Changeset 172487 in webkit
- Timestamp:
- Aug 12, 2014 1:37:37 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r172482 r172487 1 2014-08-12 Antti Koivisto <antti@apple.com> 2 3 Remove isInCanvasSubtree bit 4 https://bugs.webkit.org/show_bug.cgi?id=135837 5 6 Reviewed by Andreas Kling. 7 8 The logic to update this bit is in a wrong place and it is not clear it does 9 the right thing in all cases. Also the optimization doesn't seem necessary, 10 the focus code is not that hot. 11 12 * accessibility/AXObjectCache.cpp: 13 (WebCore::AXObjectCache::getOrCreate): 14 * dom/Element.cpp: 15 (WebCore::Element::isFocusable): 16 (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer): 17 (WebCore::Element::setIsInCanvasSubtree): Deleted. 18 (WebCore::Element::isInCanvasSubtree): Deleted. 19 * dom/Element.h: 20 * dom/ElementRareData.h: 21 (WebCore::ElementRareData::ElementRareData): 22 (WebCore::ElementRareData::isInCanvasSubtree): Deleted. 23 (WebCore::ElementRareData::setIsInCanvasSubtree): Deleted. 24 * html/HTMLAnchorElement.cpp: 25 (WebCore::HTMLAnchorElement::isKeyboardFocusable): 26 * html/HTMLCanvasElement.cpp: 27 (WebCore::HTMLCanvasElement::HTMLCanvasElement): 28 (WebCore::HTMLCanvasElement::willAttachRenderers): Deleted. 29 * html/HTMLCanvasElement.h: 30 * style/StyleResolveTree.cpp: 31 (WebCore::Style::attachRenderTree): 32 1 33 2014-08-11 Andy Estes <aestes@apple.com> 2 34 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r171477 r172487 59 59 #include "Document.h" 60 60 #include "Editor.h" 61 #include "ElementIterator.h" 61 62 #include "FocusController.h" 62 63 #include "Frame.h" 63 64 #include "HTMLAreaElement.h" 65 #include "HTMLCanvasElement.h" 64 66 #include "HTMLImageElement.h" 65 67 #include "HTMLInputElement.h" … … 380 382 // It's only allowed to create an AccessibilityObject from a Node if it's in a canvas subtree. 381 383 // Or if it's a hidden element, but we still want to expose it because of other ARIA attributes. 382 bool inCanvasSubtree = node->parentElement()->isInCanvasSubtree();383 bool isHidden = !node->renderer() &&isNodeAriaVisible(node);384 bool inCanvasSubtree = lineageOfType<HTMLCanvasElement>(*node->parentElement()).first(); 385 bool isHidden = isNodeAriaVisible(node); 384 386 385 387 bool insideMeterElement = false; -
trunk/Source/WebCore/dom/Element.cpp
r172409 r172487 435 435 return false; 436 436 437 // Elements in canvas fallback content are not rendered, but they are allowed to be438 // focusable as long as their canvas is displayed and visible.439 if (isInCanvasSubtree()) {440 ASSERT(lineageOfType<HTMLCanvasElement>(*this).first());441 auto& canvas = *lineageOfType<HTMLCanvasElement>(*this).first();442 return canvas.renderer() && canvas.renderer()->style().visibility() == VISIBLE;443 }444 445 437 if (!renderer()) { 446 438 // If the node is in a display:none tree it might say it needs style recalc but 447 439 // the whole document is actually up to date. 448 440 ASSERT(!needsStyleRecalc() || !document().childNeedsStyleRecalc()); 441 442 // Elements in canvas fallback content are not rendered, but they are allowed to be 443 // focusable as long as their canvas is displayed and visible. 444 if (auto* canvas = ancestorsOfType<HTMLCanvasElement>(*this).first()) 445 return canvas->renderer() && canvas->renderer()->style().visibility() == VISIBLE; 449 446 } 450 447 … … 2213 2210 } 2214 2211 2215 void Element::setIsInCanvasSubtree(bool isInCanvasSubtree)2216 {2217 ensureElementRareData().setIsInCanvasSubtree(isInCanvasSubtree);2218 }2219 2220 bool Element::isInCanvasSubtree() const2221 {2222 return hasRareData() && elementRareData()->isInCanvasSubtree();2223 }2224 2225 2212 void Element::setRegionOversetState(RegionOversetState state) 2226 2213 { … … 2891 2878 return; 2892 2879 ElementRareData* data = elementRareData(); 2893 data->setIsInCanvasSubtree(false);2894 2880 data->resetComputedStyle(); 2895 2881 data->resetDynamicRestyleObservations(); -
trunk/Source/WebCore/dom/Element.h
r172409 r172487 383 383 void setChildIndex(unsigned); 384 384 385 void setIsInCanvasSubtree(bool);386 bool isInCanvasSubtree() const;387 388 385 void setRegionOversetState(RegionOversetState); 389 386 RegionOversetState regionOversetState() const; -
trunk/Source/WebCore/dom/ElementRareData.h
r170774 r172487 61 61 void setStyleAffectedByEmpty(bool value) { m_styleAffectedByEmpty = value; } 62 62 63 bool isInCanvasSubtree() const { return m_isInCanvasSubtree; }64 void setIsInCanvasSubtree(bool value) { m_isInCanvasSubtree = value; }65 66 63 RegionOversetState regionOversetState() const { return m_regionOversetState; } 67 64 void setRegionOversetState(RegionOversetState state) { m_regionOversetState = state; } … … 125 122 unsigned m_needsFocusAppearanceUpdateSoonAfterAttach : 1; 126 123 unsigned m_styleAffectedByEmpty : 1; 127 unsigned m_isInCanvasSubtree : 1;128 124 #if ENABLE(FULLSCREEN_API) 129 125 unsigned m_containsFullScreenElement : 1; … … 170 166 , m_needsFocusAppearanceUpdateSoonAfterAttach(false) 171 167 , m_styleAffectedByEmpty(false) 172 , m_isInCanvasSubtree(false)173 168 #if ENABLE(FULLSCREEN_API) 174 169 , m_containsFullScreenElement(false) -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r168313 r172487 27 27 #include "Attribute.h" 28 28 #include "DNS.h" 29 #include "ElementIterator.h" 29 30 #include "EventHandler.h" 30 31 #include "EventNames.h" … … 34 35 #include "FrameLoaderTypes.h" 35 36 #include "FrameSelection.h" 37 #include "HTMLCanvasElement.h" 36 38 #include "HTMLImageElement.h" 37 39 #include "HTMLParserIdioms.h" … … 143 145 return false; 144 146 145 if ( isInCanvasSubtree())147 if (!renderer() && ancestorsOfType<HTMLCanvasElement>(*this).first()) 146 148 return true; 147 149 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r170774 r172487 86 86 { 87 87 ASSERT(hasTagName(canvasTag)); 88 setHasCustomStyleResolveCallbacks();89 88 } 90 89 … … 124 123 m_rendererIsCanvas = false; 125 124 return HTMLElement::createElementRenderer(WTF::move(style)); 126 }127 128 void HTMLCanvasElement::willAttachRenderers()129 {130 setIsInCanvasSubtree(true);131 125 } 132 126 -
trunk/Source/WebCore/html/HTMLCanvasElement.h
r166665 r172487 143 143 virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; 144 144 virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override; 145 virtual void willAttachRenderers() override;146 145 147 146 virtual bool canContainRangeEndPoint() const override; -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r172409 r172487 588 588 createRendererIfNeeded(current, inheritedStyle, renderTreePosition, resolvedStyle); 589 589 590 if (current.parentElement() && current.parentElement()->isInCanvasSubtree())591 current.setIsInCanvasSubtree(true);592 593 590 StyleResolverParentPusher parentPusher(¤t); 594 591
Note: See TracChangeset
for help on using the changeset viewer.