Fix assertion failure in JSObject::tryGetIndexQuickly()
https://bugs.webkit.org/show_bug.cgi?id=101869

Patch by Michael Pruett <michael@68k.org> on 2012-11-11
Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Currently JSObject::tryGetIndexQuickly() triggers an assertion
failure when the object has an undecided indexing type. This
case should be treated the same as a blank indexing type.

* runtime/JSObject.h:
(JSC::JSObject::tryGetIndexQuickly):

LayoutTests:

Add test case for an assertion failure triggered when constructing
a Blob with a sparse array.

* fast/constructors/blob-sparse-array-assertion-failure.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't update style when attaching in HTMLMeterElement
https://bugs.webkit.org/show_bug.cgi?id=101714

Reviewed by Hajime Morita.

Source/WebCore:

HTMLMeterElement was updating style when it's being attached. However, updating style when attaching
can cause style-update prevention. The similar thing has already happened in Bug 100507.

Since we have already set the default value in creating ShadowDOM subtree, we don't need to update style actually.

Test: fast/dom/HTMLMeterElement/meter-bar-set-value.html

* html/HTMLMeterElement.cpp:
* html/HTMLMeterElement.h:
(HTMLMeterElement): Removed attach(). We don't need it.

LayoutTests:

* fast/dom/HTMLMeterElement/meter-bar-set-value-expected.html: Added.
* fast/dom/HTMLMeterElement/meter-bar-set-value.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r134191. Turns out that FrameView::performPostLayoutTasks calls FrameSelection::updateAppearance
in the middle of a layout. So we can't have assertions in recomputeCaretRect and updateAppearance.

Furthermore, we can't update layout in updateAppearance. So do that in its call sites.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::setCaretVisibility):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, disable the test on Mac/Chromium until we figure out the cause of failure.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: wasShown is called twice when show() is called from within wasShown
https://bugs.webkit.org/show_bug.cgi?id=101858

Reviewed by Vsevolod Vlasov.

Source/WebCore:

When we attach views lazily from within wasShown, the views were getting wasShown notification twice.
We now mute one of them.

* inspector/front-end/View.js:
(WebInspector.View):
(WebInspector.View.prototype._inNotification):
(WebInspector.View.prototype._parentIsShowing):
(WebInspector.View.prototype._callOnVisibleChildren):
(WebInspector.View.prototype._processWasShown):
(WebInspector.View.prototype._processWillHide):
(WebInspector.View.prototype._processOnResize):
(WebInspector.View.prototype._notify):
(WebInspector.View.prototype.show):

LayoutTests:

* inspector/view-events-expected.txt:
* inspector/view-events.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] MiniBrowser should not strongly depend on QtTestSupport.
https://bugs.webkit.org/show_bug.cgi?id=101775

Introducing HAVE(QTTESTSUPPORT) to allow building
MiniBrowser without QtTestSupport.
This is necessary when using a production build.

Reviewed by Tor Arne Vestbø.

Source/WebCore:

* Target.pri:
* platform/qt/QtTestSupport.h:

Tools:

* MiniBrowser/qt/MiniBrowserApplication.cpp:
(MiniBrowserApplication::handleUserOptions):
* qmake/mkspecs/features/configure.prf:
* qmake/mkspecs/features/features.prf:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Turn on error on warnings for "switch"
https://bugs.webkit.org/show_bug.cgi?id=101760

Patch by KyungTae Kim <ktf.kim@samsung.com> on 2012-11-12
Reviewed by Gyuyoung Kim.

Turn on error on warning for "switch" by removing "-Wno-error=switch"

* Source/cmake/WebKitHelpers.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
'for (x in y)' requires 'var' declaration in ConsoleMessage.js
https://bugs.webkit.org/show_bug.cgi?id=101908

Reviewed by Pavel Feldman.

r134166 should have included a 'var' declaration in its 'for (x in y)'
loop. This patch adds the missing 'var' in order to prevent leakage into
the global context.

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype.append):
(WebInspector.ConsoleMessageImpl.prototype._formatWithSubstitutionString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] move TestRunner implementation into WebTestRunner namespace
https://bugs.webkit.org/show_bug.cgi?id=101837

Reviewed by Adam Barth.

That way, we don't get collisions when linking e.g. against chromium's
net test support library.

* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityControllerChromium.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppBoundClass.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppBoundClass.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppVariant.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/CppVariant.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/EventSender.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/GamepadController.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/GamepadController.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestDelegate.h:
(WebTestRunner):
(TestDelegate):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestInterfaces.h:
(WebTestRunner):
(TestInterfaces):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TextInputController.cpp:
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TextInputController.h:
(WebTestRunner):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r134154.
http://trac.webkit.org/changeset/134154
https://bugs.webkit.org/show_bug.cgi?id=101919

