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

Side by Side Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 712173002: Remove StyleInvalidator machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/css/invalidation/StyleInvalidator.cpp ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 documentStyle->setRTLOrdering(LogicalOrder); 385 documentStyle->setRTLOrdering(LogicalOrder);
386 documentStyle->setLocale(document.contentLanguage()); 386 documentStyle->setLocale(document.contentLanguage());
387 documentStyle->setZIndex(0); 387 documentStyle->setZIndex(0);
388 documentStyle->setUserModify(READ_ONLY); 388 documentStyle->setUserModify(READ_ONLY);
389 389
390 document.setupFontBuilder(documentStyle.get()); 390 document.setupFontBuilder(documentStyle.get());
391 391
392 return documentStyle.release(); 392 return documentStyle.release();
393 } 393 }
394 394
395 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features)
396 {
397 for (size_t i = 0; i < contentAttrValues.size(); ++i)
398 features.addContentAttr(contentAttrValues[i]);
399 }
400
401 // Start loading resources referenced by this style. 395 // Start loading resources referenced by this style.
402 void StyleResolver::loadPendingResources(StyleResolverState& state) 396 void StyleResolver::loadPendingResources(StyleResolverState& state)
403 { 397 {
404 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 398 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
405 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts(); 399 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts();
406 } 400 }
407 401
408 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior, 402 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior,
409 RuleMatchingBehavior matchingBehavior) 403 RuleMatchingBehavior matchingBehavior)
410 { 404 {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 449 }
456 450
457 state.fontBuilder().initForStyleResolve(state.document(), state.style()); 451 state.fontBuilder().initForStyleResolve(state.document(), state.style());
458 452
459 { 453 {
460 ElementRuleCollector collector(state.elementContext(), state.style()); 454 ElementRuleCollector collector(state.elementContext(), state.style());
461 455
462 matchAllRules(state, collector, matchingBehavior != MatchAllRulesExcludi ngSMIL); 456 matchAllRules(state, collector, matchingBehavior != MatchAllRulesExcludi ngSMIL);
463 457
464 applyMatchedProperties(state, collector.matchedResult()); 458 applyMatchedProperties(state, collector.matchedResult());
465
466 addContentAttrValuesToFeatures(state.contentAttrValues(), m_features);
467 } 459 }
468 460
469 // Cache our original display. 461 // Cache our original display.
470 state.style()->setOriginalDisplay(state.style()->display()); 462 state.style()->setOriginalDisplay(state.style()->display());
471 463
472 StyleAdjuster adjuster; 464 StyleAdjuster adjuster;
473 adjuster.adjustRenderStyle(state.style(), state.parentStyle(), *element); 465 adjuster.adjustRenderStyle(state.style(), state.parentStyle(), *element);
474 466
475 // FIXME: The CSSWG wants to specify that the effects of animations are appl ied before 467 // FIXME: The CSSWG wants to specify that the effects of animations are appl ied before
476 // important rules, but this currently happens here as we require adjustment to have happened 468 // important rules, but this currently happens here as we require adjustment to have happened
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 visitor->trace(m_viewportDependentMediaQueryResults); 991 visitor->trace(m_viewportDependentMediaQueryResults);
1000 visitor->trace(m_features); 992 visitor->trace(m_features);
1001 visitor->trace(m_attributeRuleSet); 993 visitor->trace(m_attributeRuleSet);
1002 visitor->trace(m_styleSharingLists); 994 visitor->trace(m_styleSharingLists);
1003 visitor->trace(m_pendingStyleSheets); 995 visitor->trace(m_pendingStyleSheets);
1004 visitor->trace(m_document); 996 visitor->trace(m_document);
1005 #endif 997 #endif
1006 } 998 }
1007 999
1008 } // namespace blink 1000 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/css/invalidation/StyleInvalidator.cpp ('k') | sky/engine/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698