mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
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
This commit is contained in:
parent
6b48075b57
commit
d3ffda520f
16 changed files with 188 additions and 241 deletions
|
|
@ -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;
|
||||
return aContent->GetPrimaryFrame();
|
||||
}
|
||||
|
||||
if (!primaryFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// 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 "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue