1 2018-05-02 Zalan Bujtas <zalan@apple.com>
3 [LFC] Implement LayoutContext::createDisplayBox
4 https://bugs.webkit.org/show_bug.cgi?id=185158
6 Reviewed by Antti Koivisto.
8 Now compute*() functions take both the const layout and the corresponding non-const display boxes.
9 Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
10 (This might need to change in the future if we decide to arrange them in some sort of painting order)
12 * layout/FloatingContext.cpp:
13 (WebCore::Layout::FloatingContext::computePosition):
14 * layout/FloatingContext.h:
15 * layout/FormattingContext.cpp:
16 (WebCore::Layout::FormattingContext::computeStaticPosition const):
17 (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
18 (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
19 (WebCore::Layout::FormattingContext::computeWidth const):
20 (WebCore::Layout::FormattingContext::computeHeight const):
21 (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
22 (WebCore::Layout::FormattingContext::computeFloatingWidth const):
23 (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
24 (WebCore::Layout::FormattingContext::computeFloatingHeight const):
25 * layout/FormattingContext.h:
26 * layout/LayoutContext.cpp:
27 (WebCore::Layout::LayoutContext::createDisplayBox):
28 * layout/LayoutContext.h:
29 (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
30 * layout/blockformatting/BlockFormattingContext.cpp:
31 (WebCore::Layout::BlockFormattingContext::layout const):
32 (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
33 (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
34 (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
35 * layout/blockformatting/BlockFormattingContext.h:
36 * layout/displaytree/DisplayBox.h:
37 (WebCore::Display::Box::parent const): Deleted.
38 (WebCore::Display::Box::nextSibling const): Deleted.
39 (WebCore::Display::Box::previousSibling const): Deleted.
40 (WebCore::Display::Box::firstChild const): Deleted.
41 (WebCore::Display::Box::lastChild const): Deleted.
42 (WebCore::Display::Box::setParent): Deleted.
43 (WebCore::Display::Box::setNextSibling): Deleted.
44 (WebCore::Display::Box::setPreviousSibling): Deleted.
45 (WebCore::Display::Box::setFirstChild): Deleted.
46 (WebCore::Display::Box::setLastChild): Deleted.
48 * layout/inlineformatting/InlineFormattingContext.cpp:
49 (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
50 (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
51 * layout/inlineformatting/InlineFormattingContext.h:
53 2018-05-02 Said Abou-Hallawa <sabouhallawa@apple.com>
55 Hiding then showing an <object> of type image makes the underlaying image disappear
56 https://bugs.webkit.org/show_bug.cgi?id=185216
57 <rdar://problem/39055630>
59 Reviewed by Youenn Fablet.
61 Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
62 RenderImage with the CachedImage of its ImageLoader when the RenderImage
65 Test: fast/images/object-image-hide-show.html
67 * html/HTMLPlugInImageElement.cpp:
68 (WebCore::HTMLPlugInImageElement::didAttachRenderers):
69 This is very similar to what we do in HTMLImageElement::didAttachRenderers().
72 2018-05-02 Brent Fulgham <bfulgham@apple.com>
74 Use RetainPtr for form input type
75 https://bugs.webkit.org/show_bug.cgi?id=185210
76 <rdar://problem/39734040>
78 Reviewed by Ryosuke Niwa.
80 Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
82 Test: fast/forms/access-key-mutation-2.html.
84 * html/HTMLInputElement.cpp:
85 (WebCore::HTMLInputElement::HTMLInputElement):
86 (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
87 (WebCore::HTMLInputElement::accessKeyAction):
88 (WebCore::HTMLInputElement::parseAttribute):
89 (WebCore::HTMLInputElement::appendFormData):
90 * html/HTMLInputElement.h:
92 (WebCore::createInputType):
93 (WebCore::InputType::create):
94 (WebCore::InputType::createText):
97 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
99 Use pointer instead of std::optional<std::reference_wrapper<>>
100 https://bugs.webkit.org/show_bug.cgi?id=185186
102 Reviewed by Alex Christensen.
104 std::optional<T&> is not accepted in C++17 spec. So we replaced it
105 with std::optional<std::reference_wrapper<T>>.
107 In this patch, we replace it with T*, which is well-aligned to
110 * Modules/mediastream/RTCPeerConnection.cpp:
111 (WebCore::iceServersFromConfiguration):
112 (WebCore::RTCPeerConnection::initializeConfiguration):
113 (WebCore::RTCPeerConnection::setConfiguration):
114 * css/parser/CSSParser.cpp:
115 (WebCore::CSSParser::parseSystemColor):
116 * css/parser/CSSParser.h:
117 * dom/DatasetDOMStringMap.cpp:
118 (WebCore::DatasetDOMStringMap::item const):
119 (WebCore::DatasetDOMStringMap::namedItem const):
120 * dom/DatasetDOMStringMap.h:
122 (WebCore::Element::insertAdjacentHTML):
124 * html/canvas/CanvasStyle.cpp:
125 (WebCore::parseColor):
126 * inspector/DOMEditor.cpp:
127 * platform/network/curl/CurlFormDataStream.cpp:
128 (WebCore::CurlFormDataStream::getPostData):
129 * platform/network/curl/CurlFormDataStream.h:
130 * platform/network/curl/CurlRequest.cpp:
131 (WebCore::CurlRequest::setupPOST):
132 * testing/MockCDMFactory.cpp:
133 (WebCore::MockCDMFactory::keysForSessionWithID const):
134 (WebCore::MockCDMInstance::updateLicense):
135 * testing/MockCDMFactory.h:
137 2018-05-02 Keith Rollin <krollin@apple.com>
139 Add facility for tracking times and results of page and resource loading
140 https://bugs.webkit.org/show_bug.cgi?id=184838
141 <rdar://problem/36548974>
143 Reviewed by Brent Fulgham.
145 Update FrameProgressTracker to send the necessary page load start/stop
146 signals so that we can track the entire page load at a network level.
147 Add an empty override of the pure virtual
148 LoaderStrategy::pageLoadCompleted method.
150 No new tests. There is no testable effect from these changes. On
151 Cocoa, measurable changes take place in another (non-WebKit) process.
152 On non-Cocoa systems, this facility is currently disabled.
154 * loader/FrameLoader.cpp:
155 (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
156 * loader/LoaderStrategy.h:
158 2018-05-02 Aditya Keerthi <akeerthi@apple.com>
160 Can't copy and paste URLs that have no title into Mail (macOS)
161 https://bugs.webkit.org/show_bug.cgi?id=185205
162 <rdar://problem/36352406>
164 Reviewed by Tim Horton.
166 The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
168 To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.
170 Augmented WebKitLegacy.ContextMenuCanCopyURL test
172 * platform/mac/PasteboardMac.mm:
173 (WebCore::writeURLForTypes):
175 2018-05-01 Ryosuke Niwa <rniwa@webkit.org>
177 REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
178 https://bugs.webkit.org/show_bug.cgi?id=182188
179 <rdar://problem/36689240>
181 Reviewed by Antti Koivisto.
183 Fixed the crash by removing up the release assert.
185 The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
186 Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
187 without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
188 in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
189 invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
190 whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
192 There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
193 true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
194 this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
196 This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
197 since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
198 and there is no evidence that r225868 has led to new UAFs even after five months.
200 No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
203 (WebCore::Document::removeSVGUseElement):
205 2018-05-02 Dirk Schulze <dschulze@chromium.org>
207 getCharNumAtPosition should take DOMPointInit as argument
208 https://bugs.webkit.org/show_bug.cgi?id=184695
210 Reviewed by Antti Koivisto.
212 Extend existing tests for getCharNumAtPosition.
214 * svg/SVGTextContentElement.cpp:
215 (WebCore::SVGTextContentElement::getCharNumAtPosition):
216 * svg/SVGTextContentElement.h:
217 * svg/SVGTextContentElement.idl: Use DOMPointInit argument.
219 2018-05-02 Youenn Fablet <youenn@apple.com>
221 Use NetworkLoadChecker for navigation loads
222 https://bugs.webkit.org/show_bug.cgi?id=184892
223 <rdar://problem/39652686>
225 Reviewed by Chris Dumez.
227 Sanitize headers according response tainting.
228 If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
229 If tainting is Opaque, we filter all uncommon headers.
230 If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
231 Covered by updated test.
233 * platform/network/ResourceResponseBase.cpp:
234 (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
235 (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
236 * platform/network/ResourceResponseBase.h:
238 2018-05-02 Myles C. Maxfield <mmaxfield@apple.com>
240 Collection fragment identifiers don't use PostScript names
241 https://bugs.webkit.org/show_bug.cgi?id=184624
242 <rdar://problem/39432089>
244 Reviewed by Simon Fraser.
246 In a previous version of the CSS Fonts spec, there was text saying that items in font collections
247 should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
248 inserting an item into the middle of a collection would throw off all content that uses the file.
249 Instead, the spec has since changed to use PostScript names (so the content instead would say
250 MyFonts.ttc#MyFont-Regular).
252 Test: fast/text/font-collection.html
254 * css/CSSFontFaceSource.cpp:
255 (WebCore::CSSFontFaceSource::load):
256 * loader/cache/CachedFont.cpp:
257 (WebCore::CachedFont::calculateItemInCollection const):
258 (WebCore::CachedFont::ensureCustomFontData):
259 (WebCore::CachedFont::createCustomFontData):
260 (WebCore::CachedFont::calculateIndex const): Deleted.
261 * loader/cache/CachedFont.h:
262 * platform/graphics/mac/FontCustomPlatformData.cpp:
263 (WebCore::createFontCustomPlatformData):
264 * platform/graphics/mac/FontCustomPlatformData.h:
266 2018-05-02 Brian Burg <bburg@apple.com>
268 Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
269 https://bugs.webkit.org/show_bug.cgi?id=184861
270 <rdar://problem/39153768>
272 Reviewed by Ryosuke Niwa.
274 Notify the client of the current connection count whenever a frontend connects or disconnects.
276 Covered by new API test.
278 * inspector/InspectorClient.h:
279 (WebCore::InspectorClient::frontendCountChanged):
280 * inspector/InspectorController.cpp:
281 (WebCore::InspectorController::connectFrontend):
282 (WebCore::InspectorController::disconnectFrontend):
283 (WebCore::InspectorController::disconnectAllFrontends):
284 * inspector/InspectorController.h:
286 2018-05-02 Carlos Alberto Lopez Perez <clopez@igalia.com>
288 [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
289 https://bugs.webkit.org/show_bug.cgi?id=185207
291 Reviewed by Michael Catanzaro.
293 Remove unneeded include of gstgldisplay_wayland.h
295 No new tests, no change in behaviour.
297 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
299 2018-05-02 Chris Dumez <cdumez@apple.com>
301 document.open() event listener removal is not immediate
302 https://bugs.webkit.org/show_bug.cgi?id=185191
304 Reviewed by Darin Adler.
306 We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
307 whenever they get removed from the EventListenerMap. We were doing so correctly
308 in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
309 updates clear() accordingly.
311 The reason we need to set this flag is that RegisteredEventListeners is RefCounted
312 and EventTarget::fireEventListeners() may be currently running and calling
313 each listener one by one, holding a reference to all listener of a given event.
315 Test: fast/dom/Document/document-open-removes-all-listeners.html
317 * dom/EventListenerMap.cpp:
318 (WebCore::EventListenerMap::clear):
320 2018-05-02 Zalan Bujtas <zalan@apple.com>
322 Use WeakPtr in GridCell
323 https://bugs.webkit.org/show_bug.cgi?id=185180
324 <rdar://problem/39432165>
326 Reviewed by Antti Koivisto.
328 Since GridCell does not own the renderers, it should
329 construct weak pointers.
331 Unable to create a reliably reproducible test case.
333 * rendering/Grid.cpp:
334 (WebCore::Grid::insert):
335 (WebCore::GridIterator::nextGridItem):
337 * rendering/RenderGrid.cpp:
338 (WebCore::RenderGrid::firstLineBaseline const):
340 2018-05-02 Eric Carlson <eric.carlson@apple.com>
342 [iOS] Provide audio route information when invoking AirPlay picker
343 https://bugs.webkit.org/show_bug.cgi?id=185199
344 <rdar://problem/39853103>
346 Reviewed by Jer Noble.
348 No new tests, this requires a specific hardware setup.
351 (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
354 * html/MediaElementSession.cpp:
355 (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
357 * loader/EmptyClients.h:
358 * page/ChromeClient.h:
361 (WebCore::Page::showPlaybackTargetPicker): Ditto.
364 * platform/audio/AudioSession.cpp:
365 (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
366 (WebCore::routingContextUID const): Ditto.
367 * platform/audio/AudioSession.h:
369 * platform/audio/ios/AudioSessionIOS.mm:
370 (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
371 (WebCore::AudioSession::routingContextUID const): Return the route context UID.
373 2018-05-02 Dean Jackson <dino@apple.com>
375 Draw SystemPreview badge to specification on iOS
376 https://bugs.webkit.org/show_bug.cgi?id=185203
377 <rdar://problem/39908855>
379 Reviewed by Tim Horton.
381 Use CoreImage to render a badge with a blurred background,
384 This will be tested internally while we're getting artwork
385 from WebKitAdditions.
387 * Configurations/WebCore.xcconfig: Link against CoreImage.
388 * rendering/RenderThemeIOS.h:
389 * rendering/RenderThemeIOS.mm:
390 (WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
391 in the iOS platform RenderTheme that draws the system preview.
393 2018-05-01 Brent Fulgham <bfulgham@apple.com>
395 Prevent Debug ASSERT when changing forms
396 https://bugs.webkit.org/show_bug.cgi?id=185173
397 <rdar://problem/39738669>
399 Reviewed by Ryosuke Niwa.
401 Form submission could trigger a debug assertion during validation when
402 a form is changed during an input submission. Fix this by cleaning up
403 the event handling logic and make it more consistent with modern WebKit
406 Test: fast/forms/form-submission-crash-3.html
408 * html/HTMLButtonElement.cpp:
409 (WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
410 attempting to perform event handling.
411 * html/HTMLFormElement.cpp:
412 (WebCore::HTMLFormElement::reportValidity): Ditto.
413 (WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
414 since we expect this to happen earlier in the layout pass. Add an assertion that the
416 * html/ImageInputType.cpp:
417 (WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
418 attempting to perform event handling.
419 * html/SubmitInputType.cpp:
420 (WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
422 2018-05-02 Jer Noble <jer.noble@apple.com>
424 Unreviewed; address review comments made before landing r231231.
426 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
427 (VideoFullscreenControllerContext::volume const):
429 2018-05-02 Jer Noble <jer.noble@apple.com>
431 Pipe volume through PlaybackSessionManager/Proxy.
432 https://bugs.webkit.org/show_bug.cgi?id=185182
434 Reviewed by Eric Carlson.
436 Add support for the volume property to PlaybackSessionModel, and all its clients.
438 * platform/cocoa/PlaybackSessionModel.h:
439 (WebCore::PlaybackSessionModelClient::volumeChanged):
440 * platform/cocoa/PlaybackSessionModelMediaElement.h:
441 * platform/cocoa/PlaybackSessionModelMediaElement.mm:
442 (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
443 (WebCore::PlaybackSessionModelMediaElement::setVolume):
444 (WebCore::PlaybackSessionModelMediaElement::volume const):
445 * platform/ios/PlaybackSessionInterfaceAVKit.h:
446 * platform/ios/PlaybackSessionInterfaceAVKit.mm:
447 (WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
448 * platform/ios/WebAVPlayerController.h:
449 * platform/ios/WebAVPlayerController.mm:
450 (-[WebAVPlayerController volume]):
451 (-[WebAVPlayerController setVolume:]):
452 (-[WebAVPlayerController volumeChanged:]):
453 (-[WebAVPlayerController resetMediaState]):
454 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
455 (VideoFullscreenControllerContext::volumeChanged):
456 (VideoFullscreenControllerContext::volume const):
457 (VideoFullscreenControllerContext::setVolume):
459 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
461 Unreviewed, fix build in WinCairo
462 https://bugs.webkit.org/show_bug.cgi?id=185169
464 * bindings/js/JSDOMWindowBase.cpp:
465 (WebCore::JSDOMWindowBase::instantiateStreaming):
466 * bindings/js/JSDOMWindowBase.h:
468 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
470 Use default std::optional if it is provided
471 https://bugs.webkit.org/show_bug.cgi?id=185159
473 Reviewed by JF Bastien.
475 * Modules/mediastream/RTCPeerConnection.cpp:
476 (WebCore::iceServersFromConfiguration):
477 (WebCore::RTCPeerConnection::setConfiguration):
478 * css/parser/CSSParser.cpp:
479 (WebCore::CSSParser::parseSystemColor):
480 * css/parser/CSSParser.h:
481 * dom/DatasetDOMStringMap.cpp:
482 (WebCore::DatasetDOMStringMap::item const):
483 (WebCore::DatasetDOMStringMap::namedItem const):
484 (WebCore:: const): Deleted.
485 * dom/DatasetDOMStringMap.h:
487 (WebCore::Element::insertAdjacentHTML):
489 * inspector/DOMEditor.cpp:
490 * platform/network/curl/CurlFormDataStream.cpp:
491 (WebCore::CurlFormDataStream::getPostData):
493 * platform/network/curl/CurlFormDataStream.h:
494 * testing/MockCDMFactory.cpp:
495 (WebCore::MockCDMFactory::keysForSessionWithID const):
496 (WebCore::MockCDMInstance::updateLicense):
497 (WebCore:: const): Deleted.
498 * testing/MockCDMFactory.h:
500 2018-05-01 Chris Dumez <cdumez@apple.com>
502 Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
503 https://bugs.webkit.org/show_bug.cgi?id=185181
505 Reviewed by Geoffrey Garen.
507 Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
508 on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
509 which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
510 to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
511 the UIthread instead of the WebThread on iOS WebKitLegacy.
513 * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
514 (WebCore::SocketStreamHandleImpl::scheduleStreams):
515 (WebCore::SocketStreamHandleImpl::readStreamCallback):
517 2018-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
519 Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
521 * page/RuntimeEnabledFeatures.h:
523 2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
525 Fix build error after r231194
526 https://bugs.webkit.org/show_bug.cgi?id=185169
528 Reviewed by JF Bastien.
530 Prevent compile error in iOS Simulator debug build
533 * bindings/js/JSDOMWindowBase.cpp:
534 (WebCore::JSDOMWindowBase::compileStreaming):
535 (WebCore::JSDOMWindowBase::instantiateStreaming):
537 2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
539 WebAssembly: add support for stream APIs - JavaScript API
540 https://bugs.webkit.org/show_bug.cgi?id=183442
542 Reviewed by Yusuke Suzuki and JF Bastien.
544 Add WebAssembly streaming API to WebCore.
546 * Configurations/FeatureDefines.xcconfig:
547 * bindings/js/JSDOMWindowBase.cpp:
548 (WebCore::tryAllocate):
549 (WebCore::isResponseCorrect):
550 (WebCore::handleResponseOnStreamingAction):
551 (WebCore::JSDOMWindowBase::compileStreaming):
552 (WebCore::JSDOMWindowBase::instantiateStreaming):
553 * bindings/js/JSDOMWindowBase.h:
554 * bindings/js/JSRemoteDOMWindowBase.cpp:
555 * bindings/js/JSWorkerGlobalScopeBase.cpp:
557 2018-04-30 Myles C. Maxfield <mmaxfield@apple.com>
559 Improve the performance of FontCascadeDescription's effectiveFamilies
560 https://bugs.webkit.org/show_bug.cgi?id=184720
561 <rdar://problem/38970927>
563 Reviewed by Simon Fraser.
565 The page that had the performance problem renders many different Chinese characters in system-ui
566 with only a small number of individual fonts. It turns out we were calling into the system-ui
567 machinery for each character in order to opportunistically start loading data URLs (see also:
568 https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
569 font, so we don't need to invoke the system-ui machinery at all.
571 This patch makes a 92x performance improvement on the associated performance test. This test is
572 designed to test Chinese text rendered with system-ui.
574 Performance test: Layout/system-ui.html
576 * platform/graphics/FontCascadeFonts.cpp:
577 (WebCore::opportunisticallyStartFontDataURLLoading):
579 2018-04-30 Jer Noble <jer.noble@apple.com>
581 <img src=mp4> does not display on ios despite Accept: video/* advertisement
582 https://bugs.webkit.org/show_bug.cgi?id=185029
583 <rdar://problem/39771989>
585 Reviewed by Eric Carlson.
587 Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
588 even if the resource request is successfully fulfilled prior to the return. Always return YES in
589 the case that loading succeeded.
591 * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
592 (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
594 2018-04-30 Zalan Bujtas <zalan@apple.com>
596 REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
597 https://bugs.webkit.org/show_bug.cgi?id=185142
598 <rdar://problem/39821446>
600 Reviewed by Simon Fraser.
602 Set the overflow rect on the inline textbox when needed.
604 Test: fast/text/simple-line-layout-selection-with-overflow.html
606 * rendering/SimpleLineLayoutFunctions.cpp:
607 (WebCore::SimpleLineLayout::initializeInlineTextBox):
608 (WebCore::SimpleLineLayout::generateLineBoxTree):
609 (WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
611 2018-04-30 JF Bastien <jfbastien@apple.com>
613 Use some C++17 features
614 https://bugs.webkit.org/show_bug.cgi?id=185135
616 Reviewed by Alex Christensen.
618 As discussed here [0] let's move WebKit to a subset of C++17. We
619 now require GCC 6 [1] which means that, according to [2] we can
620 use the following C++17 language features (I removed some
623 - New auto rules for direct-list-initialization
624 - static_assert with no message
625 - typename in a template template parameter
626 - Nested namespace definition
627 - Attributes for namespaces and enumerators
628 - u8 character literals
629 - Allow constant evaluation for all non-type template arguments
631 - Unary fold expressions and empty parameter packs
632 - __has_include in preprocessor conditional
633 - Differing begin and end types in range-based for
634 - Improving std::pair and std::tuple
636 Consult the Tony Tables [3] to see before / after examples.
638 Of course we can use any library feature if we're willing to
639 import them to WTF (and they don't require language support).
642 [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
643 [1]: https://trac.webkit.org/changeset/231152/webkit
644 [2]: https://en.cppreference.com/w/cpp/compiler_support
645 [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
647 * DerivedSources.make:
648 * platform/URLParser.cpp: work around an odd GCC 6 bug with class
649 static value as a template parameter.
650 (WebCore::URLParser::percentDecode):
651 (WebCore::URLParser::domainToASCII):
652 (WebCore::URLParser::hasForbiddenHostCodePoint):
653 (WebCore::URLParser::parseHostAndPort):
654 * platform/URLParser.h:
656 2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com>
658 [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
659 https://bugs.webkit.org/show_bug.cgi?id=185132
660 <rdar://problem/39834562>
662 Reviewed by Tim Horton.
664 Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
665 `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
666 behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
668 Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
670 * dom/ViewportArguments.cpp:
671 (WebCore::setViewportFeature):
672 (WebCore::operator<<):
673 * dom/ViewportArguments.h:
675 Removes the `minDeviceWidth` viewport argument.
677 * page/RuntimeEnabledFeatures.h:
678 (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
679 (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
681 Removes the runtime switch for `min-device-width`.
683 * page/ViewportConfiguration.cpp:
684 (WebCore::platformDeviceWidthOverride):
686 Hard-code the override device width in extra zoom mode.
688 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
690 In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
691 device width is less than the override device width.
693 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
694 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
695 (WebCore::ViewportConfiguration::updateConfiguration):
696 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
698 Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
699 device width is greater than the override device width.
701 (WebCore::computedMinDeviceWidth): Deleted.
702 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
703 * page/ViewportConfiguration.h:
705 2018-04-30 Chris Nardi <cnardi@chromium.org>
707 Serialize font-variation-settings with double-quotes per spec
708 https://bugs.webkit.org/show_bug.cgi?id=182542
710 Reviewed by Myles C. Maxfield.
712 According to the CSSOM spec [1], all strings should be serialized with double-quotes.
713 The axis name in font-variation-settings was previously serialized with single-quotes;
714 change this to double-quotes to match the spec and non-WebKit browsers.
716 [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
718 Updated fast/text/variations/getComputedStyle.html to test the change.
720 * css/CSSFontVariationValue.cpp:
721 (WebCore::CSSFontVariationValue::customCSSText const):
723 2018-04-30 Chris Dumez <cdumez@apple.com>
725 Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
726 https://bugs.webkit.org/show_bug.cgi?id=185134
728 Reviewed by Geoffrey Garen.
730 Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
731 and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
734 * dom/MessagePort.cpp:
735 (WebCore::MessagePort::dispatchMessages):
737 2018-04-30 Simon Fraser <simon.fraser@apple.com>
739 Make color-filter affect caret-color
740 https://bugs.webkit.org/show_bug.cgi?id=185129
741 rdar://problem/39829066
743 Reviewed by Tim Horton.
745 Transform the colors used to compare the caret color with the background through
746 color-filter (since we want contrasting colors after filters are applied), and
747 transform caret-color itself.
749 Test: css3/color-filters/color-filter-caret-color.html
751 * editing/FrameSelection.cpp:
752 (WebCore::CaretBase::paintCaret const):
754 2018-04-30 Michael Catanzaro <mcatanzaro@igalia.com>
756 [GTK] Webkit should spoof as Safari on a Mac when on Chase.com
757 https://bugs.webkit.org/show_bug.cgi?id=185103
759 Reviewed by Carlos Garcia Campos.
761 Send a fake user agent to chase.com to make it work.
763 * platform/UserAgentQuirks.cpp:
764 (WebCore::urlRequiresMacintoshPlatform):
765 (WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
767 2018-04-29 Simon Fraser <simon.fraser@apple.com>
769 Make color-filter affect <attachment>
770 https://bugs.webkit.org/show_bug.cgi?id=185122
771 rdar://problem/39818763
773 Reviewed by Tim Horton.
775 Convert the colors used to render <attachment> through color-filter, except
776 for those parts that render over the icon (like the progress bar).
780 * rendering/RenderThemeMac.mm:
781 (WebCore::titleTextColorForAttachment):
782 (WebCore::AttachmentLayout::layOutTitle):
783 (WebCore::AttachmentLayout::layOutSubtitle):
784 (WebCore::paintAttachmentIconBackground):
785 (WebCore::paintAttachmentTitleBackground):
786 (WebCore::paintAttachmentPlaceholderBorder):
788 2018-04-28 Simon Fraser <simon.fraser@apple.com>
790 Fix color-filter to apply to SVG colors
791 https://bugs.webkit.org/show_bug.cgi?id=185113
792 rdar://problem/39665082
794 Reviewed by Dean Jackson.
796 Convert SVG colors through color-filter operations for the places in SVG
797 that use color, namely fill and stroke, gradients, lighting colors and
800 Test: css3/color-filters/svg/color-filter-inline-svg.html
802 * rendering/svg/RenderSVGResourceGradient.cpp:
803 (WebCore::RenderSVGResourceGradient::applyResource):
804 * rendering/svg/RenderSVGResourceGradient.h:
805 * rendering/svg/RenderSVGResourceLinearGradient.cpp:
806 (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
807 * rendering/svg/RenderSVGResourceLinearGradient.h:
808 * rendering/svg/RenderSVGResourceRadialGradient.cpp:
809 (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
810 * rendering/svg/RenderSVGResourceRadialGradient.h:
811 * rendering/svg/RenderSVGResourceSolidColor.cpp:
812 (WebCore::RenderSVGResourceSolidColor::applyResource):
813 * svg/SVGFEDiffuseLightingElement.cpp:
814 (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
815 (WebCore::SVGFEDiffuseLightingElement::build):
816 * svg/SVGFEDropShadowElement.cpp:
817 (WebCore::SVGFEDropShadowElement::build):
818 * svg/SVGFEFloodElement.cpp:
819 (WebCore::SVGFEFloodElement::build):
820 * svg/SVGFESpecularLightingElement.cpp:
821 (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
822 (WebCore::SVGFESpecularLightingElement::build):
824 2018-04-29 Michael Catanzaro <mcatanzaro@igalia.com>
826 [CMake] Require GCC 6
827 https://bugs.webkit.org/show_bug.cgi?id=184985
829 Reviewed by Alex Christensen.
831 Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
833 * platform/graphics/FourCC.h:
834 (WebCore::FourCC::FourCC):
836 2018-04-29 Zalan Bujtas <zalan@apple.com>
838 [LFC] Implement Display::Box functions
839 https://bugs.webkit.org/show_bug.cgi?id=185116
841 Reviewed by Antti Koivisto.
843 * layout/displaytree/DisplayBox.cpp:
844 (WebCore::Display::Box::Box):
845 (WebCore::Display::Box::~Box):
846 (WebCore::Display::Box::marginBox const):
847 (WebCore::Display::Box::borderBox const):
848 (WebCore::Display::Box::paddingBox const):
849 (WebCore::Display::Box::contentBox const):
850 * layout/displaytree/DisplayBox.h:
851 (WebCore::Display::Box::rect const):
852 (WebCore::Display::Box::top const):
853 (WebCore::Display::Box::left const):
854 (WebCore::Display::Box::bottom const):
855 (WebCore::Display::Box::right const):
856 (WebCore::Display::Box::topLeft const):
857 (WebCore::Display::Box::bottomRight const):
858 (WebCore::Display::Box::size const):
859 (WebCore::Display::Box::width const):
860 (WebCore::Display::Box::height const):
861 (WebCore::Display::Box::marginTop const):
862 (WebCore::Display::Box::marginLeft const):
863 (WebCore::Display::Box::marginBottom const):
864 (WebCore::Display::Box::marginRight const):
865 (WebCore::Display::Box::parent const):
866 (WebCore::Display::Box::nextSibling const):
867 (WebCore::Display::Box::previousSibling const):
868 (WebCore::Display::Box::firstChild const):
869 (WebCore::Display::Box::lastChild const):
870 (WebCore::Display::Box::setRect):
871 (WebCore::Display::Box::setTopLeft):
872 (WebCore::Display::Box::setTop):
873 (WebCore::Display::Box::setLeft):
874 (WebCore::Display::Box::setSize):
875 (WebCore::Display::Box::setWidth):
876 (WebCore::Display::Box::setHeight):
877 (WebCore::Display::Box::setMarginTop):
878 (WebCore::Display::Box::setMarginLeft):
879 (WebCore::Display::Box::setMarginBottom):
880 (WebCore::Display::Box::setMarginRight):
881 (WebCore::Display::Box::setBorderTop):
882 (WebCore::Display::Box::setBorderLeft):
883 (WebCore::Display::Box::setBorderBottom):
884 (WebCore::Display::Box::setBorderRight):
885 (WebCore::Display::Box::setPaddingTop):
886 (WebCore::Display::Box::setPaddingLeft):
887 (WebCore::Display::Box::setPaddingBottom):
888 (WebCore::Display::Box::setPaddingRight):
889 (WebCore::Display::Box::setParent):
890 (WebCore::Display::Box::setNextSibling):
891 (WebCore::Display::Box::setPreviousSibling):
892 (WebCore::Display::Box::setFirstChild):
893 (WebCore::Display::Box::setLastChild):
895 2018-04-29 Youenn Fablet <youenn@apple.com>
897 Make RestrictedHTTPResponseAccess flag true by default
898 https://bugs.webkit.org/show_bug.cgi?id=185089
900 Reviewed by Geoffrey Garen.
902 * page/RuntimeEnabledFeatures.h:
904 2018-04-28 Sihui Liu <sihui_liu@apple.com>
906 [Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
907 https://bugs.webkit.org/show_bug.cgi?id=185052
909 Reviewed by Geoffrey Garen.
911 Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could
912 create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
913 function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
916 Modified API test: WebKit.WKHTTPCookieStoreHttpOnly
918 * platform/network/cocoa/CookieCocoa.mm:
919 (WebCore::Cookie::operator NSHTTPCookie * const):
920 (WebCore::Cookie::operator== const):
921 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
922 (WebCore::NetworkStorageSession::deleteCookie):
924 2018-04-28 Zalan Bujtas <zalan@apple.com>
926 [LFC] Add LayoutTreeBuilder class to generate the layout tree
927 https://bugs.webkit.org/show_bug.cgi?id=185108
929 Reviewed by Antti Koivisto.
931 This is for testing purposes.
933 * WebCore.xcodeproj/project.pbxproj:
934 * layout/FormattingState.cpp:
935 (WebCore::Layout::FormattingState::~FormattingState):
936 * layout/FormattingState.h:
937 * layout/LayoutContext.h:
938 * layout/blockformatting/BlockFormattingState.cpp:
939 (WebCore::Layout::BlockFormattingState::~BlockFormattingState):
940 * layout/blockformatting/BlockFormattingState.h:
941 * layout/inlineformatting/InlineFormattingState.cpp:
942 (WebCore::Layout::InlineFormattingState::~InlineFormattingState):
943 * layout/inlineformatting/InlineFormattingState.h:
944 * layout/layouttree/LayoutBlockContainer.h:
945 * layout/layouttree/LayoutBox.h:
946 * layout/layouttree/LayoutContainer.h:
947 * layout/layouttree/LayoutInlineContainer.h:
948 * layout/layouttree/LayoutTreeBuilder.cpp: Added.
949 (WebCore::Layout::TreeBuilder::createLayoutTree):
950 (WebCore::Layout::TreeBuilder::createSubTree):
951 (WebCore::Layout::outputLayoutBox):
952 (WebCore::Layout::outputLayoutTree):
953 (WebCore::Layout::TreeBuilder::showLayoutTree):
954 (WebCore::Layout::printLayoutTreeForLiveDocuments):
955 * layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
956 * page/mac/PageMac.mm:
957 (WebCore::Page::platformInitialize):
959 2018-04-28 Zalan Bujtas <zalan@apple.com>
961 [LFC] Implement BlockMarginCollapse functions.
962 https://bugs.webkit.org/show_bug.cgi?id=185036
964 Reviewed by Antti Koivisto.
966 * layout/blockformatting/BlockMarginCollapse.cpp:
967 (WebCore::Layout::marginValue):
968 (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
969 (WebCore::Layout::BlockMarginCollapse::marginTop const):
970 (WebCore::Layout::BlockMarginCollapse::marginBottom const):
971 (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
972 (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
973 (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
974 (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
975 (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
976 (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
977 (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
978 (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
979 (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
980 * layout/blockformatting/BlockMarginCollapse.h:
981 * layout/layouttree/LayoutBox.h:
982 (WebCore::Layout::Box::style const):
984 2018-04-27 David Kilzer <ddkilzer@apple.com>
986 Add logging when SpringBoard enables WebThread
987 <https://webkit.org/b/185100>
988 <rdar://problem/39746542>
990 Reviewed by Daniel Bates.
992 * platform/RuntimeApplicationChecks.h:
993 (WebCore::IOSApplication::isSpringBoard): Add declaration.
994 * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
995 (WebCore::IOSApplication::isSpringBoard): Add implementation.
996 * platform/ios/wak/WebCoreThread.mm:
997 (WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
1000 2018-04-27 Keith Rollin <krollin@apple.com>
1002 Fix crash in DocumentLoader::startLoadingMainResource
1003 https://bugs.webkit.org/show_bug.cgi?id=185088
1004 rdar://problem/39689263
1006 Reviewed by Chris Dumez.
1008 Add a "protectedThis" to address a case where a deleted "this" was
1009 accessed in a RELEASE_LOG statement.
1011 No new tests -- covered by existing tests, which now pass.
1013 * loader/DocumentLoader.cpp:
1014 (WebCore::DocumentLoader::startLoadingMainResource):
1016 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1018 Implement color-filter for text stroke
1019 https://bugs.webkit.org/show_bug.cgi?id=185098
1021 Reviewed by Alan Bujtas.
1023 Transform the text stroke color through color-filter.
1025 Test: css3/color-filters/color-filter-text-stroke.html
1027 * rendering/TextPaintStyle.cpp:
1028 (WebCore::computeTextPaintStyle):
1030 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1032 Implement animation for color-filter
1033 https://bugs.webkit.org/show_bug.cgi?id=185092
1034 rdar://problem/39773810
1036 Reviewed by Tim Horton.
1038 Implement animation of color-filter.
1040 This requires tracking whether the color-filter function lists match for both old and new
1041 animation code paths.
1043 The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
1044 which has to pass the propertyID to the blend function so we know which "lists match" to check.
1045 This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.
1047 Test: css3/color-filters/color-filter-animation.html
1049 * animation/CSSPropertyBlendingClient.h:
1050 * animation/KeyframeEffectReadOnly.cpp:
1051 (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1052 (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
1053 * animation/KeyframeEffectReadOnly.h:
1054 * page/animation/AnimationBase.h:
1055 * page/animation/CSSPropertyAnimation.cpp:
1056 (WebCore::blendFunc):
1057 (WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
1058 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1059 (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
1060 (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
1061 (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
1062 (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
1063 * page/animation/ImplicitAnimation.cpp:
1064 (WebCore::ImplicitAnimation::reset):
1065 (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
1066 * page/animation/ImplicitAnimation.h:
1067 * page/animation/KeyframeAnimation.cpp:
1068 (WebCore::KeyframeAnimation::KeyframeAnimation):
1069 (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
1070 * page/animation/KeyframeAnimation.h:
1072 2018-04-27 Zalan Bujtas <zalan@apple.com>
1074 [LFC] Add FormattingContext::computeWidth/computeHeight logic.
1075 https://bugs.webkit.org/show_bug.cgi?id=185091
1077 Reviewed by Antti Koivisto.
1079 Inflow width and height can't really be computed without knowing the exact context.
1081 * layout/FormattingContext.cpp:
1082 (WebCore::Layout::FormattingContext::computeWidth const):
1083 (WebCore::Layout::FormattingContext::computeHeight const):
1084 (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1085 (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1086 (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1087 (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1088 * layout/FormattingContext.h:
1089 * layout/blockformatting/BlockFormattingContext.cpp:
1090 (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1091 (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1092 (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
1093 (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
1094 * layout/blockformatting/BlockFormattingContext.h:
1095 * layout/inlineformatting/InlineFormattingContext.cpp:
1096 (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
1097 (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
1098 * layout/inlineformatting/InlineFormattingContext.h:
1100 2018-04-27 Chris Dumez <cdumez@apple.com>
1102 Use WindowProxy instead of DOMWindow in our IDL
1103 https://bugs.webkit.org/show_bug.cgi?id=185022
1105 Reviewed by Sam Weinig.
1107 Stop using DOMWindow in all of our IDL files and use WindowProxy as
1108 per their respective specifications. As a result, the implementation
1109 as also updated to use WindowProxy type instead of DOMWindow.
1111 * WebCore.xcodeproj/project.pbxproj:
1112 * bindings/js/JSDOMConvertWindowProxy.h: Removed.
1113 * bindings/js/JSWindowProxy.cpp:
1114 (WebCore::JSWindowProxy::windowProxy const):
1115 (WebCore::JSWindowProxy::toWrapped):
1116 * bindings/js/JSWindowProxy.h:
1118 Use static_cast<>() instead of jsCast<>() because jsCast<>()
1119 relies on classInfo() which is not allowed to be called during
1120 JS sweep due to an assertion inside classInfo(). The JSWindowProxy
1121 objects are held strongly by the WindowProxy so we know the JSWindowProxy
1122 object is not getting destroyed here.
1125 * bindings/js/WindowProxy.cpp:
1126 (WebCore::WindowProxy::globalObject):
1127 * bindings/js/WindowProxy.h:
1128 (WebCore::WindowProxy::frame const):
1129 * bindings/scripts/CodeGenerator.pm:
1131 (ComputeIsCallbackInterface):
1132 (ComputeIsCallbackFunction):
1133 * bindings/scripts/CodeGeneratorJS.pm:
1134 (AddToIncludesForIDLType):
1136 (NativeToJSValueDOMConvertNeedsState):
1137 * bindings/scripts/test/JS/JSTestObj.cpp:
1138 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
1139 (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1140 * bindings/scripts/test/TestObj.idl:
1141 * dom/CompositionEvent.cpp:
1142 (WebCore::CompositionEvent::CompositionEvent):
1143 (WebCore::CompositionEvent::initCompositionEvent):
1144 * dom/CompositionEvent.h:
1145 * dom/CompositionEvent.idl:
1147 (WebCore::Document::defaultView const):
1150 * dom/DocumentTouch.cpp:
1151 (WebCore::DocumentTouch::createTouch):
1152 * dom/DocumentTouch.h:
1153 * dom/DocumentTouch.idl:
1154 * dom/FocusEvent.cpp:
1155 (WebCore::FocusEvent::FocusEvent):
1157 * dom/InputEvent.cpp:
1158 (WebCore::InputEvent::create):
1159 (WebCore::InputEvent::InputEvent):
1161 * dom/KeyboardEvent.cpp:
1162 (WebCore::KeyboardEvent::KeyboardEvent):
1163 (WebCore::KeyboardEvent::create):
1164 (WebCore::KeyboardEvent::initKeyboardEvent):
1165 (WebCore::KeyboardEvent::charCode const):
1166 * dom/KeyboardEvent.h:
1167 * dom/KeyboardEvent.idl:
1168 * dom/MessageEvent.h:
1169 * dom/MessageEvent.idl:
1170 * dom/MouseEvent.cpp:
1171 (WebCore::MouseEvent::create):
1172 (WebCore::MouseEvent::MouseEvent):
1173 (WebCore::MouseEvent::initMouseEvent):
1174 (WebCore::MouseEvent::initMouseEventQuirk):
1176 * dom/MouseEvent.idl:
1177 * dom/MouseRelatedEvent.cpp:
1178 (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1179 (WebCore::MouseRelatedEvent::init):
1180 (WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
1181 (WebCore::MouseRelatedEvent::initCoordinates):
1182 (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
1183 (WebCore::MouseRelatedEvent::computePageLocation):
1184 (WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
1185 * dom/MouseRelatedEvent.h:
1187 * dom/SimulatedClick.cpp:
1188 * dom/TextEvent.cpp:
1189 (WebCore::TextEvent::create):
1190 (WebCore::TextEvent::createForPlainTextPaste):
1191 (WebCore::TextEvent::createForFragmentPaste):
1192 (WebCore::TextEvent::createForDrop):
1193 (WebCore::TextEvent::createForDictation):
1194 (WebCore::TextEvent::TextEvent):
1195 (WebCore::TextEvent::initTextEvent):
1197 * dom/TextEvent.idl:
1198 * dom/TouchEvent.idl:
1200 (WebCore::UIEvent::UIEvent):
1201 (WebCore::UIEvent::initUIEvent):
1203 (WebCore::UIEvent::create):
1204 (WebCore::UIEvent::view const):
1206 * dom/UIEventInit.h:
1207 * dom/UIEventInit.idl:
1208 * dom/UIEventWithKeyState.h:
1209 (WebCore::UIEventWithKeyState::UIEventWithKeyState):
1210 * dom/WheelEvent.cpp:
1211 (WebCore::WheelEvent::WheelEvent):
1212 (WebCore::WheelEvent::create):
1213 (WebCore::WheelEvent::initWebKitWheelEvent):
1215 * dom/WheelEvent.idl:
1216 * editing/AlternativeTextController.cpp:
1217 (WebCore::AlternativeTextController::insertDictatedText):
1218 * editing/Editor.cpp:
1219 (WebCore::Editor::pasteAsPlainText):
1220 (WebCore::Editor::pasteAsFragment):
1221 (WebCore::Editor::setComposition):
1222 * html/HTMLDocument.cpp:
1223 (WebCore::HTMLDocument::namedItem):
1224 * html/HTMLDocument.h:
1225 * html/HTMLDocument.idl:
1226 * html/HTMLFrameElement.idl:
1227 * html/HTMLFrameOwnerElement.cpp:
1228 (WebCore::HTMLFrameOwnerElement::contentWindow const):
1229 * html/HTMLFrameOwnerElement.h:
1230 * html/HTMLFrameSetElement.cpp:
1231 (WebCore::HTMLFrameSetElement::namedItem):
1232 * html/HTMLFrameSetElement.h:
1233 * html/HTMLFrameSetElement.idl:
1234 * html/HTMLIFrameElement.idl:
1235 * html/ImageDocument.cpp:
1236 * page/DOMWindow.cpp:
1237 (WebCore::PostMessageTimer::PostMessageTimer):
1238 (WebCore::PostMessageTimer::event):
1239 (WebCore::DOMWindow::postMessage):
1240 * page/DragController.cpp:
1241 (WebCore::DragController::dispatchTextInputEventFor):
1242 * page/EventHandler.cpp:
1243 (WebCore::EventHandler::handleTextInputEvent):
1245 2018-04-27 Nan Wang <n_wang@apple.com>
1247 AX: Accessibility needs to know which part of the content view is visible on iOS
1248 https://bugs.webkit.org/show_bug.cgi?id=185085
1249 <rdar://problem/39801363>
1251 Reviewed by Chris Fleizach.
1253 Exposed unobscuredContentRect() to iOS accessibility object wrapper.
1255 Test: accessibility/ios-simulator/unobscured-content-rect.html
1257 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1258 (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1260 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1262 Refactor filter list checking code
1263 https://bugs.webkit.org/show_bug.cgi?id=185087
1265 Reviewed by Alan Bujtas.
1267 Deduplicate code between filter and backdrop-filter for checking whether function lists
1268 match, by making a shared function that takes a std::function.
1270 The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
1271 converting the return type into a value.
1273 * animation/KeyframeEffectReadOnly.cpp:
1274 (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
1275 (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
1276 (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
1277 * animation/KeyframeEffectReadOnly.h:
1278 * page/animation/KeyframeAnimation.cpp:
1279 (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
1280 (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
1281 (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
1282 * page/animation/KeyframeAnimation.h:
1284 2018-04-27 Chris Dumez <cdumez@apple.com>
1286 Regression(r222392?): Events can have a negative timestamp which causes app breakage
1287 https://bugs.webkit.org/show_bug.cgi?id=185040
1288 <rdar://problem/39638051>
1290 Reviewed by Wenson Hsieh.
1292 The real fix is in UIKit when generating the touch timestamps. However, this patch
1293 does some hardening to make sure that Event.timestamp can never return a negative
1294 value even if something goes wrong.
1297 (WebCore::Event::timeStampForBindings const):
1299 2018-04-27 Christopher Reid <chris.reid@sony.com>
1301 URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
1302 https://bugs.webkit.org/show_bug.cgi?id=184836
1304 Reviewed by Alex Christensen.
1306 Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.
1308 Test: LayoutTests\fast\url\url-hostname-encoding.html
1312 2018-04-27 Youenn Fablet <youenn@apple.com>
1314 CachedRawResource is not handling incremental data computation correctly
1315 https://bugs.webkit.org/show_bug.cgi?id=184936
1316 <rdar://problem/38798141>
1318 Reviewed by Darin Adler.
1320 * loader/cache/CachedRawResource.cpp:
1321 (WebCore::CachedRawResource::updateBuffer): Fixing style.
1323 2018-04-27 Zalan Bujtas <zalan@apple.com>
1325 [LFC] Implement BlockFormattingContext::layout logic and its dependencies
1326 https://bugs.webkit.org/show_bug.cgi?id=185024
1328 Reviewed by Antti Koivisto.
1330 This patch implements the logic for block formatting context according to
1331 https://www.w3.org/TR/CSS22/visuren.html#block-formatting
1333 1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
1334 we visit the descendant nodes until we hit a leaf node.
1335 2. Compute the position/geometry of the leaf node and move over to its sibling(s).
1336 3. Finalize the container's height/final position as we climb back on the tree.
1337 4. Run layout on the out-of-flow descendants.
1339 Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
1340 The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
1341 in a separate formatting context (excluding out-of-flow boxes that don't belong to the root).
1343 * layout/FloatingContext.cpp:
1344 (WebCore::Layout::FloatingContext::FloatingContext):
1345 (WebCore::Layout::FloatingContext::computePosition):
1346 * layout/FormattingContext.cpp:
1347 (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1348 (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1349 * layout/FormattingContext.h:
1350 * layout/LayoutContext.cpp:
1351 (WebCore::Layout::LayoutContext::updateLayout):
1352 (WebCore::Layout::LayoutContext::establishedFormattingState):
1353 * layout/LayoutContext.h:
1354 * layout/blockformatting/BlockFormattingContext.cpp:
1355 (WebCore::Layout::BlockFormattingContext::layout const):
1356 (WebCore::Layout::BlockFormattingContext::layout): Deleted.
1357 * layout/blockformatting/BlockFormattingContext.h:
1358 * layout/inlineformatting/InlineFormattingContext.cpp:
1359 (WebCore::Layout::InlineFormattingContext::layout const):
1360 (WebCore::Layout::InlineFormattingContext::layout): Deleted.
1361 * layout/inlineformatting/InlineFormattingContext.h:
1363 2018-04-27 Youenn Fablet <youenn@apple.com>
1365 Use NetworkLoadChecker for XHR/fetch loads
1366 https://bugs.webkit.org/show_bug.cgi?id=184741
1368 Reviewed by Chris Dumez.
1370 Covered by existing tests.
1372 * loader/DocumentThreadableLoader.cpp:
1373 (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
1374 We need to set this option for CORS done in NetworkProcess.
1375 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1376 Set httpHeadersTokeep when needed (service worker or CORS loads).
1377 Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
1378 (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
1379 Helper routine to make the same check for both simple and preflight case.
1380 This allows more consistent error logging between WK1 and WK2.
1381 (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1382 Skip preflight in case this is done in NetworkProcess.
1383 (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1384 (WebCore::isResponseComingFromNetworkProcess):
1385 (WebCore::DocumentThreadableLoader::redirectReceived):
1386 Bypass security checks when they are already done in NetworkProcess.
1387 (WebCore::DocumentThreadableLoader::didFail):
1388 In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
1389 Check it again to enable specific CSP console logging and error reporting.
1390 (WebCore::DocumentThreadableLoader::loadRequest):
1391 Recreating the error in case of synchronous loads to be able to log it adequately.
1392 (WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
1393 * loader/DocumentThreadableLoader.h:
1394 * loader/SubresourceLoader.cpp:
1395 (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
1396 Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
1397 (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
1398 We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
1399 * loader/cache/CachedResourceLoader.cpp:
1400 (WebCore::CachedResourceLoader::requestResource):
1401 DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
1402 as applications are not supposed to set these headers.
1404 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1406 Add an experimental feature flag for viewport "min-device-width"
1407 https://bugs.webkit.org/show_bug.cgi?id=185050
1408 <rdar://problem/39624038>
1410 Reviewed by Tim Horton.
1412 Add MinDeviceWidthEnabled as a new runtime-enabled feature.
1414 * dom/ViewportArguments.cpp:
1415 (WebCore::setViewportFeature):
1417 Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.
1419 * page/RuntimeEnabledFeatures.h:
1420 (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
1421 (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):
1423 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1425 Make color-filter transform gradient colors
1426 https://bugs.webkit.org/show_bug.cgi?id=185080
1428 Reviewed by Zalan Bujtas.
1430 In CSSGradientValue::computeStops(), transform the color of each gradient color
1431 stop through the color filter. Having a color filter makes the gradient uncacheable.
1433 Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
1434 to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
1435 functions to take const RenderStyle&.
1437 Test: css3/color-filters/color-filter-gradients.html
1439 * css/CSSCrossfadeValue.cpp:
1440 (WebCore::subimageKnownToBeOpaque):
1441 * css/CSSFilterImageValue.cpp:
1442 (WebCore::CSSFilterImageValue::knownToBeOpaque const):
1443 * css/CSSFilterImageValue.h:
1444 * css/CSSGradientValue.cpp:
1445 (WebCore::CSSGradientValue::image):
1446 (WebCore::CSSGradientValue::computeStops):
1447 (WebCore::CSSGradientValue::knownToBeOpaque const):
1448 (WebCore::CSSLinearGradientValue::createGradient):
1449 (WebCore::CSSRadialGradientValue::createGradient):
1450 * css/CSSGradientValue.h:
1451 * css/CSSImageGeneratorValue.cpp:
1452 (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
1453 * css/CSSImageValue.cpp:
1454 (WebCore::CSSImageValue::knownToBeOpaque const):
1455 * css/CSSImageValue.h:
1457 2018-04-26 Simon Fraser <simon.fraser@apple.com>
1459 Fix color-filter to apply to text decorations
1460 https://bugs.webkit.org/show_bug.cgi?id=185068
1461 <rdar://problem/39782136>
1463 Reviewed by Alan Bujtas.
1465 Transform the colors of text shadows, and the shadows of text-decorations through
1468 Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
1469 (which would have awkward ownership implications) we pass the color filters through
1470 and just map the color through it before painting.
1472 Re-order the members of TextPainter a little to optimize padding.
1474 Also fix a bug where FilterOperations::transformColor() could transform an invalid
1475 color to a valid one; we never want this.
1477 Tests: css3/color-filters/color-filter-text-decoration-shadow.html
1478 css3/color-filters/color-filter-text-shadow.html
1480 * platform/graphics/filters/FilterOperations.cpp:
1481 (WebCore::FilterOperations::transformColor const):
1482 * rendering/InlineTextBox.cpp:
1483 (WebCore::InlineTextBox::paintMarkedTextForeground):
1484 (WebCore::InlineTextBox::paintMarkedTextDecoration):
1485 * rendering/TextDecorationPainter.cpp:
1486 (WebCore::TextDecorationPainter::paintTextDecoration):
1487 * rendering/TextDecorationPainter.h:
1488 (WebCore::TextDecorationPainter::setTextShadow):
1489 (WebCore::TextDecorationPainter::setShadowColorFilter):
1490 (WebCore::TextDecorationPainter::addTextShadow): Deleted.
1491 * rendering/TextPainter.cpp:
1492 (WebCore::ShadowApplier::ShadowApplier):
1493 (WebCore::TextPainter::paintTextWithShadows):
1494 (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
1495 on the first iteration.
1496 (WebCore::TextPainter::paintRange):
1497 * rendering/TextPainter.h:
1498 (WebCore::TextPainter::setShadowColorFilter):
1499 * rendering/svg/SVGInlineTextBox.cpp:
1500 (WebCore::SVGInlineTextBox::paintTextWithShadows):
1502 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1504 Rename minimumLayoutSize to viewLayoutSize
1505 https://bugs.webkit.org/show_bug.cgi?id=185050
1506 <rdar://problem/39624038>
1508 Reviewed by Tim Horton.
1510 See WebKit/ChangeLog for more information. No change in behavior.
1512 * page/ViewportConfiguration.cpp:
1513 (WebCore::ViewportConfiguration::ViewportConfiguration):
1514 (WebCore::ViewportConfiguration::setViewLayoutSize):
1516 Remove a FIXME comment that is addressed by this refactoring.
1518 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
1519 (WebCore::ViewportConfiguration::initialScaleFromSize const):
1520 (WebCore::ViewportConfiguration::minimumScale const):
1521 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1522 (WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
1523 * page/ViewportConfiguration.h:
1524 (WebCore::ViewportConfiguration::viewLayoutSize const):
1525 (WebCore::ViewportConfiguration::viewSize const): Deleted.
1527 2018-04-27 Zalan Bujtas <zalan@apple.com>
1529 [LFC] Formatting contexts should create floating states.
1530 https://bugs.webkit.org/show_bug.cgi?id=185032
1532 Reviewed by Antti Koivisto.
1534 This patch implements the logic for sharing floating states across multiple formatting contexts.
1535 At this point this is mostly about inline formatting contexts. They either create a new floating state
1536 or inherit it from the parent formatting context.
1538 * layout/FloatingState.cpp:
1539 (WebCore::Layout::FloatingState::FloatingState):
1540 * layout/FloatingState.h:
1541 (WebCore::Layout::FloatingState::create):
1542 * layout/FormattingContext.cpp:
1543 (WebCore::Layout::FormattingContext::FormattingContext):
1544 * layout/FormattingContext.h:
1545 (WebCore::Layout::FormattingContext::layoutContext const):
1546 * layout/FormattingState.cpp:
1547 (WebCore::Layout::FormattingState::FormattingState):
1548 * layout/FormattingState.h:
1549 (WebCore::Layout::FormattingState::floatingState const):
1550 * layout/LayoutContext.cpp:
1551 (WebCore::Layout::LayoutContext::updateLayout):
1552 (WebCore::Layout::LayoutContext::formattingStateForBox const):
1553 (WebCore::Layout::LayoutContext::establishedFormattingState):
1554 (WebCore::Layout::LayoutContext::formattingContext):
1555 (WebCore::Layout::LayoutContext::formattingState): Deleted.
1556 * layout/LayoutContext.h:
1557 * layout/blockformatting/BlockFormattingContext.cpp:
1558 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1559 (WebCore::Layout::BlockFormattingContext::createFormattingState const):
1560 (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
1561 (WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
1562 * layout/blockformatting/BlockFormattingContext.h:
1563 * layout/blockformatting/BlockFormattingState.cpp:
1564 (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1565 * layout/blockformatting/BlockFormattingState.h:
1566 * layout/inlineformatting/InlineFormattingContext.cpp:
1567 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1568 (WebCore::Layout::InlineFormattingContext::createFormattingState const):
1569 (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
1570 (WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
1571 * layout/inlineformatting/InlineFormattingContext.h:
1572 * layout/inlineformatting/InlineFormattingState.cpp:
1573 (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1574 * layout/inlineformatting/InlineFormattingState.h:
1575 * layout/layouttree/LayoutBox.cpp:
1576 (WebCore::Layout::Box::formattingContextRoot const):
1577 * layout/layouttree/LayoutBox.h:
1579 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1581 [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
1582 https://bugs.webkit.org/show_bug.cgi?id=185050
1583 <rdar://problem/39624038>
1585 Reviewed by Tim Horton.
1587 Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
1588 (namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
1589 patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
1590 automatically clamping the web view width to a greater value for the device width in this scenario.
1592 Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
1593 will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
1594 size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.
1596 See per-method comments below for more detail.
1598 Test: fast/viewport/extrazoom/viewport-change-min-device-width.html
1600 * dom/ViewportArguments.cpp:
1601 (WebCore::setViewportFeature):
1602 (WebCore::operator<<):
1603 * dom/ViewportArguments.h:
1605 Removes `m_forceHorizontalShrinkToFit` (more detail below).
1607 * page/ViewportConfiguration.cpp:
1608 (WebCore::computedMinDeviceWidth):
1609 (WebCore::ViewportConfiguration::ViewportConfiguration):
1610 (WebCore::ViewportConfiguration::setMinimumLayoutSize):
1612 Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
1613 size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.
1615 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
1617 Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
1618 min-device-width attribute is actively clamping the width of the view.
1620 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1621 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
1622 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1624 Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
1627 (WebCore::ViewportConfiguration::description const):
1628 (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
1629 * page/ViewportConfiguration.h:
1631 2018-04-27 Zalan Bujtas <zalan@apple.com>
1633 [LFC] Formatting contexts should take const Box&
1634 https://bugs.webkit.org/show_bug.cgi?id=185031
1636 Reviewed by Sam Weinig.
1638 The formatting root boxes are supposed to be all const. The only reason why
1639 they are not is because WeakPtr<> does not support const objects yet.
1640 Use const_cast instead (remove it when WeakPtr<> gains const support).
1642 * layout/FormattingContext.cpp:
1643 (WebCore::Layout::FormattingContext::FormattingContext):
1644 * layout/FormattingContext.h:
1645 * layout/LayoutContext.cpp:
1646 (WebCore::Layout::LayoutContext::LayoutContext):
1647 (WebCore::Layout::LayoutContext::formattingContext):
1648 * layout/LayoutContext.h:
1649 * layout/blockformatting/BlockFormattingContext.cpp:
1650 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1651 * layout/blockformatting/BlockFormattingContext.h:
1652 * layout/inlineformatting/InlineFormattingContext.cpp:
1653 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1654 * layout/inlineformatting/InlineFormattingContext.h:
1656 2018-04-27 Zalan Bujtas <zalan@apple.com>
1658 [LFC] Add layout tree iterators.
1659 https://bugs.webkit.org/show_bug.cgi?id=185058
1661 Reviewed by Antti Koivisto.
1663 They work exactly like the renderer tree iterators.
1665 * WebCore.xcodeproj/project.pbxproj:
1666 * layout/layouttree/LayoutAncestorIterator.h: Added.
1667 (WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
1668 (WebCore::Layout::LayoutAncestorIterator<T>::operator):
1669 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
1670 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
1671 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
1672 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
1673 (WebCore::Layout::ancestorsOfType):
1674 (WebCore::Layout::lineageOfType):
1675 * layout/layouttree/LayoutBox.cpp:
1676 * layout/layouttree/LayoutChildIterator.h: Added.
1677 (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
1678 (WebCore::Layout::LayoutChildtIterator<T>::operator):
1679 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
1680 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
1681 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
1682 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
1683 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
1684 (WebCore::Layout::childrenOfType):
1685 * layout/layouttree/LayoutIterator.h: Added.
1686 (WebCore::Layout::isLayoutBoxOfType):
1687 (WebCore::Layout::Traversal::firstChild):
1688 (WebCore::Layout::Traversal::lastChild):
1689 (WebCore::Layout::Traversal::nextSibling):
1690 (WebCore::Layout::Traversal::previousSibling):
1691 (WebCore::Layout::Traversal::findAncestorOfType):
1692 (WebCore::Layout::Traversal::nextAncestorSibling):
1693 (WebCore::Layout::Traversal::nextWithin):
1694 (WebCore::Layout::Traversal::firstWithin):
1695 (WebCore::Layout::Traversal::next):
1696 (WebCore::Layout::LayoutIterator<T>::LayoutIterator):
1697 (WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
1698 (WebCore::Layout::LayoutIterator<T>::traverseNext):
1699 (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
1700 (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
1701 (WebCore::Layout::LayoutIterator<T>::operator const):
1702 (WebCore::Layout:: const):
1703 (WebCore::Layout::= const):
1705 2018-04-27 Commit Queue <commit-queue@webkit.org>
1707 Unreviewed, rolling out r231089.
1708 https://bugs.webkit.org/show_bug.cgi?id=185071
1710 Broke and made crash some WPE EME tests (Requested by calvaris
1715 "[EME][GStreamer] Move the decryptor from AppendPipeline to
1717 https://bugs.webkit.org/show_bug.cgi?id=181855
1718 https://trac.webkit.org/changeset/231089
1720 2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
1722 [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
1723 https://bugs.webkit.org/show_bug.cgi?id=181855
1725 Reviewed by Xabier Rodriguez-Calvar.
1727 The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
1729 When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
1730 the decrypted GstBuffers that are in SVP memory.
1731 This behavior cause an out-of-memory error, because we are limited in SVP memory size.
1733 By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
1734 which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
1736 This new architecture also allows to start the buffering before obtaining the DRM license
1737 and it makes easier to manage dynamic change of the license or Key.
1739 The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
1741 SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
1742 protected by a hardware access control engine, it is not accessible to other unauthorised
1743 software or hardware components.
1746 media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
1747 media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
1749 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1750 (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1751 * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1752 (WebCore::dumpAppendState):
1753 (WebCore::AppendPipeline::AppendPipeline):
1754 (WebCore::AppendPipeline::handleNeedContextSyncMessage):
1755 (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
1756 (WebCore::AppendPipeline::setAppendState):
1757 (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1758 (WebCore::AppendPipeline::appsinkNewSample):
1759 (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1760 (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1761 (WebCore::appendPipelineElementMessageCallback): Deleted.
1762 (WebCore::AppendPipeline::handleElementMessage): Deleted.
1763 (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
1764 (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
1765 * platform/graphics/gstreamer/mse/AppendPipeline.h:
1766 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1767 (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1768 * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1770 2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
1772 [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
1773 https://bugs.webkit.org/show_bug.cgi?id=181858
1775 Reviewed by Xabier Rodriguez-Calvar.
1777 Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
1778 This message should be handled by the application in order to dispatch or send the key to the decryptor.
1779 This patch is a preparation for the patch 181855.
1780 With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
1781 get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
1782 When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
1783 the DRM license or key by using this new message "decrypt-key-needed".
1786 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1787 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1788 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1789 (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
1790 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1791 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1792 (webkitMediaCommonEncryptionDecryptTransformInPlace):
1794 2018-04-26 Justin Fan <justin_fan@apple.com>
1796 tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
1797 https://bugs.webkit.org/show_bug.cgi?id=184843
1798 <rdar://problem/34898868>
1800 Reviewed by Simon Fraser.
1802 On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread.
1803 For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
1804 This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these.
1806 * platform/graphics/FormatConverter.cpp:
1807 (WebCore::FormatConverter::convert):
1809 2018-04-26 Simon Fraser <simon.fraser@apple.com>
1811 Implement rendering support for the color-filter CSS property
1812 https://bugs.webkit.org/show_bug.cgi?id=185047
1813 rdar://problem/39664967
1815 Reviewed by Tim Horton.
1817 The color-filter property transforms CSS colors just before painting. To support this,
1818 add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
1819 At most calls sites that transform colors for rendering, replace calls to
1820 visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
1821 that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().
1823 Color transformation is implemented via a new virtual function on FilterOperation;
1824 BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
1825 do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
1826 transfer operations. The math in both cases matches that for SVG filters, with the exception
1827 that color components are stored as floats through multiple filters and then mapped to
1828 normal 0-255 color components at the end.
1830 Tests: css3/color-filters/color-filter-backgrounds-borders.html
1831 css3/color-filters/color-filter-box-shadow.html
1832 css3/color-filters/color-filter-brightness.html
1833 css3/color-filters/color-filter-color-property-list-item.html
1834 css3/color-filters/color-filter-color-property.html
1835 css3/color-filters/color-filter-color-text-decorations.html
1836 css3/color-filters/color-filter-column-rule.html
1837 css3/color-filters/color-filter-contrast.html
1838 css3/color-filters/color-filter-current-color.html
1839 css3/color-filters/color-filter-filter-list.html
1840 css3/color-filters/color-filter-grayscale.html
1841 css3/color-filters/color-filter-hue-rotate.html
1842 css3/color-filters/color-filter-inherits.html
1843 css3/color-filters/color-filter-invert.html
1844 css3/color-filters/color-filter-opacity.html
1845 css3/color-filters/color-filter-outline.html
1846 css3/color-filters/color-filter-saturate.html
1847 css3/color-filters/color-filter-sepia.html
1848 css3/color-filters/color-filter-text-emphasis.html
1850 * html/HTMLTextFormControlElement.cpp:
1851 (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
1852 * page/FrameView.cpp:
1853 (WebCore::FrameView::documentBackgroundColor const):
1854 * platform/graphics/ColorUtilities.cpp:
1855 (WebCore::ColorMatrix::ColorMatrix):
1856 (WebCore::ColorMatrix::makeIdentity):
1857 (WebCore::ColorMatrix::grayscaleMatrix):
1858 (WebCore::ColorMatrix::saturationMatrix):
1859 (WebCore::ColorMatrix::hueRotateMatrix):
1860 (WebCore::ColorMatrix::sepiaMatrix):
1861 (WebCore::ColorMatrix::transformColorComponents const):
1862 * platform/graphics/ColorUtilities.h:
1863 * platform/graphics/filters/FilterOperation.cpp:
1864 (WebCore::BasicColorMatrixFilterOperation::transformColor const):
1865 (WebCore::BasicComponentTransferFilterOperation::transformColor const):
1866 * platform/graphics/filters/FilterOperation.h:
1867 (WebCore::FilterOperation::transformColor const):
1868 * platform/graphics/filters/FilterOperations.cpp:
1869 (WebCore::FilterOperations::transformColor const):
1870 * platform/graphics/filters/FilterOperations.h:
1871 * rendering/BorderEdge.cpp:
1872 (WebCore::BorderEdge::getBorderEdgeInfo):
1873 * rendering/EllipsisBox.cpp:
1874 (WebCore::EllipsisBox::paint):
1875 (WebCore::EllipsisBox::paintSelection):
1876 * rendering/InlineFlowBox.cpp:
1877 (WebCore::InlineFlowBox::paintBoxDecorations):
1878 * rendering/InlineTextBox.cpp:
1879 (WebCore::InlineTextBox::paintMarkedTextForeground):
1880 (WebCore::InlineTextBox::paintMarkedTextDecoration):
1881 (WebCore::InlineTextBox::paintCompositionUnderline const):
1882 * rendering/RenderBox.cpp:
1883 (WebCore::RenderBox::paintRootBoxFillLayers):
1884 (WebCore::RenderBox::paintBackground):
1885 (WebCore::RenderBox::getBackgroundPaintedExtent const):
1886 (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
1887 (WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
1888 * rendering/RenderBoxModelObject.cpp:
1889 (WebCore::applyBoxShadowForBackground):
1890 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1891 (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
1892 (WebCore::RenderBoxModelObject::paintBoxShadow):
1893 * rendering/RenderDetailsMarker.cpp:
1894 (WebCore::RenderDetailsMarker::paint):
1895 * rendering/RenderElement.cpp:
1896 (WebCore::RenderElement::selectionColor const):
1897 (WebCore::RenderElement::selectionBackgroundColor const):
1898 (WebCore::RenderElement::paintFocusRing):
1899 (WebCore::RenderElement::paintOutline):
1900 * rendering/RenderFileUploadControl.cpp:
1901 (WebCore::RenderFileUploadControl::paintObject):
1902 * rendering/RenderFrameSet.cpp:
1903 (WebCore::RenderFrameSet::paintColumnBorder):
1904 (WebCore::RenderFrameSet::paintRowBorder):
1905 * rendering/RenderImage.cpp:
1906 (WebCore::RenderImage::paintReplaced):
1907 (WebCore::RenderImage::paintAreaElementFocusRing):
1908 * rendering/RenderInline.cpp:
1909 (WebCore::RenderInline::paintOutline):
1910 * rendering/RenderLayerBacking.cpp:
1911 (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
1912 (WebCore::RenderLayerBacking::rendererBackgroundColor const):
1913 * rendering/RenderLayerCompositor.cpp:
1914 (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
1915 * rendering/RenderListBox.cpp:
1916 (WebCore::RenderListBox::paintItemForeground):
1917 (WebCore::RenderListBox::paintItemBackground):
1918 * rendering/RenderListMarker.cpp:
1919 (WebCore::RenderListMarker::paint):
1920 * rendering/RenderMenuList.cpp:
1921 (RenderMenuList::itemStyle const):
1922 (RenderMenuList::getItemBackgroundColor const):
1923 (RenderMenuList::menuStyle const):
1924 * rendering/RenderMultiColumnSet.cpp:
1925 (WebCore::RenderMultiColumnSet::paintColumnRules):
1926 * rendering/RenderSearchField.cpp:
1927 (WebCore::RenderSearchField::menuStyle const):
1928 * rendering/RenderTable.h:
1929 (WebCore::RenderTable::bgColor const):
1930 * rendering/RenderTableCell.cpp:
1931 (WebCore::RenderTableCell::computeCollapsedStartBorder const):
1932 (WebCore::RenderTableCell::computeCollapsedEndBorder const):
1933 (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
1934 (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
1935 (WebCore::RenderTableCell::paintBackgroundsBehindCell):
1936 * rendering/RenderTableSection.cpp:
1937 (WebCore::RenderTableSection::paintRowGroupBorder):
1938 * rendering/RenderTheme.cpp:
1939 (WebCore::RenderTheme::paintSliderTicks):
1940 * rendering/TextDecorationPainter.cpp:
1941 (WebCore::decorationColor):
1942 * rendering/TextPaintStyle.cpp:
1943 (WebCore::computeTextPaintStyle):
1944 * rendering/mathml/MathOperator.cpp:
1945 (WebCore::MathOperator::paint):
1946 * rendering/mathml/RenderMathMLFraction.cpp:
1947 (WebCore::RenderMathMLFraction::paint):
1948 * rendering/mathml/RenderMathMLMenclose.cpp:
1949 (WebCore::RenderMathMLMenclose::paint):
1950 * rendering/mathml/RenderMathMLRoot.cpp:
1951 (WebCore::RenderMathMLRoot::paint):
1952 * rendering/mathml/RenderMathMLToken.cpp:
1953 (WebCore::RenderMathMLToken::paint):
1954 * rendering/style/RenderStyle.cpp:
1955 (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
1956 (WebCore::RenderStyle::colorByApplyingColorFilter const):
1957 * rendering/style/RenderStyle.h:
1959 2018-04-26 Mark Lam <mark.lam@apple.com>
1961 Gardening: Speculative build fix for Windows.
1962 https://bugs.webkit.org/show_bug.cgi?id=184976
1963 <rdar://problem/39723901>
1967 * cssjit/CSSPtrTag.h:
1969 2018-04-26 Brent Fulgham <bfulgham@apple.com>
1971 Show punycode if URL contains Latin small letter o with dot below character
1972 https://bugs.webkit.org/show_bug.cgi?id=185051
1973 <rdar://problem/39459297>
1975 Reviewed by David Kilzer.
1977 Revise our "lookalike character" logic to include the small Latin o
1978 with dot below character.
1980 Test: fast/url/host.html
1982 * platform/mac/WebCoreNSURLExtras.mm:
1983 (WebCore::isLookalikeCharacter):
1985 2018-04-26 Daniel Bates <dabates@apple.com>
1987 Fix the build following r231068
1988 (https://bugs.webkit.org/show_bug.cgi?id=185002)
1990 Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
1991 latter does not exist.
1993 * loader/DocumentLoader.cpp:
1994 (WebCore::DocumentLoader::loadMainResource):
1996 2018-04-26 Daniel Bates <dabates@apple.com>
1998 DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
1999 https://bugs.webkit.org/show_bug.cgi?id=185002
2001 Reviewed by Youenn Fablet and Alex Christensen.
2003 In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2004 function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2005 and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2006 takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2007 ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2008 Instead we should WTFMove() the passed request into the CachedResourceRequest.
2010 * loader/DocumentLoader.cpp:
2011 (WebCore::DocumentLoader::loadMainResource):
2013 2018-04-26 Sihui Liu <sihui_liu@apple.com>
2015 -[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
2016 https://bugs.webkit.org/show_bug.cgi?id=184938
2017 <rdar://problem/34737395>
2019 Reviewed by Geoffrey Garen.
2021 When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
2022 was lost so the delete function cannot find the proper cookie to delete.
2023 This patch implements a workaround that compares Cookie object instead of NSHTTPCookie
2024 object. We might want to add the ability to set HTTPOnly header during conversion if there
2025 is an easy way to do it later.
2027 New API test: WebKit.WKHTTPCookieStoreHttpOnly
2029 * platform/network/cocoa/CookieCocoa.mm:
2030 (WebCore::Cookie::operator== const):
2031 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2032 (WebCore::NetworkStorageSession::deleteCookie):
2034 2018-04-26 Commit Queue <commit-queue@webkit.org>
2036 Unreviewed, rolling out r231052.
2037 https://bugs.webkit.org/show_bug.cgi?id=185044
2039 Broke test http/tests/security/credentials-main-resource.html
2040 (Requested by dydz on #webkit).
2044 "DocumentLoader::loadMainResource() should WTFMove() the
2045 passed ResourceRequest"
2046 https://bugs.webkit.org/show_bug.cgi?id=185002
2047 https://trac.webkit.org/changeset/231052
2049 2018-04-26 Jer Noble <jer.noble@apple.com>
2051 WK_COCOA_TOUCH all the things.
2052 https://bugs.webkit.org/show_bug.cgi?id=185006
2054 Reviewed by Tim Horton.
2056 * Configurations/WebCore.xcconfig:
2058 2018-04-26 David Kilzer <ddkilzer@apple.com>
2060 Make WAKScrollView delegate a weak property
2061 <https://webkit.org/b/184799>
2062 <rdar://problem/39469669>
2064 Reviewed by Simon Fraser.
2066 * platform/ios/wak/WAKScrollView.h:
2067 - Remove `delegate` instance variable declaration.
2068 - Declare `delegate` property as weak.
2069 (-[WAKScrollView setDelegate:]): Delete declaration.
2070 (-[WAKScrollView delegate]): Ditto.
2071 * platform/ios/wak/WAKScrollView.mm:
2072 - Synthesize getter/setter methods for `delegate` property.
2073 (-[WAKScrollView setDelegate:]): Delete implementation.
2074 (-[WAKScrollView delegate]): Ditto.
2076 2018-04-26 Youenn Fablet <youenn@apple.com>
2078 CORS preflight checker should add a console message when preflight load is blocked
2079 https://bugs.webkit.org/show_bug.cgi?id=185021
2081 Reviewed by Chris Dumez.
2083 No change of behavior, adding a JS console message when preflight load is blocked.
2084 This mirrors what is being done in preflighting done from NetworkProcess.
2085 Covered by existing tests.
2087 * loader/CrossOriginPreflightChecker.cpp:
2088 (WebCore::CrossOriginPreflightChecker::notifyFinished):
2089 (WebCore::CrossOriginPreflightChecker::doPreflight):
2091 2018-04-26 Daniel Bates <dabates@apple.com>
2093 DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
2094 https://bugs.webkit.org/show_bug.cgi?id=185002
2096 Reviewed by Youenn Fablet and Alex Christensen.
2098 In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2099 function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2100 and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2101 takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2102 ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2103 Instead we should WTFMove() the passed request into the CachedResourceRequest.
2105 * loader/DocumentLoader.cpp:
2106 (WebCore::DocumentLoader::loadMainResource):
2108 2018-04-26 Per Arne Vollan <pvollan@apple.com>
2110 Disable content filtering in minimal simulator mode
2111 https://bugs.webkit.org/show_bug.cgi?id=185027
2112 <rdar://problem/39736091>
2114 Reviewed by Jer Noble.
2116 * Configurations/FeatureDefines.xcconfig:
2118 2018-04-25 Brent Fulgham <bfulgham@apple.com>
2120 Add port 548 (afpovertcp) to port blacklist
2121 https://bugs.webkit.org/show_bug.cgi?id=185000
2122 <rdar://problem/39540481>
2124 Reviewed by David Kilzer.
2126 Tested by security/block-test.html.
2129 (WebCore::portAllowed):Also block port 548.
2131 2018-04-26 Andy VanWagoner <thetalecrafter@gmail.com>
2133 [INTL] Implement Intl.PluralRules
2134 https://bugs.webkit.org/show_bug.cgi?id=184312
2136 Reviewed by JF Bastien.
2138 Added Intl.PluralRules feature flag.
2140 Test: js/intl-pluralrules.html
2142 * Configurations/FeatureDefines.xcconfig:
2144 2018-04-15 Darin Adler <darin@apple.com>
2146 [Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
2147 https://bugs.webkit.org/show_bug.cgi?id=184637
2149 Reviewed by Alexey Proskuryakov.
2151 * crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
2152 HAVE(CCRSAGetCRTComponents) is true.
2154 * crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
2155 enough versions of iOS and macOS that have it and add declarations of the
2156 function for the non-Apple-internal-SDK case. Also don't define the
2157 WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
2159 * crypto/mac/CryptoKeyRSAMac.cpp:
2160 (WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
2162 2018-04-26 Per Arne Vollan <pvollan@apple.com>
2164 Add lazy initialization of caption display mode for videos.
2165 https://bugs.webkit.org/show_bug.cgi?id=184993
2167 The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
2168 is showing up in samples when called from HTMLMediaElement::finishInitialization().
2170 Reviewed by Eric Carlson.
2172 No new tests, covered by existing tests.
2174 * html/HTMLMediaElement.cpp:
2175 (WebCore::HTMLMediaElement::finishInitialization):
2176 (WebCore::HTMLMediaElement::setSelectedTextTrack):
2177 (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2178 (WebCore::HTMLMediaElement::captionPreferencesChanged):
2179 (WebCore::HTMLMediaElement::captionDisplayMode):
2180 * html/HTMLMediaElement.h:
2182 2018-04-26 Zan Dobersek <zdobersek@igalia.com>
2184 [GTK][WPE] Initial ASYNC_SCROLLING support
2185 https://bugs.webkit.org/show_bug.cgi?id=184961
2187 Reviewed by Carlos Garcia Campos.
2189 Add CoordinatedGraphics-specific code that will be required for async
2190 scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
2191 ScrollingTreeCoordinatedGraphics classes are mostly complete already,
2192 but the new ScrollingTreeNode-inheriting classes will need further
2193 work that will have to be done in parallel with other improvements
2194 planned for the CoordinatedGraphics subsystem.
2196 While the build-time flag is enabled, the feature is still not enabled
2197 at runtime due to being marked as unsupported by the DrawingArea
2198 implementation in the WebKit layer. It would also not work yet if it
2199 were enabled due to the before-mentioned pending changes.
2201 Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
2204 * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
2206 * SourcesGTK.txt: Add new files to build.
2207 * SourcesWPE.txt: Ditto.
2208 * page/scrolling/AsyncScrollingCoordinator.cpp:
2209 Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
2210 * page/scrolling/ScrollingTree.h:
2211 * page/scrolling/ThreadedScrollingTree.cpp:
2212 * page/scrolling/ThreadedScrollingTree.h:
2213 currentSnapPointIndicesDidChange() method is only invoked in
2214 Cocoa-specific code, and its implementation calls Cocoa-specific method
2215 on the AsyncScrollingCoordinator class.
2216 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2217 (WebCore::ScrollingCoordinator::create):
2218 (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
2219 (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
2220 (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
2221 (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
2222 (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
2223 (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
2224 (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
2225 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
2226 * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
2227 (WebCore::ScrollingTreeCoordinatedGraphics::create):
2228 (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
2229 (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
2230 * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
2231 * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
2232 (WebCore::ScrollingTreeFixedNode::create):
2233 (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
2234 (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
2235 (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2236 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2237 * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
2238 * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
2239 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
2240 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
2241 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
2242 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
2243 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
2244 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
2245 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
2246 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
2247 * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
2248 * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
2249 (WebCore::ScrollingTreeStickyNode::create):
2250 (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
2251 (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
2252 (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2253 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2254 * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
2255 * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
2256 for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
2257 * platform/TextureMapper.cmake: Two build targets have been moved to
2258 SourcesGTK.txt and SourcesWPE.txt.
2260 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com>
2262 [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
2263 https://bugs.webkit.org/show_bug.cgi?id=184643
2265 Reviewed by Žan Doberšek.
2267 Adapt to single-header WPE includes.
2269 * platform/graphics/egl/GLContextEGLWPE.cpp:
2270 * platform/graphics/wpe/PlatformDisplayWPE.cpp:
2271 * platform/wpe/PlatformPasteboardWPE.cpp:
2273 2018-04-25 Youenn Fablet <youenn@apple.com>
2275 Use NetworkLoadChecker for all subresource loads except fetch/XHR
2276 https://bugs.webkit.org/show_bug.cgi?id=184870
2277 <rdar://problem/39370034>
2279 Reviewed by Chris Dumez.
2281 No change of behavior.
2282 Update CachedResourceLoader error messages to match NetworkProcess error messages.
2284 * loader/cache/CachedResourceLoader.cpp:
2285 (WebCore::CachedResourceLoader::printAccessDeniedMessage const):
2287 2018-04-25 Zalan Bujtas <zalan@apple.com>
2289 [LFC] Add support for is<> and downcast<>
2290 https://bugs.webkit.org/show_bug.cgi?id=185016
2292 Reviewed by Antti Koivisto.
2294 * layout/layouttree/LayoutBlockContainer.cpp:
2295 (WebCore::Layout::BlockContainer::BlockContainer):
2296 * layout/layouttree/LayoutBlockContainer.h:
2297 * layout/layouttree/LayoutBox.cpp:
2298 (WebCore::Layout::Box::Box):
2299 * layout/layouttree/LayoutBox.h:
2300 (WebCore::Layout::Box::isContainer const):
2301 (WebCore::Layout::Box::isBlockContainer const):
2302 (WebCore::Layout::Box::isInlineBox const):
2303 (WebCore::Layout::Box::isInlineContainer const):
2304 * layout/layouttree/LayoutContainer.cpp:
2305 (WebCore::Layout::Container::Container):
2306 * layout/layouttree/LayoutContainer.h:
2307 * layout/layouttree/LayoutInlineBox.cpp:
2308 (WebCore::Layout::InlineBox::InlineBox):
2309 * layout/layouttree/LayoutInlineBox.h:
2310 * layout/layouttree/LayoutInlineContainer.cpp:
2311 (WebCore::Layout::InlineContainer::InlineContainer):
2312 * layout/layouttree/LayoutInlineContainer.h:
2314 2018-04-25 Chris Dumez <cdumez@apple.com>
2316 window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
2317 https://bugs.webkit.org/show_bug.cgi?id=184981
2319 Reviewed by Sam Weinig.
2321 window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
2322 complaining that |this| is not a Window. This was caused by a copy & paste mistake in
2323 JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
2326 No new tests, updated existing tests.
2328 * bindings/js/JSDOMWindowCustom.cpp:
2329 (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2330 * page/RemoteDOMWindow.cpp:
2331 (WebCore::RemoteDOMWindow::postMessage):
2332 * page/RemoteDOMWindow.h:
2333 * page/RemoteDOMWindow.idl:
2335 2018-04-25 Simon Fraser <simon.fraser@apple.com>
2337 brightness() filter should default to 1, and not allow negative values
2338 https://bugs.webkit.org/show_bug.cgi?id=184937
2340 Reviewed by Dean Jackson.
2342 Remove the special-casing for brightness() in consumeFilterFunction(), so it now
2343 follows the same logic as the other color-related filters in not allowing negative
2346 Removed the special-casing for brightness() in createFilterOperations() so its default
2349 Modified existing tests.
2351 * css/StyleResolver.cpp:
2352 (WebCore::StyleResolver::createFilterOperations):
2353 * css/parser/CSSPropertyParserHelpers.cpp:
2354 (WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
2355 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2357 2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com>
2359 Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
2360 https://bugs.webkit.org/show_bug.cgi?id=184999
2362 Reviewed by Tim Horton.
2364 Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
2366 * Configurations/WebCore.xcconfig:
2368 2018-04-25 Zalan Bujtas <zalan@apple.com>
2370 [LFC] Implement LayoutContexet::layout() and its dependencies.
2371 https://bugs.webkit.org/show_bug.cgi?id=184951
2373 Reviewed by Antti Koivisto.
2375 * layout/FormattingContext.cpp:
2376 (WebCore::Layout::FormattingContext::FormattingContext):
2377 (WebCore::Layout::FormattingContext::~FormattingContext):
2378 (WebCore::Layout::FormattingContext::computeStaticPosition):
2379 (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
2380 (WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
2381 (WebCore::Layout::FormattingContext::computeWidth):
2382 (WebCore::Layout::FormattingContext::computeHeight):
2383 (WebCore::Layout::FormattingContext::marginTop):
2384 (WebCore::Layout::FormattingContext::marginLeft):
2385 (WebCore::Layout::FormattingContext::marginBottom):
2386 (WebCore::Layout::FormattingContext::marginRight):
2387 * layout/FormattingContext.h:
2388 * layout/FormattingState.cpp:
2389 (WebCore::Layout::FormattingState::FormattingState):
2390 * layout/FormattingState.h:
2391 * layout/LayoutContext.cpp:
2392 (WebCore::Layout::LayoutContext::LayoutContext):
2393 (WebCore::Layout::LayoutContext::updateLayout):
2394 (WebCore::Layout::LayoutContext::formattingState):
2395 (WebCore::Layout::LayoutContext::formattingContext):
2396 * layout/LayoutContext.h:
2397 * layout/blockformatting/BlockFormattingContext.cpp:
2398 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2399 (WebCore::Layout::BlockFormattingContext::layout):
2400 (WebCore::Layout::BlockFormattingContext::formattingState const):
2401 (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
2402 (WebCore::Layout::BlockFormattingContext::computeWidth):
2403 (WebCore::Layout::BlockFormattingContext::computeHeight):
2404 (WebCore::Layout::BlockFormattingContext::marginTop):
2405 (WebCore::Layout::BlockFormattingContext::marginBottom):
2406 * layout/blockformatting/BlockFormattingContext.h:
2407 * layout/blockformatting/BlockFormattingState.cpp:
2408 (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2409 * layout/blockformatting/BlockFormattingState.h:
2410 * layout/inlineformatting/InlineFormattingContext.cpp:
2411 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2412 (WebCore::Layout::InlineFormattingContext::layout):
2413 (WebCore::Layout::InlineFormattingContext::formattingState const):
2414 * layout/inlineformatting/InlineFormattingContext.h:
2415 * layout/inlineformatting/InlineFormattingState.cpp:
2416 (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2417 * layout/inlineformatting/InlineFormattingState.h:
2419 2018-04-25 Mark Lam <mark.lam@apple.com>
2421 Push the definition of PtrTag down to the WTF layer.
2422 https://bugs.webkit.org/show_bug.cgi?id=184976
2423 <rdar://problem/39723901>
2425 Reviewed by Saam Barati.
2427 No new tests needed. This is covered by existing tests.
2429 * cssjit/CSSPtrTag.h:
2430 * cssjit/SelectorCompiler.h:
2431 (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
2432 (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
2433 (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
2434 (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
2436 2018-04-25 Eric Carlson <eric.carlson@apple.com>
2438 [iOS] remove media element parameter from MediaElementSession methods
2439 https://bugs.webkit.org/show_bug.cgi?id=184992
2440 <rdar://problem/39731624>
2442 Reviewed by Jon Lee.
2444 No new tests, no behavior change.
2446 * Modules/mediacontrols/MediaControlsHost.cpp:
2447 (WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
2448 (WebCore::MediaControlsHost::userGestureRequired const):
2449 * accessibility/AccessibilityMediaObject.cpp:
2450 (WebCore::AccessibilityMediaObject::isPlayingInline const):
2451 * html/HTMLMediaElement.cpp:
2452 (WebCore::HTMLMediaElement::~HTMLMediaElement):
2453 (WebCore::HTMLMediaElement::parseAttribute):
2454 (WebCore::HTMLMediaElement::prepareForLoad):
2455 (WebCore::HTMLMediaElement::selectMediaResource):
2456 (WebCore::HTMLMediaElement::loadResource):
2457 (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2458 (WebCore::HTMLMediaElement::setReadyState):
2459 (WebCore::HTMLMediaElement::play):
2460 (WebCore::HTMLMediaElement::pause):
2461 (WebCore::HTMLMediaElement::pauseInternal):
2462 (WebCore::HTMLMediaElement::setVolume):
2463 (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
2464 (WebCore::HTMLMediaElement::sourceWasAdded):
2465 (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
2466 (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2467 (WebCore::HTMLMediaElement::updatePlayState):
2468 (WebCore::HTMLMediaElement::clearMediaPlayer):
2469 (WebCore::HTMLMediaElement::resume):
2470 (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
2471 (WebCore::HTMLMediaElement::addEventListener):
2472 (WebCore::HTMLMediaElement::removeEventListener):
2473 (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
2474 (WebCore::HTMLMediaElement::exitFullscreen):
2475 (WebCore::HTMLMediaElement::configureMediaControls):
2476 (WebCore::HTMLMediaElement::createMediaPlayer):
2477 (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
2478 (WebCore::HTMLMediaElement::updateMediaState):
2479 (WebCore::HTMLMediaElement::mediaState const):
2480 (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
2481 (WebCore::HTMLMediaElement::updateShouldPlay):
2482 * html/HTMLVideoElement.cpp:
2483 (WebCore::HTMLVideoElement::parseAttribute):
2484 (WebCore::HTMLVideoElement::supportsFullscreen const):
2485 (WebCore::HTMLVideoElement::webkitEnterFullscreen):
2486 (WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
2487 (WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
2488 (WebCore::HTMLVideoElement::setFullscreenMode):
2489 * html/MediaElementSession.cpp:
2490 (WebCore::MediaElementSession::playbackPermitted const):
2491 (WebCore::MediaElementSession::dataLoadingPermitted const):
2492 (WebCore::MediaElementSession::fullscreenPermitted const):
2493 (WebCore::MediaElementSession::pageAllowsDataLoading const):
2494 (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
2495 (WebCore::MediaElementSession::canShowControlsManager const):
2496 (WebCore::MediaElementSession::showPlaybackTargetPicker):
2497 (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
2498 (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
2499 (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2500 (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
2501 (WebCore::MediaElementSession::mediaStateDidChange):
2502 (WebCore::MediaElementSession::effectivePreloadForElement const):
2503 (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
2504 (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
2505 (WebCore::MediaElementSession::mediaEngineUpdated):
2506 (WebCore::MediaElementSession::allowsPictureInPicture const):
2507 * html/MediaElementSession.h:
2508 * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2509 (WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):
2511 2018-04-25 Jiewen Tan <jiewen_tan@apple.com>
2513 Remove access to keychain from the WebContent process
2514 https://bugs.webkit.org/show_bug.cgi?id=184428
2515 <rdar://problem/13150903>
2517 Reviewed by Brent Fulgham.
2521 This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
2522 Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
2523 localized string is marked WEBCORE_EXPORT as well to support the API test.
2525 Covered by existing tests and api tests.
2527 * WebCore.xcodeproj/project.pbxproj:
2529 (WebCore::Document::signedPublicKeyAndChallengeString):
2531 * html/HTMLKeygenElement.cpp:
2532 (WebCore::HTMLKeygenElement::appendFormData):
2533 * page/ChromeClient.h:
2534 * platform/LocalizedStrings.h:
2535 * platform/SSLKeyGenerator.h:
2537 2018-04-25 Ryosuke Niwa <rniwa@webkit.org>
2539 PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
2540 https://bugs.webkit.org/show_bug.cgi?id=184962
2542 Reviewed by Youenn Fablet.
2544 Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
2545 a new WebContent process when navigating to a blob URL, data URL, and about:blank.
2547 Tests: ProcessSwap.SameOriginBlobNavigation
2548 ProcessSwap.CrossOriginBlobNavigation
2549 ProcessSwap.NavigateToAboutBlank
2550 ProcessSwap.NavigateToDataURL
2552 * loader/NavigationAction.cpp:
2553 (WebCore::treatAsSameOriginNavigation):
2554 * loader/NavigationAction.h:
2555 (WebCore::NavigationAction::treatAsSameOriginNavigation const):
2557 2018-04-25 Zalan Bujtas <zalan@apple.com>
2559 [LFC] Implement Layout::BlockContainer functions.
2560 https://bugs.webkit.org/show_bug.cgi?id=184994
2562 Reviewed by Antti Koivisto.
2564 * layout/layouttree/LayoutBlockContainer.cpp:
2565 (WebCore::Layout::BlockContainer::BlockContainer):
2566 (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2568 2018-04-25 Zalan Bujtas <zalan@apple.com>
2570 [LFC] Implement Layout::Container functions.
2571 https://bugs.webkit.org/show_bug.cgi?id=184988
2573 Reviewed by Antti Koivisto.
2575 * layout/layouttree/LayoutContainer.cpp:
2576 (WebCore::Layout::Container::Container):
2577 (WebCore::Layout::Container::firstInFlowChild const):
2578 (WebCore::Layout::Container::firstInFlowOrFloatingChild const):
2579 (WebCore::Layout::Container::lastInFlowChild const):
2580 (WebCore::Layout::Container::lastInFlowOrFloatingChild const):
2581 (WebCore::Layout::Container::setFirstChild):
2582 (WebCore::Layout::Container::setLastChild):
2583 (WebCore::Layout::Container::setOutOfFlowDescendants):
2584 * layout/layouttree/LayoutContainer.h:
2585 (WebCore::Layout::Container::firstChild const):
2586 (WebCore::Layout::Container::lastChild const):
2587 (WebCore::Layout::Container::hasChild const):
2588 (WebCore::Layout::Container::hasInFlowChild const):
2589 (WebCore::Layout::Container::hasInFlowOrFloatingChild const):
2590 (WebCore::Layout::Container::outOfFlowDescendants):
2592 2018-04-25 Brent Fulgham <bfulgham@apple.com>
2594 Don't Block First Party Cookies on Redirects
2595 https://bugs.webkit.org/show_bug.cgi?id=184948
2596 <rdar://problem/39534099>
2598 Reviewed by Youenn Fablet.
2600 The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.
2602 Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
2604 * loader/NavigationScheduler.cpp:
2606 2018-04-25 Youenn Fablet <youenn@apple.com>
2608 CachedRawResource is not handling incremental data computation correctly
2609 https://bugs.webkit.org/show_bug.cgi?id=184936
2611 Reviewed by Chris Dumez.
2613 Covered by updated test.
2615 The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
2616 In service worker case, a SharedBuffer may contain more than one segment.
2617 This is fixed by iterating until all new data is sent to clients.
2619 * loader/cache/CachedRawResource.cpp:
2620 (WebCore::CachedRawResource::updateBuffer):
2622 2018-04-25 Andy Estes <aestes@apple.com>
2624 [Mac] Number of drop items is always 0 when performing a DHTML drag
2625 https://bugs.webkit.org/show_bug.cgi?id=184943
2627 Reviewed by Ryosuke Niwa.
2629 New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop
2631 DragController tracks the number of items to be accepted by a file input element, taking
2632 into account whether the control is disabled or accepts multiple files. When this number
2633 changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
2634 calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
2635 rendered next to the dragging item thumbnails.
2637 When performing a DHTML drag, we don't know how many items the page will accept, so prior
2638 to this patch we would render a "0" in the badge. This is misleading, because the page is
2639 more likely to accept all the items (or at least one of them) rather than none of them.
2641 Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
2642 files in the drag operation when performing a DHTML file drag.
2644 * page/DragController.cpp:
2645 (WebCore::DragController::tryDocumentDrag):
2647 2018-04-25 Eric Carlson <eric.carlson@apple.com>
2649 [iOS] Set route sharing policy when setting audio session category
2650 https://bugs.webkit.org/show_bug.cgi?id=184979
2651 <rdar://problem/39709577>
2653 Reviewed by Jer Noble.
2655 * platform/audio/ios/AudioSessionIOS.mm:
2656 (WebCore::AudioSession::setCategory):
2658 2018-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
2660 [Curl] Fix wrong schema checking on r230973
2661 https://bugs.webkit.org/show_bug.cgi?id=184977
2663 Did write a wrong condition when making a string.
2665 Reviewed by Alex Christensen.
2667 No new tests because test interface is not ready.
2669 * platform/network/curl/CurlProxySettings.cpp:
2670 (WebCore::createProxyUrl):
2672 2018-04-25 Youenn Fablet <youenn@apple.com>
2674 Make DocumentThreadableLoader error logging more consistent
2675 https://bugs.webkit.org/show_bug.cgi?id=184853
2677 Reviewed by Chris Dumez.
2679 Covered by rebased tests.
2680 Make EventSource, XHR and Fetch log error messages consistently.
2681 This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
2682 will issue more and more errors in places different from WK1.
2683 This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.
2685 Update ImageLoader error message to be more general than CORS.
2687 * loader/CrossOriginPreflightChecker.cpp:
2688 (WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
2689 (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
2690 * loader/DocumentThreadableLoader.cpp:
2691 (WebCore::DocumentThreadableLoader::didFail):
2692 (WebCore::DocumentThreadableLoader::preflightFailure):
2693 (WebCore::DocumentThreadableLoader::logErrorAndFail):
2694 * loader/ImageLoader.cpp:
2695 (WebCore::ImageLoader::notifyFinished):
2696 * loader/SubresourceLoader.cpp:
2697 (WebCore::SubresourceLoader::didFail):
2698 * loader/ThreadableLoader.cpp:
2699 (WebCore::ThreadableLoader::logError):
2700 * loader/cache/CachedResource.cpp:
2701 (WebCore::CachedResource::load):
2702 * loader/cache/CachedResourceRequestInitiators.cpp:
2703 (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
2704 * loader/cache/CachedResourceRequestInitiators.h:
2705 * page/EventSource.cpp:
2706 (WebCore::EventSource::connect):
2707 (WebCore::EventSource::didFail):
2708 * xml/XMLHttpRequest.cpp:
2709 (WebCore::XMLHttpRequest::didFail):
2711 2018-04-25 Zalan Bujtas <zalan@apple.com>
2713 [LFC] Implement Layout::Box functions.
2714 https://bugs.webkit.org/show_bug.cgi?id=184974
2716 Reviewed by Antti Koivisto.
2718 * layout/layouttree/LayoutBlockContainer.h:
2719 * layout/layouttree/LayoutBox.cpp:
2720 (WebCore::Layout::Box::Box):
2721 (WebCore::Layout::Box::~Box):
2722 (WebCore::Layout::Box::establishesFormattingContext const):
2723 (WebCore::Layout::Box::establishesBlockFormattingContext const):
2724 (WebCore::Layout::Box::isRelativelyPositioned const):
2725 (WebCore::Layout::Box::isStickyPositioned const):
2726 (WebCore::Layout::Box::isAbsolutelyPositioned const):
2727 (WebCore::Layout::Box::isFixedPositioned const):
2728 (WebCore::Layout::Box::isFloatingPositioned const):
2729 (WebCore::Layout::Box::containingBlock const):
2730 (WebCore::Layout::Box::isDescendantOf const):
2731 (WebCore::Layout::Box::isAnonymous const):
2732 (WebCore::Layout::Box::isInlineBlockBox const):
2733 (WebCore::Layout::Box::isBlockLevelBox const):
2734 (WebCore::Layout::Box::isInlineLevelBox const):
2735 (WebCore::Layout::Box::isBlockContainerBox const):
2736 (WebCore::Layout::Box::isInitialContainingBlock const):
2737 (WebCore::Layout::Box::nextInFlowSibling const):
2738 (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
2739 (WebCore::Layout::Box::previousInFlowSibling const):
2740 (WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
2741 (WebCore::Layout::Box::setParent):
2742 (WebCore::Layout::Box::setNextSibling):
2743 (WebCore::Layout::Box::setPreviousSibling):
2744 (WebCore::Layout::Box::isOverflowVisible const):
2745 * layout/layouttree/LayoutBox.h:
2746 (WebCore::Layout::Box::establishesInlineFormattingContext const):
2747 (WebCore::Layout::Box::isInFlow const):
2748 (WebCore::Layout::Box::isPositioned const):
2749 (WebCore::Layout::Box::isInFlowPositioned const):
2750 (WebCore::Layout::Box::isOutOfFlowPositioned const):
2751 (WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
2752 (WebCore::Layout::Box::parent const):
2753 (WebCore::Layout::Box::nextSibling const):
2754 (WebCore::Layout::Box::previousSibling const):
2755 (WebCore::Layout::Box::weakPtrFactory const):
2756 * layout/layouttree/LayoutContainer.h:
2757 * layout/layouttree/LayoutInlineBox.h:
2758 * layout/layouttree/LayoutInlineContainer.h:
2760 2018-04-25 Per Arne Vollan <pvollan@apple.com>
2762 [Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
2763 https://bugs.webkit.org/show_bug.cgi?id=184953
2765 This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
2766 The crash is only happening in release builds, which also is an indication of this being a
2769 Reviewed by Zalan Bujtas.
2771 No new tests, covered by existing tests.
2773 * rendering/SimpleLineLayoutFunctions.cpp:
2774 (WebCore::SimpleLineLayout::generateLineBoxTree):
2776 2018-04-25 Dean Jackson <dino@apple.com>
2778 Make a better flag for system preview, and disable it where necessary
2779 https://bugs.webkit.org/show_bug.cgi?id=184968
2780 <rdar://problem/39686506>
2782 Reviewed by Eric Carlson.
2784 Use USE(SYSTEM_PREVIEW).
2786 * html/HTMLAnchorElement.cpp:
2787 (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
2788 * html/HTMLAnchorElement.h:
2789 * html/HTMLImageElement.cpp:
2790 * html/HTMLImageElement.h:
2791 * html/HTMLPictureElement.cpp:
2792 * html/HTMLPictureElement.h:
2793 * rendering/RenderImage.cpp:
2794 (WebCore::RenderImage::paintIntoRect):
2795 * rendering/RenderTheme.cpp:
2796 * rendering/RenderTheme.h:
2797 * testing/Internals.cpp:
2798 (WebCore::Internals::systemPreviewRelType):
2799 (WebCore::Internals::isSystemPreviewLink const):
2800 (WebCore::Internals::isSystemPreviewImage const):
2802 2018-04-25 Zalan Bujtas <zalan@apple.com>
2804 Fix project file after r230931.
2806 * WebCore.xcodeproj/project.pbxproj:
2808 2018-04-25 Miguel Gomez <magomez@igalia.com>
2810 [GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
2811 https://bugs.webkit.org/show_bug.cgi?id=184780
2813 Reviewed by Žan Doberšek.
2815 Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.
2817 Covered by existent tests.
2819 * platform/graphics/texmap/TextureMapperLayer.h:
2821 2018-04-25 Carlos Garcia Campos <cgarcia@igalia.com>
2823 [GTK] Implement MouseEvent.buttons
2824 https://bugs.webkit.org/show_bug.cgi?id=184913
2826 Reviewed by Žan Doberšek.
2828 Add helper function to get the state modifier of a GDK button.
2830 * platform/gtk/GtkUtilities.cpp:
2831 (WebCore::stateModifierForGdkButton):
2832 * platform/gtk/GtkUtilities.h:
2834 2018-04-24 Ryosuke Niwa <rniwa@webkit.org>
2836 Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
2837 Document::updateStyleIfNeeded
2838 https://bugs.webkit.org/show_bug.cgi?id=184950
2840 Reviewed by Zalan Bujtas.
2842 Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
2843 by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.
2845 Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
2846 there is no security implication to execute scripts in this isolated document.
2848 Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
2849 style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
2850 I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
2851 by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.
2853 * dom/ScriptDisallowedScope.h: Updated the comment.
2854 * loader/cache/CachedSVGFont.cpp:
2855 (WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.
2857 2018-04-24 Simon Fraser <simon.fraser@apple.com>
2859 visitedDependentColor() should take a CSSPropertyID
2860 https://bugs.webkit.org/show_bug.cgi?id=184949
2862 Reviewed by Sam Weinig.
2864 Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
2865 and RenderElement::selectionColor() to take CSSPropertyID rather than int.
2869 * rendering/RenderElement.cpp:
2870 (WebCore::RenderElement::selectionColor const):
2871 * rendering/RenderElement.h:
2872 * rendering/RenderTableCell.cpp:
2873 (WebCore::RenderTableCell::computeCollapsedStartBorder const):
2874 (WebCore::RenderTableCell::computeCollapsedEndBorder const):
2875 (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
2876 (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
2877 * rendering/style/RenderStyle.cpp:
2878 (WebCore::RenderStyle::colorIncludingFallback const):
2879 (WebCore::RenderStyle::visitedDependentColor const):
2880 * rendering/style/RenderStyle.h:
2882 2018-04-24 Simon Fraser <simon.fraser@apple.com>
2884 Add a new "color-filter" CSS property as an experimental feature
2885 https://bugs.webkit.org/show_bug.cgi?id=184940
2886 rdar://problem/39664904
2888 Reviewed by Jon Lee.
2890 Add a new CSS property called "color-filter" as an experimental feature (off by default).
2892 This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
2893 to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
2894 Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.
2896 Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.
2898 This patch adds support for parsing color-filter.
2900 Test: css3/color-filters/color-filter-parsing.html
2902 * css/CSSComputedStyleDeclaration.cpp:
2903 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2904 * css/CSSProperties.json:
2905 * css/parser/CSSParser.cpp:
2906 (WebCore::CSSParserContext::CSSParserContext):
2907 (WebCore::operator==):
2908 * css/parser/CSSParserMode.h:
2909 * css/parser/CSSPropertyParser.cpp:
2910 (WebCore::CSSPropertyParser::parseSingleValue):
2911 * css/parser/CSSPropertyParserHelpers.cpp:
2912 (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
2913 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2914 (WebCore::CSSPropertyParserHelpers::consumeFilter):
2915 * css/parser/CSSPropertyParserHelpers.h:
2916 * page/Settings.yaml:
2917 * rendering/style/RenderStyle.cpp:
2918 (WebCore::RenderStyle::changeRequiresRepaint const):
2919 * rendering/style/RenderStyle.h:
2920 (WebCore::RenderStyle::mutableColorFilter):
2921 (WebCore::RenderStyle::colorFilter const):
2922 (WebCore::RenderStyle::hasColorFilter const):
2923 (WebCore::RenderStyle::setColorFilter):
2924 (WebCore::RenderStyle::initialColorFilter):
2925 * rendering/style/StyleRareInheritedData.cpp:
2926 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2927 (WebCore::StyleRareInheritedData::operator== const):
2928 (WebCore::StyleRareInheritedData::hasColorFilters const):
2929 * rendering/style/StyleRareInheritedData.h:
2931 2018-04-24 Simon Fraser <simon.fraser@apple.com>
2933 shape-outside and filter styles occur twice in the result of getComputedStyle
2934 https://bugs.webkit.org/show_bug.cgi?id=184931
2936 Reviewed by Antti Koivisto.
2938 CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
2939 used by getComputedStyle. Remove the duplication.
2941 Tested by existing tests.
2943 * css/CSSComputedStyleDeclaration.cpp:
2945 2018-04-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
2947 [Curl] Extract proxy settings into a separate class to hold advanced information.
2948 https://bugs.webkit.org/show_bug.cgi?id=184714
2950 It was simplely structure to hold proxy setting. To support advanced feature of proxy
2951 such as authentication, more inteligent object is required to store intermediate state
2952 or errors. That's why we've introduced new class for that purpose.
2954 Reviewed by Youenn Fablet.
2956 No new tests because there's no new behavior.
2958 * platform/Curl.cmake:
2959 * platform/network/curl/CurlContext.cpp:
2960 (WebCore::CurlHandle::enableProxyIfExists):
2961 (WebCore::CurlContext::ProxyInfo::url const): Deleted.
2962 (WebCore::CurlContext::setProxyInfo): Deleted.
2963 * platform/network/curl/CurlContext.h:
2964 (WebCore::CurlContext::proxySettings const):
2965 (WebCore::CurlContext::setProxySettings):
2966 (WebCore::CurlContext::setProxyUserPass):
2967 (WebCore::CurlContext::proxyInfo const): Deleted.
2968 (WebCore::CurlContext::setProxyInfo): Deleted.
2969 * platform/network/curl/CurlProxySettings.cpp: Added.
2970 (WebCore::CurlProxySettings::CurlProxySettings):
2971 (WebCore::CurlProxySettings::rebuildUrl):
2972 (WebCore::CurlProxySettings::setUserPass):
2973 (WebCore::protocolIsInSocksFamily):
2974 (WebCore::getProxyPort):
2975 (WebCore::createProxyUrl):
2976 * platform/network/curl/CurlProxySettings.h: Added.
2977 (WebCore::CurlProxySettings::CurlProxySettings):
2978 (WebCore::CurlProxySettings::isEmpty const):
2979 (WebCore::CurlProxySettings::mode const):
2980 (WebCore::CurlProxySettings::url const):
2981 (WebCore::CurlProxySettings::ignoreHosts const):
2982 (WebCore::CurlProxySettings::user const):
2983 (WebCore::CurlProxySettings::password const):
2984 * platform/network/curl/CurlRequest.cpp:
2985 (WebCore::CurlRequest::didReceiveHeader):
2986 * platform/network/curl/CurlResponse.h:
2987 (WebCore::CurlResponse::isolatedCopy const):
2988 * platform/network/curl/ResourceResponseCurl.cpp:
2989 (WebCore::ResourceResponse::ResourceResponse):
2991 2018-04-24 Youenn Fablet <youenn@apple.com>
2993 Throw in case of PeerConnection created for detached documents
2994 https://bugs.webkit.org/show_bug.cgi?id=184921
2995 <rdar://problem/39629216>
2997 Reviewed by Eric Carlson.
2999 Add a check to ensure that page is not null when creating a peer connection backend.
3000 In that case, the peer connection constructor will later on throw.
3001 The same for setConfiguration is done.
3002 Behavior is consistent with Chrome.
3004 Test: webrtc/pc-detached-document.html
3006 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3007 (WebCore::createLibWebRTCPeerConnectionBackend):
3008 (WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
3009 (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
3010 (WebCore::libWebRTCProvider): Deleted.
3011 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3013 2018-04-24 John Wilander <wilander@apple.com>
3015 From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
3016 https://bugs.webkit.org/show_bug.cgi?id=184560
3017 <rdar://problem/38901344>
3019 Reviewed by Youenn Fablet and Daniel Bates.
3021 Tests: http/tests/from-origin/document-from-origin-same-accepted.html
3022 http/tests/from-origin/document-from-origin-same-blocked.html
3023 http/tests/from-origin/document-from-origin-same-site-accepted.html
3024 http/tests/from-origin/document-from-origin-same-site-blocked.html
3025 http/tests/from-origin/document-nested-from-origin-same-accepted.html
3026 http/tests/from-origin/document-nested-from-origin-same-blocked.html
3027 http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
3028 http/tests/from-origin/fetch-from-origin-same-accepted.html
3029 http/tests/from-origin/fetch-from-origin-same-blocked.html
3030 http/tests/from-origin/fetch-from-origin-same-site-accepted.html
3031 http/tests/from-origin/fetch-from-origin-same-site-blocked.html
3032 http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
3033 http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
3034 http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
3035 http/tests/from-origin/image-from-origin-same-accepted.html
3036 http/tests/from-origin/image-from-origin-same-blocked.html
3037 http/tests/from-origin/image-from-origin-same-site-accepted.html
3038 http/tests/from-origin/image-from-origin-same-site-blocked.html
3039 http/tests/from-origin/redirect-document-from-origin-same-blocked.html
3040 http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
3041 http/tests/from-origin/redirect-image-from-origin-same-blocked.html
3042 http/tests/from-origin/redirect-script-from-origin-same-blocked.html
3043 http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
3044 http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
3045 http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
3046 http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
3047 http/tests/from-origin/script-from-origin-same-accepted.html
3048 http/tests/from-origin/script-from-origin-same-blocked.html
3049 http/tests/from-origin/script-from-origin-same-site-accepted.html
3050 http/tests/from-origin/script-from-origin-same-site-blocked.html
3051 http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
3052 http/tests/from-origin/xhr-from-origin-same-accepted.html
3053 http/tests/from-origin/xhr-from-origin-same-blocked.html
3054 http/tests/from-origin/xhr-from-origin-same-site-accepted.html
3055 http/tests/from-origin/xhr-from-origin-same-site-blocked.html
3057 * loader/SubresourceLoader.cpp:
3058 (WebCore::SubresourceLoader::didFail):
3059 Outputs the error's localized description in a console message except when the destination
3060 is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
3061 * page/RuntimeEnabledFeatures.h:
3062 (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
3063 (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
3064 Added From-Origin support as an experimental feature.
3065 * platform/network/HTTPHeaderNames.in:
3067 * platform/network/HTTPParsers.cpp:
3068 (WebCore::parseFromOriginHeader):
3069 Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
3070 * platform/network/HTTPParsers.h:
3072 2018-04-24 Antti Koivisto <antti@apple.com>
3074 Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
3075 https://bugs.webkit.org/show_bug.cgi?id=184922
3077 Reviewed by Zalan Bujtas.
3079 To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.
3082 * WebCore.xcodeproj/project.pbxproj:
3083 * layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
3084 * layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
3085 * layout/LayoutCtx.cpp: Removed.
3086 * layout/LayoutCtx.h: Removed.
3087 * page/FrameView.cpp:
3088 (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
3089 (WebCore::FrameView::updateLayoutViewport):
3090 (WebCore::FrameView::updateLayerPositionsAfterScrolling):
3091 (WebCore::FrameView::updateCompositingLayersAfterScrolling):
3092 (WebCore::FrameView::availableContentSizeChanged):
3094 * page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
3095 (WebCore::LayoutScope::LayoutScope):
3096 (WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
3097 (WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
3098 (WebCore::FrameViewLayoutContext::layout):
3099 (WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
3100 (WebCore::FrameViewLayoutContext::runAsynchronousTasks):
3101 (WebCore::FrameViewLayoutContext::flushAsynchronousTasks):
3102 (WebCore::FrameViewLayoutContext::reset):
3103 (WebCore::FrameViewLayoutContext::needsLayout const):
3104 (WebCore::FrameViewLayoutContext::setNeedsLayout):
3105 (WebCore::FrameViewLayoutContext::enableSetNeedsLayout):
3106 (WebCore::FrameViewLayoutContext::disableSetNeedsLayout):
3107 (WebCore::FrameViewLayoutContext::scheduleLayout):
3108 (WebCore::FrameViewLayoutContext::unscheduleLayout):
3109 (WebCore::FrameViewLayoutContext::scheduleSubtreeLayout):
3110 (WebCore::FrameViewLayoutContext::layoutTimerFired):
3111 (WebCore::FrameViewLayoutContext::convertSubtreeLayoutToFullLayout):
3112 (WebCore::FrameViewLayoutContext::setSubtreeLayoutRoot):
3113 (WebCore::FrameViewLayoutContext::canPerformLayout const):
3114 (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
3115 (WebCore::FrameViewLayoutContext::updateStyleForLayout):
3116 (WebCore::FrameViewLayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
3117 (WebCore::FrameViewLayoutContext::startLayoutAtMainFrameViewIfNeeded):
3118 (WebCore::FrameViewLayoutContext::layoutDelta const):
3119 (WebCore::FrameViewLayoutContext::addLayoutDelta):
3120 (WebCore::FrameViewLayoutContext::layoutDeltaMatches):
3121 (WebCore::FrameViewLayoutContext::layoutState const):
3122 (WebCore::FrameViewLayoutContext::pushLayoutState):
3123 (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
3124 (WebCore::FrameViewLayoutContext::popLayoutState):
3125 (WebCore::FrameViewLayoutContext::checkLayoutState):
3126 (WebCore::FrameViewLayoutContext::frame const):
3127 (WebCore::FrameViewLayoutContext::view const):
3128 (WebCore::FrameViewLayoutContext::renderView const):
3129 (WebCore::FrameViewLayoutContext::document const):
3130 (WebCore::LayoutContext::LayoutContext): Deleted.
3131 (WebCore::LayoutContext::~LayoutContext): Deleted.
3132 (WebCore::LayoutContext::layout): Deleted.
3133 (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Deleted.
3134 (WebCore::LayoutContext::runAsynchronousTasks): Deleted.
3135 (WebCore::LayoutContext::flushAsynchronousTasks): Deleted.
3136 (WebCore::LayoutContext::reset): Deleted.
3137 (WebCore::LayoutContext::needsLayout const): Deleted.
3138 (WebCore::LayoutContext::setNeedsLayout): Deleted.
3139 (WebCore::LayoutContext::enableSetNeedsLayout): Deleted.
3140 (WebCore::LayoutContext::disableSetNeedsLayout): Deleted.
3141 (WebCore::LayoutContext::scheduleLayout): Deleted.
3142 (WebCore::LayoutContext::unscheduleLayout): Deleted.
3143 (WebCore::LayoutContext::scheduleSubtreeLayout): Deleted.
3144 (WebCore::LayoutContext::layoutTimerFired): Deleted.
3145 (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout): Deleted.
3146 (WebCore::LayoutContext::setSubtreeLayoutRoot): Deleted.
3147 (WebCore::LayoutContext::canPerformLayout const): Deleted.
3148 (WebCore::LayoutContext::applyTextSizingIfNeeded): Deleted.
3149 (WebCore::LayoutContext::updateStyleForLayout): Deleted.
3150 (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
3151 (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded): Deleted.
3152 (WebCore::LayoutContext::layoutDelta const): Deleted.
3153 (WebCore::LayoutContext::addLayoutDelta): Deleted.
3154 (WebCore::LayoutContext::layoutDeltaMatches): Deleted.
3155 (WebCore::LayoutContext::layoutState const): Deleted.
3156 (WebCore::LayoutContext::pushLayoutState): Deleted.
3157 (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): Deleted.
3158 (WebCore::LayoutContext::popLayoutState): Deleted.
3159 (WebCore::LayoutContext::checkLayoutState): Deleted.
3160 (WebCore::LayoutContext::frame const): Deleted.
3161 (WebCore::LayoutContext::view const): Deleted.
3162 (WebCore::LayoutContext::renderView const): Deleted.
3163 (WebCore::LayoutContext::document const): Deleted.
3164 * page/FrameViewLayoutContext.h: Copied from Source/WebCore/page/LayoutContext.h.
3165 (WebCore::LayoutContext::startDisallowingLayout): Deleted.
3166 (WebCore::LayoutContext::endDisallowingLayout): Deleted.
3167 (WebCore::LayoutContext::layoutPhase const): Deleted.
3168 (WebCore::LayoutContext::isLayoutNested const): Deleted.
3169 (WebCore::LayoutContext::isLayoutPending const): Deleted.
3170 (WebCore::LayoutContext::isInLayout const): Deleted.
3171 (WebCore::LayoutContext::isInRenderTreeLayout const): Deleted.
3172 (WebCore::LayoutContext::inPaintableState const): Deleted.
3173 (WebCore::LayoutContext::layoutCount const): Deleted.
3174 (WebCore::LayoutContext::subtreeLayoutRoot const): Deleted.
3175 (WebCore::LayoutContext::clearSubtreeLayoutRoot): Deleted.
3176 (WebCore::LayoutContext::resetFirstLayoutFlag): Deleted.
3177 (WebCore::LayoutContext::didFirstLayout const): Deleted.
3178 (WebCore::LayoutContext::setNeedsFullRepaint): Deleted.
3179 (WebCore::LayoutContext::needsFullRepaint const): Deleted.
3180 (WebCore::LayoutContext::isPaintOffsetCacheEnabled const): Deleted.
3181 (WebCore::LayoutContext::layoutDisallowed const): Deleted.
3182 (WebCore::LayoutContext::isLayoutSchedulingEnabled const): Deleted.
3183 (WebCore::LayoutContext::inAsynchronousTasks const): Deleted.
3184 (WebCore::LayoutContext::disablePaintOffsetCache): Deleted.
3185 (WebCore::LayoutContext::enablePaintOffsetCache): Deleted.
3186 * page/LayoutContext.cpp: Removed.
3187 * page/LayoutContext.h: Removed.
3188 * rendering/LayoutState.cpp:
3189 (WebCore::LayoutState::LayoutState):
3190 (WebCore::LayoutState::computePaginationInformation):
3191 (WebCore::LayoutState::establishLineGrid):
3192 (WebCore::LayoutStateDisabler::LayoutStateDisabler):
3193 * rendering/LayoutState.h:
3195 2018-04-24 Mark Lam <mark.lam@apple.com>
3197 Need to acquire the VM lock before calling toNumber on a JSValue.
3198 https://bugs.webkit.org/show_bug.cgi?id=184924
3199 <rdar://problem/39690679>
3201 Reviewed by Saam Barati.
3203 * bridge/objc/objc_utility.mm:
3204 (JSC::Bindings::convertValueToObjcValue):
3206 2018-04-24 Tadeu Zagallo <tzagallo@apple.com>
3208 REGRESSION(r221839): Fix requests with FormData containing empty files
3209 https://bugs.webkit.org/show_bug.cgi?id=184490
3210 <rdar://problem/39385169>
3212 Reviewed by Geoffrey Garen.
3214 We should not append the blob to the FormData when it is a file but has no path. It broke
3215 the submission since the request was failing to read the file in FormDataStreamCFNet.h:156
3217 Test: http/tests/local/formdata/send-form-data-with-empty-file.html
3219 * platform/network/FormData.cpp:
3220 (WebCore::FormData::appendMultiPartFileValue):
3222 2018-04-24 Zalan Bujtas <zalan@apple.com>
3224 Fix project file after r230931.
3226 * WebCore.xcodeproj/project.pbxproj:
3228 2018-04-24 Jer Noble <jer.noble@apple.com>
3230 Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
3231 https://bugs.webkit.org/show_bug.cgi?id=184786
3233 Reviewed by Tim Horton.
3235 * Configurations/WebCore.xcconfig:
3236 * DerivedSources.make:
3237 * WebCore.xcodeproj/project.pbxproj:
3239 2018-04-24 Zan Dobersek <zdobersek@igalia.com>
3241 [CoordGraphics] Remove dead fixed layer code
3242 https://bugs.webkit.org/show_bug.cgi?id=184912
3244 Reviewed by Michael Catanzaro.
3246 Remove CoordinatedGraphicsLayer::setFixedToViewport() and the
3247 corresponding attribute on the CoordinatedGraphicsLayerState struct.
3248 The method is not called anywhere since r230952.
3250 CoordinatedGraphicsState struct also loses the scrollPosition attribute
3251 that also isn't used anymore.
3253 Changes to GraphicsLayerTextureMapper class mirror those made to
3254 CoordinatedGraphicsLayer, removing support for the fixed-to-viewport
3255 attribute. This too was not called from anywhere.
3257 All that enables us removing fixed-to-viewport handling in the
3258 TextureMapperLayer class. Along with related changes in the
3259 CoordinatedGraphicsScene class, we're able to remove a bunch of methods
3260 and member variables that are not used or needed anymore.
3262 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3263 (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
3264 (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
3265 (WebCore::GraphicsLayerTextureMapper::setFixedToViewport): Deleted.
3266 * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3267 * platform/graphics/texmap/TextureMapperLayer.cpp:
3268 (WebCore::TextureMapperLayer::computeTransformsRecursive):
3269 (WebCore::TextureMapperLayer::setFixedToViewport): Deleted.
3270 (WebCore::TextureMapperLayer::isAncestorFixedToViewport const): Deleted.
3271 (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): Deleted.
3272 * platform/graphics/texmap/TextureMapperLayer.h:
3273 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3274 (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3275 (WebCore::CoordinatedGraphicsLayer::syncLayerState):
3276 (WebCore::CoordinatedGraphicsLayer::setFixedToViewport): Deleted.
3277 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3278 * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3279 (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3281 2018-04-24 Zan Dobersek <zdobersek@igalia.com>
3283 [CoordGraphics] Remove unused fixed layout functionality
3284 https://bugs.webkit.org/show_bug.cgi?id=184908
3286 Reviewed by Carlos Garcia Campos.
3288 Ports using the CoordinatedGraphics subsystem don't expose fixed layout
3289 support. As such, we're able to remove a lot of unused code and
3290 unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
3291 in both WebCore and WebKit.
3293 With fixed layout not available for use to users of the GTK+ and WPE
3294 ports, we can remove the ScrollingCoordinatorCoordinatedGraphics
3295 implementation, making room for an implementation that inherits from
3296 AsyncScrollingCoordinator in the future. For that purpose the
3297 ScrollingCoordinator::create() function is moved into the
3298 ScrollingCoordinatorCoordinatedGraphics.cpp file already.
3300 This also enables removing delegatedScrollRequested() method from
3301 HostWindow and the inheriting ChromeClient interface.
3303 * loader/EmptyClients.h:
3305 (WebCore::Chrome::delegatedScrollRequested): Deleted.
3307 * page/ChromeClient.h:
3308 * page/scrolling/ScrollingCoordinator.cpp:
3309 (WebCore::ScrollingCoordinator::create):
3310 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
3311 (WebCore::ScrollingCoordinator::create):
3312 (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): Deleted.
3313 (WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree): Deleted.
3314 (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree): Deleted.
3315 (WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree): Deleted.
3316 (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer): Deleted.
3317 (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): Deleted.
3318 (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate): Deleted.
3319 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Removed.
3320 * platform/HostWindow.h:
3322 2018-04-24 Daniel Bates <dabates@apple.com>
3324 Attempt to fix the Apple Internal build following r230922
3325 (https://bugs.webkit.org/show_bug.cgi?id=184737)
3327 Cast the return value of std::map::size() to a size_t before logging it with format specifier
3328 "%zu". std::map::size() returns a size_type. According to <http://en.cppreference.com/w/cpp/container/map>
3329 size_type is "usually a size_t", but it may not be. An Apple Internal debug builder reports
3330 that size_type = unsigned int != unsigned long = size_t.
3332 * Modules/mediasource/SourceBuffer.cpp:
3333 (WebCore::SourceBuffer::provideMediaData):
3335 2018-04-24 Zan Dobersek <zdobersek@igalia.com>
3337 [CoordGraphics] Avoid painting backing stores for zero-opacity layers
3338 https://bugs.webkit.org/show_bug.cgi?id=184143
3340 Reviewed by Carlos Garcia Campos.
3342 Skip generating backing stores for layers that have zero opacity and do
3343 not animate the opacity value. In the current CoordinatedGraphics system
3344 this can end up saving loads of memory on Web content that deploys a
3345 large number of such elements.
3347 * platform/graphics/texmap/TextureMapperLayer.h:
3348 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3349 (WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):
3351 2018-04-24 Daniel Bates <dabates@apple.com>
3353 Attempt to fix the Apple Internal build following r230944
3354 (https://bugs.webkit.org/show_bug.cgi?id=159464)
3356 * platform/network/mac/CookieJarMac.mm:
3358 2018-04-24 Daniel Bates <dabates@apple.com>
3360 Another attempt to fix the Mac and iOS build following r230944
3361 (https://bugs.webkit.org/show_bug.cgi?id=159464)
3363 * platform/network/mac/CookieJarMac.mm:
3364 (WebCore::policyProperties):
3366 2018-04-24 Daniel Bates <dabates@apple.com>
3368 Attempt to fix the Mac and iOS build following r230944
3369 (https://bugs.webkit.org/show_bug.cgi?id=159464)
3371 * platform/network/mac/CookieJarMac.mm:
3372 (WebCore::policyProperties):
3374 2018-04-23 Daniel Bates <dabates@apple.com>
3376 Implement Same-Site cookies
3377 https://bugs.webkit.org/show_bug.cgi?id=159464
3378 <rdar://problem/27196358>
3380 Reviewed by Brent Fulgham.
3382 Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
3383 The implementation is materially consistent with the spec. though implements the computation
3384 for a document's "site for cookies" indirectly as part of loading its frame. This is done to
3385 avoid traversing the frame tree on each subresource request initiated by the document or one
3386 of its workers. We take advantage of the fact that Web Workers and Service Workers use their
3387 host document's loader to load resources on their behalf to use the correct "site for cookies"
3388 for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
3389 host document's "site for cookies" in the worker's script execution context.
3391 The implementation differs from the spec. in the handling of about: URLs and the empty URL
3392 and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
3393 consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
3394 (16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
3395 are treated as same-site because these URLs inherit their origin from their owner.
3397 Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
3398 http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
3399 http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
3400 http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
3401 http/tests/cookies/same-site/fetch-in-about-blank-page.html
3402 http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
3403 http/tests/cookies/same-site/fetch-in-cross-origin-page.html
3404 http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
3405 http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
3406 http/tests/cookies/same-site/fetch-in-same-origin-page.html
3407 http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
3408 http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
3409 http/tests/cookies/same-site/fetch-in-same-origin-worker.html
3410 http/tests/cookies/same-site/popup-cross-site-post.html
3411 http/tests/cookies/same-site/popup-cross-site.html
3412 http/tests/cookies/same-site/popup-same-site-post.html
3413 http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
3414 http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
3415 http/tests/cookies/same-site/popup-same-site.html
3417 * Sources.txt: Add source file SameSiteInfo.cpp.
3418 * WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
3420 (WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
3421 (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
3422 (WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
3424 (WebCore::Document::firstPartyForSameSiteCookies const): Added.
3425 (WebCore::Document::setFirstPartyForSameSiteCookies): Added.
3426 * loader/CookieJar.cpp:
3427 (WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.