Update location of w3c shapes tests to reflect new import location
https://bugs.webkit.org/show_bug.cgi?id=118156

Reviewed by Dirk Pranke.

Partial imports should not be imported to the same place as the full
import, so this adds an option to allow importing to a different
location than the default. In doing that, I found that imports from
contributor directories didn't seem to be working correctly, so I
updated the import to be smarter about both contributor directories
and the test status directories. It should now be more likely that the
script guesses the root directory properly.

* Scripts/webkitpy/w3c/test_importer.py: Remove comment about the
    script not working with the full set of contributors, as that is
    no longer true, and I didn't see a good way to keep that behavior.
    Also update documentation to properly explain what happens when a
    contributor dir is imported.
(main): Attempt to find the proper repo dir by looking at the
    directory above the "test status" in the given path, this is still
    not exactly right, but is less error prone than just trimming.
(parse_args): Add -d option to set the import directory.
(TestImporter.__init__): Stop appending the subdirs to the
    destination_directory because it was making things more complex
    and isn't really needed.
(TestImporter.update_test_status): Remove hardcoded strings and use
    the TEST_STATUS constants instead.
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_import_dir_with_no_tests_and_no_hg): Add
    support for new option.
(TestImporterTest.test_import_dir_with_no_tests): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use emptyString instead of String("")
https://bugs.webkit.org/show_bug.cgi?id=119335

Reviewed by Darin Adler.

Use emptyString() instead of String("") because it is better style and
faster. This is a followup to r116908, removing all occurrences of
String("") from WebKit.

Source/JavaScriptCore:

* runtime/RegExpConstructor.cpp:
(JSC::constructRegExp):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):

Source/WebCore:

No behavior change, no new tests needed.

* platform/graphics/blackberry/LayerAnimation.h:
(WebCore::LayerAnimation::name):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::textFromEvent):
(WebCore::unmodifiedTextFromEvent):
(WebCore::keyIdentifierForKeyEvent):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::userAgent):

Source/WebKit/qt:

* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::runJavaScriptPrompt):

Source/WebKit2:

