Chromium: Hang parsing bidi control chars on Mac OS X 10.6
https://bugs.webkit.org/show_bug.cgi?id=108877

This was broken a while ago by:
    https://bugs.webkit.org/show_bug.cgi?id=83045

On 10.6, CoreText will not produce any runs covering the
Unicode BiDi RTL mark control char, which causes an infinite
loop in ComplexTextController::indexOfCurrentRun() due to no
run covering the character at offset 0.

This patch fixes that issue by finding the earliest run
explicitly via the minimum stringBegin() index instead of
relying on a run existing that covers offset 0.

Fixes hang on many BiDi wikipedia pages on Chromium/Mac10.6.
Chromium bug: http://crbug.com/167844

Source/WebCore:

New test in the same style as the harfbuzz-buffer-overrun.html
test (in the same folder).

Patch by Alexei Svitkine <asvitkine@chromium.org> on 2013-02-07
Reviewed by Eric Seidel.

Test: fast/text/international/rtl-mark.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::indexOfCurrentRun):

LayoutTests:

New test in the same style as harfbuzz-buffer-overrun.html
in the same folder.

Patch by Alexei Svitkine <asvitkine@chromium.org> on 2013-02-07
Reviewed by Eric Seidel.

* fast/text/international/rtl-mark-expected.txt: Added.
* fast/text/international/rtl-mark.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Makefiles should work for arbitrary SDKs and architectures on Apple ports
https://bugs.webkit.org/show_bug.cgi?id=107863

Patch by David Farler <dfarler@apple.com> on 2013-02-07
Reviewed by Mark Rowe.

.:

* Makefile:
Allow SDKROOT, ARCHS outside of $(ARGS).
Setting ARCHS => ONLY_ACTIVE_ARCH=NO.
* Makefile.shared: options to webkitdirs based on SDKROOT
* Source/Makefile: don't build WebKit2 for iOS

Tools:

* DumpRenderTree/Makefile: SDKROOT=iphone* => -target All-iOS
* Makefile: Only build some projects for iOS

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Turn selecting-text-through-different-region-flows test into a reftest
https://bugs.webkit.org/show_bug.cgi?id=109228

Reviewed by Eric Seidel.

Simplify and turn the test into a reftest, remove the unnecessary expected files.

* fast/regions/selecting-text-through-different-region-flows-expected.html: Added.
* fast/regions/selecting-text-through-different-region-flows-expected.txt: Removed.
* fast/regions/selecting-text-through-different-region-flows.html:
* platform/chromium-linux/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/chromium-mac-lion/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/chromium-win/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/chromium-win/fast/regions/selecting-text-through-different-region-flows-expected.txt: Removed.
* platform/efl/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/efl/fast/regions/selecting-text-through-different-region-flows-expected.txt: Removed.
* platform/gtk/fast/regions/selecting-text-through-different-region-flows-expected.txt: Removed.
* platform/qt/fast/regions/selecting-text-through-different-region-flows-expected.png: Removed.
* platform/qt/fast/regions/selecting-text-through-different-region-flows-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] #ifndef NDEBUG is redundant for assertContextHasCorrectPrototype()
https://bugs.webkit.org/show_bug.cgi?id=109167

Reviewed by Andreas Kling.

Given that assertContextHasCorrectPrototype() is anyway empty in a release
build, we don't need to surround it with #ifndef NDEBUG.

No tests. No change in behavior.

* bindings/v8/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::assertContextHasCorrectPrototype):
* bindings/v8/DOMWrapperWorld.h:
(DOMWrapperWorld):
(WebCore::DOMWrapperWorld::isolated):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Corrections the exports definition file.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
* WebKit.vcproj/WebKitExports.def.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Unreviewed, skip crashing test

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PluginProcess should quit immediately if idle in response to low-memory notifications
https://bugs.webkit.org/show_bug.cgi?id=109103
<rdar://problem/12679827>

Reviewed by Darin Adler.

Source/WebCore: 

This patch allows a process to set a custom callback for low memory warnings
(defaulting to the current behaviour, as implemented in releaseMemory).

MemoryPressureHandler::install is currently used for two purposes - it is
called when first initializing a low memory handler for a process, and also
used to reinstall the handler (on a delay) after the notification has occured.
Since reinstallation doesn't change the callback, split these behaviours out -
MemoryPressureHandler::initialize is added to initialization, and accepts a
custom callback, install in made private.

* WebCore.exp.in:
    - Added export for releaseMemory.
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseMemory):
    - Added null implementation for non-Mac builds.
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::initialize):
    - distinguish initialization from reinstallations, allow handler to be set.
(MemoryPressureHandler):
    - Added m_lowMemoryHandler function pointer member variable.
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
    - Call m_lowMemoryHandler instead of releaseMemory.

Source/WebKit/mac: 

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.
(WebInstallMemoryPressureHandler):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.

Source/WebKit2: 

PluginProcess now initializes a MemoryPressureHandler for the process, providing
a custom callback which will call terminate if appropriate (if the plugin is not
currently in use).

* PluginProcess/PluginProcess.cpp:
(WebKit::PluginProcess::lowMemoryHandler):
    - Custom callback to terminate if appropriate.
(WebKit::PluginProcess::initializeProcess):
    - Initialize the MemoryPressureHandler.
(WebKit::PluginProcess::shouldTerminate):
    - This method now also needs to be callable in situations where it might return false.
* PluginProcess/PluginProcess.h:
(PluginProcess):
    - Added declaration for lowMemoryHandler.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
    - MemoryPressureHandler::install is now called via MemoryPressureHandler::initialize.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a comment about how the SQLTransaction state machine works.
https://bugs.webkit.org/show_bug.cgi?id=109243.

Rubber stamped by Anders Carlsson.

No new tests.

* Modules/webdatabase/SQLTransactionBackend.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium-Android] Disable input[type=datetime]
https://bugs.webkit.org/show_bug.cgi?id=107614

Reviewed by Kentaro Hara.

Source/WebKit/chromium:

Reason:
http://lists.webkit.org/pipermail/webkit-dev/2013-January/023404.html

* features.gypi:
Disable ENABLE_INPUT_TYPE_DATETIME because of a wrong UI.
We enable it for non-Android ports but the runtime flag for it is
disabled by default. The runtime flag is enabled only in DumpRenderTree.

LayoutTests:

* platform/chromium/TestExpectations:
Tetsts in fast/forms/datetime/ fail.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
getComputedStyle() doesn't report intermediate values during a transition of a pseudo element
https://bugs.webkit.org/show_bug.cgi?id=106535

Reviewed by Ojan Vafai.

Source/WebCore:

Element::computedStyle and CSSComputedStyleDeclaration::getPropertyCSSValue
should use the PseudoElement and it's renderer if they exist so that
querying the computed style while an animation is running returns
the intermediate values.

No new tests, updated existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::styledNode): Added, returns either the PseudoElement or the Node.
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Updated to use styledNode.
* css/CSSComputedStyleDeclaration.h:
(CSSComputedStyleDeclaration):
* dom/Element.cpp:
(WebCore::Element::computedStyle): Check the PseudoElement, not just the cached pseudo style.
* dom/ElementRareData.h:
(WebCore::ElementRareData::pseudoElement): Remove ASSERT_NOT_REACHED so passing other pseudos returns 0.

LayoutTests:

Update tests to also check getComputedStyle during animations and transitions.

* fast/css-generated-content/pseudo-animation-expected.txt:
* fast/css-generated-content/pseudo-animation.html:
* fast/css-generated-content/pseudo-transition-expected.txt:
* fast/css-generated-content/pseudo-transition.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r142113.
http://trac.webkit.org/changeset/142113
https://bugs.webkit.org/show_bug.cgi?id=109244

tests started failing after r142081 was rolled out in r142166
(Requested by falken on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-07

* inspector/profiler/memory-instrumentation-cached-images-expected.txt:
* inspector/profiler/memory-instrumentation-cached-images.html:
* inspector/profiler/memory-instrumentation-canvas-expected.txt:
* inspector/profiler/memory-instrumentation-canvas.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Move V8DOMWrapper::setNamedHiddenReference() to V8HiddenPropertyName.h
https://bugs.webkit.org/show_bug.cgi?id=109186

Reviewed by Adam Barth.

V8HiddenPropertyName.h is a right place for setNamedHiddenReference().

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateNormalAttrGetter):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::readOnlyTestObjAttrAttrGetter):
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
* bindings/v8/V8HiddenPropertyName.cpp:
(WebCore::V8HiddenPropertyName::hiddenReferenceName):
(WebCore::V8HiddenPropertyName::setNamedHiddenReference):
(WebCore):
* bindings/v8/V8HiddenPropertyName.h:
(V8HiddenPropertyName):
(WebCore::V8HiddenPropertyName::V8HiddenPropertyName):
* bindings/v8/custom/V8MessageChannelCustom.cpp:
(WebCore::V8MessageChannel::constructorCallbackCustom):
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::toV8Object):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Rebaseline bidi-ignored-for-first-child-inline.html
which was failing on Chromium Mac after r142152.

* platform/chromium-mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt: Renamed from LayoutTests/platform/chromium/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] RunLoop::run shuold run current thread's run loop.
https://bugs.webkit.org/show_bug.cgi?id=107887

Patch by Seulgi Kim <seulgikim@company100.net> on 2013-02-07
Reviewed by Martin Robinson.

Currently, RunLoop in Gtk can use just main thread's event loop.
But the other ports are implemented to use RunLoop in sub threads.

This patch makes RunLoop constructor create new context, not use default
context.
But in the main thread still uses default context to use main event loop
since there is some codes using glib directly (e.g. in
LayerTreeHostGtk::scheduleLayerFlush).

No new tests. There is no case that uses RunLoop in off the main thread
yet.

* platform/gtk/RunLoopGtk.cpp:
(WebCore::RunLoop::RunLoop):
(WebCore::RunLoop::run):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Enable non-video element enter/exit fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=108314

Reviewed by Antonio Gomes.

Webkit support non-video element (like div) to enter/exit
fullscreen. We should pass this capability in blackberry porting.

RIM PR 256370, internally reviewed by Max Feil.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::clearDocumentData):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
(BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited):
(BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
(BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode):
(WebKit):
(BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded):
* Api/WebPage_p.h:
(WebPagePrivate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Followup review suggestions from Alexey Proskuryakov on
https://bugs.webkit.org/show_bug.cgi?id=109215

Don't provide a charset on embedded SVG, especially
with incorrect syntax :)

* css/mediaControlsQuickTime.css:
(video::-webkit-media-controls-toggle-closed-captions-button):
(video::-webkit-media-controls-closed-captions-track-list li.selected):
(video::-webkit-media-controls-closed-captions-track-list li.selected:hover):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Remove dead code after r142169
https://bugs.webkit.org/show_bug.cgi?id=109251

Reviewed by Benjamin Poulain.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::contentsSizeChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NamedFlowCollection should be a ContextDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=99239

Patch by Hanyee Kim <choco@company100.net> on 2013-02-07
Reviewed by Adam Barth

This patch removes the raw pointer of Document in NamedFlowCollection.
It could be replaced with ContextDestructionObserver.
ContextDestructionObserver has the pointer and clears the pointer
automatically when the document is destroyed.

* dom/Document.cpp:
(WebCore::Document::~Document):
* dom/NamedFlowCollection.cpp:
(WebCore::NamedFlowCollection::NamedFlowCollection):
(WebCore::NamedFlowCollection::ensureFlowWithName):
(WebCore::NamedFlowCollection::discardNamedFlow):
(WebCore::NamedFlowCollection::document):
(WebCore):
* dom/NamedFlowCollection.h:
(NamedFlowCollection):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline text output for contentOpaque
https://bugs.webkit.org/show_bug.cgi?id=108656

Unreviewed rebaseline.

* platform/chromium-mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:
* platform/chromium/TestExpectations:
* platform/chromium/compositing/visibility/visibility-image-layers-dynamic-expected.txt: Renamed from LayoutTests/platform/chromium-win/compositing/visibility/visibility-image-layers-dynamic-expected.txt.
* platform/mac/TestExpectations:
* platform/mac/compositing/visibility/visibility-image-layers-dynamic-expected.txt:
* platform/mac/platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt: Added.

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