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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2789363002: Styling slot fallback content with ::slotted()
Patch Set: rebase Created 3 years, 8 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) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 7 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 8 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 resolver->CollectMatchingShadowHostRules(collector); 260 resolver->CollectMatchingShadowHostRules(collector);
261 collector.SortAndTransferMatchedRules(); 261 collector.SortAndTransferMatchedRules();
262 collector.FinishAddingAuthorRulesForTreeScope(); 262 collector.FinishAddingAuthorRulesForTreeScope();
263 } 263 }
264 } 264 }
265 } 265 }
266 266
267 static void MatchSlottedRules(const Element& element, 267 static void MatchSlottedRules(const Element& element,
268 ElementRuleCollector& collector) { 268 ElementRuleCollector& collector) {
269 HTMLSlotElement* slot = element.AssignedSlot(); 269 HTMLSlotElement* slot = element.AssignedSlot();
270 if (!slot) 270 if (!slot) {
271 return; 271 slot = HTMLSlotElement::FindFallbackSlotElementFor(element);
272 if (!slot)
273 return;
274 }
272 275
273 HeapVector<Member<ScopedStyleResolver>> resolvers; 276 HeapVector<Member<ScopedStyleResolver>> resolvers;
274 for (; slot; slot = slot->AssignedSlot()) { 277 for (; slot; slot = slot->AssignedSlot()) {
275 if (ScopedStyleResolver* resolver = 278 if (ScopedStyleResolver* resolver =
276 slot->GetTreeScope().GetScopedStyleResolver()) 279 slot->GetTreeScope().GetScopedStyleResolver())
277 resolvers.push_back(resolver); 280 resolvers.push_back(resolver);
278 } 281 }
279 for (auto it = resolvers.rbegin(); it != resolvers.rend(); ++it) { 282 for (auto it = resolvers.rbegin(); it != resolvers.rend(); ++it) {
280 collector.ClearMatchedRules(); 283 collector.ClearMatchedRules();
281 (*it)->CollectMatchingTreeBoundaryCrossingRules(collector); 284 (*it)->CollectMatchingTreeBoundaryCrossingRules(collector);
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 2020
2018 DEFINE_TRACE(StyleResolver) { 2021 DEFINE_TRACE(StyleResolver) {
2019 visitor->Trace(matched_properties_cache_); 2022 visitor->Trace(matched_properties_cache_);
2020 visitor->Trace(selector_filter_); 2023 visitor->Trace(selector_filter_);
2021 visitor->Trace(style_sharing_lists_); 2024 visitor->Trace(style_sharing_lists_);
2022 visitor->Trace(document_); 2025 visitor->Trace(document_);
2023 visitor->Trace(tracker_); 2026 visitor->Trace(tracker_);
2024 } 2027 }
2025 2028
2026 } // namespace blink 2029 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698