Title: [156347] trunk/Source/WebCore
Revision
156347
Author
[email protected]
Date
2013-09-24 12:14:42 -0700 (Tue, 24 Sep 2013)

Log Message

[iOS] Upstream -webkit-touch-callout
https://bugs.webkit.org/show_bug.cgi?id=121507

Reviewed by Antti Koivisto.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPropertyNames.in: Added -webkit-touch-callout.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::willRespondToMouseClickEvents): Added.
* html/HTMLImageElement.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (156346 => 156347)


--- trunk/Source/WebCore/ChangeLog	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/ChangeLog	2013-09-24 19:14:42 UTC (rev 156347)
@@ -1,3 +1,26 @@
+2013-09-24  Daniel Bates  <[email protected]>
+
+        [iOS] Upstream -webkit-touch-callout
+        https://bugs.webkit.org/show_bug.cgi?id=121507
+
+        Reviewed by Antti Koivisto.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPropertyNames.in: Added -webkit-touch-callout.
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::willRespondToMouseClickEvents): Added.
+        * html/HTMLImageElement.h:
+        * rendering/style/RenderStyle.h:
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator==):
+        * rendering/style/StyleRareInheritedData.h:
+
 2013-09-24  Bem Jones-Bey  <[email protected]>
 
         Properly handle bottom margin on float with shape-outside

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (156346 => 156347)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2013-09-24 19:14:42 UTC (rev 156347)
@@ -339,6 +339,9 @@
     CSSPropertyWebkitPerspectiveOrigin,
     CSSPropertyWebkitPrintColorAdjust,
     CSSPropertyWebkitRtlOrdering,
+#if PLATFORM(IOS)
+    CSSPropertyWebkitTouchCallout,
+#endif
 #if ENABLE(CSS_SHAPES)
     CSSPropertyWebkitShapeInside,
     CSSPropertyWebkitShapeOutside,
@@ -2690,6 +2693,10 @@
         case CSSPropertyWebkitTapHighlightColor:
             return currentColorOrValidColor(style.get(), style->tapHighlightColor());
 #endif
+#if PLATFORM(IOS)
+        case CSSPropertyWebkitTouchCallout:
+            return cssValuePool().createIdentifierValue(style->touchCalloutEnabled() ? CSSValueDefault : CSSValueNone);
+#endif
         case CSSPropertyWebkitUserDrag:
             return cssValuePool().createValue(style->userDrag());
         case CSSPropertyWebkitUserSelect:

Modified: trunk/Source/WebCore/css/CSSParser.cpp (156346 => 156347)


--- trunk/Source/WebCore/css/CSSParser.cpp	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2013-09-24 19:14:42 UTC (rev 156347)
@@ -2835,6 +2835,13 @@
             return parseDashboardRegions(propId, important);
         break;
 #endif
+
+#if PLATFORM(IOS)
+    case CSSPropertyWebkitTouchCallout:
+        if (id == CSSValueDefault || id == CSSValueNone)
+            validPrimitive = true;
+        break;
+#endif
     // End Apple-specific properties
 
 #if ENABLE(DRAGGABLE_REGION)

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (156346 => 156347)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2013-09-24 19:14:42 UTC (rev 156347)
@@ -454,3 +454,6 @@
 #if defined(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) && ENABLE_ACCELERATED_OVERFLOW_SCROLLING
 -webkit-overflow-scrolling [Inherited]
 #endif
+#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
+-webkit-touch-callout [Inherited]
+#endif

Modified: trunk/Source/WebCore/css/StyleResolver.cpp (156346 => 156347)


--- trunk/Source/WebCore/css/StyleResolver.cpp	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2013-09-24 19:14:42 UTC (rev 156347)
@@ -2576,6 +2576,16 @@
             state.style()->setPerspective(perspectiveValue);
         return;
     }
+#if PLATFORM(IOS)
+    case CSSPropertyWebkitTouchCallout: {
+        HANDLE_INHERIT_AND_INITIAL(touchCalloutEnabled, TouchCalloutEnabled);
+        if (!primitiveValue)
+            break;
+
+        state.style()->setTouchCalloutEnabled(primitiveValue->getStringValue().lower() != "none");
+        return;
+    }
+#endif
 #if ENABLE(TOUCH_EVENTS)
     case CSSPropertyWebkitTapHighlightColor: {
         HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor);

Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (156346 => 156347)


--- trunk/Source/WebCore/html/HTMLImageElement.cpp	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp	2013-09-24 19:14:42 UTC (rev 156347)
@@ -380,4 +380,16 @@
     return document().completeURL(stripLeadingAndTrailingHTMLSpaces(usemap)).isEmpty();
 }
 
+#if PLATFORM(IOS)
+// FIXME: This is a workaround for <rdar://problem/7725158>. We should find a better place for the touchCalloutEnabled() logic.
+bool HTMLImageElement::willRespondToMouseClickEvents()
+{
+    RenderObject* renderer = this->renderer();
+    RenderStyle* style = renderer ? renderer->style() : nullptr;
+    if (!style || style->touchCalloutEnabled())
+        return true;
+    return HTMLElement::willRespondToMouseClickEvents();
 }
+#endif
+
+}

Modified: trunk/Source/WebCore/html/HTMLImageElement.h (156346 => 156347)


--- trunk/Source/WebCore/html/HTMLImageElement.h	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/html/HTMLImageElement.h	2013-09-24 19:14:42 UTC (rev 156347)
@@ -73,6 +73,10 @@
 
     bool complete() const;
 
+#if PLATFORM(IOS)
+    virtual bool willRespondToMouseClickEvents() OVERRIDE;
+#endif
+
     bool hasPendingActivity() const { return m_imageLoader.hasPendingActivity(); }
 
     virtual bool canContainRangeEndPoint() const { return false; }

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (156346 => 156347)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2013-09-24 19:14:42 UTC (rev 156347)
@@ -934,6 +934,9 @@
 #if ENABLE(TOUCH_EVENTS)
     Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
 #endif
+#if PLATFORM(IOS)
+    bool touchCalloutEnabled() const { return rareInheritedData->touchCalloutEnabled; }
+#endif
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
     bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
 #endif
@@ -1441,6 +1444,9 @@
 #if ENABLE(TOUCH_EVENTS)
     void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
 #endif
+#if PLATFORM(IOS)
+    void setTouchCalloutEnabled(bool v) { SET_VAR(rareInheritedData, touchCalloutEnabled, v); }
+#endif
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
     void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
 #endif
@@ -1781,6 +1787,9 @@
 #if ENABLE(IOS_TEXT_AUTOSIZING)
     static TextSizeAdjustment initialTextSizeAdjust() { return TextSizeAdjustment(); }
 #endif
+#if PLATFORM(IOS)
+    static bool initialTouchCalloutEnabled() { return true; }
+#endif
 #if ENABLE(TOUCH_EVENTS)
     static Color initialTapHighlightColor();
 #endif

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (156346 => 156347)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2013-09-24 19:14:42 UTC (rev 156347)
@@ -113,6 +113,9 @@
     , m_textUnderlinePosition(RenderStyle::initialTextUnderlinePosition())
 #endif // CSS3_TEXT
     , m_rubyPosition(RenderStyle::initialRubyPosition())
+#if PLATFORM(IOS)
+    , touchCalloutEnabled(RenderStyle::initialTouchCalloutEnabled())
+#endif
     , hyphenationLimitBefore(-1)
     , hyphenationLimitAfter(-1)
     , hyphenationLimitLines(-1)
@@ -191,6 +194,9 @@
     , m_textUnderlinePosition(o.m_textUnderlinePosition)
 #endif // CSS3_TEXT
     , m_rubyPosition(o.m_rubyPosition)
+#if PLATFORM(IOS)
+    , touchCalloutEnabled(o.touchCalloutEnabled)
+#endif
     , hyphenationString(o.hyphenationString)
     , hyphenationLimitBefore(o.hyphenationLimitBefore)
     , hyphenationLimitAfter(o.hyphenationLimitAfter)
@@ -286,6 +292,9 @@
         && m_textIndentType == o.m_textIndentType
 #endif
         && m_lineBoxContain == o.m_lineBoxContain
+#if PLATFORM(IOS)
+        && touchCalloutEnabled == o.touchCalloutEnabled
+#endif
         && hyphenationString == o.hyphenationString
         && locale == o.locale
         && textEmphasisCustomMark == o.textEmphasisCustomMark

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (156346 => 156347)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2013-09-24 19:02:59 UTC (rev 156346)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2013-09-24 19:14:42 UTC (rev 156347)
@@ -128,6 +128,10 @@
 #endif // CSS3_TEXT
     unsigned m_rubyPosition : 1; // RubyPosition
 
+#if PLATFORM(IOS)
+    unsigned touchCalloutEnabled : 1;
+#endif
+
     AtomicString hyphenationString;
     short hyphenationLimitBefore;
     short hyphenationLimitAfter;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to