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

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

Issue 2727233005: Remove calls to styleForLayoutObject() in LayoutTreeBuilder::style() (Closed)
Patch Set: Created 3 years, 9 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) 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-2011, 2013, 2014 Apple Inc. All rights reserved. 6 * Copyright (C) 2003-2011, 2013, 2014 Apple 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 virtual void copyNonAttributePropertiesFromElement(const Element&) {} 412 virtual void copyNonAttributePropertiesFromElement(const Element&) {}
413 413
414 void attachLayoutTree(const AttachContext& = AttachContext()) override; 414 void attachLayoutTree(const AttachContext& = AttachContext()) override;
415 void detachLayoutTree(const AttachContext& = AttachContext()) override; 415 void detachLayoutTree(const AttachContext& = AttachContext()) override;
416 416
417 virtual LayoutObject* createLayoutObject(const ComputedStyle&); 417 virtual LayoutObject* createLayoutObject(const ComputedStyle&);
418 virtual bool layoutObjectIsNeeded(const ComputedStyle&); 418 virtual bool layoutObjectIsNeeded(const ComputedStyle&);
419 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = nullptr); 419 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = nullptr);
420 void rebuildLayoutTree(); 420 void rebuildLayoutTree();
421 void recalcStyleForReattach();
421 void pseudoStateChanged(CSSSelector::PseudoType); 422 void pseudoStateChanged(CSSSelector::PseudoType);
422 void setAnimationStyleChange(bool); 423 void setAnimationStyleChange(bool);
423 void clearAnimationStyleChange(); 424 void clearAnimationStyleChange();
424 void setNeedsAnimationStyleRecalc(); 425 void setNeedsAnimationStyleRecalc();
425 426
426 void setNeedsCompositingUpdate(); 427 void setNeedsCompositingUpdate();
427 428
428 bool supportsStyleSharing() const; 429 bool supportsStyleSharing() const;
429 430
430 ElementShadow* shadow() const; 431 ElementShadow* shadow() const;
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 void setTabIndexExplicitly(); 793 void setTabIndexExplicitly();
793 // Subclasses may override this method to affect focusability. This method 794 // Subclasses may override this method to affect focusability. This method
794 // must be called on an up-to-date ComputedStyle, so it may use existence of 795 // must be called on an up-to-date ComputedStyle, so it may use existence of
795 // layoutObject and the LayoutObject::style() to reason about focusability. 796 // layoutObject and the LayoutObject::style() to reason about focusability.
796 // However, it must not retrieve layout information like position and size. 797 // However, it must not retrieve layout information like position and size.
797 // This method cannot be moved to LayoutObject because some focusable nodes 798 // This method cannot be moved to LayoutObject because some focusable nodes
798 // don't have layoutObjects. e.g., HTMLOptionElement. 799 // don't have layoutObjects. e.g., HTMLOptionElement.
799 // TODO(tkent): Rename this to isFocusableStyle. 800 // TODO(tkent): Rename this to isFocusableStyle.
800 virtual bool layoutObjectIsFocusable() const; 801 virtual bool layoutObjectIsFocusable() const;
801 802
803 virtual bool childrenCanHaveStyle() const { return true; }
804
802 // classAttributeChanged() exists to share code between 805 // classAttributeChanged() exists to share code between
803 // parseAttribute (called via setAttribute()) and 806 // parseAttribute (called via setAttribute()) and
804 // svgAttributeChanged (called when element.className.baseValue is set) 807 // svgAttributeChanged (called when element.className.baseValue is set)
805 void classAttributeChanged(const AtomicString& newClassString); 808 void classAttributeChanged(const AtomicString& newClassString);
806 809
807 static bool attributeValueIsJavaScriptURL(const Attribute&); 810 static bool attributeValueIsJavaScriptURL(const Attribute&);
808 811
809 PassRefPtr<ComputedStyle> originalStyleForLayoutObject(); 812 PassRefPtr<ComputedStyle> originalStyleForLayoutObject();
810 813
811 Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&); 814 Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&);
(...skipping 30 matching lines...) Expand all
842 845
843 // If the only inherited changes in the parent element are independent, 846 // If the only inherited changes in the parent element are independent,
844 // these changes can be directly propagated to this element (the child). 847 // these changes can be directly propagated to this element (the child).
845 // If these conditions are met, propagates the changes to the current style 848 // If these conditions are met, propagates the changes to the current style
846 // and returns the new style. Otherwise, returns null. 849 // and returns the new style. Otherwise, returns null.
847 PassRefPtr<ComputedStyle> propagateInheritedProperties(StyleRecalcChange); 850 PassRefPtr<ComputedStyle> propagateInheritedProperties(StyleRecalcChange);
848 851
849 StyleRecalcChange recalcOwnStyle(StyleRecalcChange, Text*); 852 StyleRecalcChange recalcOwnStyle(StyleRecalcChange, Text*);
850 void reattachPseudoElementLayoutTree(PseudoId); 853 void reattachPseudoElementLayoutTree(PseudoId);
851 void rebuildShadowRootLayoutTree(); 854 void rebuildShadowRootLayoutTree();
855 void recalcOwnStyleForReattach();
856 void recalcContainedStyleForReattach();
857 void recalcShadowRootStylesForReattach();
852 inline void checkForEmptyStyleChange(); 858 inline void checkForEmptyStyleChange();
853 859
854 void updatePseudoElement(PseudoId, StyleRecalcChange); 860 void updatePseudoElement(PseudoId, StyleRecalcChange);
855 bool updateFirstLetter(Element*); 861 bool updateFirstLetter(Element*);
856 862
857 inline void createPseudoElementIfNeeded(PseudoId); 863 inline void createPseudoElementIfNeeded(PseudoId);
858 864
859 ShadowRoot* shadowRoot() const; 865 ShadowRoot* shadowRoot() const;
860 866
861 // FIXME: Everyone should allow author shadows. 867 // FIXME: Everyone should allow author shadows.
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1210 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1205 static T* create(const QualifiedName&, Document&) 1211 static T* create(const QualifiedName&, Document&)
1206 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1212 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1207 T* T::create(const QualifiedName& tagName, Document& document) { \ 1213 T* T::create(const QualifiedName& tagName, Document& document) { \
1208 return new T(tagName, document); \ 1214 return new T(tagName, document); \
1209 } 1215 }
1210 1216
1211 } // namespace blink 1217 } // namespace blink
1212 1218
1213 #endif // Element_h 1219 #endif // Element_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698