Title: [209140] trunk
Revision
209140
Author
[email protected]
Date
2016-11-30 11:19:44 -0800 (Wed, 30 Nov 2016)

Log Message

Reverted r209130.

The new test fast/shadow-dom/keygen-shadow-manipulation.html asserts and crashes on Mac debug builds.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (209139 => 209140)


--- trunk/LayoutTests/ChangeLog	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/ChangeLog	2016-11-30 19:19:44 UTC (rev 209140)
@@ -19,27 +19,6 @@
         * fast/images/reset-image-animation-expected.txt: Added.
         * fast/images/reset-image-animation.html: Added.
 
-2016-11-29  Brent Fulgham  <[email protected]>
-
-        Use 'childOfType' template when retrieving Shadow DOM elements
-        https://bugs.webkit.org/show_bug.cgi?id=165145
-        <rdar://problem/29331830>
-
-        Reviewed by Antti Koivisto.
-
-        * fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/color-input-element-shadow-manipulation.html: Added.
-        * fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/file-input-element-shadow-manipulation.html: Added.
-        * fast/shadow-dom/keygen-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/keygen-shadow-manipulation.html: Added.
-        * fast/shadow-dom/media-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/media-shadow-manipulation.html: Added.
-        * fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/range-input-element-shadow-manipulation.html: Added.
-        * fast/shadow-dom/textarea-shadow-manipulation-expected.txt: Added.
-        * fast/shadow-dom/textarea-shadow-manipulation.html: Added.
-
 2016-11-30  Dave Hyatt  <[email protected]>
 
         [CSS Parser] Mark a bunch of tests as able to fail

Deleted: trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-foo 

Deleted: trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/color-input-element-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = color_input_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.top + 10);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    color_input_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <input type="color" id="color_input_element" style="position:absolute; height: 100px; width: 100px;">
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-foo 

Deleted: trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/file-input-element-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = file_input_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.top + 10);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    file_input_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <input type="file" id="file_input_element" style="position:absolute; height: 100px; width: 100px;">
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/keygen-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = keygen_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    keygen_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <keygen id="keygen_element" style="position:absolute; height: 100px; width: 100px;">
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-foo 

Deleted: trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/media-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = video_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + 10, bounds.bottom - 10);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    video_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <video id="video_element" style="position:absolute; height: 240px; width: 320px;" controls></video>
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-foo 

Deleted: trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/range-input-element-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = range_input_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    range_input_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <input type="range" id="range_input_element" style="position:absolute; height: 30px; width: 100px;">
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation-expected.txt	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,5 +0,0 @@
-PASS Passes if we did not debug assert.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-foo 

Deleted: trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html (209139 => 209140)


--- trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/LayoutTests/fast/shadow-dom/textarea-shadow-manipulation.html	2016-11-30 19:19:44 UTC (rev 209140)
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-window.jsTestIsAsync = true;
-
-function runTest() {
-    var bounds = textarea_element.getBoundingClientRect();
-    var range = document.caretRangeFromPoint(bounds.left + bounds.width / 2, bounds.top + bounds.height / 2);
-    var shadow_tree_container = range.commonAncestorContainer;
-    shadow_tree_container.prepend("foo");
-    textarea_element.disabled = true;
-    testPassed("Passes if we did not debug assert.");
-    finishJSTest();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-    <textarea id="textarea_element" style="position:absolute; height: 100px; width: 100px;">Text Area</textarea>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (209139 => 209140)


--- trunk/Source/WebCore/ChangeLog	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/ChangeLog	2016-11-30 19:19:44 UTC (rev 209140)
@@ -107,53 +107,6 @@
         * testing/Internals.idl:
         Expose BitmapImage::resetAnimation() through Internals so tests can force it.
 
-2016-11-29  Brent Fulgham  <[email protected]>
-
-        Use 'childOfType' template when retrieving Shadow DOM elements
-        https://bugs.webkit.org/show_bug.cgi?id=165145
-        <rdar://problem/29331830>
-
-        Reviewed by Antti Koivisto.
-
-        Tests: fast/shadow-dom/color-input-element-shadow-manipulation.html
-               fast/shadow-dom/file-input-element-shadow-manipulation.html
-               fast/shadow-dom/keygen-shadow-manipulation.html
-               fast/shadow-dom/media-shadow-manipulation.html
-               fast/shadow-dom/range-input-element-shadow-manipulation.html
-               fast/shadow-dom/textarea-shadow-manipulation.html
-
-        Switch to using 'childOfType' when retrieving Shadow DOM elements, rather
-        than relying on expected element positions, as these can be changed by
-        _javascript_.
-
-        Drive by fix: Make more use of is<> and downcast<> templates rather than blindly casting.
-
-        * dom/Element.h:
-        (WebCore::Element::isUploadButton): Added.
-        (WebCore::Element::isSliderContainerElement): Added.
-        * html/ColorInputType.cpp:
-        (WebCore::ColorInputType::shadowColorSwatch): Use 'childOfType' rather than assuming
-        the first child is the one we want.
-        * html/FileInputType.cpp:
-        (isType): Added.
-        (WebCore::FileInputType::disabledAttributeChanged): Use 'childOfType' rather than assuming
-        the first child is the one we want.
-        (WebCore::FileInputType::multipleAttributeChanged): Ditto.
-        * html/HTMLKeygenElement.cpp:
-        (WebCore::HTMLKeygenElement::shadowSelect): Ditto.
-        * html/HTMLMediaElement.cpp:
-        (WebCore::HTMLMediaElement::mediaControls): Ditto.
-        (WebCore::HTMLMediaElement::hasMediaControls): Ditto.
-        * html/HTMLTextAreaElement.cpp:
-        (WebCore::HTMLTextAreaElement::innerTextElement): Ditto.
-        * html/RangeInputType.cpp:
-        (WebCore::RangeInputType::sliderTrackElement): Ditto.
-        * html/shadow/SliderThumbElement.h:
-        (isType): Added.
-        * svg/SVGUseElement.cpp:
-        (WebCore::SVGUseElement::targetClone): Use 'childOfType' rather than assuming
-        the first child is the one we want.
-
 2016-11-30  Darin Adler  <[email protected]>
 
         Streamline and speed up tokenizer and segmented string classes

Modified: trunk/Source/WebCore/dom/Element.h (209139 => 209140)


--- trunk/Source/WebCore/dom/Element.h	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/dom/Element.h	2016-11-30 19:19:44 UTC (rev 209140)
@@ -444,8 +444,6 @@
     virtual bool isInRange() const { return false; }
     virtual bool isOutOfRange() const { return false; }
     virtual bool isFrameElementBase() const { return false; }
-    virtual bool isUploadButton() const { return false; }
-    virtual bool isSliderContainerElement() const { return false; }
 
     bool canContainRangeEndPoint() const override;
 

Modified: trunk/Source/WebCore/html/ColorInputType.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/ColorInputType.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/ColorInputType.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -38,7 +38,6 @@
 #include "CSSPropertyNames.h"
 #include "Chrome.h"
 #include "Color.h"
-#include "ElementChildIterator.h"
 #include "Event.h"
 #include "HTMLDataListElement.h"
 #include "HTMLDivElement.h"
@@ -217,14 +216,7 @@
 HTMLElement* ColorInputType::shadowColorSwatch() const
 {
     ShadowRoot* shadow = element().userAgentShadowRoot();
-    if (!shadow)
-        return nullptr;
-
-    auto wrapper = childrenOfType<HTMLDivElement>(*shadow).first();
-    if (!wrapper)
-        return nullptr;
-
-    return childrenOfType<HTMLDivElement>(*wrapper).first();
+    return shadow ? downcast<HTMLElement>(shadow->firstChild()->firstChild()) : nullptr;
 }
 
 IntRect ColorInputType::elementRectRelativeToRootView() const

Modified: trunk/Source/WebCore/html/FileInputType.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/FileInputType.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/FileInputType.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -24,7 +24,6 @@
 
 #include "Chrome.h"
 #include "DragData.h"
-#include "ElementChildIterator.h"
 #include "Event.h"
 #include "File.h"
 #include "FileList.h"
@@ -40,21 +39,10 @@
 #include "RenderFileUploadControl.h"
 #include "ScriptController.h"
 #include "ShadowRoot.h"
-#include <wtf/TypeCasts.h>
 #include <wtf/text/StringBuilder.h>
 
-
 namespace WebCore {
-class UploadButtonElement;
-}
 
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::UploadButtonElement)
-    static bool isType(const WebCore::Element& element) { return element.isUploadButton(); }
-    static bool isType(const WebCore::Node& node) { return is<WebCore::Element>(node) && isType(downcast<WebCore::Element>(node)); }
-SPECIALIZE_TYPE_TRAITS_END()
-
-namespace WebCore {
-
 using namespace HTMLNames;
 
 class UploadButtonElement final : public HTMLInputElement {
@@ -63,8 +51,6 @@
     static Ref<UploadButtonElement> createForMultiple(Document&);
 
 private:
-    bool isUploadButton() const override { return true; }
-    
     UploadButtonElement(Document&);
 };
 
@@ -281,12 +267,8 @@
 void FileInputType::disabledAttributeChanged()
 {
     ASSERT(element().shadowRoot());
-
-    ShadowRoot* root = element().userAgentShadowRoot();
-    if (!root)
-        return;
-    
-    if (auto* button = childrenOfType<UploadButtonElement>(*root).first())
+    UploadButtonElement* button = static_cast<UploadButtonElement*>(element().userAgentShadowRoot()->firstChild());
+    if (button)
         button->setBooleanAttribute(disabledAttr, element().isDisabledFormControl());
 }
 
@@ -293,12 +275,8 @@
 void FileInputType::multipleAttributeChanged()
 {
     ASSERT(element().shadowRoot());
-
-    ShadowRoot* root = element().userAgentShadowRoot();
-    if (!root)
-        return;
-
-    if (auto* button = childrenOfType<UploadButtonElement>(*root).first())
+    UploadButtonElement* button = static_cast<UploadButtonElement*>(element().userAgentShadowRoot()->firstChild());
+    if (button)
         button->setValue(element().multiple() ? fileButtonChooseMultipleFilesLabel() : fileButtonChooseFileLabel());
 }
 

Modified: trunk/Source/WebCore/html/HTMLKeygenElement.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/HTMLKeygenElement.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll ([email protected])
  *           (C) 1999 Antti Koivisto ([email protected])
  *           (C) 2001 Dirk Mueller ([email protected])
- * Copyright (C) 2004-2006, 2010, 2012-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov ([email protected])
  *
  * This library is free software; you can redistribute it and/or
@@ -27,7 +27,6 @@
 
 #include "Attribute.h"
 #include "Document.h"
-#include "ElementChildIterator.h"
 #include "FormDataList.h"
 #include "HTMLNames.h"
 #include "HTMLSelectElement.h"
@@ -147,12 +146,6 @@
 {
     ShadowRoot* root = userAgentShadowRoot();
     return root ? downcast<HTMLSelectElement>(root->firstChild()) : nullptr;
-    /*
-    if (!root)
-        return nullptr;
-
-    return childrenOfType<HTMLSelectElement>(*root).first();
-     */
 }
 
 } // namespace

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -5777,13 +5777,9 @@
 MediaControls* HTMLMediaElement::mediaControls() const
 {
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
-    return nullptr;
+    return 0;
 #else
-    ShadowRoot* root = userAgentShadowRoot();
-    if (!root)
-        return nullptr;
-    
-    return childrenOfType<MediaControls>(*root).first();
+    return toMediaControls(userAgentShadowRoot()->firstChild());
 #endif
 }
 