Causes plenty of crashes on GTK and Apple Win builders
(Requested by zdobersek on #webkit).

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

* css/mediaControls.css:
* css/mediaControlsQuickTime.css:
(audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType):
(WebCore::MediaControlToggleClosedCaptionsButtonElement::shadowPseudoId):
* html/shadow/MediaControlElements.h:
(MediaControlElement):
(MediaControlToggleClosedCaptionsButtonElement):
* html/shadow/MediaControlRootElement.cpp:
(WebCore::MediaControlRootElement::MediaControlRootElement):
(WebCore::MediaControlRootElement::create):
(WebCore::MediaControlRootElement::setMediaController):
(WebCore::MediaControlRootElement::hide):
(WebCore::MediaControlRootElement::makeTransparent):
(WebCore::MediaControlRootElement::reset):
(WebCore::MediaControlRootElement::reportedError):
* html/shadow/MediaControlRootElement.h:
(WebCore):
(MediaControlRootElement):
* html/shadow/MediaControlRootElementChromium.cpp:
(WebCore::MediaControlRootElementChromium::initializeControls):
* html/shadow/MediaControls.h:
(MediaControls):
* platform/Language.cpp:
(WebCore):
* platform/Language.h:
(WebCore):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::paintMediaControlsPart):
* rendering/RenderMediaControlsChromium.cpp:
(WebCore::RenderMediaControlsChromium::paintMediaControlsPart):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions]Add support for text-shadow in region styling
https://bugs.webkit.org/show_bug.cgi?id=94472

Reviewed by David Hyatt.

Source/WebCore:

Original patch by Andrei Onea.
Add support for text-shadow in region styling (@-webkit-region rule).
In addition to the previously supported region styling properties (background-color and color),
text-shadow requires the computation of an element style in region at layout time.

This patch adds a new method on RenderRegion - ensureRegionStyleForObject - that
can be used to retrieve the object style in region (if already cached) or to compute it
on the spot. When computing the object style in region, we need to compute the style in region
also for the object ancestor, up to the content nodes.

This patch also refactors the way styles in region are computed and stored, because
we can compute the style in region not only at paint time, but also at layout time.

Test: fast/regions/region-style-text-shadow.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::isValidRegionStyleProperty):
Allow text-shadow to be used in region styling.
* rendering/InlineBox.cpp:
(WebCore::InlineBox::styleInRegion):
Retrieve the region style for an InlineBox's renderer, given its RenderRegion.
Compute the style in region if not computed yet.
(WebCore::InlineBox::regionDuringLayout):
Retrieve the region in which an InlineBox is being flowed.
* rendering/InlineBox.h:
* rendering/InlineFlowBox.cpp: Take region styling into account.
(WebCore::InlineFlowBox::addToLine):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRegionObjectsRegionStyle):
(WebCore::canCacheObjectStyleInRegion):
Test if we can cache the computed style in region.
(WebCore::RenderRegion::restoreRegionObjectsOriginalStyle):
(WebCore::RenderRegion::computeStyleInRegion):
(WebCore::RenderRegion::setChildrenStyleInRegion):
(WebCore::setObjectHasBoxDecorationsFlag):
(WebCore::RenderRegion::setObjectStyleInRegion):
(WebCore::RenderRegion::clearObjectStyleInRegion):
(WebCore::RenderRegion::ensureRegionStyleForObject):
* rendering/RenderRegion.h:

LayoutTests:

Original patch by Andrei Onea.
Added tests for region styling using the text-shadow property.

* fast/regions/region-style-text-shadow-expected.html: Added.
* fast/regions/region-style-text-shadow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove HTMLInputElement dependency from PickerIndicatorElement
https://bugs.webkit.org/show_bug.cgi?id=101913

Patch by Kunihiko Sakamoto <ksakamoto@chromium.org> on 2012-11-12
Reviewed by Kent Tamura.

Introduced PickerIndicatorOwner interface that replaces the role of hostInput() in
PickerIndicatorElement. It makes easier to add interactions between picker indicator
and its owner without having to add functions to HTMLInputElement.

No new tests. This is just a refactor.

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::isPickerIndicatorOwnerDisabledOrReadOnly): Added.
(WebCore):
(WebCore::BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue): Added.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::setupDateTimeChooserParameters): Added.
(WebCore::BaseMultipleFieldsDateAndTimeInputType::~BaseMultipleFieldsDateAndTimeInputType):
(WebCore::BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree):
(WebCore::BaseMultipleFieldsDateAndTimeInputType::destroyShadowSubtree):
* html/BaseMultipleFieldsDateAndTimeInputType.h:
(WebCore):
(BaseMultipleFieldsDateAndTimeInputType): Implements PickerIndicatorOwner.
* html/shadow/PickerIndicatorElement.cpp: Replaced all the use of hostInput() by using PickerIndicatorOwner.
(WebCore::PickerIndicatorElement::PickerIndicatorElement):
(WebCore::PickerIndicatorElement::create):
(WebCore::PickerIndicatorElement::defaultEventHandler):
(WebCore::PickerIndicatorElement::willRespondToMouseClickEvents):
(WebCore::PickerIndicatorElement::didChooseValue):
(WebCore::PickerIndicatorElement::openPopup):
* html/shadow/PickerIndicatorElement.h:
(PickerIndicatorElement): Added a PickerIndicatorOwner member.
(PickerIndicatorOwner): An interface class for communicating picker indicator and its owner.
(WebCore::PickerIndicatorElement::PickerIndicatorOwner::~PickerIndicatorOwner):
(WebCore::PickerIndicatorElement::removePickerIndicatorOwner):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Schedule the RTCDataChannel events to be triggered at idle state
https://bugs.webkit.org/show_bug.cgi?id=101751

Reviewed by Adam Barth.

Source/Platform:

Making some WebRTCDataChannel methods const.

* chromium/public/WebRTCDataChannel.h:
(WebRTCDataChannel):

Source/WebCore:

This patch queues the events until the JS interpreter is in an idle state.

Existing tests cover this patch.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::RTCDataChannel):
(WebCore::RTCDataChannel::readyStateChanged):
(WebCore::RTCDataChannel::dataArrived):
(WebCore::RTCDataChannel::error):
(WebCore::RTCDataChannel::scheduleDispatchEvent):
(WebCore):
(WebCore::RTCDataChannel::scheduledEventTimerFired):
* Modules/mediastream/RTCDataChannel.h:
(RTCDataChannel):
* platform/chromium/support/WebRTCDataChannel.cpp:
(WebKit::WebRTCDataChannel::setBufferedAmount):
(WebKit::WebRTCDataChannel::readyStateChanged):
(WebKit::WebRTCDataChannel::dataArrived):
(WebKit::WebRTCDataChannel::error):

Tools:

Makes the data channel mocks to be synchronous instead of asynchronous to be able to
properly test RTCDataChannel event handling.

* DumpRenderTree/chromium/MockWebRTCPeerConnectionHandler.cpp:
(MockWebRTCPeerConnectionHandler::sendStringData):
(MockWebRTCPeerConnectionHandler::sendRawData):

LayoutTests:

Adding shouldNotTrow to the send() calls.

* fast/mediastream/RTCPeerConnection-datachannel-expected.txt:
* fast/mediastream/RTCPeerConnection-datachannel.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tighten vector in ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray().
<http://webkit.org/b/101850>

Patch by Andreas Kling <akling@apple.com> on 2012-11-12
Reviewed by Antti Koivisto.

Reserve the exact amount of space needed for m_responseContentDispositionEncodingFallbackArray.
222kB progression on Membuster3.

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add tests for month picker
https://bugs.webkit.org/show_bug.cgi?id=101556

Reviewed by Kent Tamura.

Adding tests for month picker.

* platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/month-picker-appearance-expected.png: Added.
* platform/chromium-mac/platform/chromium/fast/forms/calendar-picker/month-picker-appearance-step-expected.png: Added.
* platform/chromium-win/platform/chromium/fast/forms/calendar-picker/month-picker-key-operations-expected.txt: Added.
* platform/chromium/TestExpectations: Marking appearance tests as needs rebaseline.
* platform/chromium/fast/forms/calendar-picker/month-picker-appearance-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-appearance-step-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-appearance-step.html: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-appearance.html: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-key-operations-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-key-operations.html: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-mouse-operations-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-mouse-operations.html: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-with-step-expected.txt: Added.
* platform/chromium/fast/forms/calendar-picker/month-picker-with-step.html: Added.
* platform/chromium/fast/forms/calendar-picker/resources/calendar-picker-common.js:
(selectedMonth): Returns ISO string for selected month.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add ewk_settings_offline_web_application_cache_enabled set/get APIs
https://bugs.webkit.org/show_bug.cgi?id=101688

Patch by Jiyeon Kim <jiyeon0402.kim@samsung.com> on 2012-11-12
Reviewed by Gyuyoung Kim.

Add ewk_settings_offline_web_application_cache_get API to be used for enabling disabling the web application cache.
Add ewk_settings_offline_web_application_cache_set API to be used for getting the web application cache status.
In addition, offline web application cache is enabled by default.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_offline_web_application_cache_enabled_set):
(ewk_settings_offline_web_application_cache_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Gardening after 134099 and 134100. Skipped two tests because layoutTestController
needs implementation of setBackingScaleFactor().

Patch by János Badics <jbadics@inf.u-szeged.hu> on 2012-11-12
Reviewed by Csaba Osztrogonác.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Timeline: fix test expectations
https://bugs.webkit.org/show_bug.cgi?id=101737

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-12
Reviewed by Yury Semikhatsky.

The expected order of timeline records of specific types
have been changed: https://bugs.webkit.org/show_bug.cgi?id=101544

This change fixes test expectations.
Also removed expectation that test can fail.

* inspector/timeline/timeline-receive-response-event-expected.txt:
* platform/chromium/TestExpectations: Removed "fail" expectation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, skip a new crashing test.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Can not load MHTML documents
https://bugs.webkit.org/show_bug.cgi?id=101765

Reviewed by Simon Hausmann.

Source/WebCore:

Recognize common MHTML extensions so that we can recognize MHTML tests on the file-system.

Tested by existing mhtml/ tests.

* platform/qt/MIMETypeRegistryQt.cpp:
(WebCore):

Tools:

Enable MHTML feature.

* qmake/mkspecs/features/features.pri:


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