Fix the ENABLE(DATALIST_ELEMENT) build
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 20:35:11 +0000 (20:35 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 May 2018 20:35:11 +0000 (20:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186105

Patch by Aditya Keerthi <akeerthi@apple.com> on 2018-05-30
Reviewed by Wenson Hsieh.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestions const):
* html/HTMLInputElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::ownerDataListElement const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):

Source/WebKit:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLOptionElement.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp

index 7caa442..1748db9 100644 (file)
@@ -1,3 +1,19 @@
+2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
+
+        Fix the ENABLE(DATALIST_ELEMENT) build
+        https://bugs.webkit.org/show_bug.cgi?id=186105
+
+        Reviewed by Wenson Hsieh.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/ColorInputType.cpp:
+        (WebCore::ColorInputType::suggestions const):
+        * html/HTMLInputElement.h:
+        * html/HTMLOptionElement.cpp:
+        (WebCore::HTMLOptionElement::ownerDataListElement const):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paintSliderTicks):
+
 2018-05-30  Alex Christensen  <achristensen@webkit.org>
 
         Reduce String allocations
index 4012a58..1673aa9 100644 (file)
                F5973DE015CFB2030027F804 /* LocaleMac.h in Headers */ = {isa = PBXBuildFile; fileRef = F5973DDE15CFB2030027F804 /* LocaleMac.h */; };
                F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F59C95FE1255B23F000623C0 /* BaseDateAndTimeInputType.h */; };
                F5A154281279534D00D0B0C0 /* ValidationMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = F5A154261279534D00D0B0C0 /* ValidationMessage.h */; };
-               F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041D80FFCA7CE00839D4A /* HTMLDataListElement.h */; };
+               F5C041DB0FFCA7CE00839D4A /* HTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041D80FFCA7CE00839D4A /* HTMLDataListElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                F5C041E70FFCA96D00839D4A /* JSHTMLDataListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F5C041E20FFCA96D00839D4A /* JSHTMLDataListElement.h */; };
                F5E0C65C1643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = F5E0C65A1643C42C00D6CB69 /* BaseChooserOnlyDateAndTimeInputType.h */; };
                F916C48E0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = F916C48C0DB510F80076CD83 /* JSXMLHttpRequestProgressEvent.h */; };
index d4df13c..d9e4d42 100644 (file)
@@ -253,7 +253,7 @@ Vector<Color> ColorInputType::suggestions() const
         suggestions.reserveInitialCapacity(length);
         for (unsigned i = 0; i != length; ++i) {
             auto value = downcast<HTMLOptionElement>(*options->item(i)).value();
-            if (isValidSimpleColorString(value))
+            if (isValidSimpleColor(value))
                 suggestions.uncheckedAppend(Color(value));
         }
     }
index ac1c81c..74135c0 100644 (file)
@@ -268,7 +268,7 @@ public:
     bool willRespondToMouseClickEvents() override;
 
 #if ENABLE(DATALIST_ELEMENT)
-    RefPtr<HTMLElement> list() const;
+    WEBCORE_EXPORT RefPtr<HTMLElement> list() const;
     RefPtr<HTMLDataListElement> dataList() const;
     void listAttributeTargetChanged();
 #endif
index 980a2be..365c2c2 100644 (file)
@@ -250,11 +250,14 @@ void HTMLOptionElement::childrenChanged(const ChildChange& change)
 #if ENABLE(DATALIST_ELEMENT)
 HTMLDataListElement* HTMLOptionElement::ownerDataListElement() const
 {
-    for (RefPtr<ContainerNode> parent = parentNode(); parent ; parent = parent->parentNode()) {
-        if (is<HTMLDataListElement>(*parent))
-            return downcast<HTMLDataListElement>(parent);
-    }
-    return nullptr;
+    RefPtr<ContainerNode> datalist = parentNode();
+    while (datalist && !is<HTMLDataListElement>(*datalist))
+        datalist = datalist->parentNode();
+
+    if (!datalist)
+        return nullptr;
+
+    return downcast<HTMLDataListElement>(datalist.get());
 }
 #endif
 
index c44ee8c..d67e27a 100644 (file)
@@ -1000,10 +1000,12 @@ void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paint
         return;
 
     auto& input = downcast<HTMLInputElement>(*o.node());
-    auto* dataList = downcast<HTMLDataListElement>(input.list());
-    if (!dataList)
+
+    if (!input.list())
         return;
 
+    auto& dataList = downcast<HTMLDataListElement>(*input.list());
+
     double min = input.minimum();
     double max = input.maximum();
     ControlPart part = o.style().appearance();
@@ -1051,7 +1053,7 @@ void RenderTheme::paintSliderTicks(const RenderObject& o, const PaintInfo& paint
         tickRegionSideMargin = trackBounds.y() + (thumbSize.width() - tickSize.width() * zoomFactor) / 2.0;
         tickRegionWidth = trackBounds.height() - thumbSize.width();
     }
-    Ref<HTMLCollection> options = dataList->options();
+    Ref<HTMLCollection> options = dataList.options();
     GraphicsContextStateSaver stateSaver(paintInfo.context());
     paintInfo.context().setFillColor(o.style().visitedDependentColorWithColorFilter(CSSPropertyColor));
     for (unsigned i = 0; Node* node = options->item(i); i++) {
index c748e88..67e0015 100644 (file)
@@ -1,3 +1,12 @@
+2018-05-30  Aditya Keerthi  <akeerthi@apple.com>
+
+        Fix the ENABLE(DATALIST_ELEMENT) build
+        https://bugs.webkit.org/show_bug.cgi?id=186105
+
+        Reviewed by Wenson Hsieh.
+
+        * WebProcess/Automation/WebAutomationSessionProxy.cpp:
+
 2018-05-30  Jiewen Tan  <jiewen_tan@apple.com>
 
         Unreviewed, a quick build fix for r232276.
index 1f8ac9b..b316c3e 100644 (file)
 #include <WebCore/RenderElement.h>
 #include <wtf/UUID.h>
 
+#if ENABLE(DATALIST_ELEMENT)
+#include <WebCore/HTMLDataListElement.h>
+#endif
+
 namespace WebKit {
 
 template <typename T>