WebKit-https.git
4 years agojsc.cpp should call initializeMainThread() to make sure that GC thread assertions...
fpizlo@apple.com [Fri, 9 Sep 2016 21:20:02 +0000 (21:20 +0000)]
jsc.cpp should call initializeMainThread() to make sure that GC thread assertions work
https://bugs.webkit.org/show_bug.cgi?id=161801

Reviewed by Keith Miller.

The GC has debug assertions that certain things don't happen on GC threads. Those assertions
are no-ops unless initializeGCThreads() is called, and I think the most canonical way to do
that is to call initializeMainThread().

* jsc.cpp:
(jscmain):

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

4 years agoExpose Apple Pencil data to Touch events
dino@apple.com [Fri, 9 Sep 2016 20:57:50 +0000 (20:57 +0000)]
Expose Apple Pencil data to Touch events
https://bugs.webkit.org/show_bug.cgi?id=161783
<rdar://problem/28218898>

Reviewed by Beth Dakin.

Source/WebKit2:

* Platform/spi/ios/UIKitSPI.h: Expose the new SPI. Since this is only used
on public builds, guard it against everything that is <= iOS 10.0.
* Shared/WebEvent.h: New properties.
(WebKit::WebPlatformTouchPoint::setAltitudeAngle):
(WebKit::WebPlatformTouchPoint::altitudeAngle):
(WebKit::WebPlatformTouchPoint::setAzimuthAngle):
(WebKit::WebPlatformTouchPoint::azimuthAngle):
(WebKit::WebPlatformTouchPoint::setTouchType):
(WebKit::WebPlatformTouchPoint::touchType):
(WebKit::WebPlatformTouchPoint::force): Deleted.
* Shared/WebEventConversion.cpp:
(WebKit::webPlatformTouchTypeToPlatform):
(WebKit::WebKit2PlatformTouchPoint::WebKit2PlatformTouchPoint): More
parameters sent to parent constructor.
* Shared/ios/NativeWebTouchEventIOS.mm:
(WebKit::convertTouchType):
(WebKit::NativeWebTouchEvent::extractWebTouchPoint):
* Shared/ios/WebPlatformTouchPointIOS.cpp:
(WebKit::WebPlatformTouchPoint::encode):
(WebKit::WebPlatformTouchPoint::decode):

Tools:

The values that IOHID expects are different from their
documentation, and from what UITouch interprets. Tweak
incoming data so it will produce the output we expect.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator stylusDownAtPoint:azimuthAngle:altitudeAngle:pressure:]):
(-[HIDEventGenerator stylusMoveToPoint:azimuthAngle:altitudeAngle:pressure:]):

LayoutTests:

Four new tests that check data coming out of an Apple Pencil.

* fast/events/touch/ios/pencil-data-change-does-not-give-touchmove-expected.txt: Added.
* fast/events/touch/ios/pencil-data-change-does-not-give-touchmove.html: Added.
* fast/events/touch/ios/pencil-data-change-gives-touchforcechange-expected.txt: Added.
* fast/events/touch/ios/pencil-data-change-gives-touchforcechange.html: Added.
* fast/events/touch/ios/pencil-move-provides-stylus-data-expected.txt: Added.
* fast/events/touch/ios/pencil-move-provides-stylus-data.html: Added.
* fast/events/touch/ios/pencil-touch-registered-as-pencil-expected.txt: Added.
* fast/events/touch/ios/pencil-touch-registered-as-pencil.html: Added.

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

4 years agoText replacement candidates don't always overwrite the entire original string
timothy_horton@apple.com [Fri, 9 Sep 2016 20:46:23 +0000 (20:46 +0000)]
Text replacement candidates don't always overwrite the entire original string
https://bugs.webkit.org/show_bug.cgi?id=161779
<rdar://problem/28033492>

Reviewed by Simon Fraser.

Source/WebCore:

New test: editing/mac/spelling/accept-candidate-replacing-multiple-words.html.

* editing/Editor.cpp:
(WebCore::Editor::contextRangeForCandidateRequest):
Factor contextRangeForCandidateRequest out of the WebKits, into Editor.
This just expands to paragraph boundaries from the cursor.

(WebCore::Editor::selectTextCheckingResult):
Add selectTextCheckingResult, which, given a TextCheckingResult,
selects the range represented by the result's location and length, which
indicate the portion of the context string that the result refers to.
In the case of accepting a candidate, we want to select that range
so that our insertion will overwrite it.

(WebCore::Editor::handleAcceptedCandidate):
Make use of selectTextCheckingResult instead of just assuming that we want
to replace the word to the left of the insertion point.

(WebCore::Editor::stringForCandidateRequest): Deleted.
* editing/Editor.h:

* testing/Internals.cpp:
(WebCore::Internals::handleAcceptedCandidate):
* testing/Internals.h:
* testing/Internals.idl:
Internals' handleAcceptedCandidate assumed (wrongly) that the length
of a TextCheckerResult was the length of the candidate, when really it is
the length of the text that the candidate would replace. Adjust this,
and expose the replacement range to JavaScript, so we can test this.

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::requestCandidatesForSelection):
Make use of the shared implementation of contextRangeForCandidateRequest.

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformEditorState):
Make use of the shared implementation of contextRangeForCandidateRequest.

LayoutTests:

* editing/mac/spelling/accept-candidate-without-crossing-editing-boundary.html:
* editing/mac/spelling/accept-misspelled-candidate.html:
Adjust tests to send the correct replacement range.

* editing/mac/spelling/accept-candidate-replacing-multiple-words.html:
Add a test that ensures that we will replace the entire string for a
candidate that replaces multiple words.

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

4 years agoUnreviewed. Added myself to the list of committers.
jfbastien@apple.com [Fri, 9 Sep 2016 20:27:34 +0000 (20:27 +0000)]
Unreviewed. Added myself to the list of committers.

* Scripts/webkitpy/common/config/contributors.json:

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

4 years agoRebaseline js/dom/global-constructors-attributes.html for mac-wk1 after r205755.
ryanhaddad@apple.com [Fri, 9 Sep 2016 19:57:48 +0000 (19:57 +0000)]
Rebaseline js/dom/global-constructors-attributes.html for mac-wk1  after r205755.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoAdd ChakraCore tests to run-javascriptcore-tests
msaboff@apple.com [Fri, 9 Sep 2016 19:15:45 +0000 (19:15 +0000)]
Add ChakraCore tests to run-javascriptcore-tests
https://bugs.webkit.org/show_bug.cgi?id=161808

Reviewed by Saam Barati.

Added ChakraCore tests to the default list of tests to run.

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):

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

4 years agoMarking tiled-drawing/scrolling/fixed/four-bars-zoomed.html as flaky on mac-wk2 debug.
ryanhaddad@apple.com [Fri, 9 Sep 2016 19:02:24 +0000 (19:02 +0000)]
Marking tiled-drawing/scrolling/fixed/four-bars-zoomed.html as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=161547

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoDisable three flakey Chakra Tests
msaboff@apple.com [Fri, 9 Sep 2016 18:49:26 +0000 (18:49 +0000)]
Disable three flakey Chakra Tests
https://bugs.webkit.org/show_bug.cgi?id=161807

Reviewed by Saam Barati.

* ChakraCore.yaml: Disabled the flakey tests
ChakraCore/test/Array/protoLookup_native.js
ChakraCore/test/LetConst/delete.js
ChakraCore/test/fieldopts/fieldhoist_sideeffect.js

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

4 years agoSoft-link GameController.framework.
beidson@apple.com [Fri, 9 Sep 2016 18:44:14 +0000 (18:44 +0000)]
Soft-link GameController.framework.
<rdar://problem/28219953> and https://bugs.webkit.org/show_bug.cgi?id=161802

Reviewed by Brian Burg.

No new tests (No change in behavior).

* Configurations/WebCore.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
(WebCore::GameControllerGamepadProvider::startMonitoringGamepads):

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

4 years agoRename Key to CryptoKey
jiewen_tan@apple.com [Fri, 9 Sep 2016 18:38:47 +0000 (18:38 +0000)]
Rename Key to CryptoKey
https://bugs.webkit.org/show_bug.cgi?id=161665
<rdar://problem/28083391>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

A link to the spec: https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface

* crypto/CryptoKey.idl:
Remove some unnecessary IDL attributes and reorder KeyType enum to match the spec.
* crypto/CryptoKeyType.h:

LayoutTests:

* crypto/subtle/aes-cbc-unwrap-rsa-expected.txt:
* crypto/subtle/aes-cbc-unwrap-rsa.html:
* crypto/subtle/aes-kw-key-manipulation-expected.txt:
* crypto/subtle/aes-kw-key-manipulation.html:
* crypto/subtle/aes-kw-wrap-unwrap-aes-expected.txt:
* crypto/subtle/aes-kw-wrap-unwrap-aes.html:
* crypto/subtle/rsa-oaep-wrap-unwrap-aes-expected.txt:
* crypto/subtle/rsa-oaep-wrap-unwrap-aes.html:
* crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes-expected.txt:
* crypto/subtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html:
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk-expected.txt:
* crypto/subtle/rsassa-pkcs1-v1_5-import-jwk.html:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoWeb Inspector: Command-Z doesn't work when editing CSS selectors in Styles sidebar
commit-queue@webkit.org [Fri, 9 Sep 2016 18:25:14 +0000 (18:25 +0000)]
Web Inspector: Command-Z doesn't work when editing CSS selectors in Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=159734

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-09-09
Reviewed by Brian Burg.

Replace the current usage of -webkit-user-select with a textarea sized exactly the same as
the selector text which holds the current value of the selector.

* UserInterface/Test.html: Add WrappedPromise.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedMatchedStyles):
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedInlineStyles):
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
(WebInspector.DOMNodeStyles.prototype.refresh):
(WebInspector.DOMNodeStyles.prototype.changeRuleSelector.ruleSelectorChanged):
(WebInspector.DOMNodeStyles.prototype.changeRuleSelector):
Ensure that the promise returned by changeRuleSelector is only resolved once the initiated
refresh has completed, ensuring that all matched selectors are parsed and available.

* UserInterface/Views/CSSStyleDeclarationSection.css:
(.style-declaration-section > .header):
(.style-declaration-section.locked > .header::before):
(.style-declaration-section.rule-disabled > .header > .icon):
(.style-declaration-section > .header > textarea):
(.style-declaration-section > .header > textarea:focus):
(.style-declaration-section > .header > textarea:focus + .selector):
(.style-declaration-section > .header > .selector):
(.style-declaration-section > .header > .selector:empty):
(.style-declaration-section > .header > .selector .matched):
(.style-declaration-section:not(.invalid-selector).rule-disabled > .header > .icon): Deleted.
(.style-declaration-section > .header > .selector:empty::before): Deleted.
(.style-declaration-section > .header > .selector:focus): Deleted.
(.style-declaration-section:matches(.locked, .selector-locked) > .header > .selector): Deleted.
(.style-declaration-section > .header > .selector > .matched): Deleted.
(.style-declaration-section.invalid-selector > .header > .icon): Deleted.
(.style-declaration-section.invalid-selector > .header > .selector): Deleted.
Added styling to make textarea invisible when not focused.
Also removed the .invalid-selector styles as the section now refreshed on all changes.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelector):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelectorTextKnownToMatch):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
(WebInspector.CSSStyleDeclarationSection.prototype.focusRuleSelector):
(WebInspector.CSSStyleDeclarationSection.prototype.get selectorEditable):
(WebInspector.CSSStyleDeclarationSection.prototype.get _currentSelectorText):
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste):
(WebInspector.CSSStyleDeclarationSection.prototype.get selectorLocked): Deleted.
Added a hidden textarea for modifying the selector of the represented style.

* UserInterface/Views/RulesStyleDetailsPanel.js:
(WebInspector.RulesStyleDetailsPanel.prototype.cssStyleDeclarationSectionEditorPreviousRule):
Now use new getters on CSSSTyleDeclarationSection for determining if a selector is editable.

* UserInterface/Views/Variables.css:
(:root):
Added --style-declaration-section-header-padding CSS variable.

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

4 years agoMake hasOwnProperty ALWAYS_INLINE
sbarati@apple.com [Fri, 9 Sep 2016 18:04:19 +0000 (18:04 +0000)]
Make hasOwnProperty ALWAYS_INLINE
https://bugs.webkit.org/show_bug.cgi?id=161775

Reviewed by Ryosuke Niwa.

Speedometer spends around 2.5% of its time in hasOwnProperty.
Let's reduce the overhead of calling that function by marking
it as inline. Also, it's likely that the function will call into
JSObject::getOwnPropertySlot. I added a check to see if that's
the function we're calling, if it is, we do a direct call instead
of an indirect call.

* runtime/JSObject.cpp:
(JSC::JSObject::hasOwnProperty): Deleted.
* runtime/JSObjectInlines.h:
(JSC::JSObject::hasOwnProperty):

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

4 years agoURLParser: Handle \ in path according to spec
achristensen@apple.com [Fri, 9 Sep 2016 17:56:10 +0000 (17:56 +0000)]
URLParser: Handle \ in path according to spec
https://bugs.webkit.org/show_bug.cgi?id=161805

Reviewed by Andy Estes.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoPerf test Animation/css-accelerated-animation.html failing
simon.fraser@apple.com [Fri, 9 Sep 2016 17:46:54 +0000 (17:46 +0000)]
Perf test Animation/css-accelerated-animation.html failing
https://bugs.webkit.org/show_bug.cgi?id=161795

Skip Animation/css-accelerated-animation.html since this only works as a MobileSafari
perf test.

* Skipped:

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

4 years agoTextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
commit-queue@webkit.org [Fri, 9 Sep 2016 17:24:58 +0000 (17:24 +0000)]
TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
https://bugs.webkit.org/show_bug.cgi?id=161792

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-09
Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime-expected.txt:
* web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track-expected.txt:

Source/WebCore:

Covered by existing and updated tests.

Updating text track loader to use fetch mode according crossOrigin value.

Removed the check done in the case the crossOrigin value is not set.
Previously cross-origin loads were forbidden, now this is authorized.
This change allows aligning with the spec.
Also, this check could be bypassed in the case of a same-origin URL redirecting to a cross-origin one.

* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::notifyFinished): Checking resource error in lieu of doing CORS checks on its own.
(WebCore::TextTrackLoader::load): Using CachedResourceRequest::setAsPotentiallyCrossOrigin
* loader/TextTrackLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::loadFrom): Setting loading and status values as would be done when load is finished.
(WebCore::CachedResource::setBodyDataFrom): Default implementation is to copy the shared buffer.
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Enabling resource update when mode or origin is different for TextTrack resources.

LayoutTests:

* http/tests/security/text-track-crossorigin-expected.txt:
* http/tests/security/text-track-crossorigin.html: Updating test to be more robust against timeout.
Updated test to succeed doing no-cors loading of cross-origin resources.

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

4 years agoURLParser should parse URLs with non-special schemes
achristensen@apple.com [Fri, 9 Sep 2016 17:06:24 +0000 (17:06 +0000)]
URLParser should parse URLs with non-special schemes
https://bugs.webkit.org/show_bug.cgi?id=161786

Reviewed by Andy Estes.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
There's no reason for a SchemeEndCheckForSlashes state now that we can copy iterators.
It's not in the spec and not needed.
Also, move things around a little so parsing special or non-special schemes
followed by one or two slashes works correctly.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoMarking imported/w3c/web-platform-tests/IndexedDB/keyorder.htm as flaky on mac-wk2...
ryanhaddad@apple.com [Fri, 9 Sep 2016 16:57:50 +0000 (16:57 +0000)]
Marking imported/w3c/web-platform-tests/IndexedDB/keyorder.htm as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=161742

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoMarking inspector/debugger/breakpoint-columns.html as flaky on mac-wk2.
ryanhaddad@apple.com [Fri, 9 Sep 2016 16:51:23 +0000 (16:51 +0000)]
Marking inspector/debugger/breakpoint-columns.html as flaky on mac-wk2.
https://bugs.webkit.org/show_bug.cgi?id=161774

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

4 years agoHashMapImpl needs to m_buffer.clear() in its constructor
fpizlo@apple.com [Fri, 9 Sep 2016 16:50:10 +0000 (16:50 +0000)]
HashMapImpl needs to m_buffer.clear() in its constructor
https://bugs.webkit.org/show_bug.cgi?id=161796

Reviewed by Keith Miller.

This is the second time that I'm fixing a bug because AuxiliaryBarrier does not initialize
itself. That seemed like a good idea because maybe sometimes the user knows better how to
initialize it. But, it's not worth it if it's a constant source of bugs.

So, I'm fixing it for good by making AuxiliaryBarrier::AuxiliaryBarrier() initialize its
m_value.

* runtime/AuxiliaryBarrier.h:
(JSC::AuxiliaryBarrier::AuxiliaryBarrier):
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::DirectArguments):

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

4 years agoMarking fast/text/emoji-num-glyphs.html as a flaky timeout.
ryanhaddad@apple.com [Fri, 9 Sep 2016 16:29:02 +0000 (16:29 +0000)]
Marking fast/text/emoji-num-glyphs.html as a flaky timeout.
https://bugs.webkit.org/show_bug.cgi?id=161799

Unreviewed test gardening.

* TestExpectations:

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

4 years agoRegression(r186020): Null dereference in getStartDate()
cdumez@apple.com [Fri, 9 Sep 2016 16:17:19 +0000 (16:17 +0000)]
Regression(r186020): Null dereference in getStartDate()
https://bugs.webkit.org/show_bug.cgi?id=161733

Reviewed by Eric Carlson.

Source/WebCore:

Update HTMLMediaElement::getStartDate() to return NaN if m_player is null,
instead of crashing.

Test: fast/media/getStartDate-NaN.html

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
Add a FIXME comment as this code is using jsDateOrNull() but should
probably be using jsDate() as per:
- http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value

* bindings/js/JSDOMBinding.cpp:
(WebCore::jsDate):
(WebCore::jsDateOrNull):
* bindings/js/JSDOMBinding.h:
- Rename jsDateOrNaN() to jsDate() as this is the default behavior. Also,
  return new Date(NaN) instead of NaN if the implementation returns NaN.
  The IDL says we should return a Date, not a number.
- Update jsDateOrNull() to only return jsNull() if the native value is
  NaN, instead of doing so for every value that is not finite. Our
  convention is to use NaN as special value to represent null in JS.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue):
When converting a native value (double) into a Date, rely on the fact
that the type is nullable when deciding if we should call jsDate() or
jsDateOrNull() to convert. This way, we no longe need a WebKit specific
[TreatReturnedDateAs=Null|NaN] IDL extended attribute.

* bindings/scripts/IDLAttributes.txt:
* html/HTMLInputElement.idl:
Mark valueAsDate attribute as nullable, as per the specification:
- https://html.spec.whatwg.org/#htmlinputelement

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getStartDate):
Return NaN if m_player is null instead of crashing. The reason I decided
to return NaN is because the specification [1] says to return a new Date
object representing the current timeline offset. The spec of timeline
offset [2] says that the initial timeline offset value is NaN.
[1] https://html.spec.whatwg.org/#dom-media-getstartdate
[2] https://html.spec.whatwg.org/#timeline-offset

