Bug 1216747 - Record dependency on writing mode in nsRuleNode::ComputeStylePosition. r=heycam

Without the patch, both reftests fail; with it, both pass.
This commit is contained in:
L. David Baron 2015-10-20 22:52:57 -07:00
parent c34a81df88
commit 07f0bbe1de
5 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,3 @@
<!DOCTYPE HTML>
<div>This should have min-content width (i.e., many line breaks).</div>

View File

@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<style>
div {
width: -moz-min-content;
}
</style>
<div>This should have min-content width (i.e., many line breaks).</div>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<style>
div {
width: -moz-min-content;
}
</style>
<!-- If you delete this div, the bug goes away, because we don't cache
vertical-specific data in the rule tree. -->
<div style="writing-mode: vertical-rl"></div>
<div>This should have min-content width (i.e., many line breaks).</div>

View File

@ -163,6 +163,9 @@ fuzzy-if(gtkWidget||B2G,255,6) fuzzy-if(cocoaWidget,65,69) == 1193519-sideways-l
== 1196887-1-computed-display-inline-block.html 1196887-1-computed-display-inline-block-ref.html
== 1205787-legacy-svg-values-1.html 1205787-legacy-svg-values-1-ref.html
== 1216747-1.html 1216747-1-ref.html
!= 1216747-1.html 1216747-1-notref.html
# Suite of tests from Gérard Talbot in bug 1079151
include abspos/reftest.list

View File

@ -7706,7 +7706,8 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
// that case.
bool vertical;
switch (aContext->StyleVisibility()->mWritingMode) {
uint8_t writingMode = aContext->StyleVisibility()->mWritingMode;
switch (writingMode) {
default:
MOZ_ASSERT(false, "unexpected writing-mode value");
// fall through
@ -7722,6 +7723,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
}
const nsCSSValue* width = aRuleData->ValueForWidth();
if (width->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(width->GetUnit() == eCSSUnit_Enumerated && vertical ?
nsCSSValue(eCSSUnit_Unset) : *width,
pos->mWidth, parentPos->mWidth,
@ -7730,6 +7734,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
aContext, mPresContext, conditions);
const nsCSSValue* minWidth = aRuleData->ValueForMinWidth();
if (minWidth->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(minWidth->GetUnit() == eCSSUnit_Enumerated && vertical ?
nsCSSValue(eCSSUnit_Unset) : *minWidth,
pos->mMinWidth, parentPos->mMinWidth,
@ -7738,6 +7745,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
aContext, mPresContext, conditions);
const nsCSSValue* maxWidth = aRuleData->ValueForMaxWidth();
if (maxWidth->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(maxWidth->GetUnit() == eCSSUnit_Enumerated && vertical ?
nsCSSValue(eCSSUnit_Unset) : *maxWidth,
pos->mMaxWidth, parentPos->mMaxWidth,
@ -7746,6 +7756,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
aContext, mPresContext, conditions);
const nsCSSValue* height = aRuleData->ValueForHeight();
if (height->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(height->GetUnit() == eCSSUnit_Enumerated && !vertical ?
nsCSSValue(eCSSUnit_Unset) : *height,
pos->mHeight, parentPos->mHeight,
@ -7754,6 +7767,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
aContext, mPresContext, conditions);
const nsCSSValue* minHeight = aRuleData->ValueForMinHeight();
if (minHeight->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(minHeight->GetUnit() == eCSSUnit_Enumerated && !vertical ?
nsCSSValue(eCSSUnit_Unset) : *minHeight,
pos->mMinHeight, parentPos->mMinHeight,
@ -7762,6 +7778,9 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
aContext, mPresContext, conditions);
const nsCSSValue* maxHeight = aRuleData->ValueForMaxHeight();
if (maxHeight->GetUnit() == eCSSUnit_Enumerated) {
conditions.SetWritingModeDependency(writingMode);
}
SetCoord(maxHeight->GetUnit() == eCSSUnit_Enumerated && !vertical ?
nsCSSValue(eCSSUnit_Unset) : *maxHeight,
pos->mMaxHeight, parentPos->mMaxHeight,