WebKit-https.git
22 months agoExpand r209943 to suppress paste during provisional navigation as well
timothy_horton@apple.com [Thu, 19 Oct 2017 20:43:41 +0000 (20:43 +0000)]
Expand r209943 to suppress paste during provisional navigation as well
https://bugs.webkit.org/show_bug.cgi?id=178429
<rdar://problem/33952830>

Reviewed by Dean Jackson.

Source/WebCore:

No new tests; adjusted an existing test to cover this case.

* editing/Editor.cpp:
(WebCore::Editor::canPaste const):
Disable pasting during provisional navigation, like r209943 did for
various other forms of text input.

(WebCore::Editor::shouldInsertText const):
* dom/EventDispatcher.cpp:
(WebCore::shouldSuppressEventDispatchInDOM):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldSuppressTextInputFromEditing const):
(WebCore::FrameLoader::shouldSuppressKeyboardInput const): Deleted.
* loader/FrameLoader.h:
* page/Settings.in:
Rename the setting to be about editing-related text input, not "keyboard" input.

* editing/EditorCommand.cpp:
(WebCore::allowExecutionWhenDisabled):
(WebCore::doNotAllowExecutionWhenDisabled):
(WebCore::allowExecutionWhenDisabledCopyCut):
(WebCore::allowExecutionWhenDisabledPaste):
(WebCore::createCommandMap):
(WebCore::Editor::Command::allowExecutionWhenDisabled const):
Completely disable execution of paste events when in no-text-input-from-editing mode.
Otherwise, even though canPaste was false and we wouldn't do a default paste action,
we would still dispatch the paste event to the DOM.

Source/WebKit:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation):
(WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]):
(-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Adjust to the changed preference name, except at the SPI level.

LayoutTests:

* http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt:
* http/tests/navigation/keyboard-events-during-provisional-navigation.html:
* http/tests/navigation/keyboard-events-during-provisional-subframe-navigation-expected.txt:
* http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html:
* http/tests/navigation/resources/keyboard-events-after-navigation.html:
* http/tests/navigation/resources/keyboard-events-test.js:
(runBeforeTest):
(runTest):
Copy a "d" to the clipboard before running the test, and paste it while running.
I put the copy before running the test so that if someone comes along and
blacklists copy during provisional load as well, the test for this behavior
still actually tests the paste portion.
Also ensure that paste events are not triggered during provisional navigation.

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

22 months agoAvoid duplicate multisample resolve before WebGL compositing
dino@apple.com [Thu, 19 Oct 2017 20:32:10 +0000 (20:32 +0000)]
Avoid duplicate multisample resolve before WebGL compositing
https://bugs.webkit.org/show_bug.cgi?id=178537
<rdar://problem/35080724>

Reviewed by Jer Noble.

Both endPaint and prepareTexture were doing the MSAA resolve
into the renderbuffer, and being called on macOS before compositing.
Without that step, endPaint became unnecessary on iOS so I renamed
it presentRenderbuffer.

Covered by existing tests.

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::presentRenderbuffer):
(WebCore::GraphicsContext3D::endPaint): Deleted.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer display]):

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

22 months agoReferrer policy should be inherited from creator
dbates@webkit.org [Thu, 19 Oct 2017 20:17:42 +0000 (20:17 +0000)]
Referrer policy should be inherited from creator
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Add missing file that I inadvertently forgot to commit in r223697. The tests depend on this file.

* http/tests/security/resources/nested-referrer-policy-postmessage.html: Added.

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

22 months agoTurn poly proto back on by default and remove the option
sbarati@apple.com [Thu, 19 Oct 2017 20:16:19 +0000 (20:16 +0000)]
Turn poly proto back on by default and remove the option
https://bugs.webkit.org/show_bug.cgi?id=178525

Reviewed by Mark Lam.

Source/JavaScriptCore:

I added this option because I thought it'd speed speedometer up because the
original poly proto patch slowed speedometer down. It turns out that
allocating poly proto objects is not what slows speedometer down. It's
other code I added in the runtime that needs to be poly proto aware. I'll
be addressing these in follow up patches.

* runtime/Options.h:
* runtime/StructureInlines.h:
(JSC::Structure::shouldConvertToPolyProto):

Tools:

* Scripts/run-jsc-stress-tests:

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

22 months agoAdd API to clean CacheStorage data
commit-queue@webkit.org [Thu, 19 Oct 2017 20:15:42 +0000 (20:15 +0000)]
Add API to clean CacheStorage data
https://bugs.webkit.org/show_bug.cgi?id=178034

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-19

* UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Using WK_IOS_TBA instead of WK_MAC_TBA for iOS.

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

22 months ago[Payment Request] Only process shipping options if shipping is requested, and throw...
aestes@apple.com [Thu, 19 Oct 2017 20:02:29 +0000 (20:02 +0000)]
[Payment Request] Only process shipping options if shipping is requested, and throw an exception on duplicate shipping option IDs
https://bugs.webkit.org/show_bug.cgi?id=178535

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/payment-request-constructor.https-expected.txt:

Source/WebCore:

Progresses four tests in web-platform-tests/payment-request/payment-request-constructor.https.html.

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::create):

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

22 months agoMarked http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html...
jlewis3@apple.com [Thu, 19 Oct 2017 19:57:00 +0000 (19:57 +0000)]
Marked http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=178472

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

22 months agoShare logic in InlineTextBox to compute selection rect
dbates@webkit.org [Thu, 19 Oct 2017 18:55:16 +0000 (18:55 +0000)]
Share logic in InlineTextBox to compute selection rect
https://bugs.webkit.org/show_bug.cgi?id=178232
<rdar://problem/34963452>

Reviewed by Zalan Bujtas.

Currently each paint routine in InlineTextBox duplicates similar code to compute the selection
rect it will paint. This change consolidates all the duplication into localSelectionRectWithClampedPositions()
and writes all of the paint operations, except for paintCompositionUnderline(), in terms of it.
We will write paintCompositionUnderline() in terms of localSelectionRectWithClampedPositions()
in a subsequent patch.

We also write localSelectionRect() in terms of localSelectionRectWithClampedPositions(). Ideally
we would have one way to compute the selection rect. However, localSelectionRect() and paintDocumentMarker()
currently expect the enclosing integral rectangle of the selection rectangle. The function
paintDocumentMarker() needs the enclosing integral rectangle to avoid truncating the dot pattern
drawn under marked words (e.g. a spelling error) on Cocoa platforms. With regards to localSelectionRect()
we should look to have it return the actual selection rectangle. See <https://bugs.webkit.org/show_bug.cgi?id=138913>
for more details.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::localSelectionRect const): Move logic in common with paintSelection() into
localSelectionRectWithClampedPositions() and modified code to use it.
(WebCore::InlineTextBox::localSelectionRectWithClampedPositions const): Added.
(WebCore::InlineTextBox::paint): Store the local paint offset as a LayoutPoint as it is the canonical
data type for representing an offset when painting. Pass the local paint offset instead of the analagous boxOrigin value.
(WebCore::InlineTextBox::paintSelection): Write in terms of localSelectionRectWithClampedPositions().
(WebCore::InlineTextBox::paintTextSubrangeBackground): Ditto.
(WebCore::InlineTextBox::paintCompositionBackground): Ditto.
(WebCore::InlineTextBox::paintTextMatchMarker): Ditto.
(WebCore::InlineTextBox::paintDocumentMarker): Ditto.
(WebCore::InlineTextBox::paintDocumentMarkers): Pass paint offset instead of the analogous boxOrigin value.
* rendering/InlineTextBox.h:

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

22 months agoWeb Inspector: Remove superfluous file External/.eslintrc
commit-queue@webkit.org [Thu, 19 Oct 2017 18:54:47 +0000 (18:54 +0000)]
Web Inspector: Remove superfluous file External/.eslintrc
https://bugs.webkit.org/show_bug.cgi?id=178474

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-19
Reviewed by Joseph Pecoraro.

* UserInterface/External/.eslintrc: Removed.

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

22 months agoReferrer policy should be inherited from creator
dbates@webkit.org [Thu, 19 Oct 2017 18:46:22 +0000 (18:46 +0000)]
Referrer policy should be inherited from creator
https://bugs.webkit.org/show_bug.cgi?id=178403
<rdar://problem/31546136>

Reviewed by Andy Estes.

Source/WebCore:

As per section Browsing contexts of the the HTML standard, <https://html.spec.whatwg.org/multipage/browsers.html>
(17 October 2017), the referrer policy of a document should initially be inherited from its
creator.

Tests: http/tests/security/referrer-policy-nested-subframe.html
       http/tests/security/referrer-policy-nested-window-open.html
       http/tests/security/referrer-policy-subframe-window-open.html
       http/tests/security/referrer-policy-window-open-subframe.html

* dom/Document.cpp:
(WebCore::Document::initSecurityContext): Ask the loader for the effective referrer policy.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::effectiveReferrerPolicy const): Added. Returns the referrer policy
of the creator document. The creator document is document of the parent frame or the document
of the opener for a subframe or child window, respectively. If we do not have a creator frame
then we return the default referrer policy, non-referrer-when-downgrade, by <https://www.w3.org/TR/2017/CR-referrer-policy-20170126/#referrer-policy-empty-string>.
* loader/FrameLoader.h:

LayoutTests:

Add tests to ensure that the referrer policy of a document is initially inherited from its creator.

* http/tests/security/referrer-policy-nested-subframe-expected.txt: Added.
* http/tests/security/referrer-policy-nested-subframe.html: Added.
* http/tests/security/referrer-policy-nested-window-open-expected.txt: Added.
* http/tests/security/referrer-policy-nested-window-open.html: Added.
* http/tests/security/referrer-policy-subframe-window-open-expected.txt: Added.
* http/tests/security/referrer-policy-subframe-window-open.html: Added.
* http/tests/security/referrer-policy-window-open-subframe-expected.txt: Added.
* http/tests/security/referrer-policy-window-open-subframe.html: Added.
* http/tests/security/resources/referrer-policy-postmessage.php:

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

22 months ago[FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
zalan@apple.com [Thu, 19 Oct 2017 18:39:39 +0000 (18:39 +0000)]
[FrameView::layout cleanup] Do not reenter FrameView::performPostLayoutTasks
https://bugs.webkit.org/show_bug.cgi?id=178518
<rdar://problem/35075409>

Reviewed by Antti Koivisto.

This patch tightens existing reentrancy policy on performPostLayoutTasks.

Covered by existing test cases.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::reset):
(WebCore::FrameView::layout):
(WebCore::FrameView::performPostLayoutTasks):
* page/FrameView.h:

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

22 months agoUnreviewed build fix after r223692.
cdumez@apple.com [Thu, 19 Oct 2017 18:37:23 +0000 (18:37 +0000)]
Unreviewed build fix after r223692.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:

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

22 months ago[GTK] Inspector UI does not use system font despite -webkit-system-font being supported
aperez@igalia.com [Thu, 19 Oct 2017 18:33:10 +0000 (18:33 +0000)]
[GTK] Inspector UI does not use system font despite -webkit-system-font being supported
https://bugs.webkit.org/show_bug.cgi?id=178388

Reviewed by Joseph Pecoraro.

Change ocurrences of the "-apple-system" generic font name to
"-webkit-system-font", which is also implemented by the GTK+ port.

* UserInterface/Views/CodeMirrorOverrides.css:
(.CodeMirror .CodeMirror-linenumber):
(.CodeMirror .CodeMirror-placeholder):
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-text):
(.console-message .console-message-extra-parameters-container > li::before):
(.console-message .console-message-location):
* UserInterface/Views/DataGrid.css:
(.data-grid td):
* UserInterface/Views/DefaultDashboardView.css:
(.toolbar .dashboard.default > .item):
* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot-instance-popover-content > .title):
* UserInterface/Views/HierarchicalPathComponent.css:
(.hierarchical-path-component):
* UserInterface/Views/LogContentView.css:
(.console-messages):
* UserInterface/Views/Main.css:
(body):
* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-name):
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .property-name,):
* UserInterface/Views/ObjectTreeView.css:
(.tree-outline.object li .empty-message):
* UserInterface/Views/RecordingActionTreeElement.css:
(.item.action:not(.initial-state)::before):
* UserInterface/Views/SourceCodeTextEditor.css:
(.source-code.text-editor > .CodeMirror .line-indicator-widget > .text):
(.popover .debugger-popover-content > .title):
* UserInterface/Views/TypeTreeView.css:
(.type-tree):
* UserInterface/Views/VisualStyleFontFamilyTreeElement.js:

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

22 months agoREGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
keith_miller@apple.com [Thu, 19 Oct 2017 18:18:32 +0000 (18:18 +0000)]
REGRESSION (r223476): WebCore exports symbols with names belonging to other frameworks
https://bugs.webkit.org/show_bug.cgi?id=178424

Reviewed by David Kilzer.

This patch moves the wrapper function sharing the name of the externed function
to the source file and marks it as always inline. Marking it as inline prevents
the framework from exporting it.

* wtf/cocoa/SoftLinking.h:

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

22 months agoUnreviewed, revert r223650 as it caused crashes on the bots.
cdumez@apple.com [Thu, 19 Oct 2017 17:58:21 +0000 (17:58 +0000)]
Unreviewed, revert r223650 as it caused crashes on the bots.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* dom/ScriptExecutionContext.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/FetchOptions.h:
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/WorkerThreadableLoader.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/context/SWContextManager.cpp: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
(WebCore::SWContextManager::singleton):
(WebCore::SWContextManager::SWContextManager):
(WebCore::SWContextManager::startServiceWorkerContext):
* workers/service/context/SWContextManager.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
* workers/service/context/ServiceWorkerThread.h:

Source/WebKit:

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::remove):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp: Removed.
* WebProcess/Storage/ServiceWorkerClientFetch.h: Removed.
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Removed.
* WebProcess/Storage/ServiceWorkerContextManager.cpp: Removed.
* WebProcess/Storage/WebSWClientConnection.cpp:
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt: Removed.
* http/tests/workers/service/basic-fetch.https.html: Removed.
* http/tests/workers/service/resources/basic-fetch-worker.js: Removed.
* http/tests/workers/service/resources/basic-fetch.js: Removed.

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

22 months agoTurn recursive tail calls into loops
rmorisset@apple.com [Thu, 19 Oct 2017 16:27:44 +0000 (16:27 +0000)]
Turn recursive tail calls into loops
https://bugs.webkit.org/show_bug.cgi?id=176601

Reviewed by Saam Barati.

JSTests:

