jlewis3@apple.com [Mon, 24 Jul 2017 23:41:12 +0000 (23:41 +0000)]
Marked tests as failures.
<rdar://problem/
33437597>
Unreviewed test gardening.
* platform/mac-highsierra/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219847
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jlewis3@apple.com [Mon, 24 Jul 2017 23:12:39 +0000 (23:12 +0000)]
Fixed typo in test expectations.
https://bugs.webkit.org/show_bug.cgi?id=173010
Unreviewed gardening.
* platform/ios-simulator-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219846
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 24 Jul 2017 22:50:32 +0000 (22:50 +0000)]
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
https://bugs.webkit.org/show_bug.cgi?id=174790
Reviewed by Brady Eidson.
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
|this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
get executed after the store is gone.
To address the issue, we now use a RunLoop::Timer to schedule the write, instead of a
WorkQueue::dispatchAfter() call. This way, we are guaranteed that the callback will not get called
after the store has been destroyed.
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::asyncWriteTimerFired):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
(WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
(WebKit::ResourceLoadStatisticsPersistentStorage::ref):
(WebKit::ResourceLoadStatisticsPersistentStorage::deref):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219845
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Mon, 24 Jul 2017 22:42:00 +0000 (22:42 +0000)]
[Win] Async image tests are failing.
https://bugs.webkit.org/show_bug.cgi?id=174653
Unreviewed test gardening, update test expectations for async image tests.
* platform/win/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219844
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Mon, 24 Jul 2017 22:29:02 +0000 (22:29 +0000)]
Rebaseline this test. The previous result was generated using an older iOS SDK.
* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219843
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Mon, 24 Jul 2017 22:26:11 +0000 (22:26 +0000)]
Mark Skia font test as image only failure on Windows.
Unreviewed test gardening.
* platform/win/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219842
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 24 Jul 2017 21:57:34 +0000 (21:57 +0000)]
LayoutTest userscripts/user-script-audio-document.html failing on High Sierra
https://bugs.webkit.org/show_bug.cgi?id=174726
rdar://problem/
30059973
Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-24
Reviewed by Alexey Proskuryakov.
Underlying issue has been resolved.
Re-enable test: userscripts/user-script-audio-document.html
* platform/mac-highsierra/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219841
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Mon, 24 Jul 2017 21:57:17 +0000 (21:57 +0000)]
Unreviewed attempt to fix Mac cmake build
* PlatformMac.cmake:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219840
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Mon, 24 Jul 2017 21:53:38 +0000 (21:53 +0000)]
Fix typo (Timout -> Timeout).
* platform/mac-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219839
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 24 Jul 2017 21:42:51 +0000 (21:42 +0000)]
Unreviewed, rolling out r219828.
Causes debug assertions to be hit on iOS
Reverted changeset:
"Fix lifetime management issue in
ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()"
https://bugs.webkit.org/show_bug.cgi?id=174790
http://trac.webkit.org/changeset/219828
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219838
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 24 Jul 2017 21:21:06 +0000 (21:21 +0000)]
5 wav media layoutTest timeouts on High Sierra
https://bugs.webkit.org/show_bug.cgi?id=174725
rdar://problem/
30182218
Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-24
Reviewed by Andreas Kling.
Underlying issue is fixed. Re-enable tests on High Sierra.
media/audio-controls-timeline-in-media-document.html
media/audio-data-url.html
media/media-document-audio-controls-visible.html
media/media-document-audio-repaint.html
media/media-document-audio-size.html
* platform/mac-highsierra/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219837
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Mon, 24 Jul 2017 20:58:09 +0000 (20:58 +0000)]
[Mac WK2] Add an API test to cover r219765 (null dereference in [WKWebView dealloc])
https://bugs.webkit.org/show_bug.cgi?id=174793
Reviewed by Tim Horton.
Adds a new unit test that invokes some asynchronous NSTextInputClient SPI methods as the web view is tearing
down. Without r219765, this test will dereference null and crash.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/TestWebKitAPI/mac/NSTextInputClientSPI.h: Added.
* TestWebKitAPI/Tests/mac/WKWebViewSelectionTests.mm:
(TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219836
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 24 Jul 2017 19:16:55 +0000 (19:16 +0000)]
WebDriver: rename m_browsingContext as m_currentBrowsingContext in Session
https://bugs.webkit.org/show_bug.cgi?id=174783
Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2017-07-24
Reviewed by Brian Burg.
We have m_toplevelBrowsingContext and m_browsingContext, which is confusing. m_browsingContext is actually the
current browsing context, and the spec also refers to it as the current browsing context, so better use
m_currentBrowsingContext.
* Session.cpp:
(WebDriver::Session::switchToTopLevelBrowsingContext):
(WebDriver::Session::switchToBrowsingContext):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::findElements):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::elementSubmit):
(WebDriver::Session::executeScript):
* Session.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219833
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mcatanzaro@igalia.com [Mon, 24 Jul 2017 18:55:29 +0000 (18:55 +0000)]
[GTK][WPE] Stop using AutodrainedPool in IconDatabase
https://bugs.webkit.org/show_bug.cgi?id=174791
Reviewed by Alex Christensen.
AutodrainedPool seems to be some NS garbage collection thing that has no implementation on
other platforms. Now that IconDatabase is used only by GTK and WPE, we can stop using it.
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::setIconDataForIconURL):
(WebKit::IconDatabase::setIconURLForPageURL):
(WebKit::IconDatabase::iconDatabaseSyncThread):
(WebKit::IconDatabase::performURLImport):
(WebKit::IconDatabase::readFromDatabase):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219832
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 24 Jul 2017 18:42:33 +0000 (18:42 +0000)]
Make ExceptionCode a proper enumeration
https://bugs.webkit.org/show_bug.cgi?id=174771
Reviewed by Sam Weinig.
Make ExceptionCode a proper enumeration instead of a typedef to uint8_t.
Source/WebCore:
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::formData):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::encode):
(WebCore::IDBError::decode):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::rejectWithException):
* dom/Exception.h:
* dom/ExceptionCode.h:
* fileapi/FileReaderSync.cpp:
(WebCore::errorCodeToExceptionCode):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
* xml/XMLHttpRequest.h:
Source/WebKitLegacy/win:
* DOMCoreClasses.cpp:
(DOMDocument::createEvent):
* WebView.cpp:
(WebView::prepareCandidateWindow):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219831
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 24 Jul 2017 18:34:58 +0000 (18:34 +0000)]
[Win] Implement Authentication dialog in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=174662
Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-07-24
Reviewed by Alex Christensen.
* MiniBrowser/win/Common.cpp:
(CustomUserAgent):
(DisplayAuthDialog):
(AuthDialogProc):
* MiniBrowser/win/MiniBrowserLib.rc:
* MiniBrowser/win/MiniBrowserLibResource.h:
* MiniBrowser/win/ResourceLoadDelegate.cpp:
(ResourceLoadDelegate::didReceiveAuthenticationChallenge):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219830
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
simon.fraser@apple.com [Mon, 24 Jul 2017 18:07:31 +0000 (18:07 +0000)]
Change "client" coordinates back to match scrolling coordinates
https://bugs.webkit.org/show_bug.cgi?id=174734
rdar://problem/
33336930
Reviewed by Tim Horton.
Baidu.com (which uses jQuery), and various iOS apps make the assumption that getBoundingClientRect() returns a rectangle
that can be used to set or compare with the scroll position. With visual viewports, that assumption is no longer valid
when the page is zoomed, or when the keyboard has caused the visual viewport to detach from the layout viewport.
At this point the compatibility cost of shipping layout viewport-based client rects seems higher than the gain, so revert
to the shipping behavior. This reverts r216803, and will re-introduce bugs that occurred on zoomed pages on macOS,
many of which are noted in webkit.org/b/170981.
* page/FrameView.cpp:
(WebCore::FrameView::documentToClientOffset):
LayoutTests:
Revert "client" coordinates to be in scrolling coordinates
https://bugs.webkit.org/show_bug.cgi?id=174734
rdar://problem/
33336930
Reviewed by Tim Horton.
Rebaseline.
* fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe-expected.txt:
* fast/visual-viewport/client-coordinates-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* fast/visual-viewport/zoomed-fixed-expected.txt:
* fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:
* fast/zooming/client-rect-in-fixed-zoomed-expected.txt:
* platform/ios-wk2/fast/visual-viewport/client-rects-relative-to-layout-viewport-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/cssom-view/elementFromPoint-expected.txt: Added.
* platform/ios/fast/visual-viewport/zoomed-fixed-expected.txt:
* platform/ios/fast/visual-viewport/zoomed-fixed-header-and-footer-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219829
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 24 Jul 2017 17:43:14 +0000 (17:43 +0000)]
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore()
https://bugs.webkit.org/show_bug.cgi?id=174790
Reviewed by Brady Eidson.
Fix lifetime management issue in ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore().
WorkQueue::dispatchAfter() keeps the WorkQueue alive because its implementation keeps a strong ref to
|this|. As a result, the lambda passed to dispatchAfter(), which calls writeMemoryStoreToDisk(), can
get executed after the store is gone.
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::ResourceLoadStatisticsPersistentStorage):
(WebKit::ResourceLoadStatisticsPersistentStorage::scheduleOrWriteMemoryStore):
* UIProcess/Storage/ResourceLoadStatisticsPersistentStorage.h:
(WebKit::ResourceLoadStatisticsPersistentStorage::createWeakPtr):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219828
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jbedard@apple.com [Mon, 24 Jul 2017 17:31:12 +0000 (17:31 +0000)]
Handle case where line_numbers is None instead of an array of line numbers
https://bugs.webkit.org/show_bug.cgi?id=174775
Reviewed by Aakash Jain.
Added files set line_numbers to None in process_file.
* Scripts/webkitpy/style/filereader.py:
(TextFileReader.process_file): Handle case where line_number is set to None.
* Scripts/webkitpy/style/main_unittest.py:
(ExpectationLinterInStyleCheckerTest.test_linter_added_file_with_error): Test case of an added file.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219827
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mattbaker@apple.com [Mon, 24 Jul 2017 17:13:27 +0000 (17:13 +0000)]
Web Inspector: should only show Canvases in resource type filter if debug setting enabled
https://bugs.webkit.org/show_bug.cgi?id=174765
<rdar://problem/
33479009>
Reviewed by Devin Rousso.
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219826
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jlewis3@apple.com [Mon, 24 Jul 2017 16:41:35 +0000 (16:41 +0000)]
Marked tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html as failure.
https://bugs.webkit.org/show_bug.cgi?id=172148
Unreviewed test gardening.
* platform/mac-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219825
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
darin@apple.com [Mon, 24 Jul 2017 16:06:50 +0000 (16:06 +0000)]
Remove race from one plug-in test
https://bugs.webkit.org/show_bug.cgi?id=130653
Reviewed by Antti Koivisto.
* plugins/plugin-remove-readystatechange.html: Updated test to use waitUntilDone/notifyDone
rather than racing. Added a computation of offsetLeft to trigger layout and adding a long
comment explaining why this is both needed and potentially insufficient in the long run.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219824
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
clopez@igalia.com [Mon, 24 Jul 2017 16:01:33 +0000 (16:01 +0000)]
[CMake] libtasn1 should not be required when not enabling subtle_crypto
https://bugs.webkit.org/show_bug.cgi?id=174785
Reviewed by Žan Doberšek.
* pal/PlatformGTK.cmake:
* pal/PlatformWPE.cmake:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219823
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Mon, 24 Jul 2017 14:46:43 +0000 (14:46 +0000)]
Gardening: fixed C Loop build after r219790.
https://bugs.webkit.org/show_bug.cgi?id=174696
Not reviewed.
* assembler/testmasm.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219821
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zandobersek@gmail.com [Mon, 24 Jul 2017 14:27:52 +0000 (14:27 +0000)]
[WPE] Add libepoxy to the Jhbuild moduleset
https://bugs.webkit.org/show_bug.cgi?id=174711
Reviewed by Carlos Alberto Lopez Perez.
.:
libepoxy 1.3.1 that's widely available in current stable distributions (Debian stable,
Ubuntu LTS) does suffice our needs, but also contains a bug that incorrectly determines
the current EGL context and the API version of OpenGL that's bound to that context.
Focusing on experiences on Debian systems, while the current stable Debian release has
this bug patched, the package for the testing distribution of Debian removed that same
patch for whatever reason, despite using the 1.3.1 version as the package basis.
To avoid this, libepoxy 1.4.3 is now added to WPE's Jhbuild moduleset. The WPE port
also now demands at least the 1.4.0 version to be available when configuring.
We should revisit the minimum version for libepoxy in the future if the 1.3 release
branch gets updated with the proper fix.
* Source/cmake/FindLibEpoxy.cmake:
* Source/cmake/OptionsWPE.cmake:
Tools:
* wpe/jhbuild.modules: Add libepoxy 1.4.3 to WPE's Jhbuild moduleset.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219820
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zandobersek@gmail.com [Mon, 24 Jul 2017 14:24:38 +0000 (14:24 +0000)]
[WPE] libepoxy headers can use EGL_CAST, which might not be defined by eglplatform.h
https://bugs.webkit.org/show_bug.cgi?id=174780
Reviewed by Carlos Garcia Campos.
Source/WebCore:
Newer versions of libepoxy provide EGL definitions that already use the EGL_CAST macro.
We'd like to compile on systems where the eglplatform.h header doesn't yet provide
that macro that was added only recently (e.g. it's available in Mesa 17.1, but not
before).
To address that, the EpoxyEGL.h header is added that first includes the libepoxy's EGL
header and then provides the EGL_CAST definition in case the eglplatform.h header doesn't.
This header should be included in place of <epoxy/egl.h> (which is included in this new
header).
The EpoxyEGL.h and EpoxyShims.h headers are also moved under the platform/graphics/epoxy/
directory, with the new directory added to the list of inclusion paths for WPE.
* PlatformWPE.cmake:
* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/cairo/CairoUtilities.cpp:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/egl/GLContextEGL.cpp:
* platform/graphics/egl/GLContextEGLWPE.cpp:
* platform/graphics/epoxy/EpoxyEGL.h: Added.
* platform/graphics/epoxy/EpoxyShims.h: Renamed from Source/WebCore/platform/graphics/EpoxyShims.h.
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
* platform/graphics/wpe/PlatformDisplayWPE.cpp:
Tools:
* WebKitTestRunner/wpe/HeadlessViewBackend.cpp:
Manually define the EGL_CAST macro to the C++ version that uses static_cast<>
in case the eglplatform.h header doesn't provide that macro. This replicates
the work in WebCore's EpoxyEGL.h header, but we can't include that header here.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219819
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zandobersek@gmail.com [Mon, 24 Jul 2017 13:50:05 +0000 (13:50 +0000)]
[CoordinatedGraphics] Remove unused GLDefs.h header
https://bugs.webkit.org/show_bug.cgi?id=174712
Reviewed by Michael Catanzaro.
* platform/graphics/opengl/GLDefs.h: Remove this unused header.
As far as my recollection goes it was used in the IPC-based
CoordinatedGraphics subsystem, which has been removed already.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219818
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fred.wang@free.fr [Mon, 24 Jul 2017 08:33:11 +0000 (08:33 +0000)]
Add attribute allow-top-navigation-by-user-activation to iframe sandbox
https://bugs.webkit.org/show_bug.cgi?id=171327
Patch by Frederic Wang <fwang@igalia.com> on 2017-07-11
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
This commit updates the expectation for the test verifying that a sandboxed iframe without
the allow-top-navigation-by-user-activation flag set can not perform top navigation if it is
not triggered by a user gesture. The navigation is still prohibited but the parsing of the
allow-top-navigation-by-user-activation flag should not raised any error message.
A similar update is done for the test verifying that the combination of the flags
allow-top-navigation-by-user-activation and allow-top-navigation.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt: Remove the error message.
* web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt: Ditto.
Source/WebCore:
Tests: http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html
http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation_by_user_activation_without_user_gesture-expected.txt
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_allow_top_navigation-3-expected.txt
* dom/Document.cpp:
(WebCore::Document::canNavigate): Case 2 of conformance verification is refined to match the
current specification: Top navigation is allowed when it is triggered by user activation and
when allow-top-navigation-by-user-activation is set. Because we have additional "security
origin" rules with respect to the specification we also add some early return to ensure that
navigation is really allowed for this new case.
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy): Add allow-top-navigation-by-user-activation flag.
(WebCore::SecurityContext::parseSandboxPolicy): Parse the new flag to allow top user
navigation by user activation. Also, make sure that allow-top-navigation allows such
navigation as defined by the specification.
* dom/SecurityContext.h: Declare new sandboxing flag.
LayoutTests:
This patch adds tests to verify that a sandboxed iframe with the flag
'allow-top-navigation-by-user-activation' or 'allow-top-navigation' can navigate the top
level page, if navigation is triggered by a user gesture. This is based on a test from the
Chromium repository.
It also verifies that navigation fails when 'allow-top-navigation-by-user-activation' is
absent, even when it is triggered by a user gesture.
* http/tests/security/frameNavigation/resources/iframe-that-performs-parent-navigation-with-user-activation.html: Added. This is similar to iframe-that-performs-parent-navigation.html but it
performs navigation of its parent using user activation.
* http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1.html: Added.
Test top navigation for a sandboxed frame with 'allow-top-navigation-by-user-activation'
* http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-1-expected.txt: Added.
Add PASS expectation.
* http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2.html: Added.
Test top navigation for a sandboxed frame with 'allow-top-navigation'.
* http/tests/security/frameNavigation/sandbox-ALLOWED-top-navigation-with-user-gesture-2-expected.txt: Added.
Add PASS expectation.
* http/tests/security/frameNavigation/sandbox-DENIED-top-navigation-with-user-gesture.html: Added.
Test user-triggered navigation for a sandboxed frame without 'allow-top-navigation-by-user-activation'.
* http/tests/security/frameNavigation/sandbox-DENIED-top-navigation-with-user-gesture-expected.txt: Added.
Add reference with navigation failure.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219797
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Mon, 24 Jul 2017 06:47:25 +0000 (06:47 +0000)]
Unreviewed. REGRESSION(r219713): [GTK][WPE] Fix default favicon database patch.
When nullptr is passed to webkit_web_context_set_favicon_database_directory() the default database directory was
taken from WebProcessPool::platformDefaultIconDatabasePath(), that has been removed in r219713 without properly
replacing it, now it uses an empty string. This causes that the current directory is used to create the favicon
database.
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkit_web_context_set_favicon_database_directory): Use the default icon database directory instead of an empty
string when nullptr is passed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219796
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Mon, 24 Jul 2017 06:05:17 +0000 (06:05 +0000)]
[iOS WK2] 5 DataInteractionTests are failing: observed selection rects after dropping don't match expected values
https://bugs.webkit.org/show_bug.cgi?id=174769
<rdar://problem/
33478864>
Reviewed by Tim Horton.
Source/WebCore:
These tests began failing after r219541, due to a change in behavior of whether or not we call
setIgnoreSelectionChanges(false, RevealSelection::No) or setIgnoreSelectionChanges(false, RevealSelection::Yes)
when performing a text editing drop.
Before r219541, we would not reveal the selection when performing an edit drag operation. This is because in
WebPage::performDragControllerAction, we would begin ignoring selection changes by calling
setIgnoreSelectionChanges(true). However, while taking a text indicator snapshot, we would stop ignoring
selection in TextIndicator::createWithRange due to us calling setIgnoreSelectionChanges(false,
RevealSelection::No) at the end of the function. Then, when we return to the scope of
WebPage::performDragControllerAction and try to setIgnoreSelectionChanges(false), this is a no-op because we've
already stopped ignoring selection changes.
After r219541, switching to using TemporarySelectionChange means that TextIndicator::createWithRange now means
we respect whether or not we were already ignoring selection before taking the snapshot, so we won't always
setIgnoreSelectionChanges(false) at the end. This means that selection changes will now be correctly ignored
when performing a drag operation, but this also means that we'll try to reveal the selection, since
WebPage::performDragControllerAction calls setIgnoreSelectionChanges(false), for which RevealSelection::Yes
is used by default.
Revealing the selection in WebPage::performDragControllerAction was unintended in the first place, so we should
revert to calling setIgnoreSelectionChanges(false, RevealSelection::No). To ensure this, we adopt
TemporarySelectionChange here and pass only TemporarySelectionOptionIgnoreSelectionChanges, so that we won't
additionally try to reveal selection after the drop. This is consistent with behavior prior to macOS 10.13 and
iOS 11. Additionally, this patch also moves the call to ignore selection change from WebKit into WebCore, so
that whether we ignore selection is consistent across both WebKit1 and WebKit2.
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
Source/WebKit:
Fixes several API tests in the DataInteractionTests suite. See Source/WebCore/ChangeLog for more details.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219795
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Mon, 24 Jul 2017 05:58:46 +0000 (05:58 +0000)]
WebDriver: implement page load timeout
https://bugs.webkit.org/show_bug.cgi?id=174672
Reviewed by Brian Burg.
Source/WebDriver:
Handle timeout errors and pass the page load timeout to waitForNavigationToComplete and all other navigation
commands. Also fix the setTimeouts command that was still using the legacy name of the page load timeout,
instead of the one in the spec.
8. Sessions
https://www.w3.org/TR/webdriver/#dfn-session-page-load-timeout
* CommandResult.cpp:
(WebDriver::CommandResult::CommandResult):
(WebDriver::CommandResult::httpStatusCode):
(WebDriver::CommandResult::errorString):
* CommandResult.h:
* Session.cpp:
(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::waitForNavigationToComplete):
* WebDriverService.cpp:
(WebDriver::WebDriverService::setTimeouts):
Source/WebKit:
Always start a timer when waiting for a navigation to complete. When the timer fires, pending callbacks for
navigations are removed and invoked with a timeout error. If navigation completes before the timer is fired,
then the timer is stopped. All navigation commands now receive the page load strategy and timeout as optional
parameters, when not provided the default timeout (300 seconds) is used.
* UIProcess/Automation/Automation.json:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::waitForNavigationToComplete):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
(WebKit::WebAutomationSession::loadTimerFired):
(WebKit::WebAutomationSession::navigateBrowsingContext):
(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):
(WebKit::WebAutomationSession::reloadBrowsingContext):
(WebKit::WebAutomationSession::navigationOccurredForFrame):
* UIProcess/Automation/WebAutomationSession.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219794
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Mon, 24 Jul 2017 03:20:29 +0000 (03:20 +0000)]
[GTK] Correct a typo in the reference manual of WebKitWebInspector
https://bugs.webkit.org/show_bug.cgi?id=174767
Patch by Takuro Ashie <ashie@clear-code.com> on 2017-07-23
Reviewed by Michael Catanzaro.
* UIProcess/API/gtk/WebKitWebInspector.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219793
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Mon, 24 Jul 2017 02:10:13 +0000 (02:10 +0000)]
Drop ExceptionCodeDescription class
https://bugs.webkit.org/show_bug.cgi?id=174757
Reviewed by Darin Adler.
Source/WebCore:
Drop ExceptionCodeDescription class now that there is only one exception
type: DOMException. Instead, we now have static methods on DOMException
to get the name / message for a given exception code.
* CMakeLists.txt:
* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::name):
(WebCore::IDBError::message):
* Modules/quota/StorageErrorCallback.cpp:
(WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* dom/DOMAllInOne.cpp:
* dom/DOMException.cpp:
(WebCore::errorCodeFromName):
(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):
(WebCore::DOMException::name):
(WebCore::DOMException::message):
* dom/DOMException.h:
* dom/ExceptionCodeDescription.cpp: Removed.
* dom/ExceptionCodeDescription.h: Removed.
* inspector/DOMEditor.cpp:
(WebCore::populateErrorString):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::toErrorString):
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
Source/WebKit:
Update GTK bindings to use new API on DOMException instead of
ExceptionCodeDescription.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
(webkit_dom_attr_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
(webkit_dom_cdata_section_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
(webkit_dom_css_rule_set_css_text):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
(webkit_dom_css_style_declaration_set_property):
(webkit_dom_css_style_declaration_set_css_text):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
(webkit_dom_css_style_sheet_insert_rule):
(webkit_dom_css_style_sheet_delete_rule):
(webkit_dom_css_style_sheet_add_rule):
(webkit_dom_css_style_sheet_remove_rule):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(webkit_dom_css_value_set_css_text):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
(webkit_dom_character_data_dispatch_event):
(webkit_dom_character_data_insert_data):
(webkit_dom_character_data_delete_data):
(webkit_dom_character_data_replace_data):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRect.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMClientRectList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
(webkit_dom_comment_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
(webkit_dom_dom_implementation_create_document_type):
(webkit_dom_dom_implementation_create_document):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
(webkit_dom_dom_selection_collapse_to_end):
(webkit_dom_dom_selection_collapse_to_start):
(webkit_dom_dom_selection_extend):
(webkit_dom_dom_selection_get_range_at):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
(webkit_dom_dom_token_list_add):
(webkit_dom_dom_token_list_remove):
(webkit_dom_dom_token_list_toggle):
(webkit_dom_dom_token_list_replace):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
(webkit_dom_dom_window_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
(webkit_dom_node_set_prefix):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_dispatch_event):
(webkit_dom_document_create_element):
(webkit_dom_document_create_cdata_section):
(webkit_dom_document_create_processing_instruction):
(webkit_dom_document_create_attribute):
(webkit_dom_document_import_node):
(webkit_dom_document_create_element_ns):
(webkit_dom_document_create_attribute_ns):
(webkit_dom_document_adopt_node):
(webkit_dom_document_create_event):
(webkit_dom_document_create_expression):
(webkit_dom_document_evaluate):
(webkit_dom_document_query_selector):
(webkit_dom_document_query_selector_all):
(webkit_dom_document_set_xml_version):
(webkit_dom_document_set_cookie):
(webkit_dom_document_set_body):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
(webkit_dom_document_fragment_dispatch_event):
(webkit_dom_document_fragment_query_selector):
(webkit_dom_document_fragment_query_selector_all):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
(webkit_dom_document_type_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
(webkit_dom_element_dispatch_event):
(webkit_dom_element_set_attribute):
(webkit_dom_element_set_attribute_node):
(webkit_dom_element_remove_attribute_node):
(webkit_dom_element_set_attribute_ns):
(webkit_dom_element_set_attribute_node_ns):
(webkit_dom_element_matches):
(webkit_dom_element_closest):
(webkit_dom_element_insert_adjacent_element):
(webkit_dom_element_insert_adjacent_html):
(webkit_dom_element_insert_adjacent_text):
(webkit_dom_element_remove):
(webkit_dom_element_query_selector):
(webkit_dom_element_query_selector_all):
(webkit_dom_element_set_inner_html):
(webkit_dom_element_set_outer_html):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
(webkit_dom_html_anchor_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
(webkit_dom_html_applet_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
(webkit_dom_html_area_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
(webkit_dom_html_br_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
(webkit_dom_html_base_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
(webkit_dom_html_body_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
(webkit_dom_html_button_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
(webkit_dom_html_canvas_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
(webkit_dom_html_d_list_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
(webkit_dom_html_directory_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
(webkit_dom_html_div_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
(webkit_dom_html_document_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
(webkit_dom_html_element_dispatch_event):
(webkit_dom_html_element_set_inner_text):
(webkit_dom_html_element_set_outer_text):
(webkit_dom_html_element_set_content_editable):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
(webkit_dom_html_embed_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
(webkit_dom_html_field_set_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
(webkit_dom_html_font_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
(webkit_dom_html_form_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
(webkit_dom_html_frame_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
(webkit_dom_html_frame_set_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
(webkit_dom_html_hr_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
(webkit_dom_html_head_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
(webkit_dom_html_heading_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
(webkit_dom_html_html_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
(webkit_dom_html_iframe_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
(webkit_dom_html_image_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
(webkit_dom_html_input_element_dispatch_event):
(webkit_dom_html_input_element_set_max_length):
(webkit_dom_html_input_element_set_size):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
(webkit_dom_html_li_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
(webkit_dom_html_label_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
(webkit_dom_html_legend_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
(webkit_dom_html_link_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
(webkit_dom_html_map_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
(webkit_dom_html_marquee_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
(webkit_dom_html_menu_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
(webkit_dom_html_meta_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
(webkit_dom_html_mod_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
(webkit_dom_html_o_list_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
(webkit_dom_html_object_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
(webkit_dom_html_opt_group_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
(webkit_dom_html_option_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
(webkit_dom_html_paragraph_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
(webkit_dom_html_param_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
(webkit_dom_html_pre_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
(webkit_dom_html_quote_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
(webkit_dom_html_script_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_dispatch_event):
(webkit_dom_html_select_element_add):
(webkit_dom_html_select_element_set_length):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
(webkit_dom_html_style_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
(webkit_dom_html_table_caption_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
(webkit_dom_html_table_cell_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
(webkit_dom_html_table_col_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
(webkit_dom_html_table_element_dispatch_event):
(webkit_dom_html_table_element_insert_row):
(webkit_dom_html_table_element_delete_row):
(webkit_dom_html_table_element_set_caption):
(webkit_dom_html_table_element_set_t_head):
(webkit_dom_html_table_element_set_t_foot):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
(webkit_dom_html_table_row_element_dispatch_event):
(webkit_dom_html_table_row_element_insert_cell):
(webkit_dom_html_table_row_element_delete_cell):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
(webkit_dom_html_table_section_element_dispatch_event):
(webkit_dom_html_table_section_element_insert_row):
(webkit_dom_html_table_section_element_delete_row):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
(webkit_dom_html_text_area_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
(webkit_dom_html_title_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
(webkit_dom_html_u_list_element_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
(webkit_dom_media_list_delete_medium):
(webkit_dom_media_list_append_medium):
(webkit_dom_media_list_set_media_text):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
(webkit_dom_named_node_map_set_named_item):
(webkit_dom_named_node_map_remove_named_item):
(webkit_dom_named_node_map_remove_named_item_ns):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
(webkit_dom_node_dispatch_event):
(webkit_dom_node_insert_before):
(webkit_dom_node_replace_child):
(webkit_dom_node_remove_child):
(webkit_dom_node_append_child):
(webkit_dom_node_clone_node_with_error):
(webkit_dom_node_set_node_value):
(webkit_dom_node_set_text_content):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
(webkit_dom_processing_instruction_dispatch_event):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
(webkit_dom_range_set_start):
(webkit_dom_range_set_end):
(webkit_dom_range_set_start_before):
(webkit_dom_range_set_start_after):
(webkit_dom_range_set_end_before):
(webkit_dom_range_set_end_after):
(webkit_dom_range_select_node):
(webkit_dom_range_select_node_contents):
(webkit_dom_range_compare_boundary_points):
(webkit_dom_range_delete_contents):
(webkit_dom_range_extract_contents):
(webkit_dom_range_clone_contents):
(webkit_dom_range_insert_node):
(webkit_dom_range_surround_contents):
(webkit_dom_range_create_contextual_fragment):
(webkit_dom_range_compare_node):
(webkit_dom_range_intersects_node):
(webkit_dom_range_compare_point):
(webkit_dom_range_is_point_in_range):
(webkit_dom_range_expand):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
(webkit_dom_text_dispatch_event):
(webkit_dom_text_split_text):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
(webkit_dom_xpath_expression_evaluate):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
(webkit_dom_xpath_result_iterate_next):
(webkit_dom_xpath_result_snapshot_item):
(webkit_dom_xpath_result_get_number_value):
(webkit_dom_xpath_result_get_boolean_value):
(webkit_dom_xpath_result_get_single_node_value):
(webkit_dom_xpath_result_get_snapshot_length):
Source/WebKitLegacy/mac:
Stop using ExceptionCodeDescription.
* DOM/ExceptionHandlers.mm:
(raiseDOMErrorException):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219792
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mcatanzaro@igalia.com [Sun, 23 Jul 2017 21:01:28 +0000 (21:01 +0000)]
Implement FALLTHROUGH attribute for C with GCC
https://bugs.webkit.org/show_bug.cgi?id=174555
Reviewed by Darin Adler.
My previous attempt to silence the JSC -Wimplicit-fallthrough warnings failed because they
are coming from a C file, and our FALLTHROUGH macro is only implemented for C++. So
implement it for C as well, using C attribute syntax.
Note this is only possible to do for GCC, because Clang only supports this attribute using
the [[C++ attribute syntax]].
* wtf/Compiler.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219791
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Sun, 23 Jul 2017 20:35:02 +0000 (20:35 +0000)]
Create regression tests for the JIT probe.
https://bugs.webkit.org/show_bug.cgi?id=174696
<rdar://problem/
33436922>
Reviewed by Saam Barati.
The new testmasm will test the following:
1. the probe is able to read the value of CPU registers.
2. the probe is able to write the value of CPU registers.
3. the probe is able to preserve all CPU registers.
4. special case of (2): the probe is able to change the value of the stack pointer.
5. special case of (2): the probe is able to change the value of the program counter
i.e. the probe can change where the code continues executing upon returning from
the probe.
Currently, the x86, x86_64, and ARMv7 ports passes the test. ARM64 does not
because it does not support changing the sp and pc yet. The ARM64 probe
implementation will be fixed in https://bugs.webkit.org/show_bug.cgi?id=174697
later.
* Configurations/ToolExecutable.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::CPUState::pc):
(JSC::MacroAssembler::CPUState::fp):
(JSC::MacroAssembler::CPUState::sp):
(JSC::ProbeContext::pc):
(JSC::ProbeContext::fp):
(JSC::ProbeContext::sp):
* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeTrampoline):
* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::printPCRegister):
* assembler/testmasm.cpp: Added.
(hiddenTruthBecauseNoReturnIsStupid):
(usage):
(JSC::nextID):
(JSC::isPC):
(JSC::isSP):
(JSC::isFP):
(JSC::compile):
(JSC::invoke):
(JSC::compileAndRun):
(JSC::testSimple):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testFunctionToTrashRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):
(run):
(main):
* b3/air/testair.cpp:
(usage):
* shell/CMakeLists.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219790
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Sun, 23 Jul 2017 05:28:34 +0000 (05:28 +0000)]
[iOS WK2] Remove _WKDraggableElementInfo and fold PositionInformationTests into WKRequestActivatedElementInfo
https://bugs.webkit.org/show_bug.cgi?id=174758
Reviewed by Dan Bernstein.
Source/WebKit:
_WKDraggableElementInfo is no longer used in WebKit, so it should be removed. However, some of the scenarios
in PositionInformationTests that depend on _WKDraggableElementInfo are still useful to exercise: namely,
performing both synchronous and asynchronous position information updates while an async position information
update is in flight. This patch refactors these unit tests into 2 new unit tests in the existing
WKRequestActivatedElementInfo test suite.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _draggableElementAtPosition:]): Deleted.
(-[WKWebView _requestDraggableElementAtPosition:completionBlock:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKDraggableElementInfo.h: Removed.
* UIProcess/API/Cocoa/_WKDraggableElementInfo.mm: Removed.
* UIProcess/API/Cocoa/_WKDraggableElementInfoInternal.h: Removed.
* UIProcess/ios/WKContentViewInteraction.mm:
* WebKit.xcodeproj/project.pbxproj:
Tools:
Migrate position-information-related unit tests from the PositionInformationTests suite to
WKRequestActivatedElementInfo as 2 new unit tests. See WebKit2 ChangeLog for more details.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKRequestActivatedElementInfo.mm:
(TestWebKitAPI::checkElementTypeAndBoundingRect):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/ios/PositionInformationTests.mm: Removed.
* TestWebKitAPI/cocoa/TestWKWebView.h:
* TestWebKitAPI/cocoa/TestWKWebView.mm:
(-[TestWKWebView activatedElementAtPosition:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219768
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mitz@apple.com [Sat, 22 Jul 2017 22:31:00 +0000 (22:31 +0000)]
Fixed building for macOS 10.12 with the macOS 10.13 SDK after r219644.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Suppress the objc-literal-conversion warning
in one place where we are calling a class method on a Class and the compiler can’t tell
which class it is, so it chooses wrong and emits a warning.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219767
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Sat, 22 Jul 2017 21:20:23 +0000 (21:20 +0000)]
Merge ExceptionBase into DOMException and drop custom toString
https://bugs.webkit.org/show_bug.cgi?id=174755
Reviewed by Sam Weinig.
LayoutTests/imported/w3c:
Rebaseline some tests now that DOMException's custom toString has been dropped
and we rely on Error's toString. This causes the exception message to be
slightly different.
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_ecdh_bits.https-expected.txt:
* web-platform-tests/WebCryptoAPI/derive_bits_keys/test_ecdh_keys.https-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_multi-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_null-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_origin-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_space-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_zero-expected.txt:
* web-platform-tests/webrtc/RTCPeerConnection-addIceCandidate-expected.txt:
Source/WebCore:
Merge ExceptionBase into DOMException and drop custom toString, now that DOMException
is the only remaining exception type.
* CMakeLists.txt:
* Modules/mediastream/MediaStream.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::retrieveErrorMessage):
* dom/DOMAllInOne.cpp:
* dom/DOMException.cpp:
(WebCore::DOMException::DOMException):
(WebCore::DOMException::initializeDescription):
* dom/DOMException.h:
(WebCore::DOMException::code):
(WebCore::DOMException::name):
(WebCore::DOMException::message):
* dom/ExceptionBase.cpp: Removed.
* dom/ExceptionBase.h: Removed.
LayoutTests:
Rebaseline some tests now that DOMException's custom toString has been dropped
and we rely on Error's toString. This causes the exception message to be
slightly different.
* fast/canvas/canvas-getImageData-invalid-result-buffer-crash-expected.txt:
* fast/frames/sandboxed-iframe-history-denied-expected.txt:
* fast/frames/sandboxed-iframe-navigation-top-denied-expected.txt:
* fast/inspector-support/uncaught-dom1-exception-expected.txt:
* fast/inspector-support/uncaught-dom3-exception-expected.txt:
* fast/inspector-support/uncaught-dom8-exception-expected.txt:
* fast/regions/selection/crash-deselect-expected.txt:
* http/tests/security/listener/xss-JSTargetNode-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-JSTargetNode-onclick-shortcut-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-addEventListener-expected.txt:
* http/tests/security/listener/xss-XMLHttpRequest-shortcut-expected.txt:
* http/tests/security/listener/xss-window-onclick-addEventListener-expected.txt:
* http/tests/security/listener/xss-window-onclick-shortcut-expected.txt:
* http/tests/security/sandboxed-iframe-blocks-access-from-parent-expected.txt:
* http/tests/security/sandboxed-iframe-modify-self-expected.txt:
* http/tests/security/srcdoc-in-sandbox-cannot-access-parent-expected.txt:
* http/tests/security/xss-DENIED-assign-location-hash-expected.txt:
* http/tests/security/xss-DENIED-assign-location-host-expected.txt:
* http/tests/security/xss-DENIED-assign-location-hostname-expected.txt:
* http/tests/security/xss-DENIED-assign-location-nonstandardProperty-expected.txt:
* http/tests/security/xss-DENIED-assign-location-pathname-expected.txt:
* http/tests/security/xss-DENIED-assign-location-protocol-expected.txt:
* http/tests/security/xss-DENIED-assign-location-reload-expected.txt:
* http/tests/security/xss-DENIED-assign-location-search-expected.txt:
* http/tests/security/xss-DENIED-frame-name-expected.txt:
* http/tests/security/xss-DENIED-sandboxed-iframe-expected.txt:
* http/tests/security/xss-DENIED-window-name-navigator-expected.txt:
* inspector/debugger/command-line-api-exception-expected.txt:
* inspector/debugger/regress-133182-expected.txt:
* inspector/debugger/setPauseOnExceptions-all-expected.txt:
* inspector/debugger/setPauseOnExceptions-none-expected.txt:
* inspector/debugger/setPauseOnExceptions-uncaught-expected.txt:
* platform/mac/fast/dynamic/015-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219766
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
wenson_hsieh@apple.com [Sat, 22 Jul 2017 19:57:12 +0000 (19:57 +0000)]
[Mac WK2] Fix null dereference in asynchronous NSTextInputClient methods when deallocating a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=174751
<rdar://problem/
33132405>
Reviewed by Darin Adler.
Tweaks -[WKWebView dealloc] to close the WebPageProxy at an earlier time, prior to destroying the WebViewImpl.
This fixes a NSTextInputClient crash in WKWebView when exercising the following scenario:
(1) Suppose that NSTextInputContext invokes an asynchronous text input query on WKWebView immediately before
WKWebView is deallocated, such that WebPageProxy's CallbackMap contains an NSTextInputContext callback at the
time that -[WKWebView dealloc] is called. Additionally, suppose that this callback from NSTextInputContext
invokes additional NSTextInputClient methods on the WKWebView that involve plumbing through to the WebViewImpl
(which is stored as _impl on the WKWebView).
(2) Observe that when calling [super dealloc] in [WKWebView dealloc], we will destroy the WebViewImpl as a
result of setting our unique pointer to _impl to be null. In ~WebViewImpl, we invoke WebPageProxy::close, which
in turn invokes WebPageProxy::resetState.
(3) WebPageProxy::resetState then calls m_callbacks.invalidate(error), which triggers all pending callbacks.
This invokes the block described in (1), which causes us to try and call back into WKWebView, invoking
NSTextInputClient methods. Without the fix in this patch, these methods currently assume that _impl is nonnull,
even though we've already cleared out the pointer in (2), so we segfault with a null dereference.
After this patch, we close the _page at an earlier time, such that the state is reset before the WebViewImpl
(and corresponding _impl unique_ptr in WKWebView) is torn down. This ensures that _impl will not be null for
callbacks invoked after beginning to deallocate the WKWebView.
Forcing this scenario in a custom AppKit root that triggers async NSTextInputClient methods immediately when a
WKWebView is being deallocated produces a crash with the same stack trace as what we observe in the radar, but
there are no known steps to actually reproduce this crash in shipping software.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219765
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Sat, 22 Jul 2017 17:31:57 +0000 (17:31 +0000)]
REGRESSION(r204565): WKObject is broken
https://bugs.webkit.org/show_bug.cgi?id=174736
<rdar://problem/
33246169>
Reviewed by Dan Bernstein.
Source/WebKit:
Revert r204565 as making WKObject a root class caused unexpected crashes.
Instead, we now have WKObject inherit from NSProxy (instead of previously
NSObject) and we forward calls to the target.
We also need to provide an implementation for private methods such as
isNSString__ to address the issue with NSStrings that r204565 was trying
to fix.
* Shared/Cocoa/APIObject.mm:
(API::Object::unwrap):
* Shared/Cocoa/WKObject.h:
* Shared/Cocoa/WKObject.mm:
(-[WKObject dealloc]):
(-[WKObject hash]):
(-[WKObject isKindOfClass:]):
(-[WKObject isMemberOfClass:]):
(-[WKObject respondsToSelector:]):
(-[WKObject conformsToProtocol:]):
(-[WKObject forwardingTargetForSelector:]):
(-[WKObject description]):
(-[WKObject debugDescription]):
(-[WKObject classForCoder]):
(-[WKObject classForKeyedArchiver]):
(-[WKObject _web_createTarget]):
(-[WKObject forwardInvocation:]):
(-[WKObject methodSignatureForSelector:]):
(-[WKObject isNSObject__]):
(-[WKObject isNSArray__]):
(-[WKObject isNSCFConstantString__]):
(-[WKObject isNSData__]):
(-[WKObject isNSDate__]):
(-[WKObject isNSDictionary__]):
(-[WKObject isNSNumber__]):
(-[WKObject isNSOrderedSet__]):
(-[WKObject isNSSet__]):
(-[WKObject isNSString__]):
(-[WKObject isNSTimeZone__]):
(-[WKObject isNSValue__]):
Tools:
Add API test that used to crash.
* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219764
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
fpizlo@apple.com [Sat, 22 Jul 2017 14:36:18 +0000 (14:36 +0000)]
It should be easy to decide how WebKit yields
https://bugs.webkit.org/show_bug.cgi?id=174298
Reviewed by Saam Barati.
Source/bmalloc:
Use sched_yield() explicitly.
* bmalloc/StaticMutex.cpp:
(bmalloc::StaticMutex::lockSlowCase):
Source/JavaScriptCore:
Use the new WTF::Thread::yield() function for yielding instead of the C++ function.
* heap/Heap.cpp:
(JSC::Heap::resumeThePeriphery):
* heap/VisitingTimeout.h:
* runtime/JSCell.cpp:
(JSC::JSCell::lockSlow):
(JSC::JSCell::unlockSlow):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::lock):
(JSC::JSCell::unlock):
* runtime/JSLock.cpp:
(JSC::JSLock::grabAllLocks):
* runtime/SamplingProfiler.cpp:
Source/WebCore:
No new tests because the WebCore change is just a change to how we #include things.
* inspector/InspectorPageAgent.h:
* inspector/TimelineRecordFactory.h:
* workers/Worker.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.h:
Source/WebKitLegacy:
* Storage/StorageTracker.h:
Source/WTF:
Created a Thread::yield() abstraction for sched_yield(), and made WTF use it everywhere that it
had previously used std::this_thread::yield().
To make it less annoying to experiment with changes to the lock algorithm in the future, this also
moves the meat of the algorithm into LockAlgorithmInlines.h. Only two files include that header.
Since LockAlgorithm.h no longer includes ParkingLot.h, a bunch of files in WK now need to include
timing headers (Seconds, MonotonicTime, etc) manually.
* WTF.xcodeproj/project.pbxproj:
* benchmarks/ToyLocks.h:
* wtf/CMakeLists.txt:
* wtf/Lock.cpp:
* wtf/LockAlgorithm.h:
(WTF::LockAlgorithm::lockSlow): Deleted.
(WTF::LockAlgorithm::unlockSlow): Deleted.
* wtf/LockAlgorithmInlines.h: Added.
(WTF::hasParkedBit>::lockSlow):
(WTF::hasParkedBit>::unlockSlow):
* wtf/MainThread.cpp:
* wtf/RunLoopTimer.h:
* wtf/Threading.cpp:
* wtf/Threading.h:
* wtf/ThreadingPthreads.cpp:
(WTF::Thread::yield):
* wtf/ThreadingWin.cpp:
(WTF::Thread::yield):
* wtf/WordLock.cpp:
(WTF::WordLockBase::lockSlow):
(WTF::WordLockBase::unlockSlow):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219763
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sat, 22 Jul 2017 12:12:33 +0000 (12:12 +0000)]
REGRESSION(r219045): A partially loaded image may not be repainted when its complete frame finishes decoding
https://bugs.webkit.org/show_bug.cgi?id=174230
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-22
Reviewed by Simon Fraser.
Because of r219045, we now only repaint the CachedImageClinets which tried
to draw the image but they could not because they have to wait for the image
decoding to finish. This was done by keeping a HashSet of these clients
and make CachedImage own it. This HashSet is cleared once the image frame
finishes decoding and all the waited clients are repainted.
But Multiple asynchronous image decoding requests are allowed for the same
frame if new data is added to the image source. If we tried to draw the
same image twice before it finishes decoding the first request, we will
not be to record this second request since the HashSet will not add the
same client twice. When he second request finishes decoding, CachedImage
will not repaint any client since its HashSet is empty.
To fix this problem we can do the following. When an image frame finishes
decoding, CachedImage will keep its HashSet of pending drawing clients as
long as the image frame is a partially loaded frame.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
(WebCore::CachedImage::imageFrameAvailable):
* loader/cache/CachedImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::destroyDecodedData):
(WebCore::BitmapImage::dataChanged):
(WebCore::BitmapImage::setCurrentFrameDecodingStatusIfNecessary):
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::internalStartAnimation):
(WebCore::BitmapImage::internalAdvanceAnimation):
(WebCore::BitmapImage::imageFrameAvailableAtIndex):
* platform/graphics/BitmapImage.h:
* platform/graphics/ImageFrame.cpp:
(WebCore::ImageFrame::decodingStatus):
* platform/graphics/ImageFrame.h: Move DecodingStatus out of this class
to ImageTypes.h to avoid adding other header files to ImageObvsever.h
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::setNativeImage):
(WebCore::ImageFrameCache::cacheMetadataAtIndex):
(WebCore::ImageFrameCache::cacheNativeImageAtIndex):
(WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
(WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
(WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageObserver.h:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::frameDecodingStatusAtIndex):
* platform/graphics/ImageTypes.h:
* platform/image-decoders/bmp/BMPImageReader.cpp:
(WebCore::BMPImageReader::decodeBMP):
* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::frameComplete):
(WebCore::GIFImageDecoder::initFrameBuffer):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::outputScanlines):
(WebCore::JPEGImageDecoder::jpegComplete):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::rowAvailable):
(WebCore::PNGImageDecoder::pngComplete):
(WebCore::PNGImageDecoder::frameComplete):
* platform/image-decoders/webp/WEBPImageDecoder.cpp:
(WebCore::WEBPImageDecoder::decode):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219762
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Sat, 22 Jul 2017 08:12:10 +0000 (08:12 +0000)]
Drag and Drop preview image for Twitter link is the wrong shape
https://bugs.webkit.org/show_bug.cgi?id=174731
<rdar://problem/
33335616>
* dom/Range.cpp:
(WebCore::Range::absoluteRectsForRangeInText):
* page/TextIndicator.cpp:
(WebCore::initializeIndicator):
Apply some post-landing review feedback for r219756.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219761
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
utatane.tea@gmail.com [Sat, 22 Jul 2017 07:27:00 +0000 (07:27 +0000)]
[WTF] Extend ThreadGroup::add results from bool to ThreadGroupAddResult
https://bugs.webkit.org/show_bug.cgi?id=174705
Reviewed by Mark Lam.
Source/WTF:
After starting using ThreadGroup to bookkeep active threads for Signals,
we would like to know tristate of ThreadGroup::add result, NewlyAdded, AlreadyAdded, NotAdded.
This patch extends the result of ThreadGroup::add from bool to ThreadGroupAddResult tristate.
Note that NotAdded is returned if the target thread is dying.
* wtf/ThreadGroup.cpp:
(WTF::ThreadGroup::add):
(WTF::ThreadGroup::addCurrentThread):
* wtf/ThreadGroup.h:
* wtf/Threading.cpp:
(WTF::Thread::addToThreadGroup):
* wtf/Threading.h:
* wtf/threads/Signals.cpp:
(WTF::registerThreadForMachExceptionHandling):
Tools:
* TestWebKitAPI/Tests/WTF/ThreadGroup.cpp:
(TestWebKitAPI::testThreadGroup):
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219760
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sat, 22 Jul 2017 05:14:15 +0000 (05:14 +0000)]
Unreviewed, rolling out r219732.
https://bugs.webkit.org/show_bug.cgi?id=174748
static is not threadsafe in WebKit tree (Requested by
yusukesuzuki on #webkit).
Reverted changeset:
"[WTF] Drop initializeDate"
https://bugs.webkit.org/show_bug.cgi?id=174714
http://trac.webkit.org/changeset/219732
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219759
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Sat, 22 Jul 2017 04:43:37 +0000 (04:43 +0000)]
Drop IDBDatabaseException class
https://bugs.webkit.org/show_bug.cgi?id=174743
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
Rebaseline test as the exception message is slightly different.
* web-platform-tests/IndexedDB/keypath-special-identifiers-expected.txt:
Source/WebCore:
Drop IDBDatabaseException class and use DOMException directly. IDBDatabaseException was
only an internal concept and was already exposed to the Web as a DOMException. This
simplifies the code a bit and will allow for further simplification in a follow-up patch.
No new tests, no Web-facing behavior change, except for some exception messages
being slightly different.
* CMakeLists.txt:
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):
* Modules/indexeddb/IDBDatabaseError.h: Removed.
* Modules/indexeddb/IDBDatabaseException.cpp: Removed.
* Modules/indexeddb/IDBDatabaseException.h: Removed.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::cmp):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::setName):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
(WebCore::IDBKeyRange::includes):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::openKeyCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::getKey):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::count):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::result):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abort):
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::didCreateIndexOnServer):
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::addRecord):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::renameIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::putIndexKey):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::createIndex):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::begin):
(WebCore::IDBServer::SQLiteIDBTransaction::commit):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::name):
(WebCore::IDBError::message):
(WebCore::IDBError::toDOMError):
* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::userDeleteError):
(WebCore::IDBError::isNull):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* dom/DOMException.cpp:
(WebCore::DOMException::initializeDescription):
Initialize description->code from using the actual error codes in the
coreExceptions table, instead of initializing it using |ec|. |ec| is
the index in the ExceptionCode enumeration and it matches the error
code only for legacy exceptions. New exceptions such as DataError
should have a code of 0. Without this change, w3c for IDB would start
failing.
* dom/ExceptionCodeDescription.cpp:
(WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
* dom/ExceptionCodeDescription.h:
Source/WebKit:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::connectionToServerLost):
LayoutTests:
Rebaseline test as the exception messages are slightly different.
* storage/indexeddb/createIndex-after-failure-expected.txt:
* storage/indexeddb/createIndex-after-failure-private-expected.txt:
* storage/indexeddb/get-keyrange-expected.txt:
* storage/indexeddb/get-keyrange-private-expected.txt:
* storage/indexeddb/keypath-edges-expected.txt:
* storage/indexeddb/keypath-edges-private-expected.txt:
* storage/indexeddb/keyrange-expected.txt:
* storage/indexeddb/keyrange-private-expected.txt:
* storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-expected.txt:
* storage/indexeddb/modern/idbdatabase-deleteobjectstore-failures-private-expected.txt:
* storage/indexeddb/transaction-active-flag-expected.txt:
* storage/indexeddb/transaction-active-flag-private-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219758
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Sat, 22 Jul 2017 03:54:16 +0000 (03:54 +0000)]
[WebIDL] Simplify XMLHttpRequest bindings by removing built-ins
https://bugs.webkit.org/show_bug.cgi?id=174740
Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Chris Dumez.
The behavior we were getting from XMLHttpRequest.js can be implemented
with the [CachedAttribute] extended attribute. This reduces the number
of JS -> C++ jumps required and makes the code more similar to other
bindings that need caching of an IDL any value.
* CMakeLists.txt:
* DerivedSources.make:
* xml/XMLHttpRequest.js: Removed.
Remove XMLHttpRequest.js.
* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::response):
(WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
* xml/XMLHttpRequest.idl:
Replace builtin with a [CachedAttribute] and [CustomGetter]
for the response property.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219757
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Sat, 22 Jul 2017 03:01:51 +0000 (03:01 +0000)]
Drag and Drop preview image for Twitter link is the wrong shape
https://bugs.webkit.org/show_bug.cgi?id=174731
<rdar://problem/
33335616>
Reviewed by Zalan Bujtas.
TextIndicator uses Range::borderAndTextQuads and ::absoluteTextRects
in order to get the rects of the indicated text. Currently, these
functions do not respect clipping, so clipped-out text (e.g. as seen
inside links on Twitter) generates lots of meaningless indicated rects.
* page/TextIndicator.cpp:
(WebCore::estimatedBackgroundColorForRange):
(WebCore::hasAnyIllegibleColors):
Change adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary
to instead be hasAnyIllegibleColors, and referred to in the same place
as hasNonInlineOrReplacedElements, so that it follows the same
upgrade path (leaving textRects empty, so that it is later filled in
with the absoluteBoundingRect). This was a mistake in r219033, which
instead would end up painting all content, but filling in textRects
with the actual individual text rects.
This alone changes the behavior on Twitter from lots of jagged misplaced
rects to a too-large bounding rect. Combined with the following changes,
the bounding rect is reduced to the right size:
(WebCore::initializeIndicator):
Adopt the new Range::borderAndTextQuads and ::absoluteTextRects parameter
and opt-in to respecting clipping for text rects.
* dom/DOMRectList.cpp:
(WebCore::DOMRectList::DOMRectList):
* dom/DOMRectList.h:
(WebCore::DOMRectList::create):
Add a DOMRectList constructor and create() that take FloatRects, similar
to the one that takes FloatQuads, but without the boundingRect() calls.
* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::convertAbsoluteToClientRects):
Add convertAbsoluteToClientRects, similar to covertAbsoluteToClientQuads,
except acting on rects instead of quads.
* dom/Range.cpp:
(WebCore::Range::absoluteRectsForRangeInText):
(WebCore::Range::absoluteTextRects):
(WebCore::Range::getClientRects):
(WebCore::Range::borderAndTextRects):
(WebCore::Range::boundingRect):
(WebCore::Range::absoluteBoundingRect):
(WebCore::Range::borderAndTextQuads): Deleted.
* dom/Range.h:
Replace borderAndTextQuads with borderAndTextRects, because all callers
just ended up calling boundingBox() on the quads.
Factor absoluteRectsForRangeInText out of absoluteTextRects and
borderAndTextQuads, and teach it to optionally intersect the text rects
with their renderer's absoluteClippedOverflowRect.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219756
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
pvollan@apple.com [Sat, 22 Jul 2017 00:41:14 +0000 (00:41 +0000)]
Round-tripping stroke-width styles through getComputedStyle cause the text to gain a stroke.
https://bugs.webkit.org/show_bug.cgi?id=174701
Source/WebCore:
<rdar://problem/
32903679>
Reviewed by Simon Fraser.
The initial value of stroke-color should be transparent, see https://www.w3.org/TR/fill-stroke-3/#stroke-color.
Also, there is no need to set the graphics context in text stroke mode, if the stroke color is not visible.
Test: fast/css/round-trip-stroke-width-using-computed-style.html
* rendering/TextPaintStyle.cpp:
(WebCore::updateGraphicsContext):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialStrokeWidth):
(WebCore::RenderStyle::initialStrokeColor):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
LayoutTests:
Reviewed by Simon Fraser.
* fast/css/round-trip-stroke-width-using-computed-style-expected.html: Added.
* fast/css/round-trip-stroke-width-using-computed-style.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219755
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Sat, 22 Jul 2017 00:15:00 +0000 (00:15 +0000)]
Crash in many WebKit apps marking a connection invalid under Messages::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace.
<rdar://problem/
28822272> and https://bugs.webkit.org/show_bug.cgi?id=174729
Reviewed by Tim Horton.
Previously, when a NetworkLoad generated a "CanAuthenticateAgainstProtectionSpace" event, the message went from
Network process -> Web process -> UI process.
In that case, MESSAGE_CHECKing the validity of the frame in WebPageProxy made sense.
In r202511 we cut the WebProcess out of this and had Networking go straight to UI process.
As a result, the message check became invalid. The Networking process cannot possible know the validity of
particular WebPage or WebFrame identifiers.
We simply need to validate the input in NetworkProcessProxy.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Validate both the page and frame ids before
passing the call along to the WebPageProxy. Also, if either of those validations fail, respond to the network process.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219754
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Sat, 22 Jul 2017 00:13:11 +0000 (00:13 +0000)]
Remove an inaccurate comment from RenderTextLineBoxes
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::absoluteRectsForRange):
This comment has been wrong for at least 4 years.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219753
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
timothy_horton@apple.com [Fri, 21 Jul 2017 23:34:18 +0000 (23:34 +0000)]
TextIndicator::estimatedTextColorsForRange asserts inside HashSet code (inserting reserved value)
https://bugs.webkit.org/show_bug.cgi?id=174733
Reviewed by Wenson Hsieh.
* page/TextIndicator.cpp:
(WebCore::estimatedTextColorsForRange):
(WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
RGBA32 isn't a valid hash key, because we have no traits that define the
empty or deleted values, nor do we have any bits we could feasibly
use -- the full range of RGBA32 is easy to reach with various colors.
Instead, hash Color directly.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219752
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
n_wang@apple.com [Fri, 21 Jul 2017 23:25:21 +0000 (23:25 +0000)]
AX: Expose form validation on iOS as hint
https://bugs.webkit.org/show_bug.cgi?id=174722
<rdar://problem/
33459761>
Reviewed by Chris Fleizach.
Source/WebCore:
Adding the validation message to the hint of the form control element.
Test: accessibility/ios-simulator/form-control-validation-message.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isShowingValidationMessage):
(WebCore::AccessibilityObject::validationMessage):
* accessibility/AccessibilityObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityHint]):
(-[WebAccessibilityObjectWrapper accessibilityIsShowingValidationMessage]):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isShowingValidationMessage):
* html/HTMLFormControlElement.h:
LayoutTests:
* accessibility/ios-simulator/form-control-validation-message-expected.txt: Added.
* accessibility/ios-simulator/form-control-validation-message.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219751
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
aestes@apple.com [Fri, 21 Jul 2017 22:44:32 +0000 (22:44 +0000)]
[iOS] Adopt UIImagePickerControllerImageURL for photo uploads
https://bugs.webkit.org/show_bug.cgi?id=174723
<rdar://problem/
33223962>
Reviewed by Joseph Pecoraro.
In iOS 11, use the URL provided by UIImagePickerControllerImageURL, if available, as the
file URL for photo uploads. Since we use the UIImagePickerController imageExportPreset of
UIImagePickerControllerImageURLExportPresetCompatible, UIKit will take care of converting
HEIF images to JPEG for us. For other types (GIF, JPEG, and PNG), it will preserve the
original format.
Since UIImagePickerController now provides GIF and PNG representations, we no longer need to
use PHImageManager to access the original assets. This patch removes the
PHAsset/PHImageManager code added in r185241.
* Platform/spi/ios/PhotosSPI.h: Removed.
* UIProcess/ios/forms/WKFileUploadPanel.mm:
(-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
(-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]): Deleted.
* WebKit.xcodeproj/project.pbxproj:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219750
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 22:41:26 +0000 (22:41 +0000)]
Web Inspector: inspect(aFunction) should jump to function definition
https://bugs.webkit.org/show_bug.cgi?id=149344
<rdar://problem/
11563607>
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-21
Reviewed by Matt Baker.
Source/WebInspectorUI:
* UserInterface/Protocol/InspectorObserver.js:
(WebInspector.InspectorObserver.prototype.inspect):
If we receive a function remote object jump to its location if available.
LayoutTests:
* inspector/runtime/CommandLineAPI-inspect-expected.txt: Added.
* inspector/runtime/CommandLineAPI-inspect.html: Added.
Add tests for the CommandLineAPI's inspect() and how it triggers the
`Inspector.inspect` event with a RemoteObject and hints.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219749
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jlewis3@apple.com [Fri, 21 Jul 2017 22:22:26 +0000 (22:22 +0000)]
Adjusted test expectations.
https://bugs.webkit.org/show_bug.cgi?id=173861
Unreviewed test gardening.
* platform/mac-wk2/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219748
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jbedard@apple.com [Fri, 21 Jul 2017 22:20:37 +0000 (22:20 +0000)]
Fail gracefully when xcrun fails in IOSSimulatorPort constructor
https://bugs.webkit.org/show_bug.cgi?id=174724
Reviewed by Aakash Jain.
* Scripts/webkitpy/port/ios_simulator.py:
(IOSSimulatorPort.__init__): Ignore any errors when attempting to find a running
simulator. Errors here should be treated the same as no simulators found.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219747
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Fri, 21 Jul 2017 22:04:01 +0000 (22:04 +0000)]
Unreviewed, fix Mac cmake build after r219733
* PlatformMac.cmake:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219746
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Fri, 21 Jul 2017 21:26:15 +0000 (21:26 +0000)]
[cmake][Mac] Unreviewed, fix linking WebKitSystemInterface
After r219560 link_directories() in PlatformXXX.cmake files does not
affect corresponding targets.
* PlatformMac.cmake:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219745
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 21:20:25 +0000 (21:20 +0000)]
[WebIDL] Remove the need for the side map of DeprecatedCSSOMValue roots
https://bugs.webkit.org/show_bug.cgi?id=174713
Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Andreas Kling.
We used to not want to bloat the size of CSSValues with a pointer to the
owner CSSStyleDeclaration, so, for GC purposes we need kept a mapping of
them on DOMWrapperWorld that only got set if a wrapper was made. Now that
we have DeprecatedCSSOMValue, a wrapper for CSSValue that only gets created
for the bindings, we no longer need the side table, and simply have the
DeprecatedCSSOMValue maintain a reference to the CSSStyleDeclaration.
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::wrappers):
Remove m_deprecatedCSSOMValueRoots and make m_wrappers private with a getter.
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue): Deleted.
Remove custom implementation of getPropertyCSSValue, now that it no longer
needs to update m_deprecatedCSSOMValueRoots.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
* bindings/js/JSDOMWrapperCache.h:
(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):
* bindings/js/JSNodeCustom.cpp:
(WebCore::getOutOfLineCachedWrapper):
Use wrappers getter rather than direct member variable.
* bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
Rather than checking the side table for roots, now get the root
via the reference CSSStyleDeclaration.
(WebCore::JSDeprecatedCSSOMValueOwner::finalize): Deleted.
Remove custom finalize now that we don't have to remove ourself
from m_deprecatedCSSOMValueRoots.
* css/CSSStyleDeclaration.idl:
Remove [Custom] from getPropertyCSSValue.
* css/DeprecatedCSSOMValue.idl:
Remove [JSCustomFinalize].
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
* css/CSSImageValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
* css/CSSPrimitiveValue.h:
* css/CSSStyleDeclaration.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::createDeprecatedCSSOMWrapper):
* css/CSSValue.h:
* css/DeprecatedCSSOMCounter.h:
* css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
* css/DeprecatedCSSOMPrimitiveValue.h:
(WebCore::DeprecatedCSSOMPrimitiveValue::create):
(WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
* css/DeprecatedCSSOMRGBColor.h:
* css/DeprecatedCSSOMRect.h:
* css/DeprecatedCSSOMValue.h:
(WebCore::DeprecatedCSSOMValue::owner):
(WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMComplexValue::create):
(WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
* css/DeprecatedCSSOMValueList.h:
(WebCore::DeprecatedCSSOMValueList::create):
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
* css/PropertySetCSSStyleDeclaration.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
Pass owning CSSStyleDeclaration to DeprecatedCSSOMValue and derived classes.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219744
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
akling@apple.com [Fri, 21 Jul 2017 21:16:29 +0000 (21:16 +0000)]
Use more references in event dispatch code
https://bugs.webkit.org/show_bug.cgi?id=174681
Reviewed by Geoffrey Garen.
Source/WebCore:
Make EventListener::handleEvent() take a ScriptExecutionContext&, Event&.
Then make everything build again. Various null checks and assertions
disappear in the process.
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSErrorHandler.h:
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::initializeJSFunction):
(WebCore::JSEventListener::handleEvent):
(WebCore::eventHandlerAttribute):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::jsFunction):
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSLazyEventListener.h:
* dom/EventListener.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::defaultEventHandler):
* html/ImageDocument.cpp:
(WebCore::ImageEventListener::handleEvent):
* inspector/CommandLineAPIHost.cpp:
(WebCore::listenerEntriesFromListenerInfo):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* inspector/InspectorIndexedDBAgent.cpp:
* platform/Widget.h:
(WebCore::Widget::handleEvent):
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::handleEvent):
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::handleEvent):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefTargetEventListener::handleEvent):
* svg/animation/SVGSMILElement.cpp:
(WebCore::ConditionEventListener::handleEvent):
(WebCore::SVGSMILElement::handleConditionEvent):
* svg/animation/SVGSMILElement.h:
Source/WebKit:
* WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
(WebKit::PDFPluginAnnotation::handleEvent):
(WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::handleEvent):
* WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
* WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
(WebKit::PDFPluginPasswordField::handleEvent):
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
(WebKit::PDFPluginTextAnnotation::handleEvent):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::createWebEvent):
(WebKit::PluginView::handleEvent):
* WebProcess/Plugins/PluginView.h:
Source/WebKitLegacy/mac:
* DOM/ObjCEventListener.h:
* DOM/ObjCEventListener.mm:
(WebCore::ObjCEventListener::handleEvent):
* WebCoreSupport/WebFrameLoaderClient.mm:
(NetscapePluginWidget::handleEvent):
Source/WebKitLegacy/win:
* DOMEventsClasses.cpp:
(WebEventListener::handleEvent):
* DOMEventsClasses.h:
* Plugins/PluginView.cpp:
(WebCore::PluginView::handleEvent):
* Plugins/PluginView.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219743
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
zalan@apple.com [Fri, 21 Jul 2017 21:04:43 +0000 (21:04 +0000)]
iBooks: Overlapping/missing content at beginning/end of paragraph.
https://bugs.webkit.org/show_bug.cgi?id=174717
<rdar://problem/
33117912>
Reviewed by Simon Fraser.
By definiton simple and normal line layout should always produce the exact same lineboxes. It enables us not
to force repaint while swapping between these 2 line layouts.
However in certain cases (font size pixel rounding as an example) they don't agree on how much content fits the line and
that could result in missing/overlapping content due to the lack of repaint.
Unable to test.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::ensureLineBoxes):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219742
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 20:53:01 +0000 (20:53 +0000)]
Drop make_dom_exceptions.pl script that we only have DOMException
https://bugs.webkit.org/show_bug.cgi?id=174699
Reviewed by Darin Adler.
Drop make_dom_exceptions.pl script that we only have DOMException.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:
* bindings/js/JSDOMExceptionHandling.cpp:
* css/FontFaceSet.cpp:
* dom/DOMAllInOne.cpp:
* dom/DOMExceptions.in: Removed.
* dom/ExceptionCodeDescription.cpp: Added.
(WebCore::ExceptionCodeDescription::ExceptionCodeDescription):
* dom/ExceptionCodeDescription.h: Added.
* dom/make_dom_exceptions.pl: Removed.
* inspector/WebInjectedScriptHost.cpp:
(WebCore::WebInjectedScriptHost::subtype):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219741
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
mark.lam@apple.com [Fri, 21 Jul 2017 20:44:33 +0000 (20:44 +0000)]
Refactor MASM probe CPUState to use arrays for register storage.
https://bugs.webkit.org/show_bug.cgi?id=174694
Reviewed by Keith Miller.
Using arrays for register storage in CPUState allows us to do away with the
huge switch statements to decode each register id. We can now simply index into
the arrays.
With this patch, we now:
1. Remove the need for macros for defining the list of CPU registers.
We can go back to simple enums. This makes the code easier to read.
2. Make the assembler the authority on register names.
Most of this code is moved into the assembler from GPRInfo and FPRInfo.
GPRInfo and FPRInfo now forwards to the assembler.
3. Make the assembler the authority on the number of registers of each type.
4. Fix a "bug" in ARMv7's lastRegister(). It was previously omitting lr and pc.
This is inconsistent with how every other CPU architecture implements
lastRegister(). This patch fixes it to return the true last GPR i.e. pc, but
updates RegisterSet::reservedHardwareRegisters() to exclude those registers.
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::numberOfRegisters):
(JSC::ARM64Assembler::firstSPRegister):
(JSC::ARM64Assembler::lastSPRegister):
(JSC::ARM64Assembler::numberOfSPRegisters):
(JSC::ARM64Assembler::numberOfFPRegisters):
(JSC::ARM64Assembler::gprName):
(JSC::ARM64Assembler::sprName):
(JSC::ARM64Assembler::fprName):
* assembler/ARMAssembler.h:
(JSC::ARMAssembler::numberOfRegisters):
(JSC::ARMAssembler::firstSPRegister):
(JSC::ARMAssembler::lastSPRegister):
(JSC::ARMAssembler::numberOfSPRegisters):
(JSC::ARMAssembler::numberOfFPRegisters):
(JSC::ARMAssembler::gprName):
(JSC::ARMAssembler::sprName):
(JSC::ARMAssembler::fprName):
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::lastRegister):
(JSC::ARMv7Assembler::numberOfRegisters):
(JSC::ARMv7Assembler::firstSPRegister):
(JSC::ARMv7Assembler::lastSPRegister):
(JSC::ARMv7Assembler::numberOfSPRegisters):
(JSC::ARMv7Assembler::numberOfFPRegisters):
(JSC::ARMv7Assembler::gprName):
(JSC::ARMv7Assembler::sprName):
(JSC::ARMv7Assembler::fprName):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::numberOfRegisters):
(JSC::AbstractMacroAssembler::gprName):
(JSC::AbstractMacroAssembler::firstSPRegister):
(JSC::AbstractMacroAssembler::lastSPRegister):
(JSC::AbstractMacroAssembler::numberOfSPRegisters):
(JSC::AbstractMacroAssembler::sprName):
(JSC::AbstractMacroAssembler::numberOfFPRegisters):
(JSC::AbstractMacroAssembler::fprName):
* assembler/MIPSAssembler.h:
(JSC::MIPSAssembler::numberOfRegisters):
(JSC::MIPSAssembler::firstSPRegister):
(JSC::MIPSAssembler::lastSPRegister):
(JSC::MIPSAssembler::numberOfSPRegisters):
(JSC::MIPSAssembler::numberOfFPRegisters):
(JSC::MIPSAssembler::gprName):
(JSC::MIPSAssembler::sprName):
(JSC::MIPSAssembler::fprName):
* assembler/MacroAssembler.h:
(JSC::MacroAssembler::CPUState::gprName):
(JSC::MacroAssembler::CPUState::sprName):
(JSC::MacroAssembler::CPUState::fprName):
(JSC::MacroAssembler::CPUState::gpr):
(JSC::MacroAssembler::CPUState::spr):
(JSC::MacroAssembler::CPUState::fpr):
(JSC::MacroAssembler::CPUState::pc):
(JSC::MacroAssembler::CPUState::fp):
(JSC::MacroAssembler::CPUState::sp):
(JSC::ProbeContext::gpr):
(JSC::ProbeContext::spr):
(JSC::ProbeContext::fpr):
(JSC::ProbeContext::gprName):
(JSC::ProbeContext::sprName):
(JSC::ProbeContext::fprName):
(JSC::MacroAssembler::numberOfRegisters): Deleted.
(JSC::MacroAssembler::numberOfFPRegisters): Deleted.
* assembler/MacroAssemblerARM.cpp:
* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeTrampoline):
* assembler/MacroAssemblerARMv7.cpp:
* assembler/MacroAssemblerPrinter.cpp:
(JSC::Printer::nextID):
(JSC::Printer::printAllRegisters):
(JSC::Printer::printPCRegister):
(JSC::Printer::printRegisterID):
(JSC::Printer::printAddress):
* assembler/MacroAssemblerX86Common.cpp:
* assembler/X86Assembler.h:
(JSC::X86Assembler::numberOfRegisters):
(JSC::X86Assembler::firstSPRegister):
(JSC::X86Assembler::lastSPRegister):
(JSC::X86Assembler::numberOfSPRegisters):
(JSC::X86Assembler::numberOfFPRegisters):
(JSC::X86Assembler::gprName):
(JSC::X86Assembler::sprName):
(JSC::X86Assembler::fprName):
* jit/FPRInfo.h:
(JSC::FPRInfo::debugName):
* jit/GPRInfo.h:
(JSC::GPRInfo::debugName):
* jit/RegisterSet.cpp:
(JSC::RegisterSet::reservedHardwareRegisters):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219740
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 20:40:13 +0000 (20:40 +0000)]
WebResourceLoadStatisticsStore::m_operatingDates is unsafely modified from several threads
https://bugs.webkit.org/show_bug.cgi?id=174721
<rdar://problem/
33400343>
Reviewed by Brent Fulgham.
WebResourceLoadStatisticsStore::m_operatingDates is supposed to only be modified on
the background thread. However, WebResourceLoadStatisticsStore::performDailyTasks()
was mistakenly calling includeTodayAsOperatingDateIfNecessary() on the main thread,
which would modify m_operatingDates. This could lead to crashes such as the
one in <rdar://problem/
33400343>, as the main thread may modify m_operatingDates
while we are interating over it on the background thread to save it to disk.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::performDailyTasks):
(WebKit::WebResourceLoadStatisticsStore::includeTodayAsOperatingDateIfNecessary):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219739
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 20:38:21 +0000 (20:38 +0000)]
[CG] An image should not invoke many system calls before confirming its format is supported
https://bugs.webkit.org/show_bug.cgi?id=174692
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-07-21
Reviewed by Tim Horton.
We should be careful when invoking system calls before confirming that the
image type is available and it is one of the whitelist formats. Otherwise
we will be calling the parsers of the unsupported formats.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::setImageDataBuffer): The check isAllowedImageUTI()
is now done in ImageDecoder::encodedDataStatus() which will return Error
if there is an error in the data or "isAllowedImageUTI() returns false."
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::dataChanged): Avoid calling canUseAsyncDecodingForLargeImages()
before confirming the image type is available and it's supported by WebKit.
canUseAsyncDecodingForLargeImages() tries to cache the first frame of the
image to know its size. Asking the ImageFrameCache to destroy its decoded
frames is not needed unless ImageFrameCache::decodedSize() is not zero.
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::encodedDataStatus): Avoid calling CGImageSourceGetStatus()
before knowing the UTI of the image. When knowing it, we call CGImageSourceGetStatus()
and if it returns kCGImageStatusIncomplete or kCGImageStatusComplete, we
check whether isAllowedImageUTI() or not. If isAllowedImageUTI() returns
false, return Error which will make the CachedImage cancel loading the
rest of the image.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219738
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 19:55:00 +0000 (19:55 +0000)]
AudioTrackPrivateMediaStreamCocoa shouldn't set AudioSession::setPreferredBufferSize
https://bugs.webkit.org/show_bug.cgi?id=174707
rdar://problem/
33446809
Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-21
Reviewed by Eric Carlson.
Manually tested for audio side effects.
AudioChannel::copyFrom fails when AudioChannel lengths don't match.
This happens because PlatformMediaSessionManager::updateSessionState() owns and sets
AudioSession::setPreferredBufferSize().
However, AudioTrackPrivateMediaStreamCocoa::createAudioUnit, when it creates an input
audio unit is setting AudioSession::setPreferredBufferSize() directly to its own arbitrary value.
AudioSession::setPreferredBufferSize() should be managed by the higher level
PlatformMediaSessionManager, and not modified by audio unit creation, in order to keep harmony
within the audio pipeline.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219737
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 19:48:48 +0000 (19:48 +0000)]
Noise when AudioChannel lengths don't match.
https://bugs.webkit.org/show_bug.cgi?id=174706
rdar://problem/
33389856
Patch by Jeremy Jones <jeremyj@apple.com> on 2017-07-21
Reviewed by Eric Carlson.
When AudioChannel lengths don't match, copyFrom() returns early leaving uninitialized data in the audio buffer.
This change zeros out the data, so there isn't objectionable noise sent to the speaker.
* platform/audio/AudioChannel.cpp:
(WebCore::AudioChannel::copyFrom):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219736
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 19:39:57 +0000 (19:39 +0000)]
[WebIDL] Make a few parameters non-nullable in inspector IDL files
https://bugs.webkit.org/show_bug.cgi?id=174719
Patch by Sam Weinig <sam@webkit.org> on 2017-07-21
Reviewed by Joseph Pecoraro.
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::databaseId):
(WebCore::CommandLineAPIHost::storageId):
* inspector/CommandLineAPIHost.h:
* inspector/CommandLineAPIHost.idl:
* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::storageId):
* inspector/InspectorDOMStorageAgent.h:
* inspector/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::databaseId):
* inspector/InspectorDatabaseAgent.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu):
(WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Remove nullability from arguments that should never be null.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219735
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 19:36:40 +0000 (19:36 +0000)]
Web Inspector: Avoid subclassing WebInspector.Object if we do not need to
https://bugs.webkit.org/show_bug.cgi?id=174703
Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-07-21
Reviewed by Brian Burg.
* UserInterface/Models/LogObject.js:
(WebInspector.LogObject):
(WebInspector.LogObject.prototype.get startDate): Deleted.
Remove unused startDate property as well.
* UserInterface/Base/YieldableTask.js:
* UserInterface/Debug/ProtocolTrace.js:
* UserInterface/Models/AnalyzerMessage.js:
* UserInterface/Models/ApplicationCacheFrame.js:
* UserInterface/Models/ApplicationCacheManifest.js:
* UserInterface/Models/BackForwardEntry.js:
* UserInterface/Models/Branch.js:
* UserInterface/Models/BreakpointAction.js:
* UserInterface/Models/CSSMedia.js:
* UserInterface/Models/CSSSelector.js:
* UserInterface/Models/CallFrame.js:
* UserInterface/Models/CallingContextTree.js:
* UserInterface/Models/CallingContextTreeNode.js:
* UserInterface/Models/CollectionEntry.js:
* UserInterface/Models/CollectionEntryPreview.js:
* UserInterface/Models/ConsoleMessage.js:
* UserInterface/Models/DOMSearchMatchObject.js:
* UserInterface/Models/DatabaseObject.js:
* UserInterface/Models/DatabaseTableObject.js:
* UserInterface/Models/DebuggerDashboard.js:
* UserInterface/Models/DebuggerData.js:
* UserInterface/Models/ExecutionContext.js:
* UserInterface/Models/ExecutionContextList.js:
* UserInterface/Models/GarbageCollection.js:
* UserInterface/Models/HeapSnapshotRootPath.js:
* UserInterface/Models/IndexedDatabase.js:
* UserInterface/Models/IndexedDatabaseObjectStore.js:
* UserInterface/Models/IndexedDatabaseObjectStoreIndex.js:
* UserInterface/Models/Instrument.js:
* UserInterface/Models/KeyboardShortcut.js:
* UserInterface/Models/LineWidget.js:
* UserInterface/Models/MemoryCategory.js:
* UserInterface/Models/MemoryPressureEvent.js:
* UserInterface/Models/ObjectPreview.js:
* UserInterface/Models/Probe.js:
* UserInterface/Models/ProbeSetDataFrame.js:
* UserInterface/Models/Profile.js:
* UserInterface/Models/ProfileNode.js:
* UserInterface/Models/ProfileNodeCall.js:
* UserInterface/Models/PropertyDescriptor.js:
* UserInterface/Models/PropertyPath.js:
* UserInterface/Models/PropertyPreview.js:
* UserInterface/Models/ResourceQueryMatch.js:
* UserInterface/Models/ResourceQueryResult.js:
* UserInterface/Models/ResourceTimingData.js:
* UserInterface/Models/Revision.js:
* UserInterface/Models/ScopeChainNode.js:
* UserInterface/Models/ScriptSyntaxTree.js:
* UserInterface/Models/SourceCodePosition.js:
* UserInterface/Models/SourceCodeSearchMatchObject.js:
* UserInterface/Models/SourceMap.js:
* UserInterface/Models/StackTrace.js:
* UserInterface/Models/StructureDescription.js:
* UserInterface/Models/TextMarker.js:
* UserInterface/Models/TextRange.js:
* UserInterface/Models/TimelineRange.js:
* UserInterface/Models/TypeDescription.js:
* UserInterface/Models/TypeSet.js:
* UserInterface/Protocol/ProtocolTracer.js:
* UserInterface/Proxies/FormatterWorkerProxy.js:
* UserInterface/Proxies/HeapSnapshotDiffProxy.js:
* UserInterface/Proxies/HeapSnapshotWorkerProxy.js:
* UserInterface/Test/TestSuite.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219734
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Fri, 21 Jul 2017 18:48:17 +0000 (18:48 +0000)]
Get rid of WebCore IconDatabase code.
https://bugs.webkit.org/show_bug.cgi?id=174700
Reviewed by Tim Horton.
Source/WebCore:
No new tests (No behavior change).
Tons of red.
Very little green.
No further explanation.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::implicitClose):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::~HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::setURLString):
* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::iconLoadDecisionAvailable): Deleted.
(WebCore::iconLoadDecisionCallback): Deleted.
(WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Deleted.
(WebCore::DocumentLoader::continueIconLoadWithDecision): Deleted.
(WebCore::iconDataCallback): Deleted.
(WebCore::DocumentLoader::getIconDataForIconURL): Deleted.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::linkIcons):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader):
(WebCore::FrameLoader::stop):
* loader/FrameLoader.h:
(WebCore::FrameLoader::subframeLoader):
(WebCore::FrameLoader::icon): Deleted.
* loader/FrameLoaderClient.h:
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* loader/icon/IconController.cpp: Removed.
* loader/icon/IconController.h: Removed.
* loader/icon/IconDatabase.cpp: Removed.
* loader/icon/IconDatabase.h: Removed.
* loader/icon/IconDatabaseBase.cpp: Removed.
* loader/icon/IconDatabaseBase.h: Removed.
* loader/icon/IconDatabaseClient.h: Removed.
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:
* loader/icon/IconRecord.cpp: Removed.
* loader/icon/IconRecord.h: Removed.
* loader/icon/PageURLRecord.cpp: Removed.
* loader/icon/PageURLRecord.h: Removed.
* testing/Internals.cpp:
(WebCore::Internals::shortcutIconURLs):
Source/WebKit:
* UIProcess/API/glib/WebKitWebContext.cpp:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
Source/WebKitLegacy:
* WebKitLegacy.xcodeproj/project.pbxproj:
Source/WebKitLegacy/mac:
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics iconPageURLMappingCount]):
(+[WebCoreStatistics iconRetainedPageURLCount]):
(+[WebCoreStatistics iconRecordCount]):
(+[WebCoreStatistics iconsWithDataCount]):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
* WebCoreSupport/WebIconDatabaseClient.h: Removed.
* WebCoreSupport/WebIconDatabaseClient.mm: Removed.
* WebView/WebView.mm:
(-[WebView mainFrameIconURL]):
LayoutTests:
* fast/dom/icon-url-list-expected.txt:
* fast/dom/icon-url-list.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219733
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
utatane.tea@gmail.com [Fri, 21 Jul 2017 16:59:46 +0000 (16:59 +0000)]
[WTF] Drop initializeDate
https://bugs.webkit.org/show_bug.cgi?id=174714
Reviewed by Darin Adler.
minYear static variable will be initialized in an exclusive manner, which is ensured by C++ "static" semantics.
Thus, we do not need to call initializeDate() explicitly.
* wtf/DateMath.cpp:
(WTF::equivalentYearForDST):
(WTF::initializeDates): Deleted.
* wtf/Threading.cpp:
(WTF::initializeThreading):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219732
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
utatane.tea@gmail.com [Fri, 21 Jul 2017 16:41:34 +0000 (16:41 +0000)]
[JSC] Introduce static symbols
https://bugs.webkit.org/show_bug.cgi?id=158863
Reviewed by Darin Adler.
Source/JavaScriptCore:
We use StaticSymbolImpl to initialize PrivateNames and builtin Symbols.
As a result, we can share the same Symbol values between VMs and threads.
And we do not need to allocate Ref<SymbolImpl> for these symbols at runtime.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.cpp: Added.
Suppress warning C4307, integral constant overflow. It is intentional in constexpr hash value calculation.
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames):
* builtins/BuiltinUtils.h:
Source/WTF:
We add a new class StaticSymbolImpl. StaticSymbolImpl can offer
the way to create static SymbolImpl. It can be shared between
multiple VMs and multiple threads.
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl):
(WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&):
For StaticSymbolImpl's hashForSymbol, we use usual string hash value.
Since all the SymbolImpls are unique, basically, any value is OK here.
Non-confilicting to the other SymbolImpls is ideal.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219731
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 16:35:32 +0000 (16:35 +0000)]
Rename DOMCoreException class to DOMException
https://bugs.webkit.org/show_bug.cgi?id=174698
Reviewed by Darin Adler.
Rename DOMCoreException class to DOMException to match its Web-exposed name.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/quota/StorageErrorCallback.cpp:
(WebCore::StorageErrorCallback::CallbackTask::CallbackTask):
* Modules/quota/StorageErrorCallback.h:
* Modules/quota/StorageErrorCallback.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::retrieveErrorMessage):
(WebCore::createDOMException):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadDispatcher):
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* dom/DOMAllInOne.cpp:
* dom/DOMException.cpp: Renamed from Source/WebCore/dom/DOMCoreException.cpp.
(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):
(WebCore::DOMException::initializeDescription):
* dom/DOMException.h: Renamed from Source/WebCore/dom/DOMCoreException.h.
(WebCore::DOMException::create):
(WebCore::DOMException::DOMException):
* dom/DOMException.idl: Renamed from Source/WebCore/dom/DOMCoreException.idl.
* dom/DOMExceptions.in:
* dom/make_dom_exceptions.pl:
(generateImplementation):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219730
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 16:34:49 +0000 (16:34 +0000)]
Unreviewed, rebaseline test after r219708.
* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219729
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 16:02:22 +0000 (16:02 +0000)]
[CMake] Add an option to stop build after generating project files
https://bugs.webkit.org/show_bug.cgi?id=174664
Patch by Yousuke Kimoto <Yousuke.Kimoto@sony.com> on 2017-07-21
Reviewed by Konstantin Tokarev.
Add "--generate-project-only" to stop build after generating project files.
* Scripts/build-webkit: Add '--generate-project-only' option and a checker to stop build.
* Scripts/webkitdirs.pm: Add a function to check '--generate-project-only' option and the same checker as the above
(buildCMakeProjectOrExit): Add a cheker to stop build stop build after generating project files.
(determineIsGenerateProjectOnly): Check if '--generate-project-only' option is specified
(isGenerateProjectOnly): ditto
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219728
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
utatane.tea@gmail.com [Fri, 21 Jul 2017 16:01:01 +0000 (16:01 +0000)]
[FTL] Arguments elimination is suppressed by unreachable blocks
https://bugs.webkit.org/show_bug.cgi?id=174352
Reviewed by Filip Pizlo.
JSTests:
* stress/arguments-elimination-force-exit.js: Added.
(shouldBe):
(strict):
(sloppy):
* stress/arguments-elimination-throw.js: Added.
(shouldBe):
(shouldThrow):
(sloppy):
(isArguments):
Source/JavaScriptCore:
If we do not execute `op_get_by_id`, our value profiling tells us unpredictable and DFG emits ForceOSRExit.
The problem is that arguments elimination phase checks escaping even when ForceOSRExit preceeds.
Since GetById without information can escape arguments if it is specified, non-executed code including
op_get_by_id with arguments can escape arguments.
For example,
function test(flag)
{
if (flag) {
// This is not executed, but emits GetById with arguments.
// It prevents us from eliminating materialization.
return arguments.length;
}
return arguments.length;
}
noInline(test);
while (true)
test(false);
We do not perform CFA and dead-node clipping yet when performing arguments elimination phase.
So this GetById exists and escapes arguments.
To solve this problem, our arguments elimination phase checks preceding pseudo-terminal nodes.
If it is shown, following GetById does not escape arguments. Compared to performing AI, it is
lightweight. But it catches much of typical cases we failed to perform arguments elimination.
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGNode.h:
(JSC::DFG::Node::isPseudoTerminal):
* dfg/DFGValidate.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219727
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
weinig@apple.com [Fri, 21 Jul 2017 15:50:55 +0000 (15:50 +0000)]
Follow up to https://bugs.webkit.org/show_bug.cgi?id=174659.
* inspector/InspectorFrontendHost.idl:
Remove unnecessary JSGenerateToJSObject noticed in review.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219726
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
utatane.tea@gmail.com [Fri, 21 Jul 2017 15:37:52 +0000 (15:37 +0000)]
[WTF] Newly added AtomicStringImpl should use BufferInternal static string if StringImpl is static
https://bugs.webkit.org/show_bug.cgi?id=174501
Reviewed by Darin Adler.
Source/WTF:
When creating AtomicStringImpl from static StringImpl, we can just use createWithoutCopying
to create a BufferInternal AtomicStringImpl which m_data{8,16} is static string's one.
* wtf/text/AtomicStringImpl.cpp:
(WTF::CStringTranslator::hash):
(WTF::CStringTranslator::equal):
(WTF::CStringTranslator::translate):
(WTF::AtomicStringImpl::add):
(WTF::HashTranslatorCharBuffer::HashTranslatorCharBuffer):
(WTF::UCharBufferTranslator::hash):
(WTF::UCharBufferTranslator::equal):
(WTF::UCharBufferTranslator::translate):
(WTF::LCharBufferTranslator::hash):
(WTF::LCharBufferTranslator::equal):
(WTF::LCharBufferTranslator::translate):
(WTF::BufferFromStaticDataTranslator::hash):
(WTF::BufferFromStaticDataTranslator::equal):
(WTF::BufferFromStaticDataTranslator::translate):
(WTF::AtomicStringImpl::addLiteral):
(WTF::addSymbol):
(WTF::addStatic):
(WTF::AtomicStringImpl::addSlowCase):
(WTF::AtomicStringImpl::lookUp):
(WTF::CharBufferFromLiteralDataTranslator::hash): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::equal): Deleted.
(WTF::CharBufferFromLiteralDataTranslator::translate): Deleted.
(WTF::addSubstring): Deleted.
* wtf/text/StringImpl.h:
Tools:
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219725
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
annulen@yandex.ru [Fri, 21 Jul 2017 13:46:13 +0000 (13:46 +0000)]
[cmake] Unreviewed, add definitions necessary to use ICU shipped with macOS
macOS system ICU libraries are built with U_DISABLE_RENAMING=1 and
U_SHOW_CPLUSPLUS_API=0. After r219155 we have to pass this definitons
explicitly, because ICU headers in the tree are not modified anymore.
.:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:
Source/WTF:
* wtf/PlatformMac.cmake: Rely on ICU_LIBRARIES instead of passing ICU
library name explicitly in WTF_LIBRARIES.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219724
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Fri, 21 Jul 2017 10:22:25 +0000 (10:22 +0000)]
Web Automation: implicit navigations don't cause browsing context switch
https://bugs.webkit.org/show_bug.cgi?id=174633
<rdar://problem/
33387797>
Reviewed by Brian Burg.
When a new page load replaces the current frameset, for example when a link in the current browser context has a
_top target, there's no explicit context switch, so the web driver doesn't know that the current browsing
context is no longer valid. Following commands will still be using the previous frame as the current browsing
context, but they don't fail with no such frame because the frame is still alive in the page cache and
referenced in the internal maps used in both UI and web processes. This causes test
testShouldFocusOnTheReplacementWhenAFrameFollowsALinkToA_TopTargetedPage to fail, since it expects a no such
frame exception. When a new page navigation happens we can simply remove references to frames from
m_handleWebFrameMap in WebAutomationSession, because any existing frame reference in the map should be for a
previous page. With this, before the next command is executed, waitForNavigationToComplete will be called and it
will fail with no such frame, condition that is handled to switch to the top level browser context. The test
still fails, because the find element command is called with the top level browsing context, returning no such
element, instead of no such frame. This is consistent with Chrome.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::navigationOccurredForFrame): Clear the m_handleWebFrameMap when a new page load
finished.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219723
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Fri, 21 Jul 2017 09:50:49 +0000 (09:50 +0000)]
WebDriver: wait until navigation is complete before running new commands and after a click
https://bugs.webkit.org/show_bug.cgi?id=174670
Reviewed by Brian Burg.
Source/WebDriver:
We are already waiting for navigation to complete after navigation commands (go, back, forward, refresh), but
the spec says we should always wait before executing a new command and also after a click. This is causing test
testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes to sometimes fail, because it does .click()
+ .title and expects the title to tbe the one of the page loaded by the click. Since the load happens very fast,
the test usually passes, but in a real case with a slower load, the title of the previous page will be returned
most of the times.
6.3 Processing Model. Step 7. Wait for navigation to complete. If this returns an error return its value and
jump to step 1 in this overall algorithm, otherwise continue.
https://www.w3.org/TR/webdriver/#processing-model
14.1 Element Click. Step 10. If the click causes navigation: 1. Run the post-navigation checks and return its
value if it is an error. 2. Try to wait for navigation to complete.
https://www.w3.org/TR/webdriver/#element-click
* Session.cpp:
(WebDriver::Session::waitForNavigationToComplete): Send waitForNavigationToComplete message to the browser to
wait for any pending navigation of current browsing context to complete.
(WebDriver::Session::elementClick): Call waitForNavigationToComplete() after the click.
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::go): Wait for navigations to complete before running the command.
(WebDriver::WebDriverService::getCurrentURL): Ditto.
(WebDriver::WebDriverService::back): Ditto.
(WebDriver::WebDriverService::forward): Ditto.
(WebDriver::WebDriverService::refresh): Ditto.
(WebDriver::WebDriverService::getTitle): Ditto.
(WebDriver::WebDriverService::switchToFrame): Ditto.
(WebDriver::WebDriverService::switchToParentFrame): Ditto.
(WebDriver::WebDriverService::findElement): Ditto.
(WebDriver::WebDriverService::findElements): Ditto.
(WebDriver::WebDriverService::executeScript): Ditto.
(WebDriver::WebDriverService::executeAsyncScript): Ditto.
Source/WebKit:
Add waitForNavigationToComplete method to Automation to allow WebDriver to wait for pending navigations to
complete. The new method already receives page load strategy and timeout, but they are not implemented yet.
* UIProcess/Automation/Automation.json: Add waitForNavigationToComplete method and PageLoadStrategy new type.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::waitForNavigationToComplete): Call waitForNavigationToCompleteOnPage or
waitForNavigationToCompleteOnFrame depending on whether the current borwsing context is the main frame or not.
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Check if there's an ongoing load for the page,
and wait for it to complete if needed.
(WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Check if there's an ongoing load for the frame,
and wait for it to complete if needed.
(WebKit::WebAutomationSession::navigateBrowsingContext): Use waitForNavigationToCompleteOnPage() now.
(WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
(WebKit::WebAutomationSession::navigationOccurredForFrame): Renamed since it now receives the notification for
all the frames. Complete page operations if it's a main frame, or frame operations otherwise.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishLoadForFrame): Notify about all frames, not only the main one.
(WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219722
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Fri, 21 Jul 2017 09:43:13 +0000 (09:43 +0000)]
WebDriver: correctly handle main frame handles
https://bugs.webkit.org/show_bug.cgi?id=174668
Reviewed by Brian Burg.
When I switched to use std::optional instead of empty strings for the browsing contexts in WebDriver, I forgot
that automation uses empty string for frames to refer to the main frame. We should handle that case, because we
are currently considering empty strings as valid browsing context. It's not a big deal because Automation
converts back the empty string received to the main frame, though. We should also ensure we close the current
browsing context when switching to a new top level browsing context. This patch adds to helper private methods
to switch browsing contexts that deal with the special cases.
* Session.cpp:
(WebDriver::Session::close):
(WebDriver::Session::switchToTopLevelBrowsingContext):
(WebDriver::Session::switchToBrowsingContext):
(WebDriver::Session::createTopLevelBrowsingContext):
(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::switchToWindow):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
* Session.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219721
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
csaavedra@igalia.com [Fri, 21 Jul 2017 08:22:20 +0000 (08:22 +0000)]
[GTK] Update test expectations after r219663
Unreviewed gardening
DOMException got its toString() removed so the output changes.
* platform/gtk/crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/aes-export-key-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/aes-generate-key-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/aes-import-key-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/rsa-generate-key-malformed-parameters-expected.txt:
* platform/gtk/crypto/subtle/rsa-import-key-malformed-parameters-expected.txt:
* platform/gtk/fast/mediastream/RTCPeerConnection-closed-state-expected.txt:
* platform/gtk/fast/text/font-selection-font-loading-api-parse-expected.txt:
* platform/gtk/http/tests/dom/document-attributes-null-handling-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219720
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
csaavedra@igalia.com [Fri, 21 Jul 2017 07:40:21 +0000 (07:40 +0000)]
[WPE] Update expectation file
Unreviewed gardening.
Drop XPathException after r219708.
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219719
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
carlosgc@webkit.org [Fri, 21 Jul 2017 06:38:09 +0000 (06:38 +0000)]
Unreviewed. Remove WKIconDatabaseCairo.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp: Removed.
* UIProcess/API/C/cairo/WKIconDatabaseCairo.h: Removed.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219718
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
graouts@webkit.org [Fri, 21 Jul 2017 06:34:29 +0000 (06:34 +0000)]
Turn tests at media/modern-media-controls/seek-forward-support back on
https://bugs.webkit.org/show_bug.cgi?id=174690
Reviewed by Dean Jackson.
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219717
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
graouts@webkit.org [Fri, 21 Jul 2017 06:32:18 +0000 (06:32 +0000)]
Turn tests at media/modern-media-controls/seek-backward-support back on
https://bugs.webkit.org/show_bug.cgi?id=174689
Reviewed by Dean Jackson.
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219716
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
graouts@webkit.org [Fri, 21 Jul 2017 06:29:25 +0000 (06:29 +0000)]
Turn tests at media/modern-media-controls/time-labels-support back on
https://bugs.webkit.org/show_bug.cgi?id=174688
Reviewed by Dean Jackson.
* media/modern-media-controls/time-labels-support/elapsed-time-expected.txt:
* media/modern-media-controls/time-labels-support/elapsed-time.html:
* media/modern-media-controls/time-labels-support/remaining-time-expected.txt:
* media/modern-media-controls/time-labels-support/remaining-time.html:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219715
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
graouts@webkit.org [Fri, 21 Jul 2017 06:28:34 +0000 (06:28 +0000)]
Turn tests at media/modern-media-controls/status-support back on
https://bugs.webkit.org/show_bug.cgi?id=174687
Reviewed by Dean Jackson.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219714
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
beidson@apple.com [Fri, 21 Jul 2017 04:10:54 +0000 (04:10 +0000)]
Get rid of IconDatabase related code in WebKit.
https://bugs.webkit.org/show_bug.cgi?id=174693
Reviewed by Tim Horton.
This leaves the C-API class but guts it.
No explanations of the other changes are needed.
* CMakeLists.txt:
* DerivedSources.make:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetIconDatabase):
(WKContextSetIconDatabasePath):
* UIProcess/API/C/WKIconDatabase.cpp:
(WKIconDatabaseSetIconDatabaseClient):
(WKIconDatabaseRetainIconForURL):
(WKIconDatabaseReleaseIconForURL):
(WKIconDatabaseSetIconDataForIconURL):
(WKIconDatabaseSetIconURLForPageURL):
(WKIconDatabaseCopyIconURLForPageURL):
(WKIconDatabaseCopyIconDataForPageURL):
(WKIconDatabaseEnableDatabaseCleanup):
(WKIconDatabaseRemoveAllIcons):
(WKIconDatabaseCheckIntegrityBeforeOpening):
(WKIconDatabaseClose):
* UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
(WKIconDatabaseTryGetCGImageForURL):
(WKIconDatabaseTryCopyCGImageArrayForURL):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
* UIProcess/WebIconDatabase.cpp: Removed.
* UIProcess/WebIconDatabase.h:
(WebKit::WebIconDatabase::clearProcessPool): Deleted.
* UIProcess/WebIconDatabase.messages.in: Removed.
* UIProcess/WebIconDatabaseClient.cpp: Removed.
* UIProcess/WebIconDatabaseClient.h: Removed.
* UIProcess/WebProcessPool.cpp:
(WebKit::m_hiddenPageThrottlingTimer):
(WebKit::WebProcessPool::~WebProcessPool):
(WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::setIconDatabasePath): Deleted.
(WebKit::WebProcessPool::iconDatabasePath): Deleted.
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::retainIconForPageURL): Deleted.
(WebKit::WebProcessProxy::releaseIconForPageURL): Deleted.
(WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* UIProcess/gtk/WebProcessPoolGtk.cpp:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
* UIProcess/wpe/WebProcessPoolWPE.cpp:
(WebKit::WebProcessPool::platformDefaultIconDatabasePath): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/IconDatabase/WebIconDatabaseProxy.cpp: Removed.
* WebProcess/IconDatabase/WebIconDatabaseProxy.h: Removed.
* WebProcess/IconDatabase/WebIconDatabaseProxy.messages.in: Removed.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::getWebCoreStatistics):
* WebProcess/WebProcess.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219713
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 02:36:52 +0000 (02:36 +0000)]
Drop legacy SVGException type
https://bugs.webkit.org/show_bug.cgi?id=174695
Reviewed by Darin Adler.
Source/WebCore:
Drop legacy SVGException type and use DOMException instead, as per the latest
SVG specification. Both Chrome and Firefox no longer expose the SVGException
type.
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase):
* dom/DOMExceptions.in:
* svg/SVGAllInOne.cpp:
* svg/SVGCircleElement.cpp:
* svg/SVGException.cpp: Removed.
* svg/SVGException.h: Removed.
* svg/SVGException.idl: Removed.
* svg/SVGGraphicsElement.idl:
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGMatrixValue.h:
* svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::getItem):
(WebCore::SVGPathSegList::replaceItem):
(WebCore::SVGPathSegList::removeItem):
* svg/SVGPathSegList.h:
* svg/SVGPathSegList.idl:
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
LayoutTests:
Update existing tests to reflect behavior change.
* fast/dom/Window/resources/window-properties.js:
* js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:
* svg/animations/animate-marker-orient-from-angle-to-autostartreverse-expected.txt:
* svg/custom/SVGException-expected.txt: Removed.
* svg/custom/SVGException.html: Removed.
* svg/custom/global-constructors-expected.txt:
* svg/custom/global-constructors.html:
* svg/custom/js-svg-constructors-expected.txt:
* svg/custom/js-svg-constructors.svg:
* svg/dom/SVGAnimatedEnumeration-SVGClipPathElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGComponentTransferFunctionElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFEColorMatrixElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFEConvolveMatrixElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFEDisplacementMapElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFEMorphologyElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFETurbulenceElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGFilterElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGGradientElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGMaskElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGPatternElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGTextContentElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-SVGTextPathElement-expected.txt:
* svg/dom/SVGAnimatedEnumeration-expected.txt:
* svg/dom/SVGException-obsolete-expected.txt: Added.
* svg/dom/SVGException-obsolete.html: Added.
* svg/dom/SVGMatrix-interface-expected.txt:
* svg/dom/svglist-exception-on-out-bounds-error-expected.txt:
* svg/filters/feBlend-invalid-mode-expected.txt:
* svg/filters/feComponentTransfer-style-crash-expected.txt:
* svg/filters/feDisplacementMap-crash-test-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219712
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Fri, 21 Jul 2017 01:38:58 +0000 (01:38 +0000)]
Hook up ITP quirks to the needsSiteSpecificQuirks setting
https://bugs.webkit.org/show_bug.cgi?id=174691
Reviewed by Darin Adler.
Hook up ITP quirks to the needsSiteSpecificQuirks setting to make it easier for
Web-developers to test their fixes.
* loader/ResourceLoadObserver.cpp:
(WebCore::shouldEnableSiteSpecificQuirks):
(WebCore::areDomainsAssociated):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::resourceNeedsSSOQuirk):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219711
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jlewis3@apple.com [Fri, 21 Jul 2017 01:23:19 +0000 (01:23 +0000)]
Unreviewed, rolling out r219700.
This revision caused consistent timouts on iOS.
Reverted changeset:
"Turn tests at media/modern-media-controls/start-support back
on"
https://bugs.webkit.org/show_bug.cgi?id=174683
http://trac.webkit.org/changeset/219700
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219710
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
commit-queue@webkit.org [Fri, 21 Jul 2017 00:39:09 +0000 (00:39 +0000)]
Add SPI to notify WKNavigationDelegate about client redirects
https://bugs.webkit.org/show_bug.cgi?id=174680
rdar://problem/
33184886
Patch by David Quesada <david_quesada@apple.com> on 2017-07-20
Reviewed by Brady Eidson.
Source/WebCore:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::performClientRedirect):
* loader/FrameLoader.h:
Add a convenience method for NavigationScheduler that handles a FrameLoadRequest
as a client redirect. Currently this means loading the request and informing the
client about it.
* loader/FrameLoaderClient.h:
Add FrameLoaderClient::dispatchDidPerformClientRedirect() to inform the client when
a client redirect occurs.
* loader/NavigationScheduler.cpp:
Removed ScheduledURLNavigation::fire(). This class was never instantiated directly,
and all subclasses override fire(), so this was unused code.
For ScheduledRedirects and ScheduledLocationChange, use FrameLoader's new method to
load the request as a client redirect.
Source/WebKit:
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didPerformClientRedirectForNavigation):
Add a new virtual method for navigation clients to implement if they want to be informed
when the page is initiating a navigation that is a client redirect.
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
Declare the new WKNavigationDelegate method -_webView:didPerformClientRedirectForNavigation:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didPerformClientRedirectForNavigation):
Add a new method to NavigationState method to tell the WKNavigationDelegate when a
client redirect happens.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformClientRedirectForLoadForFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Allow the WebPageProxy to receive a message from the web process when a client redirect happens.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidPerformClientRedirect):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
Send this new message to the UI process on client redirects.
Tools:
* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
(-[DidPerformClientRedirectNavigationDelegate _webView:didPerformClientRedirectForNavigation:]):
(TEST):
Add API test for -[id<WKNavigationDelegatePrivate> _webView:didPerformClientRedirectForNavigation:].
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219709
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 20 Jul 2017 23:02:15 +0000 (23:02 +0000)]
Drop legacy XPathException type
https://bugs.webkit.org/show_bug.cgi?id=174679
Reviewed by Sam Weinig.
Source/WebCore:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
Test: fast/dom/DOMException/XPathException-obsolete.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase):
* dom/DOMExceptions.in:
* xml/XPathException.cpp: Removed.
* xml/XPathException.h: Removed.
* xml/XPathException.idl: Removed.
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::evaluate):
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::parseStatement):
* xml/XPathResult.cpp:
(WebCore::XPathResult::convertTo):
(WebCore::XPathResult::numberValue):
(WebCore::XPathResult::stringValue):
(WebCore::XPathResult::booleanValue):
(WebCore::XPathResult::singleNodeValue):
(WebCore::XPathResult::snapshotLength):
(WebCore::XPathResult::iterateNext):
(WebCore::XPathResult::snapshotItem):
Source/WebKit:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
* UIProcess/Automation/atoms/FindNodes.js:
(tryToFindNode):
Source/WebKitLegacy/mac:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
* DOM/ExceptionHandlers.mm:
(raiseDOMErrorException):
LayoutTests:
Update existing tests to reflect behavior change.
* dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.js:
(XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR):
* dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.js:
(XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR):
* dom/svg/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.js:
(XPathEvaluator_evaluate_TYPE_ERR):
* dom/svg/level3/xpath/XPathResult_TYPE_ERR.js:
(XPathResult_TYPE_ERR):
* fast/dom/DOMException/XPathException-expected.txt: Removed.
* fast/dom/DOMException/XPathException.html: Removed.
* fast/dom/DOMException/resources/XPathException.js: Removed.
* fast/dom/Window/resources/window-properties.js:
* fast/dom/Window/window-lookup-precedence-expected.txt:
* fast/xpath/4XPath/Core/test_parser-expected.txt:
* fast/xpath/invalid-functions-expected.txt:
* fast/xpath/py-dom-xpath/expressions-expected.txt:
* platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219708
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 20 Jul 2017 22:45:23 +0000 (22:45 +0000)]
Unreviewed, rolling out r219706.
Broke iOS build
Reverted changeset:
"Drop legacy XPathException type"
https://bugs.webkit.org/show_bug.cgi?id=174679
http://trac.webkit.org/changeset/219706
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219707
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 20 Jul 2017 22:03:45 +0000 (22:03 +0000)]
Drop legacy XPathException type
https://bugs.webkit.org/show_bug.cgi?id=174679
Reviewed by Sam Weinig.
Source/WebCore:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
Test: fast/dom/DOMException/XPathException-obsolete.html
* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase):
* dom/DOMExceptions.in:
* xml/XPathException.cpp: Removed.
* xml/XPathException.h: Removed.
* xml/XPathException.idl: Removed.
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::evaluate):
* xml/XPathParser.cpp:
(WebCore::XPath::Parser::parseStatement):
* xml/XPathResult.cpp:
(WebCore::XPathResult::convertTo):
(WebCore::XPathResult::numberValue):
(WebCore::XPathResult::stringValue):
(WebCore::XPathResult::booleanValue):
(WebCore::XPathResult::singleNodeValue):
(WebCore::XPathResult::snapshotLength):
(WebCore::XPathResult::iterateNext):
(WebCore::XPathResult::snapshotItem):
Source/WebKit:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
* UIProcess/Automation/atoms/FindNodes.js:
(tryToFindNode):
Source/WebKitLegacy/mac:
Drop legacy XPathException type and use DOMException instead. Both Firefox and Chrome
no longer expose XPathException.
* DOM/ExceptionHandlers.mm:
(raiseDOMErrorException):
* WebKit.exp:
LayoutTests:
Update existing tests to reflect behavior change.
* dom/svg/level3/xpath/XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR.js:
(XPathEvaluator_createExpression_INVALID_EXPRESSION_ERR):
* dom/svg/level3/xpath/XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR.js:
(XPathEvaluator_evaluate_INVALID_EXPRESSION_ERR):
* dom/svg/level3/xpath/XPathEvaluator_evaluate_TYPE_ERR.js:
(XPathEvaluator_evaluate_TYPE_ERR):
* dom/svg/level3/xpath/XPathResult_TYPE_ERR.js:
(XPathResult_TYPE_ERR):
* fast/dom/DOMException/XPathException-expected.txt: Removed.
* fast/dom/DOMException/XPathException.html: Removed.
* fast/dom/DOMException/resources/XPathException.js: Removed.
* fast/dom/Window/resources/window-properties.js:
* fast/dom/Window/window-lookup-precedence-expected.txt:
* fast/xpath/4XPath/Core/test_parser-expected.txt:
* fast/xpath/invalid-functions-expected.txt:
* fast/xpath/py-dom-xpath/expressions-expected.txt:
* platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219706
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
cdumez@apple.com [Thu, 20 Jul 2017 21:09:26 +0000 (21:09 +0000)]
Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords()
https://bugs.webkit.org/show_bug.cgi?id=174686
Reviewed by Geoffrey Garen.
Avoid unnecessary WorkQueue dispatch in WebResourceLoadStatisticsStore::processStatisticsAndDataRecords(). The most common
call site is already on the right thread.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsProcessStatisticsAndDataRecords]):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleStatisticsAndDataRecordsProcessing):
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
* UIProcess/WebResourceLoadStatisticsStore.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219705
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
jlewis3@apple.com [Thu, 20 Jul 2017 21:09:12 +0000 (21:09 +0000)]
Rebaselined svg/css/getComputedStyle-basic.xhtml.
Unreviewed test gardening.
* platform/mac-highsierra/svg/css/getComputedStyle-basic-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219704
268f45cc-cd09-0410-ab3c-
d52691b4dbfc