[V8] Unify setJSWrapperForDOMObject and setJSWrapperForDOMNode
https://bugs.webkit.org/show_bug.cgi?id=101422

Reviewed by Kentaro Hara.

This patch is another incremental step towards the patch in Bug 10110.
In this step, we unify setJSWrapperForDOMObject and
setJSWrapperForDOMNode.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):
(GenerateNormalAttrGetter):
(GenerateConstructorCallback):
(GenerateNamedConstructorCallback):
(GenerateToV8Converters):
* bindings/scripts/test/V8/V8Float64Array.h:
(WebCore::V8Float64Array::wrap):
* bindings/scripts/test/V8/V8TestActiveDOMObject.h:
(WebCore::V8TestActiveDOMObject::wrap):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
(WebCore::V8TestCustomNamedGetter::wrap):
* bindings/scripts/test/V8/V8TestEventConstructor.h:
(WebCore::V8TestEventConstructor::wrap):
* bindings/scripts/test/V8/V8TestEventTarget.h:
(WebCore::V8TestEventTarget::wrap):
* bindings/scripts/test/V8/V8TestException.h:
(WebCore::V8TestException::wrap):
* bindings/scripts/test/V8/V8TestInterface.h:
(WebCore::V8TestInterface::wrap):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
(WebCore::V8TestMediaQueryListListener::wrap):
* bindings/scripts/test/V8/V8TestNamedConstructor.h:
(WebCore::V8TestNamedConstructor::wrap):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore::V8TestNode::constructorCallback):
(WebCore::V8TestNode::wrapSlow):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::readOnlyTestObjAttrAttrGetter):
* bindings/scripts/test/V8/V8TestObj.h:
(WebCore::V8TestObj::wrap):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
(WebCore::V8TestSerializedScriptValueInterface::wrap):
* bindings/v8/DOMDataStore.cpp:
(WebCore::DOMDataStore::current):
* bindings/v8/DOMDataStore.h:
(WebCore::DOMDataStore::get):
(DOMDataStore):
* bindings/v8/V8DOMWrapper.cpp:
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):
(WebCore::V8DOMWrapper::setJSWrapperPrivate):
(WebCore::V8DOMWrapper::setJSWrapperForDOMObject):
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore::v8HTMLImageElementConstructorCallback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable REQUEST_AUTOCOMPLETE for chromium port
https://bugs.webkit.org/show_bug.cgi?id=101376

Patch by Dan Beam <dbeam@chromium.org> on 2012-11-06
Reviewed by Adam Barth.

Source/WebCore:

Added a runtime enabled feature to control whether HTMLFormElement#requestAutocomplete is visible from JavaScript.

* bindings/generic/RuntimeEnabledFeatures.cpp:
(WebCore):
* bindings/generic/RuntimeEnabledFeatures.h:
(RuntimeEnabledFeatures):

Added a binding from RuntimeEnabledFeatures that triggers [V8EnabledAtRuntime=requestAutocomplete].

(WebCore::RuntimeEnabledFeatures::requestAutocompleteEnabled):

Added a getter to WebCore to ask whether the runtime flag requestAutocomplete is on.

(WebCore::RuntimeEnabledFeatures::setRequestAutocompleteEnabled):

Added a setter to WebCore to affect the runtime flag requestAutocomplete.

* html/HTMLFormElement.idl:

Wrapped commonly grouped features in an #if defined(ENABLED_REQUEST_AUTOCOMPLETE) block and added [V8EnableAtRuntime]
so these features can be changed with a command line switch in the chromium port.

Source/WebKit/chromium:

This patch enables the feature flag REQUEST_AUTOCOMPLETE in WebKit/chromium only to allow web authors to start to use
HTMLFormElement#requestAutocomplete as the chrome-side work progresses further.

* features.gypi:

Turned on the *compile* time flag for REQUEST_AUTOCOMPLETE in chromium's webkit port but also added a *run* time flag
that functionally enables the behavior.  This means the chromium port will compile in support but will require a run
time flag to enable.

* public/WebRuntimeFeatures.h:
(WebRuntimeFeatures):

Added a method to the public chromium run time features interface to allow chrome to enable/disable this feature.

* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableRequestAutocomplete):
(WebKit):

A setter than can be called from chrome code to change the enable/disable requestAutocomplete and associated events at
runtime.

(WebKit::WebRuntimeFeatures::isRequestAutocompleteEnabled):

A getter that returns whether the requestAutocomplete run time feature is enabled.

Tools:

This patch enables the feature flag REQUEST_AUTOCOMPLETE in WebKit/chromium only to allow web authors to start to use
HTMLFormElement#requestAutocomplete as the chrome-side work progresses further.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):

Enables the requestAutocomplete runtime feature flag during tests.

LayoutTests:

This patch enables the feature flag REQUEST_AUTOCOMPLETE in WebKit/chromium only to allow web authors to start to use
HTMLFormElement#requestAutocomplete as the chrome-side work progresses further.

* fast/forms/form-request-autocomplete-expected.txt:

Updated to match form-request-autocomplete.html changes.

* fast/forms/form-request-autocomplete.html:

Remove bug number as per Adam Barth <abarth@webkit.org>'s advice.

* platform/chromium/fast/forms/form-request-autocomplete-expected.txt: Added.

Adding expected successful layout test for form-request-autocomplete.html tests to chromium specific directory
(as chromium is currently the only place the feature is enabled).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed attempt to fix the chromium-mac build.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133721 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement month picking to calendar picker
https://bugs.webkit.org/show_bug.cgi?id=101333

Reviewed by Kent Tamura.

.:

* ManualTests/forms/calendar-picker.html: Added test for month picker.

Source/WebCore:

This adds month picker mode to CalendarPicker.

No new tests. Tests will be added later when this feature is enabled in DRT.

* Resources/pagepopups/calendarPicker.css:
(.month-mode .day): Remove rounded corners when in month mode.
* Resources/pagepopups/calendarPicker.js:
(Month.createFromToday): Creates month containing today.
(CalendarPicker): Set this.selectionConstructor to Day or Month depending on the mode. Create DayTables or MonthPickerDaysTable depending on the mode.
(CalendarPicker.prototype.handleToday):
(CalendarPicker.prototype._layoutButtons):
(DaysTable.prototype._renderMonth): Set element.dataset.monthValue for all date nodes.
(DaysTable.prototype._markRangeAsSelected): Marks all day nodes in range as selected.
(DaysTable.prototype.selectRange): Selects a day.
(DaysTable.prototype.selectRangeAndShowEntireRange): Same as selectRange.
(DaysTable.prototype._selectRangeContainingNode):
(DaysTable.prototype._rangeForNode): Returns Day for node.
(DaysTable.prototype.startDate): Start datetime of visible date range. This value is inclusive.
(DaysTable.prototype.endDate): End datetime of visible date range. This value is exclusive.
(DaysTable.prototype._handleKey):
(MonthPickerDaysTable):
(MonthPickerDaysTable.prototype._markRangeAsSelected): Marks all day nodes in range as selected.
(MonthPickerDaysTable.prototype.selectRange): Selects month. If month is not visible, navigates to that month.
(MonthPickerDaysTable.prototype.selectRangeAndShowEntireRange): Selects month. Navigates to the month.
(MonthPickerDaysTable.prototype._rangeForNode): Returns Month for node.
(MonthPickerDaysTable.prototype._handleKey): Arrow keys simply move the selection forwards or backwards.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] API test crash with accelerated compositing on.
https://bugs.webkit.org/show_bug.cgi?id=101384

Patch by Viatcheslav Ostapenko <v.ostapenko@samsung.com> on 2012-11-06
Reviewed by Gyuyoung Kim.

If accelerated compositing is enabled API tests should create GL evas engine
instead of default one.
Also, in API tests first window resize and display often comes earlier
than enterAcceleratedCompositingMode call, so let's create GL surface in
_ewk_view_smart_calculate on first window resize.

* UIProcess/API/efl/ewk_view.cpp:
(_ewk_view_smart_calculate):
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
(EWK2UnitTest::EWK2UnitTestBase::SetUp):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move DrawingAreaImpl methods graphicsLayerFactory, setRootCompositingLayer & scheduleCompositingLayerSync under ACCELERATED_COMPOSITING
https://bugs.webkit.org/show_bug.cgi?id=101427

Patch by Vivek Galatage <vivekgalatage@gmail.com> on 2012-11-06
Reviewed by Anders Carlsson.

