Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 2842263004: Fix assignedNodes({flatten:true}) to return fallback content in document tree (Closed)
Patch Set: Rename GetDistributedNodes to GetDistributedNodesExcludingFallback Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 const HeapHashSet<Member<RuleSet>>& rule_sets) { 864 const HeapHashSet<Member<RuleSet>>& rule_sets) {
865 InvalidationLists invalidation_lists; 865 InvalidationLists invalidation_lists;
866 for (const auto& rule_set : rule_sets) 866 for (const auto& rule_set : rule_sets)
867 rule_set->Features().CollectTypeRuleInvalidationSet(invalidation_lists, 867 rule_set->Features().CollectTypeRuleInvalidationSet(invalidation_lists,
868 node); 868 node);
869 DCHECK(invalidation_lists.siblings.IsEmpty()); 869 DCHECK(invalidation_lists.siblings.IsEmpty());
870 style_invalidator_.ScheduleInvalidationSetsForNode(invalidation_lists, node); 870 style_invalidator_.ScheduleInvalidationSetsForNode(invalidation_lists, node);
871 } 871 }
872 872
873 void StyleEngine::InvalidateSlottedElements(HTMLSlotElement& slot) { 873 void StyleEngine::InvalidateSlottedElements(HTMLSlotElement& slot) {
874 for (auto& node : slot.GetDistributedNodes()) { 874 for (auto& node : slot.GetDistributedNodesExcludingFallback()) {
hayato 2017/05/18 06:58:25 Is this correct? Why doesn't this need to invalida
kochi 2017/05/18 07:21:49 If this is not correct, I'll file another bug. Thi
875 if (node->IsElementNode()) 875 if (node->IsElementNode())
876 node->SetNeedsStyleRecalc(kLocalStyleChange, 876 node->SetNeedsStyleRecalc(kLocalStyleChange,
877 StyleChangeReasonForTracing::Create( 877 StyleChangeReasonForTracing::Create(
878 StyleChangeReason::kStyleSheetChange)); 878 StyleChangeReason::kStyleSheetChange));
879 } 879 }
880 } 880 }
881 881
882 void StyleEngine::ScheduleInvalidationsForRuleSets( 882 void StyleEngine::ScheduleInvalidationsForRuleSets(
883 TreeScope& tree_scope, 883 TreeScope& tree_scope,
884 const HeapHashSet<Member<RuleSet>>& rule_sets) { 884 const HeapHashSet<Member<RuleSet>>& rule_sets) {
(...skipping 20 matching lines...) Expand all
905 invalidate_slotted = true; 905 invalidate_slotted = true;
906 break; 906 break;
907 } 907 }
908 } 908 }
909 } 909 }
910 910
911 Node* stay_within = &tree_scope.RootNode(); 911 Node* stay_within = &tree_scope.RootNode();
912 Element* element = ElementTraversal::FirstChild(*stay_within); 912 Element* element = ElementTraversal::FirstChild(*stay_within);
913 while (element) { 913 while (element) {
914 ScheduleRuleSetInvalidationsForElement(*element, rule_sets); 914 ScheduleRuleSetInvalidationsForElement(*element, rule_sets);
915 if (invalidate_slotted && isHTMLSlotElement(element)) 915 if (invalidate_slotted && isHTMLSlotElement(element) &&
916 toHTMLSlotElement(element)->SupportsDistribution())
916 InvalidateSlottedElements(toHTMLSlotElement(*element)); 917 InvalidateSlottedElements(toHTMLSlotElement(*element));
917 918
918 if (element->GetStyleChangeType() < kSubtreeStyleChange) 919 if (element->GetStyleChangeType() < kSubtreeStyleChange)
919 element = ElementTraversal::Next(*element, stay_within); 920 element = ElementTraversal::Next(*element, stay_within);
920 else 921 else
921 element = ElementTraversal::NextSkippingChildren(*element, stay_within); 922 element = ElementTraversal::NextSkippingChildren(*element, stay_within);
922 } 923 }
923 } 924 }
924 925
925 void StyleEngine::SetStatsEnabled(bool enabled) { 926 void StyleEngine::SetStatsEnabled(bool enabled) {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 } 1202 }
1202 1203
1203 DEFINE_TRACE_WRAPPERS(StyleEngine) { 1204 DEFINE_TRACE_WRAPPERS(StyleEngine) {
1204 for (auto sheet : injected_author_style_sheets_) { 1205 for (auto sheet : injected_author_style_sheets_) {
1205 visitor->TraceWrappers(sheet); 1206 visitor->TraceWrappers(sheet);
1206 } 1207 }
1207 visitor->TraceWrappers(document_style_sheet_collection_); 1208 visitor->TraceWrappers(document_style_sheet_collection_);
1208 } 1209 }
1209 1210
1210 } // namespace blink 1211 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698