Changeset 96433 in webkit
- Timestamp:
- Sep 30, 2011 3:31:01 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r96431 r96433 1 2011-09-30 Johnny Ding <jnd@chromium.org> 2 3 Support -webkit-tap-highlight-color in WebCore when enabling touch events support. 4 https://bugs.webkit.org/show_bug.cgi?id=48544. 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Add a layout test to get customized tap highlight color set by page author. 9 10 * fast/css/getComputedStyle/computed-style-without-renderer.html: 11 * fast/css/getComputedStyle/computed-style.html: 12 * fast/events/touch/script-tests/tap-highlight-color.js: Added. 13 (onTouchStart): 14 (touchTargets): 15 * fast/events/touch/tap-highlight-color-expected.txt: Added. 16 * fast/events/touch/tap-highlight-color.html: Added. 17 * svg/css/getComputedStyle-basic.xhtml: 18 1 19 2011-09-30 David Hyatt <hyatt@apple.com> 2 20 -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer.html
r69220 r96433 29 29 for (var i = 0; i != style.length; ++i) { 30 30 var name = style.item(i); 31 if (name != "-webkit-dashboard-region") 31 // "-webkit-tap-highlight-color" is only available on the 32 // ports which have enabled TOUCH_EVENTS flag. We test it in 33 // layout test fast/events/touch/tap-highlight-color.html. 34 if (name != "-webkit-dashboard-region" && 35 name != "-webkit-tap-highlight-color") 32 36 log(" " + name + ": " + style.getPropertyValue(name)); 33 37 } -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style.html
r69220 r96433 8 8 var name = style.item(i); 9 9 var value = style.getPropertyValue(name); 10 if (name != "-webkit-dashboard-region") 10 // "-webkit-tap-highlight-color" is only available on the ports 11 // which have enabled TOUCH_EVENTS flag. We test it in layout test 12 // fast/events/touch/tap-highlight-color.html. 13 if (name != "-webkit-dashboard-region" && 14 name != "-webkit-tap-highlight-color") 11 15 text += name + ": " + value + ";\n"; 12 16 } -
trunk/LayoutTests/svg/css/getComputedStyle-basic.xhtml
r69220 r96433 25 25 var value = style.getPropertyValue(name); 26 26 var cssValue = style.getPropertyCSSValue(name); 27 28 if (name != "-webkit-dashboard-region") { 27 // "-webkit-tap-highlight-color" is only available on the ports 28 // which have enabled TOUCH_EVENTS flag. We test it in layout test 29 // fast/events/touch/tap-highlight-color.html. 30 if (name != "-webkit-dashboard-region" && 31 name != "-webkit-tap-highlight-color") { 29 32 debugLog(elementId + ": style.getPropertyValue(" + name + ") : " + value); 30 33 debugLog(elementId + ": style.getPropertyCSSValue(" + name + ") : " + cssValue); -
trunk/Source/WebCore/ChangeLog
r96431 r96433 1 2011-09-30 Johnny Ding <jnd@chromium.org> 2 3 Support -webkit-tap-highlight-color when enabling touch events support. 4 https://bugs.webkit.org/show_bug.cgi?id=48544 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Original code from the iOS WebCore code dump, extracted and modified by tijiang@rim and jnd@chromium. 9 Supports the new CSS property -webkit-tap-highlight-color on platforms which support touch events. 10 Platform can override WebCore::RenderTheme::platformTapHighlightColor to use its own platform 11 specific default tap highlight color. Otherwise RenderTheme::defaultTapHighlightColor will be 12 used as default tap highlight color. 13 14 Test: fast/events/touch/tap-highlight-color.html 15 16 * css/CSSComputedStyleDeclaration.cpp: 17 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 18 * css/CSSParser.cpp: 19 (WebCore::CSSParser::parseValue): 20 * css/CSSPropertyNames.in: 21 * css/CSSStyleSelector.cpp: 22 (WebCore::CSSStyleSelector::applyProperty): 23 * rendering/RenderTheme.cpp: 24 (WebCore::RenderTheme::tapHighlightColor): 25 * rendering/RenderTheme.h: 26 (WebCore::RenderTheme::platformTapHighlightColor): 27 * rendering/style/RenderStyle.cpp: 28 (WebCore::RenderStyle::initialTapHighlightColor): 29 * rendering/style/RenderStyle.h: 30 (WebCore::InheritedFlags::tapHighlightColor): 31 (WebCore::InheritedFlags::setTapHighlightColor): 32 * rendering/style/StyleRareInheritedData.cpp: 33 (WebCore::StyleRareInheritedData::StyleRareInheritedData): 34 (WebCore::StyleRareInheritedData::operator==): 35 * rendering/style/StyleRareInheritedData.h: 36 1 37 2011-09-30 David Hyatt <hyatt@apple.com> 2 38 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r95888 r96433 248 248 CSSPropertyWebkitPerspectiveOrigin, 249 249 CSSPropertyWebkitRtlOrdering, 250 #if ENABLE(TOUCH_EVENTS) 251 CSSPropertyWebkitTapHighlightColor, 252 #endif 250 253 CSSPropertyWebkitTextCombine, 251 254 CSSPropertyWebkitTextDecorationsInEffect, … … 1798 1801 case CSSPropertyWebkitRtlOrdering: 1799 1802 return primitiveValueCache->createIdentifierValue(style->rtlOrdering() ? CSSValueVisual : CSSValueLogical); 1803 #if ENABLE(TOUCH_EVENTS) 1804 case CSSPropertyWebkitTapHighlightColor: 1805 return currentColorOrValidColor(style.get(), style->tapHighlightColor()); 1806 #endif 1800 1807 case CSSPropertyWebkitUserDrag: 1801 1808 return primitiveValueCache->createValue(style->userDrag()); -
trunk/Source/WebCore/css/CSSParser.cpp
r96276 r96433 1935 1935 // End Apple-specific properties 1936 1936 1937 #if ENABLE(TOUCH_EVENTS) 1938 case CSSPropertyWebkitTapHighlightColor: 1939 if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu 1940 || (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && !m_strict)) { 1941 validPrimitive = true; 1942 } else { 1943 parsedValue = parseColor(); 1944 if (parsedValue) 1945 m_valueList->next(); 1946 } 1947 break; 1948 #endif 1937 1949 /* shorthand properties */ 1938 1950 case CSSPropertyBackground: { -
trunk/Source/WebCore/css/CSSPropertyNames.in
r95888 r96433 356 356 -webkit-region-break-before 357 357 -webkit-region-break-inside 358 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS 359 -webkit-tap-highlight-color 360 #endif 358 361 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r96393 r96433 3635 3635 return; 3636 3636 } 3637 #if ENABLE(TOUCH_EVENTS) 3638 case CSSPropertyWebkitTapHighlightColor: { 3639 HANDLE_INHERIT_AND_INITIAL(tapHighlightColor, TapHighlightColor); 3640 if (!primitiveValue) 3641 break; 3642 3643 Color col = getColorFromPrimitiveValue(primitiveValue); 3644 m_style->setTapHighlightColor(col); 3645 return; 3646 } 3647 #endif 3637 3648 case CSSPropertyWebkitColorCorrection: 3638 3649 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(colorSpace, ColorSpace); -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r94149 r96433 1085 1085 } 1086 1086 1087 #if ENABLE(TOUCH_EVENTS) 1088 Color RenderTheme::tapHighlightColor() 1089 { 1090 return defaultTheme()->platformTapHighlightColor(); 1091 } 1092 #endif 1093 1087 1094 void RenderTheme::setCustomFocusRingColor(const Color& c) 1088 1095 { -
trunk/Source/WebCore/rendering/RenderTheme.h
r90048 r96433 150 150 virtual Color platformFocusRingColor() const { return Color(0, 0, 0); } 151 151 static void setCustomFocusRingColor(const Color&); 152 152 #if ENABLE(TOUCH_EVENTS) 153 static Color tapHighlightColor(); 154 virtual Color platformTapHighlightColor() const { return RenderTheme::defaultTapHighlightColor; } 155 #endif 153 156 virtual void platformColorsDidChange(); 154 157 … … 331 334 mutable Color m_inactiveListBoxSelectionForegroundColor; 332 335 336 #if ENABLE(TOUCH_EVENTS) 337 static const RGBA32 defaultTapHighlightColor = 0x33000000; 338 #endif 339 333 340 #if USE(NEW_THEME) 334 341 Theme* m_theme; // The platform-specific theme. -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r96393 r96433 35 35 #include "ShadowData.h" 36 36 #include "StyleImage.h" 37 #if ENABLE(TOUCH_EVENTS) 38 #include "RenderTheme.h" 39 #endif 37 40 #include <wtf/StdLibExtras.h> 38 41 #include <algorithm> … … 1512 1515 } 1513 1516 1517 #if ENABLE(TOUCH_EVENTS) 1518 Color RenderStyle::initialTapHighlightColor() 1519 { 1520 return RenderTheme::tapHighlightColor(); 1521 } 1522 #endif 1523 1514 1524 void RenderStyle::getImageOutsets(const NinePieceImage& image, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const 1515 1525 { … … 1531 1541 bottom = NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth()); 1532 1542 } 1533 1543 1534 1544 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r96393 r96433 837 837 LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; } 838 838 const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; } 839 #if ENABLE(TOUCH_EVENTS) 840 Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; } 841 #endif 839 842 bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; } 840 843 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); } … … 1218 1221 void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); } 1219 1222 void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); } 1223 #if ENABLE(TOUCH_EVENTS) 1224 void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); } 1225 #endif 1220 1226 bool setTextSizeAdjust(bool); 1221 1227 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); } … … 1467 1473 static bool initialTextSizeAdjust() { return true; } 1468 1474 static ETextSecurity initialTextSecurity() { return TSNONE; } 1475 #if ENABLE(TOUCH_EVENTS) 1476 static Color initialTapHighlightColor(); 1477 #endif 1469 1478 #if ENABLE(DASHBOARD_SUPPORT) 1470 1479 static const Vector<StyleDashboardRegion>& initialDashboardRegions(); -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp
r94710 r96433 57 57 , hyphenationLimitAfter(-1) 58 58 , hyphenationLimitLines(-1) 59 #if ENABLE(TOUCH_EVENTS) 60 , tapHighlightColor(RenderStyle::initialTapHighlightColor()) 61 #endif 59 62 { 60 63 } … … 96 99 , locale(o.locale) 97 100 , textEmphasisCustomMark(o.textEmphasisCustomMark) 101 #if ENABLE(TOUCH_EVENTS) 102 , tapHighlightColor(o.tapHighlightColor) 103 #endif 98 104 { 99 105 } … … 118 124 && textFillColor == o.textFillColor 119 125 && textEmphasisColor == o.textEmphasisColor 126 #if ENABLE(TOUCH_EVENTS) 127 && tapHighlightColor == o.tapHighlightColor 128 #endif 120 129 && shadowDataEquivalent(o) 121 130 && highlight == o.highlight -
trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h
r94710 r96433 99 99 AtomicString textEmphasisCustomMark; 100 100 RefPtr<QuotesData> quotes; 101 #if ENABLE(TOUCH_EVENTS) 102 Color tapHighlightColor; 103 #endif 101 104 102 105 private:
Note: See TracChangeset
for help on using the changeset viewer.