Moving these methods under the ACCELERATED_COMPOSITING flag.
This fixes broken wincairo due to use of override specifier.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit):
* WebProcess/WebPage/DrawingAreaImpl.h:
(DrawingAreaImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] media/media-continues-playing-after-replace-source.html fails
https://bugs.webkit.org/show_bug.cgi?id=101429

Unreviewed, EFL gardening.

media-continues-playing-after-replace-source.html test case crashes in WK2 only.

Patch by Kangil Han <kangil.han@samsung.com> on 2012-11-06

* platform/efl-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StringBuilder::append(UChar) with an 8 bit quantity shouldn't change the contents to 16 bits
https://bugs.webkit.org/show_bug.cgi?id=101421

Reviewed by Anders Carlsson.

If the string builder contains only 8 bit data, check if the character being appended contains
8 bit data.  If so, append it to the 8 bit buffer instead of converting the buffer to 16 bits.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::append):
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Console not displaying all properties of an Object once native Constructor overwritten
https://bugs.webkit.org/show_bug.cgi?id=101320

Reviewed by Pavel Feldman.

Source/WebCore:

Use Object instance from {}.constructor when formatting inspector messages in the
injected script. Otherwise inspected page may overwrite Object value and break inspector.

Test: inspector/console/console-Object-overwritten.html

* inspector/InjectedScriptSource.js:

LayoutTests:

Check that Web Inspector's console works fine if Object is overwritten in the inspected
page.

* inspector/console/console-Object-overwritten-expected.txt: Added.
* inspector/console/console-Object-overwritten.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Fix execution of exif-orientation-image-document.html on EFL Wk2 bot
https://bugs.webkit.org/show_bug.cgi?id=101343

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Add Cairo to the list of backends that support shouldRespectImageOrientation.

No new tests, fixes exif-orientation-image-document.html.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):

LayoutTests:

Unskipping exif-orientation-image-document.html now that respecting
orientation is default enabled for image documents.

* platform/efl-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove support for "desktop-width" in the viewport meta tag
https://bugs.webkit.org/show_bug.cgi?id=101217

Reviewed by Gyuyoung Kim.

Source/WebCore:

This has been removed from the CSS Device Adaptation spec, and
should be safe to remove as it is not documented anywhere (neither
in blog posts).

The viewport meta should only support the legacy features.

* dom/ViewportArguments.cpp:
(WebCore::computeViewportAttributes):
(WebCore::findSizeValue):
(WebCore::findScaleValue):
(WebCore::findUserScalableValue):
* dom/ViewportArguments.h:

Source/WebKit/blackberry:

Sync WebViewportArguments enum with the one in
WebCore::ViewportArguments

* Api/WebViewportArguments.h:

Source/WebKit/chromium:

Remove some code trying to use the set desktop width (say 980) for
sites not using a viewport meta element.

Removing this code should have no effect as it ends up being set
to desktop width in that case anyway, by the ViewportArguments
algorithm.

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix build of modules depending on QtWebKit when using prefix
https://bugs.webkit.org/show_bug.cgi?id=101437

Patch by Oswald Buddenhagen <oswald.buddenhagen@nokia.com> on 2012-11-07
Reviewed by Simon Hausmann.

.:

.qmake.conf loads qt_build_config.prf, which nowadays is responsible for
adding the path to .qmake.super (before it was done by default_pre.prf,
so having setting the path in our default_pre wrapper was sufficient).

* .qmake.conf:

Tools:

Remove setting of MODULE_QMAKE_OUTDIR from here, it's been moved to .qmake.conf.

* qmake/mkspecs/features/default_pre.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add replaceWithLiteral() method to WTF::String
https://bugs.webkit.org/show_bug.cgi?id=101257

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-07
Reviewed by Benjamin Poulain.

Source/WebCore:

Substitute String::replace() calls by String::replaceWithLiteral() where
adequate, for efficiency.

No new tests, no behavior change.

* dom/Node.cpp:
(WebCore::Node::showNode):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setSearch):
* loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL):
* platform/network/soup/ProxyResolverSoup.cpp:
(soupProxyResolverWkSetProperty):
* plugins/PluginView.cpp:
(WebCore::makeURL):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::showBox):
* xml/XSLTProcessor.cpp:
(WebCore::transformTextStringToXHTMLDocumentString):

Source/WebKit/blackberry:

Substitute String::replace() calls by String::replaceWithLiteral() where
adequate, for efficiency.

* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::generateHTML):

Source/WebKit2:

