Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 4 files changed
  • 0 commit comments
  • 3 contributors
Commits on Mar 23, 2012
@amb26 amb26 FLUID-4680: Implementation of context reference for "{that}" 9f6fe9d
Commits on Mar 29, 2012
@michelled michelled Merge remote-tracking branch 'amb26/FLUID-4680'
* amb26/FLUID-4680:
  FLUID-4680: Implementation of context reference for "{that}"
b049653
Commits on Apr 03, 2012
Cindy Qi Li FLUID-4685: Fixed the issue that 1em is always applied to body elemen…
…t at page load regardless its original font size.
775c800
@michelled michelled Merge remote-tracking branch 'cindyli/FLUID-4685'
* cindyli/FLUID-4685:
  FLUID-4685: Fixed the issue that 1em is always applied to body element at page load regardless its original font size.
0155954
View
5 src/webapp/components/uiOptions/js/UIEnhancer.js
@@ -352,8 +352,9 @@ var fluid_1_5 = fluid_1_5 || {};
};
fluid.uiEnhancer.getPx2EmFactor = function (container, fontSizeMap) {
- // The base font size is the computed font size of the container's parent element unless the container itself has been a "body" tag
- if (container.get(0).tagName !== "BODY") {
+ // The base font size is the computed font size of the container's parent element unless the container itself
+ // has been the DOM root element "HTML" which is NOT detectable with this algorithm
+ if (container.get(0).tagName !== "HTML") {
container = container.parent();
}
return fluid.uiEnhancer.getTextSizeInPx(container, fontSizeMap);
View
32 src/webapp/framework/core/js/FluidIoC.js
@@ -179,36 +179,38 @@ var fluid_1_5 = fluid_1_5 || {};
var fetchStrategies = [fluid.model.funcResolverStrategy, makeGingerStrategy(instantiator, parentThat, thatStack)];
var fetcher = function(parsed) {
var context = parsed.context;
+ var foundComponent;
if (context === "instantiator") {
// special treatment for the current instantiator which used to be discovered as unique in threadLocal
return instantiator;
}
- if (localRecord && localRecordExpected.test(context)) {
+ else if (context === "that") {
+ foundComponent = parentThat;
+ }
+ else if (localRecord && localRecordExpected.test(context)) {
var fetched = fluid.get(localRecord[context], parsed.path);
return (context === "arguments" || expandOptions.direct)? fetched : {
marker: context === "options"? fluid.EXPAND : fluid.EXPAND_NOW,
value: fetched
};
}
- var foundComponent;
- visitComponents(instantiator, thatStack, function(component, name, options, up, down) {
- if (context === name || context === component.typeName || context === component.nickName) {
- foundComponent = component;
- if (down > 1) {
- fluid.log("***WARNING: value resolution for context " + context + " found at depth " + down + ": this may not be supported in future");
+ if (!foundComponent) {
+ visitComponents(instantiator, thatStack, function(component, name, options, up, down) {
+ if (context === name || context === component.typeName || context === component.nickName) {
+ foundComponent = component;
+ return true; // YOUR VISIT IS AT AN END!!
}
- return true; // YOUR VISIT IS AT AN END!!
- }
- if (fluid.get(component, fluid.path("options", "components", context, "type")) && !component[context]) {
- foundComponent = fluid.get(component, context, {strategies: fetchStrategies});
- return true;
- }
- });
+ if (fluid.get(component, fluid.path("options", "components", context, "type")) && !component[context]) {
+ foundComponent = fluid.get(component, context, {strategies: fetchStrategies});
+ return true;
+ }
+ });
+ }
if (!foundComponent && parsed.path !== "") {
var ref = fluid.renderContextReference(parsed);
fluid.log("Failed to resolve reference " + ref + ": thatStack contains\n" + fluid.dumpThatStack(thatStack, instantiator));
fluid.fail("Failed to resolve reference " + ref + " - could not match context with name "
- + context + " from component leaf of type " + thatStack[thatStack.length - 1].typeName, "\ninstantiator contents: ", instantiator);
+ + context + " from component leaf of type " + parentThat.typeName, "\ninstantiator contents: ", instantiator);
}
return fluid.get(foundComponent, parsed.path, fetchStrategies);
};
View
9 src/webapp/tests/component-tests/uiOptions/js/UIEnhancerTests.js
@@ -59,12 +59,19 @@ https://github.com/fluid-project/infusion/raw/master/Infusion-LICENSE.txt
jqUnit.assertEquals("Things are still styled with 'last-class' ", 2, $(".last-class").length);
});
- tests.test("getPx2EmFactor", function () {
+ tests.test("getPx2EmFactor & getTextSizeInEm", function () {
+ expect(2);
+
var container = $(".flt-baseFontSize-child");
var uiEnhancer = fluid.uiEnhancer(container, uiEnhancerOptions);
var px2emFactor = fluid.uiEnhancer.getPx2EmFactor(container, uiEnhancer.options.fontSizeMap);
jqUnit.assertEquals("Check that the factor is pulled from the container correctly", 8, px2emFactor);
+
+ var container = $("html");
+ var fontSizeInEm = fluid.uiEnhancer.getTextSizeInEm(container, uiEnhancer.options.fontSizeMap);
+
+ jqUnit.assertEquals("Unable to detect the text size in em for the DOM root element <html>. Always return 1em.", 1, fontSizeInEm);
});
tests.test("TextSizer", function () {
View
3  src/webapp/tests/framework-tests/core/js/FluidIoCTests.js
@@ -1234,7 +1234,8 @@ fluid.registerNamespace("fluid.tests");
events: {
outEvent1: null,
// note inconsistency - only IoC-resolved events get instantiator wrapping!
- outEvent2: "{island1}.events.outEvent1"
+ // "that" reference tests FLUID-4680
+ outEvent2: "{that}.events.outEvent1"
}
});

No commit comments for this range

Something went wrong with that request. Please try again.