* bindings/scripts/IDLAttributes.txt:
* html/HTMLMediaElement.idl:
Drop [TreatReturnedDateAs] attribute as it is no longer supported.

LayoutTests:

Add layout test coverage.

* fast/media/getStartDate-NaN-expected.txt: Added.
* fast/media/getStartDate-NaN.html: Added.

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

4 years agoSync web-platform-tests up to revision 6d9c836
commit-queue@webkit.org [Fri, 9 Sep 2016 15:42:13 +0000 (15:42 +0000)]
Sync web-platform-tests up to revision 6d9c836
https://bugs.webkit.org/show_bug.cgi?id=161738

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-09
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* resources/ImportExpectations:
* resources/TestRepositories:
* resources/resource-files.json:
* resources/web-platform-tests-modules.json:
* web-platform-tests/2dcontext/transformations/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/w3c-import.log.
* web-platform-tests/IndexedDB/idbindex-multientry-big-expected.txt:
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/w3c-import.log: Added.
* web-platform-tests/WebIDL/ecmascript-binding/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/w3c-import.log.
* web-platform-tests/WebIDL/readme.txt: Added.
* web-platform-tests/WebIDL/testable_assertions.txt: Added.
* web-platform-tests/WebIDL/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/template/appending-to-a-template/w3c-import.log.
* web-platform-tests/XMLHttpRequest/responsexml-document-properties-expected.txt:
* web-platform-tests/XMLHttpRequest/send-entity-body-document-expected.txt:
* web-platform-tests/XMLHttpRequest/send-non-same-origin.sub-expected.txt:
* web-platform-tests/XMLHttpRequest/send-non-same-origin.sub.htm:
* web-platform-tests/XMLHttpRequest/w3c-import.log:
* web-platform-tests/common/canvas-tests.js:
(addCrossOriginYellowImage):
* web-platform-tests/common/get-host-info.sub.js:
(get_host_info):
* web-platform-tests/config.json: Added.
* web-platform-tests/dom/historical-expected.txt:
* web-platform-tests/dom/historical.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument.html:
* web-platform-tests/dom/nodes/DOMImplementation-hasFeature-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-hasFeature.html:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/w3c-import.log:
* web-platform-tests/dom/nodes/Document-createElementNS-expected.txt:
* web-platform-tests/dom/nodes/Document-createElementNS.html:
* web-platform-tests/dom/nodes/Document-createElementNS.js:
* web-platform-tests/domparsing/w3c-import.log:
* web-platform-tests/fetch/api/basic/mode-same-origin.html:
* web-platform-tests/fetch/api/basic/mode-same-origin.js:
* web-platform-tests/fetch/api/basic/referrer.html:
* web-platform-tests/fetch/api/basic/referrer.js:
(runTest):
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers.js:
(requestHeaders):
* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-worker.html:
* web-platform-tests/fetch/api/basic/scheme-blob.html:
* web-platform-tests/fetch/api/basic/scheme-blob.js:
(invalidRequestMethods.forEach):
* web-platform-tests/fetch/api/basic/w3c-import.log:
* web-platform-tests/fetch/api/cors/cors-basic.html:
* web-platform-tests/fetch/api/cors/cors-basic.js:
* web-platform-tests/fetch/api/cors/cors-cookies.html:
* web-platform-tests/fetch/api/cors/cors-cookies.js:
* web-platform-tests/fetch/api/cors/cors-no-preflight.html:
* web-platform-tests/fetch/api/cors/cors-no-preflight.js:
* web-platform-tests/fetch/api/cors/cors-origin.html:
* web-platform-tests/fetch/api/cors/cors-origin.js:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.html:
* web-platform-tests/fetch/api/cors/cors-preflight-redirect.js:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.html:
* web-platform-tests/fetch/api/cors/cors-preflight-referrer.js:
* web-platform-tests/fetch/api/cors/cors-preflight-status.html:
* web-platform-tests/fetch/api/cors/cors-preflight-status.js:
* web-platform-tests/fetch/api/cors/cors-preflight.html:
* web-platform-tests/fetch/api/cors/cors-preflight.js:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.html:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials.js:
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.html:
* web-platform-tests/fetch/api/cors/cors-redirect-preflight.js:
* web-platform-tests/fetch/api/cors/cors-redirect.html:
* web-platform-tests/fetch/api/cors/cors-redirect.js:
* web-platform-tests/fetch/api/cors/w3c-import.log:
* web-platform-tests/fetch/api/headers/headers-combine-expected.txt:
* web-platform-tests/fetch/api/headers/headers-combine.html:
* web-platform-tests/fetch/api/redirect/redirect-mode.html:
* web-platform-tests/fetch/api/redirect/redirect-mode.js:
* web-platform-tests/fetch/api/redirect/redirect-origin.html:
* web-platform-tests/fetch/api/redirect/redirect-origin.js:
* web-platform-tests/fetch/api/redirect/w3c-import.log:
* web-platform-tests/fetch/api/request/request-cache-expected.txt:
* web-platform-tests/fetch/api/request/request-cache.html:
* web-platform-tests/fetch/api/request/request-disturbed.html:
* web-platform-tests/fetch/api/resources/get-host-info.sub.js: Removed.
* web-platform-tests/fetch/api/resources/w3c-import.log:
* web-platform-tests/fetch/api/response/response-init-001.html:
* web-platform-tests/html/browsers/browsing-the-web/history-traversal/w3c-import.log:
* web-platform-tests/html/browsers/history/the-history-interface/w3c-import.log:
* web-platform-tests/html/browsers/history/the-location-interface/w3c-import.log:
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt: Added.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window-expected.txt: Added.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-on-new-window.html: Added.
* web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html: Added.
* web-platform-tests/html/browsers/origin/cross-origin-objects/frame.html:
* web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log:
* web-platform-tests/html/browsers/origin/cross-origin-objects/win-documentdomain.sub.html:
* web-platform-tests/html/browsers/the-window-object/security-window/window-security.sub.html:
* web-platform-tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub-expected.txt:
* web-platform-tests/html/browsers/windows/w3c-import.log:
* web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/010-expected.txt:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-N-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-N-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-N-EN-ref-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-N-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-N-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-bdi-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-dir-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-dir-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-dir_auto-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-script-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-script-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-style-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-style-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-contained-textarea-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-N-EN-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-N-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-N-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-N-EN-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-N-L-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-N-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-input-script-R-expected.html:
* web-platform-tests/html/dom/elements/global-attributes/dir_auto-isolate-expected.html:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/semantics/document-metadata/the-link-element/document-without-browsing-context-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/refresh.sub.html: Removed.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/support/w3c-import.log: Added.
* web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/w3c-import.log.
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-shape-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-area-element/area-shape.html:
* web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-audio-element/audio_constructor.html:
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.canvas.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.drawImage.image.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.fillStyle.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.strokeStyle.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.canvas.timing.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.create.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.cross.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.fillStyle.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.pattern.image.strokeStyle.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.reset-expected.txt: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.reset.sub-expected.txt.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.reset.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/security.reset.sub.html.
* web-platform-tests/html/semantics/embedded-content/the-canvas-element/w3c-import.log:
* web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:
* web-platform-tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-001-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-li-element/grouping-li-reftest-002-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-li-element/w3c-import.log:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-rev-reftest-001-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol.html:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/w3c-import.log:
* web-platform-tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-expected.html:
* web-platform-tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref-expected.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-pre-element/grouping-pre-reftest-001-ref.html: Removed.
* web-platform-tests/html/semantics/grouping-content/the-pre-element/w3c-import.log:
* web-platform-tests/html/semantics/links/linktypes/alternate-css-expected.html:
* web-platform-tests/html/semantics/tabular-data/the-table-element/tFoot.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-a-foster-parent-element.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-foster-parenting/template-is-not-a-foster-parent-element.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-foster-parenting/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/generating-of-implied-end-tags.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-body-token.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-frameset-token.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-head-token.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/ignore-html-token.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-body.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/start-tag-html.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/template-end-tag-without-start-one.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-body-insertion-mode/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/end-tag-frameset.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-frameset-insertion-mode/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/generating-of-implied-end-tags.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/template-end-tag-without-start-one.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-head-insertion-mode/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/end-tag-table.html:
* web-platform-tests/html/syntax/parsing/template/additions-to-the-in-table-insertion-mode/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/appending-to-a-template/template-child-nodes.html:
* web-platform-tests/html/syntax/parsing/template/appending-to-a-template/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-body-context.html:
* web-platform-tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-context.html:
* web-platform-tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/clearing-stack-back-to-a-table-row-context.html:
* web-platform-tests/html/syntax/parsing/template/clearing-the-stack-back-to-a-given-context/w3c-import.log:
* web-platform-tests/html/syntax/parsing/template/creating-an-element-for-the-token/template-owner-document.html:
* web-platform-tests/html/syntax/parsing/template/creating-an-element-for-the-token/w3c-import.log:
* web-platform-tests/lint.whitelist:
* web-platform-tests/resource-timing/SyntheticResponse.py:
(main):
* web-platform-tests/resource-timing/resource-timing-expected.txt:
* web-platform-tests/resource-timing/resource-timing.html:
* web-platform-tests/resource-timing/resource-timing.js:
(logResourceEntry): Deleted.
(window.onload): Deleted.
* web-platform-tests/resource-timing/resources/resource_timing_test0.xml:
* web-platform-tests/resource-timing/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log.
* web-platform-tests/resource-timing/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/w3c-import.log.
* web-platform-tests/url/interfaces-expected.txt:

LayoutTests:

* platform/wk2/TestExpectations:
* platform/wk2/imported/w3c/web-platform-tests/html/semantics/document-metadata/styling/LinkStyle-expected.txt:

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

4 years agoGardening: fixing a few JSC test failures.
mark.lam@apple.com [Fri, 9 Sep 2016 12:54:12 +0000 (12:54 +0000)]
Gardening: fixing a few JSC test failures.
https://bugs.webkit.org/show_bug.cgi?id=161760

Not reviewed.

Without this fix, the following tests will crash on a null dereference of isGCThread.
    stress/slow-path-generator-updating-current-node-dfg.js.misc-ftl-no-cjit
    stress/unshift-array-storage.js.misc-ftl-no-cjit

* wtf/MainThread.cpp:
(WTF::mayBeGCThread):

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

4 years agoASSERTION FAILED: promise.inherits(JSPromise::info())
commit-queue@webkit.org [Fri, 9 Sep 2016 09:47:55 +0000 (09:47 +0000)]
ASSERTION FAILED: promise.inherits(JSPromise::info())
https://bugs.webkit.org/show_bug.cgi?id=161632
<rdar://problem/28184743>

Patch by Youenn Fablet <youenn@apple.com> on 2016-09-09
Reviewed by Mark Lam.

Source/JavaScriptCore:

* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::create): Returning null if promise object is not created.

Source/WebCore:

Test: fetch/fetch-worker-crash.html

* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction): Returning early if created promise is null.
Passing directly a DeferredWrapper to the generated code.
* bindings/scripts/CodeGeneratorJS.pm: Updated to take a DeferredWrapper.
(GenerateImplementation):
(GenerateReturnParameters):
* bindings/scripts/test/JS/JSTestObj.cpp: Rebasing expectations.
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
(WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):

LayoutTests:

* TestExpectations: Reenabling skipped tests.
* fetch/fetch-worker-crash-expected.txt: Added.
* fetch/fetch-worker-crash.html: Added.
* fetch/fetch-worker-crash.js: Added.

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

4 years ago[Cocoa] Improve performance of glyph advance metrics gathering
mmaxfield@apple.com [Fri, 9 Sep 2016 08:33:44 +0000 (08:33 +0000)]
[Cocoa] Improve performance of glyph advance metrics gathering
https://bugs.webkit.org/show_bug.cgi?id=161119

Reviewed by Simon Fraser.

Most of the glyphs in a GlyphPage are never read from. Therefore, we can get a performance boost
by not populating as many items in the GlyphPage. Because of the performance characteristics of
CTFontGetGlyphsForCharacters(), a better size for a GlyphPage is 16 items. This, coupled with
using CTFontGetUnsummedAdvancesForGlyphsAndStyle(), causes between a 0.01%-0.5% speedup on PLT.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::initCharWidths):
(WebCore::Font::platformGlyphInit):
(WebCore::createAndFillGlyphPage):
* platform/graphics/Font.h:
(WebCore::Font::widthForGlyph):
* platform/graphics/GlyphMetricsMap.h:
* platform/graphics/GlyphPage.h:
* platform/graphics/cocoa/FontCocoa.mm:
* platform/spi/cocoa/CoreTextSPI.h:
(WebCore::Font::platformWidthForGlyph):
(WebCore::canUseFastGlyphAdvanceGetter): Deleted.

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

4 years agov3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleF...
antti@apple.com [Fri, 9 Sep 2016 07:42:56 +0000 (07:42 +0000)]
v3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleForElement
https://bugs.webkit.org/show_bug.cgi?id=161689

Reviewed by Andreas Kling.

These crashes happen because synchronously triggered resource loads generate callbacks that may end up
deleting the resource loader.

Stop triggering resource loads from StyleResolver. Instead trigger them when applying style to render tree.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::~StyleResolver):

    Replace the RELEASE_ASSERT against deletion during resource loads by a general isDeleted assert.

(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::pseudoStyleForElement):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::loadPendingResources): Deleted.
* css/StyleResolver.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::resolveKeyframeStyles):

    Ensure resource load for all animation frames.

* page/animation/KeyframeAnimation.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
(WebCore::RenderElement::initializeStyle):

    Load resources when renderer initializes a style.

(WebCore::RenderElement::setStyle):
(WebCore::RenderElement::getUncachedPseudoStyle):

    Load resources for pseudo styles.

* rendering/RenderImage.cpp:
(WebCore::RenderImage::RenderImage):
(WebCore::RenderImage::styleWillChange):

    Shuffle image resource initialization out from constructor so initializeStyle gets called before.

* rendering/RenderImage.h:
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):

    Track pending status with a bit instead of implicitly by the existence of CachedResource.
    This is useful for asserts.

(WebCore::StyleCachedImage::load):
(WebCore::StyleCachedImage::isPending):
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
(WebCore::StyleCachedImage::image):
* rendering/style/StyleCachedImage.h:

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

4 years agoUnreviewed. Fix GTK+ build after r205689.
carlosgc@webkit.org [Fri, 9 Sep 2016 06:26:14 +0000 (06:26 +0000)]
Unreviewed. Fix GTK+ build after r205689.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
(webkit_dom_html_o_list_element_set_start):

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

4 years agoScriptRunner should be driven by PendingScript rather than ScriptElement
utatane.tea@gmail.com [Fri, 9 Sep 2016 05:20:17 +0000 (05:20 +0000)]
ScriptRunner should be driven by PendingScript rather than ScriptElement
https://bugs.webkit.org/show_bug.cgi?id=161726

Reviewed by Ryosuke Niwa.

Source/WebCore:

Tests: js/dom/document-write-in-error-event.html
       js/dom/document-write-in-load-event.html

ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
while all the external script will load the LoadableScript. It is confusing.
This patch removes ScriptElement::notifyFinished and use PendingScript's observability
in ScriptRunner instead.

This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
the load and error events, this ignore-destructive-writes counter should not be incremeneted by
this execution. The added tests ensure this behavior.

[1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block

* dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
(WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
(WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
So no need to do it here, that's duplicated.
(WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
(WebCore::ScriptElement::stopLoadRequest): Deleted.
(WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
merged into executeScriptForRunner.
(WebCore::ScriptElement::notifyFinished): Deleted.
* dom/ScriptElement.h:
(WebCore::ScriptElement::~ScriptElement):
(WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
(WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
(WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
(WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
(WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
(WebCore::ScriptRunner::notifyScriptReady): Deleted.
* dom/ScriptRunner.h:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.

LayoutTests:

* js/dom/document-write-in-error-event-expected.txt: Added.
* js/dom/document-write-in-error-event.html: Added.
* js/dom/document-write-in-load-event-expected.txt: Added.
* js/dom/document-write-in-load-event.html: Added.
* js/dom/script-tests/dummy.js: Added.

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

4 years ago[WTF] HashTable's rehash is not compatible to Ref<T> and ASan
utatane.tea@gmail.com [Fri, 9 Sep 2016 05:11:25 +0000 (05:11 +0000)]
[WTF] HashTable's rehash is not compatible to Ref<T> and ASan
https://bugs.webkit.org/show_bug.cgi?id=161763

Reviewed by Mark Lam.

Source/WebCore:

Include wtf/text/StringHash.h to avoid linking errors in EFL port.

* loader/ResourceLoadStatistics.h:

Source/WTF:

If we move an object, the location which the moved object used should not be touched anymore.
HashTable::rehash performs WTFMove for the object that resides in the old table.
However, after moving it, we accidentally touch this location by using `!isEmptyOrDeletedBucket(table[i])`
in HashTable::deallocateTable. And it causes ASan crashing if we use Ref<> for HashTable's key or value.

In this patch, we call the destructor right after moving the object. And HashTable::rehash just calls
fastFree since all the objects in the old table are already moved and destructed.
And we also change HashTable::deallocate to destruct only live objects. Calling destructors for empty objects
is meaningless. And according to the Ref<>'s comment, empty object is not designed to be destructed.

* wtf/HashTable.h:
(WTF::KeyTraits>::deallocateTable):

Tools:

Add tests that inserts many Ref<>s. It incurs HashTable::rehash, and we can ensure
that ASan crash does not occur with this patch.

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/HashSet.cpp:
(TestWebKitAPI::TEST):

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

4 years agoWeb Inspector: make copy-user-interface-resources.pl easier to read
bburg@apple.com [Fri, 9 Sep 2016 05:07:45 +0000 (05:07 +0000)]
Web Inspector: make copy-user-interface-resources.pl easier to read
https://bugs.webkit.org/show_bug.cgi?id=161772

Reviewed by Joseph Pecoraro.

* Scripts/copy-user-interface-resources.pl:
Break long script invocations across multiple lines so that the
options and values are paired together.

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

4 years agoWeb Inspector: get rid of extra copies of jsmin.py and cssmin.py
bburg@apple.com [Fri, 9 Sep 2016 04:33:11 +0000 (04:33 +0000)]
Web Inspector: get rid of extra copies of jsmin.py and cssmin.py
https://bugs.webkit.org/show_bug.cgi?id=161770
<rdar://problem/28216813>

Reviewed by Joseph Pecoraro.

* Scripts/copy-user-interface-resources-dryrun.rb:
- Keep track of the original working directory.
- Stage scripts from PrivateHeaders into the temporary directory.
- Add a comment to clarify what this script is simulating.
- Use system instead of exec so we can print an error message.

* Scripts/copy-user-interface-resources.pl:
- Use jsmin.py and cssmin.py from JavaScriptCore instead of
WebInspectorUI. There are no differences between the two copies.

* Scripts/cssmin.py: Removed.
* Scripts/jsmin.py: Removed.

* WebInspectorUI.xcodeproj/project.pbxproj:
- Remove unused copies of jsmin.py and cssmin.py.

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

4 years agoHTMLObjectElement.hspace / vspace attributes should be unsigned
cdumez@apple.com [Fri, 9 Sep 2016 03:49:13 +0000 (03:49 +0000)]
HTMLObjectElement.hspace / vspace attributes should be unsigned
https://bugs.webkit.org/show_bug.cgi?id=161766

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

HTMLObjectElement.hspace / vspace attributes should be unsigned:
- https://html.spec.whatwg.org/#HTMLObjectElement-partial

Firefox agrees with the specification but those were signed in WebKit.

No new tests, rebaselined existing test.

* html/HTMLObjectElement.idl:

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

4 years agoHTMLObjectElement.codebase attribute should reflect as a URL
cdumez@apple.com [Fri, 9 Sep 2016 03:31:58 +0000 (03:31 +0000)]
HTMLObjectElement.codebase attribute should reflect as a URL
https://bugs.webkit.org/show_bug.cgi?id=161768

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline existing test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

HTMLObjectElement.codebase attribute should reflect as a URL:
- https://html.spec.whatwg.org/#dom-applet-codebase

Chrome and Firefox agree with the specification.

No new test, rebaselined existing test.

* html/HTMLObjectElement.idl:

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

4 years agool.start may return incorrect value for reversed lists when not explicitly set
cdumez@apple.com [Fri, 9 Sep 2016 03:31:21 +0000 (03:31 +0000)]
ol.start may return incorrect value for reversed lists when not explicitly set
https://bugs.webkit.org/show_bug.cgi?id=161713

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/html/semantics/grouping-content/the-ol-element/grouping-ol-expected.txt:
* web-platform-tests/html/semantics/grouping-content/the-ol-element/ol.start-reflection-2-expected.txt:

Source/WebCore:

ol.start may return incorrect value for reversed lists when not explicitly set.
This is because we're supposed to return the number of rendered <li> child
elements, which relies on layout. However, we did not make sure the layout is
up-to-date before counting the number of li child elements. This patch fixes
the issue.

No new tests, rebaselined existing tests.

* html/HTMLOListElement.h:

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

4 years agoRe-landing the fix for
mitz@apple.com [Fri, 9 Sep 2016 02:50:02 +0000 (02:50 +0000)]
Re-landing the fix for

[Mac] .tbd files for the shims end up installed when building with GENERATE_TEXT_BASED_STUBS=YES
https://bugs.webkit.org/show_bug.cgi?id=161722

without reintroducing https://webkit.org/b/161782

* Configurations/Shim.xcconfig: Don’t install the shims. The Copy Shims build phase in the
  WebKit target will copy them into place without bringing their .tbd files along. Keep the
  install path set, though, because it determines the dylibs’ install names.

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

4 years agoUnreviewed, rolling out r205576.
commit-queue@webkit.org [Fri, 9 Sep 2016 02:25:10 +0000 (02:25 +0000)]
Unreviewed, rolling out r205576.
https://bugs.webkit.org/show_bug.cgi?id=161782

Introduced a crash at launch and broke all our Mac perf
testing (Requested by rniwa on #webkit).

Reverted changeset:

"[Mac] .tbd files for the shims end up installed when building
with GENERATE_TEXT_BASED_STUBS=YES"
https://bugs.webkit.org/show_bug.cgi?id=161722
http://trac.webkit.org/changeset/205576

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

4 years agoAdd support for HTMLIframeElement.allowFullscreen attribute
cdumez@apple.com [Fri, 9 Sep 2016 01:53:51 +0000 (01:53 +0000)]
Add support for HTMLIframeElement.allowFullscreen attribute
https://bugs.webkit.org/show_bug.cgi?id=161757

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

Add support for HTMLIframeElement.allowFullscreen attribute:
- https://html.spec.whatwg.org/#dom-iframe-allowfullscreen

Firefox and Chrome already support it, unprefixed.

Note that the HTMLIframeElement.allowFullscreen attribute reflects the
allowfullscreen content attribute which we already support.

Test: fullscreen/full-screen-iframe-allowFullscreen.html

* html/HTMLIFrameElement.idl:

LayoutTests:

Add layout test coverage.

* fullscreen/full-screen-iframe-allowFullscreen-expected.txt: Added.
* fullscreen/full-screen-iframe-allowFullscreen.html: Added.

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

4 years agoframe.longDesc / iframe.longDesc should reflect as a URL
cdumez@apple.com [Fri, 9 Sep 2016 01:43:25 +0000 (01:43 +0000)]
frame.longDesc / iframe.longDesc should reflect as a URL
https://bugs.webkit.org/show_bug.cgi?id=161764

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-obsolete-expected.txt:

Source/WebCore:

frame.longDesc / iframe.longDesc should reflect as a URL:
- https://html.spec.whatwg.org/#dom-iframe-longdesc
- https://html.spec.whatwg.org/#dom-frame-longdesc

They already do in Chrome and Firefox.

No new tests, rebaselined existing tests.

* html/HTMLFrameElement.idl:
* html/HTMLIFrameElement.idl:

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

4 years agoURLParser: Handle \ in paths of special URLs according to spec
achristensen@apple.com [Fri, 9 Sep 2016 01:32:18 +0000 (01:32 +0000)]
URLParser: Handle \ in paths of special URLs according to spec
https://bugs.webkit.org/show_bug.cgi?id=161781

Reviewed by Tim Horton.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::bufferView):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::parse):
* platform/URLParser.h:

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoHeap::isMarked() shouldn't pay the price of concurrent lazy flipping
fpizlo@apple.com [Fri, 9 Sep 2016 01:22:05 +0000 (01:22 +0000)]
Heap::isMarked() shouldn't pay the price of concurrent lazy flipping
https://bugs.webkit.org/show_bug.cgi?id=161760

Reviewed by Mark Lam.
Source/JavaScriptCore:

To fix a race condition in marking, I made Heap::isMarked() and Heap::isLive() atomic by
using flipIfNecessaryConcurrently() instead of flipIfNecessary().

This introduces three unnecessary overheads:

- isLive() is not called by marking, so that change was not necessary.

- isMarked() gets calls many times outside of marking, so it shouldn't always do the
  concurrent thing. This adds isMarkedConcurrently() for use in marking, and reverts
  isMarked().

- isMarked() and isMarkedConcurrently() don't actually have to do the lazy flip. They can
  return false if the flip is necessary.

I added a bunch of debug assertions to make sure that isLive() and isMarked() are not called
during marking.

If we needed to, we could remove most of the calls to isMarkedConcurrently(). As a kind of
optimization, CodeBlock does an initial fixpoint iteration during marking, and so all of the
code called from CodeBlock's fixpoint iterator needs to use isMarkedConcurrently(). But we
could probably arrange for CodeBlock only do fixpoint iterating during the weak reference
thing.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::shouldJettisonDueToOldAge):
(JSC::shouldMarkTransition):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::propagateTransitions):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::isLive):
(JSC::Heap::isMarked):
(JSC::Heap::isMarkedConcurrently):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::flipIfNecessarySlow):
(JSC::MarkedBlock::flipIfNecessaryConcurrentlySlow):
(JSC::MarkedBlock::needsFlip):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::needsFlip):
(JSC::MarkedBlock::flipIfNecessary):
(JSC::MarkedBlock::flipIfNecessaryConcurrently):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendToMarkStack):
(JSC::SlotVisitor::markAuxiliary):
(JSC::SlotVisitor::visitChildren):
* runtime/Structure.cpp:
(JSC::Structure::isCheapDuringGC):
(JSC::Structure::markIfCheap):

Source/WTF:

* wtf/MainThread.cpp:
(WTF::isMainThreadOrGCThread):
(WTF::mayBeGCThread):
* wtf/MainThread.h:

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

4 years agoMove the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo...
commit-queue@webkit.org [Fri, 9 Sep 2016 01:06:47 +0000 (01:06 +0000)]
Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
https://bugs.webkit.org/show_bug.cgi?id=158684

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-08
Reviewed by Simon Fraser.

Source/WebCore:

This is a refactoring patch. It moves the BitmapImage platform dependent
code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
responsible of drawing a NativeImagePtr and answering some metadata queries.

No new tests -- Code refactoring, no behavior change.

* PlatformAppleWin.cmake:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformWinCairo.cmake:
* WebCore.xcodeproj/project.pbxproj:
* loader/cache/MemoryCache.h:
* loader/icon/IconDatabaseBase.h:
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
(createContentCrossfadeAnimation):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::BitmapImage):
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::destroyDecodedDataIfNecessary):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::ensureFrameAtIndexIsCached):
(WebCore::BitmapImage::frameImageAtIndex):
(WebCore::BitmapImage::nativeImage):
(WebCore::BitmapImage::nativeImageForCurrentFrame):
(WebCore::BitmapImage::nativeImageOfSize):
(WebCore::BitmapImage::framesNativeImages):
(WebCore::BitmapImage::frameIsCompleteAtIndex):
(WebCore::BitmapImage::frameDurationAtIndex):
(WebCore::BitmapImage::frameHasAlphaAtIndex):
(WebCore::BitmapImage::frameOrientationAtIndex):
(WebCore::BitmapImage::singlePixelSolidColor):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::drawPattern):
(WebCore::BitmapImage::canAnimate):
(WebCore::BitmapImage::clearTimer):
(WebCore::BitmapImage::startTimer):
(WebCore::BitmapImage::stopAnimation):
(WebCore::BitmapImage::resetAnimation):
(WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
(WebCore::BitmapImage::filenameExtension): Deleted.
(WebCore::BitmapImage::ensureFrameIsCached): Deleted.
* platform/graphics/BitmapImage.h:
(WebCore::FrameData::FrameData):
m_hasAlpha can be initialized with false because it is accessed only in
BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
and in BitmapImage::cacheFrame().

(WebCore::FrameData::~FrameData):
(WebCore::FrameData::clear):
* platform/graphics/Icon.h:
* platform/graphics/Image.h:
(WebCore::Image::nativeImage):
(WebCore::Image::nativeImageOfSize):
(WebCore::Image::framesNativeImages):
(WebCore::Image::orientationForCurrentFrame): Deleted.
(WebCore::Image::getCGImageRef): Deleted.
(WebCore::Image::getFirstCGImageRefOfSize): Deleted.
(WebCore::Image::getCGImageArray): Deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::calculateMaximumSubsamplingLevel):
(WebCore::ImageSource::size):
(WebCore::ImageSource::sizeRespectingOrientation):
* platform/graphics/ImageSource.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/NativeImage.h: Added.
* platform/graphics/NativeImagePtr.h: Removed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
* platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
* platform/graphics/cairo/NativeImageCairo.cpp: Added.
(WebCore::nativeImageSize):
(WebCore::nativeImageHasAlpha):
(WebCore::nativeImageSinglePixelSolidColor):
(WebCore::subsamplingScale):
(WebCore::drawNativeImage):
(WebCore::clearNativeImageSubImages):
* platform/graphics/cg/BitmapImageCG.cpp: Removed.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::size):
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cg/NativeImageCG.cpp: Added.
(WebCore::nativeImageSize):
(WebCore::nativeImageHasAlpha):
(WebCore::nativeImageSinglePixelSolidColor):
(WebCore::subsamplingScale):
(WebCore::drawNativeImage):
(WebCore::clearNativeImageSubImages):
* platform/graphics/cg/PatternCG.cpp:
(WebCore::Pattern::createPlatformPattern):
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(TextTrackRepresentationCocoa::update):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::getTIFFRepresentation):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
* platform/win/DragImageCGWin.cpp:
(WebCore::createDragImageFromImage):

Source/WebKit/mac:

* DOM/DOM.mm:
(-[DOMNode getPreviewSnapshotImage:andRects:]):
* Misc/WebCache.mm:
(+[WebCache imageForURL:]):
Replace BitmapImage::getCGImageRef() with BitmapImage::nativeImage().

Source/WebKit2:

* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryGetCGImageForURL):
(WKIconDatabaseTryCopyCGImageArrayForURL):
It was the only place in the code which uses BitmapImage::getCGImageArray().
Call BitmapImage::framesNativeImages() instead and form the returned
Vector<NativeImagePtr> build the CFArrayRef.

* UIProcess/WebIconDatabase.h:
Include "NativeImage.h" instead of "NativeImagePtr.h".

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _presentationSnapshotForPreviewItemController:]):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::isAlmostSolidColor):
Call BitmapImage::getCGImageRef() instead of calling BitmapImage::nativeImage().

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

4 years agoUpdate the content-animation.plan file to run css-accelerated-animation.html
simon.fraser@apple.com [Fri, 9 Sep 2016 00:55:43 +0000 (00:55 +0000)]
Update the content-animation.plan file to run css-accelerated-animation.html
and pull SVN revision r205680.

* Scripts/webkitpy/benchmark_runner/data/plans/content-animation.plan:

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

4 years agoAdd a content-animation test with accelerated CSS animations
simon.fraser@apple.com [Fri, 9 Sep 2016 00:51:06 +0000 (00:51 +0000)]
Add a content-animation test with accelerated CSS animations
https://bugs.webkit.org/show_bug.cgi?id=161776

Reviewed by Dean Jackson.

PerformanceTests:

Add a test that measures the frame rate of accelerated CSS animations.

This is like css-animation.html (which animates 'left' and 'top') but animates
transforms instead. In order to get animation in X and Y we make two nested elements
and set transformX() on one, and transformY() on the other.

* Animation/css-accelerated-animation.html: Added.

Tools:

* Scripts/webkitpy/benchmark_runner/data/patches/ContentAnimation.patch:

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

4 years agoURLParser: Parsing empty URLs with a base URL should return the base URL
achristensen@apple.com [Fri, 9 Sep 2016 00:46:17 +0000 (00:46 +0000)]
URLParser: Parsing empty URLs with a base URL should return the base URL
https://bugs.webkit.org/show_bug.cgi?id=161777

Reviewed by Tim Horton.

Source/WebCore:

Covered by an API test and progress towards passing all web platform tests when using URLParser.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoURLParser failures should preserve the original input string
achristensen@apple.com [Fri, 9 Sep 2016 00:43:50 +0000 (00:43 +0000)]
URLParser failures should preserve the original input string
https://bugs.webkit.org/show_bug.cgi?id=161769

Reviewed by Tim Horton.

Source/WebCore:

No new tests, but covered by updates to API tests.
This also represents many newly passing web platform tests when using URLParser.

* platform/URLParser.cpp:
(WebCore::URLParser::failure):
(WebCore::URLParser::parse):
* platform/URLParser.h:

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
(TestWebKitAPI::shouldFail):

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

4 years agoURLParser should parse URLs with a user but no password
achristensen@apple.com [Fri, 9 Sep 2016 00:05:36 +0000 (00:05 +0000)]
URLParser should parse URLs with a user but no password
https://bugs.webkit.org/show_bug.cgi?id=161773

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parseAuthority):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoWeb Inspector: TimelineDataGridNode should refresh when graph column is resized
mattbaker@apple.com [Thu, 8 Sep 2016 23:21:27 +0000 (23:21 +0000)]
Web Inspector: TimelineDataGridNode should refresh when graph column is resized
https://bugs.webkit.org/show_bug.cgi?id=161765
<rdar://problem/28215674>

Reviewed by Brian Burg.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.resizerDragging):
Call `DataGridNode.didResizeColumn` for all visible nodes in the columns
to the left and right of the column resizer.

* UserInterface/Views/DataGridNode.js:
(WebInspector.DataGridNode.prototype.didResizeColumn):
Add protected base class method for subclasses to override.

* UserInterface/Views/TimelineDataGridNode.js:
(WebInspector.TimelineDataGridNode.prototype.didResizeColumn):
Refresh the node's graph when the "graph" column is resized.
Renamed `left/rightCellIndex` -> `left/rightColumnIndex`.

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

4 years agoWe should inline operationConvertJSValueToBoolean into JIT code
sbarati@apple.com [Thu, 8 Sep 2016 23:19:38 +0000 (23:19 +0000)]
We should inline operationConvertJSValueToBoolean into JIT code
https://bugs.webkit.org/show_bug.cgi?id=161729

Reviewed by Filip Pizlo.

JSTests:

* stress/value-to-boolean.js: Added.
(assert):
(test1):
(test2):
(test3):

Source/JavaScriptCore:

This patch introduces an AssemblyHelpers emitter function
that replaces operationConvertJSValueToBoolean. This operation
was showing up when I was doing performance analysis for the
speedometer benchmark. I saw that it was spending about 1% of
its time in this function. Hopefully this patch can help us speedup
up speedometer by a little bit.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitConvertValueToBoolean):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateDestructibleObject): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emitSlow_op_jfalse): Deleted.
(JSC::JIT::emitSlow_op_jtrue): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_jfalse):
(JSC::JIT::emit_op_jtrue):
(JSC::JIT::emitSlow_op_jfalse): Deleted.
(JSC::JIT::emitSlow_op_jtrue): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:

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

4 years agoWeb Inspector: Add a button to navigation bar to toggle Control Flow Profiler
nvasilyev@apple.com [Thu, 8 Sep 2016 23:13:57 +0000 (23:13 +0000)]
Web Inspector: Add a button to navigation bar to toggle Control Flow Profiler
https://bugs.webkit.org/show_bug.cgi?id=160973
<rdar://problem/27912606>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
Add "Fade unexecuted code" and "Do not fade unexecuted code".

* UserInterface/Base/Main.js:
(WebInspector.loaded):
Add a setting to remember whether Code Coverage Profiler is on or off between Web Inspector reloads.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.shown):
(WebInspector.SourceCodeTextEditor.prototype.canShowTypeAnnotations):
(WebInspector.SourceCodeTextEditor.prototype.canShowCoverageHints):
(WebInspector.SourceCodeTextEditor.prototype.contentDidChange):
(WebInspector.SourceCodeTextEditor.prototype.toggleTypeAnnotations):
(WebInspector.SourceCodeTextEditor.prototype.toggleUnexecutedCodeHighlights):
(WebInspector.SourceCodeTextEditor.prototype.prettyPrint):
(WebInspector.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
(WebInspector.SourceCodeTextEditor.prototype._setTypeTokenAnnotatorEnabledState):
(WebInspector.SourceCodeTextEditor.prototype.set _basicBlockAnnotatorEnabled):
(WebInspector.SourceCodeTextEditor.prototype._enableScrollEventsForTypeTokenAnnotator):
(WebInspector.SourceCodeTextEditor.prototype._enableScrollEventsForControlFlowAnnotator):
(WebInspector.SourceCodeTextEditor.prototype._disableScrollEventsForControlFlowAnnotator):
(WebInspector.SourceCodeTextEditor.prototype._createTypeTokenScrollEventHandler):
(WebInspector.SourceCodeTextEditor.prototype._createControlFlowScrollEventHandler):
(WebInspector.SourceCodeTextEditor.prototype.canBeFormatted): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.dialogWasDismissed): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.showPopoverForTypes): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._addBreakpointWithEditorLineInfo): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._removeBreakpointWithEditorLineInfo): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._tokenTrackingControllerHighlightedMarkedExpression): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._dismissEditingController): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.editingControllerDidStartEditing): Deleted.
(WebInspector.SourceCodeTextEditor.prototype.editingControllerDidFinishEditing): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._getAssociatedScript): Deleted.
(WebInspector.SourceCodeTextEditor.prototype._createTypeTokenAnnotator): Deleted.
Make Code Coverage profiler independent from Type Profiler.

* UserInterface/Views/TextContentView.js:
(WebInspector.TextContentView):
(WebInspector.TextContentView.prototype.get navigationItems):
(WebInspector.TextContentView.prototype.get textEditor): Deleted.
* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.get hasModified):
(WebInspector.TextEditor.prototype.canShowCoverageHints):
* UserInterface/Views/TextResourceContentView.js:
(WebInspector.TextResourceContentView):
(WebInspector.TextResourceContentView.prototype.get navigationItems):
(WebInspector.TextResourceContentView.prototype._contentDidPopulate):
(WebInspector.TextResourceContentView.prototype._toggleTypeAnnotations):
(WebInspector.TextResourceContentView.prototype._toggleUnexecutedCodeHighlights):
(WebInspector.TextResourceContentView.prototype._enableControlFlowProfilerSettingChanged):
(WebInspector.TextResourceContentView.prototype._contentWillPopulate): Deleted.
* UserInterface/Views/ScriptContentView.js:
(WebInspector.ScriptContentView):
(WebInspector.ScriptContentView.prototype.get navigationItems):
(WebInspector.ScriptContentView.prototype._contentDidPopulate):
(WebInspector.ScriptContentView.prototype._toggleTypeAnnotations):
(WebInspector.ScriptContentView.prototype._toggleUnexecutedCodeHighlights):
(WebInspector.ScriptContentView.prototype._enableControlFlowProfilerSettingChanged):
(WebInspector.ScriptContentView.prototype._contentWillPopulate): Deleted.
Add the [C] icon right next to the [T] (Type Profiler) icon.

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

4 years agoRemove pass expectation for fast/text/emoji-num-glyphs.html after r205657.
ryanhaddad@apple.com [Thu, 8 Sep 2016 23:07:44 +0000 (23:07 +0000)]
Remove pass expectation for fast/text/emoji-num-glyphs.html after r205657.

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years ago[CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
clopez@igalia.com [Thu, 8 Sep 2016 22:54:51 +0000 (22:54 +0000)]
[CMake] Build failure with GCC 6 (fatal error: stdlib.h: No such file or directory)
https://bugs.webkit.org/show_bug.cgi?id=161697

Reviewed by Michael Catanzaro.

Get the list of system includes from GCC and add it to the CMake
list of implicit includes. This way, CMake will filter any of this
directories from the list of includes when calling the compiler.

This avoids an issue with GCC 6 that causes build failures when
including the default include path as a system include (-isystem).

* Source/cmake/OptionsCommon.cmake:

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

4 years agoFix URLs after r205669.
achristensen@apple.com [Thu, 8 Sep 2016 22:33:36 +0000 (22:33 +0000)]
Fix URLs after r205669.
https://bugs.webkit.org/show_bug.cgi?id=161731

* platform/URLParser.cpp:
(WebCore::URLParser::enabled):
I accidentally committed enabling the URLParser by default.  Not ready yet.

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

4 years agoAlign proto getter / setter behavior with other browsers
cdumez@apple.com [Thu, 8 Sep 2016 22:30:26 +0000 (22:30 +0000)]
Align proto getter / setter behavior with other browsers
https://bugs.webkit.org/show_bug.cgi?id=161455

Reviewed by Saam Barati.

Source/JavaScriptCore:

Drop allowsAccessFrom from the methodTable and delegate cross-origin
checking to the DOM bindings for [[SetPrototypeOf]] / [[GetPrototypeOf]].
This is more consistent with other operations (e.g. [[GetOwnProperty]]).

* jsc.cpp:
* runtime/JSGlobalObject.cpp:
* runtime/JSGlobalObject.h:
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoGetter):
(JSC::globalFuncProtoSetter):
(JSC::globalFuncBuiltinLog): Deleted.
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeWithCycleCheck):
Remove check added in r197648. This check was added to match
the latest EcmaScript spec:
- https://tc39.github.io/ecma262/#sec-ordinarysetprototypeof (step 8)
This check allowed for [[Prototype]] chain cycles if the prototype
chain includes objects that do not use the ordinary object definitions
for [[GetPrototypeOf]] and [[SetPrototypeOf]].
The issue is that the rest of our code base does not properly handle
such cycles and we can end up in infinite loops. This became obvious
because this patch updates Window / Location so that they no longer
use the default [[GetPrototypeOf]] / [[SetPrototypeOf]]. If I do not
remove this check, I get an infinite loop in
Structure::anyObjectInChainMayInterceptIndexedAccesses(), which is
called from JSObject::setPrototypeDirect(), when running the following
layout test:
- html/browsers/history/the-location-interface/allow_prototype_cycle_through_location.sub.html
I filed https://bugs.webkit.org/show_bug.cgi?id=161534 to track this
issue.

* runtime/JSObject.h:
(JSC::JSObject::getArrayLength): Deleted.
* runtime/JSProxy.cpp:
(JSC::JSProxy::setPrototype):
(JSC::JSProxy::getPrototype):
* runtime/JSProxy.h:
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorSetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor): Deleted.
(JSC::objectConstructorGetOwnPropertyDescriptors): Deleted.
* runtime/ObjectConstructor.h:
* runtime/ReflectObject.cpp:
(JSC::reflectObjectGetPrototypeOf):
(JSC::reflectObjectSetPrototypeOf):

Source/WebCore:

Align cross-origin __proto__ getter / setter behavior with other
browsers and the specification:

[[SetPrototypeOf]] should throw a TypeError:
- https://html.spec.whatwg.org/#windowproxy-setprototypeof
- https://html.spec.whatwg.org/#location-setprototypeof
- https://tc39.github.io/ecma262/#sec-object.setprototypeof (step 5)

[[GetPrototypeOf]] should return null cross-origin:
- https://html.spec.whatwg.org/#windowproxy-getprototypeof
- https://html.spec.whatwg.org/#location-getprototypeof

Test: js/dom/setPrototypeOf-location-window.html

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase): Deleted.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setPrototype):
(WebCore::JSDOMWindow::getPrototype):
(WebCore::JSDOMWindow::preventExtensions):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::setPrototype):
(WebCore::JSLocation::getPrototype):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::supportsRichSourceInfo): Deleted.
* bindings/js/JSWorkerGlobalScopeBase.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bindings/scripts/IDLAttributes.txt:
* page/DOMWindow.idl:
* page/Location.idl:

LayoutTests:

Add layout test coverage and update a few existing test to reflect
behavior change.

* fast/dom/Window/script-tests/window-custom-prototype.js: Removed.
* fast/dom/Window/window-custom-prototype-crash-expected.txt:
* fast/dom/Window/window-custom-prototype-expected.txt: Removed.
* fast/dom/Window/window-custom-prototype.html: Removed.
* http/tests/security/cross-frame-access-object-getPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-getPrototypeOf.html:
* http/tests/security/cross-frame-access-object-setPrototypeOf-expected.txt:
* http/tests/security/cross-frame-access-object-setPrototypeOf.html:
* http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-htmlelelment-with-iframe-proto.html:
* http/tests/security/xss-DENIED-method-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-method-with-iframe-proto.html:
* http/tests/security/xss-DENIED-non-shadowable-propterty-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-non-shadowable-propterty-with-iframe-proto.html:
* http/tests/security/xss-DENIED-regular-propterty-with-iframe-proto-expected.txt:
* http/tests/security/xss-DENIED-regular-propterty-with-iframe-proto.html:
* js/dom/setPrototypeOf-location-window-expected.txt: Added.
* js/dom/setPrototypeOf-location-window.html: Added.

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

4 years agoURLParser should parse ports after IPv4 and IPv6 hosts
achristensen@apple.com [Thu, 8 Sep 2016 22:28:48 +0000 (22:28 +0000)]
URLParser should parse ports after IPv4 and IPv6 hosts
https://bugs.webkit.org/show_bug.cgi?id=161731

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parsePort):
(WebCore::URLParser::parseHost):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoURLParser should correctly handle \ in path
achristensen@apple.com [Thu, 8 Sep 2016 22:16:49 +0000 (22:16 +0000)]
URLParser should correctly handle \ in path
https://bugs.webkit.org/show_bug.cgi?id=161762

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::isSpecialScheme):
(WebCore::bufferView):
(WebCore::URLParser::parse):
Treat \ as / in the path of special URLs as described in the spec and tested in web platform tests.
Also a slight performance improvement using StringViews instead of copied Strings.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoURLParser should handle URLs with empty authority
achristensen@apple.com [Thu, 8 Sep 2016 22:15:07 +0000 (22:15 +0000)]
URLParser should handle URLs with empty authority
https://bugs.webkit.org/show_bug.cgi?id=161711

Reviewed by Brady Eidson.

Source/WebCore:

Covered by new API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
(WebCore::URLParser::parseAuthority):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

4 years agoRemove CopiedSpace and use MarkedSpace instead
fpizlo@apple.com [Thu, 8 Sep 2016 22:12:05 +0000 (22:12 +0000)]
Remove CopiedSpace and use MarkedSpace instead
https://bugs.webkit.org/show_bug.cgi?id=159658

Reviewed by Keith Miller.

This removes the final client of CopiedSpace, the overrides array of DirectArguments. That
is a simple change.

Then this stubs out some remaining internal debugging code that referenced CopiedSpace in
JSDollarVM and HeapVerifier. I filed FIXMEs to restore that debugging functionality.

The rest of this patch is deleting CopiedSpace.

* API/JSObjectRef.cpp:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOperations.cpp:
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
* heap/CopiedAllocator.h: Removed.
* heap/CopiedBlock.cpp: Removed.
* heap/CopiedBlock.h: Removed.
* heap/CopiedBlockInlines.h: Removed.
* heap/CopiedSpace.cpp: Removed.
* heap/CopiedSpace.h: Removed.
* heap/CopiedSpaceInlines.h: Removed.
* heap/CopyBarrier.h: Removed.
* heap/CopyToken.h: Removed.
* heap/CopyVisitor.cpp: Removed.
* heap/CopyVisitor.h: Removed.
* heap/CopyVisitorInlines.h: Removed.
* heap/CopyWorkList.h: Removed.
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::isPagedOut):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::size):
(JSC::Heap::capacity):
(JSC::Heap::collectImpl):
(JSC::Heap::stopAllocation):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::copyBackingStores): Deleted.
(JSC::Heap::threadBytesCopied): Deleted.
* heap/Heap.h:
(JSC::Heap::objectSpace):
(JSC::Heap::allocatorForAuxiliaryData):
(JSC::Heap::storageSpace): Deleted.
(JSC::Heap::storageAllocator): Deleted.
* heap/HeapCellInlines.h:
* heap/HeapInlines.h:
(JSC::Heap::tryAllocateStorage): Deleted.
(JSC::Heap::tryReallocateStorage): Deleted.
* heap/HeapVerifier.cpp:
(JSC::HeapVerifier::verifyButterflyIsInStorageSpace):
(JSC::HeapVerifier::reportObject):
(JSC::getButterflyDetails): Deleted.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::copyLater): Deleted.
* heap/SlotVisitor.h:
* jit/AssemblyHelpers.h:
* jit/JITOpcodes.cpp:
* jsc.cpp:
* runtime/ArrayConstructor.cpp:
* runtime/ArrayPrototype.cpp:
* runtime/Butterfly.h:
* runtime/ButterflyInlines.h:
(JSC::Butterfly::createUninitializedDuringCollection): Deleted.
* runtime/ClassInfo.h:
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::visitChildren):
(JSC::DirectArguments::overrideThings):
(JSC::DirectArguments::copyBackingStore): Deleted.
* runtime/DirectArguments.h:
* runtime/JSArray.cpp:
* runtime/JSCell.cpp:
(JSC::JSCell::copyBackingStore): Deleted.
* runtime/JSCell.h:
* runtime/JSLexicalEnvironment.h:
* runtime/JSObject.cpp:
* runtime/JSTypedArrays.cpp:
* runtime/LiteralParser.cpp:
* runtime/ObjectConstructor.cpp:
* runtime/RegExpObject.cpp:
* runtime/StringPrototype.cpp:
* runtime/WeakMapData.cpp:
* tools/JSDollarVMPrototype.cpp:
(JSC::JSDollarVMPrototype::isInStorageSpace):

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

4 years agoHTMLImageElement.hspace / vspace attributes should be unsigned
cdumez@apple.com [Thu, 8 Sep 2016 22:02:39 +0000 (22:02 +0000)]
HTMLImageElement.hspace / vspace attributes should be unsigned
https://bugs.webkit.org/show_bug.cgi?id=161754

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

HTMLImageElement.hspace / vspace attributes should be unsigned:
- https://html.spec.whatwg.org/#HTMLImageElement-partial

Firefox agrees with the specification, however, those were signed in
webKit.

No new tests, rebaselined existing test.

* html/HTMLImageElement.idl:

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

4 years agoREGRESSION (r205569?): 32-bit JSC test timeout: stress/rest-parameter-many-arguments...
mark.lam@apple.com [Thu, 8 Sep 2016 22:00:52 +0000 (22:00 +0000)]
REGRESSION (r205569?): 32-bit JSC test timeout: stress/rest-parameter-many-arguments.js.dfg-maximal-flush-validate-no-cjit
https://bugs.webkit.org/show_bug.cgi?id=161756

Reviewed by Saam Barati.

It looks like the 32-bit JSC bot is just too slow at running this test with the
dfg-maximal-flush-validate-no-cjit configuration.  We'll try excluding that
configuration.

* stress/rest-parameter-many-arguments.js:

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

4 years agoUpdate parseHTMLNonNegativeInteger() to return an unsigned value
cdumez@apple.com [Thu, 8 Sep 2016 21:31:54 +0000 (21:31 +0000)]
Update parseHTMLNonNegativeInteger() to return an unsigned value
https://bugs.webkit.org/show_bug.cgi?id=161759

Reviewed by Alex Christensen.

Update parseHTMLNonNegativeInteger() to return an unsigned value instead
of a signed one as the value can never be negative.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseBorderWidthAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLNonNegativeInteger):
(WebCore::parseHTTPRefreshInternal):
* html/parser/HTMLParserIdioms.h:

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

4 years agoDelete older WebAssembly tests
commit-queue@webkit.org [Thu, 8 Sep 2016 21:30:17 +0000 (21:30 +0000)]
Delete older WebAssembly tests
https://bugs.webkit.org/show_bug.cgi?id=161758

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-08
Reviewed by Filip Pizlo.

They're not running, rely on the older polyfill prototype, and the older code was deleted in: https://trac.webkit.org/changeset/204180

* stress/wasm-arithmetic-float32.js: Removed.
* stress/wasm-arithmetic-float64.js: Removed.
* stress/wasm-arithmetic-int32.js: Removed.
* stress/wasm-calls.js: Removed.
* stress/wasm-comma.js: Removed.
* stress/wasm-control-flow.js: Removed.
* stress/wasm-globals.js: Removed.
* stress/wasm-linear-memory.js: Removed.
* stress/wasm-locals.js: Removed.
* stress/wasm-relational.js: Removed.
* stress/wasm-type-conversion.js: Removed.
* stress/wasm/arithmetic-float32.wasm: Removed.
* stress/wasm/arithmetic-float64.wasm: Removed.
* stress/wasm/arithmetic-int32.wasm: Removed.
* stress/wasm/calls.wasm: Removed.
* stress/wasm/comma.wasm: Removed.
* stress/wasm/control-flow.wasm: Removed.
* stress/wasm/globals.wasm: Removed.
* stress/wasm/linear-memory.wasm: Removed.
* stress/wasm/locals.wasm: Removed.
* stress/wasm/relational.wasm: Removed.
* stress/wasm/type-conversion.wasm: Removed.

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

4 years agoGet rid of the color profile from ImageFrame and ImageDecoder
commit-queue@webkit.org [Thu, 8 Sep 2016 21:16:38 +0000 (21:16 +0000)]
Get rid of the color profile from ImageFrame and ImageDecoder
https://bugs.webkit.org/show_bug.cgi?id=159699

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-09-08
Reviewed by Simon Fraser.

The color profile is set but it is never used.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageFrame::setColorProfile): Deleted.
* platform/image-decoders/ImageDecoder.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageReader::decode):
(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::readColorProfile): Deleted.
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::headerAvailable):
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::readColorProfile): Deleted.

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

4 years ago[CSS Parser] Add support for new CSS selector parsing
hyatt@apple.com [Thu, 8 Sep 2016 21:09:04 +0000 (21:09 +0000)]
[CSS Parser] Add support for new CSS selector parsing
https://bugs.webkit.org/show_bug.cgi?id=161749

Reviewed by Dean Jackson.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::isValidSelector):
* css/CSSDefaultStyleSheets.cpp:
(WebCore::parseUASheet):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFaces):
* css/CSSGrammar.y.in:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/DOMCSSNamespace.cpp:
(WebCore::DOMCSSNamespace::supports):
* css/FontFace.cpp:
(WebCore::FontFace::parseString):
(WebCore::FontFace::setVariant):
* css/MediaList.cpp:
(WebCore::MediaQuerySet::internalParse):
(WebCore::MediaQuerySet::parse):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
* css/SelectorFilter.cpp:
(WebCore::SelectorFilter::collectIdentifierHashes):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/SelectorPseudoTypeMap.h:
* css/SourceSizeList.cpp:
(WebCore::parseSizesAttribute):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::MutableStyleProperties):
* css/StyleProperties.h:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::StyleSheetContents):
(WebCore::StyleSheetContents::parserAddNamespace):
(WebCore::StyleSheetContents::namespaceURIFromPrefix):
(WebCore::StyleSheetContents::determineNamespace): Deleted.
* css/StyleSheetContents.h:
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/parser/CSSParser.cpp:
(WebCore::strictCSSParserContext):
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseColor):
(WebCore::CSSParser::shouldAcceptUnitLessValues):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseColumnWidth):
(WebCore::CSSParser::parseColumnCount):
(WebCore::CSSParser::parseFontWeight):
(WebCore::CSSParser::parseColorParameters):
(WebCore::CSSParser::parseHSLParameters):
(WebCore::CSSParser::parseShadow):
(WebCore::CSSParser::parseBorderImageSlice):
(WebCore::CSSParser::parseBorderImageQuad):
(WebCore::CSSParser::parseDeprecatedLinearGradient):
(WebCore::CSSParser::parseLinearGradient):
(WebCore::CSSParser::parseTransformValue):
(WebCore::CSSParser::parseBuiltinFilterArguments):
(WebCore::CSSParser::determineNameInNamespace):
* css/parser/CSSParser.h:
(WebCore::CSSParser::inStrictMode):
(WebCore::CSSParser::inQuirksMode):
* css/parser/CSSParserMode.h:
(WebCore::isQuirksModeBehavior):
(WebCore::isUASheetBehavior):
(WebCore::isUnitLessLengthParsingEnabledForMode):
(WebCore::isCSSViewportParsingEnabledForMode):
(WebCore::strictToCSSParserMode):
(WebCore::isStrictParserMode):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
(WebCore::CSSParserSelector::parsePseudoClassSelectorFromStringView):
(WebCore::CSSParserSelector::setSelectorList):
(WebCore::CSSParserSelector::appendTagHistory):
(WebCore::CSSParserSelector::releaseTagHistory):
(WebCore::CSSParserSelector::isHostPseudoSelector):
* css/parser/CSSParserValues.h:
(WebCore::CSSParserSelector::match):
(WebCore::CSSParserSelector::pseudoElementType):
(WebCore::CSSParserSelector::selectorList):
(WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
* css/parser/CSSPropertyParser.h:
(WebCore::CSSPropertyParser::inQuirksMode):
* css/parser/CSSSelectorParser.cpp: Added.
(WebCore::CSSSelectorParser::parseSelector):
(WebCore::CSSSelectorParser::CSSSelectorParser):
(WebCore::CSSSelectorParser::consumeComplexSelectorList):
(WebCore::CSSSelectorParser::consumeCompoundSelectorList):
(WebCore::CSSSelectorParser::consumeComplexSelector):
(WebCore::CSSSelectorParser::consumeCompoundSelector):
(WebCore::CSSSelectorParser::consumeSimpleSelector):
(WebCore::CSSSelectorParser::consumeName):
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::CSSSelectorParser::consumePseudo):
(WebCore::CSSSelectorParser::consumeCombinator):
(WebCore::CSSSelectorParser::consumeAttributeMatch):
(WebCore::CSSSelectorParser::consumeAttributeFlags):
(WebCore::CSSSelectorParser::consumeANPlusB):
(WebCore::CSSSelectorParser::defaultNamespace):
(WebCore::CSSSelectorParser::determineNamespace):
(WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
(WebCore::CSSSelectorParser::addSimpleSelectorToCompound):
(WebCore::CSSSelectorParser::splitCompoundAtImplicitShadowCrossingCombinator):
* css/parser/CSSSelectorParser.h: Added.
(WebCore::CSSSelectorParser::DisallowPseudoElementsScope::DisallowPseudoElementsScope):
(WebCore::CSSSelectorParser::DisallowPseudoElementsScope::~DisallowPseudoElementsScope):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
* dom/StyledElement.cpp:
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::SVGFontFaceElement):

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