Substitute String::replace() calls by String::replaceWithLiteral() where
adequate, for efficiency.

* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::makeURLString):

Source/WTF:

Add replaceWithLiteral() method to WTF::String that takes
replacement string as a literal to avoid uselessly constructing
a String object.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::replace):
(WTF):
* wtf/text/StringImpl.h:
(WTF::StringImpl::replace):
(StringImpl):
* wtf/text/WTFString.h:
(String):
(WTF::String::replaceWithLiteral):

Tools:

Add API tests for String::replaceWithLiteral() and corresponding
StringImpl methods.

* TestWebKitAPI/CMakeLists.txt: Add WTFString API tests to CMake.
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI):
* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed gardening.

Marking new test media/progress-events-generated-correctly.html as failing on EFL.

* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed trivial build fix adapting to QtMultimedia API changes

The QtMultimedia namespace is now called QMultimedia and
QtMultimedia::MetaData is now QMediaMetaData.

* platform/graphics/qt/MediaPlayerPrivateQt.cpp:
(WebCore::MediaPlayerPrivateQt::supportsType):
(WebCore::MediaPlayerPrivateQt::totalBytes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Cleanup V8DOMWrapper::getCachedWrapper
https://bugs.webkit.org/show_bug.cgi?id=100853

Patch by Dan Carney <dcarney@google.com> on 2012-11-07
Reviewed by Adam Barth.

Slight cleanup. Removed redundant branch.

No new tests. No change in functionality.

* bindings/v8/V8DOMWrapper.h:
(WebCore::V8DOMWrapper::getCachedWrapper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Switch the efl-linux-slave-2 to Wk2 Release
https://bugs.webkit.org/show_bug.cgi?id=101345

Reviewed by Gyuyoung Kim.

Switching efl-linux-slave-2 to Wk2 Release.

* BuildSlaveSupport/build.webkit.org-config/config.json:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2: WebKitTestRunner needs to turn on 'setContinuousSpellCheckingEnabled'
https://bugs.webkit.org/show_bug.cgi?id=93611

Reviewed by Gyuyoung Kim.

When WebKitTestRunner turns on the spelling feature with the resetStateToConsistentValues() method,
it happens that the WebProcess is still not launched (although it is already created).
In this case, isValid() method returns false.

This fix sends a message to the WebProcess messages queue, and the message
will be handled once the WebProcess is ready.

* Target.pri:
Adds missing files to compile spellcheking feature for WebKit2-Qt
to use WebKit C API from WKTextChecker.h.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::updateTextCheckerState):
Uses canSendMessage() method instead of isValid() to check whether the message to
the WebProcess can be sent.

* UIProcess/efl/TextCheckerEfl.cpp:
(WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
Calls TextChecker::setContinuousSpellCheckingEnabled which additionaly invokes the client's method.
WK2-EFL settings for text checker (ewk_settings.cpp) set the default language (if it wasn't set earlier) to
perform the spelling. It allows to pass the tests from editing/spelling directory.

Tools: WebKitTestRunner needs to turn on 'setContinuousSpellCheckingEnabled'
https://bugs.webkit.org/show_bug.cgi?id=93611

Reviewed by Gyuyoung Kim.

WebKitTestRunner enables spelling feature to pass the layout tests from editing/spelling.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
Enables spelling by WebKit2 C API.

LayoutTests: [EFL] WebKitTestRunner needs to turn on 'setContinuousSpellCheckingEnabled'
https://bugs.webkit.org/show_bug.cgi?id=93611

Reviewed by Gyuyoung Kim.

Unskip the spelling tests from efl-wk2/TestExpectations to run them for WebKit2-EFL.
Add new missing baselines for two spelling tests for EFL platform.

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:
* platform/efl/editing/spelling/inline_spelling_markers-expected.txt: Added.
* platform/efl/editing/spelling/spelling-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Now that it no longer produces image results, remove unnecessary
PNGs for crash-hw-sw-switch.html.  Unreviewed.

* platform/chromium-android/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/chromium-linux/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/chromium-mac-snowleopard/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/chromium-mac/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/chromium-win/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/mac-snowleopard/css3/filters/crash-hw-sw-switch-expected.png: Removed.
* platform/qt/css3/filters/crash-hw-sw-switch-expected.png: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed. Add Qt EWS bots to the watchers list.

* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
(QtEWS):
(QtWK2EWS):

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