Bug 849407: Disable flex item style fixup for anonymous content in nsFrameManager::ReResolveStyleContext(). r=bz

This commit is contained in:
Daniel Holbert 2013-03-13 13:54:05 -07:00
parent 3eec603af5
commit b47d968bc8
5 changed files with 72 additions and 3 deletions

View File

@ -1270,6 +1270,10 @@ nsFrameManager::ReResolveStyleContext(nsPresContext *aPresContext,
else {
NS_ASSERTION(localContent,
"non pseudo-element frame without content node");
// Skip flex-item style fixup for anonymous subtrees:
TreeMatchContext::AutoFlexItemStyleFixupSkipper
flexFixupSkipper(aTreeMatchContext,
element->IsRootOfNativeAnonymousSubtree());
newContext = styleSet->ResolveStyleFor(element, parentContext,
aTreeMatchContext);
}

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
legend {
width: 200px;
height: 100px;
overflow: scroll;
border: 2px dashed gray;
}
div.child {
background: lightblue;
height: 1000px;
}
</style>
</head>
<body>
<fieldset>
<legend>
<div class="child">
There should be scrollbars making this area scrollable.
</div>
</legend>
</fieldset>
</body>
</html>

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
legend {
display: flex;
width: 200px;
height: 100px;
overflow: scroll;
border: 2px dashed gray;
}
div.child {
background: lightblue;
height: 1000px;
}
</style>
</head>
<body>
<fieldset>
<legend>
<div class="child">
There should be scrollbars making this area scrollable.
</div>
</legend>
</fieldset>
</body>
</html>

View File

@ -1748,3 +1748,4 @@ skip-if(B2G) == 818276-1.html 818276-1-ref.html
== 848421-1.html 848421-1-ref.html
== 847850-1.html 847850-1-ref.html
== 846144-1.html 846144-1-ref.html
test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html

View File

@ -243,15 +243,24 @@ struct NS_STACK_CLASS TreeMatchContext {
};
/* Helper class for tracking whether we're skipping the ApplyStyleFixups
* code for flex items. */
* code for flex items.
*
* The optional second parameter aSkipFlexItemStyleFixup allows this
* class to be instantiated but only conditionally activated (e.g.
* in cases where we may or may not want to be skipping flex-item
* style fixup for a particular chunk of code).
*/
class NS_STACK_CLASS AutoFlexItemStyleFixupSkipper {
public:
AutoFlexItemStyleFixupSkipper(TreeMatchContext& aTreeMatchContext
AutoFlexItemStyleFixupSkipper(TreeMatchContext& aTreeMatchContext,
bool aSkipFlexItemStyleFixup = true
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: mAutoRestorer(aTreeMatchContext.mSkippingFlexItemStyleFixup)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
aTreeMatchContext.mSkippingFlexItemStyleFixup = true;
if (aSkipFlexItemStyleFixup) {
aTreeMatchContext.mSkippingFlexItemStyleFixup = true;
}
}
private: