mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix bug 345609. r+sr+a=roc
This commit is contained in:
parent
ea85dbdbbb
commit
d6ddf5aec3
@ -1098,6 +1098,13 @@ public:
|
||||
nsIURI *aLinkURI, const nsString& aTargetSpec,
|
||||
PRBool aClick, PRBool aIsUserTriggered);
|
||||
|
||||
/**
|
||||
* Return true if aContent or one of its ancestors in the
|
||||
* bindingParent chain is native anonymous.
|
||||
*/
|
||||
static PRBool IsNativeAnonymous(nsIContent* aContent);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
static PRBool InitializeEventTable();
|
||||
|
@ -3685,3 +3685,23 @@ nsContentUtils::TriggerLink(nsIContent *aContent, nsPresContext *aPresContext,
|
||||
handler->OnLinkClick(aContent, aLinkURI, aTargetSpec.get());
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsContentUtils::IsNativeAnonymous(nsIContent* aContent)
|
||||
{
|
||||
while (aContent) {
|
||||
nsIContent* bindingParent = aContent->GetBindingParent();
|
||||
if (bindingParent == aContent) {
|
||||
NS_ASSERTION(bindingParent->IsNativeAnonymous() ||
|
||||
bindingParent->IsNodeOfType(nsINode::eXUL),
|
||||
"Bogus binding parent?");
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
NS_ASSERTION(!aContent->IsNativeAnonymous(),
|
||||
"Native anonymous node with wrong binding parent");
|
||||
aContent = bindingParent;
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsContentUtils.h"
|
||||
|
||||
nsIURI *nsStyleSet::gQuirkURI = 0;
|
||||
|
||||
@ -508,7 +509,7 @@ nsStyleSet::FileRules(nsIStyleRuleProcessor::EnumFunc aCollectorFunc,
|
||||
nsRuleNode* lastPresHintRN = mRuleWalker->GetCurrentNode();
|
||||
|
||||
mRuleWalker->SetLevel(eUserSheet, PR_FALSE);
|
||||
PRBool skipUserStyles = IsNativeAnonymous(aData->mContent);
|
||||
PRBool skipUserStyles = nsContentUtils::IsNativeAnonymous(aData->mContent);
|
||||
if (!skipUserStyles && mRuleProcessors[eUserSheet]) // NOTE: different
|
||||
(*aCollectorFunc)(mRuleProcessors[eUserSheet], aData);
|
||||
nsRuleNode* lastUserRN = mRuleWalker->GetCurrentNode();
|
||||
@ -572,7 +573,7 @@ nsStyleSet::WalkRuleProcessors(nsIStyleRuleProcessor::EnumFunc aFunc,
|
||||
if (mRuleProcessors[ePresHintSheet])
|
||||
(*aFunc)(mRuleProcessors[ePresHintSheet], aData);
|
||||
|
||||
PRBool skipUserStyles = IsNativeAnonymous(aData->mContent);
|
||||
PRBool skipUserStyles = nsContentUtils::IsNativeAnonymous(aData->mContent);
|
||||
if (!skipUserStyles && mRuleProcessors[eUserSheet]) // NOTE: different
|
||||
(*aFunc)(mRuleProcessors[eUserSheet], aData);
|
||||
|
||||
@ -1004,20 +1005,3 @@ nsStyleSet::HasAttributeDependentStyle(nsPresContext* aPresContext,
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsStyleSet::IsNativeAnonymous(nsIContent* aContent)
|
||||
{
|
||||
while (aContent) {
|
||||
nsIContent* bindingParent = aContent->GetBindingParent();
|
||||
if (bindingParent == aContent) {
|
||||
NS_ASSERTION(bindingParent->IsNativeAnonymous() ||
|
||||
bindingParent->IsNodeOfType(nsINode::eXUL),
|
||||
"Bogus binding parent?");
|
||||
return PR_TRUE;
|
||||
}
|
||||
aContent = bindingParent;
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
@ -245,10 +245,6 @@ class nsStyleSet
|
||||
|
||||
nsPresContext* PresContext() { return mRuleTree->GetPresContext(); }
|
||||
|
||||
// Return true if aContent or one of its ancestors in the
|
||||
// bindingParent chain is native anonymous.
|
||||
static PRBool IsNativeAnonymous(nsIContent* aContent);
|
||||
|
||||
static nsIURI *gQuirkURI;
|
||||
|
||||
// The sheets in each array in mSheets are stored with the most significant
|
||||
|
@ -607,6 +607,13 @@ nsBoxFrame::DidReflow(nsPresContext* aPresContext,
|
||||
return rv;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsBoxFrame::HonorPrintBackgroundSettings()
|
||||
{
|
||||
return (!mContent || !nsContentUtils::IsNativeAnonymous(mContent)) &&
|
||||
nsContainerFrame::HonorPrintBackgroundSettings();
|
||||
}
|
||||
|
||||
#ifdef DO_NOISY_REFLOW
|
||||
static int myCounter = 0;
|
||||
static void printSize(char * aDesc, nscoord aSize)
|
||||
|
@ -159,6 +159,8 @@ public:
|
||||
const nsHTMLReflowState* aReflowState,
|
||||
nsDidReflowStatus aStatus);
|
||||
|
||||
virtual PRBool HonorPrintBackgroundSettings();
|
||||
|
||||
virtual ~nsBoxFrame();
|
||||
|
||||
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = nsnull, nsIBoxLayout* aLayoutManager = nsnull);
|
||||
|
Loading…
Reference in New Issue
Block a user