Add some simple test that computes factorial in several ways, and other trivial computations.
They all tests the case where foo calls bar (in an inlineable way) that then does a tail call.
Depending on the nature of both calls, it is possible or not to turn the tail call into a loop.
I have no clear way of checking that the call was indeed transformed, but I can check that the code computes the right result
(which it doesn't if that tail call is transformed into a loop in the unsound cases).

* stress/inline-call-to-recursive-tail-call.js: Added.
(factorial.aux):
(factorial):
(factorial2.aux):
(factorial2.id):
(factorial2):
(factorial3.aux):
(factorial3):
(aux):
(factorial4):
(test):

Source/JavaScriptCore:

We want to turn recursive tail calls into loops early in the pipeline, so that the loops can then be optimized.
One difficulty is that we need to split the entry block of the function we are jumping to in order to have somewhere to jump to.
Worse: it is not necessarily the first block of the codeBlock, because of inlining! So we must do the splitting in the DFGByteCodeParser, at the same time as inlining.
We do this part through modifying the computation of the jump targets.
Importantly, we only do this splitting for functions that have tail calls.
It is the only case where the optimisation is sound, and doing the splitting unconditionnaly destroys performance on Octane/raytrace.

We must then do the actual transformation also in DFGByteCodeParser, to avoid code motion moving code out of the body of what will become a loop.
The transformation is entirely contained in handleRecursiveTailCall, which is hooked to the inlining machinery.

* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasTailCalls const):
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
(JSC::computePreciseJumpTargetsInternal):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::hasTailCalls const):
(JSC::UnlinkedCodeBlock::setHasTailCalls):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnter):
(JSC::BytecodeGenerator::emitCallInTailPosition):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::allocateTargetableBlock):
(JSC::DFG::ByteCodeParser::makeBlockTargetable):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleRecursiveTailCall):
(JSC::DFG::ByteCodeParser::parseBlock):
(JSC::DFG::ByteCodeParser::parse):

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

22 months agohttp/tests/workers/service/basic-register.html is a flaky failure.
cdumez@apple.com [Thu, 19 Oct 2017 16:10:47 +0000 (16:10 +0000)]
http/tests/workers/service/basic-register.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=178494
<rdar://problem/35065315>

Reviewed by Youenn Fablet.

In WebSWServerConnection::resolveJobInClient(), when a service worker is
registered, we:
1. Add the origin to the WebSWOriginStore
2. Send the IPC to the WebProcess to notify it that the registration succeeded.

The assumption was that step 1 would be synchronous and would therefore send
the shared memory handle to the WebProcess (if the SharedMemory was invalidated)
*before* step 2.

The issue is that step 1 was scheduling a zero-timer to schedule the addition.
As a result, there was a race and the WebContent process could check the
the WebSWOriginTable *after* being notified that a service worker was registered
but *before* it received the SharedMemory handle for the WebSWOriginTable. This
could lead to false negatives and was causing the layout test to be flaky.

To address the issue, step 1 is now synchronous.

* Shared/SharedStringHashStore.cpp:
(WebKit::SharedStringHashStore::SharedStringHashStore):
(WebKit::SharedStringHashStore::scheduleAddition):
(WebKit::SharedStringHashStore::scheduleRemoval):
(WebKit::SharedStringHashStore::contains):
(WebKit::SharedStringHashStore::flushPendingChanges):
(WebKit::SharedStringHashStore::processPendingOperations):
* Shared/SharedStringHashStore.h:
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp:
(WebKit::WebSWOriginStore::add):
(WebKit::WebSWOriginStore::addAll):
(WebKit::WebSWOriginStore::remove):
* StorageProcess/ServiceWorker/WebSWOriginStore.h:
* UIProcess/VisitedLinkStore.cpp:
(WebKit::VisitedLinkStore::addVisitedLinkHash):
(WebKit::VisitedLinkStore::removeVisitedLinkHash):

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

22 months ago[FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
zalan@apple.com [Thu, 19 Oct 2017 15:52:37 +0000 (15:52 +0000)]
[FrameView::layout cleanup] Replace m_nestedLayoutCount with isLayoutNested()
https://bugs.webkit.org/show_bug.cgi?id=178503
<rdar://problem/35066561>

Reviewed by Antti Koivisto.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::layout):
(WebCore::FrameView::updateLayerPositionsAfterScrolling):
(WebCore::FrameView::updateCompositingLayersAfterScrolling):
(WebCore::FrameView::updateEmbeddedObjects):
(WebCore::FrameView::flushPostLayoutTasksQueue):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
* page/FrameView.h:

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

22 months agoOverlapping text on all CSS fonts specs
antti@apple.com [Thu, 19 Oct 2017 13:11:05 +0000 (13:11 +0000)]
Overlapping text on all CSS fonts specs
https://bugs.webkit.org/show_bug.cgi?id=177585
<rdar://problem/34704078>

Reviewed by Daniel Bates.

Source/WebCore:

We were resetting StyleResolver::overrideDocumentElementStyle too early when resolving slot elements.
This resulted in 'rem' units being miscomputed.

Reduction by Zalan.

Test: fast/html/details-line-height-overlap.html

* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::Scope::~Scope):

    Only reset overrideDocumentElementStyle when destroying the scope.

(WebCore::Style::TreeResolver::pushScope):
(WebCore::Style::TreeResolver::pushEnclosingScope):
(WebCore::Style::TreeResolver::popScope):

    A scope can show up multiple times in scope stack.

* style/StyleTreeResolver.h:

LayoutTests:

* fast/html/details-line-height-overlap-expected.html: Added.
* fast/html/details-line-height-overlap.html: Added.
* platform/ios/fast/shadow-dom/copy-shadow-tree-expected.txt:

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

22 months agoConsolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
rniwa@webkit.org [Thu, 19 Oct 2017 10:34:31 +0000 (10:34 +0000)]
Consolidate calls to insertedInto and expand the coverage of NoEventDispatchAssertion
https://bugs.webkit.org/show_bug.cgi?id=178504

Reviewed by Antti Koivisto.

Consolidated calls to notifyChildNodeInserted, childrenChanged, didFinishInsertingNode, and
dispatchChildInsertionEvents for inserting a node by executeNodeInsertionWithScriptAssertion,
a new templatefunction which takes a closure to do the node insertion to make exactly when
the script becomes runnable clear.

Added an exception to SVGTRefElement::updateReferencedText since this code mutates user agent
shadow root during insertedInto, and turned ChildChangeSource into an enum class.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
(WebCore::CharacterData::setDataAndUpdate):
* dom/ContainerNode.cpp:
(WebCore::executeNodeInsertionWithScriptAssertion): Extracted.
(WebCore::ContainerNode::takeAllChildrenFrom): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::insertBefore): Ditto.
(WebCore::ContainerNode::changeForChildInsertion): Deleted.
(WebCore::ContainerNode::notifyChildInserted): Deleted.
(WebCore::ContainerNode::parserInsertBefore): Deployed executeNodeInsertionWithScriptAssertion.
(WebCore::ContainerNode::replaceChild): Ditto.
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::parserRemoveChild):
(WebCore::ContainerNode::replaceAllChildren): Ditto.
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Ditto.
(WebCore::ContainerNode::parserAppendChild): Ditto.
(WebCore::ContainerNode::childrenChanged):
(WebCore::ContainerNode::updateTreeAfterInsertion): Deleted.
* dom/ContainerNode.h:
* dom/Element.cpp:
(WebCore::Element::childrenChanged):
* html/HTMLOutputElement.cpp:
(WebCore::HTMLOutputElement::childrenChanged):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::childrenChanged):
* svg/SVGElement.cpp:
(WebCore::SVGElement::childrenChanged):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::childrenChanged):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::childrenChanged):
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::childrenChanged):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::childrenChanged):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::childrenChanged):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::childrenChanged):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::childrenChanged):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText): Allow DOM mutations inside the user agent shadow tree here.

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

22 months agoImport W3C Web Platform Tests for createImageBitmap
dino@apple.com [Thu, 19 Oct 2017 10:07:26 +0000 (10:07 +0000)]
Import W3C Web Platform Tests for createImageBitmap
https://bugs.webkit.org/show_bug.cgi?id=178509
<rdar://problem/35070583>

Reviewed by Antoine Quint.

* resources/import-expectations.json:
* web-platform-tests/2dcontext/imagebitmap/common.js: Added.
(testCanvasDisplayingPattern):
(testDrawImageBitmap):
(initializeImageData):
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-sizeOverflow.html: Added.
* web-platform-tests/2dcontext/imagebitmap/w3c-import.log: Added.

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

22 months agoAdd an argument indicating the type of removal to Node::removedFrom
rniwa@webkit.org [Thu, 19 Oct 2017 10:05:21 +0000 (10:05 +0000)]
Add an argument indicating the type of removal to Node::removedFrom
https://bugs.webkit.org/show_bug.cgi?id=178505

Reviewed by Antti Koivisto.

Like r223628, added RemovalType as the first argument to Node::removedFrom, which contains two booleans indicating
whether the node just become disconnected from a document, and whether node's tree scope had changed or not.

These boolean flags simplifies the logic in removedFrom implementations, and are required to have a better
guarantee about the correctness of node flags during calls to removedFrom. Right now, Node::isConnected() and
Node::isInShadowTree() are both outdated until Node::removedFrom is called.

Also renamed the second argument of removedFrom to parentOfRemovedTree to make the semantics clear.

Note that in some implementations of removedFrom, we check whether isConnected() was true to decide whether
the node had already been disconnected from a document prior to calls to this particular call of removedFrom.
This extra check is no longer necessary since no node will be removed from a document without first being inserted
completely somewhere after r223458.

No new tests since there should be no behavioral changes.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument): Replaced RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
(WebCore::notifyNodeRemovedFromDocument): Replaced the check that the node had not been re-connected by scripts
by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
Also moved the code to call setCSSTarget to Element::removedFrom. This random call to setCSSTarget predates r114351,
as well as r40475. It was originally introduced by r29311 into Node::removedFromDocument() ten years ago.
(WebCore::notifyNodeRemovedFromTree): Moved NoEventDispatchAssertion to notifyChildNodeRemoved.
(WebCore::notifyChildNodeRemoved): Added NoEventDispatchAssertion.
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::removedFrom): Replaced the complicated code to detect when this element is removed from a document
and its tree scope had changed by removalType.disconnectedFromDocument and removalType.treeScopeChanged.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::removedFrom):
* dom/Node.h: Replaced a long block of comments above insertedInto by two lines of concise comments now that
the semantics of insertedInto and didFinishInsertingNode are more clear, and enforced by assertions.
(WebCore::Node::RemovalType::RemovalType): Addedl
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* dom/ProcessingInstruction.h:
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::removedFrom): The extra !isConnected() check is no longer needed. See the description above.
* dom/ShadowRoot.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::removedFrom):
* html/FormAssociatedElement.h:
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::removedFrom):
* html/HTMLBaseElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::removedFrom):
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::removedFrom):
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::removedFrom):
* html/HTMLFormElement.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::removedFrom):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::removedFrom):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::removedFrom):
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::removedFrom):
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFrom):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::removedFrom):
* html/HTMLObjectElement.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::removedFrom): Simplifies the logic to detect when this slot element is being
removed from a shadow tree using removalType.treeScopeChanged.
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto): Added a FIXME for an obvious bug.
(WebCore::HTMLSourceElement::removedFrom): Ditto.
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::removedFrom):
* html/HTMLStyleElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::removedFrom):
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::removedFrom): Ditto.
* html/HTMLTrackElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::removedFrom): Replaced isConnected() check before calling Node::removedFrom by the check of
removalType.disconnectedFromDocument.
* svg/SVGElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::removedFrom):
* svg/SVGFEImageElement.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::removedFrom):
* svg/SVGFontFaceElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::removedFrom):
* svg/SVGMPathElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::removedFrom):
* svg/SVGPathElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::removedFrom):
* svg/SVGSVGElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::removedFrom): The extra !isConnected() check is no longer needed. See above.
* svg/SVGStyleElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::removedFrom):
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::removedFrom):
* svg/SVGTextPathElement.h:
* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::removedFrom):
* svg/SVGTitleElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::removedFrom):
* svg/SVGUseElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::removedFrom):
* svg/animation/SVGSMILElement.h:

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

22 months agoUpdate the signatures of compressedTexSubImage3D.
Ms2ger@igalia.com [Thu, 19 Oct 2017 08:27:10 +0000 (08:27 +0000)]
Update the signatures of compressedTexSubImage3D.
https://bugs.webkit.org/show_bug.cgi?id=178507

Reviewed by Ryosuke Niwa.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

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

22 months ago[curl] Segfault in WebCore::CurlRequest::setupPOST
commit-queue@webkit.org [Thu, 19 Oct 2017 07:41:41 +0000 (07:41 +0000)]
[curl] Segfault in WebCore::CurlRequest::setupPOST
https://bugs.webkit.org/show_bug.cgi?id=178434

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-19
Reviewed by Ryosuke Niwa.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::resolveBlobReferences):
(WebCore::CurlRequest::setupPOST):

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

22 months agoDon't expose raw HTML in pasteboard to the web content
rniwa@webkit.org [Thu, 19 Oct 2017 05:44:33 +0000 (05:44 +0000)]
Don't expose raw HTML in pasteboard to the web content
https://bugs.webkit.org/show_bug.cgi?id=178422
Source/WebCore:

<rdar://problem/34567052>

Reviewed by Wenson Hsieh.

This patch enables HTML sanitization added in r223440 when WebKit pastes & concludes edit drag as opposed to
just when dataTransfer.get is used. This is important to avoid leaking privacy sensitive information such as
local file paths and pasting potentially harmful content such as scripts in event handler serialized by
WebKit prior to r223462. In addition, we start using blob URLs in the pasted content instead of retaining
the original URL and overriding the document loader like r222839 for RTFD and r222119 for image files.

To do this, a new superclass FrameWebContentReader of PasteboardWebContentReader and WebContentMarkupReader
is introduced, and helper functions are extracted out of WebContentMarkupReader in WebContentReaderCocoa.mm
to be also used in WebContentReader.

Tests: http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html
       http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html
       http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html
       PasteWebArchive.SanitizesHTML

* editing/WebContentReader.cpp:
(WebCore::FrameWebContentReader::shouldSanitize const): Moved from WebContentMarkupReader.
* editing/WebContentReader.h:
(WebCore::FrameWebContentReader): Added to share code between WebContentReader and WebContentMarkupReader.
(WebCore::FrameWebContentReader::FrameWebContentReader): Added.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard): Store the content's origin in the pasteboard so that we can
avoid sanitizing the content when pasting into the same document. This is important since converting all URLs
into blob URLs would break editors on the Web which tracks images, etc... in the content using URLs.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::MarkupAndArchive): Replaced FragmentAndArchive. Now returns the markup string in the archive
instead of the parsed fragment.
(WebCore::extractMarkupAndArchive): Renamed from createFragmentFromWebArchive. Now returns the markup string.
(WebCore::sanitizeMarkupWithArchive): Extracted out of WebContentMarkupReader::readWebArchive to share code
between WebContentReader and WebContentMarkupReader, and added the code to handle subframes recursively.
As inefficient as this code is, we can't delay the conversion of subframes' marksup until later time since
the main frame's markup would contain blob URLs to refer to those subframes.
(WebCore::WebContentReader::readWebArchive): Use sanitizeMarkupWithArchive when shouldSanitize() is true.
Don't add the subresources to the document loader when the content will be loaded into the same origin since
subresouces are mostly likely available in the document anyway.
(WebCore::WebContentMarkupReader::readWebArchive):
* platform/Pasteboard.h:
(WebCore::PasteboardWebContent): Added contentOrigin.
* platform/PasteboardWriterData.h:
(WebCore::PasteboardWriterData): Ditto.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read): Read the origin before branching out to readRespectingUTIFidelities.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Record the content origin into the pasteboard.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write): Ditto.
* platform/mac/PasteboardWriter.mm:
(WebCore::createPasteboardWriter): Ditto.

