summaryrefslogtreecommitdiffstats
path: root/layout/base/ServoRestyleManager.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-17 05:10:25 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-17 05:10:25 -0400
commit7614fdb51b177e6975fce5bf9a7facef170e61aa (patch)
tree598e187ce71ae82b300a3a6b6b2f199aa2f3c43d /layout/base/ServoRestyleManager.cpp
parent5f297c5f57583b0f9d27d714beb285919f42d655 (diff)
downloadUXP-7614fdb51b177e6975fce5bf9a7facef170e61aa.tar
UXP-7614fdb51b177e6975fce5bf9a7facef170e61aa.tar.gz
UXP-7614fdb51b177e6975fce5bf9a7facef170e61aa.tar.lz
UXP-7614fdb51b177e6975fce5bf9a7facef170e61aa.tar.xz
UXP-7614fdb51b177e6975fce5bf9a7facef170e61aa.zip
Bug 1355351 - Make pseudo-elements return the correct style via getComputedStyle
* Add a node property to access the ::before and ::after pseudo-elements * Look for the frame for ::before and ::after pseudos * Clean up pseudo-element props * Simplify nsLayoutUtils callers, and make child iterators notice display: contents pseudos Tag #1375
Diffstat (limited to 'layout/base/ServoRestyleManager.cpp')
-rw-r--r--layout/base/ServoRestyleManager.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp
index 9624c678b..0659ab857 100644
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -277,24 +277,17 @@ ServoRestyleManager::FrameForPseudoElement(const nsIContent* aContent,
nsIAtom* aPseudoTagOrNull)
{
MOZ_ASSERT_IF(aPseudoTagOrNull, aContent->IsElement());
- nsIFrame* primaryFrame = aContent->GetPrimaryFrame();
if (!aPseudoTagOrNull) {
- return primaryFrame;
- }
-
- if (!primaryFrame) {
- return nullptr;
+ return aContent->GetPrimaryFrame();
}
- // NOTE: we probably need to special-case display: contents here. Gecko's
- // RestyleManager passes the primary frame of the parent instead.
if (aPseudoTagOrNull == nsCSSPseudoElements::before) {
- return nsLayoutUtils::GetBeforeFrameForContent(primaryFrame, aContent);
+ return nsLayoutUtils::GetBeforeFrame(aContent);
}
if (aPseudoTagOrNull == nsCSSPseudoElements::after) {
- return nsLayoutUtils::GetAfterFrameForContent(primaryFrame, aContent);
+ return nsLayoutUtils::GetAfterFrame(aContent);
}
MOZ_CRASH("Unkown pseudo-element given to "