[CSS Exclusions] Add ExclusionShape::shapeBoundingBox() method
https://bugs.webkit.org/show_bug.cgi?id=99216

Patch by Hans Muller <hmuller@adobe.com> on 2012-10-18
Reviewed by Dirk Schulze.

Added a FloatRect::extend() method which simplifies writing loops that
accumulate the bounding box for a sequence of FloatPoints. The new method
is used by ExclusionPolygon to initialize the shape's logical and physical
bounding boxes. This a clean-up, not a change in functionality. It's already
covered by the existing fast/exclusions LayoutTests.

* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::extend): Extend the FloatRect's bounds to include a FloatPoint.
(WebCore):
* platform/graphics/FloatRect.h:
(FloatRect): Added extend() method.
* rendering/ExclusionPolygon.cpp:
(WebCore::ExclusionPolygon::ExclusionPolygon): Use FloatRect::extend() to compute the polygon's internal bounding box.
* rendering/ExclusionShape.cpp:
(WebCore::ExclusionShape::createExclusionShape): Use FloatRect::extend() to compute the polygon's physical bounding box.
* rendering/ExclusionShape.h:
(WebCore::ExclusionShape::shapeBoundingBox): Return the shape's bounding box in physical coordinates.
(ExclusionShape):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131768 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rebaseline a slider test on Mac.
I think I grabbed the baseline at the wrong time or from the wrong bot yesterday.

* platform/mac/media/video-playing-and-pause-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed testExpectation change for Chromium.

* platform/chromium/TestExpectations: Marked svg/hixie/perf/007.xml as [ Pass Slow ]


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131772 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, mark http/tests/xmlhttprequest/request-encoding2.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=99734

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131775 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add 8-bit path to RenderBlock::handleTrailingSpaces()
https://bugs.webkit.org/show_bug.cgi?id=99731

Reviewed by Dan Bernstein.

Factored out and added findFirstTrailingSpace() templated helper function that is called with the
approriate character pointer type.

No tests needed, change covered by existing tests.

* rendering/RenderBlockLineLayout.cpp:
(WebCore::findFirstTrailingSpace):
(WebCore::RenderBlock::handleTrailingSpaces):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make conversion between JSStringRef and WKStringRef work without character size conversions
https://bugs.webkit.org/show_bug.cgi?id=99727

Reviewed by Anders Carlsson.

Source/JavaScriptCore:

Export the string() method for use in WebKit.

* API/OpaqueJSString.h:
(OpaqueJSString::string):

Source/WebKit2:

Use the wrapped WTFString object to convert between JSStringRef and WKStringRef.

* Shared/WebString.h:
(WebKit::JSStringCreateWithString):
(WebKit::WebString::create):
(WebKit::WebString::createJSString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131777 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add diagnostic logging to track per-page media engine usage.
https://bugs.webkit.org/show_bug.cgi?id=99615
<rdar://problem/12476473>

Reviewed by Eric Carlson.

Add diagnostic logging triggered only once-per-page and once-per-page-per-engine.

* html/HTMLMediaElement.cpp:
(WebCore::logMediaLoadRequest): Encapsulate diagnostic logging into single static method.
(WebCore::HTMLMediaElement::mediaLoadingFailed): Call logMediaLoadRequest.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchDidCommitLoad): Reset the set of seen media engines.

Add new methods to Page to track per-page media engine diagnostic info, similar to plugin diagnostic info.
* page/Page.cpp:
(WebCore::Page::hasSeenAnyMediaEngine):
(WebCore::Page::hasSeenMediaEngine):
(WebCore::Page::sawMediaEngine):
(WebCore::Page::resetSeenMediaEngines):
* page/Page.h:

Add new static logging key definitions:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
* page/DiagnosticLoggingKeys.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement OES_element_index_uint / WEBKIT_OES_element_index_uint
https://bugs.webkit.org/show_bug.cgi?id=97400

Patch by Brandon Jones <bajones@google.com> on 2012-10-18
Reviewed by Kenneth Russell.

Source/WebCore:

Implemented OES_element_index_uint WebGL extension

Test: fast/canvas/webgl/oes-element-index-uint.html

* CMakeLists.txt:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toV8Object):
* html/canvas/OESElementIndexUint.cpp: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
(WebCore):
(WebCore::OESElementIndexUint::OESElementIndexUint):
(WebCore::OESElementIndexUint::~OESElementIndexUint):
(WebCore::OESElementIndexUint::getName):
(WebCore::OESElementIndexUint::create):
* html/canvas/OESElementIndexUint.h: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
(WebCore):
(OESElementIndexUint):
* html/canvas/OESElementIndexUint.idl: Copied from Source/WebCore/html/canvas/WebGLExtension.h.
* html/canvas/WebGLExtension.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::validateElementArraySize):
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
(WebCore::WebGLRenderingContext::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContext::validateRenderingState):
(WebCore::WebGLRenderingContext::drawElements):
(WebCore::WebGLRenderingContext::getExtension):
(WebCore::WebGLRenderingContext::getSupportedExtensions):
* html/canvas/WebGLRenderingContext.h:
(WebCore):
(WebGLRenderingContext):
* platform/graphics/Extensions3D.h:
(Extensions3D):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):

