1 2018-05-03 Yusuke Suzuki <utatane.tea@gmail.com>
3 Use pointer instead of std::optional<T&>
4 https://bugs.webkit.org/show_bug.cgi?id=185186
6 Reviewed by Alex Christensen.
8 std::optional<T&> is not accepted in C++17 spec.
9 In this patch, we replace it with T*, which is well-aligned to
12 * Modules/mediastream/RTCPeerConnection.cpp:
13 (WebCore::iceServersFromConfiguration):
14 (WebCore::RTCPeerConnection::initializeConfiguration):
15 (WebCore::RTCPeerConnection::setConfiguration):
16 * css/parser/CSSParser.cpp:
17 (WebCore::CSSParser::parseSystemColor):
18 * css/parser/CSSParser.h:
19 * dom/DatasetDOMStringMap.cpp:
20 (WebCore::DatasetDOMStringMap::item const):
21 (WebCore::DatasetDOMStringMap::namedItem const):
22 (WebCore:: const): Deleted.
23 * dom/DatasetDOMStringMap.h:
25 (WebCore::Element::insertAdjacentHTML):
27 * html/canvas/CanvasStyle.cpp:
28 (WebCore::parseColor):
29 * inspector/DOMEditor.cpp:
30 * platform/network/curl/CurlFormDataStream.cpp:
31 (WebCore::CurlFormDataStream::getPostData):
33 * platform/network/curl/CurlFormDataStream.h:
34 * platform/network/curl/CurlRequest.cpp:
35 (WebCore::CurlRequest::setupPOST):
36 * testing/MockCDMFactory.cpp:
37 (WebCore::MockCDMFactory::keysForSessionWithID const):
38 (WebCore::MockCDMInstance::updateLicense):
39 (WebCore:: const): Deleted.
40 * testing/MockCDMFactory.h:
42 2018-05-03 Chris Dumez <cdumez@apple.com>
44 Stop using an iframe's id as fallback if its name attribute is not set
45 https://bugs.webkit.org/show_bug.cgi?id=11388
47 Reviewed by Geoff Garen.
49 WebKit had logic to use an iframe's id as fallback name when its name
50 content attribute is not set. This behavior was not standard and did not
52 - https://html.spec.whatwg.org/#attr-iframe-name
54 Gecko / Trident never behaved this way. Blink was aligned with us until
55 they started to match the specification in:
56 - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
58 This WebKit quirk was causing some Web-compatibility issues because it
59 would affect the behavior of Window's name property getter when trying
60 to look up an iframe by id. Because of Window's named property getter
61 behavior [1], we would return the frame's contentWindow instead of the
62 iframe element itself.
64 [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
66 Test: fast/dom/Window/named-getter-frame-id.html
68 * html/HTMLFrameElementBase.cpp:
69 (WebCore::HTMLFrameElementBase::openURL):
70 (WebCore::HTMLFrameElementBase::parseAttribute):
71 (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
72 * html/HTMLFrameElementBase.h:
74 2018-05-03 Eric Carlson <eric.carlson@apple.com>
76 [iOS] Internal text and audio tracks not in fullscreen menu
77 https://bugs.webkit.org/show_bug.cgi?id=185268
78 <rdar://problem/38673440>
80 Reviewed by Jer Noble.
82 * platform/cocoa/PlaybackSessionModelMediaElement.mm:
83 (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
84 events are fired at the track lists, not the media element.
86 2018-05-03 Ryosuke Niwa <rniwa@webkit.org>
88 Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
89 https://bugs.webkit.org/show_bug.cgi?id=185238
91 Reviewed by Antti Koivisto.
93 The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
94 even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
96 Test: fast/images/imagemap-in-nested-shadow-tree.html
97 fast/images/imagemap-in-shadow-tree.html
100 (WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
101 (WebCore::Document::removeImageElementByUsemap): Ditto.
102 (WebCore::Document::imageElementByUsemap const): Ditto.
105 (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
106 (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
107 which used to call this function with the raw value of the usemap content attribute now calls it
108 via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
109 (WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
110 (WebCore::TreeScope::removeImageElementByUsemap): Ditto.
111 (WebCore::TreeScope::imageElementByUsemap const): Ditto.
113 * html/HTMLImageElement.cpp:
114 (WebCore::HTMLImageElement::parseAttribute):
115 (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
116 if it's connected to a document.
117 (WebCore::HTMLImageElement::removedFromAncestor):
118 (WebCore::HTMLImageElement::associatedMapElement const):
119 * html/HTMLImageElement.h:
120 * html/HTMLMapElement.cpp:
121 (WebCore::HTMLMapElement::imageElement):
122 * rendering/RenderImage.cpp:
123 (WebCore::RenderImage::imageMap const):
125 2018-05-03 Justin Fan <justin_fan@apple.com>
127 [WebGL] Add runtime flag for enabling ASTC support in WebGL
128 https://bugs.webkit.org/show_bug.cgi?id=184840
130 Reviewed by Myles C. Maxfield.
132 Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
134 * page/RuntimeEnabledFeatures.h:
135 (WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
136 (WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
138 2018-05-03 Chris Nardi <cnardi@chromium.org>
140 Remove [NoInterfaceObject] from DOMRectList
141 https://bugs.webkit.org/show_bug.cgi?id=185255
143 Reviewed by Chris Dumez.
145 In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
146 from DOMRectList. Remove it from our implementation to match the spec, as well as
149 Updated web platform tests IDL test for the Geometry spec.
151 * dom/DOMRectList.idl:
153 2018-05-03 Chris Dumez <cdumez@apple.com>
155 REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
156 https://bugs.webkit.org/show_bug.cgi?id=185073
157 <rdar://problem/39821223>
159 Reviewed by Alexey Proskuryakov.
161 The following changes were made:
162 - Make sure SocketStream callbacks are always scheduled on the right runloop:
163 WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
164 main runloop otherwise.
165 - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
166 before calling methods on the SocketStream client. Previously, this code path
167 was specific to Windows but there is no reason to have platform-specific code here.
168 callOnMainThreadAndWait() calls the function right away if we're already on the main
169 thread, which will be the case on other platform than Windows.
171 * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
172 (WebCore::callbacksRunLoop):
173 (WebCore::callbacksRunLoopMode):
174 (WebCore::SocketStreamHandleImpl::scheduleStreams):
175 (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
176 (WebCore::SocketStreamHandleImpl::executePACFileURL):
177 (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
178 (WebCore::SocketStreamHandleImpl::readStreamCallback):
179 (WebCore::SocketStreamHandleImpl::writeStreamCallback):
180 (WebCore::SocketStreamHandleImpl::platformClose):
182 2018-05-03 Zalan Bujtas <zalan@apple.com>
184 [LFC] Enable multiple layout roots for incremental layout.
185 https://bugs.webkit.org/show_bug.cgi?id=185185
187 Reviewed by Antti Koivisto.
189 With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
190 When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
191 the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
193 * layout/FormattingState.h:
194 * layout/LayoutContext.cpp:
195 (WebCore::Layout::LayoutContext::updateLayout):
196 (WebCore::Layout::LayoutContext::addLayoutEntryPoint):
197 * layout/LayoutContext.h:
199 2018-05-03 Zalan Bujtas <zalan@apple.com>
201 [LFC] Box invalidation logic should go to dedicated classes.
202 https://bugs.webkit.org/show_bug.cgi?id=185249
204 Reviewed by Antti Koivisto.
206 Each formatting context can initiate a different type of invalidation when
207 style attribute changes in a box.
210 * WebCore.xcodeproj/project.pbxproj:
211 * layout/FormattingState.cpp:
212 (WebCore::Layout::FormattingState::FormattingState):
213 * layout/FormattingState.h:
214 (WebCore::Layout::FormattingState::isBlockFormattingState const):
215 (WebCore::Layout::FormattingState::isInlineFormattingState const):
216 * layout/LayoutContext.cpp:
217 (WebCore::Layout::LayoutContext::styleChanged):
218 (WebCore::Layout::LayoutContext::markNeedsUpdate):
219 * layout/LayoutContext.h:
220 * layout/blockformatting/BlockFormattingState.cpp:
221 (WebCore::Layout::BlockFormattingState::BlockFormattingState):
222 * layout/blockformatting/BlockFormattingState.h:
223 * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
224 (WebCore::Layout::BlockInvalidation::invalidate):
225 * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
226 * layout/inlineformatting/InlineFormattingState.cpp:
227 (WebCore::Layout::InlineFormattingState::InlineFormattingState):
228 * layout/inlineformatting/InlineFormattingState.h:
229 * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
230 (WebCore::Layout::InlineInvalidation::invalidate):
231 * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
233 2018-05-03 Michael Catanzaro <mcatanzaro@igalia.com>
235 WebKit should send fake macOS user agent to docs.google.com
236 https://bugs.webkit.org/show_bug.cgi?id=185165
238 Reviewed by Carlos Garcia Campos.
240 * platform/UserAgentQuirks.cpp:
241 (WebCore::urlRequiresMacintoshPlatform):
242 (WebCore::urlRequiresLinuxDesktopPlatform):
244 2018-05-03 Commit Queue <commit-queue@webkit.org>
246 Unreviewed, rolling out r231223 and r231288.
247 https://bugs.webkit.org/show_bug.cgi?id=185256
249 The change in r231223 breaks internal builds, and r231288 is a
250 dependent change. (Requested by ryanhaddad on #webkit).
254 "Use default std::optional if it is provided"
255 https://bugs.webkit.org/show_bug.cgi?id=185159
256 https://trac.webkit.org/changeset/231223
258 "Use pointer instead of
259 std::optional<std::reference_wrapper<>>"
260 https://bugs.webkit.org/show_bug.cgi?id=185186
261 https://trac.webkit.org/changeset/231288
263 2018-05-03 Ryan Haddad <ryanhaddad@apple.com>
265 Unreviewed, rolling out r231253.
267 The API test added with this change is crashing on the bots.
271 "Web Inspector: opt out of process swap on navigation if a Web
272 Inspector frontend is connected"
273 https://bugs.webkit.org/show_bug.cgi?id=184861
274 https://trac.webkit.org/changeset/231253
276 2018-05-03 Youenn Fablet <youenn@apple.com>
278 A MediaStream being played should allow removing some of its tracks
279 https://bugs.webkit.org/show_bug.cgi?id=185233
281 Reviewed by Eric Carlson.
283 Update the tracks out of the for loop.
284 Test: fast/mediastream/change-tracks-media-stream-being-played.html
286 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
287 (WebCore::updateTracksOfType):
289 2018-05-03 Miguel Gomez <magomez@igalia.com>
291 WebCore::TextureMapperLayer object used after freed
292 https://bugs.webkit.org/show_bug.cgi?id=184729
294 Reviewed by Michael Catanzaro.
296 Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
297 inside TextureMapperLayer.
299 * platform/graphics/texmap/TextureMapperLayer.cpp:
300 (WebCore::TextureMapperLayer::~TextureMapperLayer):
301 (WebCore::TextureMapperLayer::setMaskLayer):
302 (WebCore::TextureMapperLayer::setReplicaLayer):
303 * platform/graphics/texmap/TextureMapperLayer.h:
305 2018-05-03 Basuke Suzuki <Basuke.Suzuki@sony.com>
307 [Curl] Add OpenSSL/LibreSSL multi-threading support
308 https://bugs.webkit.org/show_bug.cgi?id=185138
310 The older OpenSSL manual says the locking_function and threadid_function should
311 be set when use it in multi-threading environment. This applies to LibreSSL also.
312 https://www.openssl.org/docs/man1.0.2/crypto/threads.html
314 For unix and other similar os, the default threadId_function implementation is
315 good enough. We'll set custom callback only for Windows OS.
317 Note it's not required for OpenSSL 1.1.0 and after.
318 https://www.openssl.org/blog/blog/2017/02/21/threads/
320 Reviewed by Per Arne Vollan.
322 * platform/network/curl/CurlSSLHandle.cpp:
323 (WebCore::CurlSSLHandle::CurlSSLHandle):
324 (WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
325 (WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
326 (WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
327 * platform/network/curl/CurlSSLHandle.h:
328 (WebCore::CurlSSLHandle::ThreadSupport::setup):
329 (WebCore::CurlSSLHandle::ThreadSupport::singleton):
330 (WebCore::CurlSSLHandle::ThreadSupport::lock):
331 (WebCore::CurlSSLHandle::ThreadSupport::unlock):
333 2018-05-02 Ryosuke Niwa <rniwa@webkit.org>
335 Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
336 https://bugs.webkit.org/show_bug.cgi?id=185227
338 Reviewed by Chris Dumez.
340 Removed the check. The attribute value string can never be null.
343 (WebCore::Element::removeAttributeInternal):
345 2018-05-02 Zalan Bujtas <zalan@apple.com>
347 [LFC] Implement LayoutContext::createDisplayBox
348 https://bugs.webkit.org/show_bug.cgi?id=185158
350 Reviewed by Antti Koivisto.
352 Now compute*() functions take both the const layout and the corresponding non-const display boxes.
353 Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
354 (This might need to change in the future if we decide to arrange them in some sort of painting order)
356 * layout/FloatingContext.cpp:
357 (WebCore::Layout::FloatingContext::computePosition):
358 * layout/FloatingContext.h:
359 * layout/FormattingContext.cpp:
360 (WebCore::Layout::FormattingContext::computeStaticPosition const):
361 (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
362 (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
363 (WebCore::Layout::FormattingContext::computeWidth const):
364 (WebCore::Layout::FormattingContext::computeHeight const):
365 (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
366 (WebCore::Layout::FormattingContext::computeFloatingWidth const):
367 (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
368 (WebCore::Layout::FormattingContext::computeFloatingHeight const):
369 * layout/FormattingContext.h:
370 * layout/LayoutContext.cpp:
371 (WebCore::Layout::LayoutContext::createDisplayBox):
372 * layout/LayoutContext.h:
373 (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
374 * layout/blockformatting/BlockFormattingContext.cpp:
375 (WebCore::Layout::BlockFormattingContext::layout const):
376 (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
377 (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
378 (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
379 * layout/blockformatting/BlockFormattingContext.h:
380 * layout/displaytree/DisplayBox.h:
381 (WebCore::Display::Box::parent const): Deleted.
382 (WebCore::Display::Box::nextSibling const): Deleted.
383 (WebCore::Display::Box::previousSibling const): Deleted.
384 (WebCore::Display::Box::firstChild const): Deleted.
385 (WebCore::Display::Box::lastChild const): Deleted.
386 (WebCore::Display::Box::setParent): Deleted.
387 (WebCore::Display::Box::setNextSibling): Deleted.
388 (WebCore::Display::Box::setPreviousSibling): Deleted.
389 (WebCore::Display::Box::setFirstChild): Deleted.
390 (WebCore::Display::Box::setLastChild): Deleted.
392 * layout/inlineformatting/InlineFormattingContext.cpp:
393 (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
394 (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
395 * layout/inlineformatting/InlineFormattingContext.h:
397 2018-05-02 Said Abou-Hallawa <sabouhallawa@apple.com>
399 Hiding then showing an <object> of type image makes the underlaying image disappear
400 https://bugs.webkit.org/show_bug.cgi?id=185216
401 <rdar://problem/39055630>
403 Reviewed by Youenn Fablet.
405 Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
406 RenderImage with the CachedImage of its ImageLoader when the RenderImage
409 Test: fast/images/object-image-hide-show.html
411 * html/HTMLPlugInImageElement.cpp:
412 (WebCore::HTMLPlugInImageElement::didAttachRenderers):
413 This is very similar to what we do in HTMLImageElement::didAttachRenderers().
416 2018-05-02 Brent Fulgham <bfulgham@apple.com>
418 Use RetainPtr for form input type
419 https://bugs.webkit.org/show_bug.cgi?id=185210
420 <rdar://problem/39734040>
422 Reviewed by Ryosuke Niwa.
424 Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
426 Test: fast/forms/access-key-mutation-2.html.
428 * html/HTMLInputElement.cpp:
429 (WebCore::HTMLInputElement::HTMLInputElement):
430 (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
431 (WebCore::HTMLInputElement::accessKeyAction):
432 (WebCore::HTMLInputElement::parseAttribute):
433 (WebCore::HTMLInputElement::appendFormData):
434 * html/HTMLInputElement.h:
435 * html/InputType.cpp:
436 (WebCore::createInputType):
437 (WebCore::InputType::create):
438 (WebCore::InputType::createText):
441 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
443 Use pointer instead of std::optional<std::reference_wrapper<>>
444 https://bugs.webkit.org/show_bug.cgi?id=185186
446 Reviewed by Alex Christensen.
448 std::optional<T&> is not accepted in C++17 spec. So we replaced it
449 with std::optional<std::reference_wrapper<T>>.
451 In this patch, we replace it with T*, which is well-aligned to
454 * Modules/mediastream/RTCPeerConnection.cpp:
455 (WebCore::iceServersFromConfiguration):
456 (WebCore::RTCPeerConnection::initializeConfiguration):
457 (WebCore::RTCPeerConnection::setConfiguration):
458 * css/parser/CSSParser.cpp:
459 (WebCore::CSSParser::parseSystemColor):
460 * css/parser/CSSParser.h:
461 * dom/DatasetDOMStringMap.cpp:
462 (WebCore::DatasetDOMStringMap::item const):
463 (WebCore::DatasetDOMStringMap::namedItem const):
464 * dom/DatasetDOMStringMap.h:
466 (WebCore::Element::insertAdjacentHTML):
468 * html/canvas/CanvasStyle.cpp:
469 (WebCore::parseColor):
470 * inspector/DOMEditor.cpp:
471 * platform/network/curl/CurlFormDataStream.cpp:
472 (WebCore::CurlFormDataStream::getPostData):
473 * platform/network/curl/CurlFormDataStream.h:
474 * platform/network/curl/CurlRequest.cpp:
475 (WebCore::CurlRequest::setupPOST):
476 * testing/MockCDMFactory.cpp:
477 (WebCore::MockCDMFactory::keysForSessionWithID const):
478 (WebCore::MockCDMInstance::updateLicense):
479 * testing/MockCDMFactory.h:
481 2018-05-02 Keith Rollin <krollin@apple.com>
483 Add facility for tracking times and results of page and resource loading
484 https://bugs.webkit.org/show_bug.cgi?id=184838
485 <rdar://problem/36548974>
487 Reviewed by Brent Fulgham.
489 Update FrameProgressTracker to send the necessary page load start/stop
490 signals so that we can track the entire page load at a network level.
491 Add an empty override of the pure virtual
492 LoaderStrategy::pageLoadCompleted method.
494 No new tests. There is no testable effect from these changes. On
495 Cocoa, measurable changes take place in another (non-WebKit) process.
496 On non-Cocoa systems, this facility is currently disabled.
498 * loader/FrameLoader.cpp:
499 (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
500 * loader/LoaderStrategy.h:
502 2018-05-02 Aditya Keerthi <akeerthi@apple.com>
504 Can't copy and paste URLs that have no title into Mail (macOS)
505 https://bugs.webkit.org/show_bug.cgi?id=185205
506 <rdar://problem/36352406>
508 Reviewed by Tim Horton.
510 The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
512 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.
514 Augmented WebKitLegacy.ContextMenuCanCopyURL test
516 * platform/mac/PasteboardMac.mm:
517 (WebCore::writeURLForTypes):
519 2018-05-01 Ryosuke Niwa <rniwa@webkit.org>
521 REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
522 https://bugs.webkit.org/show_bug.cgi?id=182188
523 <rdar://problem/36689240>
525 Reviewed by Antti Koivisto.
527 Fixed the crash by removing up the release assert.
529 The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
530 Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
531 without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
532 in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
533 invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
534 whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
536 There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
537 true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
538 this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
540 This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
541 since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
542 and there is no evidence that r225868 has led to new UAFs even after five months.
544 No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
547 (WebCore::Document::removeSVGUseElement):
549 2018-05-02 Dirk Schulze <dschulze@chromium.org>
551 getCharNumAtPosition should take DOMPointInit as argument
552 https://bugs.webkit.org/show_bug.cgi?id=184695
554 Reviewed by Antti Koivisto.
556 Extend existing tests for getCharNumAtPosition.
558 * svg/SVGTextContentElement.cpp:
559 (WebCore::SVGTextContentElement::getCharNumAtPosition):
560 * svg/SVGTextContentElement.h:
561 * svg/SVGTextContentElement.idl: Use DOMPointInit argument.
563 2018-05-02 Youenn Fablet <youenn@apple.com>
565 Use NetworkLoadChecker for navigation loads
566 https://bugs.webkit.org/show_bug.cgi?id=184892
567 <rdar://problem/39652686>
569 Reviewed by Chris Dumez.
571 Sanitize headers according response tainting.
572 If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
573 If tainting is Opaque, we filter all uncommon headers.
574 If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
575 Covered by updated test.
577 * platform/network/ResourceResponseBase.cpp:
578 (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
579 (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
580 * platform/network/ResourceResponseBase.h:
582 2018-05-02 Myles C. Maxfield <mmaxfield@apple.com>
584 Collection fragment identifiers don't use PostScript names
585 https://bugs.webkit.org/show_bug.cgi?id=184624
586 <rdar://problem/39432089>
588 Reviewed by Simon Fraser.
590 In a previous version of the CSS Fonts spec, there was text saying that items in font collections
591 should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
592 inserting an item into the middle of a collection would throw off all content that uses the file.
593 Instead, the spec has since changed to use PostScript names (so the content instead would say
594 MyFonts.ttc#MyFont-Regular).
596 Test: fast/text/font-collection.html
598 * css/CSSFontFaceSource.cpp:
599 (WebCore::CSSFontFaceSource::load):
600 * loader/cache/CachedFont.cpp:
601 (WebCore::CachedFont::calculateItemInCollection const):
602 (WebCore::CachedFont::ensureCustomFontData):
603 (WebCore::CachedFont::createCustomFontData):
604 (WebCore::CachedFont::calculateIndex const): Deleted.
605 * loader/cache/CachedFont.h:
606 * platform/graphics/mac/FontCustomPlatformData.cpp:
607 (WebCore::createFontCustomPlatformData):
608 * platform/graphics/mac/FontCustomPlatformData.h:
610 2018-05-02 Brian Burg <bburg@apple.com>
612 Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
613 https://bugs.webkit.org/show_bug.cgi?id=184861
614 <rdar://problem/39153768>
616 Reviewed by Ryosuke Niwa.
618 Notify the client of the current connection count whenever a frontend connects or disconnects.
620 Covered by new API test.
622 * inspector/InspectorClient.h:
623 (WebCore::InspectorClient::frontendCountChanged):
624 * inspector/InspectorController.cpp:
625 (WebCore::InspectorController::connectFrontend):
626 (WebCore::InspectorController::disconnectFrontend):
627 (WebCore::InspectorController::disconnectAllFrontends):
628 * inspector/InspectorController.h:
630 2018-05-02 Carlos Alberto Lopez Perez <clopez@igalia.com>
632 [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
633 https://bugs.webkit.org/show_bug.cgi?id=185207
635 Reviewed by Michael Catanzaro.
637 Remove unneeded include of gstgldisplay_wayland.h
639 No new tests, no change in behaviour.
641 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
643 2018-05-02 Chris Dumez <cdumez@apple.com>
645 document.open() event listener removal is not immediate
646 https://bugs.webkit.org/show_bug.cgi?id=185191
648 Reviewed by Darin Adler.
650 We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
651 whenever they get removed from the EventListenerMap. We were doing so correctly
652 in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
653 updates clear() accordingly.
655 The reason we need to set this flag is that RegisteredEventListeners is RefCounted
656 and EventTarget::fireEventListeners() may be currently running and calling
657 each listener one by one, holding a reference to all listener of a given event.
659 Test: fast/dom/Document/document-open-removes-all-listeners.html
661 * dom/EventListenerMap.cpp:
662 (WebCore::EventListenerMap::clear):
664 2018-05-02 Zalan Bujtas <zalan@apple.com>
666 Use WeakPtr in GridCell
667 https://bugs.webkit.org/show_bug.cgi?id=185180
668 <rdar://problem/39432165>
670 Reviewed by Antti Koivisto.
672 Since GridCell does not own the renderers, it should
673 construct weak pointers.
675 Unable to create a reliably reproducible test case.
677 * rendering/Grid.cpp:
678 (WebCore::Grid::insert):
679 (WebCore::GridIterator::nextGridItem):
681 * rendering/RenderGrid.cpp:
682 (WebCore::RenderGrid::firstLineBaseline const):
684 2018-05-02 Eric Carlson <eric.carlson@apple.com>
686 [iOS] Provide audio route information when invoking AirPlay picker
687 https://bugs.webkit.org/show_bug.cgi?id=185199
688 <rdar://problem/39853103>
690 Reviewed by Jer Noble.
692 No new tests, this requires a specific hardware setup.
695 (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
698 * html/MediaElementSession.cpp:
699 (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
701 * loader/EmptyClients.h:
702 * page/ChromeClient.h:
705 (WebCore::Page::showPlaybackTargetPicker): Ditto.
708 * platform/audio/AudioSession.cpp:
709 (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
710 (WebCore::routingContextUID const): Ditto.
711 * platform/audio/AudioSession.h:
713 * platform/audio/ios/AudioSessionIOS.mm:
714 (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
715 (WebCore::AudioSession::routingContextUID const): Return the route context UID.
717 2018-05-02 Dean Jackson <dino@apple.com>
719 Draw SystemPreview badge to specification on iOS
720 https://bugs.webkit.org/show_bug.cgi?id=185203
721 <rdar://problem/39908855>
723 Reviewed by Tim Horton.
725 Use CoreImage to render a badge with a blurred background,
728 This will be tested internally while we're getting artwork
729 from WebKitAdditions.
731 * Configurations/WebCore.xcconfig: Link against CoreImage.
732 * rendering/RenderThemeIOS.h:
733 * rendering/RenderThemeIOS.mm:
734 (WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
735 in the iOS platform RenderTheme that draws the system preview.
737 2018-05-01 Brent Fulgham <bfulgham@apple.com>
739 Prevent Debug ASSERT when changing forms
740 https://bugs.webkit.org/show_bug.cgi?id=185173
741 <rdar://problem/39738669>
743 Reviewed by Ryosuke Niwa.
745 Form submission could trigger a debug assertion during validation when
746 a form is changed during an input submission. Fix this by cleaning up
747 the event handling logic and make it more consistent with modern WebKit
750 Test: fast/forms/form-submission-crash-3.html
752 * html/HTMLButtonElement.cpp:
753 (WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
754 attempting to perform event handling.
755 * html/HTMLFormElement.cpp:
756 (WebCore::HTMLFormElement::reportValidity): Ditto.
757 (WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
758 since we expect this to happen earlier in the layout pass. Add an assertion that the
760 * html/ImageInputType.cpp:
761 (WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
762 attempting to perform event handling.
763 * html/SubmitInputType.cpp:
764 (WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
766 2018-05-02 Jer Noble <jer.noble@apple.com>
768 Unreviewed; address review comments made before landing r231231.
770 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
771 (VideoFullscreenControllerContext::volume const):
773 2018-05-02 Jer Noble <jer.noble@apple.com>
775 Pipe volume through PlaybackSessionManager/Proxy.
776 https://bugs.webkit.org/show_bug.cgi?id=185182
778 Reviewed by Eric Carlson.
780 Add support for the volume property to PlaybackSessionModel, and all its clients.
782 * platform/cocoa/PlaybackSessionModel.h:
783 (WebCore::PlaybackSessionModelClient::volumeChanged):
784 * platform/cocoa/PlaybackSessionModelMediaElement.h:
785 * platform/cocoa/PlaybackSessionModelMediaElement.mm:
786 (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
787 (WebCore::PlaybackSessionModelMediaElement::setVolume):
788 (WebCore::PlaybackSessionModelMediaElement::volume const):
789 * platform/ios/PlaybackSessionInterfaceAVKit.h:
790 * platform/ios/PlaybackSessionInterfaceAVKit.mm:
791 (WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
792 * platform/ios/WebAVPlayerController.h:
793 * platform/ios/WebAVPlayerController.mm:
794 (-[WebAVPlayerController volume]):
795 (-[WebAVPlayerController setVolume:]):
796 (-[WebAVPlayerController volumeChanged:]):
797 (-[WebAVPlayerController resetMediaState]):
798 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
799 (VideoFullscreenControllerContext::volumeChanged):
800 (VideoFullscreenControllerContext::volume const):
801 (VideoFullscreenControllerContext::setVolume):
803 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
805 Unreviewed, fix build in WinCairo
806 https://bugs.webkit.org/show_bug.cgi?id=185169
808 * bindings/js/JSDOMWindowBase.cpp:
809 (WebCore::JSDOMWindowBase::instantiateStreaming):
810 * bindings/js/JSDOMWindowBase.h:
812 2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com>
814 Use default std::optional if it is provided
815 https://bugs.webkit.org/show_bug.cgi?id=185159
817 Reviewed by JF Bastien.
819 * Modules/mediastream/RTCPeerConnection.cpp:
820 (WebCore::iceServersFromConfiguration):
821 (WebCore::RTCPeerConnection::setConfiguration):
822 * css/parser/CSSParser.cpp:
823 (WebCore::CSSParser::parseSystemColor):
824 * css/parser/CSSParser.h:
825 * dom/DatasetDOMStringMap.cpp:
826 (WebCore::DatasetDOMStringMap::item const):
827 (WebCore::DatasetDOMStringMap::namedItem const):
828 (WebCore:: const): Deleted.
829 * dom/DatasetDOMStringMap.h:
831 (WebCore::Element::insertAdjacentHTML):
833 * inspector/DOMEditor.cpp:
834 * platform/network/curl/CurlFormDataStream.cpp:
835 (WebCore::CurlFormDataStream::getPostData):
837 * platform/network/curl/CurlFormDataStream.h:
838 * testing/MockCDMFactory.cpp:
839 (WebCore::MockCDMFactory::keysForSessionWithID const):
840 (WebCore::MockCDMInstance::updateLicense):
841 (WebCore:: const): Deleted.
842 * testing/MockCDMFactory.h:
844 2018-05-01 Chris Dumez <cdumez@apple.com>
846 Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
847 https://bugs.webkit.org/show_bug.cgi?id=185181
849 Reviewed by Geoffrey Garen.
851 Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
852 on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
853 which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
854 to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
855 the UIthread instead of the WebThread on iOS WebKitLegacy.
857 * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
858 (WebCore::SocketStreamHandleImpl::scheduleStreams):
859 (WebCore::SocketStreamHandleImpl::readStreamCallback):
861 2018-05-01 Wenson Hsieh <wenson_hsieh@apple.com>
863 Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
865 * page/RuntimeEnabledFeatures.h:
867 2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
869 Fix build error after r231194
870 https://bugs.webkit.org/show_bug.cgi?id=185169
872 Reviewed by JF Bastien.
874 Prevent compile error in iOS Simulator debug build
877 * bindings/js/JSDOMWindowBase.cpp:
878 (WebCore::JSDOMWindowBase::compileStreaming):
879 (WebCore::JSDOMWindowBase::instantiateStreaming):
881 2018-05-01 Oleksandr Skachkov <gskachkov@gmail.com>
883 WebAssembly: add support for stream APIs - JavaScript API
884 https://bugs.webkit.org/show_bug.cgi?id=183442
886 Reviewed by Yusuke Suzuki and JF Bastien.
888 Add WebAssembly streaming API to WebCore.
890 * Configurations/FeatureDefines.xcconfig:
891 * bindings/js/JSDOMWindowBase.cpp:
892 (WebCore::tryAllocate):
893 (WebCore::isResponseCorrect):
894 (WebCore::handleResponseOnStreamingAction):
895 (WebCore::JSDOMWindowBase::compileStreaming):
896 (WebCore::JSDOMWindowBase::instantiateStreaming):
897 * bindings/js/JSDOMWindowBase.h:
898 * bindings/js/JSRemoteDOMWindowBase.cpp:
899 * bindings/js/JSWorkerGlobalScopeBase.cpp:
901 2018-04-30 Myles C. Maxfield <mmaxfield@apple.com>
903 Improve the performance of FontCascadeDescription's effectiveFamilies
904 https://bugs.webkit.org/show_bug.cgi?id=184720
905 <rdar://problem/38970927>
907 Reviewed by Simon Fraser.
909 The page that had the performance problem renders many different Chinese characters in system-ui
910 with only a small number of individual fonts. It turns out we were calling into the system-ui
911 machinery for each character in order to opportunistically start loading data URLs (see also:
912 https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
913 font, so we don't need to invoke the system-ui machinery at all.
915 This patch makes a 92x performance improvement on the associated performance test. This test is
916 designed to test Chinese text rendered with system-ui.
918 Performance test: Layout/system-ui.html
920 * platform/graphics/FontCascadeFonts.cpp:
921 (WebCore::opportunisticallyStartFontDataURLLoading):
923 2018-04-30 Jer Noble <jer.noble@apple.com>
925 <img src=mp4> does not display on ios despite Accept: video/* advertisement
926 https://bugs.webkit.org/show_bug.cgi?id=185029
927 <rdar://problem/39771989>
929 Reviewed by Eric Carlson.
931 Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
932 even if the resource request is successfully fulfilled prior to the return. Always return YES in
933 the case that loading succeeded.
935 * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
936 (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
938 2018-04-30 Zalan Bujtas <zalan@apple.com>
940 REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
941 https://bugs.webkit.org/show_bug.cgi?id=185142
942 <rdar://problem/39821446>
944 Reviewed by Simon Fraser.
946 Set the overflow rect on the inline textbox when needed.
948 Test: fast/text/simple-line-layout-selection-with-overflow.html
950 * rendering/SimpleLineLayoutFunctions.cpp:
951 (WebCore::SimpleLineLayout::initializeInlineTextBox):
952 (WebCore::SimpleLineLayout::generateLineBoxTree):
953 (WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
955 2018-04-30 JF Bastien <jfbastien@apple.com>
957 Use some C++17 features
958 https://bugs.webkit.org/show_bug.cgi?id=185135
960 Reviewed by Alex Christensen.
962 As discussed here [0] let's move WebKit to a subset of C++17. We
963 now require GCC 6 [1] which means that, according to [2] we can
964 use the following C++17 language features (I removed some
967 - New auto rules for direct-list-initialization
968 - static_assert with no message
969 - typename in a template template parameter
970 - Nested namespace definition
971 - Attributes for namespaces and enumerators
972 - u8 character literals
973 - Allow constant evaluation for all non-type template arguments
975 - Unary fold expressions and empty parameter packs
976 - __has_include in preprocessor conditional
977 - Differing begin and end types in range-based for
978 - Improving std::pair and std::tuple
980 Consult the Tony Tables [3] to see before / after examples.
982 Of course we can use any library feature if we're willing to
983 import them to WTF (and they don't require language support).
986 [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
987 [1]: https://trac.webkit.org/changeset/231152/webkit
988 [2]: https://en.cppreference.com/w/cpp/compiler_support
989 [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
991 * DerivedSources.make:
992 * platform/URLParser.cpp: work around an odd GCC 6 bug with class
993 static value as a template parameter.
994 (WebCore::URLParser::percentDecode):
995 (WebCore::URLParser::domainToASCII):
996 (WebCore::URLParser::hasForbiddenHostCodePoint):
997 (WebCore::URLParser::parseHostAndPort):
998 * platform/URLParser.h:
1000 2018-04-30 Wenson Hsieh <wenson_hsieh@apple.com>
1002 [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
1003 https://bugs.webkit.org/show_bug.cgi?id=185132
1004 <rdar://problem/39834562>
1006 Reviewed by Tim Horton.
1008 Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
1009 `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
1010 behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
1012 Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
1014 * dom/ViewportArguments.cpp:
1015 (WebCore::setViewportFeature):
1016 (WebCore::operator<<):
1017 * dom/ViewportArguments.h:
1019 Removes the `minDeviceWidth` viewport argument.
1021 * page/RuntimeEnabledFeatures.h:
1022 (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
1023 (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
1025 Removes the runtime switch for `min-device-width`.
1027 * page/ViewportConfiguration.cpp:
1028 (WebCore::platformDeviceWidthOverride):
1030 Hard-code the override device width in extra zoom mode.
1032 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
1034 In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
1035 device width is less than the override device width.
1037 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1038 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
1039 (WebCore::ViewportConfiguration::updateConfiguration):
1040 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1042 Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
1043 device width is greater than the override device width.
1045 (WebCore::computedMinDeviceWidth): Deleted.
1046 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
1047 * page/ViewportConfiguration.h:
1049 2018-04-30 Chris Nardi <cnardi@chromium.org>
1051 Serialize font-variation-settings with double-quotes per spec
1052 https://bugs.webkit.org/show_bug.cgi?id=182542
1054 Reviewed by Myles C. Maxfield.
1056 According to the CSSOM spec [1], all strings should be serialized with double-quotes.
1057 The axis name in font-variation-settings was previously serialized with single-quotes;
1058 change this to double-quotes to match the spec and non-WebKit browsers.
1060 [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
1062 Updated fast/text/variations/getComputedStyle.html to test the change.
1064 * css/CSSFontVariationValue.cpp:
1065 (WebCore::CSSFontVariationValue::customCSSText const):
1067 2018-04-30 Chris Dumez <cdumez@apple.com>
1069 Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
1070 https://bugs.webkit.org/show_bug.cgi?id=185134
1072 Reviewed by Geoffrey Garen.
1074 Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
1075 and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
1078 * dom/MessagePort.cpp:
1079 (WebCore::MessagePort::dispatchMessages):
1081 2018-04-30 Simon Fraser <simon.fraser@apple.com>
1083 Make color-filter affect caret-color
1084 https://bugs.webkit.org/show_bug.cgi?id=185129
1085 rdar://problem/39829066
1087 Reviewed by Tim Horton.
1089 Transform the colors used to compare the caret color with the background through
1090 color-filter (since we want contrasting colors after filters are applied), and
1091 transform caret-color itself.
1093 Test: css3/color-filters/color-filter-caret-color.html
1095 * editing/FrameSelection.cpp:
1096 (WebCore::CaretBase::paintCaret const):
1098 2018-04-30 Michael Catanzaro <mcatanzaro@igalia.com>
1100 [GTK] Webkit should spoof as Safari on a Mac when on Chase.com
1101 https://bugs.webkit.org/show_bug.cgi?id=185103
1103 Reviewed by Carlos Garcia Campos.
1105 Send a fake user agent to chase.com to make it work.
1107 * platform/UserAgentQuirks.cpp:
1108 (WebCore::urlRequiresMacintoshPlatform):
1109 (WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
1111 2018-04-29 Simon Fraser <simon.fraser@apple.com>
1113 Make color-filter affect <attachment>
1114 https://bugs.webkit.org/show_bug.cgi?id=185122
1115 rdar://problem/39818763
1117 Reviewed by Tim Horton.
1119 Convert the colors used to render <attachment> through color-filter, except
1120 for those parts that render over the icon (like the progress bar).
1122 Not easily testable.
1124 * rendering/RenderThemeMac.mm:
1125 (WebCore::titleTextColorForAttachment):
1126 (WebCore::AttachmentLayout::layOutTitle):
1127 (WebCore::AttachmentLayout::layOutSubtitle):
1128 (WebCore::paintAttachmentIconBackground):
1129 (WebCore::paintAttachmentTitleBackground):
1130 (WebCore::paintAttachmentPlaceholderBorder):
1132 2018-04-28 Simon Fraser <simon.fraser@apple.com>
1134 Fix color-filter to apply to SVG colors
1135 https://bugs.webkit.org/show_bug.cgi?id=185113
1136 rdar://problem/39665082
1138 Reviewed by Dean Jackson.
1140 Convert SVG colors through color-filter operations for the places in SVG
1141 that use color, namely fill and stroke, gradients, lighting colors and
1144 Test: css3/color-filters/svg/color-filter-inline-svg.html
1146 * rendering/svg/RenderSVGResourceGradient.cpp:
1147 (WebCore::RenderSVGResourceGradient::applyResource):
1148 * rendering/svg/RenderSVGResourceGradient.h:
1149 * rendering/svg/RenderSVGResourceLinearGradient.cpp:
1150 (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
1151 * rendering/svg/RenderSVGResourceLinearGradient.h:
1152 * rendering/svg/RenderSVGResourceRadialGradient.cpp:
1153 (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
1154 * rendering/svg/RenderSVGResourceRadialGradient.h:
1155 * rendering/svg/RenderSVGResourceSolidColor.cpp:
1156 (WebCore::RenderSVGResourceSolidColor::applyResource):
1157 * svg/SVGFEDiffuseLightingElement.cpp:
1158 (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
1159 (WebCore::SVGFEDiffuseLightingElement::build):
1160 * svg/SVGFEDropShadowElement.cpp:
1161 (WebCore::SVGFEDropShadowElement::build):
1162 * svg/SVGFEFloodElement.cpp:
1163 (WebCore::SVGFEFloodElement::build):
1164 * svg/SVGFESpecularLightingElement.cpp:
1165 (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
1166 (WebCore::SVGFESpecularLightingElement::build):
1168 2018-04-29 Michael Catanzaro <mcatanzaro@igalia.com>
1170 [CMake] Require GCC 6
1171 https://bugs.webkit.org/show_bug.cgi?id=184985
1173 Reviewed by Alex Christensen.
1175 Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
1177 * platform/graphics/FourCC.h:
1178 (WebCore::FourCC::FourCC):
1180 2018-04-29 Zalan Bujtas <zalan@apple.com>
1182 [LFC] Implement Display::Box functions
1183 https://bugs.webkit.org/show_bug.cgi?id=185116
1185 Reviewed by Antti Koivisto.
1187 * layout/displaytree/DisplayBox.cpp:
1188 (WebCore::Display::Box::Box):
1189 (WebCore::Display::Box::~Box):
1190 (WebCore::Display::Box::marginBox const):
1191 (WebCore::Display::Box::borderBox const):
1192 (WebCore::Display::Box::paddingBox const):
1193 (WebCore::Display::Box::contentBox const):
1194 * layout/displaytree/DisplayBox.h:
1195 (WebCore::Display::Box::rect const):
1196 (WebCore::Display::Box::top const):
1197 (WebCore::Display::Box::left const):
1198 (WebCore::Display::Box::bottom const):
1199 (WebCore::Display::Box::right const):
1200 (WebCore::Display::Box::topLeft const):
1201 (WebCore::Display::Box::bottomRight const):
1202 (WebCore::Display::Box::size const):
1203 (WebCore::Display::Box::width const):
1204 (WebCore::Display::Box::height const):
1205 (WebCore::Display::Box::marginTop const):
1206 (WebCore::Display::Box::marginLeft const):
1207 (WebCore::Display::Box::marginBottom const):
1208 (WebCore::Display::Box::marginRight const):
1209 (WebCore::Display::Box::parent const):
1210 (WebCore::Display::Box::nextSibling const):
1211 (WebCore::Display::Box::previousSibling const):
1212 (WebCore::Display::Box::firstChild const):
1213 (WebCore::Display::Box::lastChild const):
1214 (WebCore::Display::Box::setRect):
1215 (WebCore::Display::Box::setTopLeft):
1216 (WebCore::Display::Box::setTop):
1217 (WebCore::Display::Box::setLeft):
1218 (WebCore::Display::Box::setSize):
1219 (WebCore::Display::Box::setWidth):
1220 (WebCore::Display::Box::setHeight):
1221 (WebCore::Display::Box::setMarginTop):
1222 (WebCore::Display::Box::setMarginLeft):
1223 (WebCore::Display::Box::setMarginBottom):
1224 (WebCore::Display::Box::setMarginRight):
1225 (WebCore::Display::Box::setBorderTop):
1226 (WebCore::Display::Box::setBorderLeft):
1227 (WebCore::Display::Box::setBorderBottom):
1228 (WebCore::Display::Box::setBorderRight):
1229 (WebCore::Display::Box::setPaddingTop):
1230 (WebCore::Display::Box::setPaddingLeft):
1231 (WebCore::Display::Box::setPaddingBottom):
1232 (WebCore::Display::Box::setPaddingRight):
1233 (WebCore::Display::Box::setParent):
1234 (WebCore::Display::Box::setNextSibling):
1235 (WebCore::Display::Box::setPreviousSibling):
1236 (WebCore::Display::Box::setFirstChild):
1237 (WebCore::Display::Box::setLastChild):
1239 2018-04-29 Youenn Fablet <youenn@apple.com>
1241 Make RestrictedHTTPResponseAccess flag true by default
1242 https://bugs.webkit.org/show_bug.cgi?id=185089
1244 Reviewed by Geoffrey Garen.
1246 * page/RuntimeEnabledFeatures.h:
1248 2018-04-28 Sihui Liu <sihui_liu@apple.com>
1250 [Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
1251 https://bugs.webkit.org/show_bug.cgi?id=185052
1253 Reviewed by Geoffrey Garen.
1255 Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could
1256 create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
1257 function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
1260 Modified API test: WebKit.WKHTTPCookieStoreHttpOnly
1262 * platform/network/cocoa/CookieCocoa.mm:
1263 (WebCore::Cookie::operator NSHTTPCookie * const):
1264 (WebCore::Cookie::operator== const):
1265 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1266 (WebCore::NetworkStorageSession::deleteCookie):
1268 2018-04-28 Zalan Bujtas <zalan@apple.com>
1270 [LFC] Add LayoutTreeBuilder class to generate the layout tree
1271 https://bugs.webkit.org/show_bug.cgi?id=185108
1273 Reviewed by Antti Koivisto.
1275 This is for testing purposes.
1277 * WebCore.xcodeproj/project.pbxproj:
1278 * layout/FormattingState.cpp:
1279 (WebCore::Layout::FormattingState::~FormattingState):
1280 * layout/FormattingState.h:
1281 * layout/LayoutContext.h:
1282 * layout/blockformatting/BlockFormattingState.cpp:
1283 (WebCore::Layout::BlockFormattingState::~BlockFormattingState):
1284 * layout/blockformatting/BlockFormattingState.h:
1285 * layout/inlineformatting/InlineFormattingState.cpp:
1286 (WebCore::Layout::InlineFormattingState::~InlineFormattingState):
1287 * layout/inlineformatting/InlineFormattingState.h:
1288 * layout/layouttree/LayoutBlockContainer.h:
1289 * layout/layouttree/LayoutBox.h:
1290 * layout/layouttree/LayoutContainer.h:
1291 * layout/layouttree/LayoutInlineContainer.h:
1292 * layout/layouttree/LayoutTreeBuilder.cpp: Added.
1293 (WebCore::Layout::TreeBuilder::createLayoutTree):
1294 (WebCore::Layout::TreeBuilder::createSubTree):
1295 (WebCore::Layout::outputLayoutBox):
1296 (WebCore::Layout::outputLayoutTree):
1297 (WebCore::Layout::TreeBuilder::showLayoutTree):
1298 (WebCore::Layout::printLayoutTreeForLiveDocuments):
1299 * layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
1300 * page/mac/PageMac.mm:
1301 (WebCore::Page::platformInitialize):
1303 2018-04-28 Zalan Bujtas <zalan@apple.com>
1305 [LFC] Implement BlockMarginCollapse functions.
1306 https://bugs.webkit.org/show_bug.cgi?id=185036
1308 Reviewed by Antti Koivisto.
1310 * layout/blockformatting/BlockMarginCollapse.cpp:
1311 (WebCore::Layout::marginValue):
1312 (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
1313 (WebCore::Layout::BlockMarginCollapse::marginTop const):
1314 (WebCore::Layout::BlockMarginCollapse::marginBottom const):
1315 (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
1316 (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
1317 (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
1318 (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
1319 (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
1320 (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
1321 (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
1322 (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
1323 (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
1324 * layout/blockformatting/BlockMarginCollapse.h:
1325 * layout/layouttree/LayoutBox.h:
1326 (WebCore::Layout::Box::style const):
1328 2018-04-27 David Kilzer <ddkilzer@apple.com>
1330 Add logging when SpringBoard enables WebThread
1331 <https://webkit.org/b/185100>
1332 <rdar://problem/39746542>
1334 Reviewed by Daniel Bates.
1336 * platform/RuntimeApplicationChecks.h:
1337 (WebCore::IOSApplication::isSpringBoard): Add declaration.
1338 * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1339 (WebCore::IOSApplication::isSpringBoard): Add implementation.
1340 * platform/ios/wak/WebCoreThread.mm:
1341 (WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
1344 2018-04-27 Keith Rollin <krollin@apple.com>
1346 Fix crash in DocumentLoader::startLoadingMainResource
1347 https://bugs.webkit.org/show_bug.cgi?id=185088
1348 rdar://problem/39689263
1350 Reviewed by Chris Dumez.
1352 Add a "protectedThis" to address a case where a deleted "this" was
1353 accessed in a RELEASE_LOG statement.
1355 No new tests -- covered by existing tests, which now pass.
1357 * loader/DocumentLoader.cpp:
1358 (WebCore::DocumentLoader::startLoadingMainResource):
1360 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1362 Implement color-filter for text stroke
1363 https://bugs.webkit.org/show_bug.cgi?id=185098
1365 Reviewed by Alan Bujtas.
1367 Transform the text stroke color through color-filter.
1369 Test: css3/color-filters/color-filter-text-stroke.html
1371 * rendering/TextPaintStyle.cpp:
1372 (WebCore::computeTextPaintStyle):
1374 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1376 Implement animation for color-filter
1377 https://bugs.webkit.org/show_bug.cgi?id=185092
1378 rdar://problem/39773810
1380 Reviewed by Tim Horton.
1382 Implement animation of color-filter.
1384 This requires tracking whether the color-filter function lists match for both old and new
1385 animation code paths.
1387 The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
1388 which has to pass the propertyID to the blend function so we know which "lists match" to check.
1389 This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.
1391 Test: css3/color-filters/color-filter-animation.html
1393 * animation/CSSPropertyBlendingClient.h:
1394 * animation/KeyframeEffectReadOnly.cpp:
1395 (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
1396 (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
1397 * animation/KeyframeEffectReadOnly.h:
1398 * page/animation/AnimationBase.h:
1399 * page/animation/CSSPropertyAnimation.cpp:
1400 (WebCore::blendFunc):
1401 (WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
1402 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1403 (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
1404 (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
1405 (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
1406 (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
1407 * page/animation/ImplicitAnimation.cpp:
1408 (WebCore::ImplicitAnimation::reset):
1409 (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
1410 * page/animation/ImplicitAnimation.h:
1411 * page/animation/KeyframeAnimation.cpp:
1412 (WebCore::KeyframeAnimation::KeyframeAnimation):
1413 (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
1414 * page/animation/KeyframeAnimation.h:
1416 2018-04-27 Zalan Bujtas <zalan@apple.com>
1418 [LFC] Add FormattingContext::computeWidth/computeHeight logic.
1419 https://bugs.webkit.org/show_bug.cgi?id=185091
1421 Reviewed by Antti Koivisto.
1423 Inflow width and height can't really be computed without knowing the exact context.
1425 * layout/FormattingContext.cpp:
1426 (WebCore::Layout::FormattingContext::computeWidth const):
1427 (WebCore::Layout::FormattingContext::computeHeight const):
1428 (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1429 (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1430 (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1431 (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1432 * layout/FormattingContext.h:
1433 * layout/blockformatting/BlockFormattingContext.cpp:
1434 (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1435 (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1436 (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
1437 (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
1438 * layout/blockformatting/BlockFormattingContext.h:
1439 * layout/inlineformatting/InlineFormattingContext.cpp:
1440 (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
1441 (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
1442 * layout/inlineformatting/InlineFormattingContext.h:
1444 2018-04-27 Chris Dumez <cdumez@apple.com>
1446 Use WindowProxy instead of DOMWindow in our IDL
1447 https://bugs.webkit.org/show_bug.cgi?id=185022
1449 Reviewed by Sam Weinig.
1451 Stop using DOMWindow in all of our IDL files and use WindowProxy as
1452 per their respective specifications. As a result, the implementation
1453 as also updated to use WindowProxy type instead of DOMWindow.
1455 * WebCore.xcodeproj/project.pbxproj:
1456 * bindings/js/JSDOMConvertWindowProxy.h: Removed.
1457 * bindings/js/JSWindowProxy.cpp:
1458 (WebCore::JSWindowProxy::windowProxy const):
1459 (WebCore::JSWindowProxy::toWrapped):
1460 * bindings/js/JSWindowProxy.h:
1462 Use static_cast<>() instead of jsCast<>() because jsCast<>()
1463 relies on classInfo() which is not allowed to be called during
1464 JS sweep due to an assertion inside classInfo(). The JSWindowProxy
1465 objects are held strongly by the WindowProxy so we know the JSWindowProxy
1466 object is not getting destroyed here.
1469 * bindings/js/WindowProxy.cpp:
1470 (WebCore::WindowProxy::globalObject):
1471 * bindings/js/WindowProxy.h:
1472 (WebCore::WindowProxy::frame const):
1473 * bindings/scripts/CodeGenerator.pm:
1475 (ComputeIsCallbackInterface):
1476 (ComputeIsCallbackFunction):
1477 * bindings/scripts/CodeGeneratorJS.pm:
1478 (AddToIncludesForIDLType):
1480 (NativeToJSValueDOMConvertNeedsState):
1481 * bindings/scripts/test/JS/JSTestObj.cpp:
1482 (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
1483 (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
1484 * bindings/scripts/test/TestObj.idl:
1485 * dom/CompositionEvent.cpp:
1486 (WebCore::CompositionEvent::CompositionEvent):
1487 (WebCore::CompositionEvent::initCompositionEvent):
1488 * dom/CompositionEvent.h:
1489 * dom/CompositionEvent.idl:
1491 (WebCore::Document::defaultView const):
1494 * dom/DocumentTouch.cpp:
1495 (WebCore::DocumentTouch::createTouch):
1496 * dom/DocumentTouch.h:
1497 * dom/DocumentTouch.idl:
1498 * dom/FocusEvent.cpp:
1499 (WebCore::FocusEvent::FocusEvent):
1501 * dom/InputEvent.cpp:
1502 (WebCore::InputEvent::create):
1503 (WebCore::InputEvent::InputEvent):
1505 * dom/KeyboardEvent.cpp:
1506 (WebCore::KeyboardEvent::KeyboardEvent):
1507 (WebCore::KeyboardEvent::create):
1508 (WebCore::KeyboardEvent::initKeyboardEvent):
1509 (WebCore::KeyboardEvent::charCode const):
1510 * dom/KeyboardEvent.h:
1511 * dom/KeyboardEvent.idl:
1512 * dom/MessageEvent.h:
1513 * dom/MessageEvent.idl:
1514 * dom/MouseEvent.cpp:
1515 (WebCore::MouseEvent::create):
1516 (WebCore::MouseEvent::MouseEvent):
1517 (WebCore::MouseEvent::initMouseEvent):
1518 (WebCore::MouseEvent::initMouseEventQuirk):
1520 * dom/MouseEvent.idl:
1521 * dom/MouseRelatedEvent.cpp:
1522 (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1523 (WebCore::MouseRelatedEvent::init):
1524 (WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
1525 (WebCore::MouseRelatedEvent::initCoordinates):
1526 (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
1527 (WebCore::MouseRelatedEvent::computePageLocation):
1528 (WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
1529 * dom/MouseRelatedEvent.h:
1531 * dom/SimulatedClick.cpp:
1532 * dom/TextEvent.cpp:
1533 (WebCore::TextEvent::create):
1534 (WebCore::TextEvent::createForPlainTextPaste):
1535 (WebCore::TextEvent::createForFragmentPaste):
1536 (WebCore::TextEvent::createForDrop):
1537 (WebCore::TextEvent::createForDictation):
1538 (WebCore::TextEvent::TextEvent):
1539 (WebCore::TextEvent::initTextEvent):
1541 * dom/TextEvent.idl:
1542 * dom/TouchEvent.idl:
1544 (WebCore::UIEvent::UIEvent):
1545 (WebCore::UIEvent::initUIEvent):
1547 (WebCore::UIEvent::create):
1548 (WebCore::UIEvent::view const):
1550 * dom/UIEventInit.h:
1551 * dom/UIEventInit.idl:
1552 * dom/UIEventWithKeyState.h:
1553 (WebCore::UIEventWithKeyState::UIEventWithKeyState):
1554 * dom/WheelEvent.cpp:
1555 (WebCore::WheelEvent::WheelEvent):
1556 (WebCore::WheelEvent::create):
1557 (WebCore::WheelEvent::initWebKitWheelEvent):
1559 * dom/WheelEvent.idl:
1560 * editing/AlternativeTextController.cpp:
1561 (WebCore::AlternativeTextController::insertDictatedText):
1562 * editing/Editor.cpp:
1563 (WebCore::Editor::pasteAsPlainText):
1564 (WebCore::Editor::pasteAsFragment):
1565 (WebCore::Editor::setComposition):
1566 * html/HTMLDocument.cpp:
1567 (WebCore::HTMLDocument::namedItem):
1568 * html/HTMLDocument.h:
1569 * html/HTMLDocument.idl:
1570 * html/HTMLFrameElement.idl:
1571 * html/HTMLFrameOwnerElement.cpp:
1572 (WebCore::HTMLFrameOwnerElement::contentWindow const):
1573 * html/HTMLFrameOwnerElement.h:
1574 * html/HTMLFrameSetElement.cpp:
1575 (WebCore::HTMLFrameSetElement::namedItem):
1576 * html/HTMLFrameSetElement.h:
1577 * html/HTMLFrameSetElement.idl:
1578 * html/HTMLIFrameElement.idl:
1579 * html/ImageDocument.cpp:
1580 * page/DOMWindow.cpp:
1581 (WebCore::PostMessageTimer::PostMessageTimer):
1582 (WebCore::PostMessageTimer::event):
1583 (WebCore::DOMWindow::postMessage):
1584 * page/DragController.cpp:
1585 (WebCore::DragController::dispatchTextInputEventFor):
1586 * page/EventHandler.cpp:
1587 (WebCore::EventHandler::handleTextInputEvent):
1589 2018-04-27 Nan Wang <n_wang@apple.com>
1591 AX: Accessibility needs to know which part of the content view is visible on iOS
1592 https://bugs.webkit.org/show_bug.cgi?id=185085
1593 <rdar://problem/39801363>
1595 Reviewed by Chris Fleizach.
1597 Exposed unobscuredContentRect() to iOS accessibility object wrapper.
1599 Test: accessibility/ios-simulator/unobscured-content-rect.html
1601 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1602 (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1604 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1606 Refactor filter list checking code
1607 https://bugs.webkit.org/show_bug.cgi?id=185087
1609 Reviewed by Alan Bujtas.
1611 Deduplicate code between filter and backdrop-filter for checking whether function lists
1612 match, by making a shared function that takes a std::function.
1614 The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
1615 converting the return type into a value.
1617 * animation/KeyframeEffectReadOnly.cpp:
1618 (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
1619 (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
1620 (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
1621 * animation/KeyframeEffectReadOnly.h:
1622 * page/animation/KeyframeAnimation.cpp:
1623 (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
1624 (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
1625 (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
1626 * page/animation/KeyframeAnimation.h:
1628 2018-04-27 Chris Dumez <cdumez@apple.com>
1630 Regression(r222392?): Events can have a negative timestamp which causes app breakage
1631 https://bugs.webkit.org/show_bug.cgi?id=185040
1632 <rdar://problem/39638051>
1634 Reviewed by Wenson Hsieh.
1636 The real fix is in UIKit when generating the touch timestamps. However, this patch
1637 does some hardening to make sure that Event.timestamp can never return a negative
1638 value even if something goes wrong.
1641 (WebCore::Event::timeStampForBindings const):
1643 2018-04-27 Christopher Reid <chris.reid@sony.com>
1645 URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
1646 https://bugs.webkit.org/show_bug.cgi?id=184836
1648 Reviewed by Alex Christensen.
1650 Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.
1652 Test: LayoutTests\fast\url\url-hostname-encoding.html
1656 2018-04-27 Youenn Fablet <youenn@apple.com>
1658 CachedRawResource is not handling incremental data computation correctly
1659 https://bugs.webkit.org/show_bug.cgi?id=184936
1660 <rdar://problem/38798141>
1662 Reviewed by Darin Adler.
1664 * loader/cache/CachedRawResource.cpp:
1665 (WebCore::CachedRawResource::updateBuffer): Fixing style.
1667 2018-04-27 Zalan Bujtas <zalan@apple.com>
1669 [LFC] Implement BlockFormattingContext::layout logic and its dependencies
1670 https://bugs.webkit.org/show_bug.cgi?id=185024
1672 Reviewed by Antti Koivisto.
1674 This patch implements the logic for block formatting context according to
1675 https://www.w3.org/TR/CSS22/visuren.html#block-formatting
1677 1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
1678 we visit the descendant nodes until we hit a leaf node.
1679 2. Compute the position/geometry of the leaf node and move over to its sibling(s).
1680 3. Finalize the container's height/final position as we climb back on the tree.
1681 4. Run layout on the out-of-flow descendants.
1683 Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
1684 The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
1685 in a separate formatting context (excluding out-of-flow boxes that don't belong to the root).
1687 * layout/FloatingContext.cpp:
1688 (WebCore::Layout::FloatingContext::FloatingContext):
1689 (WebCore::Layout::FloatingContext::computePosition):
1690 * layout/FormattingContext.cpp:
1691 (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
1692 (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1693 * layout/FormattingContext.h:
1694 * layout/LayoutContext.cpp:
1695 (WebCore::Layout::LayoutContext::updateLayout):
1696 (WebCore::Layout::LayoutContext::establishedFormattingState):
1697 * layout/LayoutContext.h:
1698 * layout/blockformatting/BlockFormattingContext.cpp:
1699 (WebCore::Layout::BlockFormattingContext::layout const):
1700 (WebCore::Layout::BlockFormattingContext::layout): Deleted.
1701 * layout/blockformatting/BlockFormattingContext.h:
1702 * layout/inlineformatting/InlineFormattingContext.cpp:
1703 (WebCore::Layout::InlineFormattingContext::layout const):
1704 (WebCore::Layout::InlineFormattingContext::layout): Deleted.
1705 * layout/inlineformatting/InlineFormattingContext.h:
1707 2018-04-27 Youenn Fablet <youenn@apple.com>
1709 Use NetworkLoadChecker for XHR/fetch loads
1710 https://bugs.webkit.org/show_bug.cgi?id=184741
1712 Reviewed by Chris Dumez.
1714 Covered by existing tests.
1716 * loader/DocumentThreadableLoader.cpp:
1717 (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
1718 We need to set this option for CORS done in NetworkProcess.
1719 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1720 Set httpHeadersTokeep when needed (service worker or CORS loads).
1721 Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
1722 (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
1723 Helper routine to make the same check for both simple and preflight case.
1724 This allows more consistent error logging between WK1 and WK2.
1725 (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1726 Skip preflight in case this is done in NetworkProcess.
1727 (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1728 (WebCore::isResponseComingFromNetworkProcess):
1729 (WebCore::DocumentThreadableLoader::redirectReceived):
1730 Bypass security checks when they are already done in NetworkProcess.
1731 (WebCore::DocumentThreadableLoader::didFail):
1732 In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
1733 Check it again to enable specific CSP console logging and error reporting.
1734 (WebCore::DocumentThreadableLoader::loadRequest):
1735 Recreating the error in case of synchronous loads to be able to log it adequately.
1736 (WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
1737 * loader/DocumentThreadableLoader.h:
1738 * loader/SubresourceLoader.cpp:
1739 (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
1740 Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
1741 (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
1742 We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
1743 * loader/cache/CachedResourceLoader.cpp:
1744 (WebCore::CachedResourceLoader::requestResource):
1745 DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
1746 as applications are not supposed to set these headers.
1748 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1750 Add an experimental feature flag for viewport "min-device-width"
1751 https://bugs.webkit.org/show_bug.cgi?id=185050
1752 <rdar://problem/39624038>
1754 Reviewed by Tim Horton.
1756 Add MinDeviceWidthEnabled as a new runtime-enabled feature.
1758 * dom/ViewportArguments.cpp:
1759 (WebCore::setViewportFeature):
1761 Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.
1763 * page/RuntimeEnabledFeatures.h:
1764 (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
1765 (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):
1767 2018-04-27 Simon Fraser <simon.fraser@apple.com>
1769 Make color-filter transform gradient colors
1770 https://bugs.webkit.org/show_bug.cgi?id=185080
1772 Reviewed by Zalan Bujtas.
1774 In CSSGradientValue::computeStops(), transform the color of each gradient color
1775 stop through the color filter. Having a color filter makes the gradient uncacheable.
1777 Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
1778 to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
1779 functions to take const RenderStyle&.
1781 Test: css3/color-filters/color-filter-gradients.html
1783 * css/CSSCrossfadeValue.cpp:
1784 (WebCore::subimageKnownToBeOpaque):
1785 * css/CSSFilterImageValue.cpp:
1786 (WebCore::CSSFilterImageValue::knownToBeOpaque const):
1787 * css/CSSFilterImageValue.h:
1788 * css/CSSGradientValue.cpp:
1789 (WebCore::CSSGradientValue::image):
1790 (WebCore::CSSGradientValue::computeStops):
1791 (WebCore::CSSGradientValue::knownToBeOpaque const):
1792 (WebCore::CSSLinearGradientValue::createGradient):
1793 (WebCore::CSSRadialGradientValue::createGradient):
1794 * css/CSSGradientValue.h:
1795 * css/CSSImageGeneratorValue.cpp:
1796 (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
1797 * css/CSSImageValue.cpp:
1798 (WebCore::CSSImageValue::knownToBeOpaque const):
1799 * css/CSSImageValue.h:
1801 2018-04-26 Simon Fraser <simon.fraser@apple.com>
1803 Fix color-filter to apply to text decorations
1804 https://bugs.webkit.org/show_bug.cgi?id=185068
1805 <rdar://problem/39782136>
1807 Reviewed by Alan Bujtas.
1809 Transform the colors of text shadows, and the shadows of text-decorations through
1812 Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
1813 (which would have awkward ownership implications) we pass the color filters through
1814 and just map the color through it before painting.
1816 Re-order the members of TextPainter a little to optimize padding.
1818 Also fix a bug where FilterOperations::transformColor() could transform an invalid
1819 color to a valid one; we never want this.
1821 Tests: css3/color-filters/color-filter-text-decoration-shadow.html
1822 css3/color-filters/color-filter-text-shadow.html
1824 * platform/graphics/filters/FilterOperations.cpp:
1825 (WebCore::FilterOperations::transformColor const):
1826 * rendering/InlineTextBox.cpp:
1827 (WebCore::InlineTextBox::paintMarkedTextForeground):
1828 (WebCore::InlineTextBox::paintMarkedTextDecoration):
1829 * rendering/TextDecorationPainter.cpp:
1830 (WebCore::TextDecorationPainter::paintTextDecoration):
1831 * rendering/TextDecorationPainter.h:
1832 (WebCore::TextDecorationPainter::setTextShadow):
1833 (WebCore::TextDecorationPainter::setShadowColorFilter):
1834 (WebCore::TextDecorationPainter::addTextShadow): Deleted.
1835 * rendering/TextPainter.cpp:
1836 (WebCore::ShadowApplier::ShadowApplier):
1837 (WebCore::TextPainter::paintTextWithShadows):
1838 (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
1839 on the first iteration.
1840 (WebCore::TextPainter::paintRange):
1841 * rendering/TextPainter.h:
1842 (WebCore::TextPainter::setShadowColorFilter):
1843 * rendering/svg/SVGInlineTextBox.cpp:
1844 (WebCore::SVGInlineTextBox::paintTextWithShadows):
1846 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1848 Rename minimumLayoutSize to viewLayoutSize
1849 https://bugs.webkit.org/show_bug.cgi?id=185050
1850 <rdar://problem/39624038>
1852 Reviewed by Tim Horton.
1854 See WebKit/ChangeLog for more information. No change in behavior.
1856 * page/ViewportConfiguration.cpp:
1857 (WebCore::ViewportConfiguration::ViewportConfiguration):
1858 (WebCore::ViewportConfiguration::setViewLayoutSize):
1860 Remove a FIXME comment that is addressed by this refactoring.
1862 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
1863 (WebCore::ViewportConfiguration::initialScaleFromSize const):
1864 (WebCore::ViewportConfiguration::minimumScale const):
1865 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1866 (WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
1867 * page/ViewportConfiguration.h:
1868 (WebCore::ViewportConfiguration::viewLayoutSize const):
1869 (WebCore::ViewportConfiguration::viewSize const): Deleted.
1871 2018-04-27 Zalan Bujtas <zalan@apple.com>
1873 [LFC] Formatting contexts should create floating states.
1874 https://bugs.webkit.org/show_bug.cgi?id=185032
1876 Reviewed by Antti Koivisto.
1878 This patch implements the logic for sharing floating states across multiple formatting contexts.
1879 At this point this is mostly about inline formatting contexts. They either create a new floating state
1880 or inherit it from the parent formatting context.
1882 * layout/FloatingState.cpp:
1883 (WebCore::Layout::FloatingState::FloatingState):
1884 * layout/FloatingState.h:
1885 (WebCore::Layout::FloatingState::create):
1886 * layout/FormattingContext.cpp:
1887 (WebCore::Layout::FormattingContext::FormattingContext):
1888 * layout/FormattingContext.h:
1889 (WebCore::Layout::FormattingContext::layoutContext const):
1890 * layout/FormattingState.cpp:
1891 (WebCore::Layout::FormattingState::FormattingState):
1892 * layout/FormattingState.h:
1893 (WebCore::Layout::FormattingState::floatingState const):
1894 * layout/LayoutContext.cpp:
1895 (WebCore::Layout::LayoutContext::updateLayout):
1896 (WebCore::Layout::LayoutContext::formattingStateForBox const):
1897 (WebCore::Layout::LayoutContext::establishedFormattingState):
1898 (WebCore::Layout::LayoutContext::formattingContext):
1899 (WebCore::Layout::LayoutContext::formattingState): Deleted.
1900 * layout/LayoutContext.h:
1901 * layout/blockformatting/BlockFormattingContext.cpp:
1902 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1903 (WebCore::Layout::BlockFormattingContext::createFormattingState const):
1904 (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
1905 (WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
1906 * layout/blockformatting/BlockFormattingContext.h:
1907 * layout/blockformatting/BlockFormattingState.cpp:
1908 (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1909 * layout/blockformatting/BlockFormattingState.h:
1910 * layout/inlineformatting/InlineFormattingContext.cpp:
1911 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1912 (WebCore::Layout::InlineFormattingContext::createFormattingState const):
1913 (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
1914 (WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
1915 * layout/inlineformatting/InlineFormattingContext.h:
1916 * layout/inlineformatting/InlineFormattingState.cpp:
1917 (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1918 * layout/inlineformatting/InlineFormattingState.h:
1919 * layout/layouttree/LayoutBox.cpp:
1920 (WebCore::Layout::Box::formattingContextRoot const):
1921 * layout/layouttree/LayoutBox.h:
1923 2018-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
1925 [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
1926 https://bugs.webkit.org/show_bug.cgi?id=185050
1927 <rdar://problem/39624038>
1929 Reviewed by Tim Horton.
1931 Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
1932 (namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
1933 patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
1934 automatically clamping the web view width to a greater value for the device width in this scenario.
1936 Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
1937 will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
1938 size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.
1940 See per-method comments below for more detail.
1942 Test: fast/viewport/extrazoom/viewport-change-min-device-width.html
1944 * dom/ViewportArguments.cpp:
1945 (WebCore::setViewportFeature):
1946 (WebCore::operator<<):
1947 * dom/ViewportArguments.h:
1949 Removes `m_forceHorizontalShrinkToFit` (more detail below).
1951 * page/ViewportConfiguration.cpp:
1952 (WebCore::computedMinDeviceWidth):
1953 (WebCore::ViewportConfiguration::ViewportConfiguration):
1954 (WebCore::ViewportConfiguration::setMinimumLayoutSize):
1956 Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
1957 size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.
1959 (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
1961 Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
1962 min-device-width attribute is actively clamping the width of the view.
1964 (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
1965 (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
1966 (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
1968 Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
1971 (WebCore::ViewportConfiguration::description const):
1972 (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
1973 * page/ViewportConfiguration.h:
1975 2018-04-27 Zalan Bujtas <zalan@apple.com>
1977 [LFC] Formatting contexts should take const Box&
1978 https://bugs.webkit.org/show_bug.cgi?id=185031
1980 Reviewed by Sam Weinig.
1982 The formatting root boxes are supposed to be all const. The only reason why
1983 they are not is because WeakPtr<> does not support const objects yet.
1984 Use const_cast instead (remove it when WeakPtr<> gains const support).
1986 * layout/FormattingContext.cpp:
1987 (WebCore::Layout::FormattingContext::FormattingContext):
1988 * layout/FormattingContext.h:
1989 * layout/LayoutContext.cpp:
1990 (WebCore::Layout::LayoutContext::LayoutContext):
1991 (WebCore::Layout::LayoutContext::formattingContext):
1992 * layout/LayoutContext.h:
1993 * layout/blockformatting/BlockFormattingContext.cpp:
1994 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1995 * layout/blockformatting/BlockFormattingContext.h:
1996 * layout/inlineformatting/InlineFormattingContext.cpp:
1997 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1998 * layout/inlineformatting/InlineFormattingContext.h:
2000 2018-04-27 Zalan Bujtas <zalan@apple.com>
2002 [LFC] Add layout tree iterators.
2003 https://bugs.webkit.org/show_bug.cgi?id=185058
2005 Reviewed by Antti Koivisto.
2007 They work exactly like the renderer tree iterators.
2009 * WebCore.xcodeproj/project.pbxproj:
2010 * layout/layouttree/LayoutAncestorIterator.h: Added.
2011 (WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
2012 (WebCore::Layout::LayoutAncestorIterator<T>::operator):
2013 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
2014 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
2015 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
2016 (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
2017 (WebCore::Layout::ancestorsOfType):
2018 (WebCore::Layout::lineageOfType):
2019 * layout/layouttree/LayoutBox.cpp:
2020 * layout/layouttree/LayoutChildIterator.h: Added.
2021 (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
2022 (WebCore::Layout::LayoutChildtIterator<T>::operator):
2023 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
2024 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
2025 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
2026 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
2027 (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
2028 (WebCore::Layout::childrenOfType):
2029 * layout/layouttree/LayoutIterator.h: Added.
2030 (WebCore::Layout::isLayoutBoxOfType):
2031 (WebCore::Layout::Traversal::firstChild):
2032 (WebCore::Layout::Traversal::lastChild):
2033 (WebCore::Layout::Traversal::nextSibling):
2034 (WebCore::Layout::Traversal::previousSibling):
2035 (WebCore::Layout::Traversal::findAncestorOfType):
2036 (WebCore::Layout::Traversal::nextAncestorSibling):
2037 (WebCore::Layout::Traversal::nextWithin):
2038 (WebCore::Layout::Traversal::firstWithin):
2039 (WebCore::Layout::Traversal::next):
2040 (WebCore::Layout::LayoutIterator<T>::LayoutIterator):
2041 (WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
2042 (WebCore::Layout::LayoutIterator<T>::traverseNext):
2043 (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
2044 (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
2045 (WebCore::Layout::LayoutIterator<T>::operator const):
2046 (WebCore::Layout:: const):
2047 (WebCore::Layout::= const):
2049 2018-04-27 Commit Queue <commit-queue@webkit.org>
2051 Unreviewed, rolling out r231089.
2052 https://bugs.webkit.org/show_bug.cgi?id=185071
2054 Broke and made crash some WPE EME tests (Requested by calvaris
2059 "[EME][GStreamer] Move the decryptor from AppendPipeline to
2061 https://bugs.webkit.org/show_bug.cgi?id=181855
2062 https://trac.webkit.org/changeset/231089
2064 2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
2066 [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
2067 https://bugs.webkit.org/show_bug.cgi?id=181855
2069 Reviewed by Xabier Rodriguez-Calvar.
2071 The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
2073 When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
2074 the decrypted GstBuffers that are in SVP memory.
2075 This behavior cause an out-of-memory error, because we are limited in SVP memory size.
2077 By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
2078 which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
2080 This new architecture also allows to start the buffering before obtaining the DRM license
2081 and it makes easier to manage dynamic change of the license or Key.
2083 The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
2085 SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
2086 protected by a hardware access control engine, it is not accessible to other unauthorised
2087 software or hardware components.
2090 media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
2091 media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
2093 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2094 (webkitMediaCommonEncryptionDecryptSinkEventHandler):
2095 * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2096 (WebCore::dumpAppendState):
2097 (WebCore::AppendPipeline::AppendPipeline):
2098 (WebCore::AppendPipeline::handleNeedContextSyncMessage):
2099 (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
2100 (WebCore::AppendPipeline::setAppendState):
2101 (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2102 (WebCore::AppendPipeline::appsinkNewSample):
2103 (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
2104 (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
2105 (WebCore::appendPipelineElementMessageCallback): Deleted.
2106 (WebCore::AppendPipeline::handleElementMessage): Deleted.
2107 (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
2108 (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
2109 * platform/graphics/gstreamer/mse/AppendPipeline.h:
2110 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2111 (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
2112 * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2114 2018-04-27 Yacine Bandou <yacine.bandou_ext@softathome.com>
2116 [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
2117 https://bugs.webkit.org/show_bug.cgi?id=181858
2119 Reviewed by Xabier Rodriguez-Calvar.
2121 Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
2122 This message should be handled by the application in order to dispatch or send the key to the decryptor.
2123 This patch is a preparation for the patch 181855.
2124 With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
2125 get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
2126 When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
2127 the DRM license or key by using this new message "decrypt-key-needed".
2130 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2131 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2132 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2133 (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
2134 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2135 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2136 (webkitMediaCommonEncryptionDecryptTransformInPlace):
2138 2018-04-26 Justin Fan <justin_fan@apple.com>
2140 tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
2141 https://bugs.webkit.org/show_bug.cgi?id=184843
2142 <rdar://problem/34898868>
2144 Reviewed by Simon Fraser.
2146 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.
2147 For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
2148 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.
2150 * platform/graphics/FormatConverter.cpp:
2151 (WebCore::FormatConverter::convert):
2153 2018-04-26 Simon Fraser <simon.fraser@apple.com>
2155 Implement rendering support for the color-filter CSS property
2156 https://bugs.webkit.org/show_bug.cgi?id=185047
2157 rdar://problem/39664967
2159 Reviewed by Tim Horton.
2161 The color-filter property transforms CSS colors just before painting. To support this,
2162 add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
2163 At most calls sites that transform colors for rendering, replace calls to
2164 visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
2165 that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().
2167 Color transformation is implemented via a new virtual function on FilterOperation;
2168 BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
2169 do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
2170 transfer operations. The math in both cases matches that for SVG filters, with the exception
2171 that color components are stored as floats through multiple filters and then mapped to
2172 normal 0-255 color components at the end.
2174 Tests: css3/color-filters/color-filter-backgrounds-borders.html
2175 css3/color-filters/color-filter-box-shadow.html
2176 css3/color-filters/color-filter-brightness.html
2177 css3/color-filters/color-filter-color-property-list-item.html
2178 css3/color-filters/color-filter-color-property.html
2179 css3/color-filters/color-filter-color-text-decorations.html
2180 css3/color-filters/color-filter-column-rule.html
2181 css3/color-filters/color-filter-contrast.html
2182 css3/color-filters/color-filter-current-color.html
2183 css3/color-filters/color-filter-filter-list.html
2184 css3/color-filters/color-filter-grayscale.html
2185 css3/color-filters/color-filter-hue-rotate.html
2186 css3/color-filters/color-filter-inherits.html
2187 css3/color-filters/color-filter-invert.html
2188 css3/color-filters/color-filter-opacity.html
2189 css3/color-filters/color-filter-outline.html
2190 css3/color-filters/color-filter-saturate.html
2191 css3/color-filters/color-filter-sepia.html
2192 css3/color-filters/color-filter-text-emphasis.html
2194 * html/HTMLTextFormControlElement.cpp:
2195 (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
2196 * page/FrameView.cpp:
2197 (WebCore::FrameView::documentBackgroundColor const):
2198 * platform/graphics/ColorUtilities.cpp:
2199 (WebCore::ColorMatrix::ColorMatrix):
2200 (WebCore::ColorMatrix::makeIdentity):
2201 (WebCore::ColorMatrix::grayscaleMatrix):
2202 (WebCore::ColorMatrix::saturationMatrix):
2203 (WebCore::ColorMatrix::hueRotateMatrix):
2204 (WebCore::ColorMatrix::sepiaMatrix):
2205 (WebCore::ColorMatrix::transformColorComponents const):
2206 * platform/graphics/ColorUtilities.h:
2207 * platform/graphics/filters/FilterOperation.cpp:
2208 (WebCore::BasicColorMatrixFilterOperation::transformColor const):
2209 (WebCore::BasicComponentTransferFilterOperation::transformColor const):
2210 * platform/graphics/filters/FilterOperation.h:
2211 (WebCore::FilterOperation::transformColor const):
2212 * platform/graphics/filters/FilterOperations.cpp:
2213 (WebCore::FilterOperations::transformColor const):
2214 * platform/graphics/filters/FilterOperations.h:
2215 * rendering/BorderEdge.cpp:
2216 (WebCore::BorderEdge::getBorderEdgeInfo):
2217 * rendering/EllipsisBox.cpp:
2218 (WebCore::EllipsisBox::paint):
2219 (WebCore::EllipsisBox::paintSelection):
2220 * rendering/InlineFlowBox.cpp:
2221 (WebCore::InlineFlowBox::paintBoxDecorations):
2222 * rendering/InlineTextBox.cpp:
2223 (WebCore::InlineTextBox::paintMarkedTextForeground):
2224 (WebCore::InlineTextBox::paintMarkedTextDecoration):
2225 (WebCore::InlineTextBox::paintCompositionUnderline const):
2226 * rendering/RenderBox.cpp:
2227 (WebCore::RenderBox::paintRootBoxFillLayers):
2228 (WebCore::RenderBox::paintBackground):
2229 (WebCore::RenderBox::getBackgroundPaintedExtent const):
2230 (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
2231 (WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
2232 * rendering/RenderBoxModelObject.cpp:
2233 (WebCore::applyBoxShadowForBackground):
2234 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2235 (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
2236 (WebCore::RenderBoxModelObject::paintBoxShadow):
2237 * rendering/RenderDetailsMarker.cpp:
2238 (WebCore::RenderDetailsMarker::paint):
2239 * rendering/RenderElement.cpp:
2240 (WebCore::RenderElement::selectionColor const):
2241 (WebCore::RenderElement::selectionBackgroundColor const):
2242 (WebCore::RenderElement::paintFocusRing):
2243 (WebCore::RenderElement::paintOutline):
2244 * rendering/RenderFileUploadControl.cpp:
2245 (WebCore::RenderFileUploadControl::paintObject):
2246 * rendering/RenderFrameSet.cpp:
2247 (WebCore::RenderFrameSet::paintColumnBorder):
2248 (WebCore::RenderFrameSet::paintRowBorder):
2249 * rendering/RenderImage.cpp:
2250 (WebCore::RenderImage::paintReplaced):
2251 (WebCore::RenderImage::paintAreaElementFocusRing):
2252 * rendering/RenderInline.cpp:
2253 (WebCore::RenderInline::paintOutline):
2254 * rendering/RenderLayerBacking.cpp:
2255 (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
2256 (WebCore::RenderLayerBacking::rendererBackgroundColor const):
2257 * rendering/RenderLayerCompositor.cpp:
2258 (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
2259 * rendering/RenderListBox.cpp:
2260 (WebCore::RenderListBox::paintItemForeground):
2261 (WebCore::RenderListBox::paintItemBackground):
2262 * rendering/RenderListMarker.cpp:
2263 (WebCore::RenderListMarker::paint):
2264 * rendering/RenderMenuList.cpp:
2265 (RenderMenuList::itemStyle const):
2266 (RenderMenuList::getItemBackgroundColor const):
2267 (RenderMenuList::menuStyle const):
2268 * rendering/RenderMultiColumnSet.cpp:
2269 (WebCore::RenderMultiColumnSet::paintColumnRules):
2270 * rendering/RenderSearchField.cpp:
2271 (WebCore::RenderSearchField::menuStyle const):
2272 * rendering/RenderTable.h:
2273 (WebCore::RenderTable::bgColor const):
2274 * rendering/RenderTableCell.cpp:
2275 (WebCore::RenderTableCell::computeCollapsedStartBorder const):
2276 (WebCore::RenderTableCell::computeCollapsedEndBorder const):
2277 (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
2278 (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
2279 (WebCore::RenderTableCell::paintBackgroundsBehindCell):
2280 * rendering/RenderTableSection.cpp:
2281 (WebCore::RenderTableSection::paintRowGroupBorder):
2282 * rendering/RenderTheme.cpp:
2283 (WebCore::RenderTheme::paintSliderTicks):
2284 * rendering/TextDecorationPainter.cpp:
2285 (WebCore::decorationColor):
2286 * rendering/TextPaintStyle.cpp:
2287 (WebCore::computeTextPaintStyle):
2288 * rendering/mathml/MathOperator.cpp:
2289 (WebCore::MathOperator::paint):
2290 * rendering/mathml/RenderMathMLFraction.cpp:
2291 (WebCore::RenderMathMLFraction::paint):
2292 * rendering/mathml/RenderMathMLMenclose.cpp:
2293 (WebCore::RenderMathMLMenclose::paint):
2294 * rendering/mathml/RenderMathMLRoot.cpp:
2295 (WebCore::RenderMathMLRoot::paint):
2296 * rendering/mathml/RenderMathMLToken.cpp:
2297 (WebCore::RenderMathMLToken::paint):
2298 * rendering/style/RenderStyle.cpp:
2299 (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
2300 (WebCore::RenderStyle::colorByApplyingColorFilter const):
2301 * rendering/style/RenderStyle.h:
2303 2018-04-26 Mark Lam <mark.lam@apple.com>
2305 Gardening: Speculative build fix for Windows.
2306 https://bugs.webkit.org/show_bug.cgi?id=184976
2307 <rdar://problem/39723901>
2311 * cssjit/CSSPtrTag.h:
2313 2018-04-26 Brent Fulgham <bfulgham@apple.com>
2315 Show punycode if URL contains Latin small letter o with dot below character
2316 https://bugs.webkit.org/show_bug.cgi?id=185051
2317 <rdar://problem/39459297>
2319 Reviewed by David Kilzer.
2321 Revise our "lookalike character" logic to include the small Latin o
2322 with dot below character.
2324 Test: fast/url/host.html
2326 * platform/mac/WebCoreNSURLExtras.mm:
2327 (WebCore::isLookalikeCharacter):
2329 2018-04-26 Daniel Bates <dabates@apple.com>
2331 Fix the build following r231068
2332 (https://bugs.webkit.org/show_bug.cgi?id=185002)
2334 Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
2335 latter does not exist.
2337 * loader/DocumentLoader.cpp:
2338 (WebCore::DocumentLoader::loadMainResource):
2340 2018-04-26 Daniel Bates <dabates@apple.com>
2342 DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
2343 https://bugs.webkit.org/show_bug.cgi?id=185002
2345 Reviewed by Youenn Fablet and Alex Christensen.
2347 In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2348 function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2349 and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2350 takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2351 ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2352 Instead we should WTFMove() the passed request into the CachedResourceRequest.
2354 * loader/DocumentLoader.cpp:
2355 (WebCore::DocumentLoader::loadMainResource):
2357 2018-04-26 Sihui Liu <sihui_liu@apple.com>
2359 -[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
2360 https://bugs.webkit.org/show_bug.cgi?id=184938
2361 <rdar://problem/34737395>
2363 Reviewed by Geoffrey Garen.
2365 When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
2366 was lost so the delete function cannot find the proper cookie to delete.
2367 This patch implements a workaround that compares Cookie object instead of NSHTTPCookie
2368 object. We might want to add the ability to set HTTPOnly header during conversion if there
2369 is an easy way to do it later.
2371 New API test: WebKit.WKHTTPCookieStoreHttpOnly
2373 * platform/network/cocoa/CookieCocoa.mm:
2374 (WebCore::Cookie::operator== const):
2375 * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2376 (WebCore::NetworkStorageSession::deleteCookie):
2378 2018-04-26 Commit Queue <commit-queue@webkit.org>
2380 Unreviewed, rolling out r231052.
2381 https://bugs.webkit.org/show_bug.cgi?id=185044
2383 Broke test http/tests/security/credentials-main-resource.html
2384 (Requested by dydz on #webkit).
2388 "DocumentLoader::loadMainResource() should WTFMove() the
2389 passed ResourceRequest"
2390 https://bugs.webkit.org/show_bug.cgi?id=185002
2391 https://trac.webkit.org/changeset/231052
2393 2018-04-26 Jer Noble <jer.noble@apple.com>
2395 WK_COCOA_TOUCH all the things.
2396 https://bugs.webkit.org/show_bug.cgi?id=185006
2398 Reviewed by Tim Horton.
2400 * Configurations/WebCore.xcconfig:
2402 2018-04-26 David Kilzer <ddkilzer@apple.com>
2404 Make WAKScrollView delegate a weak property
2405 <https://webkit.org/b/184799>
2406 <rdar://problem/39469669>
2408 Reviewed by Simon Fraser.
2410 * platform/ios/wak/WAKScrollView.h:
2411 - Remove `delegate` instance variable declaration.
2412 - Declare `delegate` property as weak.
2413 (-[WAKScrollView setDelegate:]): Delete declaration.
2414 (-[WAKScrollView delegate]): Ditto.
2415 * platform/ios/wak/WAKScrollView.mm:
2416 - Synthesize getter/setter methods for `delegate` property.
2417 (-[WAKScrollView setDelegate:]): Delete implementation.
2418 (-[WAKScrollView delegate]): Ditto.
2420 2018-04-26 Youenn Fablet <youenn@apple.com>
2422 CORS preflight checker should add a console message when preflight load is blocked
2423 https://bugs.webkit.org/show_bug.cgi?id=185021
2425 Reviewed by Chris Dumez.
2427 No change of behavior, adding a JS console message when preflight load is blocked.
2428 This mirrors what is being done in preflighting done from NetworkProcess.
2429 Covered by existing tests.
2431 * loader/CrossOriginPreflightChecker.cpp:
2432 (WebCore::CrossOriginPreflightChecker::notifyFinished):
2433 (WebCore::CrossOriginPreflightChecker::doPreflight):
2435 2018-04-26 Daniel Bates <dabates@apple.com>
2437 DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
2438 https://bugs.webkit.org/show_bug.cgi?id=185002
2440 Reviewed by Youenn Fablet and Alex Christensen.
2442 In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
2443 function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
2444 and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
2445 takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
2446 ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
2447 Instead we should WTFMove() the passed request into the CachedResourceRequest.
2449 * loader/DocumentLoader.cpp:
2450 (WebCore::DocumentLoader::loadMainResource):
2452 2018-04-26 Per Arne Vollan <pvollan@apple.com>
2454 Disable content filtering in minimal simulator mode
2455 https://bugs.webkit.org/show_bug.cgi?id=185027
2456 <rdar://problem/39736091>
2458 Reviewed by Jer Noble.
2460 * Configurations/FeatureDefines.xcconfig:
2462 2018-04-25 Brent Fulgham <bfulgham@apple.com>
2464 Add port 548 (afpovertcp) to port blacklist
2465 https://bugs.webkit.org/show_bug.cgi?id=185000
2466 <rdar://problem/39540481>
2468 Reviewed by David Kilzer.
2470 Tested by security/block-test.html.
2473 (WebCore::portAllowed):Also block port 548.
2475 2018-04-26 Andy VanWagoner <thetalecrafter@gmail.com>
2477 [INTL] Implement Intl.PluralRules
2478 https://bugs.webkit.org/show_bug.cgi?id=184312
2480 Reviewed by JF Bastien.
2482 Added Intl.PluralRules feature flag.
2484 Test: js/intl-pluralrules.html
2486 * Configurations/FeatureDefines.xcconfig:
2488 2018-04-15 Darin Adler <darin@apple.com>
2490 [Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
2491 https://bugs.webkit.org/show_bug.cgi?id=184637
2493 Reviewed by Alexey Proskuryakov.
2495 * crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
2496 HAVE(CCRSAGetCRTComponents) is true.
2498 * crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
2499 enough versions of iOS and macOS that have it and add declarations of the
2500 function for the non-Apple-internal-SDK case. Also don't define the
2501 WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
2503 * crypto/mac/CryptoKeyRSAMac.cpp:
2504 (WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
2506 2018-04-26 Per Arne Vollan <pvollan@apple.com>
2508 Add lazy initialization of caption display mode for videos.
2509 https://bugs.webkit.org/show_bug.cgi?id=184993
2511 The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
2512 is showing up in samples when called from HTMLMediaElement::finishInitialization().
2514 Reviewed by Eric Carlson.
2516 No new tests, covered by existing tests.
2518 * html/HTMLMediaElement.cpp:
2519 (WebCore::HTMLMediaElement::finishInitialization):
2520 (WebCore::HTMLMediaElement::setSelectedTextTrack):
2521 (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2522 (WebCore::HTMLMediaElement::captionPreferencesChanged):
2523 (WebCore::HTMLMediaElement::captionDisplayMode):
2524 * html/HTMLMediaElement.h:
2526 2018-04-26 Zan Dobersek <zdobersek@igalia.com>
2528 [GTK][WPE] Initial ASYNC_SCROLLING support
2529 https://bugs.webkit.org/show_bug.cgi?id=184961
2531 Reviewed by Carlos Garcia Campos.
2533 Add CoordinatedGraphics-specific code that will be required for async
2534 scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
2535 ScrollingTreeCoordinatedGraphics classes are mostly complete already,
2536 but the new ScrollingTreeNode-inheriting classes will need further
2537 work that will have to be done in parallel with other improvements
2538 planned for the CoordinatedGraphics subsystem.
2540 While the build-time flag is enabled, the feature is still not enabled
2541 at runtime due to being marked as unsupported by the DrawingArea
2542 implementation in the WebKit layer. It would also not work yet if it
2543 were enabled due to the before-mentioned pending changes.
2545 Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
2548 * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
2550 * SourcesGTK.txt: Add new files to build.
2551 * SourcesWPE.txt: Ditto.
2552 * page/scrolling/AsyncScrollingCoordinator.cpp:
2553 Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
2554 * page/scrolling/ScrollingTree.h:
2555 * page/scrolling/ThreadedScrollingTree.cpp:
2556 * page/scrolling/ThreadedScrollingTree.h:
2557 currentSnapPointIndicesDidChange() method is only invoked in
2558 Cocoa-specific code, and its implementation calls Cocoa-specific method
2559 on the AsyncScrollingCoordinator class.
2560 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
2561 (WebCore::ScrollingCoordinator::create):
2562 (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
2563 (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
2564 (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
2565 (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
2566 (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
2567 (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
2568 (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
2569 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
2570 * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
2571 (WebCore::ScrollingTreeCoordinatedGraphics::create):
2572 (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
2573 (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
2574 * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
2575 * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
2576 (WebCore::ScrollingTreeFixedNode::create):
2577 (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
2578 (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
2579 (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2580 (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
2581 * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
2582 * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
2583 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
2584 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
2585 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
2586 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
2587 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
2588 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
2589 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
2590 (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
2591 * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
2592 * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
2593 (WebCore::ScrollingTreeStickyNode::create):
2594 (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
2595 (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
2596 (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2597 (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
2598 * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
2599 * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
2600 for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
2601 * platform/TextureMapper.cmake: Two build targets have been moved to
2602 SourcesGTK.txt and SourcesWPE.txt.
2604 2018-04-25 Michael Catanzaro <mcatanzaro@igalia.com>
2606 [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
2607 https://bugs.webkit.org/show_bug.cgi?id=184643
2609 Reviewed by Žan Doberšek.
2611 Adapt to single-header WPE includes.
2613 * platform/graphics/egl/GLContextEGLWPE.cpp:
2614 * platform/graphics/wpe/PlatformDisplayWPE.cpp:
2615 * platform/wpe/PlatformPasteboardWPE.cpp:
2617 2018-04-25 Youenn Fablet <youenn@apple.com>
2619 Use NetworkLoadChecker for all subresource loads except fetch/XHR
2620 https://bugs.webkit.org/show_bug.cgi?id=184870
2621 <rdar://problem/39370034>
2623 Reviewed by Chris Dumez.
2625 No change of behavior.
2626 Update CachedResourceLoader error messages to match NetworkProcess error messages.
2628 * loader/cache/CachedResourceLoader.cpp:
2629 (WebCore::CachedResourceLoader::printAccessDeniedMessage const):
2631 2018-04-25 Zalan Bujtas <zalan@apple.com>
2633 [LFC] Add support for is<> and downcast<>
2634 https://bugs.webkit.org/show_bug.cgi?id=185016
2636 Reviewed by Antti Koivisto.
2638 * layout/layouttree/LayoutBlockContainer.cpp:
2639 (WebCore::Layout::BlockContainer::BlockContainer):
2640 * layout/layouttree/LayoutBlockContainer.h:
2641 * layout/layouttree/LayoutBox.cpp:
2642 (WebCore::Layout::Box::Box):
2643 * layout/layouttree/LayoutBox.h:
2644 (WebCore::Layout::Box::isContainer const):
2645 (WebCore::Layout::Box::isBlockContainer const):
2646 (WebCore::Layout::Box::isInlineBox const):
2647 (WebCore::Layout::Box::isInlineContainer const):
2648 * layout/layouttree/LayoutContainer.cpp:
2649 (WebCore::Layout::Container::Container):
2650 * layout/layouttree/LayoutContainer.h:
2651 * layout/layouttree/LayoutInlineBox.cpp:
2652 (WebCore::Layout::InlineBox::InlineBox):
2653 * layout/layouttree/LayoutInlineBox.h:
2654 * layout/layouttree/LayoutInlineContainer.cpp:
2655 (WebCore::Layout::InlineContainer::InlineContainer):
2656 * layout/layouttree/LayoutInlineContainer.h:
2658 2018-04-25 Chris Dumez <cdumez@apple.com>
2660 window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
2661 https://bugs.webkit.org/show_bug.cgi?id=184981
2663 Reviewed by Sam Weinig.
2665 window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
2666 complaining that |this| is not a Window. This was caused by a copy & paste mistake in
2667 JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
2670 No new tests, updated existing tests.
2672 * bindings/js/JSDOMWindowCustom.cpp:
2673 (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2674 * page/RemoteDOMWindow.cpp:
2675 (WebCore::RemoteDOMWindow::postMessage):
2676 * page/RemoteDOMWindow.h:
2677 * page/RemoteDOMWindow.idl:
2679 2018-04-25 Simon Fraser <simon.fraser@apple.com>
2681 brightness() filter should default to 1, and not allow negative values
2682 https://bugs.webkit.org/show_bug.cgi?id=184937
2684 Reviewed by Dean Jackson.
2686 Remove the special-casing for brightness() in consumeFilterFunction(), so it now
2687 follows the same logic as the other color-related filters in not allowing negative
2690 Removed the special-casing for brightness() in createFilterOperations() so its default
2693 Modified existing tests.
2695 * css/StyleResolver.cpp:
2696 (WebCore::StyleResolver::createFilterOperations):
2697 * css/parser/CSSPropertyParserHelpers.cpp:
2698 (WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
2699 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2701 2018-04-25 Wenson Hsieh <wenson_hsieh@apple.com>
2703 Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
2704 https://bugs.webkit.org/show_bug.cgi?id=184999
2706 Reviewed by Tim Horton.
2708 Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
2710 * Configurations/WebCore.xcconfig:
2712 2018-04-25 Zalan Bujtas <zalan@apple.com>
2714 [LFC] Implement LayoutContexet::layout() and its dependencies.
2715 https://bugs.webkit.org/show_bug.cgi?id=184951
2717 Reviewed by Antti Koivisto.
2719 * layout/FormattingContext.cpp:
2720 (WebCore::Layout::FormattingContext::FormattingContext):
2721 (WebCore::Layout::FormattingContext::~FormattingContext):
2722 (WebCore::Layout::FormattingContext::computeStaticPosition):
2723 (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
2724 (WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
2725 (WebCore::Layout::FormattingContext::computeWidth):
2726 (WebCore::Layout::FormattingContext::computeHeight):
2727 (WebCore::Layout::FormattingContext::marginTop):
2728 (WebCore::Layout::FormattingContext::marginLeft):
2729 (WebCore::Layout::FormattingContext::marginBottom):
2730 (WebCore::Layout::FormattingContext::marginRight):
2731 * layout/FormattingContext.h:
2732 * layout/FormattingState.cpp:
2733 (WebCore::Layout::FormattingState::FormattingState):
2734 * layout/FormattingState.h:
2735 * layout/LayoutContext.cpp:
2736 (WebCore::Layout::LayoutContext::LayoutContext):
2737 (WebCore::Layout::LayoutContext::updateLayout):
2738 (WebCore::Layout::LayoutContext::formattingState):
2739 (WebCore::Layout::LayoutContext::formattingContext):
2740 * layout/LayoutContext.h:
2741 * layout/blockformatting/BlockFormattingContext.cpp:
2742 (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2743 (WebCore::Layout::BlockFormattingContext::layout):
2744 (WebCore::Layout::BlockFormattingContext::formattingState const):
2745 (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
2746 (WebCore::Layout::BlockFormattingContext::computeWidth):
2747 (WebCore::Layout::BlockFormattingContext::computeHeight):
2748 (WebCore::Layout::BlockFormattingContext::marginTop):
2749 (WebCore::Layout::BlockFormattingContext::marginBottom):
2750 * layout/blockformatting/BlockFormattingContext.h:
2751 * layout/blockformatting/BlockFormattingState.cpp:
2752 (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2753 * layout/blockformatting/BlockFormattingState.h:
2754 * layout/inlineformatting/InlineFormattingContext.cpp:
2755 (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2756 (WebCore::Layout::InlineFormattingContext::layout):
2757 (WebCore::Layout::InlineFormattingContext::formattingState const):
2758 * layout/inlineformatting/InlineFormattingContext.h:
2759 * layout/inlineformatting/InlineFormattingState.cpp:
2760 (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2761 * layout/inlineformatting/InlineFormattingState.h:
2763 2018-04-25 Mark Lam <mark.lam@apple.com>
2765 Push the definition of PtrTag down to the WTF layer.
2766 https://bugs.webkit.org/show_bug.cgi?id=184976
2767 <rdar://problem/39723901>
2769 Reviewed by Saam Barati.
2771 No new tests needed. This is covered by existing tests.
2773 * cssjit/CSSPtrTag.h:
2774 * cssjit/SelectorCompiler.h:
2775 (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
2776 (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
2777 (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
2778 (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
2780 2018-04-25 Eric Carlson <eric.carlson@apple.com>
2782 [iOS] remove media element parameter from MediaElementSession methods
2783 https://bugs.webkit.org/show_bug.cgi?id=184992
2784 <rdar://problem/39731624>
2786 Reviewed by Jon Lee.
2788 No new tests, no behavior change.
2790 * Modules/mediacontrols/MediaControlsHost.cpp:
2791 (WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
2792 (WebCore::MediaControlsHost::userGestureRequired const):
2793 * accessibility/AccessibilityMediaObject.cpp:
2794 (WebCore::AccessibilityMediaObject::isPlayingInline const):
2795 * html/HTMLMediaElement.cpp:
2796 (WebCore::HTMLMediaElement::~HTMLMediaElement):
2797 (WebCore::HTMLMediaElement::parseAttribute):
2798 (WebCore::HTMLMediaElement::prepareForLoad):
2799 (WebCore::HTMLMediaElement::selectMediaResource):
2800 (WebCore::HTMLMediaElement::loadResource):
2801 (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2802 (WebCore::HTMLMediaElement::setReadyState):
2803 (WebCore::HTMLMediaElement::play):
2804 (WebCore::HTMLMediaElement::pause):
2805 (WebCore::HTMLMediaElement::pauseInternal):
2806 (WebCore::HTMLMediaElement::setVolume):
2807 (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
2808 (WebCore::HTMLMediaElement::sourceWasAdded):
2809 (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
2810 (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
2811 (WebCore::HTMLMediaElement::updatePlayState):
2812 (WebCore::HTMLMediaElement::clearMediaPlayer):
2813 (WebCore::HTMLMediaElement::resume):
2814 (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
2815 (WebCore::HTMLMediaElement::addEventListener):
2816 (WebCore::HTMLMediaElement::removeEventListener):
2817 (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
2818 (WebCore::HTMLMediaElement::exitFullscreen):
2819 (WebCore::HTMLMediaElement::configureMediaControls):
2820 (WebCore::HTMLMediaElement::createMediaPlayer):
2821 (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
2822 (WebCore::HTMLMediaElement::updateMediaState):
2823 (WebCore::HTMLMediaElement::mediaState const):
2824 (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
2825 (WebCore::HTMLMediaElement::updateShouldPlay):
2826 * html/HTMLVideoElement.cpp:
2827 (WebCore::HTMLVideoElement::parseAttribute):
2828 (WebCore::HTMLVideoElement::supportsFullscreen const):
2829 (WebCore::HTMLVideoElement::webkitEnterFullscreen):
2830 (WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
2831 (WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
2832 (WebCore::HTMLVideoElement::setFullscreenMode):
2833 * html/MediaElementSession.cpp:
2834 (WebCore::MediaElementSession::playbackPermitted const):
2835 (WebCore::MediaElementSession::dataLoadingPermitted const):
2836 (WebCore::MediaElementSession::fullscreenPermitted const):
2837 (WebCore::MediaElementSession::pageAllowsDataLoading const):
2838 (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
2839 (WebCore::MediaElementSession::canShowControlsManager const):
2840 (WebCore::MediaElementSession::showPlaybackTargetPicker):
2841 (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
2842 (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
2843 (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2844 (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
2845 (WebCore::MediaElementSession::mediaStateDidChange):
2846 (WebCore::MediaElementSession::effectivePreloadForElement const):
2847 (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
2848 (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
2849 (WebCore::MediaElementSession::mediaEngineUpdated):
2850 (WebCore::MediaElementSession::allowsPictureInPicture const):
2851 * html/MediaElementSession.h:
2852 * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2853 (WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):
2855 2018-04-25 Jiewen Tan <jiewen_tan@apple.com>
2857 Remove access to keychain from the WebContent process
2858 https://bugs.webkit.org/show_bug.cgi?id=184428
2859 <rdar://problem/13150903>
2861 Reviewed by Brent Fulgham.
2865 This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
2866 Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
2867 localized string is marked WEBCORE_EXPORT as well to support the API test.
2869 Covered by existing tests and api tests.
2871 * WebCore.xcodeproj/project.pbxproj:
2873 (WebCore::Document::signedPublicKeyAndChallengeString):
2875 * html/HTMLKeygenElement.cpp:
2876 (WebCore::HTMLKeygenElement::appendFormData):
2877 * page/ChromeClient.h:
2878 * platform/LocalizedStrings.h:
2879 * platform/SSLKeyGenerator.h:
2881 2018-04-25 Ryosuke Niwa <rniwa@webkit.org>
2883 PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
2884 https://bugs.webkit.org/show_bug.cgi?id=184962
2886 Reviewed by Youenn Fablet.
2888 Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
2889 a new WebContent process when navigating to a blob URL, data URL, and about:blank.
2891 Tests: ProcessSwap.SameOriginBlobNavigation
2892 ProcessSwap.CrossOriginBlobNavigation
2893 ProcessSwap.NavigateToAboutBlank
2894 ProcessSwap.NavigateToDataURL
2896 * loader/NavigationAction.cpp:
2897 (WebCore::treatAsSameOriginNavigation):
2898 * loader/NavigationAction.h:
2899 (WebCore::NavigationAction::treatAsSameOriginNavigation const):
2901 2018-04-25 Zalan Bujtas <zalan@apple.com>
2903 [LFC] Implement Layout::BlockContainer functions.
2904 https://bugs.webkit.org/show_bug.cgi?id=184994
2906 Reviewed by Antti Koivisto.
2908 * layout/layouttree/LayoutBlockContainer.cpp:
2909 (WebCore::Layout::BlockContainer::BlockContainer):
2910 (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
2912 2018-04-25 Zalan Bujtas <zalan@apple.com>
2914 [LFC] Implement Layout::Container functions.
2915 https://bugs.webkit.org/show_bug.cgi?id=184988
2917 Reviewed by Antti Koivisto.
2919 * layout/layouttree/LayoutContainer.cpp:
2920 (WebCore::Layout::Container::Container):
2921 (WebCore::Layout::Container::firstInFlowChild const):
2922 (WebCore::Layout::Container::firstInFlowOrFloatingChild const):
2923 (WebCore::Layout::Container::lastInFlowChild const):
2924 (WebCore::Layout::Container::lastInFlowOrFloatingChild const):
2925 (WebCore::Layout::Container::setFirstChild):
2926 (WebCore::Layout::Container::setLastChild):
2927 (WebCore::Layout::Container::setOutOfFlowDescendants):
2928 * layout/layouttree/LayoutContainer.h:
2929 (WebCore::Layout::Container::firstChild const):
2930 (WebCore::Layout::Container::lastChild const):
2931 (WebCore::Layout::Container::hasChild const):
2932 (WebCore::Layout::Container::hasInFlowChild const):
2933 (WebCore::Layout::Container::hasInFlowOrFloatingChild const):
2934 (WebCore::Layout::Container::outOfFlowDescendants):
2936 2018-04-25 Brent Fulgham <bfulgham@apple.com>
2938 Don't Block First Party Cookies on Redirects
2939 https://bugs.webkit.org/show_bug.cgi?id=184948
2940 <rdar://problem/39534099>
2942 Reviewed by Youenn Fablet.
2944 The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.
2946 Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
2948 * loader/NavigationScheduler.cpp:
2950 2018-04-25 Youenn Fablet <youenn@apple.com>
2952 CachedRawResource is not handling incremental data computation correctly
2953 https://bugs.webkit.org/show_bug.cgi?id=184936
2955 Reviewed by Chris Dumez.
2957 Covered by updated test.
2959 The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
2960 In service worker case, a SharedBuffer may contain more than one segment.
2961 This is fixed by iterating until all new data is sent to clients.
2963 * loader/cache/CachedRawResource.cpp:
2964 (WebCore::CachedRawResource::updateBuffer):
2966 2018-04-25 Andy Estes <aestes@apple.com>
2968 [Mac] Number of drop items is always 0 when performing a DHTML drag
2969 https://bugs.webkit.org/show_bug.cgi?id=184943
2971 Reviewed by Ryosuke Niwa.
2973 New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop
2975 DragController tracks the number of items to be accepted by a file input element, taking
2976 into account whether the control is disabled or accepts multiple files. When this number
2977 changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
2978 calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
2979 rendered next to the dragging item thumbnails.
2981 When performing a DHTML drag, we don't know how many items the page will accept, so prior
2982 to this patch we would render a "0" in the badge. This is misleading, because the page is
2983 more likely to accept all the items (or at least one of them) rather than none of them.
2985 Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
2986 files in the drag operation when performing a DHTML file drag.
2988 * page/DragController.cpp:
2989 (WebCore::DragController::tryDocumentDrag):
2991 2018-04-25 Eric Carlson <eric.carlson@apple.com>
2993 [iOS] Set route sharing policy when setting audio session category
2994 https://bugs.webkit.org/show_bug.cgi?id=184979
2995 <rdar://problem/39709577>
2997 Reviewed by Jer Noble.
2999 * platform/audio/ios/AudioSessionIOS.mm:
3000 (WebCore::AudioSession::setCategory):
3002 2018-04-25 Basuke Suzuki <Basuke.Suzuki@sony.com>
3004 [Curl] Fix wrong schema checking on r230973
3005 https://bugs.webkit.org/show_bug.cgi?id=184977
3007 Did write a wrong condition when making a string.
3009 Reviewed by Alex Christensen.
3011 No new tests because test interface is not ready.
3013 * platform/network/curl/CurlProxySettings.cpp:
3014 (WebCore::createProxyUrl):
3016 2018-04-25 Youenn Fablet <youenn@apple.com>
3018 Make DocumentThreadableLoader error logging more consistent
3019 https://bugs.webkit.org/show_bug.cgi?id=184853
3021 Reviewed by Chris Dumez.
3023 Covered by rebased tests.
3024 Make EventSource, XHR and Fetch log error messages consistently.
3025 This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
3026 will issue more and more errors in places different from WK1.
3027 This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.
3029 Update ImageLoader error message to be more general than CORS.
3031 * loader/CrossOriginPreflightChecker.cpp:
3032 (WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
3033 (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
3034 * loader/DocumentThreadableLoader.cpp:
3035 (WebCore::DocumentThreadableLoader::didFail):
3036 (WebCore::DocumentThreadableLoader::preflightFailure):
3037 (WebCore::DocumentThreadableLoader::logErrorAndFail):
3038 * loader/ImageLoader.cpp:
3039 (WebCore::ImageLoader::notifyFinished):
3040 * loader/SubresourceLoader.cpp:
3041 (WebCore::SubresourceLoader::didFail):
3042 * loader/ThreadableLoader.cpp:
3043 (WebCore::ThreadableLoader::logError):
3044 * loader/cache/CachedResource.cpp:
3045 (WebCore::CachedResource::load):
3046 * loader/cache/CachedResourceRequestInitiators.cpp:
3047 (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
3048 * loader/cache/CachedResourceRequestInitiators.h:
3049 * page/EventSource.cpp:
3050 (WebCore::EventSource::connect):
3051 (WebCore::EventSource::didFail):
3052 * xml/XMLHttpRequest.cpp:
3053 (WebCore::XMLHttpRequest::didFail):
3055 2018-04-25 Zalan Bujtas <zalan@apple.com>
3057 [LFC] Implement Layout::Box functions.
3058 https://bugs.webkit.org/show_bug.cgi?id=184974
3060 Reviewed by Antti Koivisto.
3062 * layout/layouttree/LayoutBlockContainer.h:
3063 * layout/layouttree/LayoutBox.cpp:
3064 (WebCore::Layout::Box::Box):
3065 (WebCore::Layout::Box::~Box):
3066 (WebCore::Layout::Box::establishesFormattingContext const):
3067 (WebCore::Layout::Box::establishesBlockFormattingContext const):
3068 (WebCore::Layout::Box::isRelativelyPositioned const):
3069 (WebCore::Layout::Box::isStickyPositioned const):
3070 (WebCore::Layout::Box::isAbsolutelyPositioned const):
3071 (WebCore::Layout::Box::isFixedPositioned const):
3072 (WebCore::Layout::Box::isFloatingPositioned const):
3073 (WebCore::Layout::Box::containingBlock const):
3074 (WebCore::Layout::Box::isDescendantOf const):
3075 (WebCore::Layout::Box::isAnonymous const):
3076 (WebCore::Layout::Box::isInlineBlockBox const):
3077 (WebCore::Layout::Box::isBlockLevelBox const):
3078 (WebCore::Layout::Box::isInlineLevelBox const):
3079 (WebCore::Layout::Box::isBlockContainerBox const):
3080 (WebCore::Layout::Box::isInitialContainingBlock const):
3081 (WebCore::Layout::Box::nextInFlowSibling const):
3082 (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
3083 (WebCore::Layout::Box::previousInFlowSibling const):
3084 (WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
3085 (WebCore::Layout::Box::setParent):
3086 (WebCore::Layout::Box::setNextSibling):
3087 (WebCore::Layout::Box::setPreviousSibling):
3088 (WebCore::Layout::Box::isOverflowVisible const):
3089 * layout/layouttree/LayoutBox.h:
3090 (WebCore::Layout::Box::establishesInlineFormattingContext const):
3091 (WebCore::Layout::Box::isInFlow const):
3092 (WebCore::Layout::Box::isPositioned const):
3093 (WebCore::Layout::Box::isInFlowPositioned const):
3094 (WebCore::Layout::Box::isOutOfFlowPositioned const):
3095 (WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
3096 (WebCore::Layout::Box::parent const):
3097 (WebCore::Layout::Box::nextSibling const):
3098 (WebCore::Layout::Box::previousSibling const):
3099 (WebCore::Layout::Box::weakPtrFactory const):
3100 * layout/layouttree/LayoutContainer.h:
3101 * layout/layouttree/LayoutInlineBox.h:
3102 * layout/layouttree/LayoutInlineContainer.h:
3104 2018-04-25 Per Arne Vollan <pvollan@apple.com>
3106 [Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
3107 https://bugs.webkit.org/show_bug.cgi?id=184953
3109 This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
3110 The crash is only happening in release builds, which also is an indication of this being a
3113 Reviewed by Zalan Bujtas.
3115 No new tests, covered by existing tests.
3117 * rendering/SimpleLineLayoutFunctions.cpp:
3118 (WebCore::SimpleLineLayout::generateLineBoxTree):
3120 2018-04-25 Dean Jackson <dino@apple.com>
3122 Make a better flag for system preview, and disable it where necessary
3123 https://bugs.webkit.org/show_bug.cgi?id=184968
3124 <rdar://problem/39686506>
3126 Reviewed by Eric Carlson.
3128 Use USE(SYSTEM_PREVIEW).
3130 * html/HTMLAnchorElement.cpp:
3131 (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
3132 * html/HTMLAnchorElement.h:
3133 * html/HTMLImageElement.cpp:
3134 * html/HTMLImageElement.h:
3135 * html/HTMLPictureElement.cpp:
3136 * html/HTMLPictureElement.h:
3137 * rendering/RenderImage.cpp:
3138 (WebCore::RenderImage::paintIntoRect):
3139 * rendering/RenderTheme.cpp:
3140 * rendering/RenderTheme.h:
3141 * testing/Internals.cpp:
3142 (WebCore::Internals::systemPreviewRelType):
3143 (WebCore::Internals::isSystemPreviewLink const):
3144 (WebCore::Internals::isSystemPreviewImage const):
3146 2018-04-25 Zalan Bujtas <zalan@apple.com>
3148 Fix project file after r230931.
3150 * WebCore.xcodeproj/project.pbxproj:
3152 2018-04-25 Miguel Gomez <magomez@igalia.com>
3154 [GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
3155 https://bugs.webkit.org/show_bug.cgi?id=184780
3157 Reviewed by Žan Doberšek.
3159 Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.
3161 Covered by existent tests.
3163 * platform/graphics/texmap/TextureMapperLayer.h:
3165 2018-04-25 Carlos Garcia Campos <cgarcia@igalia.com>
3167 [GTK] Implement MouseEvent.buttons
3168 https://bugs.webkit.org/show_bug.cgi?id=184913
3170 Reviewed by Žan Doberšek.
3172 Add helper function to get the state modifier of a GDK button.
3174 * platform/gtk/GtkUtilities.cpp:
3175 (WebCore::stateModifierForGdkButton):
3176 * platform/gtk/GtkUtilities.h:
3178 2018-04-24 Ryosuke Niwa <rniwa@webkit.org>
3180 Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
3181 Document::updateStyleIfNeeded
3182 https://bugs.webkit.org/show_bug.cgi?id=184950
3184 Reviewed by Zalan Bujtas.
3186 Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
3187 by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.
3189 Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
3190 there is no security implication to execute scripts in this isolated document.
3192 Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
3193 style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
3194 I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
3195 by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.
3197 * dom/ScriptDisallowedScope.h: Updated the comment.
3198 * loader/cache/CachedSVGFont.cpp:
3199 (WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.
3201 2018-04-24 Simon Fraser <simon.fraser@apple.com>
3203 visitedDependentColor() should take a CSSPropertyID
3204 https://bugs.webkit.org/show_bug.cgi?id=184949
3206 Reviewed by Sam Weinig.
3208 Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
3209 and RenderElement::selectionColor() to take CSSPropertyID rather than int.
3213 * rendering/RenderElement.cpp:
3214 (WebCore::RenderElement::selectionColor const):
3215 * rendering/RenderElement.h:
3216 * rendering/RenderTableCell.cpp:
3217 (WebCore::RenderTableCell::computeCollapsedStartBorder const):
3218 (WebCore::RenderTableCell::computeCollapsedEndBorder const):
3219 (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
3220 (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
3221 * rendering/style/RenderStyle.cpp:
3222 (WebCore::RenderStyle::colorIncludingFallback const):
3223 (WebCore::RenderStyle::visitedDependentColor const):
3224 * rendering/style/RenderStyle.h:
3226 2018-04-24 Simon Fraser <simon.fraser@apple.com>
3228 Add a new "color-filter" CSS property as an experimental feature
3229 https://bugs.webkit.org/show_bug.cgi?id=184940
3230 rdar://problem/39664904
3232 Reviewed by Jon Lee.
3234 Add a new CSS property called "color-filter" as an experimental feature (off by default).
3236 This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
3237 to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
3238 Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.
3240 Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.
3242 This patch adds support for parsing color-filter.
3244 Test: css3/color-filters/color-filter-parsing.html
3246 * css/CSSComputedStyleDeclaration.cpp:
3247 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3248 * css/CSSProperties.json:
3249 * css/parser/CSSParser.cpp:
3250 (WebCore::CSSParserContext::CSSParserContext):
3251 (WebCore::operator==):
3252 * css/parser/CSSParserMode.h:
3253 * css/parser/CSSPropertyParser.cpp:
3254 (WebCore::CSSPropertyParser::parseSingleValue):
3255 * css/parser/CSSPropertyParserHelpers.cpp:
3256 (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
3257 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
3258 (WebCore::CSSPropertyParserHelpers::consumeFilter):
3259 * css/parser/CSSPropertyParserHelpers.h:
3260 * page/Settings.yaml:
3261 * rendering/style/RenderStyle.cpp:
3262 (WebCore::RenderStyle::changeRequiresRepaint const):
3263 * rendering/style/RenderStyle.h:
3264 (WebCore::RenderStyle::mutableColorFilter):
3265 (WebCore::RenderStyle::colorFilter const):
3266 (WebCore::RenderStyle::hasColorFilter const):
3267 (WebCore::RenderStyle::setColorFilter):
3268 (WebCore::RenderStyle::initialColorFilter):
3269 * rendering/style/StyleRareInheritedData.cpp:
3270 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3271 (WebCore::StyleRareInheritedData::operator== const):
3272 (WebCore::StyleRareInheritedData::hasColorFilters const):
3273 * rendering/style/StyleRareInheritedData.h:
3275 2018-04-24 Simon Fraser <simon.fraser@apple.com>
3277 shape-outside and filter styles occur twice in the result of getComputedStyle
3278 https://bugs.webkit.org/show_bug.cgi?id=184931
3280 Reviewed by Antti Koivisto.
3282 CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
3283 used by getComputedStyle. Remove the duplication.
3285 Tested by existing tests.
3287 * css/CSSComputedStyleDeclaration.cpp:
3289 2018-04-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
3291 [Curl] Extract proxy settings into a separate class to hold advanced information.
3292 https://bugs.webkit.org/show_bug.cgi?id=184714
3294 It was simplely structure to hold proxy setting. To support advanced feature of proxy
3295 such as authentication, more inteligent object is required to store intermediate state
3296 or errors. That's why we've introduced new class for that purpose.
3298 Reviewed by Youenn Fablet.
3300 No new tests because there's no new behavior.
3302 * platform/Curl.cmake:
3303 * platform/network/curl/CurlContext.cpp:
3304 (WebCore::CurlHandle::enableProxyIfExists):
3305 (WebCore::CurlContext::ProxyInfo::url const): Deleted.
3306 (WebCore::CurlContext::setProxyInfo): Deleted.
3307 * platform/network/curl/CurlContext.h:
3308 (WebCore::CurlContext::proxySettings const):
3309 (WebCore::CurlContext::setProxySettings):
3310 (WebCore::CurlContext::setProxyUserPass):
3311 (WebCore::CurlContext::proxyInfo const): Deleted.
3312 (WebCore::CurlContext::setProxyInfo): Deleted.
3313 * platform/network/curl/CurlProxySettings.cpp: Added.
3314 (WebCore::CurlProxySettings::CurlProxySettings):
3315 (WebCore::CurlProxySettings::rebuildUrl):
3316 (WebCore::CurlProxySettings::setUserPass):
3317 (WebCore::protocolIsInSocksFamily):
3318 (WebCore::getProxyPort):
3319 (WebCore::createProxyUrl):
3320 * platform/network/curl/CurlProxySettings.h: Added.
3321 (WebCore::CurlProxySettings::CurlProxySettings):
3322 (WebCore::CurlProxySettings::isEmpty const):
3323 (WebCore::CurlProxySettings::mode const):
3324 (WebCore::CurlProxySettings::url const):
3325 (WebCore::CurlProxySettings::ignoreHosts const):
3326 (WebCore::CurlProxySettings::user const):
3327 (WebCore::CurlProxySettings::password const):
3328 * platform/network/curl/CurlRequest.cpp:
3329 (WebCore::CurlRequest::didReceiveHeader):
3330 * platform/network/curl/CurlResponse.h:
3331 (WebCore::CurlResponse::isolatedCopy const):
3332 * platform/network/curl/ResourceResponseCurl.cpp:
3333 (WebCore::ResourceResponse::ResourceResponse):
3335 2018-04-24 Youenn Fablet <youenn@apple.com>
3337 Throw in case of PeerConnection created for detached documents
3338 https://bugs.webkit.org/show_bug.cgi?id=184921
3339 <rdar://problem/39629216>
3341 Reviewed by Eric Carlson.
3343 Add a check to ensure that page is not null when creating a peer connection backend.
3344 In that case, the peer connection constructor will later on throw.
3345 The same for setConfiguration is done.
3346 Behavior is consistent with Chrome.
3348 Test: webrtc/pc-detached-document.html
3350 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3351 (WebCore::createLibWebRTCPeerConnectionBackend):
3352 (WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
3353 (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
3354 (WebCore::libWebRTCProvider): Deleted.
3355 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3357 2018-04-24 John Wilander <wilander@apple.com>
3359 From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
3360 https://bugs.webkit.org/show_bug.cgi?id=184560
3361 <rdar://problem/38901344>
3363 Reviewed by Youenn Fablet and Daniel Bates.
3365 Tests: http/tests/from-origin/document-from-origin-same-accepted.html
3366 http/tests/from-origin/document-from-origin-same-blocked.html
3367 http/tests/from-origin/document-from-origin-same-site-accepted.html
3368 http/tests/from-origin/document-from-origin-same-site-blocked.html
3369 http/tests/from-origin/document-nested-from-origin-same-accepted.html
3370 http/tests/from-origin/document-nested-from-origin-same-blocked.html
3371 http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
3372 http/tests/from-origin/fetch-from-origin-same-accepted.html
3373 http/tests/from-origin/fetch-from-origin-same-blocked.html
3374 http/tests/from-origin/fetch-from-origin-same-site-accepted.html
3375 http/tests/from-origin/fetch-from-origin-same-site-blocked.html
3376 http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
3377 http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
3378 http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
3379 http/tests/from-origin/image-from-origin-same-accepted.html
3380 http/tests/from-origin/image-from-origin-same-blocked.html
3381 http/tests/from-origin/image-from-origin-same-site-accepted.html
3382 http/tests/from-origin/image-from-origin-same-site-blocked.html
3383 http/tests/from-origin/redirect-document-from-origin-same-blocked.html
3384 http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
3385 http/tests/from-origin/redirect-image-from-origin-same-blocked.html
3386 http/tests/from-origin/redirect-script-from-origin-same-blocked.html
3387 http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
3388 http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
3389 http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
3390 http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
3391 http/tests/from-origin/script-from-origin-same-accepted.html
3392 http/tests/from-origin/script-from-origin-same-blocked.html
3393 http/tests/from-origin/script-from-origin-same-site-accepted.html
3394 http/tests/from-origin/script-from-origin-same-site-blocked.html
3395 http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
3396 http/tests/from-origin/xhr-from-origin-same-accepted.html
3397 http/tests/from-origin/xhr-from-origin-same-blocked.html
3398 http/tests/from-origin/xhr-from-origin-same-site-accepted.html
3399 http/tests/from-origin/xhr-from-origin-same-site-blocked.html
3401 * loader/SubresourceLoader.cpp:
3402 (WebCore::SubresourceLoader::didFail):
3403 Outputs the error's localized description in a console message except when the destination
3404 is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
3405 * page/RuntimeEnabledFeatures.h:
3406 (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
3407 (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
3408 Added From-Origin support as an experimental feature.
3409 * platform/network/HTTPHeaderNames.in:
3411 * platform/network/HTTPParsers.cpp:
3412 (WebCore::parseFromOriginHeader):
3413 Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
3414 * platform/network/HTTPParsers.h:
3416 2018-04-24 Antti Koivisto <antti@apple.com>
3418 Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
3419 https://bugs.webkit.org/show_bug.cgi?id=184922
3421 Reviewed by Zalan Bujtas.
3423 To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.
3426 * WebCore.xcodeproj/project.pbxproj:
3427 * layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
3428 * layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
3429 * layout/LayoutCtx.cpp: Removed.
3430 * layout/LayoutCtx.h: Removed.
3431 * page/FrameView.cpp:
3432 (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
3433 (WebCore::FrameView::updateLayoutViewport):
3434 (WebCore::FrameView::updateLayerPositionsAfterScrolling):
3435 (WebCore::FrameView::updateCompositingLayersAfterScrolling):
3436 (WebCore::FrameView::availableContentSizeChanged):
3438 * page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
3439 (WebCore::LayoutScope::LayoutScope):
3440 (WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
3441 (WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
3442 (WebCore::FrameViewLayoutContext::layout):
3443 (WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
3444 (WebCore::FrameViewLayoutContext::runA