Bug 997709 part 2 - Prevent the nsComboboxDisplayFrame from being blockified if the parent context has display:flex/grid. r=heycam

This commit is contained in:
Mats Palmgren 2015-05-27 22:18:36 +00:00
parent 04a33bdbc3
commit 5a2a4f8f08
3 changed files with 27 additions and 22 deletions

View File

@ -1325,7 +1325,8 @@ nsComboboxControlFrame::CreateFrameFor(nsIContent* aContent)
nsRefPtr<nsStyleContext> styleContext;
styleContext = styleSet->
ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozDisplayComboboxControlFrame,
mStyleContext);
mStyleContext,
nsStyleSet::eSkipParentDisplayBasedStyleFixup);
nsRefPtr<nsStyleContext> textStyleContext;
textStyleContext = styleSet->ResolveStyleForNonElement(mStyleContext);

View File

@ -1834,7 +1834,8 @@ nsStyleSet::ProbePseudoElementStyle(Element* aParentElement,
already_AddRefed<nsStyleContext>
nsStyleSet::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
nsStyleContext* aParentContext)
nsStyleContext* aParentContext,
uint32_t aFlags)
{
NS_ENSURE_FALSE(mInShutdown, nullptr);
@ -1871,7 +1872,7 @@ nsStyleSet::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
return GetContext(aParentContext, ruleWalker.CurrentNode(), nullptr,
aPseudoTag, nsCSSPseudoElements::ePseudo_AnonBox,
nullptr, eNoFlags);
nullptr, aFlags);
}
#ifdef MOZ_XUL

View File

@ -192,10 +192,30 @@ class nsStyleSet
TreeMatchContext& aTreeMatchContext,
mozilla::dom::Element* aPseudoElement = nullptr);
/**
* Bit-flags that can be passed to ResolveAnonymousBoxStyle and GetContext
* in their parameter 'aFlags'.
*/
enum {
eNoFlags = 0,
eIsLink = 1 << 0,
eIsVisitedLink = 1 << 1,
eDoAnimation = 1 << 2,
// Indicates that we should skip the flex/grid item specific chunk of
// ApplyStyleFixups(). This is useful if our parent has "display: flex"
// or "display: grid" but we can tell we're not going to honor that (e.g. if
// it's the outer frame of a button widget, and we're the inline frame for
// the button's label).
eSkipParentDisplayBasedStyleFixup = 1 << 3
};
// Get a style context for an anonymous box. aPseudoTag is the
// pseudo-tag to use and must be non-null.
// pseudo-tag to use and must be non-null. aFlags will be forwarded
// to a GetContext call internally.
already_AddRefed<nsStyleContext>
ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag, nsStyleContext* aParentContext);
ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag, nsStyleContext* aParentContext,
uint32_t aFlags = eNoFlags);
#ifdef MOZ_XUL
// Get a style context for a XUL tree pseudo. aPseudoTag is the
@ -433,23 +453,6 @@ class nsStyleSet
nsCSSPseudoElements::Type aPseudoType,
nsRestyleHint aReplacements);
/**
* Bit-flags that can be passed to GetContext() in its parameter 'aFlags'.
*/
enum {
eNoFlags = 0,
eIsLink = 1 << 0,
eIsVisitedLink = 1 << 1,
eDoAnimation = 1 << 2,
// Indicates that we should skip the flex/grid item specific chunk of
// ApplyStyleFixups(). This is useful if our parent has "display: flex"
// or "display: grid" but we can tell we're not going to honor that (e.g. if
// it's the outer frame of a button widget, and we're the inline frame for
// the button's label).
eSkipParentDisplayBasedStyleFixup = 1 << 3
};
already_AddRefed<nsStyleContext>
GetContext(nsStyleContext* aParentContext,
nsRuleNode* aRuleNode,