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

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

Issue 2390543002: Reflow comments in core/dom/. (Closed)
Patch Set: Reformat comments in core/dom/. Created 4 years, 2 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 DEFINE_ATTRIBUTE_EVENT_LISTENER(gotpointercapture); 134 DEFINE_ATTRIBUTE_EVENT_LISTENER(gotpointercapture);
135 DEFINE_ATTRIBUTE_EVENT_LISTENER(lostpointercapture); 135 DEFINE_ATTRIBUTE_EVENT_LISTENER(lostpointercapture);
136 DEFINE_ATTRIBUTE_EVENT_LISTENER(paste); 136 DEFINE_ATTRIBUTE_EVENT_LISTENER(paste);
137 DEFINE_ATTRIBUTE_EVENT_LISTENER(search); 137 DEFINE_ATTRIBUTE_EVENT_LISTENER(search);
138 DEFINE_ATTRIBUTE_EVENT_LISTENER(selectstart); 138 DEFINE_ATTRIBUTE_EVENT_LISTENER(selectstart);
139 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel); 139 DEFINE_ATTRIBUTE_EVENT_LISTENER(wheel);
140 140
141 bool hasAttribute(const QualifiedName&) const; 141 bool hasAttribute(const QualifiedName&) const;
142 const AtomicString& getAttribute(const QualifiedName&) const; 142 const AtomicString& getAttribute(const QualifiedName&) const;
143 143
144 // Passing nullAtom as the second parameter removes the attribute when calling either of these set methods. 144 // Passing nullAtom as the second parameter removes the attribute when calling
145 // either of these set methods.
145 void setAttribute(const QualifiedName&, const AtomicString& value); 146 void setAttribute(const QualifiedName&, const AtomicString& value);
146 void setSynchronizedLazyAttribute(const QualifiedName&, 147 void setSynchronizedLazyAttribute(const QualifiedName&,
147 const AtomicString& value); 148 const AtomicString& value);
148 149
149 void removeAttribute(const QualifiedName&); 150 void removeAttribute(const QualifiedName&);
150 151
151 // Typed getters and setters for language bindings. 152 // Typed getters and setters for language bindings.
152 int getIntegralAttribute(const QualifiedName& attributeName) const; 153 int getIntegralAttribute(const QualifiedName& attributeName) const;
153 void setIntegralAttribute(const QualifiedName& attributeName, int value); 154 void setIntegralAttribute(const QualifiedName& attributeName, int value);
154 void setUnsignedIntegralAttribute(const QualifiedName& attributeName, 155 void setUnsignedIntegralAttribute(const QualifiedName& attributeName,
155 unsigned value); 156 unsigned value);
156 double getFloatingPointAttribute( 157 double getFloatingPointAttribute(
157 const QualifiedName& attributeName, 158 const QualifiedName& attributeName,
158 double fallbackValue = std::numeric_limits<double>::quiet_NaN()) const; 159 double fallbackValue = std::numeric_limits<double>::quiet_NaN()) const;
159 void setFloatingPointAttribute(const QualifiedName& attributeName, 160 void setFloatingPointAttribute(const QualifiedName& attributeName,
160 double value); 161 double value);
161 162
162 // Call this to get the value of an attribute that is known not to be the styl e 163 // Call this to get the value of an attribute that is known not to be the
163 // attribute or one of the SVG animatable attributes. 164 // style attribute or one of the SVG animatable attributes.
164 bool fastHasAttribute(const QualifiedName&) const; 165 bool fastHasAttribute(const QualifiedName&) const;
165 const AtomicString& fastGetAttribute(const QualifiedName&) const; 166 const AtomicString& fastGetAttribute(const QualifiedName&) const;
166 #if DCHECK_IS_ON() 167 #if DCHECK_IS_ON()
167 bool fastAttributeLookupAllowed(const QualifiedName&) const; 168 bool fastAttributeLookupAllowed(const QualifiedName&) const;
168 #endif 169 #endif
169 170
170 #ifdef DUMP_NODE_STATISTICS 171 #ifdef DUMP_NODE_STATISTICS
171 bool hasNamedNodeMap() const; 172 bool hasNamedNodeMap() const;
172 #endif 173 #endif
173 bool hasAttributes() const; 174 bool hasAttributes() const;
(...skipping 19 matching lines...) Expand all
193 ExceptionState&); 194 ExceptionState&);
194 195
195 const AtomicString& getIdAttribute() const; 196 const AtomicString& getIdAttribute() const;
196 void setIdAttribute(const AtomicString&); 197 void setIdAttribute(const AtomicString&);
197 198
198 const AtomicString& getNameAttribute() const; 199 const AtomicString& getNameAttribute() const;
199 const AtomicString& getClassAttribute() const; 200 const AtomicString& getClassAttribute() const;
200 201
201 bool shouldIgnoreAttributeCase() const; 202 bool shouldIgnoreAttributeCase() const;
202 203
203 // Call this to get the value of the id attribute for style resolution purpose s. 204 // Call this to get the value of the id attribute for style resolution
204 // The value will already be lowercased if the document is in compatibility mo de, 205 // purposes. The value will already be lowercased if the document is in
205 // so this function is not suitable for non-style uses. 206 // compatibility mode, so this function is not suitable for non-style uses.
206 const AtomicString& idForStyleResolution() const; 207 const AtomicString& idForStyleResolution() const;
207 208
208 // This getter takes care of synchronizing all attributes before returning the 209 // This getter takes care of synchronizing all attributes before returning the
209 // AttributeCollection. If the Element has no attributes, an empty AttributeCo llection 210 // AttributeCollection. If the Element has no attributes, an empty
210 // will be returned. This is not a trivial getter and its return value should be cached 211 // AttributeCollection will be returned. This is not a trivial getter and its
211 // for performance. 212 // return value should be cached for performance.
212 AttributeCollection attributes() const; 213 AttributeCollection attributes() const;
213 // This variant will not update the potentially invalid attributes. To be used when not interested 214 // This variant will not update the potentially invalid attributes. To be used
214 // in style attribute or one of the SVG animation attributes. 215 // when not interested in style attribute or one of the SVG animation
216 // attributes.
215 AttributeCollection attributesWithoutUpdate() const; 217 AttributeCollection attributesWithoutUpdate() const;
216 218
217 void scrollIntoView(bool alignToTop = true); 219 void scrollIntoView(bool alignToTop = true);
218 void scrollIntoViewIfNeeded(bool centerIfNeeded = true); 220 void scrollIntoViewIfNeeded(bool centerIfNeeded = true);
219 221
220 int offsetLeft(); 222 int offsetLeft();
221 int offsetTop(); 223 int offsetTop();
222 int offsetWidth(); 224 int offsetWidth();
223 int offsetHeight(); 225 int offsetHeight();
224 226
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 bool hasTagName(const QualifiedName& tagName) const { 284 bool hasTagName(const QualifiedName& tagName) const {
283 return m_tagName.matches(tagName); 285 return m_tagName.matches(tagName);
284 } 286 }
285 bool hasTagName(const HTMLQualifiedName& tagName) const { 287 bool hasTagName(const HTMLQualifiedName& tagName) const {
286 return ContainerNode::hasTagName(tagName); 288 return ContainerNode::hasTagName(tagName);
287 } 289 }
288 bool hasTagName(const SVGQualifiedName& tagName) const { 290 bool hasTagName(const SVGQualifiedName& tagName) const {
289 return ContainerNode::hasTagName(tagName); 291 return ContainerNode::hasTagName(tagName);
290 } 292 }
291 293
292 // Should be called only by Document::createElementNS to fix up m_tagName imme diately after construction. 294 // Should be called only by Document::createElementNS to fix up m_tagName
295 // immediately after construction.
293 void setTagNameForCreateElementNS(const QualifiedName&); 296 void setTagNameForCreateElementNS(const QualifiedName&);
294 297
295 // A fast function for checking the local name against another atomic string. 298 // A fast function for checking the local name against another atomic string.
296 bool hasLocalName(const AtomicString& other) const { 299 bool hasLocalName(const AtomicString& other) const {
297 return m_tagName.localName() == other; 300 return m_tagName.localName() == other;
298 } 301 }
299 302
300 const AtomicString& localName() const { return m_tagName.localName(); } 303 const AtomicString& localName() const { return m_tagName.localName(); }
301 AtomicString localNameForSelectorMatching() const; 304 AtomicString localNameForSelectorMatching() const;
302 const AtomicString& prefix() const { return m_tagName.prefix(); } 305 const AtomicString& prefix() const { return m_tagName.prefix(); }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 virtual void parseAttribute(const QualifiedName&, 367 virtual void parseAttribute(const QualifiedName&,
365 const AtomicString& oldValue, 368 const AtomicString& oldValue,
366 const AtomicString& newValue); 369 const AtomicString& newValue);
367 370
368 virtual bool hasLegalLinkAttribute(const QualifiedName&) const; 371 virtual bool hasLegalLinkAttribute(const QualifiedName&) const;
369 virtual const QualifiedName& subResourceAttributeName() const; 372 virtual const QualifiedName& subResourceAttributeName() const;
370 373
371 // Only called by the parser immediately after element construction. 374 // Only called by the parser immediately after element construction.
372 void parserSetAttributes(const Vector<Attribute>&); 375 void parserSetAttributes(const Vector<Attribute>&);
373 376
374 // Remove attributes that might introduce scripting from the vector leaving th e element unchanged. 377 // Remove attributes that might introduce scripting from the vector leaving
378 // the element unchanged.
375 void stripScriptingAttributes(Vector<Attribute>&) const; 379 void stripScriptingAttributes(Vector<Attribute>&) const;
376 380
377 bool sharesSameElementData(const Element& other) const { 381 bool sharesSameElementData(const Element& other) const {
378 return elementData() == other.elementData(); 382 return elementData() == other.elementData();
379 } 383 }
380 384
381 // Clones attributes only. 385 // Clones attributes only.
382 void cloneAttributesFromElement(const Element&); 386 void cloneAttributesFromElement(const Element&);
383 387
384 // Clones all attribute-derived data, including subclass specifics (through co pyNonAttributeProperties.) 388 // Clones all attribute-derived data, including subclass specifics (through
389 // copyNonAttributeProperties.)
385 void cloneDataFromElement(const Element&); 390 void cloneDataFromElement(const Element&);
386 391
387 bool hasEquivalentAttributes(const Element* other) const; 392 bool hasEquivalentAttributes(const Element* other) const;
388 393
389 virtual void copyNonAttributePropertiesFromElement(const Element&) {} 394 virtual void copyNonAttributePropertiesFromElement(const Element&) {}
390 395
391 void attachLayoutTree(const AttachContext& = AttachContext()) override; 396 void attachLayoutTree(const AttachContext& = AttachContext()) override;
392 void detachLayoutTree(const AttachContext& = AttachContext()) override; 397 void detachLayoutTree(const AttachContext& = AttachContext()) override;
393 398
394 virtual LayoutObject* createLayoutObject(const ComputedStyle&); 399 virtual LayoutObject* createLayoutObject(const ComputedStyle&);
395 virtual bool layoutObjectIsNeeded(const ComputedStyle&); 400 virtual bool layoutObjectIsNeeded(const ComputedStyle&);
396 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = nullptr); 401 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = nullptr);
397 void pseudoStateChanged(CSSSelector::PseudoType); 402 void pseudoStateChanged(CSSSelector::PseudoType);
398 void setAnimationStyleChange(bool); 403 void setAnimationStyleChange(bool);
399 void clearAnimationStyleChange(); 404 void clearAnimationStyleChange();
400 void setNeedsAnimationStyleRecalc(); 405 void setNeedsAnimationStyleRecalc();
401 406
402 void setNeedsCompositingUpdate(); 407 void setNeedsCompositingUpdate();
403 408
404 bool supportsStyleSharing() const; 409 bool supportsStyleSharing() const;
405 410
406 ElementShadow* shadow() const; 411 ElementShadow* shadow() const;
407 ElementShadow& ensureShadow(); 412 ElementShadow& ensureShadow();
408 // If type of ShadowRoot (either closed or open) is explicitly specified, crea tion of multiple 413 // If type of ShadowRoot (either closed or open) is explicitly specified,
409 // shadow roots is prohibited in any combination and throws an exception. Mult iple shadow roots 414 // creation of multiple shadow roots is prohibited in any combination and
410 // are allowed only when createShadowRoot() is used without any parameters fro m JavaScript. 415 // throws an exception. Multiple shadow roots are allowed only when
416 // createShadowRoot() is used without any parameters from JavaScript.
411 ShadowRoot* createShadowRoot(const ScriptState*, ExceptionState&); 417 ShadowRoot* createShadowRoot(const ScriptState*, ExceptionState&);
412 ShadowRoot* attachShadow(const ScriptState*, 418 ShadowRoot* attachShadow(const ScriptState*,
413 const ShadowRootInit&, 419 const ShadowRootInit&,
414 ExceptionState&); 420 ExceptionState&);
415 ShadowRoot* createShadowRootInternal(ShadowRootType, ExceptionState&); 421 ShadowRoot* createShadowRootInternal(ShadowRootType, ExceptionState&);
416 422
417 ShadowRoot* openShadowRoot() const; 423 ShadowRoot* openShadowRoot() const;
418 ShadowRoot* closedShadowRoot() const; 424 ShadowRoot* closedShadowRoot() const;
419 ShadowRoot* authorShadowRoot() const; 425 ShadowRoot* authorShadowRoot() const;
420 ShadowRoot* userAgentShadowRoot() const; 426 ShadowRoot* userAgentShadowRoot() const;
421 427
422 ShadowRoot* youngestShadowRoot() const; 428 ShadowRoot* youngestShadowRoot() const;
423 429
424 ShadowRoot* shadowRootIfV1() const; 430 ShadowRoot* shadowRootIfV1() const;
425 431
426 ShadowRoot& ensureUserAgentShadowRoot(); 432 ShadowRoot& ensureUserAgentShadowRoot();
427 433
428 bool isInDescendantTreeOf(const Element* shadowHost) const; 434 bool isInDescendantTreeOf(const Element* shadowHost) const;
429 435
430 // Returns the Element’s ComputedStyle. If the ComputedStyle is not already st ored on the Element, 436 // Returns the Element’s ComputedStyle. If the ComputedStyle is not already
431 // computes the ComputedStyle and stores it on the Element’s ElementRareData. Used for getComputedStyle 437 // stored on the Element, computes the ComputedStyle and stores it on the
432 // when Element is display none. 438 // Element’s ElementRareData. Used for getComputedStyle when Element is
439 // display none.
433 const ComputedStyle* ensureComputedStyle(PseudoId = PseudoIdNone); 440 const ComputedStyle* ensureComputedStyle(PseudoId = PseudoIdNone);
434 441
435 // Methods for indicating the style is affected by dynamic updates (e.g., chil dren changing, our position changing in our sibling list, etc.) 442 // Methods for indicating the style is affected by dynamic updates (e.g.,
443 // children changing, our position changing in our sibling list, etc.)
436 bool styleAffectedByEmpty() const { 444 bool styleAffectedByEmpty() const {
437 return hasElementFlag(StyleAffectedByEmpty); 445 return hasElementFlag(StyleAffectedByEmpty);
438 } 446 }
439 void setStyleAffectedByEmpty() { setElementFlag(StyleAffectedByEmpty); } 447 void setStyleAffectedByEmpty() { setElementFlag(StyleAffectedByEmpty); }
440 448
441 void setIsInCanvasSubtree(bool value) { 449 void setIsInCanvasSubtree(bool value) {
442 setElementFlag(IsInCanvasSubtree, value); 450 setElementFlag(IsInCanvasSubtree, value);
443 } 451 }
444 bool isInCanvasSubtree() const { return hasElementFlag(IsInCanvasSubtree); } 452 bool isInCanvasSubtree() const { return hasElementFlag(IsInCanvasSubtree); }
445 453
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void removeApplyScroll(); 494 void removeApplyScroll();
487 void nativeApplyScroll(ScrollState&); 495 void nativeApplyScroll(ScrollState&);
488 496
489 void callDistributeScroll(ScrollState&); 497 void callDistributeScroll(ScrollState&);
490 void callApplyScroll(ScrollState&); 498 void callApplyScroll(ScrollState&);
491 499
492 ScrollStateCallback* getApplyScroll(); 500 ScrollStateCallback* getApplyScroll();
493 501
494 // Whether this element can receive focus at all. Most elements are not 502 // Whether this element can receive focus at all. Most elements are not
495 // focusable but some elements, such as form controls and links, are. Unlike 503 // focusable but some elements, such as form controls and links, are. Unlike
496 // layoutObjectIsFocusable(), this method may be called when layout is not up to 504 // layoutObjectIsFocusable(), this method may be called when layout is not up
497 // date, so it must not use the layoutObject to determine focusability. 505 // to date, so it must not use the layoutObject to determine focusability.
498 virtual bool supportsFocus() const; 506 virtual bool supportsFocus() const;
499 // isFocusable(), isKeyboardFocusable(), and isMouseFocusable() check 507 // isFocusable(), isKeyboardFocusable(), and isMouseFocusable() check
500 // whether the element can actually be focused. Callers should ensure 508 // whether the element can actually be focused. Callers should ensure
501 // ComputedStyle is up to date; 509 // ComputedStyle is up to date;
502 // e.g. by calling Document::updateLayoutTreeIgnorePendingStylesheets(). 510 // e.g. by calling Document::updateLayoutTreeIgnorePendingStylesheets().
503 bool isFocusable() const; 511 bool isFocusable() const;
504 virtual bool isKeyboardFocusable() const; 512 virtual bool isKeyboardFocusable() const;
505 virtual bool isMouseFocusable() const; 513 virtual bool isMouseFocusable() const;
506 bool isFocusedElementInDocument() const; 514 bool isFocusedElementInDocument() const;
507 Element* adjustedFocusedElementInTreeScope() const; 515 Element* adjustedFocusedElementInTreeScope() const;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 // former can be used as a selector in any places, and the latter can be 575 // former can be used as a selector in any places, and the latter can be
568 // used only in UA stylesheet. 576 // used only in UA stylesheet.
569 void setShadowPseudoId(const AtomicString&); 577 void setShadowPseudoId(const AtomicString&);
570 578
571 LayoutSize minimumSizeForResizing() const; 579 LayoutSize minimumSizeForResizing() const;
572 void setMinimumSizeForResizing(const LayoutSize&); 580 void setMinimumSizeForResizing(const LayoutSize&);
573 581
574 virtual void didBecomeFullscreenElement() {} 582 virtual void didBecomeFullscreenElement() {}
575 virtual void willStopBeingFullscreenElement() {} 583 virtual void willStopBeingFullscreenElement() {}
576 584
577 // Called by the parser when this element's close tag is reached, 585 // Called by the parser when this element's close tag is reached, signaling
578 // signaling that all child tags have been parsed and added. 586 // that all child tags have been parsed and added. This is needed for
579 // This is needed for <applet> and <object> elements, which can't lay themselv es out 587 // <applet> and <object> elements, which can't lay themselves out until they
580 // until they know all of their nested <param>s. [Radar 3603191, 4040848]. 588 // know all of their nested <param>s. [Radar 3603191, 4040848]. Also used for
581 // Also used for script elements and some SVG elements for similar purposes, 589 // script elements and some SVG elements for similar purposes, but making
582 // but making parsing a special case in this respect should be avoided if poss ible. 590 // parsing a special case in this respect should be avoided if possible.
583 virtual void finishParsingChildren(); 591 virtual void finishParsingChildren();
584 592
585 void beginParsingChildren() { setIsFinishedParsingChildren(false); } 593 void beginParsingChildren() { setIsFinishedParsingChildren(false); }
586 594
587 PseudoElement* pseudoElement(PseudoId) const; 595 PseudoElement* pseudoElement(PseudoId) const;
588 LayoutObject* pseudoElementLayoutObject(PseudoId) const; 596 LayoutObject* pseudoElementLayoutObject(PseudoId) const;
589 597
590 virtual bool matchesDefaultPseudoClass() const { return false; } 598 virtual bool matchesDefaultPseudoClass() const { return false; }
591 virtual bool matchesEnabledPseudoClass() const { return false; } 599 virtual bool matchesEnabledPseudoClass() const { return false; }
592 virtual bool matchesReadOnlyPseudoClass() const { return false; } 600 virtual bool matchesReadOnlyPseudoClass() const { return false; }
(...skipping 17 matching lines...) Expand all
610 virtual bool isOptionalFormControl() const { return false; } 618 virtual bool isOptionalFormControl() const { return false; }
611 virtual bool isRequiredFormControl() const { return false; } 619 virtual bool isRequiredFormControl() const { return false; }
612 virtual bool willValidate() const { return false; } 620 virtual bool willValidate() const { return false; }
613 virtual bool isValidElement() { return false; } 621 virtual bool isValidElement() { return false; }
614 virtual bool isInRange() const { return false; } 622 virtual bool isInRange() const { return false; }
615 virtual bool isOutOfRange() const { return false; } 623 virtual bool isOutOfRange() const { return false; }
616 virtual bool isClearButtonElement() const { return false; } 624 virtual bool isClearButtonElement() const { return false; }
617 625
618 bool canContainRangeEndPoint() const override { return true; } 626 bool canContainRangeEndPoint() const override { return true; }
619 627
620 // Used for disabled form elements; if true, prevents mouse events from being dispatched 628 // Used for disabled form elements; if true, prevents mouse events from being
621 // to event listeners, and prevents DOMActivate events from being sent at all. 629 // dispatched to event listeners, and prevents DOMActivate events from being
630 // sent at all.
622 virtual bool isDisabledFormControl() const { return false; } 631 virtual bool isDisabledFormControl() const { return false; }
623 632
624 bool hasPendingResources() const { 633 bool hasPendingResources() const {
625 return hasElementFlag(HasPendingResources); 634 return hasElementFlag(HasPendingResources);
626 } 635 }
627 void setHasPendingResources() { setElementFlag(HasPendingResources); } 636 void setHasPendingResources() { setElementFlag(HasPendingResources); }
628 void clearHasPendingResources() { clearElementFlag(HasPendingResources); } 637 void clearHasPendingResources() { clearElementFlag(HasPendingResources); }
629 virtual void buildPendingResource() {} 638 virtual void buildPendingResource() {}
630 639
631 void v0SetCustomElementDefinition(V0CustomElementDefinition*); 640 void v0SetCustomElementDefinition(V0CustomElementDefinition*);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 const ComputedStyle* virtualEnsureComputedStyle( 879 const ComputedStyle* virtualEnsureComputedStyle(
871 PseudoId pseudoElementSpecifier = PseudoIdNone) override { 880 PseudoId pseudoElementSpecifier = PseudoIdNone) override {
872 return ensureComputedStyle(pseudoElementSpecifier); 881 return ensureComputedStyle(pseudoElementSpecifier);
873 } 882 }
874 883
875 inline void updateCallbackSelectors(const ComputedStyle* oldStyle, 884 inline void updateCallbackSelectors(const ComputedStyle* oldStyle,
876 const ComputedStyle* newStyle); 885 const ComputedStyle* newStyle);
877 inline void removeCallbackSelectors(); 886 inline void removeCallbackSelectors();
878 inline void addCallbackSelectors(); 887 inline void addCallbackSelectors();
879 888
880 // cloneNode is private so that non-virtual cloneElementWithChildren and clone ElementWithoutChildren 889 // cloneNode is private so that non-virtual cloneElementWithChildren and
881 // are used instead. 890 // cloneElementWithoutChildren are used instead.
882 Node* cloneNode(bool deep) override; 891 Node* cloneNode(bool deep) override;
883 virtual Element* cloneElementWithoutAttributesAndChildren(); 892 virtual Element* cloneElementWithoutAttributesAndChildren();
884 893
885 QualifiedName m_tagName; 894 QualifiedName m_tagName;
886 895
887 void updateNamedItemRegistration(const AtomicString& oldName, 896 void updateNamedItemRegistration(const AtomicString& oldName,
888 const AtomicString& newName); 897 const AtomicString& newName);
889 void updateExtraNamedItemRegistration(const AtomicString& oldName, 898 void updateExtraNamedItemRegistration(const AtomicString& oldName,
890 const AtomicString& newName); 899 const AtomicString& newName);
891 900
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1116 return element.shadow(); 1125 return element.shadow();
1117 } 1126 }
1118 1127
1119 inline bool isAtShadowBoundary(const Element* element) { 1128 inline bool isAtShadowBoundary(const Element* element) {
1120 if (!element) 1129 if (!element)
1121 return false; 1130 return false;
1122 ContainerNode* parentNode = element->parentNode(); 1131 ContainerNode* parentNode = element->parentNode();
1123 return parentNode && parentNode->isShadowRoot(); 1132 return parentNode && parentNode->isShadowRoot();
1124 } 1133 }
1125 1134
1126 // These macros do the same as their NODE equivalents but additionally provide a template specialization 1135 // These macros do the same as their NODE equivalents but additionally provide a
1127 // for isElementOfType<>() so that the Traversal<> API works for these Element t ypes. 1136 // template specialization for isElementOfType<>() so that the Traversal<> API
1137 // works for these Element types.
1128 #define DEFINE_ELEMENT_TYPE_CASTS(thisType, predicate) \ 1138 #define DEFINE_ELEMENT_TYPE_CASTS(thisType, predicate) \
1129 template <> \ 1139 template <> \
1130 inline bool isElementOfType<const thisType>(const Node& node) { \ 1140 inline bool isElementOfType<const thisType>(const Node& node) { \
1131 return node.predicate; \ 1141 return node.predicate; \
1132 } \ 1142 } \
1133 DEFINE_NODE_TYPE_CASTS(thisType, predicate) 1143 DEFINE_NODE_TYPE_CASTS(thisType, predicate)
1134 1144
1135 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ 1145 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \
1136 template <> \ 1146 template <> \
1137 inline bool isElementOfType<const thisType>(const Node& node) { \ 1147 inline bool isElementOfType<const thisType>(const Node& node) { \
1138 return is##thisType(node); \ 1148 return is##thisType(node); \
1139 } \ 1149 } \
1140 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) 1150 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType)
1141 1151
1142 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1152 #define DECLARE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1143 static T* create(const QualifiedName&, Document&) 1153 static T* create(const QualifiedName&, Document&)
1144 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 1154 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
1145 T* T::create(const QualifiedName& tagName, Document& document) { \ 1155 T* T::create(const QualifiedName& tagName, Document& document) { \
1146 return new T(tagName, document); \ 1156 return new T(tagName, document); \
1147 } 1157 }
1148 1158
1149 } // namespace blink 1159 } // namespace blink
1150 1160
1151 #endif // Element_h 1161 #endif // Element_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentTest.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