Source/WebKit:

Reviewed by Wenson Hsieh.

Encode & decode the origin string of the copied content written into the system pasteboard.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardWebContent>::encode):
(IPC::ArgumentCoder<PasteboardWebContent>::decode):

Tools:

Reviewed by Wenson Hsieh.

Added a test case for sanitizing web archive in the system pasteboard to strip privacy sensitive information
such as local file paths and potentially harmful scripts like event handlers serialized by WebKit prior to r223462.

* TestWebKitAPI/Tests/WebKitCocoa/PasteWebArchive.mm:
(PasteWebArchive.SanitizesHTML):

LayoutTests:

Reviewed by Wenson Hsieh.

Added tests to copy & paste web contents within the same origin as well as cross origin.

* TestExpectations:
* editing/pasteboard/data-transfer-get-data-on-drop-rich-text-expected.txt: Now contains DOCTYPE.
* editing/pasteboard/data-transfer-get-data-on-paste-rich-text-expected.txt: Ditto.
* editing/pasteboard/onpaste-text-html-expected.txt: Rebaselined as now inline styles are stripped.
* editing/pasteboard/onpaste-text-html.html: Strip away the inline style data since they differ on each platform.
* http/tests/misc/copy-resolves-urls-expected.txt:
* http/tests/misc/copy-resolves-urls.html: Now uses blob URL for the pasted image as expected.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin-expected.txt: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin-expected.txt: Added.
* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-in-same-origin.html: Added.
* http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin-expected.txt: Added.
* http/tests/security/clipboard/drag-drop-html-cross-origin-iframe-in-same-origin.html: Added.
* http/tests/security/clipboard/resources/content-to-copy.html: Added.
* http/tests/security/clipboard/resources/subdirectory/paste-html.html: Added.
* platform/ios/TestExpectations: Unskip tests that have started passing.
* platform/mac-wk1/TestExpectations: Unskip the drag & drop test which only works in Mac WK1.
* platform/win/TestExpectations: Skip the newly added tests since we don't support custom pasteboard
data on Windows port.

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

22 months agoAnother attempt to fix the windows build.
weinig@apple.com [Thu, 19 Oct 2017 05:02:01 +0000 (05:02 +0000)]
Another attempt to fix the windows build.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
* page/SettingsBase.h:

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

22 months agoAttempt to fix the windows build.
weinig@apple.com [Thu, 19 Oct 2017 04:42:25 +0000 (04:42 +0000)]
Attempt to fix the windows build.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::resourceUsageOverlayVisibleChanged):
* page/SettingsBase.h:

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

22 months ago[Settings] Convert more settings to be generated
commit-queue@webkit.org [Thu, 19 Oct 2017 04:08:39 +0000 (04:08 +0000)]
[Settings] Convert more settings to be generated
https://bugs.webkit.org/show_bug.cgi?id=177766

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Dean Jackson.

- Replaces setNeedsStyleRecalcInAllFrames option in Settings.in
  with a more generic, onChange, which allows you to specify a function
  in SettingsBase that will be called when the setting changes.
  setNeedsStyleRecalcInAllFrames is then reimplemented in terms of
  onChange.
- Moves most (all but two) of the remaining non-static settings from
  SettingsBase to Settings.in

* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
(printSetterBody):
* Scripts/GenerateSettings/Settings.py:
(Setting.__init__):
(Setting.__str__):
(Setting.typeIsValueType):
(Setting.setterFunctionName):
(Setting.setterChangeFunctionName):
(Setting.hasComplexSetter):
(parseInput):

    Add support for the onChange option.

* page/Settings.in:

    Migrate most of the remaining non-static settings to Settings.in.
    Adopt onChange option.

* page/SettingsBase.cpp:
* page/SettingsBase.h:

    Add helper functions for use by the onChange option.

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

22 months agoImplement ServiceWorkerRegistration.scope / updateViaCache
cdumez@apple.com [Thu, 19 Oct 2017 03:29:51 +0000 (03:29 +0000)]
Implement ServiceWorkerRegistration.scope / updateViaCache
https://bugs.webkit.org/show_bug.cgi?id=178497

Reviewed by Youenn Fablet.

Source/WebCore:

Implement ServiceWorkerRegistration.scope / updateViaCache.

No new tests, updated existing test.

* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::resolvedWithRegistration):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::scope const):
(WebCore::ServiceWorkerRegistration::updateViaCache const):
(WebCore::ServiceWorkerRegistration::update):
(WebCore::ServiceWorkerRegistration::unregister):
(WebCore::ServiceWorkerRegistration::scriptExecutionContext const):
(WebCore::ServiceWorkerRegistration::activeDOMObjectName const):
(WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const):
* workers/service/ServiceWorkerRegistration.h:
* workers/service/ServiceWorkerRegistration.idl:
* workers/service/ServiceWorkerRegistrationData.cpp:
(WebCore::ServiceWorkerRegistrationData::isolatedCopy const):
* workers/service/ServiceWorkerRegistrationData.h:
(WebCore::ServiceWorkerRegistrationData::encode const):
(WebCore::ServiceWorkerRegistrationData::decode):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::jobResolvedInServer):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextStarted):
(WebCore::SWServerRegistration::data const):

Source/WebKit:

* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:

LayoutTests:

Extend layout test coverage.

* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/resources/basic-register.js:
(then):

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

22 months agoAdd preliminary support for ServiceWorker Handle Fetch
commit-queue@webkit.org [Thu, 19 Oct 2017 02:26:00 +0000 (02:26 +0000)]
Add preliminary support for ServiceWorker Handle Fetch
https://bugs.webkit.org/show_bug.cgi?id=178475

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-18
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/basic-fetch.https.html

Adding parameters to allow WebKit to do loading through Service Worker or through regular networking.
A script context is now storing its selected service worker identifier. This should be fully implemented later on.
This selected service worker identifier is passed to loading code as a ResourceLoaderOptions field.
Service workers mode is also added as a ResourceLoaderOptions field so that the service worker can be bypassed.

* WebCore.xcodeproj/project.pbxproj:
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::selectedServiceWorkerIdentifier const):
(WebCore::ScriptExecutionContext::setSelectedServiceWorkerIdentifier):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/FetchOptions.h:
(WebCore::isPotentialNavigationOrSubresourceRequest):
(WebCore::isNonSubresourceRequest):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/WorkerThreadableLoader.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* workers/WorkerThread.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp: Removed.
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWServer.h:

Source/WebKit:

Preliminary support of Handle Fetch algorithm and integration with fetch spec.
Adding ServiceWorkerClientFetch as the class responsible to do the load through ServiceWorker.
It is similar to WebResourceLoader that do the load through NetworkProcess.
In case ServiceWorkerClientFetch is not able to load through ServiceWorker,
it will fallback to WebResourceLoader through a fallback callback.

Loading through Service Worker is done currently if:
- There is a service worker registered for that origin
- Request is a subresource
- service workers mode is all
There will be cases where the service worker will not do the loading, for instance when fetch event handler is not set.
Future work should try to reduce the cases where the IPC dance is done unnecessarily.

ServiceWorkerClientFetch is responsible to adapt the ServiceWorker response to ResourceLoader.
In particular, it is calling ResourceLoader error callback if response is of type error.
It should call ResourceLoader redirection callback if response is a redirection response.
This will be done as a follow-up.

Implementing the IPC communication dedicated to fetch between WebProcess and ServiceWorker through StorageProcess.
In the future, WebProcess should create a direct IPC communication to the ServiceWorker process.

Moved SWContextManager from WebCore to WebKit and renamed it to ServiceWorkerContextManager.
This class is moved to WebKit as it will have to handle IPC and having a separation will add some unnecessary boilerplate.

* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didReceiveFetchResponse):
(WebKit::WebSWServerConnection::didReceiveFetchData):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::failedFetch):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::failedFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerClientFetch.cpp: Added.
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):
(WebKit::ServiceWorkerClientFetch::didReceiveData):
(WebKit::ServiceWorkerClientFetch::didFinishFetch):
(WebKit::ServiceWorkerClientFetch::didFail):
* WebProcess/Storage/ServiceWorkerClientFetch.h: Added.
* WebProcess/Storage/ServiceWorkerClientFetch.messages.in: Added.
* WebProcess/Storage/ServiceWorkerContextManager.cpp: Renamed from Source/WebCore/workers/service/context/SWContextManager.cpp.
(WebKit::ServiceWorkerContextManager::startServiceWorkerContext):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h: Renamed from Source/WebCore/workers/service/context/SWContextManager.h.
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::startFetch):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):
(WebKit::WebServiceWorkerProvider::handleFetch):
(WebKit::WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
(WebKit::WebProcess::startServiceWorkerContext):
(WebKit::WebProcess::startFetchInServiceWorker):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

* http/tests/workers/service/basic-fetch.https-expected.txt: Added.
* http/tests/workers/service/basic-fetch.https.html: Added.
* http/tests/workers/service/resources/basic-fetch-worker.js: Added.
* http/tests/workers/service/resources/basic-fetch.js: Added.

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

22 months ago[FrameView::layout cleanup] Group related pre-layout code to improve readability
zalan@apple.com [Thu, 19 Oct 2017 02:22:45 +0000 (02:22 +0000)]
[FrameView::layout cleanup] Group related pre-layout code to improve readability
https://bugs.webkit.org/show_bug.cgi?id=178496
<rdar://problem/35065718>

Reviewed by Simon Fraser.

Early returns/asserts/member variable resets etc.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

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

22 months agoTestController should clear all fetch caches when resetting its state
commit-queue@webkit.org [Thu, 19 Oct 2017 02:14:55 +0000 (02:14 +0000)]
TestController should clear all fetch caches when resetting its state
https://bugs.webkit.org/show_bug.cgi?id=178486

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-18
Reviewed by Chris Dumez.

Tools:

Adding clearDOMCaches test runner method.
Using that method when resetting state.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::clearDOMCaches):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/cache-storage/cache-clearing-all.https.html:

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

22 months ago[iOS] Use new class name from UIKit when checking UITextSuggestion type
cpugh@apple.com [Thu, 19 Oct 2017 01:39:14 +0000 (01:39 +0000)]
[iOS] Use new class name from UIKit when checking UITextSuggestion type
https://bugs.webkit.org/show_bug.cgi?id=178416
Source/WebKit:

<rdar://problem/35010840>

Reviewed by Tim Horton.

Here we start using UITextAutofillSuggestion instead of the old name that was being used for
AutoFill text suggestions.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView insertTextSuggestion:]): Use UITextAutofillSuggestion when checking the class
and when casting instead of UIKeyboardLoginCredentialsSuggestion.

Tools:

Reviewed by Tim Horton.

This updates our test using/mocking out UITextAutofillSuggestion instead of UIKeyboardLoginCredentialsSuggestion.

* TestWebKitAPI/Tests/ios/WKWebViewAutofillTests.mm:
(-[UITextAutofillSuggestion initWithUsername:password:]): Copied from UIKit's implementation. This will serve as
a mock of this method for builds not containingit.
(+[UITextAutofillSuggestion autofillSuggestionWithUsername:password:]): Ditto.
(TestWebKitAPI::TEST): Use +[UITextAutofillSuggestion autofillSuggestionWithUsername:password:] inline instead of
helper function for creating a new suggestion.
(newUIKeyboardLoginCredentialsSuggestion): Deleted.

* TestWebKitAPI/ios/UIKitSPI.h:

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

22 months agoWeb Inspector: Layers sidebar footer should not have white background with full-width...
commit-queue@webkit.org [Thu, 19 Oct 2017 01:22:57 +0000 (01:22 +0000)]
Web Inspector: Layers sidebar footer should not have white background with full-width quick console
https://bugs.webkit.org/show_bug.cgi?id=178493

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-18
Reviewed by Matt Baker.

* UserInterface/Views/LayerDetailsSidebarPanel.css:
Update CSS for new sidebar.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.css:
Update CSS for legacy sidebar.

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

22 months agoRegExpObject::defineOwnProperty() does not need to compare values if no descriptor...
mark.lam@apple.com [Thu, 19 Oct 2017 01:12:56 +0000 (01:12 +0000)]
RegExpObject::defineOwnProperty() does not need to compare values if no descriptor value is specified.
https://bugs.webkit.org/show_bug.cgi?id=177600
<rdar://problem/34710985>

Reviewed by Saam Barati.

JSTests:

* stress/regress-177600.js: Added.

Source/JavaScriptCore:

According to http://www.ecma-international.org/ecma-262/8.0/#sec-validateandapplypropertydescriptor,
section 9.1.6.3-7.a.ii, we should only check if the value is the same if the
descriptor value is present.

* runtime/RegExpObject.cpp:
(JSC::RegExpObject::defineOwnProperty):

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

22 months agoReplace some stack raw pointers with RefPtrs within WebCore/html
jiewen_tan@apple.com [Thu, 19 Oct 2017 01:01:21 +0000 (01:01 +0000)]
Replace some stack raw pointers with RefPtrs within WebCore/html
https://bugs.webkit.org/show_bug.cgi?id=178201
<rdar://problem/34841692>

Reviewed by Ryosuke Niwa.

Source/WebCore:

This is an effort to reduce raw pointer usage in DOM code. In this patch, raw pointers
that are ref countable are blindly selected to be replaced with RefPtrs with one exception
which is auto*.

Also, this patch occasionally modifies the return type of some methods, and therefore callers
of those methods are modified accordingly.

* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
(WebCore::LegacyCDM::mediaPlayer const):
* Modules/encryptedmedia/legacy/LegacyCDM.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::cdmMediaPlayer const):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::externalDeviceDisplayName const):
(WebCore::MediaControlsHost::externalDeviceType const):
* dom/Element.cpp:
(WebCore::Element::focusDelegate):
(WebCore::Element::userAgentShadowRoot const):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
* dom/EventContext.cpp:
(WebCore::TouchEventContext::checkReachability const):
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary):
(WebCore::EventPath::setRelatedTarget):
(WebCore::EventPath::retargetTouch):
(WebCore:: const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::toNode):
(WebCore::EventTarget::addEventListener):
* dom/EventTarget.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::toElement const):
(WebCore::MouseEvent::fromElement const):
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.cpp:
(WebCore::MouseRelatedEvent::computeRelativePosition):
* dom/Node.cpp:
(WebCore::Node::toNode):
* dom/Node.h:
* dom/ScopedEventQueue.cpp:
* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand):
* editing/EditorCommand.cpp:
(WebCore::targetFrame):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleReplacedElement):
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::updateAppearance):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::updateColorSwatch):
(WebCore::ColorInputType::shadowColorSwatch const):
* html/FileInputType.cpp:
(WebCore::FileInputType::disabledAttributeChanged):
(WebCore::FileInputType::multipleAttributeChanged):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::findAssociatedForm):
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormController.cpp:
(WebCore::recordFormStructure):
(WebCore::FormKeyGenerator::formKey):
(WebCore::FormController::restoreControlStateIn):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::imageElement const):
(WebCore::HTMLAreaElement::isFocusable const):
(WebCore::HTMLAreaElement::setFocus):
(WebCore::HTMLAreaElement::updateFocusAppearance):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::setScrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
(WebCore::HTMLBodyElement::setScrollTop):
(WebCore::HTMLBodyElement::scrollHeight):
(WebCore::HTMLBodyElement::scrollWidth):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createElementRenderer):
(WebCore:: const):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::width):
(WebCore::HTMLDocument::height):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsNeeded):
(WebCore::setHasDirAutoFlagRecursively):
(WebCore::HTMLElement::directionality const):
(WebCore::HTMLElement::dirAttributeChanged):
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin const):
(WebCore::HTMLEmbedElement::rendererIsNeeded):
* html/HTMLFieldSetElement.cpp:
(WebCore::updateFromControlElementsAncestorDisabledStateUnder):
(WebCore::HTMLFieldSetElement::disabledStateChanged):
(WebCore::HTMLFieldSetElement::childrenChanged):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeIsDisabledByFieldsetAncestor const):
(WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
(WebCore::HTMLFormControlElement::didChangeForm):
(WebCore::HTMLFormControlElement::shouldAutocorrect const):
(WebCore::HTMLFormControlElement::autocapitalizeType const):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::handleLocalEvents):
(WebCore::submitElementFromEvent):
(WebCore::HTMLFormElement::prepareForSubmission):
(WebCore::HTMLFormElement::submit):
(WebCore::HTMLFormElement::reset):
(WebCore::HTMLFormElement::shouldAutocorrect const):
(WebCore::HTMLFormElement::parseAttribute):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::elementFromPastNamesMap const):
(WebCore::HTMLFormElement::namedElements):
* html/HTMLFormElement.h:
* html/HTMLFrameElement.cpp:
(WebCore::HTMLFrameElement::didAttachRenderers):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed const):
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::didAttachRenderers):
* html/HTMLFrameOwnerElement.cpp:
(WebCore::HTMLFrameOwnerElement::setContentFrame):
(WebCore::HTMLFrameOwnerElement::clearContentFrame):
(WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
(WebCore::SubframeLoadingDisabler::canLoadFrame):
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::findContaining):
(WebCore::HTMLFrameSetElement::willAttachRenderers):
(WebCore::HTMLFrameSetElement::insertedInto):
(WebCore::HTMLFrameSetElement::removedFrom):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
(WebCore::HTMLImageElement::pictureElement const):
(WebCore::HTMLImageElement::destroyImageControls):
(WebCore::HTMLImageElement::hasImageControls const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::innerTextElement const):
(WebCore::HTMLInputElement::endEditing):
(WebCore::HTMLInputElement::dataList const):
(WebCore::HTMLInputElement::resetListAttributeTargetObserver): Deleted.
(WebCore::HTMLInputElement::listAttributeTargetChanged): Deleted.
(WebCore::HTMLInputElement::isSteppable const): Deleted.
(WebCore::HTMLInputElement::dateType const): Deleted.
(WebCore::HTMLInputElement::isTextButton const): Deleted.
(WebCore::HTMLInputElement::isRadioButton const): Deleted.
(WebCore::HTMLInputElement::isSearchField const): Deleted.
(WebCore::HTMLInputElement::isInputTypeHidden const): Deleted.
(WebCore::HTMLInputElement::isPasswordField const): Deleted.
(WebCore::HTMLInputElement::isCheckbox const): Deleted.
(WebCore::HTMLInputElement::isRangeControl const): Deleted.
(WebCore::HTMLInputElement::isColorControl const): Deleted.
(WebCore::HTMLInputElement::isText const): Deleted.
(WebCore::HTMLInputElement::isEmailField const): Deleted.
(WebCore::HTMLInputElement::isFileUpload const): Deleted.
(WebCore::HTMLInputElement::isImageButton const): Deleted.
(WebCore::HTMLInputElement::isNumberField const): Deleted.
(WebCore::HTMLInputElement::isSubmitButton const): Deleted.
(WebCore::HTMLInputElement::isTelephoneField const): Deleted.
(WebCore::HTMLInputElement::isURLField const): Deleted.
(WebCore::HTMLInputElement::isDateField const): Deleted.
(WebCore::HTMLInputElement::isDateTimeField const): Deleted.
(WebCore::HTMLInputElement::isDateTimeLocalField const): Deleted.
(WebCore::HTMLInputElement::isMonthField const): Deleted.
(WebCore::HTMLInputElement::isTimeField const): Deleted.
(WebCore::HTMLInputElement::isWeekField const): Deleted.
(WebCore::HTMLInputElement::isEnumeratable const): Deleted.
(WebCore::HTMLInputElement::supportLabels const): Deleted.
(WebCore::HTMLInputElement::shouldAppearChecked const): Deleted.
(WebCore::HTMLInputElement::supportsPlaceholder const): Deleted.
(WebCore::HTMLInputElement::updatePlaceholderText): Deleted.
(WebCore::HTMLInputElement::isEmptyValue const): Deleted.
(WebCore::HTMLInputElement::maxLengthAttributeChanged): Deleted.
(WebCore::HTMLInputElement::minLengthAttributeChanged): Deleted.
(WebCore::HTMLInputElement::updateValueIfNeeded): Deleted.
(WebCore::HTMLInputElement::defaultToolTip const): Deleted.
(WebCore::HTMLInputElement::matchesIndeterminatePseudoClass const): Deleted.
(WebCore::HTMLInputElement::shouldAppearIndeterminate const): Deleted.
(WebCore::HTMLInputElement::mediaCaptureType const): Deleted.
(WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Deleted.
(WebCore:: const): Deleted.
(WebCore::HTMLInputElement::checkedRadioButtonForGroup const): Deleted.
(WebCore::HTMLInputElement::radioButtonGroups const): Deleted.
(WebCore::HTMLInputElement::addToRadioButtonGroup): Deleted.
(WebCore::HTMLInputElement::removeFromRadioButtonGroup): Deleted.
(WebCore::HTMLInputElement::height const): Deleted.
(WebCore::HTMLInputElement::width const): Deleted.
(WebCore::HTMLInputElement::setHeight): Deleted.
(WebCore::HTMLInputElement::setWidth): Deleted.
(WebCore::ListAttributeTargetObserver::ListAttributeTargetObserver): Deleted.
(WebCore::ListAttributeTargetObserver::idTargetChanged): Deleted.
(WebCore::HTMLInputElement::setRangeText): Deleted.
(WebCore::HTMLInputElement::shouldTruncateText const): Deleted.
(WebCore::HTMLInputElement::selectionStartForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionStartForBindings): Deleted.
(WebCore::HTMLInputElement::selectionEndForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionEndForBindings): Deleted.
(WebCore::HTMLInputElement::selectionDirectionForBindings const): Deleted.
(WebCore::HTMLInputElement::setSelectionDirectionForBindings): Deleted.
(WebCore::HTMLInputElement::setSelectionRangeForBindings): Deleted.
(WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Deleted.
(WebCore::HTMLInputElement::capsLockStateMayHaveChanged): Deleted.
* html/HTMLInputElement.h:
* html/HTMLKeygenElement.cpp:
(WebCore::HTMLKeygenElement::shadowSelect const):
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::defaultEventHandler):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::handleClick):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::mapMouseEvent):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::isSafeToLoadURL):
(WebCore::HTMLMediaElement::controls const):
(WebCore::HTMLMediaElement::layoutSizeChanged):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::mediaControls const):
(WebCore::HTMLMediaElement::hasMediaControls const):
(WebCore::HTMLMediaElement::mediaPlayerReferrer const):
(WebCore::HTMLMediaElement::mediaPlayerUserAgent const):
(WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge):
(WebCore::HTMLMediaElement::sourceApplicationIdentifier const):
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
(WebCore::HTMLMediaElement::session const):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::player const):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent const):
* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::ownerSelectElement const):
(WebCore::HTMLOptGroupElement::accessKeyAction):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::setText):
(WebCore::HTMLOptionElement::accessKeyAction):
(WebCore::HTMLOptionElement::index const):
(WebCore::HTMLOptionElement::parseAttribute):
(WebCore::HTMLOptionElement::selected):
(WebCore::HTMLOptionElement::setSelected):
(WebCore::HTMLOptionElement::setSelectedState):
(WebCore::HTMLOptionElement::childrenChanged):
(WebCore::HTMLOptionElement::ownerDataListElement const):
(WebCore::HTMLOptionElement::ownerSelectElement const):
(WebCore::HTMLOptionElement::textIndentedToRespectGroupLabel const):
(WebCore::HTMLOptionElement::insertedInto):
(WebCore::HTMLOptionElement::collectOptionInnerText const):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::willDetachRenderers):
(WebCore::HTMLPlugInElement::isKeyboardFocusable const):
(WebCore::HTMLPlugInElement::isUserObservable const):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay const):
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::recalcListItems const):
(WebCore::HTMLSelectElement::selectOption):
(WebCore::HTMLSelectElement::reset):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/HTMLSlotElement.cpp:
(WebCore::flattenAssignedNodes):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::removedFrom):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::isActiveSummary const):
(WebCore::isClickableControl):
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::tHead const):
(WebCore::HTMLTableElement::setTHead):
(WebCore::HTMLTableElement::tFoot const):
(WebCore::HTMLTableElement::createTBody):
(WebCore::HTMLTableElement::lastBody const):
(WebCore::HTMLTableElement::deleteRow):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable const):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::rowAfter):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::subtreeHasChanged):
(WebCore::HTMLTextAreaElement::innerTextElement const):
* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::indexForVisiblePosition const):
(WebCore::HTMLTextFormControlElement::visiblePositionForIndex const):
(WebCore::HTMLTextFormControlElement::computeSelectionStart const):
(WebCore::HTMLTextFormControlElement::computeSelectionEnd const):
(WebCore::HTMLTextFormControlElement::computeSelectionDirection const):
(WebCore::HTMLTextFormControlElement::selection const):
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
(WebCore::innerTextValueFrom):
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
(WebCore::HTMLTextFormControlElement::innerTextValue const):
(WebCore::positionForIndex):
(WebCore::HTMLTextFormControlElement::indexForPosition const):
(WebCore::HTMLTextFormControlElement::hidePlaceholder):
(WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
(WebCore::enclosingTextFormControl):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/HTMLTextFormControlElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::canLoadURL):
(WebCore::HTMLTrackElement::setReadyState):
(WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute const):
(WebCore::HTMLTrackElement::textTrackKindChanged):
(WebCore::HTMLTrackElement::textTrackModeChanged):
(WebCore::HTMLTrackElement::textTrackAddCues):
(WebCore::HTMLTrackElement::textTrackRemoveCues):
(WebCore::HTMLTrackElement::textTrackAddCue):
(WebCore::HTMLTrackElement::textTrackRemoveCue):
(WebCore::HTMLTrackElement::mediaElement const):
* html/HTMLTrackElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::setDisplayMode):
(WebCore::HTMLVideoElement::paintCurrentFrameInContext):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::scale):
(WebCore::ImageDocument::imageFitsInWindow):
* html/InputType.cpp:
(WebCore::InputType::destroyShadowSubtree):
* html/InputType.h:
(WebCore::InputType::innerTextElement const):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
(WebCore::MediaDocument::defaultEventHandler):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
(WebCore::isMainContentForPurposesOfAutoplay):
* html/NumberInputType.cpp:
(WebCore::NumberInputType::decorationWidth const):
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::appendBytes):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
(WebCore::RadioInputType::isKeyboardFocusable const):
(WebCore::RadioInputType::didDispatchClick):
* html/RadioNodeList.cpp:
(WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleMouseDownEvent):
(WebCore::RangeInputType::handleTouchEvent):
(WebCore::RangeInputType::sliderTrackElement const):
(WebCore::RangeInputType::listAttributeTargetChanged):
(WebCore::RangeInputType::updateTickMarkValues):
* html/SearchInputType.cpp:
(WebCore::SearchInputType::createShadowSubtree):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isEmptyValue const):
(WebCore::TextFieldInputType::handleKeydownEvent):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::innerTextElement const):
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const):
* html/TextFieldInputType.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2D::drawImage):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::copyBufferSubData):
(WebCore::WebGL2RenderingContext::getBufferSubData):
* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::attach):
(WebCore::WebGLFramebuffer::getAttachmentObject const):
(WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
(WebCore::WebGLFramebuffer::getColorBufferWidth const):
(WebCore::WebGLFramebuffer::getColorBufferHeight const):
(WebCore::WebGLFramebuffer::getColorBufferFormat const):
(WebCore::WebGLFramebuffer::checkStatus const):
(WebCore::WebGLFramebuffer::hasStencilBuffer const):
(WebCore::WebGLFramebuffer::initializeAttachments):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::compressedTexImage2D):
(WebCore::WebGLRenderingContextBase::compressedTexSubImage2D):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::generateMipmap):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::linkProgramWithoutInvalidatingAttribLocations):
(WebCore::WebGLRenderingContextBase::texImage2DBase):
(WebCore::WebGLRenderingContextBase::validateTexFunc):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DBase):
(WebCore::WebGLRenderingContextBase::copyTexImage2D):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texParameter):
(WebCore::WebGLRenderingContextBase::loseContextImpl):
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness):
(WebCore::WebGLRenderingContextBase::validateTextureBinding):
(WebCore::WebGLRenderingContextBase::maybeRestoreContext):
* html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor):
* html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeInsertAlreadyParsedChildTask):
(WebCore::HTMLConstructionSite::insertTextNode):
* html/parser/HTMLFormattingElementList.cpp:
(WebCore::HTMLFormattingElementList::tryToEnsureNoahsArkConditionQuickly):
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
(WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElementTypes.h:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlPanelElement::startDrag):
(WebCore::MediaControlPanelElement::endDrag):
(WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
(WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
(WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
(WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
(WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
(WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
(WebCore::MediaControlTextTrackContainerElement::updateSizes):
(WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::containsRelatedTarget):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::isDisabledFormControl const):
(WebCore::SliderThumbElement::matchesReadWritePseudoClass const):
(WebCore::SliderThumbElement::focusDelegate):
(WebCore::SliderThumbElement::setPositionFromPoint):
(WebCore::SliderThumbElement::startDragging):
(WebCore::SliderThumbElement::stopDragging):
(WebCore::SliderThumbElement::defaultEventHandler):
(WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
(WebCore::SliderThumbElement::willRespondToMouseClickEvents):
(WebCore::SliderThumbElement::willDetachRenderers):
(WebCore::findTouchWithIdentifier):
(WebCore::SliderThumbElement::handleTouchStart):
(WebCore::SliderThumbElement::handleTouchMove):
(WebCore::SliderThumbElement::handleTouchEndAndCancel):
(WebCore::SliderThumbElement::handleTouchEvent):
(WebCore::SliderThumbElement::hostInput const):
* html/shadow/SliderThumbElement.h:
* html/shadow/SpinButtonElement.cpp:
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::releaseCapture):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::ImageControlsButtonElementMac::defaultEventHandler):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::trackElementIndex):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::setMode):
(WebCore::TextTrack::hasCue):
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::copyWebVTTNodeToDOMTree):
(WebCore::VTTCue::determineTextDirection):
(WebCore::VTTCue::markFutureAndPastNodes):
(WebCore::VTTCue::removeDisplayTree):
(WebCore::VTTCue::cueContentsMatch const):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didAddEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::maybeCreateContextMenu):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::handleEvent):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::innerTextElement const):
(WebCore::RenderTextControl::styleDidChange):
(WebCore::RenderTextControl::textBlockLogicalWidth const):
(WebCore::RenderTextControl::computeLogicalHeight const):
(WebCore::RenderTextControl::hitInnerTextElement):
(WebCore::RenderTextControl::canScroll const):
(WebCore::RenderTextControl::innerLineHeight const):
* rendering/RenderTextControl.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::nodeAtPoint):
(WebCore::RenderTextControlSingleLine::styleDidChange):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isFocused const):
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintMediaSliderTrack):
(WebCore::RenderThemeGtk::paintMediaVolumeSliderTrack):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSliderThumb):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::willBeDestroyed):
(WebCore::RenderVideo::calculateIntrinsicSize):
(WebCore::RenderVideo::paintReplaced):
(WebCore::RenderVideo::updatePlayer):
(WebCore::RenderVideo::supportsAcceleratedRendering const):
(WebCore::RenderVideo::acceleratedRenderingStateChanged):
(WebCore::RenderVideo::requiresImmediateCompositing const):
(WebCore::RenderVideo::foregroundIsKnownToBeOpaqueInRect const):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree):
(WebCore::SVGUseElement::targetClone const):