* Shared/mac/WebEventFactory.mm:
(WebKit::textFromEvent):
(WebKit::unmodifiedTextFromEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce JSC API static value setter/getter overhead.
https://bugs.webkit.org/show_bug.cgi?id=119277

Patch by Yi Shen <max.hong.shen@gmail.com> on 2013-07-31
Reviewed by Geoffrey Garen.

Add property name to the static value entry, so that OpaqueJSString::create() doesn't
need to get called every time when set or get the static value.

* API/JSCallbackObjectFunctions.h:
(JSC::::put):
(JSC::::putByIndex):
(JSC::::getStaticValue):
* API/JSClassRef.cpp:
(OpaqueJSClassContextData::OpaqueJSClassContextData):
* API/JSClassRef.h:
(StaticValueEntry::StaticValueEntry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace CRASH() on overflow with Checked<>
https://bugs.webkit.org/show_bug.cgi?id=119327

Reviewed by Oliver Hunt.

Use a checked type that allows us to automate bound checks. We use a
non-recording Checked<> to keep the behavior.

No behavior change, no new tests needed.

* dom/Text.cpp:
(WebCore::Text::wholeText):
* platform/audio/AudioArray.h:
(WebCore::AudioArray::allocate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove didFinishLoad order quirk
https://bugs.webkit.org/show_bug.cgi?id=119354
<rdar://problem/11510686>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
Remove the quirk.

* page/Settings.in:
Remove the setting controlling the quirk.

Source/WebKit/mac:

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Don't set the now-removed preference.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
W3C test import script prefixes some properties that it shouldn't
https://bugs.webkit.org/show_bug.cgi?id=119357

Reviewed by Dirk Pranke.

Some prefixed properties also have unprefixed implemetations, but when
the implementations aren't identical, they aren't declared in
CSSPropertyNames.in on the same line. This fixes the import script so
that it catches all instances of prefixed properties that have an
unprefixed variant, and does not add the prefix in those cases.

* Scripts/webkitpy/w3c/test_converter.py:
(W3CTestConverter.read_webkit_prefixed_css_property_list): Read all of
the properties on every line and record if they are prefixed or not.
Use this information to only return prefixed properties that do not
have any unprefixed variant. The prefixed property list has also
changed to not include the '-webkit-' prefix, making it much easier to
do the comparison, and removing the need to remove the prefix later.
(W3CTestConverter.add_webkit_prefix_to_unprefixed_properties): This no
longer needs to remove the '-webkit-' prefix, but needs to add it in
the case where a property that needs a prefix is found.
* Scripts/webkitpy/w3c/test_converter_unittest.py:
(W3CTestConverterTest.test_read_prefixed_property_list): Remove assert
for '-webkit-' prefix, as it is no longer included in the properties
in the prefixed property list.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make ActiveDOMObject overrides private
https://bugs.webkit.org/show_bug.cgi?id=119352

Reviewed by Sam Weinig.

There is no need to call these through derived classes. And it's quite harmful for
anyone except for ScriptExecutionContext to call suspend/resume in particular -
ScriptExecutionContext won't know, and it will try to manage the state on its own.

* Modules/filesystem/DOMFileSystem.h:
* Modules/filesystem/FileWriter.h:
* Modules/geolocation/Geolocation.h:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.h:
* Modules/mediasource/MediaSource.h:
* Modules/notifications/Notification.h:
* Modules/notifications/NotificationCenter.h:
* Modules/websockets/WebSocket.h:
* fileapi/FileReader.h:
* html/HTMLMediaElement.h:
* html/canvas/WebGLRenderingContext.h:
* page/DOMTimer.h:
* page/EventSource.h:
* page/SuspendableTimer.h:
* workers/AbstractWorker.h:
* xml/XMLHttpRequest.h:


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

Not reviewed.

* TestExpectations:
- Skipping fast/forms/color/input-color-onchange-event.html which will
  crash with a failed assertion on debug builds.
  This should be un-skipped when https://bugs.webkit.org/show_bug.cgi?id=119094
  is fixed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153552 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reuse of XMLHttpRequests causes character corruption in response text
https://bugs.webkit.org/show_bug.cgi?id=119358

Reviewed by Anders Carlsson.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/6496e7bb9a0b46bc79032b86d5993b25f127a4cb

Test: http/tests/xmlhttprequest/reopen-encoding.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::clearResponseBuffers):
(WebCore::XMLHttpRequest::didFinishLoading):

LayoutTests:

* http/tests/xmlhttprequest/reopen-encoding-expected.txt: Added.
* http/tests/xmlhttprequest/reopen-encoding.html: Added.
* http/tests/xmlhttprequest/resources/get-utf-8.cgi: Added.
* http/tests/xmlhttprequest/resources/get-windows-1251.cgi: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening: changing expectation for fast/forms/color/input-color-onchange-event.html
to "Crash Pass" instead of "Skip".

Not reviewed.

* TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153554 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clobbering window.console is not cool
https://bugs.webkit.org/show_bug.cgi?id=119364

Reviewed by Tim Horton.

full-screen-test.js overrides window.console, which is hella
confusing if you're trying to use console.log to debug a fullscreen test.

* fullscreen/full-screen-test.js:
(logConsole):
* fullscreen/resources/not-allowed.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153555 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More cleanup in PropertySlot
https://bugs.webkit.org/show_bug.cgi?id=119359

Reviewed by Geoff Garen.

m_slotBase is overloaded to store the (receiver) thisValue and the object that contains the property,
This is confusing, and means that slotBase cannot be typed correctly (can only be a JSObject).

* dfg/DFGRepatch.cpp:
(JSC::DFG::tryCacheGetByID):
(JSC::DFG::tryBuildGetByIDList):
    - No need to ASSERT slotBase is an object.
* jit/JITStubs.cpp:
(JSC::tryCacheGetByID):
(JSC::DEFINE_STUB_FUNCTION):
    - No need to ASSERT slotBase is an object.
* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertySlotByIndex):
(JSC::JSObject::fillGetterPropertySlot):
    - Pass an object through to setGetterSlot.
* runtime/JSObject.h:
(JSC::PropertySlot::getValue):
    - Moved from PropertySlot (need to know anout JSObject).
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::functionGetter):
    - update per member name changes
