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

Side by Side Diff: Source/core/dom/Element.h

Issue 59463007: Have Element::ensureUserAgentShadowRoot() return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add extra assertion Created 7 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 | « no previous file | Source/core/dom/Element.cpp » ('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) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl e Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 ElementShadow* shadow() const; 307 ElementShadow* shadow() const;
308 ElementShadow& ensureShadow(); 308 ElementShadow& ensureShadow();
309 PassRefPtr<ShadowRoot> createShadowRoot(ExceptionState&); 309 PassRefPtr<ShadowRoot> createShadowRoot(ExceptionState&);
310 ShadowRoot* shadowRoot() const; 310 ShadowRoot* shadowRoot() const;
311 ShadowRoot* youngestShadowRoot() const; 311 ShadowRoot* youngestShadowRoot() const;
312 312
313 bool hasAuthorShadowRoot() const { return shadowRoot(); } 313 bool hasAuthorShadowRoot() const { return shadowRoot(); }
314 virtual void didAddShadowRoot(ShadowRoot&); 314 virtual void didAddShadowRoot(ShadowRoot&);
315 ShadowRoot* userAgentShadowRoot() const; 315 ShadowRoot* userAgentShadowRoot() const;
316 ShadowRoot* ensureUserAgentShadowRoot(); 316 ShadowRoot& ensureUserAgentShadowRoot();
317 const AtomicString& shadowPseudoId() const; 317 const AtomicString& shadowPseudoId() const;
318 318
319 RenderStyle* computedStyle(PseudoId = NOPSEUDO); 319 RenderStyle* computedStyle(PseudoId = NOPSEUDO);
320 320
321 // Methods for indicating the style is affected by dynamic updates (e.g., ch ildren changing, our position changing in our sibling list, etc.) 321 // Methods for indicating the style is affected by dynamic updates (e.g., ch ildren changing, our position changing in our sibling list, etc.)
322 bool styleAffectedByEmpty() const { return hasRareData() && rareDataStyleAff ectedByEmpty(); } 322 bool styleAffectedByEmpty() const { return hasRareData() && rareDataStyleAff ectedByEmpty(); }
323 bool childrenAffectedByFocus() const { return hasRareData() && rareDataChild renAffectedByFocus(); } 323 bool childrenAffectedByFocus() const { return hasRareData() && rareDataChild renAffectedByFocus(); }
324 bool childrenAffectedByHover() const { return hasRareData() && rareDataChild renAffectedByHover(); } 324 bool childrenAffectedByHover() const { return hasRareData() && rareDataChild renAffectedByHover(); }
325 bool childrenAffectedByActive() const { return hasRareData() && rareDataChil drenAffectedByActive(); } 325 bool childrenAffectedByActive() const { return hasRareData() && rareDataChil drenAffectedByActive(); }
326 bool childrenAffectedByDrag() const { return hasRareData() && rareDataChildr enAffectedByDrag(); } 326 bool childrenAffectedByDrag() const { return hasRareData() && rareDataChildr enAffectedByDrag(); }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 void checkForChildrenAdjacentRuleChanges(); 571 void checkForChildrenAdjacentRuleChanges();
572 572
573 void updatePseudoElement(PseudoId, StyleRecalcChange); 573 void updatePseudoElement(PseudoId, StyleRecalcChange);
574 574
575 inline void createPseudoElementIfNeeded(PseudoId); 575 inline void createPseudoElementIfNeeded(PseudoId);
576 inline bool needsPseudoElement(PseudoId) const; 576 inline bool needsPseudoElement(PseudoId) const;
577 void createPseudoElement(PseudoId); 577 void createPseudoElement(PseudoId);
578 578
579 // FIXME: Everyone should allow author shadows. 579 // FIXME: Everyone should allow author shadows.
580 virtual bool areAuthorShadowsAllowed() const { return true; } 580 virtual bool areAuthorShadowsAllowed() const { return true; }
581 virtual void didAddUserAgentShadowRoot(ShadowRoot*) { } 581 virtual void didAddUserAgentShadowRoot(ShadowRoot&) { }
582 virtual bool alwaysCreateUserAgentShadowRoot() const { return false; } 582 virtual bool alwaysCreateUserAgentShadowRoot() const { return false; }
583 583
584 // FIXME: Remove the need for Attr to call willModifyAttribute/didModifyAttr ibute. 584 // FIXME: Remove the need for Attr to call willModifyAttribute/didModifyAttr ibute.
585 friend class Attr; 585 friend class Attr;
586 586
587 enum SynchronizationOfLazyAttribute { NotInSynchronizationOfLazyAttribute = 0, InSynchronizationOfLazyAttribute }; 587 enum SynchronizationOfLazyAttribute { NotInSynchronizationOfLazyAttribute = 0, InSynchronizationOfLazyAttribute };
588 588
589 void didAddAttribute(const QualifiedName&, const AtomicString&); 589 void didAddAttribute(const QualifiedName&, const AtomicString&);
590 void willModifyAttribute(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue); 590 void willModifyAttribute(const QualifiedName&, const AtomicString& oldValue, const AtomicString& newValue);
591 void didModifyAttribute(const QualifiedName&, const AtomicString&); 591 void didModifyAttribute(const QualifiedName&, const AtomicString&);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 867 }
868 868
869 inline bool isShadowHost(const Element* element) 869 inline bool isShadowHost(const Element* element)
870 { 870 {
871 return element && element->shadow(); 871 return element && element->shadow();
872 } 872 }
873 873
874 } // namespace 874 } // namespace
875 875
876 #endif 876 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698