Update the CSS property used to support draggable regions.
authorjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2012 00:06:59 +0000 (00:06 +0000)
committerjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Oct 2012 00:06:59 +0000 (00:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=97156

Reviewed by Adam Barth.

Source/JavaScriptCore:

The CSS property to support draggable regions, guarded under
WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
confusion with DASHBOARD_SUPPORT feature.

* Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.

Source/WebCore:

The CSS property to support draggable regions has been changed from
"-webkit-widget-region" to "-webkit-app-region" in the following syntax:
   -webkit-app-region: drag|no-drag

The CSS parsing code for draggable regions is now different from the CSS
parsing code for dashboard regions since we have quite different syntax.

We still try to share as much rendering update code as possible for
these two features. To make the shared code easier to understand for
both features, the name "DashboardRegions" in the shared code is changed
to "AnnotatedRegions" to work for both dashboard regions and draggable
regions.

Note that we still using WIDGET_REGION as feature name in order not to
add more changes to this patch. It will be renamed to a more appropriate
name in next patch. WIDGET_REGION is now only turned on for the chromium
port.

Test: fast/css/draggable-region-parser.html

* Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
* WebCore.exp.in: Update the exported symbol due to renaming.
* css/CSSComputedStyleDeclaration.cpp: Update the CSS parsing.
(WebCore):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp: Update the CSS parsing.
(WebCore::CSSParser::parseValue):
(WebCore):
(WebCore::CSSParser::parseDashboardRegions):
* css/CSSParserValues.cpp: Update the CSS parsing.
(WebCore::CSSParserValue::createCSSValue):
* css/CSSPrimitiveValue.cpp: Update the CSS parsing.
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::customCssText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::reportDescendantMemoryUsage):
* css/CSSPrimitiveValue.h: Update the CSS parsing.
(CSSPrimitiveValue):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in: Rename the CSS property for draggable region.
* css/CSSValueKeywords.in: Add the keywords supported for the draggable region.
* css/DashboardRegion.h: Remove WIDGET_REGION guard.
(DashboardRegion):
* css/StyleResolver.cpp: Update the CSS parsing.
(WebCore::StyleResolver::collectMatchingRulesForList):
* dom/Document.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::Document::Document):
(WebCore::Document::annotatedRegions):
(WebCore::Document::setAnnotatedRegions):
(WebCore::Document::reportMemoryUsage):
* dom/Document.h: Rename dashboardRegions to annotatedRegions.
(WebCore):
(WebCore::Document::setAnnotatedRegionsDirty):
(WebCore::Document::annotatedRegionsDirty):
(WebCore::Document::hasAnnotatedRegions):
(WebCore::Document::setHasAnnotatedRegions):
(Document):
* page/Chrome.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::ChromeClient::annotatedRegionsChanged):
* page/ChromeClient.h: Rename dashboardRegions to annotatedRegions.
(ChromeClient):
* page/FrameView.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::FrameView::layout):
(WebCore::FrameView::updateAnnotatedRegions):
(WebCore::FrameView::paintContents):
* page/FrameView.h: Rename dashboardRegions to annotatedRegions.
(FrameView):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addAnnotatedRegions):
* rendering/RenderInline.h: Rename dashboardRegions to annotatedRegions.
(RenderInline):
* rendering/RenderLayer.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
* rendering/RenderListBox.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::RenderListBox::setHasVerticalScrollbar):
* rendering/RenderObject.cpp: Rename dashboardRegions to annotatedRegions.
(WebCore::RenderObject::styleWillChange):
(WebCore::RenderObject::addAnnotatedRegions):
(WebCore::RenderObject::collectAnnotatedRegions):
* rendering/RenderObject.h: Rename dashboardRegions to annotatedRegions.
(WebCore::AnnotatedRegionValue::operator==):
(WebCore::AnnotatedRegionValue::operator!=):
(AnnotatedRegionValue):
(RenderObject):
* rendering/style/RenderStyle.cpp: Update the CSS parsing.
(WebCore::RenderStyle::diff):
(WebCore):
* rendering/style/RenderStyle.h: Update the CSS parsing.
* rendering/style/RenderStyleConstants.h: Update the CSS parsing.
* rendering/style/StyleDashboardRegion.h: Update the CSS parsing.
* rendering/style/StyleRareNonInheritedData.cpp: Update the CSS parsing.
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h: Update the CSS parsing.
(WebCore):
(StyleRareNonInheritedData):

Source/WebKit/chromium:

Update the code to use the new name annotatedRegions to work for
both features.

* public/WebDraggableRegion.h: Rename dashboardRegions to annotatedRegions.
(WebDraggableRegion):
* src/ChromeClientImpl.cpp: Rename dashboardRegions to annotatedRegions.
(WebKit::ChromeClientImpl::annotatedRegionsChanged):
* src/ChromeClientImpl.h: Rename dashboardRegions to annotatedRegions.
(ChromeClientImpl):
* src/WebDocument.cpp: Rename dashboardRegions to annotatedRegions.
(WebKit::WebDocument::draggableRegions):

Source/WebKit/mac:

The CSS property to support draggable regions, guarded under
WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
confusion with DASHBOARD_SUPPORT feature.

Also update the code to use the new name annotatedRegions to work for
both features.

* Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
* WebCoreSupport/WebChromeClient.h: Rename dashboardRegions to annotatedRegions.
* WebCoreSupport/WebChromeClient.mm: Rename dashboardRegions to annotatedRegions.
(WebChromeClient::annotatedRegionsChanged):
* WebView/WebView.mm: Rename dashboardRegions to annotatedRegions.
(-[WebView _dashboardRegions]):

Source/WebKit2:

The CSS property to support draggable regions, guarded under
WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
confusion with DASHBOARD_SUPPORT feature.

Also update the code to use the new name annotatedRegions to work for
both features.

* Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
* WebProcess/WebCoreSupport/WebChromeClient.cpp: Rename dashboardRegions to annotatedRegions.
(WebKit::WebChromeClient::annotatedRegionsChanged):
* WebProcess/WebCoreSupport/WebChromeClient.h: Rename dashboardRegions to annotatedRegions.
(WebChromeClient):

LayoutTests:

Update the test and rename the files due to CSS property name and
syntax changes.

* fast/css/draggable-region-parser-expected.txt: Added.
* fast/css/draggable-region-parser.html: Added.
* fast/css/widget-region-parser-expected.txt: Removed.
* fast/css/widget-region-parser.html: Removed.
* platform/efl/TestExpectations: Rename the skipped test.
* platform/gtk/TestExpectations: Rename the skipped test.
* platform/mac/TestExpectations: Skip the renamed test since WIDGET_REGION is off.
* platform/qt/TestExpectations: Rename the skipped test.
* platform/win/TestExpectations: Rename the skipped test.
* platform/wincairo/TestExpectations: Rename the skipped test.

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

58 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/draggable-region-parser-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/draggable-region-parser.html [new file with mode: 0644]
LayoutTests/fast/css/widget-region-parser-expected.txt [deleted file]
LayoutTests/fast/css/widget-region-parser.html [deleted file]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wincairo/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/WebCore.exp.in
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSParserValues.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/DashboardRegion.h
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleDashboardRegion.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebDraggableRegion.h
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/chromium/src/WebDocument.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

index 827a085..884f3af 100644 (file)
@@ -1,3 +1,24 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        Update the test and rename the files due to CSS property name and
+        syntax changes.
+
+        * fast/css/draggable-region-parser-expected.txt: Added.
+        * fast/css/draggable-region-parser.html: Added.
+        * fast/css/widget-region-parser-expected.txt: Removed.
+        * fast/css/widget-region-parser.html: Removed.
+        * platform/efl/TestExpectations: Rename the skipped test.
+        * platform/gtk/TestExpectations: Rename the skipped test.
+        * platform/mac/TestExpectations: Skip the renamed test since WIDGET_REGION is off.
+        * platform/qt/TestExpectations: Rename the skipped test.
+        * platform/win/TestExpectations: Rename the skipped test.
+        * platform/wincairo/TestExpectations: Rename the skipped test.
+
 2012-10-09  Kiran Muppala  <cmuppala@apple.com>
 
         Fix coding style of layout test fast/dom/timer-throttling-hidden-page.html
diff --git a/LayoutTests/fast/css/draggable-region-parser-expected.txt b/LayoutTests/fast/css/draggable-region-parser-expected.txt
new file mode 100644 (file)
index 0000000..5f1acb7
--- /dev/null
@@ -0,0 +1,37 @@
+This tests the parser and serializer for draggable region values.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS parseDraggableRegion('drag') is 'drag'
+PASS parseDraggableRegion('no-drag') is 'no-drag'
+
+Tests for variations in whitespace that are allowed.
+
+PASS parseDraggableRegion('  drag  ') is 'drag'
+PASS parseDraggableRegion('  no-drag    ') is 'no-drag'
+
+Tests for case insensitivity.
+
+PASS parseDraggableRegion('Drag') is 'drag'
+PASS parseDraggableRegion('DrAG') is 'drag'
+PASS parseDraggableRegion('NO-DrAG') is 'no-drag'
+PASS parseDraggableRegion('NO-DRAG') is 'no-drag'
+
+Some expected failures.
+
+PASS parseDraggableRegion('') is null
+PASS parseDraggableRegion(' ') is null
+PASS parseDraggableRegion('x') is null
+PASS parseDraggableRegion('x-') is null
+PASS parseDraggableRegion('x()') is null
+PASS parseDraggableRegion('x(a)') is null
+PASS parseDraggableRegion('none x') is null
+PASS parseDraggableRegion('none x()') is null
+PASS parseDraggableRegion('none x(a)') is null
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/draggable-region-parser.html b/LayoutTests/fast/css/draggable-region-parser.html
new file mode 100644 (file)
index 0000000..617567a
--- /dev/null
@@ -0,0 +1,68 @@
+<html>
+<head>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("This tests the parser and serializer for draggable region values.");
+
+var style = document.getElementById('description').style;
+
+function parseDraggableRegion(string)
+{
+    try {
+        style.removeProperty("-webkit-app-region");
+        style.setProperty("-webkit-app-region", string, "");
+        var result = style.getPropertyValue("-webkit-app-region");
+        style.removeProperty("-webkit-app-region");
+        return result;
+    } catch (e) {
+        return "" + e;
+    }
+}
+
+debug('');
+
+shouldBe("parseDraggableRegion('drag')", "'drag'");
+shouldBe("parseDraggableRegion('no-drag')", "'no-drag'");
+
+debug('');
+debug('Tests for variations in whitespace that are allowed.');
+debug('');
+
+shouldBe("parseDraggableRegion('  drag  ')", "'drag'");
+shouldBe("parseDraggableRegion('  no-drag    ')", "'no-drag'");
+
+debug('');
+debug('Tests for case insensitivity.');
+debug('');
+
+shouldBe("parseDraggableRegion('Drag')", "'drag'");
+shouldBe("parseDraggableRegion('DrAG')", "'drag'");
+shouldBe("parseDraggableRegion('NO-DrAG')", "'no-drag'");
+shouldBe("parseDraggableRegion('NO-DRAG')", "'no-drag'");
+
+debug('');
+debug('Some expected failures.');
+debug('');
+
+shouldBe("parseDraggableRegion('')", "null");
+shouldBe("parseDraggableRegion(' ')", "null");
+shouldBe("parseDraggableRegion('x')", "null");
+shouldBe("parseDraggableRegion('x-')", "null");
+shouldBe("parseDraggableRegion('x()')", "null");
+shouldBe("parseDraggableRegion('x(a)')", "null");
+shouldBe("parseDraggableRegion('none x')", "null");
+shouldBe("parseDraggableRegion('none x()')", "null");
+shouldBe("parseDraggableRegion('none x(a)')", "null");
+
+debug('');
+
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/css/widget-region-parser-expected.txt b/LayoutTests/fast/css/widget-region-parser-expected.txt
deleted file mode 100644 (file)
index 8f6c195..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-This tests the parser and serializer for widget region values.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS parseWidgetRegion('none') is 'none'
-
-PASS parseWidgetRegion('region(label circle)') is 'region(label circle)'
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px)') is 'region(label circle 1px 2px 3px 4px)'
-PASS parseWidgetRegion('region(label circle 0px 0px 0px 0px)') is 'region(label circle 0px 0px 0px 0px)'
-PASS parseWidgetRegion('region(label circle auto auto auto auto)') is 'region(label circle auto auto auto auto)'
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px)') is 'region(label circle 1px 2px 3px 4px)'
-
-PASS parseWidgetRegion('region(label rectangle)') is 'region(label rectangle)'
-PASS parseWidgetRegion('region(label rectangle 1px 2px 3px 4px)') is 'region(label rectangle 1px 2px 3px 4px)'
-
-PASS parseWidgetRegion('region(label circle) region(label circle)') is 'region(label circle) region(label circle)'
-PASS parseWidgetRegion('region(label circle) region(label rectangle)') is 'region(label circle) region(label rectangle)'
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)') is 'region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)'
-PASS parseWidgetRegion('region(label rectangle 1px 2px 3px 4px) region(label circle 5px 6px 7px 8px)') is 'region(label rectangle 1px 2px 3px 4px) region(label circle 5px 6px 7px 8px)'
-
-Tests to demonstrate that commas are allowed.
-
-PASS parseWidgetRegion('region(label, circle)') is 'region(label circle)'
-PASS parseWidgetRegion('region(label, circle, 1px, 2px, 3px, 4px)') is 'region(label circle 1px 2px 3px 4px)'
-
-Tests for variations in whitespace that are allowed.
-
-PASS parseWidgetRegion('  region(  label  circle  )  ') is 'region(label circle)'
-PASS parseWidgetRegion('  region(  label   circle  1px  2px  3px  4px  )  region(label  rectangle  5px  6px  7px  8px  )  ') is 'region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)'
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px)region(label rectangle 5px 6px 7px 8px)') is 'region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)'
-
-Tests for case insensitivity.
-
-PASS parseWidgetRegion('region(label Circle)') is 'region(label circle)'
-PASS parseWidgetRegion('region(LABEL CIRCLE)') is 'region(LABEL circle)'
-PASS parseWidgetRegion('region(LaBeL CiRcLe)') is 'region(LaBeL circle)'
-PASS parseWidgetRegion('region(lAbEl cIrClE)') is 'region(lAbEl circle)'
-PASS parseWidgetRegion('region(label Rectangle)') is 'region(label rectangle)'
-PASS parseWidgetRegion('region(LABEL RECTANGLE)') is 'region(LABEL rectangle)'
-PASS parseWidgetRegion('region(LaBeL ReCtAnGlE)') is 'region(LaBeL rectangle)'
-PASS parseWidgetRegion('region(lAbEl rEcTaNgLe)') is 'region(lAbEl rectangle)'
-
-Some expected failures.
-
-PASS parseWidgetRegion('') is null
-PASS parseWidgetRegion(' ') is null
-PASS parseWidgetRegion('x') is null
-PASS parseWidgetRegion('dashboard-') is null
-PASS parseWidgetRegion('region') is null
-PASS parseWidgetRegion('region(') is null
-PASS parseWidgetRegion('region(label') is null
-PASS parseWidgetRegion('region(label ') is null
-PASS parseWidgetRegion('region(label c') is null
-PASS parseWidgetRegion('region(label circle') is null
-PASS parseWidgetRegion('region(label)') is null
-PASS parseWidgetRegion('region (label circle)') is null
-PASS parseWidgetRegion('region(label,, circle)') is null
-PASS parseWidgetRegion('region(label circle 1px2px 3px 4px)') is null
-PASS parseWidgetRegion('region(label,, circle, 1px, 2px, 3px, 4px)') is null
-PASS parseWidgetRegion('region(label, circle 1px 2px 3px 4px)') is null
-PASS parseWidgetRegion('region(label, circle, 1px 2px 3px 4px)') is null
-PASS parseWidgetRegion('region(label, circle, 1px, 2px 3px 4px)') is null
-PASS parseWidgetRegion('region(label, circle, 1px, 2px, 3px 4px)') is null
-PASS parseWidgetRegion('region(label circle, 1px, 2px, 3px, 4px)') is null
-PASS parseWidgetRegion('region(label circle 1px, 2px, 3px, 4px)') is null
-PASS parseWidgetRegion('region(label circle x)') is null
-PASS parseWidgetRegion('region(label circle x x)') is null
-PASS parseWidgetRegion('region(label circle x x x)') is null
-PASS parseWidgetRegion('region(label circle x x x x)') is null
-PASS parseWidgetRegion('region(label circle x x x x x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px x x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x x x)') is null
-PASS parseWidgetRegion('region(label circle 1px 2px 3px 4px circle 5px 6px 7px 8px)') is null
-PASS parseWidgetRegion('region(label, circle, 1px, 2px, 3px, 4px, circle, 5px, 6px, 7px, 8px)') is null
-PASS parseWidgetRegion('none x') is null
-PASS parseWidgetRegion('none x x') is null
-PASS parseWidgetRegion('none x x x') is null
-PASS parseWidgetRegion('none x x x x') is null
-PASS parseWidgetRegion('none region(label, circle)') is null
-PASS parseWidgetRegion('region(label, circle) none') is null
-PASS parseWidgetRegion('attr(a)') is null
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/fast/css/widget-region-parser.html b/LayoutTests/fast/css/widget-region-parser.html
deleted file mode 100644 (file)
index 7f98eb6..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<html>
-<head>
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-
-description("This tests the parser and serializer for widget region values.");
-
-var style = document.getElementById('description').style;
-
-function parseWidgetRegion(string)
-{
-    try {
-        style.removeProperty("-webkit-widget-region");
-        style.setProperty("-webkit-widget-region", string, "");
-        var result = style.getPropertyValue("-webkit-widget-region");
-        style.removeProperty("-webkit-widget-region");
-        return result;
-    } catch (e) {
-        return "" + e;
-    }
-}
-
-function testCanonicalWidgetRegion(string)
-{
-    shouldBe("parseWidgetRegion('" + string + "')", "'" + string + "'");
-}
-
-testCanonicalWidgetRegion('none');
-
-debug('');
-
-testCanonicalWidgetRegion('region(label circle)');
-testCanonicalWidgetRegion('region(label circle 1px 2px 3px 4px)');
-testCanonicalWidgetRegion('region(label circle 0px 0px 0px 0px)');
-testCanonicalWidgetRegion('region(label circle auto auto auto auto)');
-testCanonicalWidgetRegion('region(label circle 1px 2px 3px 4px)');
-
-debug('');
-
-testCanonicalWidgetRegion('region(label rectangle)');
-testCanonicalWidgetRegion('region(label rectangle 1px 2px 3px 4px)');
-
-debug('');
-
-testCanonicalWidgetRegion('region(label circle) region(label circle)');
-testCanonicalWidgetRegion('region(label circle) region(label rectangle)');
-testCanonicalWidgetRegion('region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)');
-testCanonicalWidgetRegion('region(label rectangle 1px 2px 3px 4px) region(label circle 5px 6px 7px 8px)');
-
-debug('');
-debug('Tests to demonstrate that commas are allowed.');
-debug('');
-
-shouldBe("parseWidgetRegion('region(label, circle)')", "'region(label circle)'");
-shouldBe("parseWidgetRegion('region(label, circle, 1px, 2px, 3px, 4px)')", "'region(label circle 1px 2px 3px 4px)'");
-
-debug('');
-debug('Tests for variations in whitespace that are allowed.');
-debug('');
-
-shouldBe("parseWidgetRegion('  region(  label  circle  )  ')", "'region(label circle)'");
-shouldBe("parseWidgetRegion('  region(  label   circle  1px  2px  3px  4px  )  region(label  rectangle  5px  6px  7px  8px  )  ')", "'region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)'");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px)region(label rectangle 5px 6px 7px 8px)')", "'region(label circle 1px 2px 3px 4px) region(label rectangle 5px 6px 7px 8px)'");
-
-debug('');
-debug('Tests for case insensitivity.');
-debug('');
-
-shouldBe("parseWidgetRegion('region(label Circle)')", "'region(label circle)'");
-shouldBe("parseWidgetRegion('region(LABEL CIRCLE)')", "'region(LABEL circle)'");
-shouldBe("parseWidgetRegion('region(LaBeL CiRcLe)')", "'region(LaBeL circle)'");
-shouldBe("parseWidgetRegion('region(lAbEl cIrClE)')", "'region(lAbEl circle)'");
-shouldBe("parseWidgetRegion('region(label Rectangle)')", "'region(label rectangle)'");
-shouldBe("parseWidgetRegion('region(LABEL RECTANGLE)')", "'region(LABEL rectangle)'");
-shouldBe("parseWidgetRegion('region(LaBeL ReCtAnGlE)')", "'region(LaBeL rectangle)'");
-shouldBe("parseWidgetRegion('region(lAbEl rEcTaNgLe)')", "'region(lAbEl rectangle)'");
-
-debug('');
-debug('Some expected failures.');
-debug('');
-
-shouldBe("parseWidgetRegion('')", "null");
-shouldBe("parseWidgetRegion(' ')", "null");
-shouldBe("parseWidgetRegion('x')", "null");
-shouldBe("parseWidgetRegion('dashboard-')", "null");
-shouldBe("parseWidgetRegion('region')", "null");
-shouldBe("parseWidgetRegion('region(')", "null");
-shouldBe("parseWidgetRegion('region(label')", "null");
-shouldBe("parseWidgetRegion('region(label ')", "null");
-shouldBe("parseWidgetRegion('region(label c')", "null");
-shouldBe("parseWidgetRegion('region(label circle')", "null");
-shouldBe("parseWidgetRegion('region(label)')", "null");
-shouldBe("parseWidgetRegion('region (label circle)')", "null");
-shouldBe("parseWidgetRegion('region(label,, circle)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px2px 3px 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label,, circle, 1px, 2px, 3px, 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle 1px 2px 3px 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle, 1px 2px 3px 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle, 1px, 2px 3px 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle, 1px, 2px, 3px 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label circle, 1px, 2px, 3px, 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px, 2px, 3px, 4px)')", "null");
-shouldBe("parseWidgetRegion('region(label circle x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle x x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle x x x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px x x x x x)')", "null");
-shouldBe("parseWidgetRegion('region(label circle 1px 2px 3px 4px circle 5px 6px 7px 8px)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle, 1px, 2px, 3px, 4px, circle, 5px, 6px, 7px, 8px)')", "null");
-shouldBe("parseWidgetRegion('none x')", "null");
-shouldBe("parseWidgetRegion('none x x')", "null");
-shouldBe("parseWidgetRegion('none x x x')", "null");
-shouldBe("parseWidgetRegion('none x x x x')", "null");
-shouldBe("parseWidgetRegion('none region(label, circle)')", "null");
-shouldBe("parseWidgetRegion('region(label, circle) none')", "null");
-shouldBe("parseWidgetRegion('attr(a)')", "null");
-
-debug('');
-
-
-</script>
-<script src="../../fast/js/resources/js-test-post.js"></script>
-</body>
-</html>
index 435f99e..b83f3dc 100644 (file)
@@ -381,7 +381,7 @@ inspector/debugger/dom-breakpoints.html
 inspector/timeline/timeline-receive-response-event.html
 
 # ENABLE(WIDGET_REGION) is disabled
-fast/css/widget-region-parser.html
+fast/css/draggable-region-parser.html
 
 # http://webkit.org/b/96828
 fast/canvas/webgl/oes-vertex-array-object.html
index 0d8ffd2..eb0a85a 100644 (file)
@@ -75,7 +75,7 @@ fast/canvas/canvas-gradient-addStop-error.html [ WontFix ]
 http/tests/xmlhttprequest/default-content-type-dashboard.html [ WontFix ]
 
 # ENABLE(WIDGET_REGION) is disabled
-fast/css/widget-region-parser.html [ WontFix ]
+fast/css/draggable-region-parser.html [ WontFix ]
 
 # These test -apple- and -khtml- prefixed CSS properties, which we don't support.
 inspector/styles/vendor-prefixes.html [ WontFix ]
index b2a9976..be77a33 100644 (file)
@@ -441,6 +441,9 @@ webaudio/
 # Microdata DOM API is not yet enabled.
 fast/dom/MicroData
 
+# ENABLE(WIDGET_REGION) is disabled
+fast/css/draggable-region-parser.html
+
 # https://bugs.webkit.org/show_bug.cgi?id=97132
 media/track/track-cue-rendering-horizontal.html
 media/track/track-cue-rendering-snap-to-lines-not-set.html
index 588e8bd..6cd3553 100644 (file)
@@ -449,7 +449,7 @@ fast/forms/time-multiple-fields
 fast/forms/week-multiple-fields
 
 # ENABLE(WIDGET_REGION) is disabled
-fast/css/widget-region-parser.html
+fast/css/draggable-region-parser.html
 
 # Text Autosizing is not enabled.
 webkit.org/b/84186 fast/text-autosizing
index cd9fb3e..4e7b1bc 100644 (file)
@@ -1968,7 +1968,7 @@ http/tests/security/contentSecurityPolicy/1.1
 fast/text/shaping
 
 # ENABLE(WIDGET_REGION) is disabled
-fast/css/widget-region-parser.html
+fast/css/draggable-region-parser.html
 
 # CSS image-orientation property not yet supported
 fast/css/image-orientation/
index 4d7b525..1136de6 100644 (file)
@@ -2492,7 +2492,7 @@ http/tests/security/contentSecurityPolicy/1.1
 fast/text/shaping
 
 # ENABLE(WIDGET_REGION) is disabled
-fast/css/widget-region-parser.html
+fast/css/draggable-region-parser.html
 
 # CSS image-orientation property not yet supported
 fast/css/image-orientation/
index 359a65b..d0f97f9 100644 (file)
@@ -1,3 +1,16 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        The CSS property to support draggable regions, guarded under
+        WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
+        confusion with DASHBOARD_SUPPORT feature.
+
+        * Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
+
 2012-10-09  Filip Pizlo  <fpizlo@apple.com>
 
         Unreviewed, adding forgotten files.
index 300e813..4b5be83 100644 (file)
@@ -138,8 +138,7 @@ ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 ENABLE_WEB_TIMING = ;
-ENABLE_WIDGET_REGION = $(ENABLE_WIDGET_REGION_$(REAL_PLATFORM_NAME));
-ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
+ENABLE_WIDGET_REGION = ;
 ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XSLT = ENABLE_XSLT;
 
index 22dfb35..360a053 100644 (file)
@@ -1,3 +1,113 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        The CSS property to support draggable regions has been changed from
+        "-webkit-widget-region" to "-webkit-app-region" in the following syntax:
+           -webkit-app-region: drag|no-drag
+
+        The CSS parsing code for draggable regions is now different from the CSS
+        parsing code for dashboard regions since we have quite different syntax.
+
+        We still try to share as much rendering update code as possible for
+        these two features. To make the shared code easier to understand for
+        both features, the name "DashboardRegions" in the shared code is changed
+        to "AnnotatedRegions" to work for both dashboard regions and draggable
+        regions.
+
+        Note that we still using WIDGET_REGION as feature name in order not to
+        add more changes to this patch. It will be renamed to a more appropriate
+        name in next patch. WIDGET_REGION is now only turned on for the chromium
+        port.
+
+        Test: fast/css/draggable-region-parser.html
+
+        * Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
+        * WebCore.exp.in: Update the exported symbol due to renaming.
+        * css/CSSComputedStyleDeclaration.cpp: Update the CSS parsing.
+        (WebCore):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp: Update the CSS parsing.
+        (WebCore::CSSParser::parseValue):
+        (WebCore):
+        (WebCore::CSSParser::parseDashboardRegions):
+        * css/CSSParserValues.cpp: Update the CSS parsing.
+        (WebCore::CSSParserValue::createCSSValue):
+        * css/CSSPrimitiveValue.cpp: Update the CSS parsing.
+        (WebCore::isValidCSSUnitTypeForDoubleConversion):
+        (WebCore):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::customCssText):
+        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
+        (WebCore::CSSPrimitiveValue::reportDescendantMemoryUsage):
+        * css/CSSPrimitiveValue.h: Update the CSS parsing.
+        (CSSPrimitiveValue):
+        * css/CSSProperty.cpp:
+        (WebCore::CSSProperty::isInheritedProperty):
+        * css/CSSPropertyNames.in: Rename the CSS property for draggable region.
+        * css/CSSValueKeywords.in: Add the keywords supported for the draggable region.
+        * css/DashboardRegion.h: Remove WIDGET_REGION guard.
+        (DashboardRegion):
+        * css/StyleResolver.cpp: Update the CSS parsing.
+        (WebCore::StyleResolver::collectMatchingRulesForList):
+        * dom/Document.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::Document::Document):
+        (WebCore::Document::annotatedRegions):
+        (WebCore::Document::setAnnotatedRegions):
+        (WebCore::Document::reportMemoryUsage):
+        * dom/Document.h: Rename dashboardRegions to annotatedRegions.
+        (WebCore):
+        (WebCore::Document::setAnnotatedRegionsDirty):
+        (WebCore::Document::annotatedRegionsDirty):
+        (WebCore::Document::hasAnnotatedRegions):
+        (WebCore::Document::setHasAnnotatedRegions):
+        (Document):
+        * page/Chrome.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::ChromeClient::annotatedRegionsChanged):
+        * page/ChromeClient.h: Rename dashboardRegions to annotatedRegions.
+        (ChromeClient):
+        * page/FrameView.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::updateAnnotatedRegions):
+        (WebCore::FrameView::paintContents):
+        * page/FrameView.h: Rename dashboardRegions to annotatedRegions.
+        (FrameView):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::addAnnotatedRegions):
+        * rendering/RenderInline.h: Rename dashboardRegions to annotatedRegions.
+        (RenderInline):
+        * rendering/RenderLayer.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::RenderLayer::scrollTo):
+        (WebCore::RenderLayer::setHasHorizontalScrollbar):
+        (WebCore::RenderLayer::setHasVerticalScrollbar):
+        (WebCore::RenderLayer::updateScrollbarsAfterLayout):
+        * rendering/RenderListBox.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::RenderListBox::setHasVerticalScrollbar):
+        * rendering/RenderObject.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebCore::RenderObject::styleWillChange):
+        (WebCore::RenderObject::addAnnotatedRegions):
+        (WebCore::RenderObject::collectAnnotatedRegions):
+        * rendering/RenderObject.h: Rename dashboardRegions to annotatedRegions.
+        (WebCore::AnnotatedRegionValue::operator==):
+        (WebCore::AnnotatedRegionValue::operator!=):
+        (AnnotatedRegionValue):
+        (RenderObject):
+        * rendering/style/RenderStyle.cpp: Update the CSS parsing.
+        (WebCore::RenderStyle::diff):
+        (WebCore):
+        * rendering/style/RenderStyle.h: Update the CSS parsing.
+        * rendering/style/RenderStyleConstants.h: Update the CSS parsing.
+        * rendering/style/StyleDashboardRegion.h: Update the CSS parsing.
+        * rendering/style/StyleRareNonInheritedData.cpp: Update the CSS parsing.
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h: Update the CSS parsing.
+        (WebCore):
+        (StyleRareNonInheritedData):
+
 2012-10-09  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r130811 and r130821.
index ad97fd0..31a340b 100644 (file)
@@ -139,8 +139,7 @@ ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 ENABLE_WEB_TIMING = ;
-ENABLE_WIDGET_REGION = $(ENABLE_WIDGET_REGION_$(REAL_PLATFORM_NAME));
-ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
+ENABLE_WIDGET_REGION = ;
 ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XSLT = ENABLE_XSLT;
 
index 2b4cfda..2c4f143 100644 (file)
@@ -2142,7 +2142,7 @@ __ZNK7WebCore15ContextMenuItem7enabledEv
 #endif // ENABLE(CONTEXT_MENUS)
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-__ZNK7WebCore8Document16dashboardRegionsEv
+__ZNK7WebCore8Document16annotatedRegionsEv
 #endif
 #if ENABLE(DASHBOARD_SUPPORT)
 __ZN7WebCore8Settings41setUsesDashboardBackwardCompatibilityModeEb
index ebb44f1..aab8acb 100644 (file)
@@ -80,7 +80,7 @@
 #include "WebKitCSSFilterValue.h"
 #endif
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 #include "DashboardRegion.h"
 #endif
 
@@ -352,7 +352,7 @@ static const CSSPropertyID computedProperties[] = {
     CSSPropertyWebkitRegionBreakInside,
 #endif
 #if ENABLE(WIDGET_REGION)
-    CSSPropertyWebkitWidgetRegion,
+    CSSPropertyWebkitAppRegion,
 #endif
 #if ENABLE(CSS_EXCLUSIONS)
     CSSPropertyWebkitWrapFlow,
@@ -2169,13 +2169,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
             if (style->boxSizing() == CONTENT_BOX)
                 return cssValuePool().createIdentifierValue(CSSValueContentBox);
             return cssValuePool().createIdentifierValue(CSSValueBorderBox);
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
 #if ENABLE(DASHBOARD_SUPPORT)
         case CSSPropertyWebkitDashboardRegion:
-#endif
-#if ENABLE(WIDGET_REGION)
-        case CSSPropertyWebkitWidgetRegion:
-#endif
         {
             const Vector<StyleDashboardRegion>& regions = style->dashboardRegions();
             unsigned count = regions.size();
@@ -2206,6 +2201,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
             return cssValuePool().createValue(firstRegion.release());
         }
 #endif
+#if ENABLE(WIDGET_REGION)
+        case CSSPropertyWebkitAppRegion:
+            return cssValuePool().createIdentifierValue(style->getDraggableRegionMode() == DraggableRegionDrag ? CSSValueDrag : CSSValueNoDrag);
+#endif
         case CSSPropertyWebkitAnimationDelay:
             return getDelayValue(style->animations());
         case CSSPropertyWebkitAnimationDirection: {
index b9dfbea..4805d14 100644 (file)
 #include "WebKitCSSShaderValue.h"
 #endif
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 #include "DashboardRegion.h"
 #endif
 
@@ -2515,19 +2515,21 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
             validPrimitive = true;
         break;
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
 #if ENABLE(DASHBOARD_SUPPORT)
     case CSSPropertyWebkitDashboardRegion: // <dashboard-region> | <dashboard-region>
-#endif
-#if ENABLE(WIDGET_REGION)
-    case CSSPropertyWebkitWidgetRegion:
-#endif
         if (value->unit == CSSParserValue::Function || id == CSSValueNone)
             return parseDashboardRegions(propId, important);
         break;
 #endif
     // End Apple-specific properties
 
+#if ENABLE(WIDGET_REGION)
+    case CSSPropertyWebkitAppRegion:
+        if (id >= CSSValueDrag && id <= CSSValueNoDrag)
+            validPrimitive = true;
+        break;
+#endif
+
 #if ENABLE(TOUCH_EVENTS)
     case CSSPropertyWebkitTapHighlightColor:
         if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu
@@ -4208,7 +4210,7 @@ bool CSSParser::parseGridTrackList(CSSPropertyID propId, bool important)
 }
 
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 
 #define DASHBOARD_REGION_NUM_PARAMETERS  6
 #define DASHBOARD_REGION_SHORT_NUM_PARAMETERS  2
@@ -4261,32 +4263,7 @@ bool CSSParser::parseDashboardRegions(CSSPropertyID propId, bool important)
         // dashboard-region(label, type) or dashboard-region(label type)
         // dashboard-region(label, type) or dashboard-region(label type)
         CSSParserValueList* args = value->function->args.get();
-        if (!args) {
-            valid = false;
-            break;
-        }
-        bool validFunctionName = false;
-#if ENABLE(DASHBOARD_SUPPORT)
-        static const char dashboardRegionFunctionName[] = "dashboard-region(";
-        if (equalIgnoringCase(value->function->name, dashboardRegionFunctionName)) {
-            validFunctionName = true;
-#if ENABLE(DASHBOARD_SUPPORT) && ENABLE(WIDGET_REGION)
-            // Keep track of function name when both features are enabled. 
-            region->m_cssFunctionName = dashboardRegionFunctionName;
-#endif
-        }
-#endif
-#if ENABLE(WIDGET_REGION)
-        static const char widgetRegionFunctionName[] = "region(";
-        if (equalIgnoringCase(value->function->name, widgetRegionFunctionName)) {
-            validFunctionName = true;
-#if ENABLE(DASHBOARD_SUPPORT) && ENABLE(WIDGET_REGION)
-            // Keep track of function name when both features are enabled. 
-            region->m_cssFunctionName = widgetRegionFunctionName;
-#endif
-        }
-#endif
-        if (!validFunctionName) {
+        if (!equalIgnoringCase(value->function->name, "dashboard-region(") || !args) {
             valid = false;
             break;
         }
@@ -4372,7 +4349,7 @@ bool CSSParser::parseDashboardRegions(CSSPropertyID propId, bool important)
     return valid;
 }
 
-#endif /* ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION) */
+#endif /* ENABLE(DASHBOARD_SUPPORT) */
 
 PassRefPtr<CSSValue> CSSParser::parseCounterContent(CSSParserValueList* args, bool counters)
 {
index 8b76255..6110807 100644 (file)
@@ -124,7 +124,7 @@ PassRefPtr<CSSValue> CSSParserValue::createCSSValue()
     case CSSPrimitiveValue::CSS_DPI:
     case CSSPrimitiveValue::CSS_DPCM:
     case CSSPrimitiveValue::CSS_PAIR:
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     case CSSPrimitiveValue::CSS_DASHBOARD_REGION:
 #endif
     case CSSPrimitiveValue::CSS_UNICODE_RANGE:
index 068697f..55ede8b 100644 (file)
@@ -45,7 +45,7 @@
 #include <wtf/text/StringBuffer.h>
 #include <wtf/text/StringBuilder.h>
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 #include "DashboardRegion.h"
 #endif
 
@@ -91,7 +91,7 @@ static inline bool isValidCSSUnitTypeForDoubleConversion(CSSPrimitiveValue::Unit
     case CSSPrimitiveValue::CSS_ATTR:
     case CSSPrimitiveValue::CSS_COUNTER:
     case CSSPrimitiveValue::CSS_COUNTER_NAME:
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     case CSSPrimitiveValue::CSS_DASHBOARD_REGION:
 #endif
 #if !ENABLE(CSS_IMAGE_RESOLUTION)
@@ -330,7 +330,7 @@ void CSSPrimitiveValue::init(PassRefPtr<Quad> quad)
     m_value.quad = quad.leakRef();
 }
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 void CSSPrimitiveValue::init(PassRefPtr<DashboardRegion> r)
 {
     m_primitiveUnitType = CSS_DASHBOARD_REGION;
@@ -391,7 +391,7 @@ void CSSPrimitiveValue::cleanup()
     case CSS_PAIR:
         m_value.pair->deref();
         break;
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     case CSS_DASHBOARD_REGION:
         if (m_value.region)
             m_value.region->deref();
@@ -1034,19 +1034,13 @@ String CSSPrimitiveValue::customCssText() const
         case CSS_PAIR:
             text = getPairValue()->cssText();
             break;
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
         case CSS_DASHBOARD_REGION: {
             StringBuilder result;
             for (DashboardRegion* region = getDashboardRegionValue(); region; region = region->m_next.get()) {
                 if (!result.isEmpty())
                     result.append(' ');
-#if ENABLE(DASHBOARD_SUPPORT) && ENABLE(WIDGET_REGION)
-                result.append(region->m_cssFunctionName);
-#elif ENABLE(DASHBOARD_SUPPORT)
                 result.appendLiteral("dashboard-region(");
-#else
-                result.appendLiteral("region(");
-#endif
                 result.append(region->m_label);
                 if (region->m_isCircle)
                     result.appendLiteral(" circle");
@@ -1197,7 +1191,7 @@ PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::cloneForCSSOM() const
         // Pair is not exposed to the CSSOM, no need for a deep clone.
         result = CSSPrimitiveValue::create(m_value.pair);
         break;
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     case CSS_DASHBOARD_REGION:
         // DashboardRegion is not exposed to the CSSOM, no need for a deep clone.
         result = CSSPrimitiveValue::create(m_value.region);
@@ -1289,7 +1283,7 @@ void CSSPrimitiveValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObje
     case CSS_PAIR:
         info.addMember(m_value.pair);
         break;
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     case CSS_DASHBOARD_REGION:
         info.addMember(m_value.region);
         break;
index 0fb6445..aa2dbea 100644 (file)
@@ -99,7 +99,7 @@ public:
         CSS_DPI = 30,
         CSS_DPCM = 31,
         CSS_PAIR = 100, // We envision this being exposed as a means of getting computed style values for pairs (border-spacing/radius, background-position, etc.)
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
         CSS_DASHBOARD_REGION = 101, // FIXME: Dashboard region should not be a primitive value.
 #endif
         CSS_UNICODE_RANGE = 102,
@@ -284,7 +284,7 @@ public:
     Pair* getPairValue(ExceptionCode&) const;
     Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? 0 : m_value.pair; }
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     DashboardRegion* getDashboardRegionValue() const { return m_primitiveUnitType != CSS_DASHBOARD_REGION ? 0 : m_value.region; }
 #endif
 
index b5a9d3f..bf2ead1 100644 (file)
@@ -702,7 +702,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID)
     case CSSPropertyWebkitDashboardRegion:
 #endif
 #if ENABLE(WIDGET_REGION)
-    case CSSPropertyWebkitWidgetRegion:
+    case CSSPropertyWebkitAppRegion:
 #endif
         return false;
     case CSSPropertyInvalid:
index 24b5d2e..69dafb8 100644 (file)
@@ -409,7 +409,7 @@ z-index
 -webkit-dashboard-region
 #endif
 #if defined(ENABLE_WIDGET_REGION) && ENABLE_WIDGET_REGION
--webkit-widget-region
+-webkit-app-region
 #endif
 #if defined(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) && ENABLE_ACCELERATED_OVERFLOW_SCROLLING
 -webkit-overflow-scrolling
index 4b99679..56c37a2 100644 (file)
@@ -963,3 +963,8 @@ snap
 -webkit-paged-x
 -webkit-paged-y
 
+// -webkit-app-region
+#if defined(ENABLE_WIDGET_REGION) && ENABLE_WIDGET_REGION
+drag
+no-drag
+#endif
index a698e49..91e5d7a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "Rect.h"
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 
 namespace WebCore {
 
@@ -37,11 +37,6 @@ public:
     bool m_isCircle : 1;
     bool m_isRectangle : 1;
 
-#if ENABLE(DASHBOARD_SUPPORT) && ENABLE(WIDGET_REGION)
-    // Used to tell different CSS function name when both features are enabled.
-    String m_cssFunctionName;
-#endif
-
 private:
     DashboardRegion() : m_isCircle(false), m_isRectangle(false) { }
 };
index cb576b9..2d9ccd5 100644 (file)
 #include "WebKitCSSFilterValue.h"
 #endif
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 #include "DashboardRegion.h"
 #endif
 
@@ -3318,13 +3318,8 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
         setTextSizeAdjust(primitiveValue->getIdent() == CSSValueAuto);
         return;
     }
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
 #if ENABLE(DASHBOARD_SUPPORT)
     case CSSPropertyWebkitDashboardRegion:
-#endif
-#if ENABLE(WIDGET_REGION)
-    case CSSPropertyWebkitWidgetRegion:
-#endif
     {
         HANDLE_INHERIT_AND_INITIAL(dashboardRegions, DashboardRegions)
         if (!primitiveValue)
@@ -3362,11 +3357,20 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value)
             region = region->m_next.get();
         }
 
-        m_element->document()->setHasDashboardRegions(true);
+        m_element->document()->setHasAnnotatedRegions(true);
 
         return;
     }
 #endif
+#if ENABLE(WIDGET_REGION)
+    case CSSPropertyWebkitAppRegion: {
+        if (!primitiveValue || !primitiveValue->getIdent())
+            return;
+        m_style->setDraggableRegionMode(primitiveValue->getIdent() == CSSValueDrag ? DraggableRegionDrag : DraggableRegionNoDrag);
+        m_element->document()->setHasAnnotatedRegions(true);
+        return;
+    }
+#endif
     case CSSPropertyWebkitTextStrokeWidth: {
         HANDLE_INHERIT_AND_INITIAL(textStrokeWidth, TextStrokeWidth)
         float width = 0;
index 2869c0a..6c97777 100644 (file)
@@ -462,8 +462,8 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
     , m_savedRenderer(0)
     , m_designMode(inherit)
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    , m_hasDashboardRegions(false)
-    , m_dashboardRegionsDirty(false)
+    , m_hasAnnotatedRegions(false)
+    , m_annotatedRegionsDirty(false)
 #endif
     , m_createRenderers(true)
     , m_inPageCache(false)
@@ -3354,15 +3354,15 @@ void Document::activeChainNodeDetached(Node* node)
 }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-const Vector<DashboardRegionValue>& Document::dashboardRegions() const
+const Vector<AnnotatedRegionValue>& Document::annotatedRegions() const
 {
-    return m_dashboardRegions;
+    return m_annotatedRegions;
 }
 
-void Document::setDashboardRegions(const Vector<DashboardRegionValue>& regions)
+void Document::setAnnotatedRegions(const Vector<AnnotatedRegionValue>& regions)
 {
-    m_dashboardRegions = regions;
-    setDashboardRegionsDirty(false);
+    m_annotatedRegions = regions;
+    setAnnotatedRegionsDirty(false);
 }
 #endif
 
@@ -5902,8 +5902,8 @@ void Document::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     info.addMember(m_contentLanguage);
     info.addMember(m_documentNamedItemCollections);
     info.addMember(m_windowNamedItemCollections);
-#if ENABLE(DASHBOARD_SUPPORT)
-    info.addMember(m_dashboardRegions);
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+    info.addMember(m_annotatedRegions);
 #endif
     info.addMember(m_cssCanvasElements);
     info.addMember(m_iconURLs);
index e088794..5df5b6c 100644 (file)
@@ -157,7 +157,7 @@ class TransformSource;
 #endif
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-struct DashboardRegionValue;
+struct AnnotatedRegionValue;
 #endif
 
 #if ENABLE(TOUCH_EVENTS)
@@ -993,12 +993,12 @@ public:
     bool frameElementsShouldIgnoreScrolling() const { return m_frameElementsShouldIgnoreScrolling; }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    void setDashboardRegionsDirty(bool f) { m_dashboardRegionsDirty = f; }
-    bool dashboardRegionsDirty() const { return m_dashboardRegionsDirty; }
-    bool hasDashboardRegions () const { return m_hasDashboardRegions; }
-    void setHasDashboardRegions(bool f) { m_hasDashboardRegions = f; }
-    const Vector<DashboardRegionValue>& dashboardRegions() const;
-    void setDashboardRegions(const Vector<DashboardRegionValue>&);
+    void setAnnotatedRegionsDirty(bool f) { m_annotatedRegionsDirty = f; }
+    bool annotatedRegionsDirty() const { return m_annotatedRegionsDirty; }
+    bool hasAnnotatedRegions () const { return m_hasAnnotatedRegions; }
+    void setHasAnnotatedRegions(bool f) { m_hasAnnotatedRegions = f; }
+    const Vector<AnnotatedRegionValue>& annotatedRegions() const;
+    void setAnnotatedRegions(const Vector<AnnotatedRegionValue>&);
 #endif
 
     virtual void removeAllEventListeners();
@@ -1405,9 +1405,9 @@ private:
 #endif
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    Vector<DashboardRegionValue> m_dashboardRegions;
-    bool m_hasDashboardRegions;
-    bool m_dashboardRegionsDirty;
+    Vector<AnnotatedRegionValue> m_annotatedRegions;
+    bool m_hasAnnotatedRegions;
+    bool m_annotatedRegionsDirty;
 #endif
 
     HashMap<String, RefPtr<HTMLCanvasElement> > m_cssCanvasElements;
index cca4a09..e95b2a6 100644 (file)
@@ -491,7 +491,7 @@ void Chrome::scheduleAnimation()
 // --------
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void ChromeClient::dashboardRegionsChanged()
+void ChromeClient::annotatedRegionsChanged()
 {
 }
 #endif
index ca82f41..6a3631d 100644 (file)
@@ -208,7 +208,7 @@ namespace WebCore {
         virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*, int64_t totalSpaceNeeded) = 0;
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-        virtual void dashboardRegionsChanged();
+        virtual void annotatedRegionsChanged();
 #endif
 
         virtual void populateVisitedLinks();
index f4a5659..659c9c9 100644 (file)
@@ -1228,7 +1228,7 @@ void FrameView::layout(bool allowSubtree)
         root->document()->axObjectCache()->postNotification(root, AXObjectCache::AXLayoutComplete, true);
 #endif
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    updateDashboardRegions();
+    updateAnnotatedRegions();
 #endif
 
     ASSERT(!root->needsLayout());
@@ -2913,20 +2913,20 @@ bool FrameView::scrollAnimatorEnabled() const
 }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void FrameView::updateDashboardRegions()
+void FrameView::updateAnnotatedRegions()
 {
     Document* document = m_frame->document();
-    if (!document->hasDashboardRegions())
+    if (!document->hasAnnotatedRegions())
         return;
-    Vector<DashboardRegionValue> newRegions;
-    document->renderBox()->collectDashboardRegions(newRegions);
-    if (newRegions == document->dashboardRegions())
+    Vector<AnnotatedRegionValue> newRegions;
+    document->renderBox()->collectAnnotatedRegions(newRegions);
+    if (newRegions == document->annotatedRegions())
         return;
-    document->setDashboardRegions(newRegions);
+    document->setAnnotatedRegions(newRegions);
     Page* page = m_frame->page();
     if (!page)
         return;
-    page->chrome()->client()->dashboardRegionsChanged();
+    page->chrome()->client()->annotatedRegionsChanged();
 }
 #endif
 
@@ -3249,10 +3249,10 @@ void FrameView::paintContents(GraphicsContext* p, const IntRect& rect)
     m_paintBehavior = oldPaintBehavior;
     m_lastPaintTime = currentTime();
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
     // Regions may have changed as a result of the visibility/z-index of element changing.
-    if (document->dashboardRegionsDirty())
-        updateDashboardRegions();
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+    if (document->annotatedRegionsDirty())
+        updateAnnotatedRegions();
 #endif
 
     if (isTopLevelPainter)
index 1324ae7..7d060ef 100644 (file)
@@ -226,7 +226,7 @@ public:
     bool repaintsDisabled() { return m_disableRepaints > 0; }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    void updateDashboardRegions();
+    void updateAnnotatedRegions();
 #endif
     void updateControlTints();
 
index a38409a..c9f8d7b 100644 (file)
@@ -1535,12 +1535,13 @@ void RenderInline::paintOutlineForLine(GraphicsContext* graphicsContext, const L
 }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
+void RenderInline::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
 {
     // Convert the style regions to absolute coordinates.
     if (style()->visibility() != VISIBLE)
         return;
 
+#if ENABLE(DASHBOARD_SUPPORT)
     const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
     unsigned i, count = styleRegions.size();
     for (i = 0; i < count; i++) {
@@ -1550,7 +1551,7 @@ void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
         LayoutUnit w = linesBoundingBox.width();
         LayoutUnit h = linesBoundingBox.height();
 
-        DashboardRegionValue region;
+        AnnotatedRegionValue region;
         region.label = styleRegion.label;
         region.bounds = LayoutRect(linesBoundingBox.x() + styleRegion.offset.left().value(),
                                 linesBoundingBox.y() + styleRegion.offset.top().value(),
@@ -1575,6 +1576,24 @@ void RenderInline::addDashboardRegions(Vector<DashboardRegionValue>& regions)
 
         regions.append(region);
     }
+#else // ENABLE(WIDGET_REGION)
+    if (style()->getDraggableRegionMode() == DraggableRegionNone)
+        return;
+
+    AnnotatedRegionValue region;
+    region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
+    region.bounds = linesBoundingBox();
+
+    RenderObject* container = containingBlock();
+    if (!container)
+        container = this;
+
+    FloatPoint absPos = container->localToAbsolute();
+    region.bounds.setX(absPos.x() + region.bounds.x());
+    region.bounds.setY(absPos.y() + region.bounds.y());
+    
+    regions.append(region);
+#endif
 }
 #endif
 
index 302cf16..9fa68dc 100644 (file)
@@ -162,7 +162,7 @@ private:
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    virtual void addDashboardRegions(Vector<DashboardRegionValue>&);
+    virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&);
 #endif
     
     virtual void updateFromStyle() OVERRIDE;
index de6f2e0..3d193c8 100644 (file)
@@ -1717,10 +1717,9 @@ void RenderLayer::scrollTo(int x, int y)
     // We should have a RenderView if we're trying to scroll.
     ASSERT(view);
     if (view) {
+        // Update regions, scrolling may change the clip of a particular region.
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-        // Update dashboard regions, scrolling may change the clip of a
-        // particular region.
-        view->frameView()->updateDashboardRegions();
+        view->frameView()->updateAnnotatedRegions();
 #endif
 
         view->updateWidgetPositions();
@@ -2392,10 +2391,10 @@ void RenderLayer::setHasHorizontalScrollbar(bool hasScrollbar)
     if (m_vBar)
         m_vBar->styleChanged();
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
     // Force an update since we know the scrollbars have changed things.
-    if (renderer()->document()->hasDashboardRegions())
-        renderer()->document()->setDashboardRegionsDirty(true);
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+    if (renderer()->document()->hasAnnotatedRegions())
+        renderer()->document()->setAnnotatedRegionsDirty(true);
 #endif
 }
 
@@ -2415,10 +2414,10 @@ void RenderLayer::setHasVerticalScrollbar(bool hasScrollbar)
     if (m_vBar)
         m_vBar->styleChanged();
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
     // Force an update since we know the scrollbars have changed things.
-    if (renderer()->document()->hasDashboardRegions())
-        renderer()->document()->setDashboardRegionsDirty(true);
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+    if (renderer()->document()->hasAnnotatedRegions())
+        renderer()->document()->setAnnotatedRegionsDirty(true);
 #endif
 }
 
@@ -2605,10 +2604,10 @@ void RenderLayer::updateScrollbarsAfterLayout()
 
         updateSelfPaintingLayer();
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
         // Force an update since we know the scrollbars have changed things.
-        if (renderer()->document()->hasDashboardRegions())
-            renderer()->document()->setDashboardRegionsDirty(true);
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+        if (renderer()->document()->hasAnnotatedRegions())
+            renderer()->document()->setAnnotatedRegionsDirty(true);
 #endif
 
         renderer()->repaint();
index 079ce42..67e2275 100644 (file)
@@ -876,10 +876,10 @@ void RenderListBox::setHasVerticalScrollbar(bool hasScrollbar)
     if (m_vBar)
         m_vBar->styleChanged();
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
     // Force an update since we know the scrollbars have changed things.
-    if (document()->hasDashboardRegions())
-        document()->setDashboardRegionsDirty(true);
+#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+    if (document()->hasAnnotatedRegions())
+        document()->setAnnotatedRegionsDirty(true);
 #endif
 }
 
index 6d93067..ef6e784 100755 (executable)
@@ -1819,7 +1819,7 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
                 || m_style->hasAutoZIndex() != newStyle->hasAutoZIndex();
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
             if (visibilityChanged)
-                document()->setDashboardRegionsDirty(true);
+                document()->setAnnotatedRegionsDirty(true);
 #endif
             if (visibilityChanged && AXObjectCache::accessibilityEnabled())
                 document()->axObjectCache()->childrenChanged(this);
@@ -2751,14 +2751,16 @@ void RenderObject::getTextDecorationColors(int decorations, Color& underline, Co
 }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
+void RenderObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
 {
     // Convert the style regions to absolute coordinates.
     if (style()->visibility() != VISIBLE || !isBox())
         return;
     
     RenderBox* box = toRenderBox(this);
+    FloatPoint absPos = localToAbsolute();
 
+#if ENABLE(DASHBOARD_SUPPORT)
     const Vector<StyleDashboardRegion>& styleRegions = style()->dashboardRegions();
     unsigned i, count = styleRegions.size();
     for (i = 0; i < count; i++) {
@@ -2767,7 +2769,7 @@ void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
         LayoutUnit w = box->width();
         LayoutUnit h = box->height();
 
-        DashboardRegionValue region;
+        AnnotatedRegionValue region;
         region.label = styleRegion.label;
         region.bounds = LayoutRect(styleRegion.offset.left().value(),
                                    styleRegion.offset.top().value(),
@@ -2782,24 +2784,31 @@ void RenderObject::addDashboardRegions(Vector<DashboardRegionValue>& regions)
             region.clip.setWidth(0);
         }
 
-        FloatPoint absPos = localToAbsolute();
         region.bounds.setX(absPos.x() + styleRegion.offset.left().value());
         region.bounds.setY(absPos.y() + styleRegion.offset.top().value());
 
         regions.append(region);
     }
+#else // ENABLE(WIDGET_REGION)
+    if (style()->getDraggableRegionMode() == DraggableRegionNone)
+        return;
+    AnnotatedRegionValue region;
+    region.draggable = style()->getDraggableRegionMode() == DraggableRegionDrag;
+    region.bounds = LayoutRect(absPos.x(), absPos.y(), box->width(), box->height());
+    regions.append(region);
+#endif
 }
 
-void RenderObject::collectDashboardRegions(Vector<DashboardRegionValue>& regions)
+void RenderObject::collectAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
 {
     // RenderTexts don't have their own style, they just use their parent's style,
     // so we don't want to include them.
     if (isText())
         return;
 
-    addDashboardRegions(regions);
+    addAnnotatedRegions(regions);
     for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
-        curr->collectDashboardRegions(regions);
+        curr->collectAnnotatedRegions(regions);
 }
 #endif
 
index b2aca34..408788e 100644 (file)
@@ -121,20 +121,28 @@ typedef unsigned MapLocalToContainerFlags;
 const int caretWidth = 1;
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-struct DashboardRegionValue {
-    bool operator==(const DashboardRegionValue& o) const
+struct AnnotatedRegionValue {
+    bool operator==(const AnnotatedRegionValue& o) const
     {
+#if ENABLE(DASHBOARD_SUPPORT)
         return type == o.type && bounds == o.bounds && clip == o.clip && label == o.label;
+#else // ENABLE(WIDGET_REGION)
+        return draggable == o.draggable && bounds == o.bounds;
+#endif
     }
-    bool operator!=(const DashboardRegionValue& o) const
+    bool operator!=(const AnnotatedRegionValue& o) const
     {
         return !(*this == o);
     }
 
-    String label;
     LayoutRect bounds;
+#if ENABLE(DASHBOARD_SUPPORT)
+    String label;
     LayoutRect clip;
     int type;
+#else // ENABLE(WIDGET_REGION)
+    bool draggable;
+#endif
 };
 #endif
 
@@ -667,8 +675,8 @@ public:
     virtual void updateFromElement() { }
 
 #if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
-    virtual void addDashboardRegions(Vector<DashboardRegionValue>&);
-    void collectDashboardRegions(Vector<DashboardRegionValue>&);
+    virtual void addAnnotatedRegions(Vector<AnnotatedRegionValue>&);
+    void collectAnnotatedRegions(Vector<AnnotatedRegionValue>&);
 #endif
 
     bool isComposited() const;
index 3387881..387fd20 100644 (file)
@@ -451,7 +451,7 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
         }
 #endif
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
         // If regions change, trigger a relayout to re-calc regions.
         if (rareNonInheritedData->m_dashboardRegions != other->rareNonInheritedData->m_dashboardRegions)
             return StyleDifferenceLayout;
@@ -1099,7 +1099,7 @@ const AtomicString& RenderStyle::textEmphasisMarkString() const
     return nullAtom;
 }
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
 {
     DEFINE_STATIC_LOCAL(Vector<StyleDashboardRegion>, emptyList, ());
index ac72739..e970947 100644 (file)
@@ -77,7 +77,7 @@
 #include "StyleFilterData.h"
 #endif
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 #include "StyleDashboardRegion.h"
 #endif
 
@@ -1020,7 +1020,7 @@ public:
     void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v) }
     void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v) }
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
     void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
 
@@ -1039,6 +1039,11 @@ public:
     }
 #endif
 
+#if ENABLE(WIDGET_REGION)
+    DraggableRegionMode getDraggableRegionMode() const { return rareNonInheritedData->m_draggableRegionMode; }
+    void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(rareNonInheritedData, m_draggableRegionMode, v); }
+#endif
+
     void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
     void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) }
     void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) }
@@ -1727,7 +1732,7 @@ public:
 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
     static bool initialUseTouchOverflowScrolling() { return false; }
 #endif
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     static const Vector<StyleDashboardRegion>& initialDashboardRegions();
     static const Vector<StyleDashboardRegion>& noneDashboardRegions();
 #endif
index 3cdfd59..251f683 100644 (file)
@@ -473,6 +473,10 @@ enum WrapFlow { WrapFlowAuto, WrapFlowBoth, WrapFlowStart, WrapFlowEnd, WrapFlow
 
 enum WrapThrough { WrapThroughWrap, WrapThroughNone };
 
+#if ENABLE(WIDGET_REGION)
+enum DraggableRegionMode { DraggableRegionNone, DraggableRegionDrag, DraggableRegionNoDrag };
+#endif
+
 } // namespace WebCore
 
 #endif // RenderStyleConstants_h
index e591154..62992cb 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifndef StyleDashboardRegion_h
 #define StyleDashboardRegion_h
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 
 #include "LengthBox.h"
 #include <wtf/text/WTFString.h>
@@ -57,5 +57,5 @@ struct StyleDashboardRegion {
 
 } // namespace WebCore
 
-#endif // ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#endif // ENABLE(DASHBOARD_SUPPORT)
 #endif // StyleDashboardRegion_h
index 398ed0f..5d4d2cc 100644 (file)
@@ -44,6 +44,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_perspectiveOriginX(RenderStyle::initialPerspectiveOriginX())
     , m_perspectiveOriginY(RenderStyle::initialPerspectiveOriginY())
     , lineClamp(RenderStyle::initialLineClamp())
+#if ENABLE(WIDGET_REGION)
+    , m_draggableRegionMode(DraggableRegionNone)
+#endif
     , m_mask(FillLayer(MaskFillLayer))
     , m_pageSize()
     , m_shapeInside(RenderStyle::initialShapeInside())
@@ -98,6 +101,9 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , m_perspectiveOriginX(o.m_perspectiveOriginX)
     , m_perspectiveOriginY(o.m_perspectiveOriginY)
     , lineClamp(o.lineClamp)
+#if ENABLE(WIDGET_REGION)
+    , m_draggableRegionMode(o.m_draggableRegionMode)
+#endif
     , m_deprecatedFlexibleBox(o.m_deprecatedFlexibleBox)
     , m_flexibleBox(o.m_flexibleBox)
     , m_marquee(o.m_marquee)
@@ -177,9 +183,12 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && m_perspectiveOriginX == o.m_perspectiveOriginX
         && m_perspectiveOriginY == o.m_perspectiveOriginY
         && lineClamp == o.lineClamp
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
         && m_dashboardRegions == o.m_dashboardRegions
 #endif
+#if ENABLE(WIDGET_REGION)
+        && m_draggableRegionMode == o.m_draggableRegionMode
+#endif
         && m_deprecatedFlexibleBox == o.m_deprecatedFlexibleBox
         && m_flexibleBox == o.m_flexibleBox
         && m_marquee == o.m_marquee
index 0594dfb..4292494 100644 (file)
@@ -57,7 +57,7 @@ class StyleTransformData;
 class ContentData;
 struct LengthSize;
 
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
 struct StyleDashboardRegion;
 #endif
 
@@ -102,9 +102,12 @@ public:
     Length m_perspectiveOriginY;
 
     LineClampValue lineClamp; // An Apple extension.
-#if ENABLE(DASHBOARD_SUPPORT) || ENABLE(WIDGET_REGION)
+#if ENABLE(DASHBOARD_SUPPORT)
     Vector<StyleDashboardRegion> m_dashboardRegions;
 #endif
+#if ENABLE(WIDGET_REGION)
+    DraggableRegionMode m_draggableRegionMode;
+#endif
 
     DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
     DataRef<StyleFlexibleBoxData> m_flexibleBox;
index 7e7fc78..e7f8fa4 100644 (file)
@@ -1,3 +1,22 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        Update the code to use the new name annotatedRegions to work for
+        both features.
+
+        * public/WebDraggableRegion.h: Rename dashboardRegions to annotatedRegions.
+        (WebDraggableRegion):
+        * src/ChromeClientImpl.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebKit::ChromeClientImpl::annotatedRegionsChanged):
+        * src/ChromeClientImpl.h: Rename dashboardRegions to annotatedRegions.
+        (ChromeClientImpl):
+        * src/WebDocument.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebKit::WebDocument::draggableRegions):
+
 2012-10-09  Sadrul Habib Chowdhury  <sadrul@chromium.org>
 
         [chromium] Add drop event for plugins.
index c953395..56006f6 100644 (file)
@@ -39,8 +39,9 @@ namespace WebKit {
 
 struct WebDraggableRegion {
     bool draggable;
-    WebString label;
     WebRect bounds;
+    // FIXME: to be removed after chromium change is done.
+    WebString label;
     WebRect clip;
 };
 
index 6dd11ec..65810b9 100644 (file)
@@ -1120,7 +1120,7 @@ bool ChromeClientImpl::isPointerLocked()
 #endif
 
 #if ENABLE(WIDGET_REGION)
-void ChromeClientImpl::dashboardRegionsChanged()
+void ChromeClientImpl::annotatedRegionsChanged()
 {
     WebViewClient* client = m_webView->client();
     if (client)
index 87facea..f996831 100644 (file)
@@ -139,7 +139,7 @@ public:
     virtual void reachedMaxAppCacheSize(int64_t spaceNeeded);
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t totalSpaceNeeded);
 #if ENABLE(WIDGET_REGION)
-    virtual void dashboardRegionsChanged();
+    virtual void annotatedRegionsChanged();
 #endif
     virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
 #if ENABLE(INPUT_TYPE_COLOR)
index a63082f..0593d1d 100644 (file)
@@ -262,14 +262,13 @@ WebVector<WebDraggableRegion> WebDocument::draggableRegions() const
     WebVector<WebDraggableRegion> draggableRegions;
 #if ENABLE(WIDGET_REGION)
     const Document* document = constUnwrap<Document>();
-    if (document->hasDashboardRegions()) {
-        const Vector<DashboardRegionValue>& regions = document->dashboardRegions();
+    if (document->hasAnnotatedRegions()) {
+        const Vector<AnnotatedRegionValue>& regions = document->annotatedRegions();
         draggableRegions = WebVector<WebDraggableRegion>(regions.size());
         for (size_t i = 0; i < regions.size(); i++) {
-            const DashboardRegionValue& value = regions[i];
-            draggableRegions[i].label = value.label;
+            const AnnotatedRegionValue& value = regions[i];
+            draggableRegions[i].draggable = value.draggable;
             draggableRegions[i].bounds = WebCore::IntRect(value.bounds);
-            draggableRegions[i].clip = WebCore::IntRect(value.clip);
         }
     }
 #endif
index 9f4caec..d951ee3 100644 (file)
@@ -1,3 +1,24 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        The CSS property to support draggable regions, guarded under
+        WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
+        confusion with DASHBOARD_SUPPORT feature.
+
+        Also update the code to use the new name annotatedRegions to work for
+        both features.
+
+        * Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
+        * WebCoreSupport/WebChromeClient.h: Rename dashboardRegions to annotatedRegions.
+        * WebCoreSupport/WebChromeClient.mm: Rename dashboardRegions to annotatedRegions.
+        (WebChromeClient::annotatedRegionsChanged):
+        * WebView/WebView.mm: Rename dashboardRegions to annotatedRegions.
+        (-[WebView _dashboardRegions]):
+
 2012-10-09  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r130811 and r130821.
index 2a32421..24e9bae 100644 (file)
@@ -139,8 +139,7 @@ ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 ENABLE_WEB_TIMING = ;
-ENABLE_WIDGET_REGION = $(ENABLE_WIDGET_REGION_$(REAL_PLATFORM_NAME));
-ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
+ENABLE_WIDGET_REGION = ;
 ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XSLT = ENABLE_XSLT;
 
index 895d8de..707349c 100644 (file)
@@ -117,7 +117,7 @@ public:
     virtual void populateVisitedLinks() OVERRIDE;
 
 #if ENABLE(DASHBOARD_SUPPORT)
-    virtual void dashboardRegionsChanged() OVERRIDE;
+    virtual void annotatedRegionsChanged() OVERRIDE;
 #endif
 
     virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>) OVERRIDE;
index dd1b530..806d62d 100644 (file)
@@ -681,7 +681,7 @@ void WebChromeClient::populateVisitedLinks()
 
 #if ENABLE(DASHBOARD_SUPPORT)
 
-void WebChromeClient::dashboardRegionsChanged()
+void WebChromeClient::annotatedRegionsChanged()
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     CallUIDelegate(m_webView, @selector(webView:dashboardRegionsChanged:), [m_webView _dashboardRegions]);
index 7d04f17..f627e33 100644 (file)
@@ -2122,12 +2122,12 @@ static inline IMP getMethod(id o, SEL s)
     if (!mainFrame)
         return nil;
 
-    const Vector<DashboardRegionValue>& regions = mainFrame->document()->dashboardRegions();
+    const Vector<AnnotatedRegionValue>& regions = mainFrame->document()->annotatedRegions();
     size_t size = regions.size();
 
     NSMutableDictionary *webRegions = [NSMutableDictionary dictionaryWithCapacity:size];
     for (size_t i = 0; i < size; i++) {
-        const DashboardRegionValue& region = regions[i];
+        const AnnotatedRegionValue& region = regions[i];
 
         if (region.type == StyleDashboardRegion::None)
             continue;
index 80ea2d8..69042e7 100644 (file)
@@ -1,3 +1,23 @@
+2012-10-09  Jian Li  <jianli@chromium.org>
+
+        Update the CSS property used to support draggable regions.
+        https://bugs.webkit.org/show_bug.cgi?id=97156
+
+        Reviewed by Adam Barth.
+
+        The CSS property to support draggable regions, guarded under
+        WIDGET_REGION is now disabled from Mac WebKit, in order not to cause
+        confusion with DASHBOARD_SUPPORT feature.
+
+        Also update the code to use the new name annotatedRegions to work for
+        both features.
+
+        * Configurations/FeatureDefines.xcconfig: Disable WIDGET_REGION feature.
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp: Rename dashboardRegions to annotatedRegions.
+        (WebKit::WebChromeClient::annotatedRegionsChanged):
+        * WebProcess/WebCoreSupport/WebChromeClient.h: Rename dashboardRegions to annotatedRegions.
+        (WebChromeClient):
+
 2012-10-09  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r130811 and r130821.
index 53b2fb0..ce41d30 100644 (file)
@@ -139,8 +139,7 @@ ENABLE_WEBGL = ENABLE_WEBGL;
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
 ENABLE_WEB_SOCKETS = ENABLE_WEB_SOCKETS;
 ENABLE_WEB_TIMING = ;
-ENABLE_WIDGET_REGION = $(ENABLE_WIDGET_REGION_$(REAL_PLATFORM_NAME));
-ENABLE_WIDGET_REGION_macosx = ENABLE_WIDGET_REGION;
+ENABLE_WIDGET_REGION = ;
 ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XSLT = ENABLE_XSLT;
 
index 09ed334..ac3daa9 100644 (file)
@@ -562,7 +562,7 @@ void WebChromeClient::reachedApplicationCacheOriginQuota(SecurityOrigin* origin,
 }
 
 #if ENABLE(DASHBOARD_SUPPORT)
-void WebChromeClient::dashboardRegionsChanged()
+void WebChromeClient::annotatedRegionsChanged()
 {
     notImplemented();
 }
index 85dc0e7..1e62f7a 100644 (file)
@@ -139,7 +139,7 @@ private:
     virtual void reachedApplicationCacheOriginQuota(WebCore::SecurityOrigin*, int64_t spaceNeeded) OVERRIDE;
 
 #if ENABLE(DASHBOARD_SUPPORT)
-    virtual void dashboardRegionsChanged() OVERRIDE;
+    virtual void annotatedRegionsChanged() OVERRIDE;
 #endif
 
     virtual void populateVisitedLinks() OVERRIDE;