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

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

Issue 1523843004: Add support for new CSS ::slotted() pseudo element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tentative fix for crash / querySelector test Created 4 years, 11 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 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 255
256 if (rule->isStyleRule()) { 256 if (rule->isStyleRule()) {
257 StyleRule* styleRule = toStyleRule(rule); 257 StyleRule* styleRule = toStyleRule(rule);
258 258
259 const CSSSelectorList& selectorList = styleRule->selectorList(); 259 const CSSSelectorList& selectorList = styleRule->selectorList();
260 for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorI ndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) { 260 for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorI ndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
261 if (selectorList.selectorUsesDeepCombinatorOrShadowPseudo(select orIndex)) { 261 if (selectorList.selectorUsesDeepCombinatorOrShadowPseudo(select orIndex)) {
262 m_deepCombinatorOrShadowPseudoRules.append(MinimalRuleData(s tyleRule, selectorIndex, addRuleFlags)); 262 m_deepCombinatorOrShadowPseudoRules.append(MinimalRuleData(s tyleRule, selectorIndex, addRuleFlags));
263 } else if (selectorList.selectorHasShadowDistributed(selectorInd ex)) { 263 } else if (selectorList.selectorHasShadowDistributed(selectorInd ex)) {
264 m_shadowDistributedRules.append(MinimalRuleData(styleRule, s electorIndex, addRuleFlags)); 264 m_shadowDistributedRules.append(MinimalRuleData(styleRule, s electorIndex, addRuleFlags));
265 } else if (selectorList.selectorHasShadowSlotted(selectorIndex)) {
266 m_shadowSlottedRules.append(MinimalRuleData(styleRule, selec torIndex, addRuleFlags));
265 } else { 267 } else {
266 addRule(styleRule, selectorIndex, addRuleFlags); 268 addRule(styleRule, selectorIndex, addRuleFlags);
267 } 269 }
268 } 270 }
269 } else if (rule->isPageRule()) { 271 } else if (rule->isPageRule()) {
270 addPageRule(toStyleRulePage(rule)); 272 addPageRule(toStyleRulePage(rule));
271 } else if (rule->isMediaRule()) { 273 } else if (rule->isMediaRule()) {
272 StyleRuleMedia* mediaRule = toStyleRuleMedia(rule); 274 StyleRuleMedia* mediaRule = toStyleRuleMedia(rule);
273 if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueri es(), &m_viewportDependentMediaQueryResults))) 275 if ((!mediaRule->mediaQueries() || medium.eval(mediaRule->mediaQueri es(), &m_viewportDependentMediaQueryResults)))
274 addChildRules(mediaRule->childRules(), medium, addRuleFlags); 276 addChildRules(mediaRule->childRules(), medium, addRuleFlags);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 m_cuePseudoRules.shrinkToFit(); 337 m_cuePseudoRules.shrinkToFit();
336 m_focusPseudoClassRules.shrinkToFit(); 338 m_focusPseudoClassRules.shrinkToFit();
337 m_universalRules.shrinkToFit(); 339 m_universalRules.shrinkToFit();
338 m_shadowHostRules.shrinkToFit(); 340 m_shadowHostRules.shrinkToFit();
339 m_pageRules.shrinkToFit(); 341 m_pageRules.shrinkToFit();
340 m_viewportRules.shrinkToFit(); 342 m_viewportRules.shrinkToFit();
341 m_fontFaceRules.shrinkToFit(); 343 m_fontFaceRules.shrinkToFit();
342 m_keyframesRules.shrinkToFit(); 344 m_keyframesRules.shrinkToFit();
343 m_deepCombinatorOrShadowPseudoRules.shrinkToFit(); 345 m_deepCombinatorOrShadowPseudoRules.shrinkToFit();
344 m_shadowDistributedRules.shrinkToFit(); 346 m_shadowDistributedRules.shrinkToFit();
347 m_shadowSlottedRules.shrinkToFit();
345 } 348 }
346 349
347 DEFINE_TRACE(MinimalRuleData) 350 DEFINE_TRACE(MinimalRuleData)
348 { 351 {
349 visitor->trace(m_rule); 352 visitor->trace(m_rule);
350 } 353 }
351 354
352 DEFINE_TRACE(RuleData) 355 DEFINE_TRACE(RuleData)
353 { 356 {
354 visitor->trace(m_rule); 357 visitor->trace(m_rule);
(...skipping 21 matching lines...) Expand all
376 visitor->trace(m_focusPseudoClassRules); 379 visitor->trace(m_focusPseudoClassRules);
377 visitor->trace(m_universalRules); 380 visitor->trace(m_universalRules);
378 visitor->trace(m_shadowHostRules); 381 visitor->trace(m_shadowHostRules);
379 visitor->trace(m_features); 382 visitor->trace(m_features);
380 visitor->trace(m_pageRules); 383 visitor->trace(m_pageRules);
381 visitor->trace(m_viewportRules); 384 visitor->trace(m_viewportRules);
382 visitor->trace(m_fontFaceRules); 385 visitor->trace(m_fontFaceRules);
383 visitor->trace(m_keyframesRules); 386 visitor->trace(m_keyframesRules);
384 visitor->trace(m_deepCombinatorOrShadowPseudoRules); 387 visitor->trace(m_deepCombinatorOrShadowPseudoRules);
385 visitor->trace(m_shadowDistributedRules); 388 visitor->trace(m_shadowDistributedRules);
389 visitor->trace(m_shadowSlottedRules);
386 visitor->trace(m_viewportDependentMediaQueryResults); 390 visitor->trace(m_viewportDependentMediaQueryResults);
387 visitor->trace(m_pendingRules); 391 visitor->trace(m_pendingRules);
388 #ifndef NDEBUG 392 #ifndef NDEBUG
389 visitor->trace(m_allRules); 393 visitor->trace(m_allRules);
390 #endif 394 #endif
391 #endif 395 #endif
392 } 396 }
393 397
394 #ifndef NDEBUG 398 #ifndef NDEBUG
395 void RuleSet::show() const 399 void RuleSet::show() const
396 { 400 {
397 for (const auto& rule: m_allRules) 401 for (const auto& rule: m_allRules)
398 rule.selector().show(); 402 rule.selector().show();
399 } 403 }
400 #endif 404 #endif
401 405
402 } // namespace blink 406 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698