4 years agoDon't run transitions to or from undefined Lengths
simon.fraser@apple.com [Thu, 8 Sep 2016 20:54:24 +0000 (20:54 +0000)]
Don't run transitions to or from undefined Lengths
https://bugs.webkit.org/show_bug.cgi?id=161750
rdar://problem/28170460

Reviewed by Zalan Bujtas.

Source/WebCore:

For properties like max-height whose default value is 'none', we would erroneously
attempt to run transitions/animations, and then assert when one of the endpoints
was undefined.

So don't attempt to blend such Length values, just as do when they are auto.

Fixes some transitions on apple.com and developer.apple.com.

Test: transitions/transition-to-from-undefined.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::blendProperties):
* platform/Length.cpp:
(WebCore::blend):

LayoutTests:

* transitions/transition-to-from-undefined-expected.txt: Added.
* transitions/transition-to-from-undefined.html: Added.

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

4 years agoHeap version should be 32-bit
fpizlo@apple.com [Thu, 8 Sep 2016 20:35:55 +0000 (20:35 +0000)]
Heap version should be 32-bit
https://bugs.webkit.org/show_bug.cgi?id=161751

Reviewed by Mark Lam.

32-bit devices are probably getting hurt by the 64-bit version number. The reason why I made
it 64-bit initially is so that I wouldn't have to worry about wrap-around. But wrap-around is
easy to handle.

* heap/CellContainer.h:
* heap/CellContainerInlines.h:
(JSC::CellContainer::flipIfNecessary):
* heap/ConservativeRoots.cpp:
(JSC::ConservativeRoots::genericAddPointer):
(JSC::ConservativeRoots::genericAddSpan):
* heap/ConservativeRoots.h:
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::testAndSetMarked):
* heap/HeapUtil.h:
(JSC::HeapUtil::findGCObjectPointersForMarking):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::MarkedBlock):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::flipIfNecessary):
(JSC::MarkedBlock::flipIfNecessaryConcurrently):
(JSC::MarkedBlock::Handle::flipIfNecessary):
(JSC::MarkedBlock::Handle::flipIfNecessaryConcurrently):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::flip):
* heap/MarkedSpace.h:
(JSC::MarkedSpace::version):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
* heap/SlotVisitor.h:

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

4 years agoSupport new emoji group candidates
mmaxfield@apple.com [Thu, 8 Sep 2016 20:09:20 +0000 (20:09 +0000)]
Support new emoji group candidates
https://bugs.webkit.org/show_bug.cgi?id=161664
<rdar://problem/24802695>
<rdar://problem/27666433>

Reviewed by Simon Fraser.

Source/WebCore:

Support more emoji group candidates. This includes joining groups into a single glyph, as
well as atomic deletions of the entire group when the backspace key is pressed.

Tests: editing/deleting/delete-emoji.html:
       fast/text/emoji-num-glyphs.html:

* platform/text/CharacterProperties.h:
(WebCore::isEmojiGroupCandidate):

Source/WTF:

Update breaking rules.

* wtf/text/TextBreakIterator.cpp:
(WTF::cursorMovementIterator):

LayoutTests:

Add tests.

* platform/ios-simulator/editing/deleting/delete-emoji-expected.txt:
* platform/mac-yosemite/editing/deleting/delete-emoji-expected.txt:
* platform/mac/editing/deleting/delete-emoji-expected.txt:
* editing/deleting/delete-emoji.html:
* fast/text/emoji-num-glyphs-expected.txt:
* fast/text/emoji-num-glyphs.html:

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

4 years agoAdd support for a ternary sub32 emitter for ARM64 and 32-bit ARM.
mark.lam@apple.com [Thu, 8 Sep 2016 20:05:28 +0000 (20:05 +0000)]
Add support for a ternary sub32 emitter for ARM64 and 32-bit ARM.
https://bugs.webkit.org/show_bug.cgi?id=161724

Reviewed by Filip Pizlo.

ARM architectures support ternary sub instructions.  We should make use of them
in emitAllocateWithNonNullAllocator().

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::sub32):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::sub32):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::sub32):
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::sub32):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::sub32):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testTernarySubInstructionSelection):
(JSC::B3::run):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitAllocateWithNonNullAllocator):

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

4 years agoHTMLImageElement.width / height attributes should be unsigned
cdumez@apple.com [Thu, 8 Sep 2016 19:46:10 +0000 (19:46 +0000)]
HTMLImageElement.width / height attributes should be unsigned
https://bugs.webkit.org/show_bug.cgi?id=161730

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:

Source/WebCore:

HTMLImageElement.width / height attributes should be unsigned as per
the HTML specification:
- https://html.spec.whatwg.org/#htmlimageelement

However, they are signed in WebKit. Firefox agrees with the
specification.

No new tests, rebaselined existing test.

* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::construct):
(WebCore::createImageConstructor): Deleted.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::createForJSConstructor):
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
(WebCore::HTMLImageElement::setHeight):
(WebCore::HTMLImageElement::setWidth):
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::restoreImageSize):

LayoutTests:

Update existing test to reflect behavior change.

* js/dom/custom-constructors-expected.txt:
* js/dom/script-tests/custom-constructors.js:

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

4 years agoMove JSMap/JSSet over to Auxiliary MarkedSpace
fpizlo@apple.com [Thu, 8 Sep 2016 18:59:02 +0000 (18:59 +0000)]
Move JSMap/JSSet over to Auxiliary MarkedSpace
https://bugs.webkit.org/show_bug.cgi?id=161744

Reviewed by Saam Barati.
Source/JavaScriptCore:

This moves the buffer out of CopiedSpace and into Auxiliary MarkedSpace.

Also removes MapData.h/MapDataInlines.h since they are not used anywhere, but they still
speak of CopiedSpace.

This is a purely mechanical change.

* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/CopyToken.h:
* runtime/HashMapImpl.cpp:
(JSC::HashMapImpl<HashMapBucket>::visitChildren):
(JSC::HashMapImpl<HashMapBucket>::copyBackingStore): Deleted.
* runtime/HashMapImpl.h:
(JSC::HashMapBuffer::create):
* runtime/JSMapIterator.cpp:
* runtime/JSMapIterator.h:
* runtime/JSSetIterator.cpp:
* runtime/JSSetIterator.h:
* runtime/MapBase.cpp:
* runtime/MapData.h: Removed.
* runtime/MapDataInlines.h: Removed.
* runtime/MapPrototype.cpp:
* runtime/SetConstructor.cpp:
* runtime/SetPrototype.cpp:
* runtime/VM.cpp:

Source/WebCore:

No new tests because no change in behavior.

* bindings/js/SerializedScriptValue.cpp:

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

4 years agoUnreviewed, rolling out r205652.
commit-queue@webkit.org [Thu, 8 Sep 2016 18:48:15 +0000 (18:48 +0000)]
Unreviewed, rolling out r205652.
https://bugs.webkit.org/show_bug.cgi?id=161748

Crashing under ASan (Requested by yusukesuzuki on #webkit).

Reverted changeset:

"ScriptRunner should be driven by PendingScript rather than
ScriptElement"
https://bugs.webkit.org/show_bug.cgi?id=161726
http://trac.webkit.org/changeset/205652

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

4 years agoScriptRunner should be driven by PendingScript rather than ScriptElement
utatane.tea@gmail.com [Thu, 8 Sep 2016 17:49:43 +0000 (17:49 +0000)]
ScriptRunner should be driven by PendingScript rather than ScriptElement
https://bugs.webkit.org/show_bug.cgi?id=161726

Reviewed by Ryosuke Niwa.

Source/WebCore:

ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
while all the external script will load the LoadableScript. It is confusing.
This patch removes ScriptElement::notifyFinished and use PendingScript's observability
in ScriptRunner instead.

This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
the load and error events, this ignore-destructive-writes counter should not be incremeneted by
this execution. The added tests ensure this behavior.

[1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block

* dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
(WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
(WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
So no need to do it here, that's duplicated.
(WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
(WebCore::ScriptElement::stopLoadRequest): Deleted.
(WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
merged into executeScriptForRunner.
(WebCore::ScriptElement::notifyFinished): Deleted.
* dom/ScriptElement.h:
(WebCore::ScriptElement::~ScriptElement):
(WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
(WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
(WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
(WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
(WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
(WebCore::ScriptRunner::notifyScriptReady): Deleted.
* dom/ScriptRunner.h:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.

LayoutTests:

* js/dom/document-write-in-error-event-expected.txt: Added.
* js/dom/document-write-in-error-event.html: Added.
* js/dom/document-write-in-load-event-expected.txt: Added.
* js/dom/document-write-in-load-event.html: Added.
* js/dom/script-tests/dummy.js: Added.

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

4 years agoWeb Inspector: Debugger sidebar should include a warning message breakpoints are...
commit-queue@webkit.org [Thu, 8 Sep 2016 17:37:53 +0000 (17:37 +0000)]
Web Inspector: Debugger sidebar should include a warning message breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=156719
<rdar://problem/25787932>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-08
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
New strings for breakpoints disabled warning banner.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
(.sidebar > .panel.navigation.debugger .warning-banner > a):
Generalize the class name to "warning-banner".

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointsEnabledDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart):
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped):
(WebInspector.DebuggerSidebarPanel.prototype._updateBreakpointsDisabledBanner):
Show / hide a breakpoints disabled warning banner as needed.
Only one banner shows at a time, so either the timing warning
or the generic breakpoints disabled banner will show.

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

4 years agoRe-land r205580 after r205649 fixed the test failures
achristensen@apple.com [Thu, 8 Sep 2016 17:23:30 +0000 (17:23 +0000)]
Re-land r205580 after r205649 fixed the test failures
https://bugs.webkit.org/show_bug.cgi?id=161668

Re-landing changesets:

"Punycode encode non-ascii hosts in URLParser"
https://bugs.webkit.org/show_bug.cgi?id=161655
http://trac.webkit.org/changeset/205521

"Fix query-only and fragment-only relative URLs when using
URLParser"
https://bugs.webkit.org/show_bug.cgi?id=161657
http://trac.webkit.org/changeset/205526

"URLParser should parse / as a relative URL"
https://bugs.webkit.org/show_bug.cgi?id=161667
http://trac.webkit.org/changeset/205532

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

4 years agoAdd range check in URLParser's serializeIPv6
achristensen@apple.com [Thu, 8 Sep 2016 17:19:25 +0000 (17:19 +0000)]
Add range check in URLParser's serializeIPv6
https://bugs.webkit.org/show_bug.cgi?id=161743

Reviewed by David Kilzer.

No new tests, but this fixes API tests in some release builds after
the patch from https://bugs.webkit.org/show_bug.cgi?id=161668 is recommitted.

* platform/URLParser.cpp:
(WebCore::serializeIPv6):
Don't go out of bounds.  Don't assume that the memory immediately after the end of the array will be empty.

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

4 years agoTyped arrays should use MarkedSpace instead of CopiedSpace
fpizlo@apple.com [Thu, 8 Sep 2016 16:47:34 +0000 (16:47 +0000)]
Typed arrays should use MarkedSpace instead of CopiedSpace
https://bugs.webkit.org/show_bug.cgi?id=161100

Reviewed by Geoffrey Garen.

This moves typed array backing stores out of CopiedSpace and into Auxiliary MarkedSpace.

This is a purely mechanical change since Auxiliary MarkedSpace already knows how to do
everything that typed arrays want.

* dfg/DFGOperations.cpp:
(JSC::DFG::newTypedArrayWithSize):
* dfg/DFGOperations.h:
(JSC::DFG::operationNewTypedArrayWithSizeForType):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewTypedArray):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::emitAllocateBasicStorage): Deleted.
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::initializeArrayElements):
(JSC::FTL::DFG::LowerDFGToB3::splatWords):
(JSC::FTL::DFG::LowerDFGToB3::allocateBasicStorageAndGetEnd): Deleted.
(JSC::FTL::DFG::LowerDFGToB3::allocateBasicStorage): Deleted.
* heap/CopyToken.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::markAuxiliary):
* jit/JITOperations.h:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::ConstructionContext::ConstructionContext):
(JSC::JSArrayBufferView::JSArrayBufferView):
* runtime/JSArrayBufferView.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::createWithFastVector):
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren):
(JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory):
(JSC::JSGenericTypedArrayView<Adaptor>::copyBackingStore): Deleted.

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

4 years agoExpose Apple Pencil input to testing system
dino@apple.com [Thu, 8 Sep 2016 10:28:02 +0000 (10:28 +0000)]
Expose Apple Pencil input to testing system
https://bugs.webkit.org/show_bug.cgi?id=161670
<rdar://problem/28183327>

I fixed the internal builds, now try to fix the public builds.

* WebKitTestRunner/ios/IOKitSPI.h: Add new enum values.

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

4 years ago[Win64] Compile fixes.
pvollan@apple.com [Thu, 8 Sep 2016 09:09:59 +0000 (09:09 +0000)]
[Win64] Compile fixes.
https://bugs.webkit.org/show_bug.cgi?id=161682

Reviewed by Brent Fulgham.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* runtime/ArrayConventions.cpp:
(JSC::clearArrayMemset):

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

4 years ago[Win] Exception fuzz tests fail
pvollan@apple.com [Thu, 8 Sep 2016 07:45:27 +0000 (07:45 +0000)]
[Win] Exception fuzz tests fail
https://bugs.webkit.org/show_bug.cgi?id=140928

Reviewed by Mark Lam.

JSTests:

Unskip tests.

* exceptionFuzz.yaml:

Source/JavaScriptCore:

Flush stdout when throwing the exception to make sure the output comes before output in the exception handler.
The tests depend on the output to stdout being written in the correct order.

* runtime/ExceptionFuzz.cpp:
(JSC::doExceptionFuzzing):

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

4 years agoMove webkit2gtk.pc.in, webkit2gtk-web-extension.pc.in files under Source/WebKit2...
zandobersek@gmail.com [Thu, 8 Sep 2016 07:36:27 +0000 (07:36 +0000)]
Move webkit2gtk.pc.in, webkit2gtk-web-extension.pc.in files under Source/WebKit2/gtk/
https://bugs.webkit.org/show_bug.cgi?id=161703

Reviewed by Carlos Garcia Campos.

Move the pkg-config input files that are specific to the GTK+ port
under the Source/WebKit2/gtk/ directory. Build rules are updated
accordingly.

* PlatformGTK.cmake:
* gtk/webkit2gtk-web-extension.pc.in: Renamed from Source/WebKit2/webkit2gtk-web-extension.pc.in.
* gtk/webkit2gtk.pc.in: Renamed from Source/WebKit2/webkit2gtk.pc.in.

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

4 years ago[Mac] Address some clang static analyzer warnings in WebKit
joepeck@webkit.org [Thu, 8 Sep 2016 07:18:48 +0000 (07:18 +0000)]
[Mac] Address some clang static analyzer warnings in WebKit
https://bugs.webkit.org/show_bug.cgi?id=161597

Reviewed by Darin Adler.

Source/WebKit/mac:

* Misc/WebIconDatabase.h:
Remove unused instance variable. It has not been used since r16005 (2006)!

* Misc/WebSharingServicePickerController.mm:
(-[WebSharingServicePickerController sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
Address array leak.

* WebCoreSupport/WebSelectionServiceController.mm:
(WebSelectionServiceController::hasRelevantSelectionServices):
Address attachment and cell leak.

* WebView/WebFullScreenController.h:
* WebView/WebImmediateActionController.h:
Remove unused instance variables.

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(-[WKLayerHostView makeBackingLayer]):
* UIProcess/mac/WKSharingServicePickerDelegate.mm:
(-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
* WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
(-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
Address leaks caught by the static analyzer.

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

4 years ago[GTK] Remove stale WebSoupRequestManager headers
zandobersek@gmail.com [Thu, 8 Sep 2016 06:49:16 +0000 (06:49 +0000)]
[GTK] Remove stale WebSoupRequestManager headers
https://bugs.webkit.org/show_bug.cgi?id=161691

Reviewed by Sergio Villar Senin.

WebSoupRequestManager, WebSoupRequestManagerProxy and WebSoupRequestManagerClient
classes were used to implement custom URI scheme support for Soup. This API and
the implementations of these classes were removed in r174584, but curiously the
headers went unnoticed. This patch removes them, as well as the
WebSoupRequestManagerProxy forwarding declaration in WKAPICastSoup.h.

* UIProcess/API/C/soup/WKAPICastSoup.h:
* UIProcess/soup/WebSoupRequestManagerClient.h: Removed.
* UIProcess/soup/WebSoupRequestManagerProxy.h: Removed.
(WebKit::WebSoupRequestManagerProxy::registeredURISchemes): Deleted.
* WebProcess/soup/WebSoupRequestManager.h: Removed.

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

4 years agoExpose Apple Pencil input to testing system
dino@apple.com [Thu, 8 Sep 2016 06:02:15 +0000 (06:02 +0000)]
Expose Apple Pencil input to testing system
https://bugs.webkit.org/show_bug.cgi?id=161670
<rdar://problem/28183327>

Attempt to fix iOS 9 builds.

* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator _createIOHIDEventType:]):

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

4 years agoRoll out r205580 and r205582.
achristensen@apple.com [Thu, 8 Sep 2016 05:59:38 +0000 (05:59 +0000)]
Roll out r205580 and r205582.
https://bugs.webkit.org/show_bug.cgi?id=161668

I need to figure out why this is failing on the bots before landing any more URLParser progress.

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

4 years agoUnreviewed, EFL build fix after r205581
utatane.tea@gmail.com [Thu, 8 Sep 2016 05:59:07 +0000 (05:59 +0000)]
Unreviewed, EFL build fix after r205581
https://bugs.webkit.org/show_bug.cgi?id=161674

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::notifyFinished):

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

4 years agoFix API tests after r205580
achristensen@apple.com [Thu, 8 Sep 2016 04:10:41 +0000 (04:10 +0000)]
Fix API tests after r205580
https://bugs.webkit.org/show_bug.cgi?id=161668

No new tests, but this fixes API tests on bots.

* platform/URLParser.cpp:
(WebCore::domainToASCII):
This function seems to be appending characters to strings sometimes on some configurations.
This definitely needs further investigation, but this will fix the bots, and nothing else
will be affected because the URLParser is disabled by default.

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

4 years agoIntroduce abstract class LoadableScript for classic script and module graph
utatane.tea@gmail.com [Thu, 8 Sep 2016 01:49:49 +0000 (01:49 +0000)]
Introduce abstract class LoadableScript for classic script and module graph
https://bugs.webkit.org/show_bug.cgi?id=161674

Reviewed by Ryosuke Niwa.

To prepare for ScriptModuleGraph, we introduce the abstract class over the classic script
and the module script, LoadableScript.

No behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/LoadableClassicScript.cpp: Added. LoadableClassicScript is the derived class from the
LoadableScript. In the module patch, we will introduce LoadableScriptModuleGraph which is also
the derived class from the LoadableScript. It is used for the external classic script.
A CachedResourceHandle used here alone does not prevent the underlying CachedResource from purging its
data buffer. This LoadableClassicScript holds a client until this class is destroyed in order to
guarantee that the data buffer will not be purged.
(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::LoadableClassicScript):
(WebCore::LoadableClassicScript::~LoadableClassicScript):
(WebCore::LoadableClassicScript::isLoaded):
(WebCore::LoadableClassicScript::wasErrored): Beyond the boolean value, this can return the detail
of the error. This detailed information will be used to report it to the inspector in the ScriptElement.
(WebCore::LoadableClassicScript::wasCanceled):
(WebCore::LoadableClassicScript::notifyFinished): Nosniff and cross-origin loading errors are handled here,
instead of exposing CachedScript*.
(WebCore::LoadableClassicScript::execute): Execute the cached script by using the given ScriptElement.
* dom/LoadableClassicScript.h: Copied from Source/WebCore/dom/PendingScript.h.
(isType):
* dom/LoadableScript.cpp: Copied from Source/WebCore/dom/ScriptRunner.h. New wrapper for CachedScript
and ScriptModuleGraph. We introduce a new wrapper to handle the above 2 things in the same way.
We take the way to introduce a new wrapper instead of introducing a new interface that is inherited by
CachedScript and ScriptModuleGraph. This is because ScriptModuleGraph is ref-counted while CachedScript
is managed by CachedResourceHandle. While this patch does not contain ScriptModuleGraph part, this
should be added in the module patch and at that time, this should be managed by this LoadableScript's
subclass. And we introduce TypeCasts traits for LoadableScript to allow `is<>` and `downcast<>`.
(WebCore::LoadableScript::addClient):
(WebCore::LoadableScript::removeClient):
(WebCore::LoadableScript::notifyClientFinished):
* dom/LoadableScript.h: Copied from Source/WebCore/dom/ScriptRunner.h.
(WebCore::LoadableScript::~LoadableScript):
(WebCore::LoadableScript::isClassicScript):
(WebCore::LoadableScript::isModuleGraph):
* dom/LoadableScriptClient.h: Copied from Source/WebCore/dom/ScriptRunner.h.
(WebCore::LoadableScriptClient::~LoadableScriptClient):
* dom/PendingScript.cpp: Use LoadableScript instead of CachedScript.
(WebCore::PendingScript::create):
(WebCore::PendingScript::PendingScript):
(WebCore::PendingScript::~PendingScript):
(WebCore::PendingScript::loadableScript):
(WebCore::PendingScript::notifyFinished):
(WebCore::PendingScript::isLoaded):
(WebCore::PendingScript::wasErrored):
(WebCore::PendingScript::cachedScript): Deleted.
* dom/PendingScript.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::handleSourceAttribute): Change sourceUrl to sourceURL to be consistent.
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestClassicScript): requestScript is renamed to requestClassicScript.
(WebCore::ScriptElement::requestScriptWithCache): Extract the code requesting the
CachedScript from requestScript. This will also be used by the module fetcher.
(WebCore::ScriptElement::executeScript): Now inspector error reporting is also done in this function.
When an error occurs, LoadableScript::wasErrored() returns the error which may include the information
to report the error to the inspector. nosniff and cross-origin loading errors are now detected by the
LoadableClassicScript and reported through this wasErrored().
(WebCore::ScriptElement::stopLoadRequest):
(WebCore::ScriptElement::executeScriptAndDispatchEvent):
(WebCore::ScriptElement::executeScriptForScriptRunner): Move the code from ScriptRunner. This function
calls removeClient(*this) because ScriptRunner is driven by the ScriptElement's notification. Only when using
ScriptRunner, we call addClient(*this) for ScriptElement. This is tricky, we should refactor this in the separated
bug (https://bugs.webkit.org/show_bug.cgi?id=161726).
(WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Move the code from HTMLScriptRunner.
(WebCore::ScriptElement::notifyFinished):
(WebCore::ScriptElement::requestScript): Deleted.
(WebCore::ScriptElement::execute): Deleted.
* dom/ScriptElement.h:
(WebCore::ScriptElement::loadableScript):
(WebCore::ScriptElement::cachedScript): Deleted.
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution):
(WebCore::ScriptRunner::timerFired): Use ScriptElement::executeScriptForScriptRunner.
* dom/ScriptRunner.h:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::requestPendingScript):
(WebCore::HTMLScriptRunner::requestParsingBlockingScript):
(WebCore::HTMLScriptRunner::sourceFromPendingScript): Deleted.
* html/parser/HTMLScriptRunner.h: Use ScriptElement::executeScriptForHTMLScriptRunner.
* xml/parser/XMLDocumentParserLibxml2.cpp: Currently, we do nothing about XMLDocument in this patch.
We should support the module script, but before that, we should refactor this pending script handling.
(WebCore::XMLDocumentParser::endElementNs):

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

4 years agoUnreviewed, revert r205533.
achristensen@apple.com [Thu, 8 Sep 2016 01:34:19 +0000 (01:34 +0000)]
Unreviewed, revert r205533.
https://bugs.webkit.org/show_bug.cgi?id=161668

Re-landing changesets:

"Punycode encode non-ascii hosts in URLParser"
https://bugs.webkit.org/show_bug.cgi?id=161655
http://trac.webkit.org/changeset/205521

"Fix query-only and fragment-only relative URLs when using
URLParser"
https://bugs.webkit.org/show_bug.cgi?id=161657
http://trac.webkit.org/changeset/205526

"URLParser should parse / as a relative URL"
https://bugs.webkit.org/show_bug.cgi?id=161667
http://trac.webkit.org/changeset/205532

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

4 years agoEnable the <meter> element on iOS
simon.fraser@apple.com [Thu, 8 Sep 2016 01:26:08 +0000 (01:26 +0000)]
Enable the <meter> element on iOS
https://bugs.webkit.org/show_bug.cgi?id=161714
rdar://problem/8978410

Reviewed by Tim Horton.

Source/JavaScriptCore:

Define ENABLE_METER_ELEMENT unconditionally now.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Define ENABLE_METER_ELEMENT unconditionally now.

Rendering falls back to html.css rendering, which makes <meter> looks similar between
macOS and iOS.

Tested by enabling existing tests.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

Define ENABLE_METER_ELEMENT unconditionally now.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Define ENABLE_METER_ELEMENT unconditionally now.

* Configurations/FeatureDefines.xcconfig:

Tools:

Define ENABLE_METER_ELEMENT unconditionally now.

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* platform/ios-simulator-wk1/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt: Added.
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-optimums-expected.txt:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
* platform/ios-simulator/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/form-control-infrastructure/form-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-label-element/labelable-elements-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/forms/the-meter-element/meter-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/semantics/interfaces-expected.txt:

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

4 years agoWeb Inspector: Show resource timing details in Network waterfall
commit-queue@webkit.org [Thu, 8 Sep 2016 01:04:48 +0000 (01:04 +0000)]
Web Inspector: Show resource timing details in Network waterfall
https://bugs.webkit.org/show_bug.cgi?id=160062

This patch adds a popover to network tab's and timeline tab's resource rows, when hovering
the recordbar. It shows times for the various parts of the resource load if they are available,
or it shows the reason for why not as text (e.g. cached resource, data URI).

Patch by Johan K. Jensen <johan_jensen@apple.com> on 2016-09-07
Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
Added new strings.

* UserInterface/Main.html:
Include new files.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.initialLayout):
Updated to use DataGrid property to hide header.