* runtime/PropertySlot.h:
(JSC::PropertySlot::PropertySlot):
    - Argument to constructor set to 'thisValue'.
(JSC::PropertySlot::slotBase):
    - This returns a JSObject*.
(JSC::PropertySlot::setValue):
(JSC::PropertySlot::setCustom):
(JSC::PropertySlot::setCacheableCustom):
(JSC::PropertySlot::setCustomIndex):
(JSC::PropertySlot::setGetterSlot):
(JSC::PropertySlot::setCacheableGetterSlot):
    - slotBase is a JSObject*, make setGetterSlot set slotBase for consistency.
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayEntry::get):
    - Pass an object through to setGetterSlot.
* runtime/SparseArrayValueMap.h:
    - Pass an object through to setGetterSlot.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toSVGSMILElement, and use it
https://bugs.webkit.org/show_bug.cgi?id=119260

Reviewed by Darin Adler.

As a step to change static_cast with toSVGXXX, static_cast<SVGSMILElement*> can
be changed with toSVGSMILElement().

Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=155048

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::connectConditions):
(WebCore::SVGSMILElement::disconnectConditions):
* svg/animation/SVGSMILElement.h:
(WebCore::toSVGSMILElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153559 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toSVGFontFaceElement, and use it
https://bugs.webkit.org/show_bug.cgi?id=119330

Reviewed by Andreas Kling.

As a step to change static_cast with toSVGXXX, static_cast<SVGFontFaceElement*> can
be changed with toSVGFontFaceElement().

Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=155082

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* svg/SVGFontFaceElement.h:
(WebCore::toSVGFontFaceElement):
* svg/SVGFontFaceFormatElement.cpp:
(WebCore::SVGFontFaceFormatElement::childrenChanged):
* svg/SVGFontFaceSrcElement.cpp:
(WebCore::SVGFontFaceSrcElement::childrenChanged):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::childrenChanged):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153561 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Page scrolls when width equals device width and initial scale is greater than 0.92
https://bugs.webkit.org/show_bug.cgi?id=119365

Patch by Jacky Jiang <zhajiang@blackberry.com> on 2013-07-31
Reviewed by Rob Buis.
Internally reviewed by Gen Mak and Konrad Piascik.

JIRA 445423
layoutSize (deviceScreenSize/devicePixelRatio) is FloatSize as devicePixelRatio
is float. We have to round that to IntSize as ScrollView needs IntSize
fixedLayoutSize. Based on conversion result, zoomToFitWidthScale will
hardly equal to zoomToFitHeightScale in this case. And unfortunately
zoomToFitHeightScale is a little bit greater than zoomToFitWidthScale
in this case so that we have to pick up zoomToFitHeightScale which makes
the page scollable horizontally.
The way to fix that is to define an accurate contentsSize area which
potentially has float layoutSize rounding error and can cause upexpected
scroll based on the ideal contentsSize area first, and then don't scroll
only if the scale is zoomToFitScale as "contentsSize > visibleViewportSize"
still works well if the scale is larger than zoomToFitScale.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::hasFloatLayoutSizeRoundingError):
* Api/WebPage_p.h:
* WebKitSupport/WebKitThreadViewportAccessor.cpp:
(BlackBerry::WebKit::WebKitThreadViewportAccessor::cannotScrollIfHasFloatLayoutSizeRoundingError):
* WebKitSupport/WebKitThreadViewportAccessor.h:

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

webkit.org/b/119374 fast/workers/termination-early.html [ Pass Crash ]
webkit.org/b/119375 fast/workers/worker-call.html [ Failure ]

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153563 268f45cc-cd09-0410-ab3c-d52691b4dbfc
media/video-controls-captions-trackmenu.html either crashes,
fails or passes.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
compositing/patterns/direct-pattern-compositing tests suffer
from colorspace issues that cause image failures on some machines.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FINALize StyleSheet subclasses.
<http://webkit.org/b/119370>

Reviewed by Anders Carlsson.

CSSStyleSheet and XSLStyleSheet have no further subclasses so make them final.

* css/CSSStyleSheet.h:
* xml/XSLStyleSheet.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r153462 erroneously unskipped http/tests/multipart/invalid-image-data-standalone.html
so put it back.

* platform/mac/TestExpectations:

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