@@ -5794,7 +5790,7 @@
 #else
 
     if (ShadowRoot* userAgent = userAgentShadowRoot()) {
-        Node* node = childrenOfType<MediaControls>(*root).first();
+        Node* node = userAgent->firstChild();
         ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isMediaControls());
         return node;
     }

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -2,7 +2,7 @@
  * Copyright (C) 1999 Lars Knoll ([email protected])
  *           (C) 1999 Antti Koivisto ([email protected])
  *           (C) 2001 Dirk Mueller ([email protected])
- * Copyright (C) 2004-2008, 2010, 2014, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2014 Apple Inc. All rights reserved.
  *           (C) 2006 Alexey Proskuryakov ([email protected])
  * Copyright (C) 2007 Samuel Weinig ([email protected])
  *
@@ -30,7 +30,6 @@
 #include "CSSValueKeywords.h"
 #include "Document.h"
 #include "Editor.h"
-#include "ElementChildIterator.h"
 #include "Event.h"
 #include "EventHandler.h"
 #include "EventNames.h"
@@ -329,11 +328,7 @@
 
 TextControlInnerTextElement* HTMLTextAreaElement::innerTextElement() const
 {
-    ShadowRoot* root = userAgentShadowRoot();
-    if (!root)
-        return nullptr;
-    
-    return childrenOfType<TextControlInnerTextElement>(*root).first();
+    return downcast<TextControlInnerTextElement>(userAgentShadowRoot()->firstChild());
 }
 
 void HTMLTextAreaElement::rendererWillBeDestroyed()

