mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 858937 patch 1: Add nsLayoutUtils::GetStyleFrame() variant taking nsIContent*, and use it for two existing users of the variant taking nsIFrame*. r=nrc
This commit is contained in:
parent
ba969e9990
commit
60056772e7
@ -8907,8 +8907,7 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
|
||||
// our content
|
||||
nsIContent* content = fixed->GetContent();
|
||||
nsStyleContext* styleContext =
|
||||
nsLayoutUtils::GetStyleFrame(content->GetPrimaryFrame())->
|
||||
StyleContext();
|
||||
nsLayoutUtils::GetStyleFrame(content)->StyleContext();
|
||||
FrameConstructionItemList items;
|
||||
AddFrameConstructionItemsInternal(state, content, canvasFrame,
|
||||
content->Tag(),
|
||||
|
@ -713,6 +713,17 @@ nsLayoutUtils::GetStyleFrame(nsIFrame* aFrame)
|
||||
return aFrame;
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetStyleFrame(const nsIContent* aContent)
|
||||
{
|
||||
nsIFrame *frame = aContent->GetPrimaryFrame();
|
||||
if (!frame) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return nsLayoutUtils::GetStyleFrame(frame);
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsLayoutUtils::GetFloatFromPlaceholder(nsIFrame* aFrame) {
|
||||
NS_ASSERTION(nsGkAtoms::placeholderFrame == aFrame->GetType(),
|
||||
|
@ -145,6 +145,14 @@ public:
|
||||
*/
|
||||
static nsIFrame* GetStyleFrame(nsIFrame* aPrimaryFrame);
|
||||
|
||||
/**
|
||||
* Given a content node,
|
||||
* return the frame that has the non-psuedoelement style context for
|
||||
* the content. May return null.
|
||||
* This is aContent->GetPrimaryFrame() except for tableOuter frames.
|
||||
*/
|
||||
static nsIFrame* GetStyleFrame(const nsIContent* aContent);
|
||||
|
||||
/**
|
||||
* IsGeneratedContentFor returns true if aFrame is the outermost
|
||||
* frame for generated content of type aPseudoElement for aContent.
|
||||
|
@ -307,10 +307,9 @@ nsComputedDOMStyle::GetStyleContextForElementNoFlush(Element* aElement,
|
||||
}
|
||||
|
||||
if (!aPseudo && aStyleType == eAll) {
|
||||
nsIFrame* frame = aElement->GetPrimaryFrame();
|
||||
nsIFrame* frame = nsLayoutUtils::GetStyleFrame(aElement);
|
||||
if (frame) {
|
||||
nsStyleContext* result =
|
||||
nsLayoutUtils::GetStyleFrame(frame)->StyleContext();
|
||||
nsStyleContext* result = frame->StyleContext();
|
||||
// Don't use the style context if it was influenced by
|
||||
// pseudo-elements, since then it's not the primary style
|
||||
// for this element.
|
||||
|
Loading…
Reference in New Issue
Block a user