LayoutTests:

Added OES_element_index_uint extension conformance test from KHRONOS

* fast/canvas/webgl/oes-element-index-uint-expected.txt: Added.
* fast/canvas/webgl/oes-element-index-uint.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131780 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fullscreen movie controls behave incorrectly when clicked (and dragged)
https://bugs.webkit.org/show_bug.cgi?id=99610

Reviewed by Eric Carlson.

Source/WebCore:

Do not reset the relative drag position to 0,0 at the beginning of every drag.  Instead,
store the cumulative drag offset and accumulate during each additional drag.

No new tests; modified the fullscreen/video-controls-drag.html test.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startDrag): Reset m_lastDragEventLocation.
(WebCore::MediaControlPanelElement::continueDrag): Accumulate drag distance in m_cumulativeDragOffset.
(WebCore::MediaControlPanelElement::resetPosition): Reset m_cumulativeDragOffset.
* html/shadow/MediaControlElements.h:

LayoutTests:

Add a second drag operation, testing that the location does not reset at the beginning of
each additional drag.

* fullscreen/video-controls-drag-expected.txt:
* fullscreen/video-controls-drag.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix: CachedResourceLoader::requestSVGDocument was passing an URL as charset
https://bugs.webkit.org/show_bug.cgi?id=99730

Patch by Marja Hölttä <marja@chromium.org> on 2012-10-18
Reviewed by Jochen Eisinger.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestSVGDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131782 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement css3-conditional's @supports rule
https://bugs.webkit.org/show_bug.cgi?id=86146

Patch by Pablo Flouret <pablof@motorola.com> on 2012-10-18
Reviewed by Antti Koivisto.

.:

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:
* configure.ac:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

Source/WebCore:

The "@supports" rule is a conditional group rule whose condition tests
whether the user agent supports CSS property:value pairs.

http://dev.w3.org/csswg/css3-conditional/#at-supports

Test: css3/supports.html

* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.am:
* GNUmakefile.features.am:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore):
(WebCore::CSSParser::detectSupportsToken): Tries to find 'and', 'not' and 'or' tokens.
(WebCore::CSSParser::detectAtToken): Enter SupportsMode if @supports is detected.
(WebCore::CSSParser::realLex): Try to detect supports tokens when in SupportsMode.
* css/CSSParser.h: Added new SupportsMode parsing mode.
(CSSParser):

Source/WebKit/chromium:

* features.gypi:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

Tools:

* Scripts/webkitperl/FeatureList.pm:
* qmake/mkspecs/features/features.pri:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.vsprops:
* win/tools/vsprops/FeatureDefinesCairo.vsprops:
    Add an ENABLE_CSS3_CONDITIONAL_RULES flag.

LayoutTests:

* css3/supports-expected.txt: Added.
* css3/supports.html: Added.

* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:
    Skip the test until the feature is enabled.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generated messages should have a receiver name and a name
https://bugs.webkit.org/show_bug.cgi?id=99740

Reviewed by Andreas Kling.

As a first step towards getting rid of MessageID, give each generated message a name and receiver name
and pass them along when sending the messages.

* Platform/CoreIPC/Connection.h:
(CoreIPC::Connection::send):
(CoreIPC::Connection::sendSync):
* Platform/CoreIPC/MessageSender.h:
(CoreIPC::MessageSender::send):
* Scripts/webkit2/messages.py:
(message_to_struct_declaration):
(generate_messages_header):
* Scripts/webkit2/messages_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in WebCore::Document::webkitExitFullscreen + 618
https://bugs.webkit.org/show_bug.cgi?id=99496

Reviewed by Eric Carlson.

Prospective fix for null-dereference crash in Document::webkitExitFullscreen().

* dom/Document.cpp:
(WebCore::Document::webkitExitFullscreen): Null check page() before calling page()->chrome.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-18

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a script for exporting http/tests/w3c/webperf/submission to W3C
https://bugs.webkit.org/show_bug.cgi?id=99675

Reviewed by Tony Gentilcore.

Tools:

This does the inverse of Scripts/import-w3c-performance-wg-tests.

* Scripts/export-w3c-performance-wg-tests: Added.

LayoutTests:

The W3C tests expect a company to contribute them. Move these to the Intel directory.

* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMarks-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_clearMarks-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMarks.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_clearMarks.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMeasures-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_clearMeasures-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_clearMeasures.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_clearMeasures.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_mark-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_mark.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark_exception-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_mark_exception-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_mark_exception.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_mark_exception.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_associate_with_navigation_timing-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure_associate_with_navigation_timing-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_associate_with_navigation_timing.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure_associate_with_navigation_timing.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure_exception-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_measure_exception.html.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_method_exist-expected.txt: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_method_exist-expected.txt.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_method_exist.html: Renamed from LayoutTests/http/tests/w3c/webperf/submission/user-timing/test_user_timing_method_exist.html.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt-5.0-wk2/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Race condition between GCThread and main thread during copying phase
https://bugs.webkit.org/show_bug.cgi?id=99641

Reviewed by Filip Pizlo.

When a GCThread returns from copyFromShared(), it then calls doneCopying(), which returns
its borrowed CopiedBlock to the CopiedSpace. This final block allows the CopiedSpace to
continue and finish the cleanup of the copying phase. However, the GCThread can loop back
around, see that m_currentPhase is still "Copy", and try to go through the copying phase again.
This can cause all sorts of issues. To fix this, we should add a cyclic barrier to GCThread::waitForNextPhase().

* heap/GCThread.cpp:
(JSC::GCThread::waitForNextPhase): All GCThreads will wait when they finish one iteration until the main thread
notifies them to move down to the second while loop, where they wait for the next GCPhase to start. They also
decrement the m_numberOfActiveGCThreads counter as they begin to wait for the next phase and increment it as
they enter the next phase. This allows the main thread to wait in endCurrentPhase() until all the threads have
finished the current phase and are waiting on the next phase to begin. Without the counter, there would be
no way to ensure that every thread was available for each GCPhase.
(JSC::GCThread::gcThreadMain): We now use the m_phaseLock to synchronize with the main thread when we're being created.
* heap/GCThreadSharedData.cpp:
(JSC::GCThreadSharedData::GCThreadSharedData): As we create each GCThread, we increment the m_numberOfActiveGCThreads
counter. When we are done creating the threads, we wait until they're all waiting for the next GCPhase. This prevents
us from leaving some GCThreads behind during the first GCPhase, which could hurt us on our very short-running
benchmarks (e.g. SunSpider).
(JSC::GCThreadSharedData::~GCThreadSharedData):
(JSC::GCThreadSharedData::startNextPhase): We atomically swap the two flags, m_gcThreadsShouldWait and m_currentPhase,
so that if the threads finish very quickly, they will wait until the main thread is ready to end the current phase.
(JSC::GCThreadSharedData::endCurrentPhase): Here atomically we swap the two flags again to allow the threads to
advance to waiting on the next GCPhase. We wait until all of the GCThreads have settled into the second wait loop
before allowing the main thread to continue. This prevents us from leaving one of the GCThreads stuck in the first
wait loop if we were to call startNextPhase() before it had time to wake up and move on to the second wait loop.
(JSC):
(JSC::GCThreadSharedData::didStartMarking): We now use startNextPhase() to properly swap the flags.
(JSC::GCThreadSharedData::didFinishMarking): Ditto for endCurrentPhase().
(JSC::GCThreadSharedData::didStartCopying): Ditto.
(JSC::GCThreadSharedData::didFinishCopying): Ditto.
* heap/GCThreadSharedData.h:
(GCThreadSharedData):
* heap/Heap.cpp:
(JSC::Heap::copyBackingStores): No reason to use the extra reference.


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

* Scripts/webkit2/messages.py:
(message_to_struct_declaration):
(generate_messages_header):
* Scripts/webkit2/messages_unittest.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in InRegionScrollableArea constructor while loading page
https://bugs.webkit.org/show_bug.cgi?id=99733

Patch by John Griggs <jgriggs@rim.com> on 2012-10-18
Reviewed by Antonio Gomes.

Check scrollLayer and avoid constructing InRegionScrollableArea when it is NULL.

* Api/InRegionScroller.cpp:
(BlackBerry::WebKit::InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit Doesn't Recognize Content-Language HTTP Header
https://bugs.webkit.org/show_bug.cgi?id=97929

Patch by Brian White <bcwhite@chromium.org> on 2012-10-18
Reviewed by Alexey Proskuryakov.

The HTTP "Content-Language" header may be present and include the
language of the page contents (as opposed to an embedded meta tag).

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] GraphicsContext3D::m_renderStyle is not initialized
https://bugs.webkit.org/show_bug.cgi?id=99721

Patch by Yael Aharon <yael.aharon@intel.com> on 2012-10-18
Reviewed by Antonio Gomes.

Initialize GraphicsContext3D::m_renderStyle.

No new tests, no new functionality.

* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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