mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 460664. Reset prop inheritance should skip first-line even if the whole struct is inheriting. r+sr=dbaron
This commit is contained in:
parent
2ffaaab36b
commit
41c5ae0633
11
layout/reftests/first-line/parent-style-2-ref.html
Normal file
11
layout/reftests/first-line/parent-style-2-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
div { background: green; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>OneTwo</div>
|
||||
</body>
|
||||
</html>
|
13
layout/reftests/first-line/parent-style-2.html
Normal file
13
layout/reftests/first-line/parent-style-2.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
div { background: green; }
|
||||
div::first-line { background-color: red; }
|
||||
span.one { background: inherit; }
|
||||
span.two { background-color: inherit; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div><span class="one">One</span><span class="two">Two</span></div>
|
||||
</body>
|
11
layout/reftests/first-line/parent-style-3-ref.html
Normal file
11
layout/reftests/first-line/parent-style-3-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
div { background: green; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div><p>OneTwo</p></div>
|
||||
</body>
|
||||
</html>
|
14
layout/reftests/first-line/parent-style-3.html
Normal file
14
layout/reftests/first-line/parent-style-3.html
Normal file
@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
div { background: green; }
|
||||
div::first-line { background-color: red; }
|
||||
p::first-line { background-color: red; }
|
||||
span.one { background: inherit; }
|
||||
span.two { background-color: inherit; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div><p><span class="one">One</span><span class="two">Two</span></p></div>
|
||||
</body>
|
@ -9,6 +9,8 @@ fails == out-of-flow-1d.html out-of-flow-1-ref.html # bug 396645
|
||||
|
||||
# parent style context correct
|
||||
== parent-style-1.html parent-style-1-ref.html
|
||||
== parent-style-2.html parent-style-2-ref.html
|
||||
== parent-style-3.html parent-style-3-ref.html
|
||||
|
||||
# stress-tests
|
||||
== stress-1.html about:blank # assertion test
|
||||
|
@ -1664,6 +1664,14 @@ nsRuleNode::WalkRuleTree(const nsStyleStructID aSID,
|
||||
// In the absence of any computed data in the rule tree and with
|
||||
// no rules specified that didn't have values of 'inherit', we should check our parent.
|
||||
nsStyleContext* parentContext = aContext->GetParent();
|
||||
if (isReset) {
|
||||
/* Reset structs don't inherit from first-line. */
|
||||
/* See similar code in COMPUTE_START_RESET */
|
||||
while (parentContext &&
|
||||
parentContext->GetPseudoType() == nsCSSPseudoElements::firstLine) {
|
||||
parentContext = parentContext->GetParent();
|
||||
}
|
||||
}
|
||||
if (parentContext) {
|
||||
// We have a parent, and so we should just inherit from the parent.
|
||||
// Set the inherit bits on our context. These bits tell the style context that
|
||||
@ -2036,9 +2044,10 @@ nsRuleNode::AdjustLogicalBoxProp(nsStyleContext* aContext,
|
||||
"should not have bothered calling Compute*Data"); \
|
||||
\
|
||||
nsStyleContext* parentContext = aContext->GetParent(); \
|
||||
if (parentContext && \
|
||||
parentContext->GetPseudoType() == nsCSSPseudoElements::firstLine) { \
|
||||
/* Reset structs don't inherit from first-line */ \
|
||||
/* Reset structs don't inherit from first-line */ \
|
||||
/* See similar code in WalkRuleTree */ \
|
||||
while (parentContext && \
|
||||
parentContext->GetPseudoType() == nsCSSPseudoElements::firstLine) { \
|
||||
parentContext = parentContext->GetParent(); \
|
||||
} \
|
||||
\
|
||||
|
Loading…
Reference in New Issue
Block a user