mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1341083: Don't fall back to reframing with display: contents. r=heycam
MozReview-Commit-ID: KD3QBiU7M5f Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
2cbefa7db5
commit
b903e8dcf2
@ -218,7 +218,8 @@ ParentForUndisplayedMap(const nsIContent* aContent)
|
||||
}
|
||||
|
||||
/* static */ nsStyleContext*
|
||||
nsFrameManager::GetStyleContextInMap(UndisplayedMap* aMap, nsIContent* aContent)
|
||||
nsFrameManager::GetStyleContextInMap(UndisplayedMap* aMap,
|
||||
const nsIContent* aContent)
|
||||
{
|
||||
UndisplayedNode* node = GetUndisplayedNodeInMapFor(aMap, aContent);
|
||||
return node ? node->mStyle.get() : nullptr;
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
void ClearPlaceholderFrameMap();
|
||||
|
||||
// Mapping undisplayed content
|
||||
nsStyleContext* GetUndisplayedContent(nsIContent* aContent)
|
||||
nsStyleContext* GetUndisplayedContent(const nsIContent* aContent)
|
||||
{
|
||||
if (!mUndisplayedMap) {
|
||||
return nullptr;
|
||||
@ -127,7 +127,7 @@ public:
|
||||
/**
|
||||
* Return the registered display:contents style context for aContent, if any.
|
||||
*/
|
||||
nsStyleContext* GetDisplayContentsStyleFor(nsIContent* aContent)
|
||||
nsStyleContext* GetDisplayContentsStyleFor(const nsIContent* aContent)
|
||||
{
|
||||
if (!mDisplayContentsMap) {
|
||||
return nullptr;
|
||||
@ -220,7 +220,7 @@ public:
|
||||
nsILayoutHistoryState* aState);
|
||||
protected:
|
||||
static nsStyleContext* GetStyleContextInMap(UndisplayedMap* aMap,
|
||||
nsIContent* aContent);
|
||||
const nsIContent* aContent);
|
||||
static mozilla::UndisplayedNode*
|
||||
GetUndisplayedNodeInMapFor(UndisplayedMap* aMap,
|
||||
const nsIContent* aContent);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "ChildIterator.h"
|
||||
#include "gfxFontFamilyList.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsCSSPseudoElements.h"
|
||||
@ -279,11 +280,21 @@ Gecko_GetStyleContext(RawGeckoNodeBorrowed aNode, nsIAtom* aPseudoTagOrNull)
|
||||
nsIFrame* relevantFrame =
|
||||
ServoRestyleManager::FrameForPseudoElement(aNode->AsContent(),
|
||||
aPseudoTagOrNull);
|
||||
if (!relevantFrame) {
|
||||
if (relevantFrame) {
|
||||
return relevantFrame->StyleContext();
|
||||
}
|
||||
|
||||
if (aPseudoTagOrNull) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return relevantFrame->StyleContext();
|
||||
// FIXME(emilio): Is there a shorter path?
|
||||
nsCSSFrameConstructor* fc =
|
||||
aNode->OwnerDoc()->GetShell()->GetPresContext()->FrameConstructor();
|
||||
|
||||
// NB: This is only called for CalcStyleDifference, and we handle correctly
|
||||
// the display: none case since Servo still has the older style.
|
||||
return fc->GetDisplayContentsStyleFor(aNode->AsContent());
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
|
Loading…
Reference in New Issue
Block a user