WebKit-https.git
3 years agoRemove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
commit-queue@webkit.org [Mon, 14 Mar 2016 04:52:59 +0000 (04:52 +0000)]
Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
https://bugs.webkit.org/show_bug.cgi?id=155417

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-13
Reviewed by Yusuke Suzuki.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parsePrimaryExpression): Deleted.
(JSC::Parser<LexerType>::parseMemberExpression): Deleted.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props:
* win/tools/vsprops/FeatureDefinesCairo.props:

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

3 years agoImplement unprivileged execCommand("copy") and execCommand("cut")
weinig@apple.com [Mon, 14 Mar 2016 04:43:58 +0000 (04:43 +0000)]
Implement unprivileged execCommand("copy") and execCommand("cut")
<rdar://problem/24354406>
https://bugs.webkit.org/show_bug.cgi?id=146336

Reviewed by Dean Jackson.

Source/WebCore:

Test: editing/execCommand/clipboard-access-with-user-gesture.html

* WebCore.xcodeproj/project.pbxproj:
Add new files.

* editing/ClipboardAccessPolicy.h:
Added.

* editing/EditorCommand.cpp:
(WebCore::defaultValueForSupportedCopyCut):
(WebCore::supportedCopyCut):
Match other browsers and allow the copy and cut commands
to be executed when there is a user gesture.

* page/Settings.h:
Add include of ClipboardAccessPolicy.h.

* page/Settings.in:
Add new setting for ClipboardAccessPolicy

LayoutTests:

* editing/execCommand/clipboard-access-with-user-gesture-expected.txt: Added.
* editing/execCommand/clipboard-access-with-user-gesture.html: Added.
Add test for using execCommand("copy") and execCommand("cut") during a user gesture.

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

3 years agoDRT should enable WebGL by default on Mac
dino@apple.com [Mon, 14 Mar 2016 03:58:26 +0000 (03:58 +0000)]
DRT should enable WebGL by default on Mac
https://bugs.webkit.org/show_bug.cgi?id=155419
<rdar://problem/25136981>

Reviewed by Sam Weinig.

Tools:

For some reason, lost in time, WebGL was enabled
by default on trunk, but disabled by default
in DumpRenderTree when using WebKit 1. This
was very annoying, because each test had
an explicit command to enable it.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues): Deleted WebGL line.

LayoutTests:

Update all the tests that no longer have to explicitly
turn WebGL on.

* compositing/backface-visibility/backface-visibility-webgl.html:
* compositing/visibility/visibility-simple-webgl-layer.html:
* compositing/webgl/webgl-background-color.html:
* compositing/webgl/webgl-no-alpha.html:
* compositing/webgl/webgl-nonpremultiplied-blend.html:
* compositing/webgl/webgl-reflection.html:
* compositing/webgl/webgl-repaint.html:
* fast/canvas/webgl/antialiasing-enabled.html:
* fast/canvas/webgl/canvas-resize-crash.html:
* fast/canvas/webgl/css-webkit-canvas-repaint.html:
* fast/canvas/webgl/css-webkit-canvas.html:
* fast/canvas/webgl/out-of-bounds-simulated-vertexAttrib0-drawArrays-expected.txt:
* fast/canvas/webgl/out-of-bounds-simulated-vertexAttrib0-drawArrays.html:
* fast/canvas/webgl/premultiplyalpha-test.html:
* fast/canvas/webgl/resources/webgl-test.js:
(initNonKhronosFramework): Deleted.
* fast/canvas/webgl/texImage2DImageDataTest.html:
* fast/canvas/webgl/toDataURL-unpremultipliedAlpha.html:
* fast/canvas/webgl/unprefixed-context.html:
* fast/canvas/webgl/webgl-composite-modes-repaint.html:
* fast/canvas/webgl/webgl-composite-modes.html:
* fast/canvas/webgl/webgl-drawarrays-crash.html:
* fast/canvas/webgl/webgl-layer-update.html:
* fast/canvas/webgl/webgl-reload-crash.html:
* http/tests/canvas/webgl/origin-clean-conformance.html:
* http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html:
* http/tests/security/webgl-remote-read-remote-image-allowed.html:
* http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html:
* http/tests/webgl/1.0.2/resources/webgl_test_files/conformance/more/unit.js:
* http/tests/webgl/1.0.2/resources/webgl_test_files/resources/js-test-pre.js:
* http/tests/webgl/1.0.2/resources/webkit-webgl-test-harness.js:
* imported/blink/compositing/draws-content/webgl-simple-background.html:
* webgl/1.0.2/resources/webgl_test_files/conformance/more/unit.js:
* webgl/1.0.2/resources/webgl_test_files/resources/js-test-pre.js:
* webgl/1.0.2/resources/webkit-webgl-test-harness.js:
* webgl/1.0.3/resources/webgl_test_files/conformance/more/unit.js:
* webgl/1.0.3/resources/webgl_test_files/resources/js-test-pre.js:
* webgl/1.0.3/resources/webkit-webgl-test-harness.js:
* webgl/resources/webkit-webgl-test-harness.js:

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

3 years agoREGRESSION (r190840): crash inside details element's slotNameFunction
rniwa@webkit.org [Mon, 14 Mar 2016 01:57:17 +0000 (01:57 +0000)]
REGRESSION (r190840): crash inside details element's slotNameFunction
https://bugs.webkit.org/show_bug.cgi?id=155388

Reviewed by Antti Koivisto.

Source/WebCore:

The bug was caused by HTMLDetailsElement::isActiveSummary calling findAssignedSlot with a summary element
inside the shadow tree of the detials element. Fixed it by existing early when the summary element passed
to isActiveSummary is not a direct child of the details element.

Test: fast/html/details-summary-tabindex-crash.html

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::findAssignedSlot): Added an assertion for regression testing.
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::findAssignedSlot): Removed the superfluous call to assignSlots added in r190840.
There is no need to update the slot assignments here (entires in m_slots are added or removed by
addSlotElementByName or removeSlotElementByName and assignSlots only updates assignedNodes in each SlotInfo
which is never used in this function or findFirstSlotElement.
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::isActiveSummary): Fixed the bug.

LayoutTests:

Added a regression test.

* fast/html/details-summary-tabindex-crash-expected.txt: Added.
* fast/html/details-summary-tabindex-crash.html: Added.

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

3 years ago[Mac] Injected bundle in relocatable WebContent service can’t use XPC services from...
mitz@apple.com [Mon, 14 Mar 2016 01:44:08 +0000 (01:44 +0000)]
[Mac] Injected bundle in relocatable WebContent service can’t use XPC services from other relocatable frameworks
https://bugs.webkit.org/show_bug.cgi?id=155414
<rdar://problem/24428418>

Reviewed by Sam Weinig.

* Configurations/DebugRelease.xcconfig:
  Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to NO, because
  engineering builds are ad-hoc signed and therefore can’t have a private entitlement.

* Configurations/WebContent-OSX.entitlements: Added. Includes the XPC domain extension
  entitlement.

* Configurations/WebContentService.xcconfig:
  Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to YES if not already set
  and the framework is relocatable. Set CODE_SIGN_ENTITLEMENTS to the new entitlements file
  if the domain extension entitlement is needed.

* WebKit2.xcodeproj/project.pbxproj: Added reference to new file.

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

3 years ago<attachment> should be a runtime-enabled feature
dino@apple.com [Mon, 14 Mar 2016 01:09:17 +0000 (01:09 +0000)]
<attachment> should be a runtime-enabled feature
https://bugs.webkit.org/show_bug.cgi?id=155413
<rdar://problem/25120753>

Reviewed by Sam Weinig and Anders Carlsson.

Source/WebKit/mac:

Add an internal setting on WebPreferences
to enable the <attachment> element support.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences attachmentElementEnabled]):
(-[WebPreferences setAttachmentElementEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add an internal setting on WKWebViewConfiguration
to enable the <attachment> element support.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _attachmentElementEnabled]):
(-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Now that <attachment> is disabled by default, use an
internal setting to turn them back on test by test.

* fast/attachment/attachment-default-icon-expected.html:
* fast/attachment/attachment-default-icon.html:
* fast/attachment/attachment-disabled-dom.html:
* fast/attachment/attachment-disabled-rendering.html:
* fast/attachment/attachment-dom.html:
* fast/attachment/attachment-folder-icon-expected.html:
* fast/attachment/attachment-folder-icon.html:
* fast/attachment/attachment-icon-from-file-extension-expected.html:
* fast/attachment/attachment-icon-from-file-extension.html:
* fast/attachment/attachment-label-highlight.html:
* fast/attachment/attachment-progress.html:
* fast/attachment/attachment-rendering.html:
* fast/attachment/attachment-select-on-click-inside-user-select-all.html:
* fast/attachment/attachment-select-on-click.html:
* fast/attachment/attachment-subtitle.html:
* fast/attachment/attachment-title.html:
* fast/attachment/attachment-type-attribute-expected.html:
* fast/attachment/attachment-type-attribute.html:
* editing/pasteboard/copy-paste-attachment.html:
* editing/pasteboard/drag-and-drop-attachment-contenteditable.html:

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

3 years agoComposedTreeIterator fails to traverse slots if root is shadow host
antti@apple.com [Sun, 13 Mar 2016 22:54:12 +0000 (22:54 +0000)]
ComposedTreeIterator fails to traverse slots if root is shadow host
https://bugs.webkit.org/show_bug.cgi?id=155407

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/shadow-dom/composed-tree-shadow-subtree.html

* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::ComposedTreeIterator):

    Traversal functions assume m_contextStack is deeper than 1 before they need to enter slot traversal code paths.
    Call initializeContextStack in case of shadow host which does the right thing.

(WebCore::ComposedTreeIterator::traverseSiblingInSlot):
(WebCore::composedTreeAsText):

    Add option to include pointers as debugging aid.

* dom/ComposedTreeIterator.h:
(WebCore::composedTreeChildren):

LayoutTests:

* fast/shadow-dom/composed-tree-shadow-subtree-expected.txt: Added.
* fast/shadow-dom/composed-tree-shadow-subtree.html: Added.

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

3 years agoAdded new port JSCOnly.
commit-queue@webkit.org [Sun, 13 Mar 2016 22:30:13 +0000 (22:30 +0000)]
Added new port JSCOnly.
https://bugs.webkit.org/show_bug.cgi?id=154512

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-13
Reviewed by Michael Catanzaro.

This port allows to build JavaScriptCore engine with minimal
dependencies.

.:

* CMakeLists.txt:
* Source/cmake/OptionsJSCOnly.cmake: Added.

Source/JavaScriptCore:

* PlatformJSCOnly.cmake: Added.

Source/WTF:

* wtf/PlatformJSCOnly.cmake: Added.
* wtf/none/MainThreadNone.cpp: Added.
* wtf/none/RunLoopNone.cpp: Added.
* wtf/none/WorkQueueNone.cpp: Added.

Tools:

* Scripts/build-jsc:
* Scripts/webkitdirs.pm:
(argumentsForConfiguration):
(executableProductDir):
(determinePortName):
(isJSCOnly):
(wrapperPrefixIfNeeded):
(generateBuildSystemFromCMakeProject):
(buildCMakeGeneratedProject):

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

3 years agoTestWebKitAPI: fix linker warnings
ddkilzer@apple.com [Sun, 13 Mar 2016 22:28:11 +0000 (22:28 +0000)]
TestWebKitAPI: fix linker warnings
<http://webkit.org/b/155394>

Reviewed by Darin Adler.

* TestWebKitAPI/CMakeLists.txt:
- Add RefLogger.cpp source file.
- Add other missing cross-platform source files.
- Add FIXMEs about RunLoop.cpp and about missing
  platform-specific source files.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
- Add RefLogger.cpp source file.

* TestWebKitAPI/Counters.cpp:
(DeleterCounter<ConstructorDestructorCounter>::deleterCount):
Move specific declaration here to fix linker warning.
* TestWebKitAPI/Counters.h:
(DeleterCounter<T>::deleterCount): Remove declaration of global
template variable.

* TestWebKitAPI/Tests/WTF/RefLogger.cpp: Added.
(TestWebKitAPI::log): Added.  Move inline definition in
RefLogger.h to here to fix linker warning.

* TestWebKitAPI/Tests/WTF/RefLogger.h:
(TestWebKitAPI::log): Replace inline function with declaration.

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

3 years agoWeb Inspector: REGRESSION: Styles sidebar inline swatches are oddly shaped
commit-queue@webkit.org [Sun, 13 Mar 2016 22:03:44 +0000 (22:03 +0000)]
Web Inspector: REGRESSION: Styles sidebar inline swatches are oddly shaped
https://bugs.webkit.org/show_bug.cgi?id=155410

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-03-13
Reviewed by Timothy Hatcher.

* UserInterface/Views/InlineSwatch.css:
(.inline-swatch):
(.inline-swatch > span):
Added more consistent border-radius with UserInterface/Images/CubicBezier.svg.

* UserInterface/Views/VisualStyleColorPicker.css:
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color):
Made border-radius consistent with the adjacent input field.

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

3 years agoWebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSessi...
weinig@apple.com [Sun, 13 Mar 2016 20:12:01 +0000 (20:12 +0000)]
WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
<rdar://problem/25129946>
https://bugs.webkit.org/show_bug.cgi?id=155401

Reviewed by Alex Christensen.

Source/WebCore:

Add a SessionID as a member of NetworkStorageSession. This allows us to avoid having HashMaps
to map between the two types.

* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::sessionID):
(WebCore::NetworkStorageSession::credentialStorage):
(WebCore::NetworkStorageSession::platformSession):
* platform/network/NetworkStorageSessionStub.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::context):
(WebCore::NetworkStorageSession::createPrivateBrowsingSession):
(WebCore::defaultSession):
(WebCore::NetworkStorageSession::defaultStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::defaultStorageSession):
(WebCore::NetworkStorageSession::createPrivateBrowsingSession):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::defaultStorageSession):
(WebCore::NetworkStorageSession::createPrivateBrowsingSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::soupNetworkSession):

Source/WebKit/mac:

* WebCoreSupport/WebFrameNetworkingContext.mm:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):
Pass a SessionID to NetworkStorageSession::createPrivateBrowsingSession().

Source/WebKit/win:

* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):
Pass a SessionID to NetworkStorageSession::createPrivateBrowsingSession().

Source/WebKit2:

The issue was that NSURLSessionDataTasks can continue to invoke their NSURLSession's delegate methods
after -[NSURLSession invalidateAndCancel] is called. So, when the NetworkSession was destroyed, and
still had outstanding data tasks, the session delegate would get called, try to use the session, and
crash. To fix this I:

- Made NetworkSession RefCounted.
- Gave NetworkSession two delegates, one for each NSURLSession.
- Made each delegate have a strong reference to the NetworkSession that gets cleared out in the
  newly implemented URLSession:didBecomeInvalidWithError: method.
- Changed from simply destroying the NetworkSession in SessionTracker::destroySession(), to derefing
  it and explicitly calling invalidateAndCancel on the two associated NSURLSessions (which in turn
  eventually cause the URLSession:didBecomeInvalidWithError: to fire).