* UserInterface/Views/DataGrid.css:
(.data-grid.no-header > .header-wrapper):
(.data-grid.no-header > .header-wrapper > table.header): Deleted.
Hide the whole DataGrid header.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid):
(WebInspector.DataGrid.prototype.get headerVisible):
(WebInspector.DataGrid.prototype.set headerVisible):
Add property to control header visibility, so grid clients aren't forced to manipulate internal grid styles.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype._processPendingRecords):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView.prototype._processPendingRecords):
* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
Pass in new parameter for whether or not to show the popover for resources.

* UserInterface/Views/ResourceTimelineDataGridNode.css: Added.
(.resource-timing-popover-content .data-grid):
(.resource-timing-popover-content .data-grid .graph-column > .cell-content):
(.resource-timing-popover-content .data-grid td):
(.resource-timing-popover-content .data-grid td.graph-column):
(.resource-timing-popover-content .data-grid table.data):
(.resource-timing-popover-content .data-grid tr:nth-last-child(2)):
Add styling for the popover.

* UserInterface/Views/ResourceTimelineDataGridNode.js:
(WebInspector.ResourceTimelineDataGridNode):
(WebInspector.ResourceTimelineDataGridNode.prototype.didAddRecordBar):
(WebInspector.ResourceTimelineDataGridNode.prototype.didRemoveRecordBar):
(WebInspector.ResourceTimelineDataGridNode.prototype._mouseoverRecordBar):
Creates the popover for a RecordBar and shows detailed info about segments.

* UserInterface/Views/ResourceTimingPopoverDataGridNode.js: Added.
(WebInspector.ResourceTimingPopoverDataGridNode):
(WebInspector.ResourceTimingPopoverDataGridNode.prototype.get records):
(WebInspector.ResourceTimingPopoverDataGridNode.prototype.get data):
(WebInspector.ResourceTimingPopoverDataGridNode.prototype.get selectable):
(WebInspector.ResourceTimingPopoverDataGridNode.prototype.createCellContent):
DataGridNode for the popover.

* UserInterface/Views/TimelineDataGridNode.js:
(WebInspector.TimelineDataGridNode.prototype.refreshGraph.createBar):
(WebInspector.TimelineDataGridNode.prototype.refreshGraph):
(WebInspector.TimelineDataGridNode.prototype.didAddRecordBar):
(WebInspector.TimelineDataGridNode.prototype.didRemoveRecordBar):
(WebInspector.TimelineDataGridNode):
Added hooks for notifying subclasses.

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar):
(WebInspector.TimelineRecordBar.fromElement):
Added symbol and static method to get the recordBar from a given element.

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

4 years agobitwise_cast: allow const destination type
commit-queue@webkit.org [Thu, 8 Sep 2016 00:40:17 +0000 (00:40 +0000)]
bitwise_cast: allow const destination type
https://bugs.webkit.org/show_bug.cgi?id=161719

Patch by JF Bastien <jfbastien@apple.com> on 2016-09-07
Reviewed by Saam Barati.

* wtf/StdLibExtras.h:
(WTF::bitwise_cast): allow `const To to = bitwise_cast<const To>(from);`

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

4 years ago[Mac] .tbd files for the shims end up installed when building with GENERATE_TEXT_BASE...
mitz@apple.com [Thu, 8 Sep 2016 00:38:03 +0000 (00:38 +0000)]
[Mac] .tbd files for the shims end up installed when building with GENERATE_TEXT_BASED_STUBS=YES
https://bugs.webkit.org/show_bug.cgi?id=161722

Reviewed by Anders Carlsson.

* Configurations/Shim.xcconfig: Don’t install the shims. The Copy Shims build phase in the
  WebKit target will copy them into place without bringing their .tbd files along.

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

4 years agoModernize Debugger to use nullptr
commit-queue@webkit.org [Thu, 8 Sep 2016 00:16:39 +0000 (00:16 +0000)]
Modernize Debugger to use nullptr
https://bugs.webkit.org/show_bug.cgi?id=161718

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-07
Reviewed by Mark Lam.

* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::~Debugger):
(JSC::Debugger::detach):
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::updateCallFrameAndPauseIfNeeded):
* debugger/Debugger.h:

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

4 years ago[MediaStream] applyConstraints pt. 2 - advanced constraints
eric.carlson@apple.com [Thu, 8 Sep 2016 00:01:29 +0000 (00:01 +0000)]
[MediaStream] applyConstraints pt. 2 - advanced constraints
https://bugs.webkit.org/show_bug.cgi?id=161715
<rdar://problem/28195461>

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/mediastream/apply-constraints-advanced.html

* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaConstraint::create): Return Ref<>, not RefPtr<>.
(WebCore::MediaConstraint::copy): New
(WebCore::IntConstraint::copy): Ditto.
(WebCore::DoubleConstraint::copy): Ditto.
(WebCore::BooleanConstraint::copy): Ditto.
(WebCore::StringConstraint::copy): Ditto.
(WebCore::StringConstraint::fitnessDistance): New, compute the fitness distance between the
  constraint and the specified value.
(WebCore::StringConstraint::merge): New, merge value into constraint.
(WebCore::FlattenedConstraint::set): New, add or replace a constraint.
(WebCore::FlattenedConstraint::merge): New, merge or add a constraint.
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::fitnessDistance):
(WebCore::MediaConstraint::merge):
(WebCore::NumericConstraint::nearlyEqual):
(WebCore::FlattenedConstraint::isEmpty):
(WebCore::FlattenedConstraint::begin):
(WebCore::FlattenedConstraint::end):
(WebCore::MediaConstraint::~MediaConstraint): Deleted.
(WebCore::MediaConstraint::find): Deleted.
(WebCore::MediaConstraint::getIdeal): Deleted.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance): Return the fitness distance between the source
  capabilities and a constraint.
(WebCore::applyNumericConstraint): New, apply a numeric constraint.
(WebCore::RealtimeMediaSource::applyConstraint): Use applyNumericConstraint.
(WebCore::RealtimeMediaSource::selectSettings): New, implement the SelectSettings algorithm
(WebCore::RealtimeMediaSource::applyConstraints):
(WebCore::RealtimeMediaSource::supportsConstraint): Deleted.
(WebCore::value): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

LayoutTests:

* fast/mediastream/apply-constraints-advanced-expected.txt: Added.
* fast/mediastream/apply-constraints-advanced.html: Added.

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

4 years agoRun spindumps on timeout on iOS 9 Simulator Release WK2 (Tests)
jbedard@apple.com [Thu, 8 Sep 2016 00:00:40 +0000 (00:00 +0000)]
Run spindumps on timeout on iOS 9 Simulator Release WK2 (Tests)
https://bugs.webkit.org/show_bug.cgi?id=161699

Reviewed by Alexey Proskuryakov.

This change does not have testing associated with it because the testing infrastructure does not exists, we cannot currently mock build-bot variables.

* BuildSlaveSupport/build.webkit.org-config/master.cfg:
(RunWebKitTests): Enable sample on timeout for everything.
(RunWebKitTests.start): Disable sample on timeout for everything except iOS 9 WK2 release simulators.

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

4 years agoExpose Apple Pencil input to testing system
dino@apple.com [Wed, 7 Sep 2016 23:32:08 +0000 (23:32 +0000)]
Expose Apple Pencil input to testing system
https://bugs.webkit.org/show_bug.cgi?id=161670
<rdar://problem/28183327>

Reviewed by Simon Fraser.

Tools:

Add API to UIScriptController that allows a test to emulate
stylus input, such as from the Apple Pencil.

The code is only implemented for WebKitTestRunner.

There are also four new tests that ensure an Apple Pencil
operates similarly to a regular touch. The main difference
is that you can't have multiple touches when using an Apple Pencil.

* DumpRenderTree/ios/UIScriptControllerIOS.mm: New methods. Empty implementations.
(WTR::UIScriptController::stylusDownAtPoint):
(WTR::UIScriptController::stylusMoveToPoint):
(WTR::UIScriptController::stylusUpAtPoint):
(WTR::UIScriptController::stylusTapAtPoint):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: New methods.
* TestRunnerShared/UIScriptContext/UIScriptController.cpp: Empty implementations.
(WTR::UIScriptController::stylusDownAtPoint):
(WTR::UIScriptController::stylusMoveToPoint):
(WTR::UIScriptController::stylusUpAtPoint):
(WTR::UIScriptController::stylusTapAtPoint):
* TestRunnerShared/UIScriptContext/UIScriptController.h:

* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm: New StylusEvent types. Add some properties
to SyntheticEventDigitizerInfo.
(-[HIDEventGenerator _createIOHIDEventType:]): Add support for StylusEvent types.
(-[HIDEventGenerator touchDownAtPoints:touchCount:]): Clear any old stylus info.
(-[HIDEventGenerator stylusDownAtPoint:azimuthAngle:altitudeAngle:pressure:]):
(-[HIDEventGenerator stylusMoveToPoint:azimuthAngle:altitudeAngle:pressure:]):
(-[HIDEventGenerator stylusUpAtPoint:]):
(-[HIDEventGenerator stylusDownAtPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
(-[HIDEventGenerator stylusMoveToPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
(-[HIDEventGenerator stylusUpAtPoint:completionBlock:]):
(-[HIDEventGenerator stylusTapAtPoint:azimuthAngle:altitudeAngle:pressure:completionBlock:]):
* WebKitTestRunner/ios/IOKitSPI.h: Add new include, and new SPI.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm: Calls into the HIDEventGenerator for the new API.
(WTR::UIScriptController::stylusDownAtPoint):
(WTR::UIScriptController::stylusMoveToPoint):
(WTR::UIScriptController::stylusUpAtPoint):
(WTR::UIScriptController::stylusTapAtPoint):

LayoutTests:

Four new tests that make sure Apple Pencil's register the correct
touch* style events.

* fast/events/touch/ios/pencil-down-gives-touchstart-expected.txt: Added.
* fast/events/touch/ios/pencil-down-gives-touchstart.html: Added.
* fast/events/touch/ios/pencil-move-gives-touchmove-expected.txt: Added.
* fast/events/touch/ios/pencil-move-gives-touchmove.html: Added.
* fast/events/touch/ios/pencil-tap-gives-touchstart-and-touchend-expected.txt: Added.
* fast/events/touch/ios/pencil-tap-gives-touchstart-and-touchend.html: Added.
* fast/events/touch/ios/pencil-up-gives-touchend-expected.txt: Added.
* fast/events/touch/ios/pencil-up-gives-touchend.html: Added.

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

4 years agoWeb Inspector: Remove always false case in Debugger
commit-queue@webkit.org [Wed, 7 Sep 2016 23:31:37 +0000 (23:31 +0000)]
Web Inspector: Remove always false case in Debugger
https://bugs.webkit.org/show_bug.cgi?id=161717

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-09-07
Reviewed by Brian Burg.

* debugger/Debugger.cpp:
(JSC::Debugger::didExecuteProgram):
We would have earlier returned a few statements ago if this case was true.
And we would have crashed in the previous statement if this case was true.

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

4 years agoUnreviewed, build fix after r205569
utatane.tea@gmail.com [Wed, 7 Sep 2016 22:36:05 +0000 (22:36 +0000)]
Unreviewed, build fix after r205569

Tweak CMakeLists.txt

* CMakeLists.txt:

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

4 years agoAdd CatchScope and force all exception checks to be via ThrowScope or CatchScope.
mark.lam@apple.com [Wed, 7 Sep 2016 22:10:50 +0000 (22:10 +0000)]
Add CatchScope and force all exception checks to be via ThrowScope or CatchScope.
https://bugs.webkit.org/show_bug.cgi?id=161498

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch refactors the ThrowScope class, and introduces a base ExceptionScope
that ThrowScope extends.  A CatchScope which extends the ExceptionScope is also
introduced.

ENABLE(THROW_SCOPE_VERIFICATION) is now renamed to ENABLE(EXCEPTION_SCOPE_VERIFICATION)
which is a more suitable name now.

Note: exception scope verification is still disabled by default.  There are still
many places that need to be fixed up or re-expressed in a way that is friendly
to the verification.  I'll address those in subsequent patches.

After this patch, the code will statically enforce that:
1. all calls to throwException() go through a ThrowScope.
2. all calls to clearException() go through a CatchScope.
3. all exception checks go through an ExceptionScope in the form of a ThrowScope
   or CatchScope.

A Summary of how to use ExceptionScopes
=======================================
1. If a function can throw a JS exception, it should declare a ThrowScope at the
   top of the function (as early as possible).

2. If a function can clear JS exceptions, it should declare a CatchScope at the
   top of the function (as early as possible).

Declaring a ThrowScope in a function means that the function may throw an exception
that its caller will have to handle.  Declaring a CatchScope in a function means
that the function intends to clear pending exceptions before returning to its
caller.

For more details, see the notes below.

Everything you may want to know about ExceptionScopes
=====================================================
ExceptionScope verification works to simulate exception throws and detect cases
where exception checks are missing.  The notes below will cover:

    1. The VM::m_needExceptionCheck bit
    2. ThrowScopes and CatchScopes
    3. Verification of needed exception checks
    3. Checking Exceptions
    4. Simulating throws
    5. Using ThrowScope::release()
    6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()
    7. Checking exceptions by checking callee results
    8. Debugging verification errors

1. The VM::m_needExceptionCheck bit

   The VM has a m_needExceptionCheck bit that indicates when an exception may be
   thrown.  You can think of the m_needExceptionCheck bit being set as a simulated
   throw.

2. ThrowScopes and CatchScopes

   Only ThrowScopes may throwException.  Only CatchScopes may catchException.

   Every throw site must declare a ThrowScope instance using DECLARE_THROW_SCOPE
   at the top of its function (as early as possible) e.g.

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            ...
            throwException(exec, scope, ...);
        }

   Note: by convention, every throw helper function must take a ThrowScope argument
   instead of instantiating its own ThrowScope.  This allows the throw to be
   attributed to the client code rather than the throw helper itself.

   Every catch site (i.e. a site that calls clearException()) must declare a
   CatchScope instance using DECLARE_CATCH_SCOPE at the top of its function.

   If a function can both throw or clear exceptions, then the ThrowScope should
   be declared first so that it can simulate a throw to the function's caller.

   Note: ThrowScope and CatchScope both extend ExceptionScope so that ThrowScopes
   can be aware if there's an enclosing CatchScope between it and the point where
   C++ code returns to JS code.  This is needed to determine if the ThrowScope
   should simulate a re-throw or not.  See (4) below for more details on returning
   to JS code.

3. Verification of needed exception checks

   a. On construction, each ThrowScope and CatchScope will verify that
      VM::m_needExceptionCheck is not set.

      This ensures that the caller of the current function has checked for exceptions
      where needed before doing more work which lead to calling the current function.

   b. On destruction, each ThrowScope and CatchScope will verify that
      VM::m_needExceptionCheck is not set. This verification will be skipped if
      the ThrowScope has been released (see (5) below).

      This ensures that the function that owns this exception scope is not missing
      any exception checks before returning.

   c. When throwing an exception, the ThrowScope will verify that VM::m_needExceptionCheck
      is not already set, unless it's been ask to rethrow the same Exception object.

4. Simulating throws

   Throws are simulated by setting the m_needExceptionCheck bit.

   The bit will only be set in the ThrowScope destructor except when the ThrowScope
   detects the caller is a LLInt or JIT function.  LLInt or JIT functions will always
   check for exceptions after a host C++ function returns to it.  However, they will
   not clear the m_needExceptionCheck bit.

   Hence, if the ThrowScope destructor detects the caller is a LLInt or JIT function,
   it will just skip the setting of the bit.

   Note: it is not needed nor correct to set the m_needExceptionCheck bit in the
   throwException methods.  This is because, in practice, we always return
   immediately after throwing an exception.  It doesn't make sense to set the bit in
   the throw just to have to clear it immediately after before we do verification in
   the ThrowScope destructor.

5. Using ThrowScope::release()

   Calling release() means that the scope is released from its obligation to
   verify the VM::m_needExceptionCheck bit on destruction.

   release() should only be used at the bottom of a function if:

   a. This function is going to let its caller check and handle the exception, e.g.

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            auto result = goo(); // may throw.

            ... // Code that will are not affected by a pending exceptions.

            scope.release(); // tell the ThrowScope that the caller will handle the exception.
            return result;
        }

   b. This function is going to do a tail call that may throw.

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);
            ...
            scope.release(); // tell the ThrowScope that the caller will handle the exception.
            return goo(); // may throw.
        }

      release() should not be used in code paths that branch. For example:

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            auto result = goo1(); // may throw.
            scope.release(); // WRONG !!! Don't do this.
            if (result)
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

    The above will result in a verification error in goo2()'s ThrowScope.  The
    proper way to fix this verification is to do either (6) or (7) below.

 6. Checking exceptions with ThrowScope::exception() / CatchScope::exception()

    ThrowScope/CatchScope::exception() returns the thrown Exception object if
    there is one pending.  Else, it returns nullptr.

    It also clears the m_needExceptionCheck bit thereby indicating that we've
    satisfied the needed exception check.  For example,

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            auto result = goo1(); // may throw.
            if (scope.exception())
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

    But sometimes, for optimization reasons, we may choose to test the result of
    the callee function instead doing a load of the VM exception value.  See (7)
    below.

 7. Checking exceptions by checking callee results

    This approach should only be applied when it makes a difference to performance.
    If we need to do this, we should add an ASSERT() that invokes the scope's
    exception() method to verify the result.  Since exception scope verification
    is only done on DEBUG builds, this ASSERT will satisfy the verification
    requirements without impacting performance.  For example,

        void foo(...)
        {
            auto scope = DECLARE_THROW_SCOPE(vm);

            bool failed = goo1(); // may throw.
            ASSERT(!!scope.exception() == failed)
            if (failed)
                return;

            result = goo2(); // may throw.
            ...
            return result;
        }

 8. Debugging verification errors

    a. When verification fails, you will see a message followed by an assertion
       failure.  For example:

    ERROR: Unchecked JS exception:
        This scope can throw a JS exception: setUpCall @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1245
            (ExceptionScope::m_recursionDepth was ...)
        But the exception was unchecked as of this scope: varargsSetup @ /Volumes/Data/ws6/OpenSource/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp:1398
            (ExceptionScope::m_recursionDepth was ...)
        [ backtrace here ]

       The message tells you that failure was detected at in varargsSetup() at
       LLIntSlowPaths.cpp line 1398, and that the missing exception check should
       have happened somewhere between the call to setUpCall() at LLIntSlowPaths.cpp
       line 1245 and it.

       If that is insufficient information, you can ...

    b. Dump simulated throws

       Re-run the test case with JSC_dumpSimulatedThrows=true.  You will also see
       back traces at each simulated throw.

    c. Narrowing down the source of a simulated throw

       Another technique for narrowing down the source of simulated throws is by
       further dividing a function to smaller regions by separating each region
       with additional local throw scopes.  For example,

        ... // Region 1
        { auto scope = DECLARE_THROW_SCOPE(vm); }
        ... // Region 2
        { auto scope = DECLARE_THROW_SCOPE(vm); }
        ... // Region 3

* API/APIUtils.h:
(handleExceptionIfNeeded):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bindings/ScriptFunctionCall.cpp:
(Deprecated::ScriptFunctionCall::call):
* bindings/ScriptValue.cpp:
(Deprecated::ScriptValue::toString):
* debugger/Debugger.cpp:
(JSC::Debugger::pauseIfNeeded):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* inspector/InjectedScriptManager.cpp:
(Inspector::InjectedScriptManager::createInjectedScript):
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::reportAPIException):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::weakMapEntries):
(Inspector::JSInjectedScriptHost::weakSetEntries):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::extractSourceInformationFromException):
* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
* interpreter/CallFrame.h:
(JSC::ExecState::clearException): Deleted.
(JSC::ExecState::exception): Deleted.
(JSC::ExecState::hadException): Deleted.
(JSC::ExecState::lastException): Deleted.
(JSC::ExecState::clearLastException): Deleted.
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::sizeOfVarargs):
(JSC::notifyDebuggerOfUnwinding):
(JSC::Interpreter::unwind):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::debug):
* interpreter/Interpreter.h:
(JSC::SuspendExceptionScope::SuspendExceptionScope):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::functionsOnStack):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOperations.cpp:
(JSC::getByVal):
* jsc.cpp:
(WTF::ImpureGetter::getOwnPropertySlot):
(GlobalObject::moduleLoaderResolve):
(GlobalObject::moduleLoaderFetch):
(functionCreateElement):
(functionRun):
(functionRunString):
(functionLoad):
(functionLoadString):
(functionReadFile):
(functionCheckSyntax):
(functionSetRandomSeed):
(functionLoadModule):
(functionCreateBuiltin):
(functionCheckModuleSyntax):
(functionGenerateHeapSnapshot):
(functionSamplingProfilerStackTraces):
(dumpException):
(checkUncaughtException):
(runWithScripts):
(runInteractive):
* llint/LLIntExceptions.cpp:
(JSC::LLInt::returnToThrow):
(JSC::LLInt::callToThrow):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::addSequenceProperties):
* profiler/ProfilerCompilation.cpp:
(JSC::Profiler::Compilation::toJS):
* profiler/ProfilerDatabase.cpp:
(JSC::Profiler::Database::toJS):
* profiler/ProfilerOSRExitSite.cpp:
(JSC::Profiler::OSRExitSite::toJS):
* profiler/ProfilerOriginStack.cpp:
(JSC::Profiler::OriginStack::toJS):
* runtime/ArrayPrototype.cpp:
(JSC::speciesConstructArray):
(JSC::shift):
(JSC::unshift):
(JSC::arrayProtoFuncToString):
(JSC::arrayProtoFuncToLocaleString):
(JSC::slowJoin):
(JSC::fastJoin):
(JSC::arrayProtoFuncJoin):
(JSC::arrayProtoFuncPop):
(JSC::arrayProtoFuncPush):
(JSC::arrayProtoFuncReverse):
(JSC::arrayProtoFuncShift):
(JSC::arrayProtoFuncSlice):
(JSC::arrayProtoFuncSplice):
(JSC::arrayProtoFuncUnShift):
(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):
(JSC::moveElements):
(JSC::concatAppendOne):
(JSC::arrayProtoPrivateFuncConcatMemcpy):
* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/CallData.cpp:
(JSC::call):
* runtime/CatchScope.cpp: Added.
(JSC::CatchScope::CatchScope):
(JSC::CatchScope::~CatchScope):
* runtime/CatchScope.h: Added.
(JSC::CatchScope::clearException):
(JSC::CatchScope::CatchScope):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/CommonSlowPathsExceptions.cpp:
(JSC::CommonSlowPaths::interpreterThrowInCaller):
* runtime/Completion.cpp:
(JSC::evaluate):
(JSC::rejectPromise):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
* runtime/ConsoleObject.cpp:
(JSC::consoleProtoFuncAssert):
(JSC::consoleProtoFuncProfile):
(JSC::consoleProtoFuncProfileEnd):
(JSC::consoleProtoFuncTakeHeapSnapshot):
(JSC::consoleProtoFuncTime):
(JSC::consoleProtoFuncTimeEnd):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
(JSC::dateParse):
* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToPrimitiveSymbol):
(JSC::dateProtoFuncToJSON):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::sanitizedToString):
* runtime/ErrorPrototype.cpp:
(JSC::errorProtoFuncToString):
* runtime/ExceptionEventLocation.cpp: Added.
(WTF::printInternal):
* runtime/ExceptionEventLocation.h: Copied from Source/JavaScriptCore/runtime/ThrowScopeLocation.h.
(JSC::ExceptionEventLocation::ExceptionEventLocation):
(JSC::ThrowScopeLocation::ThrowScopeLocation): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/ExceptionScope.cpp: Added.
(JSC::ExceptionScope::ExceptionScope):
(JSC::ExceptionScope::~ExceptionScope):
* runtime/ExceptionScope.h: Added.
(JSC::ExceptionScope::vm):
(JSC::ExceptionScope::recursionDepth):
(JSC::ExceptionScope::exception):
(JSC::ExceptionScope::ExceptionScope):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncBind):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::copyToArguments):
* runtime/GetterSetter.cpp:
(JSC::callGetter):
* runtime/InspectorInstrumentationObject.cpp:
(JSC::inspectorInstrumentationObjectLog):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::createCollator):
(JSC::IntlCollator::resolvedOptions):
* runtime/IntlCollatorConstructor.cpp:
(JSC::constructIntlCollator):
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf):
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorFuncCompare):
(JSC::IntlCollatorPrototypeGetterCompare):
* runtime/IntlDateTimeFormat.cpp:
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::resolvedOptions):
(JSC::IntlDateTimeFormat::format):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::constructIntlDateTimeFormat):
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatFuncFormatDateTime):
(JSC::IntlDateTimeFormatPrototypeGetterFormat):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::createNumberFormat):
(JSC::IntlNumberFormat::resolvedOptions):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::constructIntlNumberFormat):
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatFuncFormatNumber):
(JSC::IntlNumberFormatPrototypeGetterFormat):
* runtime/IntlObject.cpp:
(JSC::intlBooleanOption):
(JSC::intlStringOption):
(JSC::intlNumberOption):
(JSC::canonicalizeLocaleList):
(JSC::supportedLocales):
* runtime/IntlObjectInlines.h:
(JSC::constructIntlInstanceWithWorkaroundForLegacyIntlConstructor):
* runtime/IteratorOperations.cpp:
(JSC::iteratorNext):
(JSC::iteratorStep):
(JSC::iteratorClose):
(JSC::iteratorForIterable):
* runtime/IteratorOperations.h:
(JSC::forEachInIterable):
* runtime/JSArray.cpp:
(JSC::JSArray::pop):
(JSC::JSArray::push):
(JSC::JSArray::copyToArguments):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::arrayBufferProtoFuncSlice):
* runtime/JSArrayInlines.h:
(JSC::getLength):
(JSC::toLength):
* runtime/JSBoundFunction.cpp:
(JSC::getBoundFunctionStructure):
(JSC::JSBoundFunction::create):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::putToPrimitiveByIndex):
(JSC::JSValue::toStringSlowCase):
* runtime/JSCJSValueInlines.h:
(JSC::toPreferredPrimitiveType):
(JSC::JSValue::getPropertySlot):
(JSC::JSValue::equalSlowCaseInline):
* runtime/JSDataViewPrototype.cpp:
(JSC::getData):
(JSC::setData):
* runtime/JSFunction.cpp:
(JSC::JSFunction::setFunctionName):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::setIndex):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::speciesConstruct):
(JSC::genericTypedArrayViewProtoFuncCopyWithin):
(JSC::genericTypedArrayViewProtoFuncIncludes):
(JSC::genericTypedArrayViewProtoFuncIndexOf):
(JSC::genericTypedArrayViewProtoFuncJoin):
(JSC::genericTypedArrayViewProtoFuncLastIndexOf):
(JSC::genericTypedArrayViewProtoFuncSlice):
(JSC::genericTypedArrayViewPrivateFuncSubarrayCreate):
* runtime/JSGlobalObject.h:
(JSC::constructEmptyArray):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval):
* runtime/JSJob.cpp:
(JSC::JSJobMicrotask::run):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::getOwnPropertySlot):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::fetch):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):
(JSC::JSModuleNamespaceObject::getOwnPropertySlot):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):
(JSC::Stringifier::stringify):
(JSC::Stringifier::toJSON):
(JSC::Stringifier::appendStringifiedValue):
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
(JSC::JSONProtoFuncParse):
* runtime/JSObject.cpp:
(JSC::ordinarySetSlow):
(JSC::JSObject::setPrototypeWithCycleCheck):
(JSC::callToPrimitiveFunction):
(JSC::JSObject::ordinaryToPrimitive):
(JSC::JSObject::defaultHasInstance):
(JSC::JSObject::getPropertyNames):
(JSC::JSObject::toNumber):
(JSC::JSObject::toString):
(JSC::JSObject::defineOwnNonIndexProperty):
(JSC::JSObject::getGenericPropertyNames):
(JSC::JSObject::getMethod):
* runtime/JSObjectInlines.h:
(JSC::createListFromArrayLike):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::getNonIndexPropertySlot):
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::create):
* runtime/JSScope.cpp:
(JSC::isUnscopable):
(JSC::JSScope::resolve):
* runtime/JSString.cpp:
(JSC::JSString::equalSlowCase):
* runtime/JSStringJoiner.cpp:
(JSC::JSStringJoiner::join):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/MathObject.cpp:
(JSC::mathProtoFuncClz32):
(JSC::mathProtoFuncHypot):
(JSC::mathProtoFuncIMul):
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::constructWithNumberConstructor):
* runtime/ObjectConstructor.cpp:
(JSC::constructObject):
(JSC::objectConstructorGetPrototypeOf):
(JSC::objectConstructorSetPrototypeOf):
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorGetOwnPropertyDescriptors):
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorGetOwnPropertySymbols):
(JSC::objectConstructorKeys):
(JSC::ownEnumerablePropertyKeys):
(JSC::toPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
(JSC::defineProperties):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
(JSC::objectConstructorIsExtensible):
(JSC::ownPropertyKeys):
* runtime/ObjectConstructor.h:
(JSC::constructObjectFromPropertyDescriptor):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncIsPrototypeOf):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
(JSC::objectProtoFuncToLocaleString):
(JSC::objectProtoFuncToString):
* runtime/Operations.cpp:
(JSC::jsAddSlowCase):
* runtime/Options.h:
* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::slowGetterSetter):
* runtime/ProxyConstructor.cpp:
(JSC::makeRevocableProxy):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::toStringName):
(JSC::performProxyGet):
(JSC::ProxyObject::performGet):
(JSC::ProxyObject::performInternalMethodGetOwnProperty):
(JSC::ProxyObject::performHasProperty):
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::putByIndexCommon):
(JSC::performProxyCall):
(JSC::performProxyConstruct):
(JSC::ProxyObject::performDelete):
(JSC::ProxyObject::performPreventExtensions):
(JSC::ProxyObject::performIsExtensible):
(JSC::ProxyObject::performDefineOwnProperty):
(JSC::ProxyObject::performGetOwnPropertyNames):
(JSC::ProxyObject::performSetPrototype):
(JSC::ProxyObject::performGetPrototype):
* runtime/ReflectObject.cpp:
(JSC::reflectObjectConstruct):
(JSC::reflectObjectDefineProperty):
(JSC::reflectObjectGet):
(JSC::reflectObjectGetOwnPropertyDescriptor):
(JSC::reflectObjectIsExtensible):
(JSC::reflectObjectPreventExtensions):
(JSC::reflectObjectSet):
(JSC::reflectObjectSetPrototypeOf):
* runtime/RegExpConstructor.cpp:
(JSC::toFlags):
(JSC::regExpCreate):
(JSC::constructRegExp):
* runtime/RegExpConstructor.h:
(JSC::isRegExp):
* runtime/RegExpObject.cpp:
(JSC::collectMatches):
(JSC::RegExpObject::matchGlobal):
* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncCompile):
(JSC::flagsString):
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterFlags):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSplitFast):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::stringFromCodePoint):
(JSC::constructWithStringConstructor):
* runtime/StringObject.cpp:
(JSC::StringObject::defineOwnProperty):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):
(JSC::operationStringProtoFuncReplaceRegExpEmptyStr):
(JSC::replaceUsingStringSearch):
(JSC::replace):
(JSC::stringProtoFuncReplaceUsingRegExp):
(JSC::stringProtoFuncReplaceUsingStringSearch):
(JSC::stringProtoFuncCodePointAt):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::stringProtoFuncSubstring):
(JSC::stringProtoFuncLocaleCompare):
(JSC::toLocaleCase):
(JSC::stringProtoFuncBig):
(JSC::stringProtoFuncSmall):
(JSC::stringProtoFuncBlink):
(JSC::stringProtoFuncBold):
(JSC::stringProtoFuncFixed):
(JSC::stringProtoFuncItalics):
(JSC::stringProtoFuncStrike):
(JSC::stringProtoFuncSub):
(JSC::stringProtoFuncSup):
(JSC::stringProtoFuncFontcolor):
(JSC::stringProtoFuncFontsize):
(JSC::stringProtoFuncAnchor):
(JSC::stringProtoFuncLink):
(JSC::trimString):
(JSC::stringProtoFuncStartsWith):
(JSC::stringProtoFuncEndsWith):
(JSC::stringIncludesImpl):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::stringProtoFuncNormalize):
* runtime/SymbolConstructor.cpp:
(JSC::symbolConstructorFor):
* runtime/TemplateRegistry.cpp:
(JSC::TemplateRegistry::getTemplateObject):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::ThrowScope):
(JSC::ThrowScope::~ThrowScope):
(JSC::ThrowScope::throwException):
(JSC::ThrowScope::simulateThrow):
(JSC::ThrowScope::printIfNeedCheck): Deleted.
(JSC::ThrowScope::verifyExceptionCheckNeedIsSatisfied): Deleted.
* runtime/ThrowScope.h:
(JSC::ThrowScope::release):
(JSC::ThrowScope::ThrowScope):
(JSC::ThrowScope::throwException):
(JSC::ThrowScope::vm): Deleted.
(JSC::ThrowScope::exception): Deleted.
* runtime/ThrowScopeLocation.h: Removed.
* runtime/VM.cpp:
(JSC::VM::verifyExceptionCheckNeedIsSatisfied):
* runtime/VM.h:
(JSC::VM::exception):
(JSC::VM::clearException):
(JSC::VM::setException): Deleted.
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):

