Changeset 141005 in webkit
- Timestamp:
- Jan 28, 2013, 1:45:11 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141002 r141005 1 2013-01-28 Elliott Sprehn <esprehn@chromium.org> 2 3 Move hasAuthorShadowRoot to Element 4 https://bugs.webkit.org/show_bug.cgi?id=108071 5 6 Reviewed by Dimitri Glazkov. 7 8 Move hasAuthorShadowRoot to Element and get rid of unneccesary booleans 9 in HTMLProgressElement and HTMLMeterElement. Also get rid of 10 ShadowRoot::isAccessible since it obfuscates what's actually happening 11 inside of Element::shadowRoot(). 12 13 No new tests, just refactoring. 14 15 * dom/Element.cpp: 16 (WebCore::Element::shadowRoot): 17 (WebCore::Element::hasAuthorShadowRoot): 18 * dom/Element.h: 19 (Element): 20 * dom/ShadowRoot.h: 21 * html/HTMLMeterElement.cpp: 22 (WebCore::HTMLMeterElement::HTMLMeterElement): 23 * html/HTMLMeterElement.h: 24 (HTMLMeterElement): 25 * html/HTMLProgressElement.cpp: 26 (WebCore::HTMLProgressElement::HTMLProgressElement): 27 * html/HTMLProgressElement.h: 28 (HTMLProgressElement): 29 1 30 2013-01-28 Elliott Sprehn <esprehn@chromium.org> 2 31 -
trunk/Source/WebCore/dom/Element.cpp
r141002 r141005 1472 1472 return 0; 1473 1473 ShadowRoot* shadowRoot = elementShadow->youngestShadowRoot(); 1474 if ( !shadowRoot->isAccessible())1475 return 0;1476 return shadowRoot;1474 if (shadowRoot->type() == ShadowRoot::AuthorShadowRoot) 1475 return shadowRoot; 1476 return 0; 1477 1477 } 1478 1478 -
trunk/Source/WebCore/dom/Element.h
r141002 r141005 294 294 ShadowRoot* shadowRoot() const; 295 295 296 bool hasAuthorShadowRoot() const { return shadowRoot(); } 296 297 virtual void willAddAuthorShadowRoot() { } 297 298 virtual bool areAuthorShadowsAllowed() const { return true; } -
trunk/Source/WebCore/dom/ShadowRoot.h
r139198 r141005 94 94 95 95 ShadowRootType type() const { return m_isAuthorShadowRoot ? AuthorShadowRoot : UserAgentShadowRoot; } 96 bool isAccessible() const { return type() == AuthorShadowRoot; }97 96 98 97 PassRefPtr<Node> cloneNode(bool, ExceptionCode&); -
trunk/Source/WebCore/html/HTMLMeterElement.cpp
r139723 r141005 44 44 HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* document) 45 45 : LabelableElement(tagName, document) 46 , m_hasAuthorShadowRoot(false)47 46 { 48 47 ASSERT(hasTagName(meterTag)); … … 226 225 } 227 226 228 void HTMLMeterElement::willAddAuthorShadowRoot()229 {230 m_hasAuthorShadowRoot = true;231 }232 233 227 RenderMeter* HTMLMeterElement::renderMeter() const 234 228 { -
trunk/Source/WebCore/html/HTMLMeterElement.h
r135069 r141005 40 40 }; 41 41 42 bool hasAuthorShadowRoot() const { return m_hasAuthorShadowRoot; }43 44 42 double min() const; 45 43 void setMin(double, ExceptionCode&); … … 69 67 virtual ~HTMLMeterElement(); 70 68 71 virtual void willAddAuthorShadowRoot() OVERRIDE;72 69 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 73 70 RenderMeter* renderMeter() const; … … 86 83 87 84 RefPtr<MeterValueElement> m_value; 88 bool m_hasAuthorShadowRoot;89 85 }; 90 86 -
trunk/Source/WebCore/html/HTMLProgressElement.cpp
r139723 r141005 45 45 : LabelableElement(tagName, document) 46 46 , m_value(0) 47 , m_hasAuthorShadowRoot(false)48 47 { 49 48 ASSERT(hasTagName(progressTag)); … … 82 81 ASSERT(!renderObject || renderObject->isProgress()); 83 82 return static_cast<RenderProgress*>(renderObject); 84 }85 86 void HTMLProgressElement::willAddAuthorShadowRoot()87 {88 m_hasAuthorShadowRoot = true;89 83 } 90 84 -
trunk/Source/WebCore/html/HTMLProgressElement.h
r135069 r141005 37 37 static PassRefPtr<HTMLProgressElement> create(const QualifiedName&, Document*); 38 38 39 bool hasAuthorShadowRoot() const { return m_hasAuthorShadowRoot; }40 41 39 double value() const; 42 40 void setValue(double, ExceptionCode&); … … 55 53 virtual ~HTMLProgressElement(); 56 54 57 virtual void willAddAuthorShadowRoot() OVERRIDE;58 55 virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; } 59 56 … … 74 71 75 72 ProgressValueElement* m_value; 76 bool m_hasAuthorShadowRoot;77 73 }; 78 74
Note:
See TracChangeset
for help on using the changeset viewer.