- To ensure the correct lifetime of the WebCore::NetworkStorageSession, I made it a member of the
  NetworkSession. This also allowed some simplification inside SessionTracker.

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::setPendingDownload):
(WebKit::NetworkDataTask::pendingDownloadLocation):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::sessionID):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::willPerformHTTPRedirection):
(WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:]):
(-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
(WebKit::NetworkSession::setCustomProtocolManager):
(WebKit::NetworkSession::create):
(WebKit::NetworkSession::defaultSession):
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::networkStorageSession):
(WebKit::NetworkSession::clearCredentials):
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
* Shared/SessionTracker.cpp:
(WebKit::identifierBase):
(WebKit::SessionTracker::getIdentifierBase):
(WebKit::SessionTracker::setIdentifierBase):
(WebKit::staticSessionMap):
(WebKit::SessionTracker::networkSession):
(WebKit::SessionTracker::storageSession):
(WebKit::staticStorageSessionMap):
(WebKit::SessionTracker::sessionID):
(WebKit::SessionTracker::setSession):
(WebKit::SessionTracker::destroySession):
(WebKit::SessionTracker::forEachNetworkStorageSession):
(WebKit::storageSessionToID): Deleted.
(WebKit::SessionTracker::storageSessionMap): Deleted.
* Shared/SessionTracker.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
(WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
(WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
(WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
(WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):

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

3 years agogetUserMedia requests from the main frame should be treated the same as requests...
jonlee@apple.com [Sun, 13 Mar 2016 19:51:39 +0000 (19:51 +0000)]
getUserMedia requests from the main frame should be treated the same as requests from an iframe with the same origin
https://bugs.webkit.org/show_bug.cgi?id=155405
<rdar://problem/25131007>

Reviewed by Eric Carlson.

When gUM is called from the main frame, or from a subframe with the same origin, the
top level document origin should be the same.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::userMediaDocumentOrigin): Reverse the logic so that it is similar
to topLevelDocumentOrigin.
(WebCore::UserMediaRequest::topLevelDocumentOrigin): Return the top origin always.

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

3 years agoREGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
ddkilzer@apple.com [Sun, 13 Mar 2016 19:02:57 +0000 (19:02 +0000)]
REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier

Source/WebCore:

* platform/network/ParsedContentRange.cpp: Add #include
<wtf/StdLibExtras.h> and remove local definition of "PRId64".

Source/WTF:

This fixes the following build failure in WebCore for Windows:
    C:\Source\WebCore\page\DOMTimer.cpp(396): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]
    C:\Source\WebCore\page\DOMTimer.cpp(399): error C2146: syntax error: missing ')' before identifier 'PRId64' [C:\WebKitBuild\Debug\Source\WebCore\WebCore.vcxproj]

* wtf/StdLibExtras.h: Define "PRId64" for Windows here so it may
be shared.  This should fix DOMTimer.cpp after r198079 since it
already includes StdLibExtras.h.

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

3 years agohttp://kangax.github.io/compat-table/esnext/ crashes reliably.
mark.lam@apple.com [Sun, 13 Mar 2016 15:46:50 +0000 (15:46 +0000)]
kangax.github.io/compat-table/esnext/ crashes reliably.
https://bugs.webkit.org/show_bug.cgi?id=155404

Reviewed by Yusuke Suzuki.

constructObjectFromPropertyDescriptor() was incorrectly assuming that either
both getter and setter will be set or unset.  It did not consider that only one
of the getter or setter may be set.  This patch fixes that.

* runtime/ObjectConstructor.h:
(JSC::constructObjectFromPropertyDescriptor):
* tests/stress/proxy-with-unbalanced-getter-setter.js: Added.
(assert):
(let.handler.defineProperty):
(i.):
(i.assert):
(i.get assert):
(set assert):

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

3 years ago[EFL] Fix debug build error since r197690. Unreviewed.
jh718.park@samsung.com [Sun, 13 Mar 2016 14:46:35 +0000 (14:46 +0000)]
[EFL] Fix debug build error since r197690. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=155408

Unreviewed. Change %lld to %PRId instead to correct the error below.
error: format ‘%lld’ expects argument of type ‘long long int’,
but argument 5 has type ‘std::chrono::duration<long int, std::ratio<1l, 1000l> >::rep
{aka long int}’ [-Werror=format=]

* page/DOMTimer.cpp:
(WebCore::DOMTimer::updateTimerIntervalIfNecessary):

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

3 years ago[Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
mmaxfield@apple.com [Sun, 13 Mar 2016 03:58:41 +0000 (03:58 +0000)]
[Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
https://bugs.webkit.org/show_bug.cgi?id=155379

Reviewed by Beth Dakin.

There's no reason to not call them what they are.

No new tests because there is no behavior change.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
* platform/ScrollbarThemeComposite.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(scrollbarPainterForScrollbar):
(-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
(-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
(WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::cancelAnimations):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
(WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
(-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarMap):
(+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
(WebCore::ScrollbarThemeMac::painterForScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
(WebCore::ScrollbarThemeMac::hasThumb):
(WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
(WebCore::scrollbarPainterPaint):

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

3 years agoWhen generating Objective-C protocol types, getters for objects need to synthesize...
bburg@apple.com [Sun, 13 Mar 2016 03:48:56 +0000 (03:48 +0000)]
When generating Objective-C protocol types, getters for objects need to synthesize a new object instance
https://bugs.webkit.org/show_bug.cgi?id=155389
<rdar://problem/25125821>

Reviewed by Timothy Hatcher.

Currently, in object property getters for Objective-C protocol types, we use
a C-style cast of the member's RWIProtocolJSONObject * to the type of the property.
However, at runtime the class of `self` is going to be RWIProtocolJSONObject *,
not MemberType *, so any subsequent calls to MemberType properties on the return value
will fail as the selectors will not be recognized.

Instead of doing a C-style pointer cast, we need to create a new MemberType object
that's backed by the InspectorObject retrieved from the parent object by key.
This requires a new initWithJSONObject initializer for each object protocol type.

* inspector/scripts/codegen/generate_objc_header.py:
(ObjCHeaderGenerator._generate_type_interface): Add new declaration.

* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator.generate_type_implementation):
(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_json_object): Added.
Forward through to the super class initializer who assigns the underlying InspectorObject.

(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_required_members):
Drive-by cleanup to use the more compact [super init] form.

* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.protocol_to_objc_expression_for_member):
For property getters of objects, use initWithJSONObject: rather than a C-style cast.

Rebaseline relevant test results.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

3 years agoRemoved variable names from default constructor declarations.
commit-queue@webkit.org [Sun, 13 Mar 2016 02:39:43 +0000 (02:39 +0000)]
Removed variable names from default constructor declarations.
https://bugs.webkit.org/show_bug.cgi?id=155397

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-12
Reviewed by Mark Lam.

They carry no information and generate unused variable warning with GCC
4.8 in a lot of source files.

* parser/VariableEnvironment.h:

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

3 years agoREGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
dino@apple.com [Sun, 13 Mar 2016 01:55:45 +0000 (01:55 +0000)]
REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
https://bugs.webkit.org/show_bug.cgi?id=155400
<rdar://problem/24818602>

Reviewed by Anders Carlsson.

Source/WebCore:

When we unprefixed CSS filters we accidentally
stopped SVG elements that use the CSS filter shorthands
from rendering. We still don't actually support
the shorthands in this case, but we should render
the element without the filter.

Tests: css3/filters/filters-on-svg-element.html
       css3/filters/filters-on-svg-root.html

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::hasReferenceFilterOnly): Add
this new function that tells us if we have the
style of filter that we can handle in SVG content.
* rendering/style/RenderStyle.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
We can mark an element as ready to render if it
has a shorthand filter.

LayoutTests:

Add tests with SVG content that uses CSS filter
shorthands. These particular filters are no-ops
so should not affect rendering. If they actually
tried to do something you wouldn't see them work
until we enable shorthand filters on SVG content.

* css3/filters/filters-on-svg-element-expected.html: Added.
* css3/filters/filters-on-svg-element.html: Added.
* css3/filters/filters-on-svg-root-expected.html: Added.
* css3/filters/filters-on-svg-root.html: Added.

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

3 years agoDelete dead SVG Font code
mmaxfield@apple.com [Sun, 13 Mar 2016 00:36:59 +0000 (00:36 +0000)]
Delete dead SVG Font code
https://bugs.webkit.org/show_bug.cgi?id=154718

Reviewed by Antti Koivisto.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

All the ports have adopted the SVG -> OTF Font Converter, so there will never
be an instantiation of a font backed by a DOM subtree. We can remove all the
infrastructure used to support that.

No new tests because there is no behavior change.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* WebCore.order:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
(WebCore::CSSFontFaceSource::font): Deleted.
* css/CSSFontFaceSource.h:
* loader/cache/CachedFont.cpp:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont): Deleted.
(WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
* loader/cache/CachedSVGFont.h:
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::fillGlyphPage):
(WebCore::Font::description): Deleted.
(WebCore::Font::createScaledFont): Deleted.
(WebCore::Font::applyTransforms): Deleted.
* platform/graphics/Font.h:
(WebCore::Font::widthForGlyph):
(WebCore::Font::SVGData::~SVGData): Deleted.
(WebCore::Font::create): Deleted.
(WebCore::Font::svgData): Deleted.
(WebCore::Font::isSVGFont): Deleted.
* platform/graphics/win/FontWin.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText):
(WebCore::FontCascade::drawEmphasisMarks):
(WebCore::FontCascade::glyphDataForCharacter):
(WebCore::FontCascade::adjustSelectionRectForText):
(WebCore::FontCascade::offsetForPosition):
(WebCore::FontCascade::drawEmphasisMarksForSimpleText):
(WebCore::FontCascade::drawGlyphBuffer):
(WebCore::isDrawnWithSVGFont): Deleted.
(WebCore::FontCascade::width): Deleted.
(WebCore::FontCascade::codePath): Deleted.
* platform/graphics/FontCascade.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/SVGGlyph.cpp: Removed.
(WebCore::processArabicFormDetection): Deleted.
(WebCore::charactersWithArabicForm): Deleted.
(WebCore::isCompatibleArabicForm): Deleted.
(WebCore::isCompatibleGlyph): Deleted.
* platform/graphics/SVGGlyph.h: Removed.
(WebCore::SVGGlyph::SVGGlyph): Deleted.
(WebCore::SVGGlyph::inheritedValue): Deleted.
(WebCore::SVGGlyph::operator==): Deleted.
* platform/graphics/TextRun.cpp:
* platform/graphics/TextRun.h:
(WebCore::TextRun::RenderingContext::~RenderingContext): Deleted.
(WebCore::TextRun::renderingContext): Deleted.
(WebCore::TextRun::setRenderingContext): Deleted.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::applyFontTransforms):
(WebCore::WidthIterator::advanceInternal):
(WebCore::WidthIterator::glyphDataForCharacter): Deleted.
* platform/graphics/WidthIterator.h:
(WebCore::WidthIterator::lastGlyphName): Deleted.
(WebCore::WidthIterator::setLastGlyphName): Deleted.
(WebCore::WidthIterator::arabicForms): Deleted.
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::CairoGlyphToPathTranslator::advance):
(WebCore::FontCascade::dashesForIntersectionsWithRect):
(WebCore::CairoGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::MacGlyphToPathTranslator::advance):
(WebCore::FontCascade::dashesForIntersectionsWithRect):
(WebCore::FontCascade::primaryFontIsSystemFont):
(WebCore::FontCascade::drawEmphasisMarksForComplexText):
(WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Deleted.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::TextLayout::isNeeded):
(WebCore::TextLayout::TextLayout):
(WebCore::TextLayout::constructTextRun):
* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore::EllipsisBox::selectionRect):
(WebCore::EllipsisBox::paintSelection):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintDocumentMarker):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::offsetForPosition):
(WebCore::InlineTextBox::positionForOffset):
(WebCore::InlineTextBox::constructTextRun):
* rendering/InlineTextBox.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::stripTrailingSpace):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::checkLinesForTextOverflow):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
(WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::setImageSizeForAltText):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::getRelativeMarkerRect):
* rendering/RenderMenuList.cpp:
(RenderMenuList::updateOptionsWidth):
* rendering/RenderText.cpp:
(WebCore::RenderText::widthFromCache):
(WebCore::RenderText::trimmedPrefWidths):
(WebCore::hyphenWidth):
(WebCore::maxWordFragmentWidth):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::width):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::getAverageCharWidth):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeMeasureTextClient::RenderThemeMeasureTextClient):
(WebCore::adjustInputElementButtonStyle):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText): Deleted.
* rendering/line/BreakingContext.h:
(WebCore::WordTrailingSpace::WordTrailingSpace):
(WebCore::WordTrailingSpace::width):
(WebCore::measureHyphenWidth):
(WebCore::textWidth):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::handleText):
* rendering/svg/RenderSVGAllInOne.cpp:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
(WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
(WebCore::SVGInlineTextBox::paintTextWithShadows):
(WebCore::SVGInlineTextBox::constructTextRun): Deleted.
* rendering/svg/SVGInlineTextBox.h:
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
* rendering/svg/SVGTextLayoutEngineSpacing.cpp:
(WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): Deleted.
* rendering/svg/SVGTextLayoutEngineSpacing.h:
* rendering/svg/SVGTextMetrics.cpp:
(WebCore::SVGTextMetrics::SVGTextMetrics):
(WebCore::SVGTextMetrics::constructTextRun): Deleted.
* rendering/svg/SVGTextMetrics.h:
* rendering/svg/SVGTextMetricsBuilder.cpp:
(WebCore::SVGTextMetricsBuilder::advanceSimpleText):
* rendering/svg/SVGTextRunRenderingContext.cpp: Removed.
(WebCore::svgFontAndFontFaceElementForFontData): Deleted.
(WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Deleted.
(WebCore::SVGTextRunRenderingContext::applySVGKerning): Deleted.
(WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): Deleted.
(WebCore::SVGGlyphToPathTranslator::transform): Deleted.
(WebCore::SVGGlyphToPathTranslator::path): Deleted.
(WebCore::SVGGlyphToPathTranslator::extents): Deleted.
(WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
(WebCore::SVGGlyphToPathTranslator::advance): Deleted.
(WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator): Deleted.
(WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Deleted.
(WebCore::missingGlyphForFont): Deleted.
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Deleted.
* rendering/svg/SVGTextRunRenderingContext.h: Removed.
* svg/SVGAllInOne.cpp:
* svg/SVGFontData.cpp: Removed.
(WebCore::SVGFontData::SVGFontData): Deleted.
(WebCore::SVGFontData::initializeFont): Deleted.
(WebCore::SVGFontData::widthForSVGGlyph): Deleted.
(WebCore::SVGFontData::applySVGGlyphSelection): Deleted.
(WebCore::SVGFontData::fillSVGGlyphPage): Deleted.
(WebCore::SVGFontData::fillBMPGlyphs): Deleted.
(WebCore::SVGFontData::fillNonBMPGlyphs): Deleted.
(WebCore::computeNormalizedSpaces): Deleted.
(WebCore::createStringWithMirroredCharacters): Deleted.
* svg/SVGFontData.h: Removed.
(WebCore::SVGFontData::~SVGFontData): Deleted.
(WebCore::SVGFontData::svgFontFaceElement): Deleted.
(WebCore::SVGFontData::horizontalOriginX): Deleted.
(WebCore::SVGFontData::horizontalOriginY): Deleted.
(WebCore::SVGFontData::horizontalAdvanceX): Deleted.
(WebCore::SVGFontData::verticalOriginX): Deleted.
(WebCore::SVGFontData::verticalOriginY): Deleted.
(WebCore::SVGFontData::verticalAdvanceY): Deleted.
* svg/SVGFontElement.cpp:
(WebCore::SVGFontElement::SVGFontElement): Deleted.
(WebCore::SVGFontElement::invalidateGlyphCache): Deleted.
(WebCore::SVGFontElement::firstMissingGlyphElement): Deleted.
(WebCore::SVGFontElement::registerLigaturesInGlyphCache): Deleted.
(WebCore::SVGFontElement::ensureGlyphCache): Deleted.
(WebCore::SVGKerningMap::clear): Deleted.
(WebCore::SVGKerningMap::insert): Deleted.
(WebCore::stringMatchesUnicodeRange): Deleted.
(WebCore::stringMatchesGlyphName): Deleted.
(WebCore::stringMatchesUnicodeName): Deleted.
(WebCore::matches): Deleted.
(WebCore::kerningForPairOfStringsAndGlyphs): Deleted.
(WebCore::SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs): Deleted.
(WebCore::SVGFontElement::verticalKerningForPairOfStringsAndGlyphs): Deleted.
(WebCore::SVGFontElement::collectGlyphsForString): Deleted.
(WebCore::SVGFontElement::collectGlyphsForGlyphName): Deleted.
(WebCore::SVGFontElement::svgGlyphForGlyph): Deleted.
(WebCore::SVGFontElement::missingGlyph): Deleted.
* svg/SVGFontElement.h:
(WebCore::SVGKerning::SVGKerning): Deleted.
(WebCore::SVGKerningMap::isEmpty): Deleted.
* svg/SVGGlyphElement.cpp:
(WebCore::SVGGlyphElement::invalidateGlyphCache): Deleted.
(WebCore::SVGGlyphElement::parseAttribute): Deleted.
(WebCore::SVGGlyphElement::insertedInto): Deleted.
(WebCore::SVGGlyphElement::removedFrom): Deleted.
(WebCore::parseArabicForm): Deleted.
(WebCore::parseOrientation): Deleted.
(WebCore::SVGGlyphElement::inheritUnspecifiedAttributes): Deleted.
(WebCore::parseSVGGlyphAttribute): Deleted.
(WebCore::SVGGlyphElement::buildGenericGlyphIdentifier): Deleted.
(WebCore::SVGGlyphElement::buildGlyphIdentifier): Deleted.
* svg/SVGGlyphElement.h:
* svg/SVGGlyphMap.h: Removed.
(WebCore::GlyphMapNode::GlyphMapNode): Deleted.
(WebCore::GlyphMapNode::create): Deleted.
(WebCore::SVGGlyphMap::SVGGlyphMap): Deleted.
(WebCore::SVGGlyphMap::addGlyph): Deleted.
(WebCore::SVGGlyphMap::appendToGlyphTable): Deleted.
(WebCore::SVGGlyphMap::compareGlyphPriority): Deleted.
(WebCore::SVGGlyphMap::collectGlyphsForString): Deleted.
(WebCore::SVGGlyphMap::clear): Deleted.
(WebCore::SVGGlyphMap::svgGlyphForGlyph): Deleted.
(WebCore::SVGGlyphMap::glyphIdentifierForGlyphName): Deleted.
* svg/SVGHKernElement.cpp:
(WebCore::SVGHKernElement::insertedInto): Deleted.
(WebCore::SVGHKernElement::removedFrom): Deleted.
* svg/SVGHKernElement.h:
* svg/SVGToOTFFontConversion.cpp:
* svg/SVGToOTFFontConversion.h:
* svg/SVGVKernElement.cpp:
(WebCore::SVGVKernElement::insertedInto): Deleted.
(WebCore::SVGVKernElement::removedFrom): Deleted.
* svg/SVGVKernElement.h:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

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

3 years agoMake preview inline navigation work API
bdakin@apple.com [Sat, 12 Mar 2016 23:15:47 +0000 (23:15 +0000)]
Make preview inline navigation work API
https://bugs.webkit.org/show_bug.cgi?id=155383
-and corresponding-
rdar://problem/25117985

Reviewed by Dan Bernstein.

With this patch:
_WKElementInfo is now WKElementInfo in file and class names. Header is now
public.

_WKPreviewElementInfo is now WKPreviewElementInfo in file and class names.
Header is now public.

_WKPreviewAction is now WKPreviewActionItem in filenames (header is now
public), the protocol _WKPreviewActionItem is now WKPreviewActionItem, and
the _WKPreviewAction class is now WKPreviewAction. (The internal header is
still project, of course.)
and
WKPreviewActionIdentifiersPrivate.h/mm is now
WKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been
updated. Header is now public.

* Shared/API/Cocoa/WebKit.h:
* UIProcess/API/Cocoa/WKElementInfo.h: Copied from UIProcess/API/Cocoa/_WKElementInfo.h.
* UIProcess/API/Cocoa/WKElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKElementInfo.mm.
(-[WKElementInfo copyWithZone:]):
(-[_WKElementInfo copyWithZone:]): Deleted.
* UIProcess/API/Cocoa/WKElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKElementInfoInternal.h.
* UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h: Removed.
* UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm: Removed.
* UIProcess/API/Cocoa/WKPreviewActionItem.h: Copied from UIProcess/API/Cocoa/_WKPreviewAction.h.
* UIProcess/API/Cocoa/WKPreviewActionItem.mm: Copied from UIProcess/API/Cocoa/_WKPreviewAction.mm.
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h.
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm.
* UIProcess/API/Cocoa/WKPreviewActionItemInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewActionInternal.h.
* UIProcess/API/Cocoa/WKPreviewElementInfo.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.h.
* UIProcess/API/Cocoa/WKPreviewElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.mm.
(-[WKPreviewElementInfo _initWithLinkURL:]):
(-[_WKPreviewElementInfo _initWithLinkURL:]): Deleted.
* UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h.
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
* UIProcess/API/Cocoa/_WKElementInfo.h: Removed.
* UIProcess/API/Cocoa/_WKElementInfo.mm: Removed.
* UIProcess/API/Cocoa/_WKElementInfoInternal.h: Removed.
* UIProcess/API/Cocoa/_WKPreviewAction.h: Removed.
* UIProcess/API/Cocoa/_WKPreviewAction.mm: Removed.
* UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Removed.
* UIProcess/API/Cocoa/_WKPreviewElementInfo.h: Removed.
* UIProcess/API/Cocoa/_WKPreviewElementInfo.mm: Removed.
* UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h: Removed.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(previewIdentifierForElementAction):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):
(-[WKContentView _previewItemController:commitPreview:]):
* WebKit2.xcodeproj/project.pbxproj:

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

3 years ago[OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
mmaxfield@apple.com [Sat, 12 Mar 2016 21:18:25 +0000 (21:18 +0000)]
[OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
https://bugs.webkit.org/show_bug.cgi?id=155385

Reviewed by Simon Fraser.

Source/WebCore:

There is already some existing setup for RTL scrollbars. This patch hooks up this
existing support to the OS X triggering mechanism introduced in r197956. It also
fixes up the existing support to function even when the direction of the
RTL-scrollbar div is LTR (this means the contents of the div must be pushed
over by the width of the scrollbar).

Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html
       fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html
       fast/scrolling/rtl-scrollbars-overflow-padding.html
       fast/scrolling/rtl-scrollbars-overflow-simple.html
       fast/scrolling/rtl-scrollbars-overflow.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addOverflowFromPositionedObjects):
(WebCore::RenderBlock::logicalLeftOffsetForContent):
(WebCore::RenderBlock::logicalRightOffsetForContent):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowClipRect):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeScrollDimensions):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft):
* rendering/style/RenderStyle.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/win/TestExpectations:
* fast/scrolling/rtl-scrollbars-overflow-contents-expected.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-contents.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-dir-rtl-expected.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-expected.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-padding-expected.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-padding.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-simple-expected-mismatch.html: Added.
* fast/scrolling/rtl-scrollbars-overflow-simple.html: Added.
* fast/scrolling/rtl-scrollbars-overflow.html: Added.

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

3 years agoREGRESSION (r178615): Fix incorrect case in included header for WeakPtr.cpp
ddkilzer@apple.com [Sat, 12 Mar 2016 20:58:58 +0000 (20:58 +0000)]
REGRESSION (r178615): Fix incorrect case in included header for WeakPtr.cpp

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp: Change "test.h" to
"Test.h" to fix incorrect case.  This was discovered when adding
WeakPtr.cpp to CMakeLists.txt for the patch on Bug 155394.

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

3 years agorun-webkit-tests: handle Darwin framework/library environment variables more consistently
ddkilzer@apple.com [Sat, 12 Mar 2016 19:59:41 +0000 (19:59 +0000)]
run-webkit-tests: handle Darwin framework/library environment variables more consistently
<http://webkit.org/b/155392>

Reviewed by Daniel Bates.

These changes will make it possible to pass through environment
variables from the run-webkit-tests command-line.

* Scripts/webkitpy/port/base.py:
(Port.to.setup_environ_for_server): Add DYLD_FRAMEWORK_PATH,
__XPC_DYLD_FRAMEWORK_PATH and __XPC_DYLD_LIBRARY_PATH to the
list of variables to keep from the run-webkit-test environment.

* Scripts/webkitpy/port/driver.py:
(Driver._append_environment_variable_path): Add method to append
a path to an environment variable, or set the path if the
variable doesn't exist.
(Driver._setup_environ_for_driver): Extract build_root_path into
a local variable.  Use Driver._append_environment_variable_path
to extend DYLD_LIBRARY_PATH, __XPC_DYLD_LIBRARY_PATH,
DYLD_FRAMEWORK_PATH and __XPC_DYLD_FRAMEWORK_PATH instead of
overwriting them.

* Scripts/webkitpy/port/driver_unittest.py:
(DriverTest.test__append_environment_variable_path): Add test
method to test Driver._append_environment_variable_path.

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

3 years agoWeb Inspector: Convert toolbar and tab bar to position absolute to reduce repaint...
nvasilyev@apple.com [Sat, 12 Mar 2016 18:16:32 +0000 (18:16 +0000)]
Web Inspector: Convert toolbar and tab bar to position absolute to reduce repaint areas
https://bugs.webkit.org/show_bug.cgi?id=155386

Reviewed by Timothy Hatcher.

Using CSS flexbox causes unnecessary large repaints.
Convert top level elements (.toolbar, .tab-bar, #main)
from flexbox to "position: absolute".

* UserInterface/Views/Main.css:
(#main):
* UserInterface/Views/TabBar.css:
(.tab-bar):
* UserInterface/Views/Toolbar.css:
(.toolbar):
(body.mac-platform:not(.docked, .mavericks) .toolbar):
(body.mac-platform:not(.docked, .mavericks)):
(body.window-inactive:not(.mavericks) .toolbar): Deleted.
* UserInterface/Views/Variables.css:
(:root):

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

3 years ago[Forms: focus] focus rings around text fields do not follow contour (border-radius)
zalan@apple.com [Sat, 12 Mar 2016 17:24:21 +0000 (17:24 +0000)]
[Forms: focus] focus rings around text fields do not follow contour (border-radius)
https://bugs.webkit.org/show_bug.cgi?id=154099
rdar://problem/9988429

Reviewed by Tim Horton.

Source/WebCore:

This patch enables outline-style: auto to follow the curve of border-radius.
When both border-radius and outline-style: auto are set, the native focusring painting will take the border-radius values
into account. This is only for outline-style: auto, other non-auto outline styles paint as if there
was no border-radius set.
It supports both single and multiline content with joint rectangles.
However in case of disjoint rectangles, we fallback to the non-radius drawing.

Tests: fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html
       fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html
       fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html
       fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html

* platform/graphics/GraphicsContext.h:
* platform/graphics/Path.cpp:
(WebCore::Path::addBeziersForRoundedRect):
* platform/graphics/Path.h:
(WebCore::Path::circleControlPoint):
* platform/graphics/PathUtilities.cpp:
(WebCore::polygonsForRect):
(WebCore::PathUtilities::pathsWithShrinkWrappedRects):
(WebCore::startAndEndPointsForCorner):
(WebCore::cornerType):
(WebCore::controlPointsForBezierCurve):
(WebCore::adjustedtRadiiForHuggingCurve):
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
* platform/graphics/PathUtilities.h:
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):

LayoutTests:

Unfortunately there's no proper way to test native focusring drawing.
These tests attempt to verify that we don't end up painting sharp corners.

* fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr-expected.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl-expected.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr-expected.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl-expected.html: Added.
* fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html: Added.

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

3 years ago.:
commit-queue@webkit.org [Sat, 12 Mar 2016 10:23:40 +0000 (10:23 +0000)]
.:
[GTK][Mac] Don't force ENABLE_INTROSPECTION=OFF on Mac
https://bugs.webkit.org/show_bug.cgi?id=152650

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-03-12
Reviewed by Carlos Garcia Campos.

* Source/cmake/OptionsGTK.cmake:

Source/WebKit2:
[GTK][Mac] Use DYLD_LIBRARY_PATH on OSX rather then LD_LIBRARY_PATH
https://bugs.webkit.org/show_bug.cgi?id=152650

Patch by Jeremy Huddleston Sequoia <jeremyhu@apple.com> on 2016-03-12
Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:

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

3 years ago[JSC] Remove a few jumps from DFG
commit-queue@webkit.org [Sat, 12 Mar 2016 03:28:32 +0000 (03:28 +0000)]
[JSC] Remove a few jumps from DFG
https://bugs.webkit.org/show_bug.cgi?id=155347

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

Usually, setting ValueTrue or ValueFalse is set
by Compare+Or. There are 3 places in DFG with branches instead.

This patch changes them to the usual pattern.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileObjectEquality):
(JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):

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

3 years agoAdd Event.deepPath() and Event.scoped
rniwa@webkit.org [Sat, 12 Mar 2016 03:11:04 +0000 (03:11 +0000)]
Add Event.deepPath() and Event.scoped
https://bugs.webkit.org/show_bug.cgi?id=153538
<rdar://problem/24363836>

Reviewed by Darin Adler.

Source/WebCore:

Added the support for deepPath(), scoped, and relatedTargetScoped on Event.prototype for shadow DOM:
http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
and updated the EventPath class to respect scoped and relatedTargetScoped flags as specified at:
http://w3c.github.io/webcomponents/spec/shadow/#get-the-parent

Tests: fast/shadow-dom/Extensions-to-Event-Interface.html
       fast/shadow-dom/trusted-event-scoped-flags.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Added the support for Conditional for InitializedByEventConstructor.
* bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
* bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
* bindings/scripts/test/TestEventConstructor.idl: Added a test case for using InitializedByEventConstructor
with Conditional.
* dom/Event.cpp:
(WebCore::Event::Event): Initialize m_scoped and m_relatedTargetScoped from EventInit dictionary.
(WebCore::Event::scoped): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag
(WebCore::Event::deepPath): Added.
* dom/Event.h:
(WebCore::Event::relatedTargetScoped): Added. Overridden by FocusEvent and MouseEvent to implement
http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
(WebCore::Event::setEventPath): Added.
(WebCore::Event::clearEventPath): Added.
* dom/Event.idl: Added scoped, relatedTargetScoped, and deepPath() conditionally enabled for shadow DOM.
* dom/EventContext.h:
(WebCore::EventContext::currentTarget):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Set the event path while the event is being dispatched.
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary): Check event.scoped flag instead of hard-coding a list of events here
which has been moved to Event::scoped. See above.
(WebCore::EventPath::setRelatedTarget): Check m_event.relatedTargetScoped() instead of hard-coding a list of
events here. relatedTargetScoped is overridden by FocusEvent and MouseEvent.
(WebCore::EventPath::hasEventListeners): Fixed the misleading variable name.
(WebCore::isUnclosedNodeOf): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#dfn-unclosed-node
(WebCore::EventPath::computePathDisclosedToTarget): Added. Implements the algorithm to filter event targets:
http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
* dom/EventPath.h:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::relatedTargetScoped): Returns true when this is a trusted event per:
http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
* dom/FocusEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::relatedTargetScoped): Ditto.
* dom/MouseEvent.h:

LayoutTests:

Added a W3C style testharness.js tests for Event.prototype.scoped, Event.prototype.scopedRelatedTarget,
Event.prototype.deepPath() and a test that uses eventSender to verify the values of the scoped and
scopedRelatedTarget flags on trusted events.

* fast/shadow-dom/Extensions-to-Event-Interface-expected.txt: Added.
* fast/shadow-dom/Extensions-to-Event-Interface.html: Added.
* fast/shadow-dom/event-with-related-target.html:
* fast/shadow-dom/resources: Added.
* fast/shadow-dom/resources/event-path-test-helpers.js: Added. Extracted from event-with-related-target.html.
* fast/shadow-dom/trusted-event-scoped-flags-expected.txt: Added.
* fast/shadow-dom/trusted-event-scoped-flags.html: Added.
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* platform/ios-simulator/fast/shadow-dom/trusted-event-scoped-flags-expected.txt: Added.

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

3 years agoMove prevalent resource classifier from WebCore to WebKit.
commit-queue@webkit.org [Sat, 12 Mar 2016 00:36:17 +0000 (00:36 +0000)]
Move prevalent resource classifier from WebCore to WebKit.
https://bugs.webkit.org/show_bug.cgi?id=155242
<rdar://problem/24913272>

Patch by John Wilander <wilander@apple.com> on 2016-03-11
Reviewed by Andy Estes.

Source/WebCore:

No new tests since we have yet to decide how to set up tests for prevalent resources.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
    - Removed calls to old classifier in WebCore.
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashCountedSet):
(WebCore::ResourceLoadStatistics::checkAndSetAsPrevalentResourceIfNecessary): Deleted.
(WebCore::ResourceLoadStatistics::hasPrevalentResourceCharacteristics): Deleted.
* loader/ResourceLoadStatistics.h:
    - Deleted old classification functions.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::create):
(WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
(WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing):
    - New function to allow for checks before calls to processStatistics.
(WebCore::ResourceLoadStatisticsStore::processStatistics):
    - New function that receives a lamda and executes it on every entry in its statistics map.
* loader/ResourceLoadStatisticsStore.h:

Source/WebKit2:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::create):
(WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
(WebKit::hasPrevalentResourceCharacteristics):
(WebKit::classifyPrevalentResources):
    - Moved these two functions from WebCore.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    - Calls processStatistics with a lamda function to classify prevalent resources.
* WebKit2.xcodeproj/project.pbxproj:
    - Fixed the ordering of source files.

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

3 years agoWebKit needs a new sandbox profile addition for DataDetectors
weinig@apple.com [Fri, 11 Mar 2016 23:59:04 +0000 (23:59 +0000)]
WebKit needs a new sandbox profile addition for DataDetectors
<rdar://problem/25091102>

Reviewed by Brent Fulgham.

* WebProcess/com.apple.WebProcess.sb.in:

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

3 years ago[ios-sim debug] API test WTF_Lock.ContendedShortSection and WTF_ParkingLot.UnparkOneF...
ap@apple.com [Fri, 11 Mar 2016 23:56:20 +0000 (23:56 +0000)]
[ios-sim debug] API test WTF_Lock.ContendedShortSection and WTF_ParkingLot.UnparkOneFifty timing out
https://bugs.webkit.org/show_bug.cgi?id=155276

[ios-sim] API test WTF_Condition.TenProducersTenConsumersOneSlot timing out
https://bugs.webkit.org/show_bug.cgi?id=155345

[iOS Simulator] API test timeout: WTF_ParkingLot.UnparkOneFiftyThenFiftyAll
https://bugs.webkit.org/show_bug.cgi?id=153997
<rdar://problem/23580034>

<rdar://problem/23580018> TestWebKitAPI Timeout: WTF_ParkingLot.UnparkOneFifty

Rubber-stamped by Filip Pizlo.

* Scripts/run-api-tests: These tests are pretty slow. Increase API test timeout.

* TestWebKitAPI/Tests/WTF/ParkingLot.cpp: Start running WTF_ParkingLot.UnparkOneFiftyThenFiftyAll
on iOS again.

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

3 years ago[ES6] Make Object.assign spec compliant
sbarati@apple.com [Fri, 11 Mar 2016 23:48:46 +0000 (23:48 +0000)]
[ES6] Make Object.assign spec compliant
https://bugs.webkit.org/show_bug.cgi?id=155375

Reviewed by Michael Saboff.

This is a straight forward implementation of Object.assign
in the spec.
https://tc39.github.io/ecma262/#sec-object.assign
Before, weren't performing all of the specified operations.
Now, we are.

* builtins/ObjectConstructor.js:
(assign):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* tests/es6.yaml:

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

3 years agoRegression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashi...
cdumez@apple.com [Fri, 11 Mar 2016 23:24:00 +0000 (23:24 +0000)]
Regression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=155382

Reviewed by Alexey Proskuryakov.

r198040 introduced an assertion to make sure we never call
applicationBundleIsEqualTo() before setApplicationBundleIdentifier()
is called. This new assertion found a bug as it turns out we were
calling setApplicationBundleIdentifier() too late during the
WebProcess initialization and some runtime applications checks were
already done by then.

To address the problem, this patch moves the
setApplicationBundleIdentifier() call as early as possible during
the WebProcess and the NetworkProcess initialization. It also moves
it to the Cocoa specific files for clarity.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

3 years agoWebKit should not be redirected to an invalid URL
jiewen_tan@apple.com [Fri, 11 Mar 2016 23:15:08 +0000 (23:15 +0000)]
WebKit should not be redirected to an invalid URL
https://bugs.webkit.org/show_bug.cgi?id=155263
<rdar://problem/22820172>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/navigation/redirect-to-invalid-url.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):

LayoutTests:

* http/tests/navigation/redirect-to-invalid-url-expected.txt: Added.
* http/tests/navigation/redirect-to-invalid-url.html: Added.
* http/tests/navigation/resources/redirect-to-invalid-url-frame.php: Added.

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

3 years agoUse only selected text for Look up.
enrica@apple.com [Fri, 11 Mar 2016 22:50:21 +0000 (22:50 +0000)]
Use only selected text for Look up.
https://bugs.webkit.org/show_bug.cgi?id=155380

Reviewed by Tim Horton.

The corresponding piece that uses the extended context for Look up
is not ready yet. For the moment default to retrieving the selected text.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _lookup:]):

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

3 years ago[ios-sim debug] API tests RequiresUserActionForPlaybackTest.DoesNotRequireUserActionF...
jer.noble@apple.com [Fri, 11 Mar 2016 22:49:00 +0000 (22:49 +0000)]
[ios-sim debug] API tests RequiresUserActionForPlaybackTest.DoesNotRequireUserActionForMediaPlayback and RequiresUserActionForAudioButNotVideoPlayback asserting
https://bugs.webkit.org/show_bug.cgi?id=155365

Reviewed by Darin Adler.

Allow tests running on iOS simulator to play video inline, avoiding this assert.

* TestWebKitAPI/Tests/WebKit2Cocoa/RequiresUserActionForPlayback.mm:
(RequiresUserActionForPlaybackTest::SetUp):

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

3 years ago[iOS] Allow clients to specify text suggestions to be used for a form input session
mitz@apple.com [Fri, 11 Mar 2016 22:13:42 +0000 (22:13 +0000)]
[iOS] Allow clients to specify text suggestions to be used for a form input session
https://bugs.webkit.org/show_bug.cgi?id=155343

Patch by Chelsea Pugh <cpugh@apple.com> on 2016-03-11
Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession suggestions]): Add a getter for suggestions.
(-[WKFormInputSession setSuggestions:]): Add a setter, which calls setSuggestions with our suggestions on the input delegate.
(-[WKContentView insertTextSuggestion:]): Call _webView:insertTextSuggestion:inInputSession: on our input delegate so clients know
a text suggestion was tapped.

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

3 years agoWeb Inspector: Wrong TimelineOverview height after switching from Events to Frames
mattbaker@apple.com [Fri, 11 Mar 2016 21:53:34 +0000 (21:53 +0000)]
Web Inspector: Wrong TimelineOverview height after switching from Events to Frames
https://bugs.webkit.org/show_bug.cgi?id=155366
<rdar://problem/25111028>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
Update the overview height after setting a new view mode.

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

3 years agoFix typo in StyleTreeResolver.cpp
bfulgham@apple.com [Fri, 11 Mar 2016 21:47:19 +0000 (21:47 +0000)]
Fix typo in StyleTreeResolver.cpp
https://bugs.webkit.org/show_bug.cgi?id=139946

Patch by Maksim Kisilev <mkisilev@yandex-team.ru> on 2016-03-10
Reviewed by Andy Estes.

The constructor for CheckForVisibilityChangeOnRecalcStyle was improperly comparing the
result of WKContentChange() (which is not a function) to WKContentVisibilityChange. I
believe the above cast would implicitly resolve to WKContentNoChange in all cases,
whether a visibility change had been observed or not.

This patch corrects this problem. I would expect that this might affect some content
visibility change behavior, but I'm not sure what the appropriate test case would be
since this was apparently found through code inspection.

* style/StyleTreeResolver.cpp:
(WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle):

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

3 years agoMarking media/track/track-in-band-style.html as flaky on Yosemite
ryanhaddad@apple.com [Fri, 11 Mar 2016 21:46:54 +0000 (21:46 +0000)]
Marking media/track/track-in-band-style.html as flaky on Yosemite
https://bugs.webkit.org/show_bug.cgi?id=153143

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoImplement Function.name and Function#toString for ES6 class.
mark.lam@apple.com [Fri, 11 Mar 2016 21:08:08 +0000 (21:08 +0000)]
Implement Function.name and Function#toString for ES6 class.
https://bugs.webkit.org/show_bug.cgi?id=155336

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

The only thing that the ES6 spec says about toString with regards to class
objects is:

"The string representation must have the syntax of a FunctionDeclaration,
FunctionExpression, GeneratorDeclaration, GeneratorExpression, ClassDeclaration,
ClassExpression, ArrowFunction, MethodDefinition, or GeneratorMethod depending
upon the actual characteristics of the object."

Previously, invoking toString() on a class object will return the function
source string of the class' constructor function.  This does not conform to the
spec in that the toString string for a class does not have the syntax of a
ClassDeclaration or ClassExpression.

This is now fixed by doing the following:

1. Added "m_classSource" to FunctionExecutable (and correspondingly to
   UnlinkedFunctionExecutable, FunctionMetadataNode, and ClassExprNode).
   m_classSource is the SourceCode for the code range "class ... { ... }".

   Since the class constructor function is the in memory representation of the
   class object, only class constructor functions will have its m_classSource
   set.  m_classSource will be "null" (by default) for all other functions.
   This is how we know if a FunctionExecutable is for a class.

   Note: FunctionExecutable does not have its own m_classSource.  It always gets
   it from its UnlinkedFunctionExecutable.  This is ok to do because our CodeCache
   currently does not cache UnlinkedFunctionExecutables for class constructors.

2. The ClassExprNode now tracks the SourceCode range for the class expression.
   This is used to set m_classSource in the UnlinkedFunctionExecutable at
   bytecode generation time, and the FunctionExecutable later at bytecode
   linking time.

3. Function.prototype.toString() now checks if the function is for a class.
   If so, it returns the string for the class source instead of just the
   function source for the class constructor.

   Note: the class source is static from the time the class was parsed.  This
   can introduces some weirdness at runtime.  Consider the following:

       var v1 = class {}
       v1.toString(); // yields "class {}".

       class c2 extends v1 {}

       c2.__proto__ === v1; // yields true i.e. c2 extends v1.
       c2.toString(); // yields "class c2 extends v1 {}" which is fine.

       v1 = {}; // point v1 to something else now.

       c2.__proto__ === v1; // now yields false i.e. c2 no longer extends v1.
                            // c2 actually extends the class that v1 used to
                            // point to, but ...
       c2.toString(); // still yields "class c2 extends v1 {}" which is no longer true.

   It is unclear how we can best implement toString() to avoid this issue.
   The above behavior is how Chrome (Version 51.0.2671.0 canary (64-bit))
   currently implements toString() of a class, and we do the same in this patch.
   In Firefox (45.0), toString() of a class will yield the function source of it
   constructor function, which is not better.

In this patch, we also added ES6 compliance for Function.name on class objects:

4. The ClassExprNode now has a m_ecmaName string for tracking the inferred
   name of a class according to the ES6 spec.  The ASTBuilder now mirrors its
   handling of FuncExprNodes to ClassExprNodes in setting the nodes' m_ecmaName
   where relevant.

   The m_ecmaName is later used to set the m_ecmaName of the FunctionExecutable
   of the class constructor, which in turn is used to populate the initial value
   of the Function.name property.

5. Also renamed some variable names (/m_metadata/metadata/) to be consistent with
   webkit naming convention.

* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
(JSC::BytecodeGenerator::emitNewDefaultConstructor):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ClassExprNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createAssignResolve):
(JSC::ASTBuilder::createYield):
(JSC::ASTBuilder::createClassExpr):
(JSC::ASTBuilder::createFunctionExpr):
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::makeAssignNode):
* parser/NodeConstructors.h:
(JSC::FunctionParameters::FunctionParameters):
(JSC::BaseFuncExprNode::BaseFuncExprNode):
(JSC::FuncExprNode::FuncExprNode):
(JSC::FuncDeclNode::FuncDeclNode):
(JSC::ArrowFuncExprNode::ArrowFuncExprNode):
(JSC::ClassDeclNode::ClassDeclNode):
(JSC::ClassExprNode::ClassExprNode):
* parser/Nodes.h:
(JSC::ExpressionNode::isDestructuringNode):
(JSC::ExpressionNode::isFuncExprNode):
(JSC::ExpressionNode::isArrowFuncExprNode):
(JSC::ExpressionNode::isClassExprNode):
(JSC::ExpressionNode::isCommaNode):
(JSC::ExpressionNode::isSimpleArray):
(JSC::ExpressionNode::isAdd):
* parser/Parser.cpp:
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseClass):
* parser/ParserFunctionInfo.h:
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createEmptyLetExpression):
(JSC::SyntaxChecker::createYield):
(JSC::SyntaxChecker::createClassExpr):
(JSC::SyntaxChecker::createFunctionExpr):
(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::createArrowFunctionExpr):
* runtime/Executable.cpp:
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::finishCreation):
* runtime/Executable.h:
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* tests/es6.yaml:

LayoutTests:

* js/class-syntax-name-expected.txt:
* js/script-tests/class-syntax-name.js:
(shouldBe):
(shouldBeTrue):
- Rebased expected result.

* js/function-toString-vs-name.html:
* js/script-tests/function-toString-vs-name.js:
- Added new tests for class.

* platform/mac/inspector/model/remote-object-expected.txt:
- Rebased expected result.

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

3 years agoCreating and releasing a WKBackForwardListItem crashes
andersca@apple.com [Fri, 11 Mar 2016 20:59:27 +0000 (20:59 +0000)]
Creating and releasing a WKBackForwardListItem crashes
https://bugs.webkit.org/show_bug.cgi?id=155376
rdar://problem/17377712

Reviewed by Dan Bernstein.

Make init unavailable.

* UIProcess/API/Cocoa/WKBackForwardListItem.h:

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

3 years agoiOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest...
cdumez@apple.com [Fri, 11 Mar 2016 20:26:09 +0000 (20:26 +0000)]
iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
https://bugs.webkit.org/show_bug.cgi?id=155256

Reviewed by Alexey Proskuryakov.

r197628 consolidated the runtime application checking code for iOS and
Mac. However, while the new code works fine for WebKit2, it is unsafe
on WebKit1 / iOS and hits assertion in debug. The reason is that
applicationBundleIdentifier() for getting called from several threads
(WebThread, UIThread).

To address the problem, this patch renames applicationBundleIdentifier()
to applicationBundleIdentifierOverride() and only initializes the
override upon WebProcess and Network process initialization. We therefore
do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
When the override is not set, we fall back to using the main bundle
identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
but without caching it to avoid thread safety issues.

No new tests, already covered by API tests currently crashing.

* platform/RuntimeApplicationChecks.mm:
(WebCore::applicationBundleIdentifierOverride):
- Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
  and only initialize upon initialization of the WebProcess or the Network
  process.
- In debug, set a flag to indicate that the override was already queried.

(WebCore::applicationBundleIdentifier):
New utility function that is returns the application bundle override if it is
set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.

(WebCore::setApplicationBundleIdentifier):
Add assertions to make sure that:
1. This is always called from the main thread.
2. The application bundle identifier has not been queried *before* getting
   overriden as this would indicate a bug in our code and we would have wrongly
   returned the main bundle identifier in such case.

(WebCore::MacApplication::isAppleMail):
(WebCore::MacApplication::isIBooks):
(WebCore::MacApplication::isITunes):
(WebCore::MacApplication::isMicrosoftMessenger):
(WebCore::MacApplication::isAdobeInstaller):
(WebCore::MacApplication::isMicrosoftOutlook):
(WebCore::MacApplication::isQuickenEssentials):
(WebCore::MacApplication::isAperture):
(WebCore::MacApplication::isVersions):
(WebCore::MacApplication::isHRBlock):
(WebCore::MacApplication::isHipChat):
(WebCore::IOSApplication::isMobileSafari):
(WebCore::IOSApplication::isDumpRenderTree):
(WebCore::IOSApplication::isMobileStore):
(WebCore::IOSApplication::isFacebook):
(WebCore::IOSApplication::isDaijisenDictionary):
(WebCore::IOSApplication::isNASAHD):
(WebCore::IOSApplication::isTheEconomistOnIphone):
(WebCore::IOSApplication::isWebProcess):
(WebCore::IOSApplication::isIBooks):
Drop assertions making sure the cached flag is correct. We now have
an assertion to detect this earlier in setApplicationBundleIdentifier().

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

3 years agoMarking imported/blink/fast/multicol/dynamic/multicol-with-abspos-svg-with-foreignobj...
ryanhaddad@apple.com [Fri, 11 Mar 2016 20:04:14 +0000 (20:04 +0000)]
Marking imported/blink/fast/multicol/dynamic/multicol-with-abspos-svg-with-foreignobject-with-multicol-crash.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=155339

Unreviewed test gardening.

This test is a flaky crash on ios-simulator debug.

* platform/ios-simulator/TestExpectations:

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

3 years agoFollow-up to:
bdakin@apple.com [Fri, 11 Mar 2016 19:54:13 +0000 (19:54 +0000)]
Follow-up to:

_WKPreviewAction should be in an internal header
https://bugs.webkit.org/show_bug.cgi?id=155370

Rubber-stamped by Dan Bernstein.

* UIProcess/API/Cocoa/_WKPreviewActionInternal.h:

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

3 years agoMarking inspector/heap/getPreview.html as flaky on mac-wk2
ryanhaddad@apple.com [Fri, 11 Mar 2016 19:37:17 +0000 (19:37 +0000)]
Marking inspector/heap/getPreview.html as flaky on mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=155312

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoWeb Audio becomes distorted after sample rate changes
jer.noble@apple.com [Fri, 11 Mar 2016 19:35:15 +0000 (19:35 +0000)]
Web Audio becomes distorted after sample rate changes
https://bugs.webkit.org/show_bug.cgi?id=154538
<rdar://problem/24771292>

Reviewed by Darin Adler.

When the underlying audio hardware sample rate changes, the AudioUnit render callback will begin asking
for fewer or more frames. For example, when the sample rate goes from 44.1kHz to 48kHz, it will ask for
118 samples instead of 128. (And vice-versa, 140 samples instead of 128.) But the Web Audio engine can only
really handle requests in multiples of 128 samples. In the case where there are requests for < 128 samples,
actually render 128, but save off the unrequested samples in a separate bus. Then fill that bus during the
next request.

* platform/audio/AudioBus.cpp:
(WebCore::AudioBus::copyFromRange): Added utility method.
* platform/audio/AudioBus.h:
* platform/audio/ios/AudioDestinationIOS.cpp:
(WebCore::AudioDestinationIOS::AudioDestinationIOS): Create a "spare" bus.
(WebCore::assignAudioBuffersToBus): Moved from inside render.
(WebCore::AudioDestinationIOS::render): Save off extra samples to the "spare" bus.
* platform/audio/ios/AudioDestinationIOS.h:

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

3 years agoMarking css3/masking/mask-luminance-svg.html and css3/masking/mask-svg-script-none...
ryanhaddad@apple.com [Fri, 11 Mar 2016 19:30:55 +0000 (19:30 +0000)]
Marking css3/masking/mask-luminance-svg.html and css3/masking/mask-svg-script-none-to-png.html as flaky
https://bugs.webkit.org/show_bug.cgi?id=155372.

Unreviewed test gardening.

These two tests are flaky crashes on ios-simulator debug.

* platform/ios-simulator/TestExpectations:

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

3 years ago_WKPreviewAction should be in an internal header
bdakin@apple.com [Fri, 11 Mar 2016 19:29:08 +0000 (19:29 +0000)]
_WKPreviewAction should be in an internal header
https://bugs.webkit.org/show_bug.cgi?id=155370

Reviewed by Tim Horton.

Move _WKPreviewAction to an Internal header since only the protocol needs to
be SPI.
* UIProcess/API/Cocoa/_WKPreviewAction.h:
* UIProcess/API/Cocoa/_WKPreviewAction.mm:
* UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Added.
* UIProcess/ios/WKContentViewInteraction.mm:
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoVersioning.
bshafiei@apple.com [Fri, 11 Mar 2016 19:03:55 +0000 (19:03 +0000)]
Versioning.

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

3 years ago[jhbuild] Disable LLVM OCaml bindings.
commit-queue@webkit.org [Fri, 11 Mar 2016 18:52:50 +0000 (18:52 +0000)]
[jhbuild] Disable LLVM OCaml bindings.
https://bugs.webkit.org/show_bug.cgi?id=153274

Patch by Frederic Wang <fwang@igalia.com> on 2016-03-11
Reviewed by Michael Catanzaro.

* gtk/jhbuild.modules: disable all (actually only OCaml) bindings for LLVM.

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

3 years agoUnreviewed build fix after r198023.
utatane.tea@gmail.com [Fri, 11 Mar 2016 18:48:42 +0000 (18:48 +0000)]
Unreviewed build fix after r198023.
https://bugs.webkit.org/show_bug.cgi?id=155024

Reviewed by Geoffrey Garen.

Update binding test results.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):

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

3 years agoUnreviewed, rolling out r197984.
ryanhaddad@apple.com [Fri, 11 Mar 2016 18:36:27 +0000 (18:36 +0000)]
Unreviewed, rolling out r197984.

This change caused an existing LayoutTest to fail

Reverted changeset:

"WebKit should not be redirected to an invalid URL"
https://bugs.webkit.org/show_bug.cgi?id=155263
http://trac.webkit.org/changeset/197984

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

3 years agoWeb Inspector: Make it possible to disable TimelineRuler UI
mattbaker@apple.com [Fri, 11 Mar 2016 18:30:13 +0000 (18:30 +0000)]
Web Inspector: Make it possible to disable TimelineRuler UI
https://bugs.webkit.org/show_bug.cgi?id=155348
<rdar://problem/25103505>

Reviewed by Timothy Hatcher.

Adds an "enabled" property to TimelineRuler, allowing the selection UI
to be disabled without removing the current selection.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler.allows-time-range-selection:not(.disabled)):
(.timeline-ruler > .selection-drag):
(.timeline-ruler:not(.disabled) > .selection-drag):
(.timeline-ruler:not(.disabled) > .selection-drag:active):
(.timeline-ruler.disabled > .selection-handle):
(.timeline-ruler.allows-time-range-selection): Deleted.
(.timeline-ruler > .selection-drag:active): Deleted.
Updated ruler styles for "disabled" state: pointer events are disabled,
selection handles hidden, and the default cursor is shown.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler):
(WebInspector.TimelineRuler.prototype.get enabled):
(WebInspector.TimelineRuler.prototype.set enabled):
New property.
(WebInspector.TimelineRuler.prototype._handleClick):
Corrected code which always reset the pointer events to "all", instead
of setting it back to the original value.

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

3 years agoUnreviewed, rolling out r197495.
commit-queue@webkit.org [Fri, 11 Mar 2016 18:02:27 +0000 (18:02 +0000)]
Unreviewed, rolling out r197495.
https://bugs.webkit.org/show_bug.cgi?id=155369