Source/WebCore:

No new test because there is no behavior change in general except for 1 bug fix.
That bug is already caught by existing tests with the introduction of the CatchScope.

Fixes a bug in JSEventListener::handleEvent() where the exception thrown from
a failed attempt to get the handleEvent callback is not handled.

* ForwardingHeaders/runtime/CatchScope.h: Added.
* Modules/encryptedmedia/CDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get):
* bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
(WebCore::JSApplePaySession::completeShippingContactSelection):
(WebCore::JSApplePaySession::completePaymentMethodSelection):
* bindings/js/JSAudioTrackCustom.cpp:
(WebCore::JSAudioTrack::setKind):
(WebCore::JSAudioTrack::setLanguage):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCommandLineAPIHostCustom.cpp:
(WebCore::getJSListenerFunctions):
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
(WebCore::getHashAlgorithm):
(WebCore::createAesCbcParams):
(WebCore::createAesKeyGenParams):
(WebCore::createHmacParams):
(WebCore::createHmacKeyParams):
(WebCore::createRsaKeyGenParams):
(WebCore::createRsaOaepParams):
(WebCore::createRsaSsaParams):
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::getJSArrayFromJSON):
(WebCore::getStringFromJSON):
(WebCore::getBooleanFromJSON):
(WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
(WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
(WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
(WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
(WebCore::JSCryptoKeySerializationJWK::keyData):
(WebCore::buildJSONForRSAComponents):
(WebCore::addUsagesToJSON):
(WebCore::JSCryptoKeySerializationJWK::serialize):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElement):
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
(WebCore::JSCustomElementRegistry::define):
(WebCore::whenDefinedPromise):
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToUSVString):
(WebCore::reportException):
(WebCore::reportCurrentException):
(WebCore::setDOMException):
(WebCore::hasIteratorMethod):
(WebCore::toSmallerInt):
(WebCore::toSmallerUInt):
(WebCore::toInt32EnforceRange):
(WebCore::toUInt32EnforceRange):
(WebCore::toInt64EnforceRange):
(WebCore::toUInt64EnforceRange):
(WebCore::throwNotSupportedError):
(WebCore::throwInvalidStateError):
(WebCore::throwSecurityError):
* bindings/js/JSDOMBinding.h:
(WebCore::toJSSequence):
(WebCore::toJS):
(WebCore::jsFrozenArray):
(WebCore::NativeValueTraits<String>::nativeValue):
(WebCore::NativeValueTraits<unsigned>::nativeValue):
(WebCore::NativeValueTraits<float>::nativeValue):
(WebCore::NativeValueTraits<double>::nativeValue):
(WebCore::toNativeArray):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::makeThisTypeErrorForBuiltins):
(WebCore::makeGetterTypeErrorForBuiltins):
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
* bindings/js/JSDOMPromise.cpp:
(WebCore::rejectPromiseWithExceptionIfAny):
* bindings/js/JSDOMPromise.h:
(WebCore::callPromiseFunction):
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowMicrotaskCallback::call):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setLocation):
(WebCore::JSDOMWindow::open):
(WebCore::JSDOMWindow::showModalDialog):
(WebCore::handlePostMessage):
(WebCore::JSDOMWindow::setTimeout):
(WebCore::JSDOMWindow::setInterval):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::readAccelerationArgument):
(WebCore::readRotationRateArgument):
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::tryGetProperty):
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::tryGetPropertyAndResult):
* bindings/js/JSDocumentCustom.cpp:
(WebCore::JSDocument::getCSSCanvasContext):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::createPositionOptions):
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::get3DContextAttributes):
(WebCore::JSHTMLCanvasElement::getContext):
(WebCore::JSHTMLCanvasElement::probablySupportsContext):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSIDBDatabaseCustom.cpp:
(WebCore::JSIDBDatabase::createObjectStore):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState::linkAndEvaluateModule):
(WebCore::JSMainThreadExecState::~JSMainThreadExecState):
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::fillMessagePortArray):
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
* bindings/js/JSMockContentFilterSettingsCustom.cpp:
(WebCore::JSMockContentFilterSettings::setDecisionPoint):
(WebCore::toDecision):
(WebCore::JSMockContentFilterSettings::setDecision):
(WebCore::JSMockContentFilterSettings::setUnblockRequestDecision):
* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::acceptNode):
* bindings/js/JSNodeOrString.cpp:
(WebCore::toNodeOrStringVector):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSSVGLengthCustom.cpp:
(WebCore::JSSVGLength::convertToSpecifiedUnits):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::getOwnPropertyNames):
(WebCore::JSStorage::putDelegate):
* bindings/js/JSTextTrackCustom.cpp:
(WebCore::JSTextTrack::setLanguage):
* bindings/js/JSVideoTrackCustom.cpp:
(WebCore::JSVideoTrack::setKind):
(WebCore::JSVideoTrack::setLanguage):
* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getExtension):
(WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
(WebCore::JSWebGLRenderingContextBase::getParameter):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::toVector):
(WebCore::dataFunctionf):
(WebCore::dataFunctionMatrix):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::createAlgorithmFromJSValue):
(WebCore::cryptoKeyFormatFromJSValue):
(WebCore::cryptoKeyUsagesFromJSValue):
(WebCore::JSWebKitSubtleCrypto::encrypt):
(WebCore::JSWebKitSubtleCrypto::decrypt):
(WebCore::JSWebKitSubtleCrypto::sign):
(WebCore::JSWebKitSubtleCrypto::verify):
(WebCore::JSWebKitSubtleCrypto::digest):
(WebCore::JSWebKitSubtleCrypto::generateKey):
(WebCore::importKey):
(WebCore::JSWebKitSubtleCrypto::importKey):
(WebCore::exportKey):
(WebCore::JSWebKitSubtleCrypto::exportKey):
(WebCore::JSWebKitSubtleCrypto::wrapKey):
(WebCore::JSWebKitSubtleCrypto::unwrapKey):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
(WebCore::JSWorkerGlobalScope::setTimeout):
(WebCore::JSWorkerGlobalScope::setInterval):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
(WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::create):
* bindings/js/ScriptGlobalObject.cpp:
(WebCore::ScriptGlobalObject::set):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneBase::shouldTerminate):
(WebCore::CloneDeserializer::deserialize):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::evaluate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
(GenerateImplementation):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::jsTestEventTargetPrototypeFunctionItem):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::setJSTestGlobalObjectRegularAttribute):
(WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
(WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
(WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
(WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
(WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
(WebCore::setJSTestInterfaceImplementsStr2):
(WebCore::setJSTestInterfaceImplementsStr3):
(WebCore::setJSTestInterfaceImplementsNode):
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalStr3):
(WebCore::setJSTestInterfaceSupplementalNode):
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::setJSTestNodeName):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
(WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::setJSTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::setJSTestObjEnumAttr):
(WebCore::setJSTestObjByteAttr):
(WebCore::setJSTestObjOctetAttr):
(WebCore::setJSTestObjShortAttr):
(WebCore::setJSTestObjClampedShortAttr):
(WebCore::setJSTestObjEnforceRangeShortAttr):
(WebCore::setJSTestObjUnsignedShortAttr):
(WebCore::setJSTestObjLongAttr):
(WebCore::setJSTestObjLongLongAttr):
(WebCore::setJSTestObjUnsignedLongLongAttr):
(WebCore::setJSTestObjStringAttr):
(WebCore::setJSTestObjUsvstringAttr):
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjTestNullableObjAttr):
(WebCore::setJSTestObjLenientTestObjAttr):
(WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
(WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
(WebCore::setJSTestObjImplementationEnumAttr):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedStringAttr):
(WebCore::setJSTestObjReflectedUSVStringAttr):
(WebCore::setJSTestObjReflectedIntegralAttr):
(WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedURLAttr):
(WebCore::setJSTestObjReflectedUSVURLAttr):
(WebCore::setJSTestObjReflectedCustomIntegralAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::setJSTestObjReflectedCustomURLAttr):
(WebCore::setJSTestObjEnabledAtRuntimeAttribute):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjAttrWithGetterException):
(WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithSetterException):
(WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
(WebCore::setJSTestObjStringAttrWithGetterException):
(WebCore::setJSTestObjStringAttrWithSetterException):
(WebCore::setJSTestObjCustomAttr):
(WebCore::setJSTestObjOnfoo):
(WebCore::setJSTestObjOnwebkitfoo):
(WebCore::setJSTestObjWithScriptStateAttribute):
(WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
(WebCore::setJSTestObjConditionalAttr1):
(WebCore::setJSTestObjConditionalAttr2):
(WebCore::setJSTestObjConditionalAttr3):
(WebCore::setJSTestObjConditionalAttr4Constructor):
(WebCore::setJSTestObjConditionalAttr5Constructor):
(WebCore::setJSTestObjConditionalAttr6Constructor):
(WebCore::setJSTestObjAnyAttribute):
(WebCore::setJSTestObjMutablePoint):
(WebCore::setJSTestObjImmutablePoint):
(WebCore::setJSTestObjStrawberry):
(WebCore::setJSTestObjId):
(WebCore::setJSTestObjReplaceableAttribute):
(WebCore::setJSTestObjNullableLongSettableAttribute):
(WebCore::setJSTestObjNullableStringSettableAttribute):
(WebCore::setJSTestObjNullableUSVStringSettableAttribute):
(WebCore::setJSTestObjNullableStringValue):
(WebCore::setJSTestObjAttributeWithReservedEnumType):
(WebCore::setJSTestObjPutForwardsAttribute):
(WebCore::setJSTestObjPutForwardsNullableAttribute):
(WebCore::setJSTestObjStringifierAttribute):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
(WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
(WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
(WebCore::jsTestObjPrototypeFunctionSerializedValue):
(WebCore::jsTestObjPrototypeFunctionPrivateMethod):
(WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
(WebCore::jsTestObjPrototypeFunctionAddEventListener):
(WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
(WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
(WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
(WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
(WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
(WebCore::jsTestObjPrototypeFunctionGetElementById):
(WebCore::jsTestObjPrototypeFunctionConvert3):
(WebCore::jsTestObjPrototypeFunctionConvert4):
(WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
(WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
(WebCore::jsTestObjPrototypeFunctionAny):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
(WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
(WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
(WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
(WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors2):
(WebCore::constructJSTestOverloadedConstructors4):
(WebCore::constructJSTestOverloadedConstructors5):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::constructJSTestOverloadedConstructorsWithSequence1):
(WebCore::constructJSTestOverloadedConstructorsWithSequence2):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
(WebCore::setJSTestTypedefsUnsignedLongLongAttr):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
(WebCore::setJSTestTypedefsAttrWithGetterException):
(WebCore::setJSTestTypedefsAttrWithSetterException):
(WebCore::setJSTestTypedefsStringAttrWithGetterException):
(WebCore::setJSTestTypedefsStringAttrWithSetterException):
(WebCore::jsTestTypedefsPrototypeFunctionFunc):
(WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
(WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
(WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
(WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
(WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
* bridge/NP_jsobject.cpp:
(_NPN_InvokeDefault):
(_NPN_Invoke):
(_NPN_Evaluate):
(_NPN_GetProperty):
(_NPN_SetProperty):
(_NPN_RemoveProperty):
(_NPN_HasProperty):
(_NPN_HasMethod):
(_NPN_Enumerate):
(_NPN_Construct):
* bridge/c/c_instance.cpp:
(JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
* bridge/objc/WebScriptObject.mm:
(WebCore::addExceptionToConsole):
(-[WebScriptObject callWebScriptMethod:withArguments:]):
(-[WebScriptObject evaluateWebScript:]):
(-[WebScriptObject setValue:forKey:]):
(-[WebScriptObject valueForKey:]):
(-[WebScriptObject removeWebScriptKey:]):
(-[WebScriptObject hasWebScriptKey:]):
(-[WebScriptObject webScriptValueAtIndex:]):
(-[WebScriptObject setWebScriptValueAtIndex:value:]):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList):
(WebCore::ContentExtensions::getTypeFlags):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadEncodedRules):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::evaluate):
(WebKit::NetscapePluginInstanceProxy::invoke):
(WebKit::NetscapePluginInstanceProxy::invokeDefault):
(WebKit::NetscapePluginInstanceProxy::construct):
(WebKit::NetscapePluginInstanceProxy::getProperty):
(WebKit::NetscapePluginInstanceProxy::setProperty):
(WebKit::NetscapePluginInstanceProxy::removeProperty):
(WebKit::NetscapePluginInstanceProxy::hasProperty):
(WebKit::NetscapePluginInstanceProxy::hasMethod):
(WebKit::NetscapePluginInstanceProxy::enumerate):
* WebView/WebView.mm:
(aeDescFromJSValue):

Source/WebKit/win:

* Plugins/PluginPackage.cpp:
(WebCore::NPN_Evaluate):
(WebCore::NPN_Invoke):

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::hasMethod):
(WebKit::NPJSObject::hasProperty):
(WebKit::NPJSObject::getProperty):
(WebKit::NPJSObject::setProperty):
(WebKit::NPJSObject::removeProperty):
(WebKit::NPJSObject::construct):
(WebKit::NPJSObject::invoke):

Source/WTF:

* wtf/Platform.h:

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

4 years ago[INTL] some valid language tags cause errors in Intl constructors
commit-queue@webkit.org [Wed, 7 Sep 2016 22:01:39 +0000 (22:01 +0000)]
[INTL] some valid language tags cause errors in Intl constructors
https://bugs.webkit.org/show_bug.cgi?id=161672

Patch by Andy VanWagoner <thetalecrafter@gmail.com> on 2016-09-07
Reviewed by Mark Lam.

Source/JavaScriptCore:

Fix private use tag parsing to match spec, allowing single character parts.
https://www.rfc-editor.org/rfc/bcp/bcp47.txt

```
privateuse    = "x" 1*("-" (1*8alphanum))
```

* runtime/IntlObject.cpp:
(JSC::privateUseLangTag): Allow singleton parts in private use tag.

LayoutTests:

Add list of valid language tags that should not throw from test262.

* js/intl-collator-expected.txt:
* js/intl-datetimeformat-expected.txt:
* js/intl-numberformat-expected.txt:
* js/script-tests/intl-collator.js:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:

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

4 years ago[JSC] Remove a couple of useless forward declaration
commit-queue@webkit.org [Wed, 7 Sep 2016 21:17:27 +0000 (21:17 +0000)]
[JSC] Remove a couple of useless forward declaration
https://bugs.webkit.org/show_bug.cgi?id=161676

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-09-07
Reviewed by Mark Lam.

JITMathICForwards.h should take care of declarating the Math ICs.

* bytecode/CodeBlock.h:
* jit/JITOperations.h:

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