From 16ecf4feaecf347ff00efa5b6dfc4c6f01080dfb Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Sun, 20 Apr 2008 06:42:05 +0000 Subject: [PATCH] b=427122, padding on select elements ignored, r=dbaron,a=beltzner git-svn-id: svn://10.0.0.236/trunk@250510 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsPresContext.cpp | 4 +- mozilla/layout/base/nsPresContext.h | 7 ++- .../reftests/native-theme/427122-1-ref.html | 17 ++++++ .../reftests/native-theme/427122-1.html | 18 ++++++ .../layout/reftests/native-theme/reftest.list | 4 ++ mozilla/layout/style/nsRuleNode.cpp | 58 ++++++++++++++++--- mozilla/layout/style/nsRuleNode.h | 2 +- .../widget/src/windows/nsNativeThemeWin.cpp | 32 +++++++--- .../widget/src/xpwidgets/nsNativeTheme.cpp | 4 +- 9 files changed, 127 insertions(+), 19 deletions(-) create mode 100644 mozilla/layout/reftests/native-theme/427122-1-ref.html create mode 100644 mozilla/layout/reftests/native-theme/427122-1.html diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index ba3b3079bdd..acc5b9072b6 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -1499,8 +1499,8 @@ nsPresContext::IsChrome() const } /* virtual */ PRBool -nsPresContext::HasAuthorSpecifiedBorderOrBackground(nsIFrame *aFrame) const +nsPresContext::HasAuthorSpecifiedRules(nsIFrame *aFrame, PRUint32 ruleTypeMask) const { return nsRuleNode:: - HasAuthorSpecifiedBorderOrBackground(aFrame->GetStyleContext()); + HasAuthorSpecifiedRules(aFrame->GetStyleContext(), ruleTypeMask); } diff --git a/mozilla/layout/base/nsPresContext.h b/mozilla/layout/base/nsPresContext.h index 667e3f5fa17..94f7ec9d685 100644 --- a/mozilla/layout/base/nsPresContext.h +++ b/mozilla/layout/base/nsPresContext.h @@ -137,6 +137,11 @@ enum nsLayoutPhase { }; #endif +/* Used by nsPresContext::HasAuthorSpecifiedRules */ +#define NS_AUTHOR_SPECIFIED_BACKGROUND (1 << 0) +#define NS_AUTHOR_SPECIFIED_BORDER (1 << 1) +#define NS_AUTHOR_SPECIFIED_PADDING (1 << 2) + // An interface for presentation contexts. Presentation contexts are // objects that provide an outer context for a presentation shell. @@ -741,7 +746,7 @@ public: PRBool IsChrome() const; // Public API for native theme code to get style internals. - virtual PRBool HasAuthorSpecifiedBorderOrBackground(nsIFrame *aFrame) const; + virtual PRBool HasAuthorSpecifiedRules(nsIFrame *aFrame, PRUint32 ruleTypeMask) const; // Is it OK to let the page specify colors and backgrounds? PRBool UseDocumentColors() const { diff --git a/mozilla/layout/reftests/native-theme/427122-1-ref.html b/mozilla/layout/reftests/native-theme/427122-1-ref.html new file mode 100644 index 00000000000..78cad140bef --- /dev/null +++ b/mozilla/layout/reftests/native-theme/427122-1-ref.html @@ -0,0 +1,17 @@ + + +