зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1296556: Don't store change hints for non-elements. r=heycam
MozReview-Commit-ID: 1pIajBpt4CT --HG-- extra : rebase_source : c91a1ddac66f4e64909220d4425c49e5605ac7a4
This commit is contained in:
Родитель
72d8d2b877
Коммит
1c69b29535
|
@ -275,27 +275,25 @@ void
|
||||||
Gecko_StoreStyleDifference(RawGeckoNode* aNode, nsChangeHint aChangeHintToStore)
|
Gecko_StoreStyleDifference(RawGeckoNode* aNode, nsChangeHint aChangeHintToStore)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_STYLO
|
#ifdef MOZ_STYLO
|
||||||
MOZ_ASSERT(aNode->IsContent());
|
MOZ_ASSERT(aNode->IsElement());
|
||||||
MOZ_ASSERT(aNode->IsDirtyForServo(),
|
MOZ_ASSERT(aNode->IsDirtyForServo(),
|
||||||
"Change hint stored in a not-dirty node");
|
"Change hint stored in a not-dirty node");
|
||||||
|
|
||||||
// For elements, we need to store the change hint in the proper style context.
|
Element* aElement = aNode->AsElement();
|
||||||
// For text nodes, we want to store the change hint in the parent element,
|
|
||||||
// since Gecko's change list only operates on Elements, and we'll fail to
|
|
||||||
// compute the change hint for the element properly because the property won't
|
|
||||||
// always be in the cache of the parent's nsStyleContext.
|
|
||||||
//
|
|
||||||
// For Gecko this is not a problem, because they access the inherited structs
|
|
||||||
// from the parent style context in order to inherit them, so they're found in
|
|
||||||
// the cache and get compared.
|
|
||||||
Element* aElement =
|
|
||||||
aNode->IsElement() ? aNode->AsElement() : aNode->GetParentElement();
|
|
||||||
|
|
||||||
nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
|
nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
|
||||||
if (!primaryFrame) {
|
if (!primaryFrame) {
|
||||||
// TODO: Pick the undisplayed content map from the frame-constructor, and
|
// If there's no primary frame, that means that either this content is
|
||||||
// stick it there. For now we're generating ReconstructFrame
|
// undisplayed (so we only need to check at the restyling phase for the
|
||||||
// unconditionally, which is suboptimal.
|
// display value on the element), or is a display: contents element.
|
||||||
|
//
|
||||||
|
// In this second case, we should store it in the frame constructor display
|
||||||
|
// contents map. Note that while this operation looks hairy, this would be
|
||||||
|
// thread-safe because the content should be there already (we'd only need
|
||||||
|
// to read the map and modify our entry).
|
||||||
|
//
|
||||||
|
// That being said, we still don't support display: contents anyway, so it's
|
||||||
|
// probably not worth it to do all the roundtrip just yet until we have a
|
||||||
|
// more concrete plan.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -541,7 +541,7 @@ public:
|
||||||
void StoreChangeHint(nsChangeHint aHint)
|
void StoreChangeHint(nsChangeHint aHint)
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!IsShared());
|
MOZ_ASSERT(!IsShared());
|
||||||
mStoredChangeHint |= aHint;
|
mStoredChangeHint = aHint;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
mConsumedChangeHint = false;
|
mConsumedChangeHint = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче