[WK2] WebKitTestRunner needs to print information about Web intents
https://bugs.webkit.org/show_bug.cgi?id=90873

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-23
Reviewed by Anders Carlsson.

Source/WebKit2:

Add Bundle API for Web Intents. This is needed by the WebKitTestRunner
to print information about the new intent requests and the intent
service registrations.

* CMakeLists.txt: Move WebIntentData and WebIntentServiceInfo from
UIProcess/ to Shared/.
* GNUmakefile.list.am: Move WebIntentData and WebIntentServiceInfo from
UIProcess/ to Shared/.
* Shared/APIClientTraits.h:
* Shared/WebIntentData.cpp: Renamed from Source/WebKit2/UIProcess/WebIntentData.cpp.
(WebKit):
(WebKit::WebIntentData::WebIntentData):
(WebKit::WebIntentData::data):
(WebKit::WebIntentData::suggestions):
(WebKit::WebIntentData::extra):
(WebKit::WebIntentData::extras):
* Shared/WebIntentData.h: Renamed from Source/WebKit2/UIProcess/WebIntentData.h.
(WebKit):
(WebIntentData):
(WebKit::WebIntentData::create):
(WebKit::WebIntentData::~WebIntentData):
(WebKit::WebIntentData::action):
(WebKit::WebIntentData::payloadType):
(WebKit::WebIntentData::service):
(WebKit::WebIntentData::store):
(WebKit::WebIntentData::type):
* Shared/WebIntentServiceInfo.cpp: Renamed from Source/WebKit2/UIProcess/WebIntentServiceInfo.cpp.
(WebKit):
(WebKit::WebIntentServiceInfo::WebIntentServiceInfo):
* Shared/WebIntentServiceInfo.h: Renamed from Source/WebKit2/UIProcess/WebIntentServiceInfo.h.
(WebKit):
(WebIntentServiceInfo):
(WebKit::WebIntentServiceInfo::create):
(WebKit::WebIntentServiceInfo::~WebIntentServiceInfo):
(WebKit::WebIntentServiceInfo::action):
(WebKit::WebIntentServiceInfo::payloadType):
(WebKit::WebIntentServiceInfo::href):
(WebKit::WebIntentServiceInfo::title):
(WebKit::WebIntentServiceInfo::disposition):
(WebKit::WebIntentServiceInfo::type):
* Target.pri: Move WebIntentData and WebIntentServiceInfo from
UIProcess/ to Shared/.
* UIProcess/API/C/WKPage.h:
* UIProcess/API/efl/ewk_view_loader_client.cpp:
(didReceiveIntentForFrame):
(registerIntentServiceForFrame):
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::didReceiveIntentForFrame):
(WebKit::WebLoaderClient::registerIntentServiceForFrame):
* UIProcess/WebLoaderClient.h:
(WebLoaderClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::registerIntentServiceForFrame):
(WebKit::WebPageProxy::didReceiveIntentForFrame):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit):
(WebKit::InjectedBundlePageLoaderClient::didReceiveIntentForFrame):
(WebKit::InjectedBundlePageLoaderClient::registerIntentServiceForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
(WebKit):
(InjectedBundlePageLoaderClient):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchIntent):
(WebKit::WebFrameLoaderClient::registerIntentService):
* WebProcess/qt/QtBuiltinBundlePage.cpp:
(WebKit::QtBuiltinBundlePage::QtBuiltinBundlePage):

Tools:

