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

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

Issue 525393002: Clean up code duplication of isAtShadowBoundary() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/dom/Element.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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor () : 1); 519 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor () : 1);
520 documentStyle->setLocale(document.contentLanguage()); 520 documentStyle->setLocale(document.contentLanguage());
521 documentStyle->setZIndex(0); 521 documentStyle->setZIndex(0);
522 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL Y); 522 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL Y);
523 523
524 document.setupFontBuilder(documentStyle.get()); 524 document.setupFontBuilder(documentStyle.get());
525 525
526 return documentStyle.release(); 526 return documentStyle.release();
527 } 527 }
528 528
529 // FIXME: This is duplicated with StyleAdjuster.cpp
530 // Perhaps this should move onto ElementResolveContext or even Element?
531 static inline bool isAtShadowBoundary(const Element* element)
532 {
533 if (!element)
534 return false;
535 ContainerNode* parentNode = element->parentNode();
536 return parentNode && parentNode->isShadowRoot();
537 }
538
539 static inline void resetDirectionAndWritingModeOnDocument(Document& document) 529 static inline void resetDirectionAndWritingModeOnDocument(Document& document)
540 { 530 {
541 document.setDirectionSetOnDocumentElement(false); 531 document.setDirectionSetOnDocumentElement(false);
542 document.setWritingModeSetOnDocumentElement(false); 532 document.setWritingModeSetOnDocumentElement(false);
543 } 533 }
544 534
545 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features) 535 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features)
546 { 536 {
547 for (size_t i = 0; i < contentAttrValues.size(); ++i) 537 for (size_t i = 0; i < contentAttrValues.size(); ++i)
548 features.addContentAttr(contentAttrValues[i]); 538 features.addContentAttr(contentAttrValues[i]);
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 visitor->trace(m_uncommonAttributeRuleSet); 1593 visitor->trace(m_uncommonAttributeRuleSet);
1604 visitor->trace(m_watchedSelectorsRules); 1594 visitor->trace(m_watchedSelectorsRules);
1605 visitor->trace(m_treeBoundaryCrossingRules); 1595 visitor->trace(m_treeBoundaryCrossingRules);
1606 visitor->trace(m_styleSharingLists); 1596 visitor->trace(m_styleSharingLists);
1607 visitor->trace(m_pendingStyleSheets); 1597 visitor->trace(m_pendingStyleSheets);
1608 visitor->trace(m_document); 1598 visitor->trace(m_document);
1609 #endif 1599 #endif
1610 } 1600 }
1611 1601
1612 } // namespace blink 1602 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698