LLVM is needed to run update-webkitgtk-libs reliably
(Requested by mcatanzaro on #webkit).

Reverted changeset:

"[jhbuild] Remove LLVM dependency."
https://bugs.webkit.org/show_bug.cgi?id=153274
http://trac.webkit.org/changeset/197495

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

3 years agoUnreviewed, rolling out r197994.
commit-queue@webkit.org [Fri, 11 Mar 2016 17:51:00 +0000 (17:51 +0000)]
Unreviewed, rolling out r197994.
https://bugs.webkit.org/show_bug.cgi?id=155368

Broke several ARM tests (Requested by msaboff on #webkit).

Reverted changeset:

"[JSC] Add register reuse for ArithAdd of an Int32 and
constant in DFG"
https://bugs.webkit.org/show_bug.cgi?id=155164
http://trac.webkit.org/changeset/197994

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

3 years ago[ES6] Implement Reflect.set without receiver support
utatane.tea@gmail.com [Fri, 11 Mar 2016 17:28:46 +0000 (17:28 +0000)]
[ES6] Implement Reflect.set without receiver support
https://bugs.webkit.org/show_bug.cgi?id=155024

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements Reflect.set.
The challenge in this patch is Reflect.set requires boolean result of [[Set]],
this is not propagated in the previous JSC put implementation.

This patch changes the put and putByIndex signature from `void put(...)` and `void putByIndex(...)` to `bool put(...)` and `bool putByIndex(...)`,
more consistent style to the ECMA262 spec's [[Set]].

This patch modifies so many part of WebKit. But almost all the changes are mechanical ones.

Currently, this patch does not support receiver modification support.
This will be supported in the subsequent patch[1].

[1]: https://bugs.webkit.org/show_bug.cgi?id=155294

* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::put):
(JSC::JSCallbackObject<Parent>::putByIndex):
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::put):
* debugger/DebuggerScope.h:
* jsc.cpp:
(WTF::RuntimeArray::put):
* runtime/ClassInfo.h:
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::put):
* runtime/ClonedArguments.h:
* runtime/CustomGetterSetter.cpp:
(JSC::callCustomSetter):
* runtime/CustomGetterSetter.h:
* runtime/GenericArguments.h:
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::put):
(JSC::GenericArguments<Type>::putByIndex):
* runtime/GetterSetter.cpp:
(JSC::callSetter):
* runtime/GetterSetter.h:
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
(JSC::JSArray::put):
(JSC::JSArray::push):
* runtime/JSArray.h:
* runtime/JSArrayBuffer.cpp:
(JSC::JSArrayBuffer::put):
* runtime/JSArrayBuffer.h:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::put):
* runtime/JSArrayBufferView.h:
* runtime/JSCJSValue.cpp:
(JSC::JSValue::putToPrimitive):
(JSC::JSValue::putToPrimitiveByIndex):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::put):
(JSC::JSValue::putInline):
(JSC::JSValue::putByIndex):
* runtime/JSCell.cpp:
(JSC::JSCell::put):
(JSC::JSCell::putByIndex):
* runtime/JSCell.h:
* runtime/JSDataView.cpp:
(JSC::JSDataView::put):
* runtime/JSDataView.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
* runtime/JSFunction.h:
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::put):
(JSC::JSGenericTypedArrayView<Adaptor>::putByIndex):
* runtime/JSGlobalLexicalEnvironment.cpp:
(JSC::JSGlobalLexicalEnvironment::put):
* runtime/JSGlobalLexicalEnvironment.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::put):
* runtime/JSGlobalObject.h:
* runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::put):
* runtime/JSLexicalEnvironment.h:
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::put):
* runtime/JSModuleEnvironment.h:
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::put):
(JSC::JSModuleNamespaceObject::putByIndex):
* runtime/JSModuleNamespaceObject.h:
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSObject.cpp:
(JSC::JSObject::put):
(JSC::JSObject::putInlineSlow):
(JSC::JSObject::putByIndex):
(JSC::JSObject::putGetter):
(JSC::JSObject::putSetter):
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::putDirectCustomAccessor):
(JSC::JSObject::putDirectNonIndexAccessor):
(JSC::JSObject::putIndexedDescriptor):
(JSC::JSObject::defineOwnIndexedProperty):
(JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype):
(JSC::JSObject::attemptToInterceptPutByIndexOnHole):
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes):
(JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectNativeIntrinsicGetter):
(JSC::JSObject::putDirectNativeFunction):
(JSC::JSObject::putDirectMayBeIndex):
(JSC::validateAndApplyPropertyDescriptor):
* runtime/JSObject.h:
(JSC::JSObject::putByIndexInline):
(JSC::JSObject::putDirect):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putInline):
* runtime/JSProxy.cpp:
(JSC::JSProxy::put):
(JSC::JSProxy::putByIndex):
* runtime/JSProxy.h:
* runtime/JSSymbolTableObject.h:
(JSC::symbolTablePut):
(JSC::symbolTablePutTouchWatchpointSet):
(JSC::symbolTablePutInvalidateWatchpointSet):
(JSC::symbolTablePutWithAttributesTouchWatchpointSet):
* runtime/Lookup.h:
(JSC::putEntry):
(JSC::lookupPut):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::performPut):
(JSC::ProxyObject::put):
(JSC::ProxyObject::putByIndexCommon):
(JSC::ProxyObject::putByIndex):
* runtime/ProxyObject.h:
* runtime/PutPropertySlot.h:
* runtime/ReflectObject.cpp:
(JSC::reflectObjectSet):
* runtime/RegExpConstructor.cpp:
(JSC::setRegExpConstructorInput):
(JSC::setRegExpConstructorMultiline):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):
(JSC::regExpObjectSetLastIndexStrict):
(JSC::regExpObjectSetLastIndexNonStrict):
(JSC::RegExpObject::put):
* runtime/RegExpObject.h:
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::putEntry):
(JSC::SparseArrayEntry::put):
* runtime/SparseArrayValueMap.h:
* runtime/StringObject.cpp:
(JSC::StringObject::put):
(JSC::StringObject::putByIndex):
* runtime/StringObject.h:
* tests/es6.yaml:
* tests/modules/namespace.js:
* tests/stress/reflect-set.js: Added.
(shouldBe):
(shouldThrow):
(receiverCase.object2.set Cocoa):
(receiverCase):
(proxyCase):
(objectCase.set get shouldBe):
(objectCase.get shouldBe):
(arrayCase.set get shouldBe):
(arrayCase.get shouldBe):
(arrayBufferCase.set get shouldBe):
(arrayBufferCase.get shouldBe):
(set get shouldBe):
(get shouldBe):
(argumentCase.test1):
(argumentCase.test2):
(argumentCase.test3):
(argumentCase.test4.set get shouldBe):
(argumentCase.test5.get shouldBe):
(argumentStrictCase.test1):
(argumentStrictCase.test2):
(argumentStrictCase.test3):
(argumentStrictCase.test4.set get shouldBe):
(argumentStrictCase.test5.get shouldBe):
(stringObjectCase.set get shouldBe):
(stringObjectCase.get shouldBe):
(customSetter.test1):
(customSetter.test2):
(customSetter.test3):
(customSetter):
(regExpLastIndex):
(functionCase.func):

Source/WebCore:

CustomSetter returns boolean value that indicates the result of [[Set]].
According to this change, this patch modifies the CodeGeneratorJS and test results.

Currently, DOM elements' [[Set]] return true when the setter is found.
This is good for the first step.

* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::putDelegate):
* bindings/js/JSDOMBinding.cpp:
(WebCore::throwSetterTypeError):
* bindings/js/JSDOMBinding.h:
* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::putDelegate):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::put):
(WebCore::JSDOMWindow::putByIndex):
* bindings/js/JSHTMLAppletElementCustom.cpp:
(WebCore::JSHTMLAppletElement::putDelegate):
* bindings/js/JSHTMLEmbedElementCustom.cpp:
(WebCore::JSHTMLEmbedElement::putDelegate):
* bindings/js/JSHTMLObjectElementCustom.cpp:
(WebCore::JSHTMLObjectElement::putDelegate):
* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::putDelegate):
(WebCore::JSLocationPrototype::putDelegate):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginElementCustomPut):
* bindings/js/JSPluginElementFunctions.h:
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::putDelegate):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateImplementation):
(GeneratePrototypeDeclaration):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::setJSTestActiveDOMObjectConstructor):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::setJSTestCustomNamedGetterConstructor):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::setJSTestEventConstructorConstructor):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::setJSTestEventTargetConstructor):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::setJSTestExceptionConstructor):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::setJSTestGenerateIsReachableConstructor):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::setJSTestInterfaceConstructor):
(WebCore::JSTestInterface::put):
(WebCore::JSTestInterface::putByIndex):
(WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
(WebCore::setJSTestInterfaceImplementsStr2):
(WebCore::setJSTestInterfaceImplementsStr3):
(WebCore::setJSTestInterfaceImplementsNode):
(WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
(WebCore::setJSTestInterfaceSupplementalStr2):
(WebCore::setJSTestInterfaceSupplementalStr3):
(WebCore::setJSTestInterfaceSupplementalNode):
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::setJSTestJSBuiltinConstructorConstructor):
(WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::setJSTestMediaQueryListListenerConstructor):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::setJSTestNamedConstructorConstructor):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::setJSTestNodeConstructor):
(WebCore::setJSTestNodeName):
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::setJSTestNondeterministicConstructor):
(WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
(WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
(WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::setJSTestObjConstructor):
(WebCore::setJSTestObjConstructorStaticStringAttr):
(WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
(WebCore::setJSTestObjEnumAttr):
(WebCore::setJSTestObjByteAttr):
(WebCore::setJSTestObjOctetAttr):
(WebCore::setJSTestObjShortAttr):
(WebCore::setJSTestObjUnsignedShortAttr):
(WebCore::setJSTestObjLongAttr):
(WebCore::setJSTestObjLongLongAttr):
(WebCore::setJSTestObjUnsignedLongLongAttr):
(WebCore::setJSTestObjStringAttr):
(WebCore::setJSTestObjTestObjAttr):
(WebCore::setJSTestObjLenientTestObjAttr):
(WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
(WebCore::setJSTestObjXMLObjAttr):
(WebCore::setJSTestObjCreate):
(WebCore::setJSTestObjReflectedStringAttr):
(WebCore::setJSTestObjReflectedIntegralAttr):
(WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
(WebCore::setJSTestObjReflectedBooleanAttr):
(WebCore::setJSTestObjReflectedURLAttr):
(WebCore::setJSTestObjReflectedCustomIntegralAttr):
(WebCore::setJSTestObjReflectedCustomBooleanAttr):
(WebCore::setJSTestObjReflectedCustomURLAttr):
(WebCore::setJSTestObjTypedArrayAttr):
(WebCore::setJSTestObjAttrWithGetterException):
(WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithSetterException):
(WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
(WebCore::setJSTestObjStringAttrWithGetterException):
(WebCore::setJSTestObjStringAttrWithSetterException):
(WebCore::setJSTestObjStrictTypeCheckingAttribute):
(WebCore::setJSTestObjCustomAttr):
(WebCore::setJSTestObjOnfoo):
(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::setJSTestObjStrictFloat):
(WebCore::setJSTestObjId):
(WebCore::setJSTestObjReplaceableAttribute):
(WebCore::setJSTestObjNullableLongSettableAttribute):
(WebCore::setJSTestObjNullableStringSettableAttribute):
(WebCore::setJSTestObjNullableStringValue):
(WebCore::setJSTestObjAttributeWithReservedEnumType):
(WebCore::setJSTestObjPutForwardsAttribute):
(WebCore::setJSTestObjPutForwardsNullableAttribute):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::setJSTestOverloadedConstructorsConstructor):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::setJSTestOverrideBuiltinsConstructor):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
(WebCore::setJSTestSerializedScriptValueInterfaceValue):
(WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::setJSTestTypedefsConstructor):
(WebCore::setJSTestTypedefsUnsignedLongLongAttr):
(WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
(WebCore::setJSTestTypedefsAttrWithGetterException):
(WebCore::setJSTestTypedefsAttrWithSetterException):
(WebCore::setJSTestTypedefsStringAttrWithGetterException):
(WebCore::setJSTestTypedefsStringAttrWithSetterException):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::setJSattributeConstructor):
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::setJSreadonlyConstructor):
* bridge/c/c_runtime.cpp:
(JSC::Bindings::CField::setValueToInstance):
* bridge/c/c_runtime.h:
* bridge/jsc/BridgeJSC.h:
(JSC::Bindings::Instance::put):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcField::setValueToInstance):
(JSC::Bindings::ObjcArray::setValueAt):
(JSC::Bindings::ObjcFallbackObjectImp::put):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::put):
(JSC::RuntimeArray::putByIndex):
* bridge/runtime_array.h:
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::put):
* bridge/runtime_object.h:

Source/WebKit/mac:

As the same to NPJSObject, we just propagate the returned value of NetscapePluginInstanceProxy::setProperty.

* Plugins/Hosted/ProxyInstance.h:
* Plugins/Hosted/ProxyInstance.mm:
(WebKit::ProxyField::setValueToInstance):
(WebKit::ProxyInstance::setFieldValue):

Source/WebKit2:

NPJSObject::setProperty may call `methodTable()->put` operation, but we intentionally do not propagate it to the caller's ::put.
In the current implementation, we just use the result of ::setProperty call.
This is `true` when ::setProperty attempts to call `methodTable()->put`.
In ::setProperty, after calling `methodTable()->put`, ::setProperty function clears the exception state.
So this is not the same semantics to the simple data property store. Rather, this is like the accessor.
In ECMA262 [[Set]], it returns true if there is a setter. So we just use the returned value of ::setProperty.
This indicates that there is a setter for the given [[Set]] operation.

* WebProcess/Plugins/Netscape/JSNPObject.cpp:
(WebKit::JSNPObject::put):
* WebProcess/Plugins/Netscape/JSNPObject.h:

LayoutTests:

* js/dom/reflect-set-onto-dom-expected.txt: Added.
* js/dom/reflect-set-onto-dom.html: Added.
* js/dom/script-tests/reflect-set-onto-dom.js: Added.

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

3 years agoWeb Inspector: generated initWithPayload: protocol object initializers should recursi...
bburg@apple.com [Fri, 11 Mar 2016 16:57:20 +0000 (16:57 +0000)]
Web Inspector: generated initWithPayload: protocol object initializers should recursively decode array and object members
https://bugs.webkit.org/show_bug.cgi?id=155337
<rdar://problem/25098357>

Reviewed by Timothy Hatcher.

In cases where an object member is itself an object or array, we were
not calling initWithPayload: on the object member itself. So, this caused
a runtime error when constructing the outer object because the generated
code casted the NSDictionary/NSArray into the member's protocol object type.

* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.payload_to_objc_expression_for_member):
Do a straightforward call to initWithPayload: for objects. For arrays,
call a templated helper function which does the same thing. The helper
is used to make this array decoding fit into a single generated expression.

Rebaseline relevant test results.

* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

3 years agoREGRESSION (r197956): WebContent process crashes on launch due to unrecognized selector
ddkilzer@apple.com [Fri, 11 Mar 2016 15:54:35 +0000 (15:54 +0000)]
REGRESSION (r197956): WebContent process crashes on launch due to unrecognized selector
<http://webkit.org/b/155356>

Reviewed by Alexey Proskuryakov.

* platform/mac/ScrollableAreaMac.mm:
(WebCore::ScrollableArea::systemLanguageIsRTL): Add
-respondsToSelector: check.

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

3 years agoWTF should have a similar function as equalLettersIgnoringASCIICase to match beginnin...
youenn.fablet@crf.canon.fr [Fri, 11 Mar 2016 15:10:18 +0000 (15:10 +0000)]
WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
https://bugs.webkit.org/show_bug.cgi?id=153419

Reviewed by Darin Adler.

Source/WebCore:

Covered by added unint tests.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::isForbiddenHeaderName): Using startsWithLettersIgnoringASCIICase.

Source/WTF:

Introducing startsWithLettersIgnoringASCIICase, to check the beginning of a string.
Moving some code from WTF::equalLettersIgnoringASCIICaseCommonWithoutLength in
WTF::hasPrefixWithLettersIgnoringASCIICaseCommon to enable reuse in
WTF::startsWithLettersIgnoringASCIICaseCommon.

* wtf/text/StringCommon.h:
(WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
(WTF::equalLettersIgnoringASCIICaseCommonWithoutLength):
(WTF::startsWithLettersIgnoringASCIICaseCommonWithoutLength):
(WTF::startsWithLettersIgnoringASCIICaseCommon):
* wtf/text/StringImpl.h:
(WTF::startsWithLettersIgnoringASCIICase):
* wtf/text/WTFString.h:
(WTF::startsWithLettersIgnoringASCIICase):

Tools:

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST): Adding test case for startsWithLettersIgnoringASCIICase.

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

3 years ago[Fetch API] Use DeferredWrapper directly in FetchBody promise handling
youenn.fablet@crf.canon.fr [Fri, 11 Mar 2016 12:08:22 +0000 (12:08 +0000)]
[Fetch API] Use DeferredWrapper directly in FetchBody promise handling
https://bugs.webkit.org/show_bug.cgi?id=155291

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/request/request-consume-empty-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-consume-empty.html: Added.
* web-platform-tests/fetch/api/response/response-consume-empty-expected.txt: Added.
* web-platform-tests/fetch/api/response/response-consume-empty.html: Added.

Source/WebCore:

Moved from typed DOMPromise to DeferredWrapper as there can only be one promise resolved.
Started preparing the handling of blobs translation to other resolved types.

Fixed the case of empty body, in which case promises should resolve with empty objects (strings, buffers...) and not null.

Added Consumer structure to handle asynchronous resolution/rejection of promises.
Added preliminary API to resolve promises based on data stored as a Blob.
FetchBodyOwner will be responsible to do/stop blob loading.

Tests: imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.html
       imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.html

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::processIfEmptyOrDisturbed): Fixed empty body case.
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::loadingType):
(WebCore::FetchBody::consumeBlob):
(WebCore::FetchBody::resolveAsJSON):
(WebCore::FetchBody::loadingFailed):
(WebCore::FetchBody::loadedAsBlob):
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::formData):
(WebCore::FetchBody::Consumer::Consumer):
* Modules/fetch/FetchBody.idl:
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
(WebCore::FetchBodyOwner::loadBlob):

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

3 years agoAvoid applying link tags with an invalid media attribute
yoav@yoav.ws [Fri, 11 Mar 2016 11:13:25 +0000 (11:13 +0000)]
Avoid applying link tags with an invalid media attribute
https://bugs.webkit.org/show_bug.cgi?id=143262

Reviewed by Brent Fulgham.

Source/WebCore:

In current HTML spec, unlike HTML4, the UA must not apply <link> based resources
when the media attribute does not match:
https://html.spec.whatwg.org/multipage/semantics.html#attr-link-media

An invalid media attribute parsing creates a non-empty MediaQuerySet
containing a single query with no expressions and no media type.
(and with its m_ignored flag off)

In order to ignore such MediaQueries, I added an extra check that makes sure
that the queries handled by MediaQueryEvaluator::eval have either expressions
or a media type, and if not, they are ignored.

Test: fast/dom/HTMLLinkElement/link-stylesheet-invalid-media.html

* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::eval):

LayoutTests:

These tests make sure that when <link rel=stylesheet> is present with an invalid
media attribute, the styles are not being applied.

* fast/dom/HTMLLinkElement/link-stylesheet-invalid-media-expected.txt: Added.
* fast/dom/HTMLLinkElement/link-stylesheet-invalid-media.html: Added.
* fast/dom/HTMLLinkElement/link-stylesheet-media-type-expected.txt: Added.
* fast/dom/HTMLLinkElement/link-stylesheet-media-type.html: Added.

These tests test the old HTML4 behavior and are no longer relevant.
* fast/media/media-descriptor-syntax-05.html: Removed.
* fast/media/media-descriptor-syntax-05-expected.html: Removed.

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

3 years agoSkip content-editable-as-textarea.html on GTK as it uses AX API.
fred.wang@free.fr [Fri, 11 Mar 2016 10:04:35 +0000 (10:04 +0000)]
Skip content-editable-as-textarea.html on GTK as it uses AX API.

Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2016-03-11

* platform/gtk/TestExpectations:

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

3 years ago[CallWith=ScriptExecutionContext] should pass ScriptExecutionContext to the implement...
youenn.fablet@crf.canon.fr [Fri, 11 Mar 2016 09:44:53 +0000 (09:44 +0000)]
[CallWith=ScriptExecutionContext] should pass ScriptExecutionContext to the implementation by reference
https://bugs.webkit.org/show_bug.cgi?id=155297

Reviewed by Darin Adler.

Changing the binding generator to pass ScriptExecutionContext by reference.
Updating DOM classes accordingly.

Covered by existing tests.

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/MediaKeys.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::error):
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
* Modules/fetch/FetchResponse.h:
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::continueFunction):
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::lowerValue):
(WebCore::IDBKeyRange::upperValue):
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
* Modules/indexeddb/IDBKeyRange.h:
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::continueFunction):
(WebCore::IDBClient::IDBCursor::deleteFunction):
* Modules/indexeddb/client/IDBCursorImpl.h:
* Modules/indexeddb/client/IDBFactoryImpl.cpp:
(WebCore::IDBClient::shouldThrowSecurityException):
(WebCore::IDBClient::IDBFactory::getDatabaseNames):
(WebCore::IDBClient::IDBFactory::open):
(WebCore::IDBClient::IDBFactory::openInternal):
(WebCore::IDBClient::IDBFactory::deleteDatabase):
(WebCore::IDBClient::IDBFactory::cmp):
* Modules/indexeddb/client/IDBFactoryImpl.h:
* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::IDBIndex):
(WebCore::IDBClient::IDBIndex::openCursor):
(WebCore::IDBClient::IDBIndex::count):
(WebCore::IDBClient::IDBIndex::openKeyCursor):
(WebCore::IDBClient::IDBIndex::get):
(WebCore::IDBClient::IDBIndex::getKey):
* Modules/indexeddb/client/IDBIndexImpl.h:
* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::create):
(WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
(WebCore::IDBClient::IDBObjectStore::openCursor):
(WebCore::IDBClient::IDBObjectStore::get):
(WebCore::IDBClient::IDBObjectStore::deleteFunction):
(WebCore::IDBClient::IDBObjectStore::doDelete):
(WebCore::IDBClient::IDBObjectStore::modernDelete):
(WebCore::IDBClient::IDBObjectStore::clear):
(WebCore::IDBClient::IDBObjectStore::createIndex):
(WebCore::IDBClient::IDBObjectStore::index):
(WebCore::IDBClient::IDBObjectStore::count):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:
* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
(WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
(WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::IDBRequest):
* Modules/indexeddb/client/IDBRequestImpl.h:
* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::objectStore):
(WebCore::IDBClient::IDBTransaction::createObjectStore):
(WebCore::IDBClient::IDBTransaction::createIndex):
* Modules/mediasource/DOMURLMediaSource.cpp:
(WebCore::DOMURLMediaSource::createObjectURL):
* Modules/mediasource/DOMURLMediaSource.h:
* Modules/mediastream/DOMURLMediaStream.cpp:
(WebCore::DOMURLMediaStream::createObjectURL):
* Modules/mediastream/DOMURLMediaStream.h:
* Modules/mediastream/HTMLMediaElementMediaStream.cpp:
(WebCore::HTMLMediaElementMediaStream::setSrcObject):
* Modules/mediastream/HTMLMediaElementMediaStream.h:
* Modules/mediastream/HTMLMediaElementMediaStream.idl:
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::create):
(WebCore::Notification::permission):
(WebCore::Notification::requestPermission):
* Modules/notifications/Notification.h:
* Modules/notifications/NotificationCenter.cpp:
(WebCore::NotificationCenter::createNotification):
* Modules/notifications/NotificationClient.h:
* Modules/quota/StorageInfo.cpp:
(WebCore::StorageInfo::queryUsageAndQuota):
(WebCore::StorageInfo::requestQuota):
* Modules/quota/StorageInfo.h:
* Modules/quota/StorageQuota.h:
* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::JSIDBObjectStore::createIndex):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithScriptExecutionContextAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::readAsArrayBuffer):
(WebCore::FileReaderSync::readAsBinaryString):
(WebCore::FileReaderSync::readAsText):
(WebCore::FileReaderSync::readAsDataURL):
(WebCore::FileReaderSync::startLoading):
* fileapi/FileReaderSync.h:
(WebCore::FileReaderSync::readAsText):
* html/DOMURL.cpp:
(WebCore::DOMURL::createObjectURL):
(WebCore::DOMURL::createPublicURL):
(WebCore::DOMURL::revokeObjectURL):
* html/DOMURL.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
* html/HTMLMediaElement.h:
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
* page/DOMWindow.h:
* page/History.h:
(WebCore::History::back):
(WebCore::History::forward):
(WebCore::History::go):

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

3 years agoUnreviewed, fix Changelog. git merged poorly.
keith_miller@apple.com [Fri, 11 Mar 2016 07:52:17 +0000 (07:52 +0000)]
Unreviewed, fix Changelog. git merged poorly.

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

3 years ago[ES6] Make RegExp.prototype.toString spec compliant
keith_miller@apple.com [Fri, 11 Mar 2016 07:13:10 +0000 (07:13 +0000)]
[ES6] Make RegExp.prototype.toString spec compliant
https://bugs.webkit.org/show_bug.cgi?id=155341

Patch by Saam barati <sbarati@apple.com> on 2016-03-10
Reviewed by Filip Pizlo.

Before we were directly calling into the flagsString
function. Instead, we must get the "flags" property
of the thisObject. This will usually call into the flags
getter, but not always. Specifically, you can you a Proxy
to observe this behavior.

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterGlobal):
* tests/es6.yaml:
* tests/es6/Proxy_internal_get_calls_RegExp.prototype.toString.js: Added.
(test.get var):
(test.):
* tests/stress/regexp-prototype-tostring.js: Added.
(assert):
(test):
(test.get var):
(test.):
(let.handler.get switch):
(let.handler):
(get test):
(test.get RegExp):

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

3 years ago[ES6] Make RegExp.prototype.toString spec compliant
sbarati@apple.com [Fri, 11 Mar 2016 07:10:18 +0000 (07:10 +0000)]
[ES6] Make RegExp.prototype.toString spec compliant
https://bugs.webkit.org/show_bug.cgi?id=155341

Reviewed by Filip Pizlo.

Before we were directly calling into the flagsString
function. Instead, we must get the "flags" property
of the thisObject. This will usually call into the flags
getter, but not always. Specifically, you can you a Proxy
to observe this behavior.

* runtime/RegExpPrototype.cpp:
(JSC::regExpProtoFuncToString):
(JSC::regExpProtoGetterGlobal):
* tests/es6.yaml:
* tests/es6/Proxy_internal_get_calls_RegExp.prototype.toString.js: Added.
(test.get var):
(test.):
* tests/stress/regexp-prototype-tostring.js: Added.
(assert):
(test):
(test.get var):
(test.):
(let.handler.get switch):
(let.handler):
(get test):
(test.get RegExp):

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

3 years ago[GTK] Fix rendering of slider input elements
carlosgc@webkit.org [Fri, 11 Mar 2016 07:05:01 +0000 (07:05 +0000)]
[GTK] Fix rendering of slider input elements
https://bugs.webkit.org/show_bug.cgi?id=155296

Reviewed by Michael Catanzaro.

Use the new gadgets for newer GTK+ and improve a bit the rendering
for previous versions to better match GTK+.

* rendering/RenderThemeGtk.cpp:
(WebCore::createStyleContext): Add ScaleContents and
ScaleHighlight parts that are only used with GTK+ 3.19.
(WebCore::RenderThemeGtk::paintSliderTrack): Use a smaller trough,
centered in the given rectangle to better match GTK+. Also render
the hightlight gadget with GTK+ 3.19.
(WebCore::RenderThemeGtk::paintSliderThumb): Also create the style
context for contents gadget.
(WebCore::RenderThemeGtk::adjustSliderThumbSize): Take into
account the slider border when calculating the slider thumb size.

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

3 years ago[GTK] Scrollbars are broken once again with current GTK+ master
carlosgc@webkit.org [Fri, 11 Mar 2016 06:59:57 +0000 (06:59 +0000)]
[GTK] Scrollbars are broken once again with current GTK+ master
https://bugs.webkit.org/show_bug.cgi?id=155292

Reviewed by Michael Catanzaro.

Most of the trough theming properties have been moved to the
scrollbar, and a new gadget "contents" has been added between the
scrollbar and its children.

* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
left/bottom style classes to ensure the scrollbars border is taken
into account and rendered.
(WebCore::ScrollbarThemeGtk::paintTrackBackground): Also create
style context for contents gadget.
(WebCore::ScrollbarThemeGtk::paintThumb): Ditto.
(WebCore::ScrollbarThemeGtk::paintButton): Ditto.
(WebCore::ScrollbarThemeGtk::scrollbarThickness): Take the
scrollbar border into account.
(WebCore::ScrollbarThemeGtk::buttonSize): Also create style
context for contents gadget.
(WebCore::ScrollbarThemeGtk::getStepperSpacing): Ditto.
(WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto.
(WebCore::ScrollbarThemeGtk::thumbFatness): Ditto.
(WebCore::ScrollbarThemeGtk::getTroughBorder): Take the scrollbar
border into account.

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

3 years agoREGRESSION (r197986): Don't try to link to undefined $(WEBKIT_SYSTEM_INTERFACE_LIBRARY)
ddkilzer@apple.com [Fri, 11 Mar 2016 06:47:10 +0000 (06:47 +0000)]
REGRESSION (r197986): Don't try to link to undefined $(WEBKIT_SYSTEM_INTERFACE_LIBRARY)

Follow-up build fix for:
    AX: Force allow user zoom
    <https://bugs.webkit.org/show_bug.cgi?id=155056>

Fixes the following build failure:
    ld: library not found for -l-lAccessibility
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

* Configurations/WebKit.xcconfig: Remove
"-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)" from OTHER_LDFLAGS since
that macro is not defined, and there is no need to link to
libWebKitSystemInterface.a.

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

3 years agoREGRESSION (r197983): Build fails due to missing inline method
ddkilzer@apple.com [Fri, 11 Mar 2016 06:12:52 +0000 (06:12 +0000)]
REGRESSION (r197983): Build fails due to missing inline method

Attempt to fix the following build failure:

    Undefined symbols for architecture arm64:
      "JSC::GenericTypedArrayView<JSC::Uint8ClampedAdaptor>::createUninitialized(unsigned int)", referenced from:
          WebCore::ImageBufferData::getData(WebCore::IntRect const&, WebCore::IntSize const&, bool, bool, float) const in ImageBufferDataCG.o

* platform/graphics/cg/ImageBufferDataCG.cpp: Include some
headers to match FEGaussianBlur.cpp and FilterEffect.cpp.

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

3 years ago[JSC] Add register reuse for ArithAdd of an Int32 and constant in DFG
commit-queue@webkit.org [Fri, 11 Mar 2016 06:04:49 +0000 (06:04 +0000)]
[JSC] Add register reuse for ArithAdd of an Int32 and constant in DFG
https://bugs.webkit.org/show_bug.cgi?id=155164

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-10
Reviewed by Geoffrey Garen.

Every "inc" in loop was looking like this:
    move rX, rY
    inc rY
    jo 0x230f4a200580

This patch add register Reuse to that case to remove
the extra "move".

* dfg/DFGOSRExit.h:
(JSC::DFG::SpeculationRecovery::SpeculationRecovery):
(JSC::DFG::SpeculationRecovery::immediate):
* dfg/DFGOSRExitCompiler32_64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGOSRExitCompiler64.cpp:
(JSC::DFG::OSRExitCompiler::compileExit):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithAdd):
* tests/stress/arith-add-with-constant-overflow.js: Added.
(opaqueAdd):

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

3 years agoTry to fix the iOS 9 build.
timothy_horton@apple.com [Fri, 11 Mar 2016 05:09:03 +0000 (05:09 +0000)]
Try to fix the iOS 9 build.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/spi/cocoa/DataDetectorsCoreSPI.h:

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

3 years agoREGRESSION (r197976): Build failure due to missing DDOptionalSource.h header
ddkilzer@apple.com [Fri, 11 Mar 2016 05:01:06 +0000 (05:01 +0000)]
REGRESSION (r197976): Build failure due to missing DDOptionalSource.h header

Follow-up fix for:
    Expose additional WKDataDetectorTypes.
    <https://bugs.webkit.org/show_bug.cgi?id=155331>

* platform/spi/cocoa/DataDetectorsCoreSPI.h: Protect
DDOptionalSource.h with version check.

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

3 years agoFix Windows build after r197986.
achristensen@apple.com [Fri, 11 Mar 2016 04:52:21 +0000 (04:52 +0000)]
Fix Windows build after r197986.

* accessibility/AccessibilityObject.h:

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

3 years agoSet AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
jer.noble@apple.com [Fri, 11 Mar 2016 04:50:10 +0000 (04:50 +0000)]
Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
https://bugs.webkit.org/show_bug.cgi?id=155117
rdar://problem/6802240

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-03-10
Reviewed by Simon Fraser.

Source/WebCore:

No new tests because no new functionality was added.

This will prevent persistent media caches when webkit is using in memory caching.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache): Added.
* html/HTMLMediaElement.h: Declare mediaPlayerShouldUsePersistentCache().
* page/ChromeClient.h: Declare mediaPlayerShouldUsePersistentCache().
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldUsePersistentCache): Added.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Set property on AVAssetOptions.

Source/WebKit/mac:

Implement mediaShouldUsePersistentCache to disable media caching when NSURLCache is disabled.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::mediaShouldUsePersistentCache): Added.

Source/WebKit2:

Make AVAsset AVURLAssetUsesNoPersistentCacheKey match !m_websiteDataStore->isPersistent()
This will prevent persistent media caches when webkit is using in-memory caching.

* Shared/WebPageCreationParameters.cpp: Add mediaShouldUsePersistentCache.
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Add mediaShouldUsePersistentCache.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mediaShouldUsePersistentCache): Added.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_mediaUsesPersistentCache): Added.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::mediaShouldUsePersistentCache): Added.

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

3 years agoCRASH at WebCore::RenderView::updateVisibleViewportRect
jer.noble@apple.com [Fri, 11 Mar 2016 04:25:51 +0000 (04:25 +0000)]
CRASH at WebCore::RenderView::updateVisibleViewportRect
https://bugs.webkit.org/show_bug.cgi?id=155209
<rdar://problem/23997530>

Reviewed by Simon Fraser.

Source/WebCore:

Test: media/video-crash-invisible-autoplay-display-none.html

Between the time when the video element's renderer is created and destroyed, we may have unset the
InvisibleAutoplayNotPermitted restriction. So rather than check for that restriction before
unregistering for the "visible in viewport" notification, unregister only if the renderer
was previously registered.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::willDetachRenderers):

LayoutTests:

(These files were mistakenly landed in a previous commit:)
* media/video-crash-invisible-autoplay-display-none-expected.txt: Added.
* media/video-crash-invisible-autoplay-display-none.html: Added.

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

3 years agoUnreviewed build fix after r197953; correct the settings added in r197953.
jer.noble@apple.com [Fri, 11 Mar 2016 04:16:55 +0000 (04:16 +0000)]
Unreviewed build fix after r197953; correct the settings added in r197953.

* WebView.cpp:
(WebView::notifyPreferencesChanged):

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

3 years agoSimple line layout: Add text-align: justify support.
zalan@apple.com [Fri, 11 Mar 2016 04:03:32 +0000 (04:03 +0000)]
Simple line layout: Add text-align: justify support.
https://bugs.webkit.org/show_bug.cgi?id=155006

Reviewed by Antti Koivisto.

Source/WebCore:

This patch enables text-align: justify; for simple line layout (only latin text for now).
It speeds up/reduced memory consumption for justified text.

PerformanceTests/Layout/line-layout-simple.html
before text-align: justify support -> mean: 86.20513022288704 runs/s
after -> mean: 96.73972475626084 runs/s

Covered by existing text-align: justify tests.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):
(WebCore::SimpleLineLayout::LineState::expansionOpportunityCount):
(WebCore::SimpleLineLayout::LineState::expansionOportunity):
(WebCore::SimpleLineLayout::expansionBehavior):
(WebCore::SimpleLineLayout::justifyRuns):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::createTextRuns):
(WebCore::SimpleLineLayout::printReason):
(WebCore::SimpleLineLayout::canUseForStyle): Deleted.
* rendering/SimpleLineLayout.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/SimpleLineLayoutResolver.h:
(WebCore::SimpleLineLayout::RunResolver::Run::expansion):
(WebCore::SimpleLineLayout::RunResolver::Run::expansionBehavior):

LayoutTests:

Rebaseline based on simple line layout output.

* fast/text/whitespace/023-expected.txt:
* platform/mac/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt:

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

3 years agoAX: Force allow user zoom
n_wang@apple.com [Fri, 11 Mar 2016 03:57:52 +0000 (03:57 +0000)]
AX: Force allow user zoom
https://bugs.webkit.org/show_bug.cgi?id=155056

Reviewed by Simon Fraser.

Source/WebCore:

Override the maximum/minimum scale factor when forceAlwaysUserScalable is true.

Test: fast/viewport/ios/force-always-user-scalable.html

* Configurations/WebCoreTestSupport.xcconfig:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScale):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::Internals):
(WebCore::Internals::composedTreeAsText):
(WebCore::Internals::setViewportForceAlwaysUserScalable):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Linked libAccessibility library so that we can observe the accessibility
setting change for the force always user scalable feature.

* Configurations/WebKit.xcconfig:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowPictureInPictureMediaPlayback):
(forceAlwaysUserScalableChangedCallback):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView dealloc]):
(-[WKWebView _navigationGestureDidEnd]):
(-[WKWebView _updateForceAlwaysUserScalable]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
(WebKit::WebPageProxy::updateForceAlwaysUserScalable):
(WebKit::WebPageProxy::setMaximumUnobscuredSize):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::disableInspectorNodeSearch):
(WebKit::WebPage::updateForceAlwaysUserScalable):
(WebKit::innerFrameQuad):

LayoutTests:

* fast/viewport/ios/force-always-user-scalable-expected.txt: Added.
* fast/viewport/ios/force-always-user-scalable.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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

3 years agoUnreviewed, build fix for r197983, hopefully.
keith_miller@apple.com [Fri, 11 Mar 2016 03:52:15 +0000 (03:52 +0000)]
Unreviewed, build fix for r197983, hopefully.

* API/WebKitAvailability.h:

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

3 years agoWebKit should not be redirected to an invalid URL
jiewen_tan@apple.com [Fri, 11 Mar 2016 02:58:47 +0000 (02:58 +0000)]
WebKit should not be redirected to an invalid URL
https://bugs.webkit.org/show_bug.cgi?id=155263
<rdar://problem/22820172>

Reviewed by Brent Fulgham.

Source/WebCore:

Test: http/tests/navigation/redirect-to-invalid-url.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):

LayoutTests:

* http/tests/navigation/redirect-to-invalid-url-expected.txt: Added.
* http/tests/navigation/redirect-to-invalid-url.html: Added.
* http/tests/navigation/resources/redirect-to-invalid-url-frame.php: Added.

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

3 years agoTyped Arrays have no public facing API
keith_miller@apple.com [Fri, 11 Mar 2016 02:46:03 +0000 (02:46 +0000)]
Typed Arrays have no public facing API
https://bugs.webkit.org/show_bug.cgi?id=120112

Reviewed by Geoffrey Garen.

This patch adds a new C-API (an Obj-C API will follow in the future) for Typed Arrays. The API has two sets of
functions. One for Typed Arrays and another for Array Buffers. This API is intended to reflect the use of Typed
Array objects in JS code. There is a method for each of the core TypedArray and Array Buffer methods.
Originally, we were planning on using a separate non-JS object as the backing store instead of a JS Array Buffer
but we decide to defer that idea since there was no good CF/NS API that met all the constraints we needed
(Discussed further below). We also wanted to want until Shared Array Buffers had reached a more finished state
to see what impact they might have on an API.

The API has the following Typed Array construction methods:
1) Create with length (the backing buffer is zero initialized). -- JSObjectMakeTypedArray
2) Create with an existing pointer and a destructor. -- JSObjectMakeTypedArrayFromBytesNoCopy
3) Create with an Array Buffer object. -- JSObjectMakeTypedArrayFromArrayBuffer
4) Create with an Array Buffer object with a given offset and length. -- JSObjectMakeTypedArrayFromArrayBufferWithOffset

The API has the following functions on Typed Array JSObjectRefs:
5) Get access to a temporary void* of the backing store's data. -- JSObjectGetTypedArrayBytesPtr
6) Get the length of a Typed Array object (returns 0 if it is not a Typed Array object). -- JSObjectGetTypedArrayLength
7) Get the byte length of a Typed Array object (returns 0 if it is not a Typed Array object). -- JSObjectGetTypedArrayByteLength
8) Get the byte offset of a Typed Array object (returns 0 if it is not a Typed Array object). -- JSObjectGetTypedArrayByteOffset
9) Get a Typed Array object's Array Buffer  backing store. -- JSObjectGetTypedArrayBuffer

The API has the following Array Buffer construction method:
10) Create with an existing pointer and a destructor. -- JSObjectMakeArrayBufferWithBytesNoCopy

The API has the following functions on Array Buffer JSObjectRefs:
11) Get access to a temporary void* of the backing store's data. -- JSObjectGetArrayBufferBytesPtr
12) Get the byte length of an Array Buffer object (returns 0 if it is not an Array Buffer object). -- JSObjectGetArrayBufferByteLength

The API adds the following new typedefs and enumerations:
13) A typedef representing the function pointer type used to deallocate byte pointers provided to constructors. -- JSTypedArrayByesDeallocator
14) An enumeration indicating the Typed Array API type of a JSValueRef. -- JSTypedArrayType

Finally, The API has the following function to get Typed Array Types:
15)  Get the Typed Array type of a JS value. -- JSValueGetTypedArrayType

There are a couple of things to note about these functions. Calling JSObjectGetTypedArrayBytesPtr (5) or
JSObjectGetArrayBufferBytesPtr (12) will pin and lock the ArrayBuffer's data for the remaining lifetime of that
ArrayBuffer. This is because, currently, we do not have finalizers for our Array Buffers or Typed Arrays with a
backing ArrayBuffer and adding one would likely incur a non-trivial cost to GC. Also, we do not have a direct
way to make a Typed Array from a pointer with an offset as we do not expect using offsets to be a common use
case of the API.

While it would have been nice to integrate our backing store with CFData or one of its subclasses, it is not
possible to force a CFData/CFMutableData to be both writable and have a fixed size/backing store pointer.
NSData is not writable and CFMutableData can have a fixed pointer if it is allocated with a non-zero capacity
but there is no way for us to force an existing CFMutableData into this state.

* API/APIUtils.h: Copied from Source/JavaScriptCore/runtime/ArrayBuffer.cpp.
(handleExceptionIfNeeded):
(setException):
* API/JSBase.h:
* API/JSObjectRef.cpp:
(handleExceptionIfNeeded): Deleted.
* API/JSTypedArray.cpp: Added.
(toJSTypedArrayType):
(toTypedArrayType):
(createTypedArray):
(JSValueGetTypedArrayType):
(JSObjectMakeTypedArray):
(JSObjectMakeTypedArrayWithBytesNoCopy):
(JSObjectMakeTypedArrayWithArrayBuffer):
(JSObjectMakeTypedArrayWithArrayBufferAndOffset):
(JSObjectGetTypedArrayBytesPtr):
(JSObjectGetTypedArrayLength):
(JSObjectGetTypedArrayByteLength):
(JSObjectGetTypedArrayByteOffset):
(JSObjectGetTypedArrayBuffer):
(JSObjectMakeArrayBufferWithBytesNoCopy):
(JSObjectGetArrayBufferBytesPtr):
(JSObjectGetArrayBufferByteLength):
* API/JSTypedArray.h: Added.
* API/JSValueRef.cpp:
(handleExceptionIfNeeded): Deleted.
* API/JSValueRef.h:
* API/JavaScript.h:
* API/WebKitAvailability.h:
* API/tests/TypedArrayCTest.cpp: Added.
(id):
(freePtr):
(assertEqualsAsNumber):
(testAccess):
(testConstructors):
(forEachTypedArrayType):
(testTypedArrayCAPI):
* API/tests/TypedArrayCTest.h: Added.
* API/tests/testapi.c:
(main):
* CMakeLists.txt:
* ForwardingHeaders/JavaScriptCore/JSTypedArray.h: Added.
* JavaScriptCore.xcodeproj/project.pbxproj:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* runtime/ArrayBuffer.cpp:
(JSC::ArrayBuffer::transfer):
* runtime/ArrayBuffer.h:
(JSC::arrayBufferDestructorNull):
(JSC::arrayBufferDestructorDefault):
(JSC::ArrayBufferContents::ArrayBufferContents):
(JSC::ArrayBufferContents::transfer):
(JSC::ArrayBuffer::createAdopted):
(JSC::ArrayBuffer::createFromBytes):
(JSC::ArrayBuffer::ArrayBuffer):
(JSC::ArrayBuffer::pinAndLock):
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBufferContents::~ArrayBufferContents):
* shell/PlatformWin.cmake:

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

3 years agoAX: Implement bounds/position and index related text marker functions using TextIterator
n_wang@apple.com [Fri, 11 Mar 2016 02:37:46 +0000 (02:37 +0000)]
AX: Implement bounds/position and index related text marker functions using TextIterator
https://bugs.webkit.org/show_bug.cgi?id=154976

Reviewed by Chris Fleizach.

Source/WebCore:

Implemented position and index related text marker calls with TextIterator. Also fixed some
VoiceOver navigation issues.

Test: accessibility/mac/text-marker-for-index.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
(WebCore::AXObjectCache::shouldSkipBoundary):
(WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
(WebCore::AXObjectCache::startCharacterOffsetOfWord):
(WebCore::AXObjectCache::nextBoundary):
(WebCore::AXObjectCache::previousBoundary):
(WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
(WebCore::AXObjectCache::localCaretRectForCharacterOffset):
(WebCore::AXObjectCache::absoluteCaretBoundsForCharacterOffset):
(WebCore::AXObjectCache::characterOffsetForPoint):
(WebCore::AXObjectCache::characterOffsetForBounds):
(WebCore::AXObjectCache::endCharacterOffsetOfLine):
(WebCore::AXObjectCache::startCharacterOffsetOfLine):
(WebCore::AXObjectCache::characterOffsetForIndex):
(WebCore::AXObjectCache::indexForCharacterOffset):
(WebCore::AXObjectCache::rootAXEditableElement):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::visiblePositionRangeForRange):
(WebCore::AccessibilityObject::rangeForPlainTextRange):
(WebCore::AccessibilityObject::lineRangeForPosition):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::boundsForVisiblePositionRange):
(WebCore::AccessibilityObject::boundsForRange):
(WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
(WebCore::AccessibilityObject::doAXStringForRange):
(WebCore::AccessibilityObject::doAXBoundsForRange):
(WebCore::AccessibilityObject::doAXBoundsForRangeUsingCharacterOffset):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::nodeIsTextControl):
(WebCore::AccessibilityRenderObject::boundsForRects):
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
(WebCore::AccessibilityRenderObject::boundsForRange):
(WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
(WebCore::AccessibilityRenderObject::doAXBoundsForRange):
(WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset):
(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper positionForTextMarker:]):
(-[WebAccessibilityObjectWrapper textMarkerRange]):
(-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
(-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
(-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
(-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
(-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
(-[WebAccessibilityObjectWrapper _convertToNSRange:]):
(-[WebAccessibilityObjectWrapper _indexForTextMarker:]):
(-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
* editing/htmlediting.cpp:
(WebCore::localCaretRectInRendererForCaretPainting):
(WebCore::localCaretRectInRendererForRect):
* editing/htmlediting.h:

LayoutTests:

* accessibility/mac/text-marker-for-index-expected.txt: Added.
* accessibility/mac/text-marker-for-index.html: Added.
* accessibility/mac/text-marker-word-nav-expected.txt:
* accessibility/mac/text-marker-word-nav.html:

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

3 years agoFont antialiasing (smoothing) changes when elements are rendered into compositing...
simon.fraser@apple.com [Fri, 11 Mar 2016 01:49:22 +0000 (01:49 +0000)]
Font antialiasing (smoothing) changes when elements are rendered into compositing layers
https://bugs.webkit.org/show_bug.cgi?id=23364

Reviewed by Tim Horton.

Source/WebCore:

Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
by opting in to a new CALayer backing store format.

GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
when the platform has support for the new feature. Ideally this would only be set when
we know a layer has smoothed text drawn into it, but, for now, enable this for all
layers. The right thing happens with opaque layers under the hood.

setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
is ultimately passed to setBackingStoreFormat().

We also need to propagate this flag to TileController tiles.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsSmoothedLayerText):
(WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
(WebCore::GraphicsLayer::smoothedLayerTextEnabled):
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::supportsSmoothedFonts):
(WebCore::GraphicsLayer::setSupportsSmoothedFonts):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsSmoothedLayerText):
(WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
(WebCore::GraphicsLayer::smoothedLayerTextEnabled):
(WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateContentsFormat):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
the contents format says we support smoothed fonts.
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setTileContentsFormatFlags):
(WebCore::TileController::createTileLayer):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::updateTileLayerProperties):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::setBackingStoreFormat):
(PlatformCALayerCocoa::commonInit):
(PlatformCALayerCocoa::setContentsFormat):
(PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
non-opaque layers to improve text appearance. We no longer need to do that when
the contents format has "SmoothedFonts".
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::setContentsFormat):
(PlatformCALayerWin::contentsFormat):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/ios/LegacyTileGridTile.mm:
(WebCore::setBackingStoreFormat):
(WebCore::LegacyTileGridTile::LegacyTileGridTile):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):

Source/WebKit/mac:

Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
can disable it.

* WebView/WebView.mm:
(+[WebView _setSmoothedLayerTextEnabled:]):
(+[WebView _smoothedLayerTextEnabled]):
* WebView/WebViewPrivate.h:

Source/WebKit2:

Send the ContentsFormat to the UI process (but nothing happens to it there yet).

Allow internal clients to turn off smoothed layer text, so that WebKitTestRunner
can disable it.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
* UIProcess/API/C/WKContext.cpp:
(WKContextEnableSmoothedLayerText):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::enableSmoothedLayerText):
(WebKit::WebProcessPool::WebProcessPool): Deleted.
* UIProcess/WebProcessPool.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::setContentsFormat):
(WebKit::PlatformCALayerRemote::contentsFormat):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::enableSmoothedLayerText):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Turn off smoothed layer text because it affects many layout test results.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebViewToConsistentStateBeforeTesting):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

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

3 years agoUnreviewed, rolling out r197922.
ryanhaddad@apple.com [Fri, 11 Mar 2016 01:46:31 +0000 (01:46 +0000)]
Unreviewed, rolling out r197922.
https://bugs.webkit.org/show_bug.cgi?id=155340

This change broke storage/websql tests on ios-simulator.
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"WebKit should adopt journal_mode=wal for all SQLite
databases."
https://bugs.webkit.org/show_bug.cgi?id=133496
http://trac.webkit.org/changeset/197922

Patch by Commit Queue <commit-queue@webkit.org> on 2016-03-10

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

3 years ago[Cocoa] Test gardening after r197933
mmaxfield@apple.com [Fri, 11 Mar 2016 01:41:12 +0000 (01:41 +0000)]
[Cocoa] Test gardening after r197933
<rdar://problem/25091368>

Unreviewed.

* fast/text/woff2-expected.html:
* fast/text/woff2.html:

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

3 years agoFix the build again.
timothy_horton@apple.com [Fri, 11 Mar 2016 01:34:11 +0000 (01:34 +0000)]
Fix the build again.

* editing/cocoa/DataDetection.mm:
(WebCore::constructURLStringForResult):

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

3 years agoFix the build.
timothy_horton@apple.com [Fri, 11 Mar 2016 01:32:12 +0000 (01:32 +0000)]
Fix the build.

* editing/cocoa/DataDetection.mm:

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

3 years agoExpose additional WKDataDetectorTypes.
enrica@apple.com [Fri, 11 Mar 2016 01:06:48 +0000 (01:06 +0000)]
Expose additional WKDataDetectorTypes.
https://bugs.webkit.org/show_bug.cgi?id=155331
rdar://problem/24175813

Reviewed by Tim Horton.

Source/WebCore:

Adding support for additional data detector types (tracking
numbers, flight information and spotlight suggestions).

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::constructURLStringForResult):
(WebCore::DataDetection::detectContentInRange):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/spi/cocoa/DataDetectorsCoreSPI.h:

Source/WebKit2:

Adding API to enable data detection of tracking numbers,
flight number and spotlight suggestions.

* UIProcess/API/Cocoa/WKWebView.mm:
(fromWKDataDetectorTypes):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:

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

3 years agoWeb Inspector: color swatch and border are misaligned in Visual Styles sidebar
commit-queue@webkit.org [Fri, 11 Mar 2016 01:03:38 +0000 (01:03 +0000)]
Web Inspector: color swatch and border are misaligned in Visual Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154471

Patch by Daniel Strokis <dstrokis@icloud.com> on 2016-03-10
Reviewed by Timothy Hatcher.

Color swatches in the Visual Styles sidebar now have only their left corners rounded (thanks to Matt Baker for the idea).

* UserInterface/Views/InlineSwatch.css:
(.inline-swatch > span):
(.inline-swatch): Deleted.
* UserInterface/Views/VisualStyleColorPicker.css:
(.visual-style-property-container.input-color-picker > .visual-style-property-value-container > .inline-swatch.color):

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

3 years agoWeb Inspector: Timelines UI redesign: remove navigation sidebar
mattbaker@apple.com [Fri, 11 Mar 2016 00:49:16 +0000 (00:49 +0000)]
Web Inspector: Timelines UI redesign: remove navigation sidebar
https://bugs.webkit.org/show_bug.cgi?id=153036
<rdar://problem/24195627>

Reviewed by Timothy Hatcher.

Removed TimelineView methods used by the sidebar to setup the content tree
outline and handle tree element events, which are no longer used. Tree elements
are no longer created by TimelineViews as records are processed.

* UserInterface/Main.html:
Removed files.

* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView):
Removed tree outline event listeners and data grid parameter.
(WebInspector.LayoutTimelineView.prototype._processPendingRecords):
(WebInspector.LayoutTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.LayoutTimelineView.prototype._hoveredOrSelectedRecord):
Get record from data grid node instead of tree element.
(WebInspector.LayoutTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.LayoutTimelineView.prototype._mouseOverTreeOutline): Deleted.
(WebInspector.LayoutTimelineView.prototype._mouseLeaveTreeOutline): Deleted.
No longer needed, highlighting performed by data grid event handlers.

* UserInterface/Views/MemoryTimelineView.js:
(WebInspector.MemoryTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
No longer needed.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype._updateFilter): Deleted.
Removed hack which was specific to TimelineSidebarPanel.

* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
Removed sidebar styles and tree outline data grid parameter.
(WebInspector.NetworkTimelineView.prototype._processPendingRecords):
(WebInspector.NetworkTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.NetworkTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.NetworkTimelineView.prototype.treeElementSelected): Deleted.
No longer needed.

* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView):
(WebInspector.OverviewTimelineView.prototype.get selectionPathComponents):
(WebInspector.OverviewTimelineView.prototype.dataGridNodePathComponentSelected):
Create path components from the grid selection. This should have been
included in https://webkit.org/b/154954.

(WebInspector.OverviewTimelineView.prototype._compareDataGridNodesByStartTime.getStartTime):
(WebInspector.OverviewTimelineView.prototype._compareDataGridNodesByStartTime):
(WebInspector.OverviewTimelineView.prototype._insertDataGridNode):
(WebInspector.OverviewTimelineView.prototype._addResourceToDataGridIfNeeded):
(WebInspector.OverviewTimelineView.prototype._addSourceCodeTimeline):
Refactored to accept grid nodes instead of tree elements.

(WebInspector.OverviewTimelineView.prototype._processPendingRepresentedObjects):
(WebInspector.OverviewTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.OverviewTimelineView.prototype.shown):
(WebInspector.OverviewTimelineView.prototype.treeElementPathComponentSelected): Deleted.
(WebInspector.OverviewTimelineView.prototype._compareTreeElementsByDetails): Deleted.
Not used anywhere.

(WebInspector.OverviewTimelineView.prototype._compareTreeElementsByStartTime.getStartTime): Deleted.
(WebInspector.OverviewTimelineView.prototype._compareTreeElementsByStartTime): Deleted.
(WebInspector.OverviewTimelineView.prototype._insertTreeElement): Deleted.
(WebInspector.OverviewTimelineView.prototype._addResourceToTreeIfNeeded): Deleted.
Reimplemented as _compareDataGridNodesByStartTime, _insertDataGridNode and _addResourceToDataGridIfNeeded.

* UserInterface/Views/RenderingFrameTimelineView.js:
(WebInspector.RenderingFrameTimelineView):
Removed sidebar styles and tree outline data grid parameter.

(WebInspector.RenderingFrameTimelineView.prototype.get selectionPathComponents):
(WebInspector.RenderingFrameTimelineView.prototype.dataGridNodePathComponentSelected):
Create path components from the grid selection. This should have been
included in https://webkit.org/b/154954.

(WebInspector.RenderingFrameTimelineView.prototype._processPendingRecords):
(WebInspector.RenderingFrameTimelineView.prototype._scopeBarSelectionDidChange):
(WebInspector.RenderingFrameTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.RenderingFrameTimelineView.prototype.treeElementDeselected): Deleted.
(WebInspector.RenderingFrameTimelineView.prototype.treeElementSelected): Deleted.
(WebInspector.RenderingFrameTimelineView.prototype.treeElementPathComponentSelected): Deleted.

* UserInterface/Views/ScriptClusterTimelineView.js:
(WebInspector.ScriptClusterTimelineView):
Don't hold reference to extraArguments, just pass to subviews.

* UserInterface/Views/ScriptDetailsTimelineView.js:
(WebInspector.ScriptDetailsTimelineView):
Removed sidebar styles and tree outline data grid parameter.
(WebInspector.ScriptDetailsTimelineView.prototype._processPendingRecords):
(WebInspector.ScriptDetailsTimelineView.prototype._dataGridFiltersDidChange):
(WebInspector.ScriptDetailsTimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.ScriptDetailsTimelineView.prototype.treeElementSelected): Deleted.
(WebInspector.ScriptDetailsTimelineView.prototype.dataGridNodeForTreeElement): Deleted.
(WebInspector.ScriptDetailsTimelineView.prototype.populateProfileNodeTreeElement): Deleted.

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype.addRowInSortOrder):
Fixed failure when treeElement and parentTreeElementOrDataGridNode are both null.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):
Removed extraArguments and sidebar panel references.
(WebInspector.TimelineRecordingContentView.prototype.contentBrowserTreeElementForRepresentedObject):
Use icon style from the tab, instead of the sidebar.
(WebInspector.TimelineRecordingContentView.prototype._currentContentViewDidChange):
Removed updates to the sidebar.
(WebInspector.TimelineRecordingContentView.prototype._pathComponentSelected):
(WebInspector.TimelineRecordingContentView.prototype._updateTimes):
(WebInspector.TimelineRecordingContentView.prototype._instrumentAdded):
Removed sidebar reference when creating new TimelineViews.
(WebInspector.TimelineRecordingContentView.prototype._timeRangeSelectionChanged):

* UserInterface/Views/TimelineSidebarPanel.css: Removed.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView):
Removed hidden sidebar FIXME.
(WebInspector.TimelineTabContentView.prototype._addRecording):
New location for sidebar style class constant StopwatchIconStyleClass.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype.get navigationItems): Deleted.
(WebInspector.TimelineView.prototype.get navigationSidebarTreeOutline): Deleted.
(WebInspector.TimelineView.prototype.get navigationSidebarTreeOutlineLabel): Deleted.
(WebInspector.TimelineView.prototype.get timelineSidebarPanel): Deleted.
(WebInspector.TimelineView.prototype.treeElementPathComponentSelected): Deleted.
(WebInspector.TimelineView.prototype.treeElementDeselected): Deleted.
(WebInspector.TimelineView.prototype.treeElementSelected): Deleted.
(WebInspector.TimelineView.prototype._treeSelectionDidChange): Deleted.
Sidebar logic for panel and content tree outline removed.

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

3 years agodefaultActions in UIDelegate method
bdakin@apple.com [Fri, 11 Mar 2016 00:47:31 +0000 (00:47 +0000)]
defaultActions in UIDelegate method
_webView:previewingViewControllerForElement:defaultActions: need to be
use-able by a client
https://bugs.webkit.org/show_bug.cgi?id=155304
-and corresponding-
rdar://problem/24269296

Reviewed by Anders Carlsson.

This patch adds a new protocol, WKPreviewActionItem, which is a sub-protocol
of UIPreviewActionItem. The new protocol adds an identifier so that clients
can identify which of our default actions they want to use. In order for a
client to use our default action items, they need to return those actions in
their UIViewController's implementation of previewActionItems.

Change the defaultActions to NSArray <id <WKPreviewActionItem>> *
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

This new file defines our sub-protocol and sub-class for WKPreviewActions.
* UIProcess/API/Cocoa/_WKPreviewAction.h: Added.
* UIProcess/API/Cocoa/_WKPreviewAction.mm: Added.
(+[_WKPreviewAction actionWithIdentifier:title:style:handler:]):

New BOOL _uiDelegateProvidedPreviewingViewController keeps track of whether
the client returned a view controller from
_webView:previewingViewControllerForElement:defaultActions:. If they did
return a view controller, then we should invoke
_webView:commitPreviewingViewController: at commit time. If they returned
nil, then they indicated that WebKit should continue with default previewing
behavior, so we will not invoke the UIDelegate’s commit method.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _registerPreview]):
(-[WKContentView _unregisterPreview]):
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):

In order for our default actions to be useful, we have to create
_WKPreviewActions.
(-[WKContentView _presentedViewControllerForPreviewItemController:]):

Only invoke _webView:commitPreviewedViewController: if
_uiDelegateProvidedPreviewingViewController is YES.
(-[WKContentView _previewItemController:commitPreview:]):
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoCSP: Implement frame-ancestors directive
dbates@webkit.org [Fri, 11 Mar 2016 00:45:13 +0000 (00:45 +0000)]
CSP: Implement frame-ancestors directive
https://bugs.webkit.org/show_bug.cgi?id=154345
<rdar://problem/24702161>

Reviewed by Brent Fulgham.

Source/WebCore:

Add support for the Content Security Policy directive frame-ancestors per the Content Security
Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-meta-element-ignored.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-report-only-ignored.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-https.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-https.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Extracted from DocumentLoader::responseReceived().
(WebCore::DocumentLoader::responseReceived): Extracted logic to cancel a load and dispatch a DOM Load
event at the frame owner into DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
Make use of this function when loading of the frame is blocked by either the Content Security Policy or
the X-Frame-Option policy. We explicitly instantiate a ContentSecurityPolicy object with a SecurityOrigin
and Frame instead of using ScriptExecutionContext m_frame->document() because m_frame->document() is not
in a stable state (for instance, Document::m_url has not been initialized) as we are in the process of
loading the underlying document data for it.
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument): Pass ContentSecurityPolicy::ReportParsingErrors::No to silence
errors raised when parsing the Content Security Policy headers to avoid duplicate error messages. Any
parsing errors would have been raised when we parsed the Content Security Policy in DocumentLoader.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take an optional pointer to a Frame (defaults
to nullptr). The specified Frame is used to support emitting console messages for violations/syntax errors and
send violation reports. We make use of this constructor variant in DocumentLoader to support emitting console
message and sending violation reports in the context of DocumentLoader where its associated Document is not in a
stable state and making use of a Frame seems less error prone.
(WebCore::ContentSecurityPolicy::didReceiveHeaders): Modified to take argument reportParsingErrors as
to whether to silence parsing errors when parsing the specified headers.
(WebCore::isAllowedByAllWithFrame): Helper function to query a ContentSecurityPolicyDirectiveList function
passing a Frame and URL for each Content Security Policy.
(WebCore::ContentSecurityPolicy::allowFrameAncestors): Calls WebCore::isAllowedByAllWithFrame().
(WebCore::ContentSecurityPolicy::reportViolation): Modified to support sending a violation report when
we have a Frame and no ScriptExecutionContext (such as when we are instantiated in DocumentLoader).
Additionally, we only will send a report if reporting is enabled (i.e. ContentSecurityPolicy::m_isReportingEnabled == true).
(WebCore::ContentSecurityPolicy::logToConsole): Modified to support logging a message to the console
we have a Frame and no ScriptExecutionContext. We also only allow logging if reporting is enabled.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors): Added.
(WebCore::ContentSecurityPolicyDirectiveList::checkFrameAncestorsAndReportViolation): Added.
(WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Added.
(WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore the directive frame-ancestors when defined
in a policy given in an HTML meta element and report such use as invalid.
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive frame-ancestors.
* page/csp/ContentSecurityPolicyDirectiveList.h:
* page/csp/ContentSecurityPolicyResponseHeaders.h: Mark constructor "explicit".

LayoutTests:

Adds new tests to ensure we ignore directive frame-ancestors when defined a policy delivered
in an HTML meta element or in a report-only policy (i.e. delivered via HTTP header Content-
Security-Policy-Report-Only). Also adds new test to ensure that we send a violation report
when the directive frame-ancestors is violated.

Updated many existing tests and test results that unnecessarily depended on a DOM SecurityError
exception being thrown when accessing the content of a cross-origin frame. It is sufficient
and more direct to test directive frame-ancestors by dumping the contents of all children frames
on the page. We design the tests such that a child frame that was blocked by the frame-ancestors
directive is expected to have no content. A child frame that was allowed by the frame-ancestors
directive is expected to have content.

* TestExpectations: Mark frame-ancestors tests as PASS so that we run them.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-meta-element-ignored-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-meta-element-ignored.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-report-only-ignored-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-report-only-ignored.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-none-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-self-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-star-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-star-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-url-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-url-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-url-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-cross-url-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-none-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-self-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-star-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-star-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-url-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-url-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-url-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-same-url-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-none-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-self-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-star-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-star-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-url-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-url-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-url-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-cross-url-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-none-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-self-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-self-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-star-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-star-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-url-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-url-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-url-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-same-in-same-url-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-none-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-none-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-protocolless-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-protocolless-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-self-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-self-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-self-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-self-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-star-allow-crossorigin-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-star-allow-crossorigin.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-star-allow-sameorigin-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-star-allow-sameorigin.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-url-allow-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-url-allow.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-url-block-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-url-block.html:
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-https-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-https.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-https-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-https.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin.html: Added.
* http/tests/security/contentSecurityPolicy/resources/echo-intertag.pl: Added.
* http/tests/security/contentSecurityPolicy/resources/frame-ancestors-test.js:
(done): Added.
(injectIFrame): Modified to make use of handleFrameEvent().
(handleFrameEvent): Added.
(iframeLoaded): Deleted.
* http/tests/security/contentSecurityPolicy/resources/frame-in-frame.pl:

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

3 years agoWeb Inspector: Enable Memory Timelines by default if supported
joepeck@webkit.org [Fri, 11 Mar 2016 00:44:20 +0000 (00:44 +0000)]
Web Inspector: Enable Memory Timelines by default if supported
https://bugs.webkit.org/show_bug.cgi?id=155333
<rdar://problem/25097319>

Reviewed by Timothy Hatcher.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.defaultInstruments):

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

3 years ago[ES6] Instanceof isn't spec compliant when the RHS is a Proxy with a target that...
sbarati@apple.com [Fri, 11 Mar 2016 00:43:46 +0000 (00:43 +0000)]
[ES6] Instanceof isn't spec compliant when the RHS is a Proxy with a target that is a function
https://bugs.webkit.org/show_bug.cgi?id=155329

Reviewed by Mark Lam.

We use type info flags on the structure to dictate whether or not
the RHS of an instanceof is a valid RHS (i.e, a function). The solution
to make Proxy a valid RHS when the Proxy's target is callable is to have
two different structures for ProxyObject: one for a non-callable target
and one for a callable target.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::moduleRecordStructure):
(JSC::JSGlobalObject::moduleNamespaceObjectStructure):
(JSC::JSGlobalObject::proxyObjectStructure):
(JSC::JSGlobalObject::callableProxyObjectStructure):
(JSC::JSGlobalObject::proxyRevokeStructure):
(JSC::JSGlobalObject::wasmModuleStructure):
* runtime/ProxyConstructor.cpp:
(JSC::makeRevocableProxy):
(JSC::constructProxyObject):
(JSC::ProxyConstructor::getConstructData):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::ProxyObject):
(JSC::ProxyObject::structureForTarget):
(JSC::ProxyObject::finishCreation):
* runtime/ProxyObject.h:
(JSC::ProxyObject::create):
(JSC::ProxyObject::createStructure):
* tests/es6.yaml:
* tests/stress/proxy-instanceof.js: Added.
(assert):
(test):
(C):
(test.let.handler.get if):
(test.let.handler):

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

3 years agoAdd shouldNotBe to standalone test harness
commit-queue@webkit.org [Fri, 11 Mar 2016 00:42:18 +0000 (00:42 +0000)]
Add shouldNotBe to standalone test harness
https://bugs.webkit.org/show_bug.cgi?id=155300

Patch by Andy VanWagoner <andy@instructure.com> on 2016-03-10
Reviewed by Saam Barati.

Copy over the shouldNotBe function from js-test-pre. This fixes errors
introduced be new Intl tests.

* resources/standalone-pre.js:
(shouldNotBe):

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

3 years agoAdd WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
jer.noble@apple.com [Fri, 11 Mar 2016 00:34:57 +0000 (00:34 +0000)]
Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
https://bugs.webkit.org/show_bug.cgi?id=155326
<rdar://problem/25095408>

Reviewed by Beth Dakin.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Set the OverrideUserGestureRequirementForMainContent if the new setting is enabled.
* page/Settings.in:

Source/WebKit/mac:

Add SPI to get and set the new preference.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences overrideUserGestureRequirementForMainContent]):
(-[WebPreferences setOverrideUserGestureRequirementForMainContent:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add SPI to get and set the new preference.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetMainContentUserGestureOverrideEnabled):
(WKPreferencesGetMainContentUserGestureOverrideEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _mainContentUserGestureOverrideEnabled]):
(-[WKWebViewConfiguration _setMainContentUserGestureOverrideEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

3 years agoREGRESSION: GuardMallloc crash in SVGListPropertyTearOff<SVGPointList>::processIncomi...
said@apple.com [Fri, 11 Mar 2016 00:32:51 +0000 (00:32 +0000)]
REGRESSION: GuardMallloc crash in SVGListPropertyTearOff<SVGPointList>::processIncomingListItemWrapper
https://bugs.webkit.org/show_bug.cgi?id=154969

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2016-03-10
Reviewed by Darin Adler.

The life cycle of the SVGAnimatedPropertyTearOff::m_baseVal and m_animVal
was not correct. Like what was done in SVGAnimatedListPropertyTearOff,
m_baseVal and m_animVal have to be raw RefCounted pointers. When requested
through, SVGAnimatedPropertyTearOff::baseVal() and animVal() they are
encapsulated in a RefPtr to ensure they existence as long as they are
referenced. When the animated property object (which is stored in either
m_baseVal or m_animVal) is not referenced by anyone, it is going to be
deleted. In the destructor of their class, SVGAnimatedPropertyTearOff
will be notified of this deletion through propertyWillBeDeleted() to clean
its member m_baseVal or m_animVal.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Now all the SVG animated property return RefPtrs. In
addition to that, SVGViewSpec.transform also returns
RefPtr<SVGTransformListPropertyTearOff>.

* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
(WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue):
(WebCore::SVGAnimatedListPropertyTearOff::animationStarted):
(WebCore::SVGAnimatedListPropertyTearOff::animationEnded):
(WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
(WebCore::SVGAnimatedListPropertyTearOff::isAnimating):
(WebCore::SVGAnimatedListPropertyTearOff::propertyWillBeDeleted):
Change propertyWillBeDeleted() to be virtual and make it takes an SVGProperty*.
Rename m_animatingAnimVal to be m_animatedProperty. Add isAnimating() which
returns true if m_animatedProperty is not null. Use isAnimating() instead of
m_isAnimating because it's deleted from the base class.

* svg/properties/SVGAnimatedProperty.cpp:
(WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
(WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
* svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::isAnimating):
(WebCore::SVGAnimatedProperty::propertyWillBeDeleted):
Delete m_isAnimating since its value can be deduced from the value of
m_animatedProperty in the derived class. Add propertyWillBeDeleted() and
isAnimating() as virtual functions with the default behavior.

* svg/properties/SVGAnimatedPropertyTearOff.h:
(WebCore::SVGAnimatedPropertyTearOff::baseVal):
(WebCore::SVGAnimatedPropertyTearOff::animVal):
Like SVGAnimatedListPropertyTearOff::baseVal() and animVal() create the
value if it does not exist. Keep a raw RefCounted pointer but return a
RefPtr.

(WebCore::SVGAnimatedPropertyTearOff::isAnimating):
(WebCore::SVGAnimatedPropertyTearOff::propertyWillBeDeleted):
Override virtual functions.

(WebCore::SVGAnimatedPropertyTearOff::currentAnimatedValue):
(WebCore::SVGAnimatedPropertyTearOff::animationStarted):
(WebCore::SVGAnimatedPropertyTearOff::animationEnded):
(WebCore::SVGAnimatedPropertyTearOff::animValWillChange):
(WebCore::SVGAnimatedPropertyTearOff::animValDidChange):
Replace m_isAnimating with isAnimating(). Ensure that we get a new animated
property through animVal() and store it in a RefPtr to ensure it will not
go away while animating.

* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(WebCore::SVGAnimatedStaticPropertyTearOff::isAnimating):
(WebCore::SVGAnimatedStaticPropertyTearOff::currentAnimatedValue):
(WebCore::SVGAnimatedStaticPropertyTearOff::animationStarted):
(WebCore::SVGAnimatedStaticPropertyTearOff::animationEnded):
(WebCore::SVGAnimatedStaticPropertyTearOff::animValWillChange):
(WebCore::SVGAnimatedStaticPropertyTearOff::animValDidChange):
Add isAnimating() and replace all the instances of m_isAnimating with calls
to isAnimating().

* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::animatedProperty):
(WebCore::SVGPropertyTearOff::setAnimatedProperty):
(WebCore::SVGPropertyTearOff::contextElement):
(WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
(WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
SVGPropertyTearOff is what SVGAnimatedPropertyTearOff creates for its
baseVal() and animVal() values. These values can be null anytime once
they are not referenced. The SVGAnimatedPropertyTearOff holds only raw
RefCounted pointer for them. So (1) SVGPropertyTearOff needs to hold a
RefPtr for its SVGAnimatedProperty and (2) it needs to notify its
SVGAnimatedProperty when it's deleted by calling propertyWillBeDeleted()
from the destructor. Also there is no need to get the contextElement()
and save it in class member, m_contextElement since it can be always be
retrieved from SVGAnimatedProperty::contextElement().

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