Print out information about new intents requests and intent
services registrations in WebKitTestRunner. This is expected
by tests under webintents/*.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):
(WTR::InjectedBundlePage::didReceiveIntentForFrame):
(WTR):
(WTR::InjectedBundlePage::registerIntentServiceForFrame):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
(InjectedBundlePage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Refactor CCLayerTreeHostCommon: clean up clipRect and drawableContentRect design
https://bugs.webkit.org/show_bug.cgi?id=80622

Reviewed by Adrienne Walker.

Source/WebCore:

clipRect(), usesLayerClipping(), and drawableContentRect() have been
very confusing in CCLayerTreeHostCommon for a while. This patch
refactors it so that (1) clipping is only done locally in
calcDrawTransforms, and (2) the layer's drawableContentRect value
is now meaningful value outside of calcDrawTransforms.
Additionally, the layer is now always clipped to the root
surface's contentBounds (which are set to the viewport bounds).
This refactor not only makes calcDrawTransforms far more readable and intuitive, but
this patch enables more upcoming beneficial refactors, including
the pending refactor in https://bugs.webkit.org/show_bug.cgi?id=88953.

Tests are also significantly updated to keep up with this refactoring change.

* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
* platform/graphics/chromium/LayerChromium.h:
(LayerChromium):
Removed m_usesLayerClipping and m_clipRect and associated accessors.

* platform/graphics/chromium/RenderSurfaceChromium.h:
(RenderSurfaceChromium):
Updated comment

* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::CCLayerImpl):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(CCLayerImpl):
Removed m_usesLayerClipping and m_clipRect and associated accessors.

* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::updateLayers):
removed setClipRect code that no longer applies

* platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
(WebCore::calculateLayerScissorRect):
scissor rect is now a little bit tighter, the intersection between damage and layer's new drawableContentRect.

(WebCore::calculateSurfaceScissorRect):
scissor rect is now a little bit tighter, except when filters are involved.

(WebCore::layerClipsSubtree):
new helper function

(WebCore):
(WebCore::calculateVisibleContentRect):
(WebCore::subtreeShouldRenderToSeparateSurface):
(WebCore::calculateDrawTransformsInternal):
   - added drawableContentRectOfSubtree to the function args, it is valid only after recursion returns,
   - added clipRectFromAncestor and bool ancestorClipsSubtree to function args, this replaces the layer's clipRect and usesLayerClipping.
   - removed the boolean return value, which was redundant with drawableContentRectOfSubtree.
   - replaced all the "setDrawableContentRect" logic with more intuitive, clear logic.
   - now, layer's drawableContentRect represents the clipped bounds of the layer expressed in the target surface space.

(WebCore::CCLayerTreeHostCommon::calculateDrawTransforms):
(WebCore::pointIsClippedBySurfaceOrClipRect):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::calculateRenderSurfaceLayerList):
* platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
(WebCore::::layerScissorRectInTargetSurface):
Updated this accessor.  It could be removed in the future, but not appropriate for this patch.

* platform/graphics/chromium/cc/CCRenderSurface.h:

Source/WebKit/chromium:

Many tests needed to be updated because the semantics of the layer tree have changed:
  - a few tests that were no longer applicable were removed.
  - many tests needed to have fixed initialization, properly
    setting surface contentRect and rootLayer bounds.
  - because clipRect and usesLayerClipping no longer exists, those places in code had to be removed/changed
  - the scissorRect tests needed to have updated expectations
    because after this patch, the rootLayer Surface now clips
    to its contentBounds.
  - the clipRect tests were changed to test the layer's new semantics for the drawableContentRect instead.

* tests/CCLayerImplTest.cpp:
(WebCore::TEST):
* tests/CCLayerIteratorTest.cpp:
* tests/CCLayerTreeHostCommonTest.cpp:
* tests/CCLayerTreeHostImplTest.cpp:
* tests/CCLayerTreeHostTest.cpp:
* tests/CCOcclusionTrackerTest.cpp:
(WebKitTests::CCOcclusionTrackerTest::calcDrawEtc):
(WebKitTests::CCOcclusionTrackerTestAnimationOpacity1OnMainThread::runMyTest):
(WebKitTests::CCOcclusionTrackerTestAnimationOpacity0OnMainThread::runMyTest):
* tests/LayerChromiumTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move JSC::parseDate() from DateConversion to JSDateMath
https://bugs.webkit.org/show_bug.cgi?id=91982

Reviewed by Geoffrey Garen.

Moveing this function into the other files removes the dependency
on JSC spcific classes in DateConversion.{cpp|h}.

* runtime/DateConversion.cpp:
* runtime/DateConversion.h:
(JSC):
* runtime/JSDateMath.cpp:
(JSC::parseDate):
(JSC):
* runtime/JSDateMath.h:
(JSC):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when setting empty class name on a new element
https://bugs.webkit.org/show_bug.cgi?id=92024

Reviewed by Andreas Kling.

Source/WebCore: 

Add a check for null attributeData() when setting the className to an
empty string on a newly created element. New SVG elements have null
attributeData() on baseVal upon creation.

Test: svg/custom/empty-className-baseVal-crash.html

* dom/StyledElement.cpp:
(WebCore::StyledElement::classAttributeChanged): Add check for null attributeData()

LayoutTests: 

Add a check for null attributeData() when setting the className to an
empty string on a newly created element.

* svg/custom/empty-className-baseVal-crash-expected.txt: Added.
* svg/custom/empty-className-baseVal-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed chromium expectations change to mark media/media-fragments/TC0010-TC0019.html as flaky/crashy.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Part 2 of: Implement sticky positioning
https://bugs.webkit.org/show_bug.cgi?id=90046

Reviewed by Ojan Vafai.

Source/JavaScriptCore:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Turn on ENABLE_CSS_STICKY_POSITION. Add support for parsing the new '-webkit-sticky'
value for position, returning it from getComputedStyle(), and storing it in RenderStyle.

Test: fast/css/sticky/parsing-position-sticky.html

* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getPositionOffsetValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EPosition):
* css/CSSValueKeywords.in:
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:

Source/WebKit/chromium:

Turn on ENABLE_CSS_STICKY_POSITION.

* features.gypi:

Source/WebKit/mac:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Turn on ENABLE_CSS_STICKY_POSITION.

* Configurations/FeatureDefines.xcconfig:

LayoutTests:

Test for parsing and returning fro getComputedStyle() the new
-webkit-sticky value for position.

* fast/css/sticky/parsing-position-sticky-expected.txt: Added.
* fast/css/sticky/parsing-position-sticky.html: Added.
* fast/css/sticky/resources/parsing-position-sticky.js: Added.
(test):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nrwt swallows early exceptions
https://bugs.webkit.org/show_bug.cgi?id=91884

Reviewed by Dirk Pranke.

Put everything in a try block so we won't miss any error.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(run):
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] dom/xhtml/level3/core rebaseline after new test fonts
https://bugs.webkit.org/show_bug.cgi?id=92028

Unreviewed.

* platform/qt-5.0/Skipped:
* platform/qt/dom/xhtml/level3/core/documentgetinputencoding03-expected.txt:
* platform/qt/dom/xhtml/level3/core/entitygetinputencoding02-expected.txt:
* platform/qt/dom/xhtml/level3/core/entitygetxmlversion02-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri05-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri07-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri09-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri10-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri11-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri15-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri17-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodegetbaseuri18-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodelookupnamespaceuri01-expected.txt:
* platform/qt/dom/xhtml/level3/core/nodelookupprefix19-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] TestInterfaces should be responsible for owning and binding AccessibilityController and TextInputController
https://bugs.webkit.org/show_bug.cgi?id=91459

Reviewed by Ryosuke Niwa.

Rather than having TestShell own and bind each of these JavaScript APIs
individually, TestShell should delegate that work to TestInterfaces.
This patch moves AccessibilityController and TextInputController to be
the responsibility of TestInterfaces.

* DumpRenderTree/chromium/TestRunner/TestInterfaces.cpp:
(TestInterfaces::TestInterfaces):
(TestInterfaces::~TestInterfaces):
(TestInterfaces::setWebView):
(TestInterfaces::bindTo):
(TestInterfaces::resetAll):
* DumpRenderTree/chromium/TestRunner/TestInterfaces.h:
(WebKit):
(TestInterfaces):
(TestInterfaces::accessibilityController):
* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::initialize):
(TestShell::createMainWindow):
(TestShell::~TestShell):
(TestShell::resetTestController):
(TestShell::bindJSObjectsToWindow):
* DumpRenderTree/chromium/TestShell.h:
(TestShell::accessibilityController):
(TestShell):


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