Source/WebKit:

Change the type of node as toNode() is changed to return RefPtr.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebCoreSupport/wpe/WebEditorClientWPE.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::handleEditingKeyboardEvent):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::frameForEvent):

Source/WebKitLegacy/mac:

* DOM/DOM.mm:
(kit):
Change the type of node as toNode() is changed to return RefPtr.

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::handleEditingKeyboardEvent):
Change the type of node as toNode() is changed to return RefPtr.

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

22 months agoupdate-webkit-auxiliary-libs can't download WebKitAuxiliaryLibrary.zip due to 403...
commit-queue@webkit.org [Thu, 19 Oct 2017 00:46:15 +0000 (00:46 +0000)]
update-webkit-auxiliary-libs can't download WebKitAuxiliaryLibrary.zip due to 403 Forbidden
https://bugs.webkit.org/show_bug.cgi?id=178381

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Alexey Proskuryakov.

The web server developer.apple.com seems to reject HTTP requests
without Accept header field.

* Scripts/update-webkit-dependency: Add 'Accept' header field to requests.

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

22 months agoSome older hardware can't actually use renderbuffers at the size they advertise
dino@apple.com [Wed, 18 Oct 2017 23:41:44 +0000 (23:41 +0000)]
Some older hardware can't actually use renderbuffers at the size they advertise
https://bugs.webkit.org/show_bug.cgi?id=178417
<rdar://problem/35042291>

Reviewed by Tim Horton.

Source/WebCore:

The change in r223567 caused some older hardware to fail, because even though
they claimed to support a maximum renderbuffer and viewport of 16K, they were
unable to actually handle one. Rather than trying to identify such hardware,
clamp all buffers to a maximum of 8192. This is bigger than the previous value
of 4096, and large enough to have a full-screen buffer on a Retina 5K iMac.

* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::getIntegerv):

LayoutTests:

Unskip webgl/1.0.2/conformance/canvas/drawingbuffer-static-canvas-test.html.

* TestExpectations:

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

22 months agoAdd test to ensure that text-overflow: ellipsis text is scrollable
dbates@webkit.org [Wed, 18 Oct 2017 23:14:34 +0000 (23:14 +0000)]
Add test to ensure that text-overflow: ellipsis text is scrollable
https://bugs.webkit.org/show_bug.cgi?id=178395

Reviewed by Zalan Bujtas.

* fast/text/scroll-text-overflow-ellipsis-expected.html: Added.
* fast/text/scroll-text-overflow-ellipsis.html: Added.
* platform/ios-wk1/TestExpectations: For now, skip the test in legacy WebKit on iOS
as eventSender.keyDown() does not seem to be dispatching a keyboard event to the
focused field. See <https://bugs.webkit.org/show_bug.cgi?id=178490>.
* resources/ui-helper.js:
(window.UIHelper.keyDown.return.new.Promise):
(window.UIHelper.keyDown):

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

22 months ago[Service Worker] Add stubs for Client / WindowClient / Clients
cdumez@apple.com [Wed, 18 Oct 2017 22:31:55 +0000 (22:31 +0000)]
[Service Worker] Add stubs for Client / WindowClient / Clients
https://bugs.webkit.org/show_bug.cgi?id=178469

Reviewed by Youenn Fablet.

Source/WebCore:

Add stubs for Client / WindowClient / Clients:
- https://w3c.github.io/ServiceWorker/v1/#clients
- https://w3c.github.io/ServiceWorker/v1/#client-interface

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::visibilityState const):
* dom/Document.h:
* dom/Document.idl:
* dom/VisibilityState.h: Renamed from Source/WebCore/page/PageVisibilityState.h.
* dom/VisibilityState.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* page/Page.cpp:
(WebCore::Page::visibilityState const):
* page/Page.h:
* workers/service/ServiceWorkerClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::activeDOMObjectName const):
(WebCore::ServiceWorkerClient::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClient::url const):
(WebCore::ServiceWorkerClient::frameType const):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerClients.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp.
(WebCore::ServiceWorkerClients::ServiceWorkerClients):
(WebCore::ServiceWorkerClients::activeDOMObjectName const):
(WebCore::ServiceWorkerClients::canSuspendForDocumentSuspension const):
(WebCore::ServiceWorkerClients::get):
(WebCore::ServiceWorkerClients::matchAll):
(WebCore::ServiceWorkerClients::openWindow):
(WebCore::ServiceWorkerClients::claim):
* workers/service/ServiceWorkerClients.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.h.
(WebCore::ServiceWorkerClients::create):
* workers/service/ServiceWorkerClients.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
* workers/service/ServiceWorkerGlobalScope.h:
(WebCore::ServiceWorkerGlobalScope::clients):
* workers/service/ServiceWorkerGlobalScope.idl:
* workers/service/ServiceWorkerWindowClient.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
(WebCore::ServiceWorkerWindowClient::visibilityState const):
(WebCore::ServiceWorkerWindowClient::isFocused const):
(WebCore::ServiceWorkerWindowClient::focus):
(WebCore::ServiceWorkerWindowClient::navigate):
* workers/service/ServiceWorkerWindowClient.h: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerWindowClient.idl: Copied from Source/WebCore/workers/service/ServiceWorkerGlobalScope.idl.

Source/WebKit:

Rename PageVisibilityState to VisibilityState.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toVisibilityState):
* WebProcess/WebPage/WebPage.h:

Source/WebKitLegacy/mac:

Rename PageVisiblityState to VisibilityState.

* WebView/WebView.mm:
(kit):

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

22 months ago[FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value...
zalan@apple.com [Wed, 18 Oct 2017 22:27:55 +0000 (22:27 +0000)]
[FrameView::layout cleanup] Use SetForScope to protect m_needsFullRepaint's value on reentrancy
https://bugs.webkit.org/show_bug.cgi?id=178479
<rdar://problem/35056950>

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

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

22 months agoMake failing WebGL tests produce debug output
dino@apple.com [Wed, 18 Oct 2017 22:01:49 +0000 (22:01 +0000)]
Make failing WebGL tests produce debug output
https://bugs.webkit.org/show_bug.cgi?id=178421

Reviewed by Jon Lee.

If a WebGL conformance test fails, we just get the word "FAIL". Instead,
have it log the actual output of the test, so we can see what happens
on bots.

Drive-by fix where I noticed a test file was missing, that causes
two tests to timeout. They may still timeout, but now because they
take a long time to run rather than they have a JS error.

* platform/mac/TestExpectations:
* webgl/1.0.2/resources/webgl_test_files/conformance/resources/iterable-test.js: Added.
* webgl/1.0.2/resources/webkit-webgl-test-harness.js:
(window.webglTestHarness.notifyFinished):
* webgl/resources/webkit-webgl-test-harness.js:
(window.webglTestHarness.notifyFinished):

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

22 months ago[FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
zalan@apple.com [Wed, 18 Oct 2017 21:54:28 +0000 (21:54 +0000)]
[FrameView::layout cleanup] Remove InPreLayoutStyleUpdate.
https://bugs.webkit.org/show_bug.cgi?id=178483
<rdar://problem/35058800>

Reviewed by Simon Fraser.

Its client, updateCompositingLayersAfterStyleChange only needs to know if there's a upcoming
layer update (part of FrameView::layout()).

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterStyleChange):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

22 months agowebkitpy tests should have --json-output option
aakash_jain@apple.com [Wed, 18 Oct 2017 21:52:09 +0000 (21:52 +0000)]
webkitpy tests should have --json-output option
https://bugs.webkit.org/show_bug.cgi?id=178481

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/test/main.py:
(Tester._parse_args): Added json-output argument.
(Tester._run_tests): Write output to json file.

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

22 months agoGlobal constructors exposed to service workers should go on ServiceWorkerGlobalScope...
cdumez@apple.com [Wed, 18 Oct 2017 21:37:33 +0000 (21:37 +0000)]
Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface
https://bugs.webkit.org/show_bug.cgi?id=178482

Reviewed by Sam Weinig.

Global constructors exposed to service workers should go on ServiceWorkerGlobalScope interface,
not the ServiceWorker interface.

* bindings/scripts/preprocess-idls.pl:

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

22 months agoAdd an argument indicating the type of insertion to Node::insertedInto
rniwa@webkit.org [Wed, 18 Oct 2017 21:34:25 +0000 (21:34 +0000)]
Add an argument indicating the type of insertion to Node::insertedInto
https://bugs.webkit.org/show_bug.cgi?id=178431

Reviewed by Antti Koivisto.

Added InsertionType as the first argument to Node::insertedInto, which contains two booleans indicating
whether the node just become newly connected to a document, and whether node's tree scope had changed or not.

These boolean flags simplifie the logic in insertedInto implementations, and are required to have a better
guarantee about the correctness of node flags during calls to insertedInto. Right now, isConnected() and
isInShadowTree() are both outdated until Node::insertedInto is called.

Also renamed the second argument from insertionPoint to parentOfInsertedTree to make the semantics clear,
and renamed finishedInsertingSubtree to didFinishInsertingNode, and renamed InsertionNotificationRequest
to InsertedIntoResult using enum class.

Note that in some implementations of insertedInto, we check whether isConnected() was false to decide whether
the node is newly connected to a document. This extra check is no longer necessary since no node will be inserted
into a document without first being completely removed after r223458.

No new tests since there should be no behavioral changes.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::notifyChildInserted):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoDocument): Replaced the check that the node had not been disconnected by scripts
by a release assert now that we believe we've eliminated all causes of these unwanted DOM mutations in r223458.
(WebCore::notifyNodeInsertedIntoTree): Removed NoEventDispatchAssertion since notifyChildNodeInserted has it
already since r223458.
(WebCore::notifyChildNodeInserted): Made this function return NodeVector (copy elision).
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::insertedInto): Use insertionType.connectedToDocument to detect when this element had become
connected to some document. Similarly, use insertionType.treeScopeChanged to detect when this element had been
inserted into a new tree scope. Removed the comment which became obsolete due to this cleanup.
(WebCore::Element::addShadowRoot): Simplified the code here since we never attach a ShadowRoot with children.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::insertedInto):
* dom/Node.h:
(WebCore::Node::InsertedIntoResult): Renamed from InsertionNotificationRequest, and turned into an enum class.
(WebCore::Node::InsertionType): Added. We pass this object by value to insertedInto as a performance optimization
as passing two booleans by value is faster than passing a pointer and then de-referencing it in a virtual callee.
(WebCore::Node::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ProcessingInstruction.h:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::shouldCallFinishedInsertingSubtree): Deleted.
(WebCore::ScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* dom/ScriptElement.h:
(WebCore::ScriptElement::insertedInto const): Added. Extracted from shouldCallFinishedInsertingSubtree.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto): The extra isConnected() check is no longer needed. See the description above.
* dom/ShadowRoot.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::insertedInto):
* html/FormAssociatedElement.h:
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::insertedInto):
* html/HTMLBaseElement.h:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto):
(WebCore::HTMLBodyElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLBodyElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedInto):
(WebCore::HTMLFormControlElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::insertedInto):
* html/HTMLFormControlElementWithState.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::insertedInto):
* html/HTMLFormElement.h:
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::insertedInto):
(WebCore::HTMLFrameElementBase::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLFrameElementBase.h:
* html/HTMLFrameSetElement.cpp:
(WebCore::HTMLFrameSetElement::insertedInto):
* html/HTMLFrameSetElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::insertedInto):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedInto):
(WebCore::HTMLInputElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::insertedInto): The extra isConnected() check is no longer needed. See above.
(WebCore::HTMLLinkElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLLinkElement.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedInto):
* html/HTMLMapElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedInto):
(WebCore::HTMLMediaElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::insertedInto):
* html/HTMLMetaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::insertedInto):
(WebCore::HTMLObjectElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLObjectElement.h:
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::insertedInto):
* html/HTMLOptionElement.h:
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::insertedInto):
(WebCore::HTMLScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* html/HTMLScriptElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::insertedInto):
* html/HTMLSelectElement.h:
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::insertedInto): Replaced a cumbersome condition by a boolean check on insertionType's
treeScopeChanged and removed the accompanying comment which is no longer needed.
* html/HTMLSlotElement.h:
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
* html/HTMLSourceElement.h:
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above.
* html/HTMLStyleElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::insertedInto):
* html/HTMLTextFormControlElement.h:
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::insertedInto):
* html/HTMLTitleElement.h:
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto): Added a FIXME since this code is clearly wrong.
* html/HTMLTrackElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::insertedInto):
* svg/SVGElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::insertedInto):
(WebCore::SVGFEImageElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGFEImageElement.h:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedInto):
* svg/SVGFontFaceElement.h:
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::insertedInto):
* svg/SVGFontFaceUriElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::insertedInto):
* svg/SVGImageElement.h:
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::insertedInto):
(WebCore::SVGMPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGMPathElement.h:
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::insertedInto):
* svg/SVGPathElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::insertedInto):
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::insertedInto):
(WebCore::SVGScriptElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGScriptElement.h:
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::insertedInto): The extra isConnected() check is no longer needed. See above description.
* svg/SVGStyleElement.h:
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::insertedInto):
(WebCore::SVGTRefElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGTRefElement.h:
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedInto):
(WebCore::SVGTextPathElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/SVGTextPathElement.h:
* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
* svg/SVGTitleElement.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::insertedInto):
* svg/SVGUseElement.h:
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::insertedInto):
(WebCore::SVGSMILElement::didFinishInsertingNode): Renamed from finishedInsertingSubtree.
* svg/animation/SVGSMILElement.h:

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

22 months agoKey events should not update Document.lastHandledUserGestureTimestamp unless key...
eric.carlson@apple.com [Wed, 18 Oct 2017 20:26:38 +0000 (20:26 +0000)]
Key events should not update Document.lastHandledUserGestureTimestamp unless key event is handled
https://bugs.webkit.org/show_bug.cgi?id=178473
<rdar://problem/34869935>

Reviewed by Brent Fulgham.

Source/WebCore:

No new tests, updated media/restricted-audio-playback-with-document-gesture.html for this change.

* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Restore the current Document's "lastHandledUserGestureTimestamp"
if the key event was not handled.

LayoutTests:

* media/restricted-audio-playback-with-document-gesture.html: Pass true to runWithKeyDown so
it consumes the keydown event.
* media/video-test.js:
(runWithKeyDown): Take optional parameter which causes event handler to call preventDefault.

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

22 months agoUnreviewed, rolling out r223291.
wenson_hsieh@apple.com [Wed, 18 Oct 2017 20:20:37 +0000 (20:20 +0000)]
Unreviewed, rolling out r223291.

Source/WebCore:

After further investigation, this removed codepath is
something Mail may want to re-adopt. Additionally, the
original breaking change was rolled out in r223408, so
this test once again passes on ToT.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

Source/WebKitLegacy/mac:

See WebCore ChangeLog for more detail.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

Tools:

See WebCore ChangeLog for more detail.

Reverted changeset:

"Remove Editor::simplifyMarkup"
https://bugs.webkit.org/show_bug.cgi?id=178271
https://trac.webkit.org/changeset/223291

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

22 months ago[Settings] Move remaining simple settings to Settings.in
commit-queue@webkit.org [Wed, 18 Oct 2017 20:18:38 +0000 (20:18 +0000)]
[Settings] Move remaining simple settings to Settings.in
https://bugs.webkit.org/show_bug.cgi?id=177730
<rdar://problem/34763346>

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Daniel Bates.

* Scripts/GenerateSettings/Settings.py:
(Setting.__init__):
(Setting.__str__):
(Setting.getterFunctionName):
(parseInput):

    Add support for parsing the 'getter' option.

* page/Settings.in:

    Migrate simple settings from SettingsBase to here.

* page/SettingsBase.cpp:
(WebCore::SettingsBase::SettingsBase):
(WebCore::SettingsBase::setJavaEnabled): Deleted.
(WebCore::SettingsBase::setJavaEnabledForLocalFiles): Deleted.
(WebCore::SettingsBase::setPreferMIMETypeForImages): Deleted.
(WebCore::SettingsBase::setForcePendingWebGLPolicy): Deleted.
(WebCore::SettingsBase::setNeedsAdobeFrameReloadingQuirk): Deleted.
(WebCore::SettingsBase::setFontRenderingMode): Deleted.
(WebCore::SettingsBase::fontRenderingMode const): Deleted.
(WebCore::SettingsBase::setShowTiledScrollingIndicator): Deleted.
(WebCore::SettingsBase::setFontFallbackPrefersPictographs): Deleted.
* page/SettingsBase.h:
(WebCore::SettingsBase::isJavaEnabled const): Deleted.
(WebCore::SettingsBase::isJavaEnabledForLocalFiles const): Deleted.
(WebCore::SettingsBase::preferMIMETypeForImages const): Deleted.
(WebCore::SettingsBase::needsAcrobatFrameReloadingQuirk const): Deleted.
(WebCore::SettingsBase::showTiledScrollingIndicator const): Deleted.
(WebCore::SettingsBase::setTouchEventEmulationEnabled): Deleted.
(WebCore::SettingsBase::isTouchEventEmulationEnabled const): Deleted.
(WebCore::SettingsBase::setTimeWithoutMouseMovementBeforeHidingControls): Deleted.
(WebCore::SettingsBase::timeWithoutMouseMovementBeforeHidingControls const): Deleted.
(WebCore::SettingsBase::fontFallbackPrefersPictographs const): Deleted.
(WebCore::SettingsBase::setMediaKeysStorageDirectory): Deleted.
(WebCore::SettingsBase::mediaKeysStorageDirectory const): Deleted.
(WebCore::SettingsBase::setMediaDeviceIdentifierStorageDirectory): Deleted.
(WebCore::SettingsBase::mediaDeviceIdentifierStorageDirectory const): Deleted.
(WebCore::SettingsBase::applePayEnabled const): Deleted.
(WebCore::SettingsBase::setApplePayEnabled): Deleted.
(WebCore::SettingsBase::applePayCapabilityDisclosureAllowed const): Deleted.
(WebCore::SettingsBase::setApplePayCapabilityDisclosureAllowed): Deleted.
(WebCore::SettingsBase::isForcePendingWebGLPolicy const): Deleted.

    Remove simple settings.

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

22 months agoediting/deleting/delete-emoji-9.html is failing consistently.
mmaxfield@apple.com [Wed, 18 Oct 2017 19:30:28 +0000 (19:30 +0000)]
editing/deleting/delete-emoji-9.html is failing consistently.
https://bugs.webkit.org/show_bug.cgi?id=178478

Unreviewed.

* platform/mac/editing/deleting/delete-emoji-9-expected.txt:

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

22 months ago[FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
zalan@apple.com [Wed, 18 Oct 2017 19:19:38 +0000 (19:19 +0000)]
[FrameView::layout cleanup] Move root/body marking dirty logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178477
<rdar://problem/35056478>

Reviewed by Simon Fraser.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::markRootOrBodyRendererDirty const):
(WebCore::FrameView::layout):
* page/FrameView.h:

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

22 months agoSetup WebCore build to start using unified sources.
keith_miller@apple.com [Wed, 18 Oct 2017 19:14:51 +0000 (19:14 +0000)]
Setup WebCore build to start using unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178362

Reviewed by Tim Horton.

.:

Pass features to the unified source bundler script.

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

Change comments in source list files. Also, pass explicit names for build files.

* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Sources.txt:
* SourcesGTK.txt:
* SourcesMac.txt:

Source/WebCore:

This patch adds all the long tooling needed to start adding
unified sources to WebCore. Most of the source list files
are empty to start but will be filled over the next few days.

I started by moving all the non-derived bindings code to
unified sources to make sure everything worked correctly.

* CMakeLists.txt:
* Configurations/GenerateUnifiedSources.xcconfig: Added.
* Configurations/WebCore.xcconfig:
* PlatformMac.cmake:
* Sources.txt: Added.
* SourcesCocoa.txt: Added.
* SourcesIOS.txt: Added.
* SourcesMac.txt: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMediaStreamCapabilitiesCustom.cpp: Removed. No one seems to use this...

Source/WTF:

There are a number of changes to the bundler script. First, it is
now possible to enable or disable building files based on if the
associated feature flag is enabled or not. The syntax for this is
similar to how we do #ifs in C++ code. e.g.

#if ENABLE_APPLE_PAY
    myApplePayFile.cpp
#endif

would enable myApplePayFile.cpp if and only if the APPLE_PAY
feature define is set.

I also changed comments from # to // to make it less likely they
would be confused with a #if.

Finally, this patch enables bundling files in the same relative
directory across source list files. Previously, if
SourcesCocoa.txt had platform/cf/foo.cpp and SourcesMac.txt had
platform/cf/bar.cpp those files would not be put in the same
unified source bundle. Now, those files will be put into the same
bundle but bar.cpp will always follow foo.cpp. The idea is that by
putting more specific files after more general files we can avoid
random build failures.

* Scripts/generate-unified-source-bundles.rb:

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

22 months ago[GTK] Web Inspector: Add Layers.svg
commit-queue@webkit.org [Wed, 18 Oct 2017 18:39:04 +0000 (18:39 +0000)]
[GTK] Web Inspector: Add Layers.svg
https://bugs.webkit.org/show_bug.cgi?id=178430

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Michael Catanzaro.

* UserInterface/Images/gtk/Layers.svg: Added.

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

22 months agoUnreviewed, rolling out r223321.
commit-queue@webkit.org [Wed, 18 Oct 2017 18:28:20 +0000 (18:28 +0000)]
Unreviewed, rolling out r223321.
https://bugs.webkit.org/show_bug.cgi?id=178476

This protocol change broke some internal builds (Requested by
brrian__ on #webkit).

Reverted changeset:

"Web Inspector: provide a way to enable/disable event
listeners"
https://bugs.webkit.org/show_bug.cgi?id=177451
https://trac.webkit.org/changeset/223321

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

22 months agoRoll out r223316.
aestes@apple.com [Wed, 18 Oct 2017 18:23:09 +0000 (18:23 +0000)]
Roll out r223316.

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

22 months agoCheck notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPa...
wilander@apple.com [Wed, 18 Oct 2017 18:21:16 +0000 (18:21 +0000)]
Check notifyPagesWhenTelemetryWasCaptured before notifying pages if there is no WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=178470
<rdar://problem/34417518>

Reviewed by Brian Burg.

* UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
(WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
    Add a missing check of notifyPagesWhenTelemetryWasCaptured.
    The page notification is only for testing purposes.

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

22 months agoThe compiler should always register a structure when it adds its transitionWatchPointSet.
mark.lam@apple.com [Wed, 18 Oct 2017 17:41:55 +0000 (17:41 +0000)]
The compiler should always register a structure when it adds its transitionWatchPointSet.
https://bugs.webkit.org/show_bug.cgi?id=178420
<rdar://problem/34814024>

Reviewed by Saam Barati and Filip Pizlo.

JSTests:

* stress/regress-178420.js: Added.
(new.Array.10000.map):

Source/JavaScriptCore:

Instead of invoking addLazily() to add a structure's transitionWatchpointSet, we
now invoke Graph::registerAndWatchStructureTransition() on the structure.
registerAndWatchStructureTransition() both registers the structure and add its
transitionWatchpointSet to the plan desired watchpoints.

Graph::registerAndWatchStructureTransition() is based on Graph::registerStructure()
except registerAndWatchStructureTransition() adds the structure's
transitionWatchpointSet unconditionally.

* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine const):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):

* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::registerAndWatchStructureTransition):
* dfg/DFGGraph.h:

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnString):
- The second set of addLazily()s is redundant.  This set is executed only when
  prototypeChainIsSane is true, and prototypeChainIsSane can only be true if and
  only if we've executed the if statement above it.  That preceding if statement
  already registerAndWatchStructureTransition() the same 2 structures.  Hence,
  this second set can be deleted.

* dfg/DFGWatchpointCollectionPhase.cpp:
(JSC::DFG::WatchpointCollectionPhase::addLazily):
- Deleted an unused function.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt):

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

22 months agohttp/tests/loading/basic-auth-resend-wrong-credentials.html is still a flaky failure...
achristensen@apple.com [Wed, 18 Oct 2017 17:16:41 +0000 (17:16 +0000)]
http/tests/loading/basic-auth-resend-wrong-credentials.html is still a flaky failure after proposed fix.
https://bugs.webkit.org/show_bug.cgi?id=178467

Reviewed by Andy Estes.

* http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
* http/tests/loading/basic-auth-resend-wrong-credentials.html:
* platform/wk2/http/tests/loading/basic-auth-resend-wrong-credentials-expected.txt:
Use setTimeout to make the loading order deterministic.
The important part of this test is that the passwords shown in the delegate callbacks are correct,
and this doesn't change that.

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

22 months ago[Settings] Miscellaneous cleanup of the settings generation scripts
commit-queue@webkit.org [Wed, 18 Oct 2017 17:10:16 +0000 (17:10 +0000)]
[Settings] Miscellaneous cleanup of the settings generation scripts
https://bugs.webkit.org/show_bug.cgi?id=178462

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Daniel Bates.

- Stop generating and remove now unused SettingsMacros.h
- Make functions operating on the python Setting object member functions
- Add predicate to determine if a Setting's type is a value type, allowing
  us to exclude those from using const references.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py:
* Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:
* Scripts/GenerateSettings/GenerateSettingsMacrosHeader.py: Removed.
* Scripts/GenerateSettings/Settings.py:
* WebCoreMacros.cmake:
* WebCore.xcodeproj/project.pbxproj:

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

22 months agoAlign ImageData constructor with the specification
cdumez@apple.com [Wed, 18 Oct 2017 16:59:52 +0000 (16:59 +0000)]
Align ImageData constructor with the specification
https://bugs.webkit.org/show_bug.cgi?id=178406

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline test now that one more check is passing.

* web-platform-tests/html/semantics/embedded-content/the-canvas-element/imagedata-expected.txt:

Source/WebCore:

Align ImageData constructor with the specification:
- https://html.spec.whatwg.org/multipage/canvas.html#dom-imagedata

It sometimes throws the wrong exception.

No new tests, rebaselined existing test.

* html/ImageData.cpp:
(WebCore::ImageData::create):
* html/ImageData.h:
* html/ImageData.idl:

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

22 months agoUnreviewed, fix build error after r223608 with some SDKs.
cdumez@apple.com [Wed, 18 Oct 2017 16:54:36 +0000 (16:54 +0000)]
Unreviewed, fix build error after r223608 with some SDKs.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::ensureSWOriginStoreForSession):

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

22 months ago[GTK] Test gardening.
Ms2ger@igalia.com [Wed, 18 Oct 2017 16:20:19 +0000 (16:20 +0000)]
[GTK] Test gardening.
https://bugs.webkit.org/show_bug.cgi?id=178461

Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

22 months agoAdd an efficient data structure for WebCore to query if there is a Service Worker...
cdumez@apple.com [Wed, 18 Oct 2017 16:12:11 +0000 (16:12 +0000)]
Add an efficient data structure for WebCore to query if there is a Service Worker registered for a given origin
https://bugs.webkit.org/show_bug.cgi?id=177876
<rdar://problem/34813129>

Reviewed by Ryosuke Niwa.

Source/WebCore:

No new tests, updatdd existing test.

* dom/Document.h:
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegisteredForOrigin):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::startServiceWorkerContext):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::scriptContextStarted):
(WebCore::SWServer::scriptContextStarted):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextFailedToStart):
(WebCore::SWServerRegistration::scriptContextStarted):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Introduce a Service Worker origin store which gets populated / updated on the StorageProcess side
and queried on the WebContent process side via the WebSWOriginTable so that the WebProcess can
efficiently check if there is a ServiceWorker registered for a given origin without actually doing
an IPC to the StorageProcess.

For efficiency, the hash table is backed by SharedMemory so we only pass shared memory handles
between the StorageProcess and the WebProcesses.

We currently add entries to the WebSWOriginStore whenever a service worker registration succeeds
on the StorageProcess side. We also clear this store whenever the API to clear service worker
registrations is called. Code to query the WebSWOriginTable from the WebContent process side is
there but currently only used by Internals for testing. We will later leverage this code when
integrating with Fetch API.

* CMakeLists.txt:
* Shared/SharedStringHashStore.h:
(WebKit::SharedStringHashStore::Client::didUpdateSharedStringHashes):
* Shared/SharedStringHashTable.cpp:
(WebKit::SharedStringHashTable::clear):
* StorageProcess/ServiceWorker/WebSWOriginStore.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
(WebKit::WebSWOriginStore::WebSWOriginStore):
(WebKit::WebSWOriginStore::add):
(WebKit::WebSWOriginStore::remove):
(WebKit::WebSWOriginStore::clear):
(WebKit::WebSWOriginStore::registerSWServerConnection):
(WebKit::WebSWOriginStore::unregisterSWServerConnection):
(WebKit::WebSWOriginStore::sendStoreHandle):
(WebKit::WebSWOriginStore::didInvalidateSharedMemory):
* StorageProcess/ServiceWorker/WebSWOriginStore.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::resolveJobInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
(WebKit::WebSWServerConnection::sessionID const):
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::deleteWebsiteData):
(WebKit::StorageProcess::deleteWebsiteDataForOrigins):
(WebKit::StorageProcess::ensureSWOriginStoreForSession):
(WebKit::StorageProcess::swOriginStoreForSession const):
(WebKit::StorageProcess::serviceWorkerContextStarted):
(WebKit::StorageProcess::registerSWServerConnection):
(WebKit::StorageProcess::unregisterSWServerConnection):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
(WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const):
(WebKit::WebSWClientConnection::setSWOriginTableSharedMemory):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:
* WebProcess/Storage/WebSWOriginTable.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
(WebKit::WebSWOriginTable::contains const):
(WebKit::WebSWOriginTable::setSharedMemory):
* WebProcess/Storage/WebSWOriginTable.h: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h.
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Storage/WebToStorageProcessConnection.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::startServiceWorkerContext):

Tools:

Clear service worker registrations between test runs to avoid flakiness.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

LayoutTests:

Add layout test coverage. Also rebaseline a few tests now that registration succeeds.

* http/tests/workers/service/basic-register-exceptions-expected.txt:
* http/tests/workers/service/basic-register-expected.txt:
* http/tests/workers/service/registration-task-queue-scheduling-1-expected.txt:
* http/tests/workers/service/resources/basic-register.js:
* http/tests/workers/service/resources/registration-task-queue-scheduling-1.js:

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

22 months ago[Settings] Replace macros in Settings.h/cpp with generated code
commit-queue@webkit.org [Wed, 18 Oct 2017 15:16:35 +0000 (15:16 +0000)]
[Settings] Replace macros in Settings.h/cpp with generated code
https://bugs.webkit.org/show_bug.cgi?id=178419

Patch by Sam Weinig <sam@webkit.org> on 2017-10-18
Reviewed by Antti Koivisto.

* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py:
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py:

    Rather than use macros in the generated Settings class, generate the code the macros
    would expand to.

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

22 months agoREGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
annulen@yandex.ru [Wed, 18 Oct 2017 14:57:13 +0000 (14:57 +0000)]
REGRESSION(r217771): nullTerminatedWCharToString loses last character of input string
https://bugs.webkit.org/show_bug.cgi?id=178444

Reviewed by Per Arne Vollan.

* wtf/text/win/WCharStringExtras.h:
(WTF::nullTerminatedWCharToString):

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

22 months ago[FrameView::layout cleanup] Move frame flattening layout logic to a separate function
zalan@apple.com [Wed, 18 Oct 2017 14:18:24 +0000 (14:18 +0000)]
[FrameView::layout cleanup] Move frame flattening layout logic to a separate function
https://bugs.webkit.org/show_bug.cgi?id=178425
<rdar://problem/35045836>

Reviewed by Antti Koivisto.

No change in functionality.

* page/FrameView.cpp:
(WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
(WebCore::FrameView::layout):
(WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
* page/FrameView.h:

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

22 months agoResolve ::before and ::after pseudo elements during style resolution
antti@apple.com [Wed, 18 Oct 2017 13:41:04 +0000 (13:41 +0000)]
Resolve ::before and ::after pseudo elements during style resolution
https://bugs.webkit.org/show_bug.cgi?id=178339
Source/WebCore:

Reviewed by Ryosuke Niwa.

They are currently resolved during render tree building which creates problems with display:contents and animations.

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

    Call InspectorInstrumentation from constructor.

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::pushParent):

    Push the full update to the parent stack.

(WebCore::RenderTreeUpdater::popParent):
(WebCore::RenderTreeUpdater::updateBeforeDescendants):
(WebCore::RenderTreeUpdater::updateAfterDescendants):
(WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
* style/RenderTreeUpdater.h:
* style/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):

    No need to resolve pseudo style, we have it already.

(WebCore::RenderTreeUpdater::GeneratedContent::needsPseudoElement):
(WebCore::RenderTreeUpdater::GeneratedContent::updateBeforePseudoElement): Deleted.
(WebCore::RenderTreeUpdater::GeneratedContent::updateAfterPseudoElement): Deleted.
* style/RenderTreeUpdaterGeneratedContent.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::resolvePseudoStyle):

    Resolve pseudos.

(WebCore::Style::TreeResolver::createAnimatedElementUpdate):

    Make a private member function.

(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleTreeResolver.h:
* style/StyleUpdate.cpp:
(WebCore::Style::Update::elementUpdates const):
(WebCore::Style::Update::elementUpdates):

    Bundle the style update for an element and the associated before/after pseudos.

(WebCore::Style::Update::elementStyle const):
(WebCore::Style::Update::elementStyle):
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::elementUpdate const): Deleted.
(WebCore::Style::Update::elementUpdate): Deleted.
* style/StyleUpdate.h:

LayoutTests:

<rdar://problem/35025601>

Reviewed by Ryosuke Niwa.

Add a test verifying a crash noticed with earlier version of this patch.

* fast/css-generated-content/svg-use-crash-expected.html: Added.
* fast/css-generated-content/svg-use-crash.html: Added.

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

22 months ago[JSC] Remove unused private name structure
utatane.tea@gmail.com [Wed, 18 Oct 2017 12:53:30 +0000 (12:53 +0000)]
[JSC] Remove unused private name structure
https://bugs.webkit.org/show_bug.cgi?id=178436

Reviewed by Sam Weinig.

It is no longer used. This patch just removes it.

* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::numberObjectStructure const):
(JSC::JSGlobalObject::privateNameStructure const): Deleted.

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

22 months agoUpdate the signatures of texSubImage3D.
Ms2ger@igalia.com [Wed, 18 Oct 2017 12:47:17 +0000 (12:47 +0000)]
Update the signatures of texSubImage3D.
https://bugs.webkit.org/show_bug.cgi?id=178435

Reviewed by Sam Weinig.

Update the signatures of texSubImage3D.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

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

22 months agoRemove remnants of OpenWebRTC
zandobersek@gmail.com [Wed, 18 Oct 2017 12:04:10 +0000 (12:04 +0000)]
Remove remnants of OpenWebRTC
https://bugs.webkit.org/show_bug.cgi?id=178437

Reviewed by Alejandro G. Castro.

.:

Remove the FindOpenWebRTC.cmake file and the searches for it in both
OptionsGTK and OptionsWPE.

* Source/cmake/FindOpenWebRTC.cmake: Removed.
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Tools:

Drop OpenWebRTC packages from the GTK's Jhbuild modules file. Relevant
patches are also removed.

* gtk/jhbuild.modules:
* gtk/patches/libnice-0001-TURN-allow-REALM-to-be-empty.patch: Removed.
* gtk/patches/libnice-0001-nicesrc-spin-the-agent-mainloop-in-a-separate-thread.patch: Removed.
* gtk/patches/rtspsrc-timeout-on-udpsrc-is-in-nanoseconds.patch: Removed.
* gtk/patches/udpsrc-improve-timeouts.patch: Removed.

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

22 months agoUse LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
commit-queue@webkit.org [Wed, 18 Oct 2017 11:05:40 +0000 (11:05 +0000)]
Use LazyNeverDestroyed instead of DEFINE_GLOBAL for WebKitFontFamilyNames
https://bugs.webkit.org/show_bug.cgi?id=175106

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-18
Reviewed by Yusuke Suzuki.

No new tests because there is no behavior change.

* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Call get() method of LazyNeverDestroyed.
* dom/make_names.pl: Use LazyNeverDestroyed for font names.

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

22 months ago[MSE] Move SourceBuffer's pending append data into the platform implementations
zandobersek@gmail.com [Wed, 18 Oct 2017 08:30:13 +0000 (08:30 +0000)]
[MSE] Move SourceBuffer's pending append data into the platform implementations
https://bugs.webkit.org/show_bug.cgi?id=178003

Reviewed by Jer Noble.

In SourceBuffer::appendBufferTimerFired(), we can use move semantics to
pass the pending append data into the platform layer, where it can then
be used more efficiently.

Resources in the m_pendingAppendData member are moved into the append()
call on the SourceBufferPrivate object. The m_pendingAppendData is still
cleared out manually in case the underlying implementation doesn't clear
it out through a move operation. The SourceBufferPrivate interface is
updated to accept a Vector rvalue reference as the only parameter of the
append() method.

For the GStreamer implementation, signature of the append() method in
MediaSourceClientGStreamerMSE class is also updated. The implementation
now moves the Vector resources over to a on-heap Vector object that is
then wrapped into a GstBuffer object by using the
gst_buffer_new_wrapped_full() API and specifying the custom deleter.

The AVFoundation implementation of SourceBufferPrivate is only updated
to reflect the changes in the interface. The Vector data that is passed
in is still copied into the NSData allocation.

MockSourceBufferPrivate is also updated, with the append data still
being copied into the m_inputBuffer Vector.

No new tests -- no change in behavior.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::appendBufferTimerFired):
* platform/graphics/SourceBufferPrivate.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::append):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::append):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::append):
* platform/mock/mediasource/MockSourceBufferPrivate.h:

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

22 months agoFix macOS and iOS builds after r223594.
rniwa@webkit.org [Wed, 18 Oct 2017 08:12:17 +0000 (08:12 +0000)]
Fix macOS and iOS builds after r223594.

* JavaScriptCore.xcodeproj/project.pbxproj:

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

22 months ago[JSC] __proto__ getter should be fast
utatane.tea@gmail.com [Wed, 18 Oct 2017 07:12:53 +0000 (07:12 +0000)]
[JSC] __proto__ getter should be fast
https://bugs.webkit.org/show_bug.cgi?id=178067

Reviewed by Saam Barati.

JSTests:

* stress/dfg-object-proto-accessor.js: Added.
(shouldBe):
(shouldThrow):
(target):
* stress/dfg-object-proto-getter.js: Added.
(shouldBe):
(shouldThrow):
(target):
* stress/dfg-object-prototype-of.js: Added.
(shouldBe):
(shouldThrow):
(target):
* stress/dfg-reflect-get-prototype-of.js: Added.
(shouldBe):
(shouldThrow):
(target):
* stress/intrinsic-getter-with-poly-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-get-prototype-of-filtered.js: Added.
(shouldBe):
(shouldThrow):
(target):
(i.Cocoa):
* stress/object-get-prototype-of-mono-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-get-prototype-of-poly-mono-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-get-prototype-of-poly-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-proto-getter-filtered.js: Added.
(shouldBe):
(shouldThrow):
(target):
(i.Cocoa):
* stress/object-proto-getter-poly-mono-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-proto-getter-poly-proto.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/object-prototype-proto-accessors-should-throw-on-undefined-this.js:
* stress/string-proto.js: Added.
(shouldBe):
(target):

Source/JavaScriptCore:

In our ES6 class implementation, we access __proto__ field to retrieve super constructor.
Currently, it is handled as an usual getter call to a generic function. And DFG just emits
Call node for this. It is inefficient since typically we know the `prototype` of the given
object when accessing `object.__proto__` since we emit CheckStructure for this `object`.
If Structure has mono proto, we can immediately fold it to constant value. If it is poly proto,
we can still change this to efficient access to poly proto slot.

This patch implements GetPrototypeOf DFG node. This node efficiently accesses to prototype of
the given object. And in AI and ByteCodeParser phase, we attempt to fold it to constant.
ByteCodeParser's folding is a bit important since we have `callee.__proto__` code to get super
constructor. If we can change this to constant, we can reify CallLinkInfo with this constant.
This paves the way to optimizing ArrayConstructor super calls[1], which is particularly important
for ARES-6 ML.

And we also optimize Reflect.getPrototypeOf and Object.getPrototypeOf with this GetPrototypeOf node.

Currently, __proto__ access for poly proto object is not handled well in IC. But we add code handling
poly proto in GetPrototypeOf since Reflect.getPrototypeOf and Object.getPrototypeOf can use it.
Once IC starts handling poly proto & intrinsic getter well, this code will be used for that too.

This patch improves SixSpeed super.es6 by 3.42x.

                         baseline                  patched

super.es6           123.6666+-3.9917     ^     36.1684+-1.0351        ^ definitely 3.4192x faster

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

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::handleIntrinsicGetter):
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupGetPrototypeOf):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::shouldSpeculateFunction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculateFunction):
(JSC::DFG::SpeculativeJIT::speculateFinalObject):
(JSC::DFG::SpeculativeJIT::compileGetPrototypeOf):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileGetPrototypeOf):
(JSC::FTL::DFG::LowerDFGToB3::compileInstanceOf):
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::canEmitIntrinsicGetter):
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/JITOperations.h:
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::booleanPrototype const):
(JSC::JSGlobalObject::numberPrototype const):
(JSC::JSGlobalObject::booleanObjectStructure const):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncProtoGetter):
* runtime/JSGlobalObjectFunctions.h:
* runtime/ObjectConstructor.cpp:
* runtime/ReflectObject.cpp:

LayoutTests:

* js/object-literal-shorthand-construction-expected.txt:
* js/script-tests/object-literal-shorthand-construction.js:
(set 2):
(get 1):
* js/script-tests/sloppy-getter-setter-global-object.js:
* js/sloppy-getter-setter-global-object-expected.txt:

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

22 months ago[FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout...
zalan@apple.com [Wed, 18 Oct 2017 01:42:26 +0000 (01:42 +0000)]
[FrameView::layout cleanup] Remove redundant body->renderer()->setChildNeedsLayout() call
https://bugs.webkit.org/show_bug.cgi?id=178414
<rdar://problem/35040876>

Reviewed by Simon Fraser.

Since m_size always equals to layoutSize() at this point, we never call setChildNeedsLayout() on the body's renderer.
However a few lines below, when we adjust the frame size and check if oldSize != m_size, we actually
dirty the body's renderer.

Covered by existing tests.

* page/FrameView.cpp:
(WebCore::FrameView::layout):

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

22 months ago[Regression] Webkit "-apple-system" font fallback token handles font weights of PingF...
mmaxfield@apple.com [Wed, 18 Oct 2017 00:34:23 +0000 (00:34 +0000)]
[Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Reviewed by Jon Lee.

Source/WebCore:

This bug has a fairly insideous cause. In particular, the system font fallback path follows
system conventions, which are not the same as the CSS fallback path. For example, the Chinese
fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
and expected, and we shouldn't synthesize bold in this situation.

Test: fast/text/system-ui-chinese-bold-fallback.html

* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges const):

LayoutTests:

* fast/text/system-ui-chinese-bold-fallback.html:

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

22 months agoVersioning.
jmarcell@apple.com [Wed, 18 Oct 2017 00:06:54 +0000 (00:06 +0000)]
Versioning.

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

22 months agowebgl/1.0.2/conformance/canvas/drawingbuffer-static-canvas-test.html failing
dino@apple.com [Wed, 18 Oct 2017 00:05:15 +0000 (00:05 +0000)]
webgl/1.0.2/conformance/canvas/drawingbuffer-static-canvas-test.html failing
https://bugs.webkit.org/show_bug.cgi?id=178417
<rdar://problem/35042291>

Skip this test while I work out what causes it to fail on older hardware.

* TestExpectations:

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

22 months agoYou can't vmDeallocate null
fpizlo@apple.com [Tue, 17 Oct 2017 23:49:40 +0000 (23:49 +0000)]
You can't vmDeallocate null
<rdar://problem/35038926>

Reviewed by Michael Saboff.

After failing allocation, we would try to deallocate the thing we failed to allocate. The fix is to
not try to deallocate something that is obviously null.

* bmalloc/Gigacage.cpp:
(Gigacage::ensureGigacage):

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

22 months ago[iOS] Don't turn fields yellow after filling credentials
cpugh@apple.com [Tue, 17 Oct 2017 23:38:26 +0000 (23:38 +0000)]
[iOS] Don't turn fields yellow after filling credentials
https://bugs.webkit.org/show_bug.cgi?id=178411

Reviewed by Wenson Hsieh.

* editing/ios/AutofillElements.cpp:
(WebCore::AutofillElements::autofill): We don't want to turn fields yellow when filling the user name
and password. Remove the code that was causing that to happen.

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

22 months agoUnreviewed, rolling out r223523.
ryanhaddad@apple.com [Tue, 17 Oct 2017 23:34:29 +0000 (23:34 +0000)]
Unreviewed, rolling out r223523.

A test for this change is failing on debug JSC bots.

Reverted changeset:

"[JSC] __proto__ getter should be fast"
https://bugs.webkit.org/show_bug.cgi?id=178067
https://trac.webkit.org/changeset/223523

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

22 months agoFix the Sierra build after r223580.
aestes@apple.com [Tue, 17 Oct 2017 23:10:09 +0000 (23:10 +0000)]
Fix the Sierra build after r223580.

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):

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

22 months agoMark fast/text/ellipsis-text-rtl.html as a failure on Windows.
pvollan@apple.com [Tue, 17 Oct 2017 23:03:48 +0000 (23:03 +0000)]
Mark fast/text/ellipsis-text-rtl.html as a failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=178413

Unreviewed test gardening.

* platform/win/TestExpectations:

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

22 months ago[Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and...
aestes@apple.com [Tue, 17 Oct 2017 21:41:57 +0000 (21:41 +0000)]
[Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact and ApplePayError
https://bugs.webkit.org/show_bug.cgi?id=178191
<rdar://problem/34906367>

Reviewed by Tim Horton.

Source/WebCore:

Added test cases to http/tests/ssl/applepay/ApplePaySession.html.

* Modules/applepay/ApplePayError.idl:
* Modules/applepay/ApplePayPaymentContact.h:
* Modules/applepay/ApplePayPaymentContact.idl:
* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):
(WebCore::convert):

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toNSError):

LayoutTests:

* http/tests/ssl/applepay/ApplePayError-expected.txt:
* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:

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

22 months agoUnreviewed, rolling out r223500.
commit-queue@webkit.org [Tue, 17 Oct 2017 21:29:27 +0000 (21:29 +0000)]
Unreviewed, rolling out r223500.
https://bugs.webkit.org/show_bug.cgi?id=178408

Introduced a crash in CSSAnimationController::updateAnimations
(Requested by rniwa on #webkit).

Reverted changeset:

"Resolve ::before and ::after pseudo elements during style
resolution"
https://bugs.webkit.org/show_bug.cgi?id=178339
https://trac.webkit.org/changeset/223500

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

22 months agoDelete button doesn't fully delete certain emoji
mmaxfield@apple.com [Tue, 17 Oct 2017 21:21:32 +0000 (21:21 +0000)]
Delete button doesn't fully delete certain emoji
https://bugs.webkit.org/show_bug.cgi?id=178096
<rdar://problem/34785106>

Reviewed by Simon Fraser.

Source/WebCore:

System infrastructure for handling emoji changes every year. Instead of having
custom code to specifically walk over codepoints, we should delegate to the
system handling.

Tests: editing/deleting/delete-emoji.html
       editing/deleting/delete-emoji-1.html
       editing/deleting/delete-emoji-2.html
       editing/deleting/delete-emoji-3.html
       editing/deleting/delete-emoji-4.html
       editing/deleting/delete-emoji-5.html
       editing/deleting/delete-emoji-6.html
       editing/deleting/delete-emoji-7.html
       editing/deleting/delete-emoji-8.html
       editing/deleting/delete-emoji-9.html

* rendering/RenderText.cpp:
(WebCore::RenderText::previousOffset const):
(WebCore::RenderText::previousOffsetForBackwardDeletion const):
(WebCore::RenderText::nextOffset const):
(WebCore::isHangulLVT): Deleted.
(WebCore::isMark): Deleted.
(WebCore::isRegionalIndicator): Deleted.
(WebCore::isInArmenianToLimbuRange): Deleted.

LayoutTests:

* editing/deleting/delete-emoji-1.html: Added.
* editing/deleting/delete-emoji-2.html: Added.
* editing/deleting/delete-emoji-3.html: Added.
* editing/deleting/delete-emoji-4.html: Added.
* editing/deleting/delete-emoji-5.html: Added.
* editing/deleting/delete-emoji-6.html: Added.
* editing/deleting/delete-emoji-7.html: Added.
* editing/deleting/delete-emoji-8.html: Added.
* editing/deleting/delete-emoji-9.html: Added.
* editing/deleting/delete-emoji.html:
* platform/ios/editing/deleting/delete-emoji-1-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-2-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-3-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-4-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-5-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-6-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-7-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-8-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-9-expected.txt: Added.
* platform/ios/editing/deleting/delete-emoji-expected.txt:
* platform/mac-elcapitan/editing/deleting/delete-emoji-2-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-3-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-4-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-5-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-6-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-7-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-8-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-9-expected.txt: Added.
* platform/mac-elcapitan/editing/deleting/delete-emoji-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-1-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-2-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-3-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-4-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-5-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-6-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-7-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-8-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-9-expected.txt: Added.
* platform/mac-sierra/editing/deleting/delete-emoji-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-1-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-2-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-3-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-4-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-5-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-6-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-7-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-8-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-9-expected.txt: Added.
* platform/mac/editing/deleting/delete-emoji-expected.txt:
* platform/win/TestExpectations:

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

22 months agoAdd preliminary support for fetch event
commit-queue@webkit.org [Tue, 17 Oct 2017 21:19:38 +0000 (21:19 +0000)]
Add preliminary support for fetch event
https://bugs.webkit.org/show_bug.cgi?id=178171

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-17

* workers/service/FetchEvent.cpp:
(WebCore::FetchEvent::promiseIsSettled): build fix by removing unnecessary captured this at the moment.

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

22 months ago[CSS Font Loading] Fonts are erroneously invisible when the policy says they should...
mmaxfield@apple.com [Tue, 17 Oct 2017 21:16:42 +0000 (21:16 +0000)]
[CSS Font Loading] Fonts are erroneously invisible when the policy says they should be visible
https://bugs.webkit.org/show_bug.cgi?id=178238

Reviewed by Simon Fraser.

When implementing font-display, I added testing infrastructure (so we don't have to wait for
3 second timeouts to occur). This testing infrastructure covered up a real bug where the wrong
font would be reported to CSSFontAccessor. This patch reverts the erroneous testing
infrastructure and replaces it with a real fix to the problem. The replacement fix is covered
by the same tests that I wrote when implementing the feature.

Covered by existing tests.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::pump):
(WebCore::visibility):
(WebCore::CSSFontFace::font):

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

22 months agoWeb Inspector: [PARITY] Styles Redesign: Add color picker inline widget
nvasilyev@apple.com [Tue, 17 Oct 2017 20:55:23 +0000 (20:55 +0000)]
Web Inspector: [PARITY] Styles Redesign: Add color picker inline widget
https://bugs.webkit.org/show_bug.cgi?id=178354

Reviewed by Joseph Pecoraro.

Show color picker using the existing WI.InlineSwatch.

* UserInterface/Models/Color.js:
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:not(.disabled) .token-comment):
Syntax highlight comments in values.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._renderValue):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
Find colors in CodeMirror tokens and replace them with color token elements.

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

22 months ago[Settings] Generate Settings.h/cpp
weinig@apple.com [Tue, 17 Oct 2017 20:45:36 +0000 (20:45 +0000)]
[Settings] Generate Settings.h/cpp
https://bugs.webkit.org/show_bug.cgi?id=178361

Reviewed by Dean Jackson.

Source/WebCore:

This change generates Settings.h and Settings.cpp exactly as they are,
using SettingsMacros.h and everything. In follow up changes, the use of
SettingsMacros.h will be removed.

* CMakeLists.txt:
* DerivedSources.make:
* Scripts/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettings.py:
* Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Added.
* Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Added.
* WebCore.xcodeproj/project.pbxproj:
* WebCoreMacros.cmake:
* page/Settings.cpp: Removed.
* page/Settings.h: Removed.

Source/WebKit:

* PlatformGTK.cmake:
* PlatformWPE.cmake:

    Delete the old Settings.h from the forwarding
    headers directory to allow the build to work.

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

22 months agoCreate bindings for WebGL2's versions of texSubImage2D.
Ms2ger@igalia.com [Tue, 17 Oct 2017 20:35:22 +0000 (20:35 +0000)]
Create bindings for WebGL2's versions of texSubImage2D.
https://bugs.webkit.org/show_bug.cgi?id=178382

Reviewed by Ryosuke Niwa.

Create bindings for WebGL2's versions of texSubImage2D.

No new tests: not much point in adding tests now; this method doesn't
do anything anyway.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.idl:

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

22 months agowebkitpy: Hang when workers write to the same stack trace file
jbedard@apple.com [Tue, 17 Oct 2017 20:30:18 +0000 (20:30 +0000)]
webkitpy: Hang when workers write to the same stack trace file
https://bugs.webkit.org/show_bug.cgi?id=178402
<rdar://problem/35033432>

Reviewed by Aakash Jain.

Workers can hang if they all write to the same stack trace file when receiving
a SIGTERM. Attach the pid to the stack trace file name so that each worker
writes to a different file.

* Scripts/webkitpy/common/interupt_debugging.py:
(log_stack_trace_on_term.handler): Name stack trace file path/<pid>-filename.
(log_stack_trace_on_cntrl_c.handler): Ditto.

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

22 months agoSkip service workers tests on Windows.
pvollan@apple.com [Tue, 17 Oct 2017 20:24:13 +0000 (20:24 +0000)]
Skip service workers tests on Windows.

Unreviewed test gardening.

* platform/win/TestExpectations:

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

22 months agoMark animations/play-state-suspend.html as flaky on Windows.
pvollan@apple.com [Tue, 17 Oct 2017 20:18:21 +0000 (20:18 +0000)]
Mark animations/play-state-suspend.html as flaky on Windows.
https://bugs.webkit.org/show_bug.cgi?id=178341

Unreviewed test gardening.

* platform/win/TestExpectations:

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

22 months ago[FrameView::layout cleanup] Subtree should read subtreeLayout.
zalan@apple.com [Tue, 17 Oct 2017 20:09:15 +0000 (20:09 +0000)]
[FrameView::layout cleanup] Subtree should read subtreeLayout.
https://bugs.webkit.org/show_bug.cgi?id=178401

Reviewed by Simon Fraser.

Rename some variables to improve readability.

No change in functionality.

* page/FrameView.cpp:
(WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::~SubtreeLayoutStateMaintainer):
(WebCore::SubtreeLayoutStateMaintainer::shouldDisableLayoutStateForSubtree):
(WebCore::FrameView::reset):
(WebCore::FrameView::willDestroyRenderTree):
(WebCore::FrameView::didDestroyRenderTree):
(WebCore::FrameView::calculateScrollbarModesForLayout):
(WebCore::FrameView::layout):
(WebCore::FrameView::convertSubtreeLayoutToFullLayout):
(WebCore::FrameView::scheduleRelayout):
(WebCore::FrameView::scheduleRelayoutOfSubtree):
(WebCore::FrameView::needsLayout const):
(WebCore::FrameView::autoSizeIfEnabled):
* page/FrameView.h:

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

22 months agoWebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
dino@apple.com [Tue, 17 Oct 2017 19:17:33 +0000 (19:17 +0000)]
WebGL clamps drawingBufferWidth to 4096 pixels on a 5120 monitor/canvas
https://bugs.webkit.org/show_bug.cgi?id=178223
<rdar://problem/34597567>

Reviewed by Antoine Quint.

Source/WebCore:

Remove the limit of 4k on the width/height of the renderbuffer.

Test: fast/canvas/webgl/large-drawing-buffer-resize.html

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::reshape):

LayoutTests:

Test that resizes an already large buffer to make sure it
doesn't get clamped to 4k.

* fast/canvas/webgl/large-drawing-buffer-resize-expected.txt: Added.
* fast/canvas/webgl/large-drawing-buffer-resize.html: Added.

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

22 months agoRoll out r223447.
aestes@apple.com [Tue, 17 Oct 2017 19:04:22 +0000 (19:04 +0000)]
Roll out r223447.

Broke the Sierra build.

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

22 months agoAdd and remove cookie partition accordingly in intermediary redirect requests
wilander@apple.com [Tue, 17 Oct 2017 18:57:21 +0000 (18:57 +0000)]
Add and remove cookie partition accordingly in intermediary redirect requests
https://bugs.webkit.org/show_bug.cgi?id=178369
<rdar://problem/34467603>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
       http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html

* loader/ResourceLoadObserver.h:
    Now exposes notifyObserver() so that it can be triggered
    by the TestRunner.
    Removed unimplemented ResourceLoadObserver::setShouldThrottleObserverNotifications().

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::shouldChangePartition):
    Convenience function. Comment documents the logic.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now adds and removes cookie partition based on the
    redirect-to URL's domain.
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleResourceLoadStatisticsNotifyObserver):
    Test infrastructure.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:

Tools:

Adds the function statisticsNotifyObserver().

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::statisticsNotifyObserver):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsNotifyObserver):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

This patch adds two new tests, relevant for the code change.
Also makes changes to existing tests to increase speed and
reliability.

* http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html: Added.
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html: Added.
* http/tests/resourceLoadStatistics/resources/get-cookies.php: Added.
* http/tests/resourceLoadStatistics/resources/redirect.php:
* http/tests/resourceLoadStatistics/resources/set-cookie.php: Added.
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* platform/ios/TestExpectations:
    The two new tests are marked [ Pass ].
* platform/mac-wk2/TestExpectations:
    The two new tests are marked [ Pass ].
* platform/wk2/TestExpectations:
    The two new tests are marked [ Skip ] because they require cookie partitioning.

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

22 months agoCorrupted image after looping movie-backed <img>.
jer.noble@apple.com [Tue, 17 Oct 2017 18:53:52 +0000 (18:53 +0000)]
Corrupted image after looping movie-backed <img>.
https://bugs.webkit.org/show_bug.cgi?id=178398

Reviewed by Eric Carlson.

Use the decode-order sample cursor rather than the destination sample cursor when generating
the CMSampleBuffer to decode.

* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):

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

22 months agoUnreviewed, rolling out r223459.
ryanhaddad@apple.com [Tue, 17 Oct 2017 18:49:11 +0000 (18:49 +0000)]
Unreviewed, rolling out r223459.

This change introduced LayoutTest failures.

Reverted changeset:

"WebGL clamps drawingBufferWidth to 4096 pixels on a 5120
monitor/canvas"
https://bugs.webkit.org/show_bug.cgi?id=178223
https://trac.webkit.org/changeset/223459

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