Title: [232306] trunk/Source
Revision
232306
Author
[email protected]
Date
2018-05-30 13:35:11 -0700 (Wed, 30 May 2018)

Log Message

Fix the ENABLE(DATALIST_ELEMENT) build
https://bugs.webkit.org/show_bug.cgi?id=186105

Patch by Aditya Keerthi <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232305 => 232306)


--- trunk/Source/WebCore/ChangeLog	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/ChangeLog	2018-05-30 20:35:11 UTC (rev 232306)
@@ -1,3 +1,19 @@
+2018-05-30  Aditya Keerthi  <[email protected]>
+
+        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  <[email protected]>
 
         Reduce String allocations

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (232305 => 232306)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-05-30 20:35:11 UTC (rev 232306)
@@ -4832,7 +4832,7 @@
 		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 */; };

Modified: trunk/Source/WebCore/html/ColorInputType.cpp (232305 => 232306)


--- trunk/Source/WebCore/html/ColorInputType.cpp	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/html/ColorInputType.cpp	2018-05-30 20:35:11 UTC (rev 232306)
@@ -253,7 +253,7 @@
         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));
         }
     }

Modified: trunk/Source/WebCore/html/HTMLInputElement.h (232305 => 232306)


--- trunk/Source/WebCore/html/HTMLInputElement.h	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/html/HTMLInputElement.h	2018-05-30 20:35:11 UTC (rev 232306)
@@ -268,7 +268,7 @@
     bool willRespondToMouseClickEvents() override;
 
 #if ENABLE(DATALIST_ELEMENT)
-    RefPtr<HTMLElement> list() const;
+    WEBCORE_EXPORT RefPtr<HTMLElement> list() const;
     RefPtr<HTMLDataListElement> dataList() const;
     void listAttributeTargetChanged();
 #endif

Modified: trunk/Source/WebCore/html/HTMLOptionElement.cpp (232305 => 232306)


--- trunk/Source/WebCore/html/HTMLOptionElement.cpp	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/html/HTMLOptionElement.cpp	2018-05-30 20:35:11 UTC (rev 232306)
@@ -250,11 +250,14 @@
 #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
 

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (232305 => 232306)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2018-05-30 20:35:11 UTC (rev 232306)
@@ -1000,10 +1000,12 @@
         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 @@
         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++) {

Modified: trunk/Source/WebKit/ChangeLog (232305 => 232306)


--- trunk/Source/WebKit/ChangeLog	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebKit/ChangeLog	2018-05-30 20:35:11 UTC (rev 232306)
@@ -1,3 +1,12 @@
+2018-05-30  Aditya Keerthi  <[email protected]>
+
+        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  <[email protected]>
 
         Unreviewed, a quick build fix for r232276.

Modified: trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp (232305 => 232306)


--- trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2018-05-30 20:05:41 UTC (rev 232305)
+++ trunk/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp	2018-05-30 20:35:11 UTC (rev 232306)
@@ -56,6 +56,10 @@
 #include <WebCore/RenderElement.h>
 #include <wtf/UUID.h>
 
+#if ENABLE(DATALIST_ELEMENT)
+#include <WebCore/HTMLDataListElement.h>
+#endif
+
 namespace WebKit {
 
 template <typename T>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to