Modified: trunk/Source/WebCore/html/RangeInputType.cpp (209139 => 209140)


--- trunk/Source/WebCore/html/RangeInputType.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/RangeInputType.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -33,7 +33,6 @@
 #include "RangeInputType.h"
 
 #include "AXObjectCache.h"
-#include "ElementChildIterator.h"
 #include "EventNames.h"
 #include "HTMLInputElement.h"
 #include "HTMLParserIdioms.h"
@@ -268,15 +267,7 @@
     ASSERT(element().userAgentShadowRoot()->firstChild()->isHTMLElement());
     ASSERT(element().userAgentShadowRoot()->firstChild()->firstChild()); // track
 
-    ShadowRoot* root = element().userAgentShadowRoot();
-    if (!root)
-        return nullptr;
-    
-    auto* container = childrenOfType<SliderContainerElement>(*root).first();
-    if (!container)
-        return nullptr;
-
-    return childrenOfType<HTMLElement>(*container).first();
+    return downcast<HTMLElement>(element().userAgentShadowRoot()->firstChild()->firstChild());
 }
 
 SliderThumbElement& RangeInputType::typedSliderThumbElement() const

Modified: trunk/Source/WebCore/html/shadow/SliderThumbElement.h (209139 => 209140)


--- trunk/Source/WebCore/html/shadow/SliderThumbElement.h	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/html/shadow/SliderThumbElement.h	2016-11-30 19:19:44 UTC (rev 209140)
@@ -136,14 +136,8 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
     std::optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override;
     const AtomicString& shadowPseudoId() const override;
-    bool isSliderContainerElement() const override { return true; }
 
     AtomicString m_shadowPseudoId;
 };
 
 } // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SliderContainerElement)
-    static bool isType(const WebCore::Element& element) { return element.isSliderContainerElement(); }
-    static bool isType(const WebCore::Node& node) { return is<WebCore::Element>(node) && isType(downcast<WebCore::Element>(node)); }
-SPECIALIZE_TYPE_TRAITS_END()

Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (209139 => 209140)


--- trunk/Source/WebCore/svg/SVGUseElement.cpp	2016-11-30 18:51:04 UTC (rev 209139)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp	2016-11-30 19:19:44 UTC (rev 209140)
@@ -261,7 +261,7 @@
     auto* root = userAgentShadowRoot();
     if (!root)
         return nullptr;
-    return childrenOfType<SVGElement>(*root).first();
+    return downcast<SVGElement>(root->firstChild());
 }
 
 RenderPtr<RenderElement> SVGUseElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to