1 2017-04-05 Alex Christensen <achristensen@webkit.org>
5 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
6 Some JavaScript inline functions were not being accessed from this file with different enable flags.
7 * platform/spi/cf/CFNetworkSPI.h:
8 * platform/spi/cocoa/NSURLConnectionSPI.h:
9 Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
11 2017-04-05 Chris Dumez <cdumez@apple.com>
13 _blank / _self / _parent / _top browsing context names should be case-insensitive
14 https://bugs.webkit.org/show_bug.cgi?id=169747
16 Reviewed by Alex Christensen.
18 _blank / _self / _parent / _top browsing context names should be case-insensitive
19 as per the HTML specification:
20 - https://html.spec.whatwg.org/#browsing-context-names
22 This aligns our behavior with Firefox as well. See discussion at:
23 - https://github.com/whatwg/html/issues/2443
25 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
26 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
27 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
28 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
29 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
31 * loader/FrameLoader.cpp:
32 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
33 (WebCore::createWindow):
35 (WebCore::DOMWindow::open):
37 (WebCore::FrameTree::uniqueChildName):
38 (WebCore::FrameTree::find):
40 2017-04-05 Miguel Gomez <magomez@igalia.com>
42 [GTK+] PNG animations that should run once are not played at all
43 https://bugs.webkit.org/show_bug.cgi?id=170499
45 Reviewed by Carlos Garcia Campos.
47 The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
48 means 0 for the animations that need to be played once. Change it to return an appropriate value.
50 Covered by existent tests.
52 * platform/image-decoders/png/PNGImageDecoder.cpp:
53 (WebCore::PNGImageDecoder::repetitionCount):
54 * platform/image-decoders/png/PNGImageDecoder.h:
56 2017-04-05 Andy Estes <aestes@apple.com>
58 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
59 https://bugs.webkit.org/show_bug.cgi?id=170365
60 <rdar://problem/29205721>
62 Reviewed by Tim Horton.
64 r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
65 consider nodes that are descendants of startNode, but we need to traverse all nodes between
66 startNode and endNode to find existing non-DD links.
68 As a result, we'd add a Data Detector link to the following snippet and make the original
71 <a href='#'>tomorrow</a> <a href='#'>night</a>
73 Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
74 will terminate when we reach endNode.
76 Updated WebKit2.DataDetectionReferenceDate API test.
78 * editing/cocoa/DataDetection.mm:
79 (WebCore::searchForLinkRemovingExistingDDLinks):
81 2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
83 Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
84 https://bugs.webkit.org/show_bug.cgi?id=156974
86 Reviewed by Sam Weinig.
91 * platform/gtk/ErrorsGtk.cpp: Removed.
92 * platform/gtk/ErrorsGtk.h: Removed.
94 2017-04-05 Andy Estes <aestes@apple.com>
96 [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
97 https://bugs.webkit.org/show_bug.cgi?id=161967
99 Reviewed by Alexey Proskuryakov.
101 DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
102 on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
103 8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
104 or return DDQueryOffsets.
106 * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
107 Public SDK builds, and added a static_assert to detect future size changes at compile time.
109 2017-04-04 Jer Noble <jer.noble@apple.com>
111 Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
112 https://bugs.webkit.org/show_bug.cgi?id=170471
114 Reviewed by Eric Carlson.
116 Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
118 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
119 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
120 * platform/spi/mac/AVFoundationSPI.h:
122 2017-04-04 Youenn Fablet <youenn@apple.com>
124 Canvas is tainted when painting a video with MediaStreamTrack
125 https://bugs.webkit.org/show_bug.cgi?id=170486
127 Reviewed by Eric Carlson.
129 Test: http/tests/media/media-stream/getusermedia-with-canvas.html
131 Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
132 For now, canvas will not be tainted if painted from a MediaStreamTrack.
134 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
135 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
136 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
137 * platform/mediastream/MediaStreamTrackPrivate.h:
138 (WebCore::MediaStreamTrackPrivate::isIsolated):
139 * platform/mediastream/RealtimeMediaSource.h:
141 2017-04-04 Commit Queue <commit-queue@webkit.org>
143 Unreviewed, rolling out r214894, r214895, r214907, r214912,
145 https://bugs.webkit.org/show_bug.cgi?id=170491
147 Caused build failures on Mac (Requested by rniwa on #webkit).
152 http://trac.webkit.org/changeset/214894
154 "Rolling back the build fix, as it broke other builds."
155 http://trac.webkit.org/changeset/214895
157 "Move AVSampleBufferDisplayLayer declarations into
159 https://bugs.webkit.org/show_bug.cgi?id=170471
160 http://trac.webkit.org/changeset/214907
162 "Unreviewed build fix: fix compilation error on Sierra."
163 http://trac.webkit.org/changeset/214912
166 http://trac.webkit.org/changeset/214918
168 2017-04-04 Youenn Fablet <youenn@apple.com>
170 [Mac] Add back web audio support for getUserMedia MediaStreamTrack
171 https://bugs.webkit.org/show_bug.cgi?id=170482
173 Reviewed by Eric Carlson.
175 ´Covered by reenabled test.
177 Exporting method and class used in WebKit2.
179 * WebCore.xcodeproj/project.pbxproj:
180 * platform/audio/mac/CAAudioStreamDescription.h:
181 * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
183 2017-04-04 Alexey Proskuryakov <ap@apple.com>
187 * platform/spi/mac/AVFoundationSPI.h:
189 2017-04-04 Simon Fraser <simon.fraser@apple.com>
191 Do some minor FEColorMatrix code cleanup and optimization
192 https://bugs.webkit.org/show_bug.cgi?id=170474
194 Reviewed by Dean Jackson.
196 Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
198 Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
199 of multiple times, which is faster.
201 This kind of code benefits from aligning things with spaces for readability, so do so,
202 violating webkit style.
204 Add some off-by-default performance logging code.
206 Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
208 * platform/graphics/filters/FEColorMatrix.cpp:
210 (WebCore::saturateAndHueRotate):
211 (WebCore::effectType):
212 (WebCore::FEColorMatrix::platformApplySoftware):
214 2017-04-04 Brent Fulgham <bfulgham@apple.com>
216 Do not assert when CharacterData representing an Attr fires events
217 https://bugs.webkit.org/show_bug.cgi?id=170454
218 <rdar://problem/30979320>
220 Reviewed by Ryosuke Niwa.
222 Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
223 since Attr elements should be allowed to fire events.
225 Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
227 * dom/CharacterData.cpp:
228 (WebCore::CharacterData::notifyParentAfterChange):
230 2017-04-04 Youenn Fablet <youenn@apple.com>
232 LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
233 https://bugs.webkit.org/show_bug.cgi?id=169481
235 Reviewed by Eric Carlson.
237 No need to enumerate all network interfaces in most layout tests.
238 Adding an Internals API for that in case we want to use TCP localhost candidates.
240 * testing/Internals.cpp:
241 (WebCore::Internals::Internals):
242 (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
243 * testing/Internals.h:
244 * testing/Internals.idl:
247 2017-04-04 Jer Noble <jer.noble@apple.com>
249 Unreviewed build fix: fix compilation error on Sierra.
251 * platform/spi/mac/AVFoundationSPI.h:
253 2017-04-04 Jer Noble <jer.noble@apple.com>
255 Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
256 https://bugs.webkit.org/show_bug.cgi?id=170471
258 Reviewed by Eric Carlson.
260 Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
262 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
263 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
264 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
265 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
266 * platform/spi/mac/AVFoundationSPI.h:
268 2017-04-04 Saam Barati <sbarati@apple.com>
270 WebAssembly: JSWebAssemblyCallee should not be a JSCell
271 https://bugs.webkit.org/show_bug.cgi?id=170135
273 Reviewed by Michael Saboff.
275 * bindings/js/JSDOMWindowBase.cpp:
276 (WebCore::callerDOMWindow):
278 2017-04-04 Simon Fraser <simon.fraser@apple.com>
280 Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
281 https://bugs.webkit.org/show_bug.cgi?id=170468
283 Reviewed by Zalan Bujtas.
285 Change the double to MonotonicTime. No behavior change.
288 (WebCore::Document::updateLastHandledUserGestureTimestamp):
290 (WebCore::Document::lastHandledUserGestureTimestamp):
291 * html/HTMLPlugInImageElement.cpp:
292 (WebCore::documentHadRecentUserGesture):
293 * loader/FrameLoader.cpp:
294 (WebCore::shouldAskForNavigationConfirmation):
296 2017-04-04 Youenn Fablet <youenn@apple.com>
298 [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
299 https://bugs.webkit.org/show_bug.cgi?id=170395
300 <rdar://problem/31394017>
302 Reviewed by Mark Lam.
304 No change of behavior.
306 * bindings/js/JSDOMPromise.cpp:
307 (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
309 2017-04-04 Alexey Proskuryakov <ap@apple.com>
311 Rolling back the build fix, as it broke other builds.
313 * platform/spi/mac/AVFoundationSPI.h:
315 2017-04-04 Alexey Proskuryakov <ap@apple.com>
319 Rubber-stamped by Jer Noble.
321 * platform/spi/mac/AVFoundationSPI.h:
323 2017-04-04 Tim Horton <timothy_horton@apple.com>
325 [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
326 https://bugs.webkit.org/show_bug.cgi?id=165801
327 <rdar://problem/29649535>
329 Reviewed by Wenson Hsieh.
331 New API tests: WebKit2.FindInPageWrapping*
333 * page/FrameTree.cpp:
334 (WebCore::FrameTree::traverseNextWithWrap):
335 (WebCore::FrameTree::traversePreviousWithWrap):
336 (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
338 Add CanWrap and DidWrap boolean enums, and add an optional out argument
339 to traverse*WithWrap indicating whether a wrap actually occurred.
341 * history/CachedPage.cpp:
342 (WebCore::firePageShowAndPopStateEvents):
343 * history/PageCache.cpp:
344 (WebCore::destroyRenderTree):
345 Adjust to the new CanWrap enum.
348 (WebCore::incrementFrame):
349 (WebCore::Page::findString):
350 (WebCore::Page::findStringMatchingRanges):
351 (WebCore::Page::rangeOfString):
352 (WebCore::Page::findMatchesForText):
353 (WebCore::Page::unmarkAllTextMatches):
355 Adjust to the new CanWrap enum, and optionally plumb DidWrap through
356 to callers of findString().
358 2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
360 [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
361 https://bugs.webkit.org/show_bug.cgi?id=170458
363 Reviewed by Carlos Alberto Lopez Perez.
365 That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
367 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
368 (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
370 2017-04-04 Per Arne Vollan <pvollan@apple.com>
372 Unreviewed Windows build fix.
374 * bindings/js/JSDOMGuardedObject.h:
376 2017-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
378 Data interaction should register type identifiers in order of priority
379 https://bugs.webkit.org/show_bug.cgi?id=170428
380 <rdar://problem/30633296>
382 Reviewed by Tim Horton.
384 Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
385 UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
386 ordering in which type identifiers are registered in the generated item provider. This is because
387 -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
389 To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
390 representations in order of priority (which is dependent on the content being interacted with) and then register
391 individual type-data mappings at the end.
393 Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
394 in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
395 DataInteractionTests.TextAreaToInput.
397 * WebCore.xcodeproj/project.pbxproj:
398 * editing/cocoa/EditorCocoa.mm:
399 (WebCore::archivedDataForAttributedString):
400 (WebCore::Editor::writeSelectionToPasteboard):
401 (WebCore::Editor::writeSelection):
402 * platform/Pasteboard.h:
403 * platform/PasteboardWriterData.h:
404 * platform/PlatformPasteboard.h:
405 * platform/ios/AbstractPasteboard.h:
406 * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
408 Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
409 of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
411 (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
412 (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
413 (-[WebPasteboardItemData representingObjects]):
414 (-[WebPasteboardItemData additionalData]):
415 * platform/ios/PlatformPasteboardIOS.mm:
416 (WebCore::richTextRepresentationsForPasteboardWebContent):
417 (WebCore::PlatformPasteboard::writeObjectRepresentations):
418 (WebCore::PlatformPasteboard::write):
420 Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
421 PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
424 * platform/ios/WebItemProviderPasteboard.mm:
425 (-[WebItemProviderPasteboard pasteboardTypes]):
426 (-[WebItemProviderPasteboard setItemProviders:]):
427 (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
429 Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
430 representation of the data in the pasteboard.
432 (-[WebItemProviderPasteboard setItems:]): Deleted.
434 2017-04-03 Javier Fernandez <jfernandez@igalia.com>
436 [css-align] Adapt place-content alignment shorthand to the new baseline syntax
437 https://bugs.webkit.org/show_bug.cgi?id=170340
439 Reviewed by David Hyatt.
441 Now that the align-content and justify-content CSS properties are
442 adapted to the new baseline-position CSS values syntax we can adapt the
443 shorthand that controls such properties to the new syntax as well.
445 No new tests, just adding some additional cases to the tests we already have.
447 * css/StyleProperties.cpp:
448 (WebCore::StyleProperties::getPropertyValue):
449 (WebCore::StyleProperties::placeContentPropertyValue):
450 * css/StyleProperties.h:
451 * css/parser/CSSPropertyParser.cpp:
452 (WebCore::isContentDistributionKeyword):
453 (WebCore::isContentPositionKeyword):
454 (WebCore::isOverflowKeyword):
455 (WebCore::getBaselineKeyword):
456 (WebCore::consumeContentDistributionOverflowPosition):
457 (WebCore::consumeSimplifiedContentPosition):
459 2017-04-03 Nan Wang <n_wang@apple.com>
461 AX: Expose link children when doing search predication on iOS
462 https://bugs.webkit.org/show_bug.cgi?id=170424
463 <rdar://problem/31413335>
465 The children of links are accessible elements on iOS instead of the link itself,
466 so we should expose the children when doing predicated searches as well.
468 Reviewed by Chris Fleizach.
470 Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
472 * accessibility/AccessibilityObject.cpp:
473 (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
475 2017-04-03 Jer Noble <jer.noble@apple.com>
477 No audio output for MediaStream-backed audio elements on iOS
478 https://bugs.webkit.org/show_bug.cgi?id=170427
480 Reviewed by Eric Carlson.
482 The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
483 subtracting out the timestamp of the first pull request, it effectively doubled it.
485 * platform/audio/mac/AudioSampleDataSource.mm:
486 (WebCore::AudioSampleDataSource::pullSamplesInternal):
488 2017-04-03 Dave Hyatt <hyatt@apple.com>
490 Japanese fonts in vertical text should support synthesized italics
491 https://bugs.webkit.org/show_bug.cgi?id=169301
493 Reviewed by Simon Fraser.
495 Updated test in fast/text/international.
497 * platform/graphics/Font.cpp:
498 (WebCore::Font::nonSyntheticItalicFont): Deleted.
499 * platform/graphics/Font.h:
500 Removed the non-synthetic italic font member, since it's not used.
502 * platform/graphics/FontCascadeFonts.cpp:
503 (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
504 Patched to ensure that a text-orientation-fallback font data is always
505 returned in the synthetic oblique case, so that non-CJK and CJK are
506 guaranteed to be broken up so that their slants can be applied differently.
508 (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
509 (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
510 (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
511 Patched to no longer turn off synthetic oblique for CJK.
513 * platform/graphics/cocoa/FontCascadeCocoa.mm:
514 (WebCore::FontCascade::drawGlyphs):
515 Apply the correct italic transform to CJK when in vertical text.
517 2017-04-03 Chris Dumez <cdumez@apple.com>
519 REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
520 https://bugs.webkit.org/show_bug.cgi?id=170285
521 <rdar://problem/31378543>
523 Reviewed by Andy Estes.
525 r206744 caused up to stop trying to resolve relative URLs when trying to load an image
526 referred to by CSS. We already try to resolve the relative URL when parsing the CSS
527 property so this will usually work fine. However, in the case when the CSS property
528 is parsed in detached document and then moved to another document, we will not have
531 Test: fast/images/background-image-relative-url-changes-document.html
533 * css/CSSImageValue.cpp:
534 (WebCore::CSSImageValue::loadImage):
536 2017-04-03 Jeremy Jones <jeremyj@apple.com>
538 Do not set WebAVPlayerLayerView background to black in fullscreen.
539 https://bugs.webkit.org/show_bug.cgi?id=170132
540 rdar://problem/30839278
542 Reviewed by Tim Horton.
544 No new tests because no behavior change.
546 The black background on WebAVPlayerLayerView interferes with the fullscreen animation
547 and has been removed.
549 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
550 (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
551 (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
553 2017-04-03 Antti Koivisto <antti@apple.com>
555 REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
556 https://bugs.webkit.org/show_bug.cgi?id=170402
557 <rdar://problem/31004344>
559 Reviewed by Simon Fraser.
561 If a new stylesheet load is started from the load event the document.styleSheets does not
562 always reflect the already loaded stylesheets.
564 Test: fast/css/document-stylesheets-dynamic.html
566 * style/StyleScope.cpp:
567 (WebCore::Style::Scope::updateActiveStyleSheets):
569 Remove an old optimization where we would not update active stylesheets if there were pending
570 (head) stylesheet loads and they had not been updated already.
571 This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
573 * style/StyleScope.h:
575 2017-04-03 Anders Carlsson <andersca@apple.com>
577 Tweak ApplePaySession API
578 https://bugs.webkit.org/show_bug.cgi?id=170409
579 rdar://problem/31405459
581 Reviewed by Tim Horton.
583 Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
585 * Modules/applepay/ApplePayError.cpp:
586 (WebCore::ApplePayError::create):
587 (WebCore::ApplePayError::ApplePayError):
588 * Modules/applepay/ApplePayError.h:
589 * Modules/applepay/ApplePayError.idl:
590 * Modules/applepay/PaymentRequest.h:
592 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
594 [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
595 https://bugs.webkit.org/show_bug.cgi?id=170345
597 Reviewed by Michael Catanzaro.
599 Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
601 Implement keySizeInBits() by returning the appropriate size for this
602 object's curve type. An assertion is added to ensure that this size
603 matches the one that's returned by gcry_pk_get_nbits() for this
604 object's EC key as represented by the m_platformKey gcry_sexp_t object.
606 Implement platformGeneratePair() by constructing a genkey s-expression
607 that requests a generation of an EC key for the specified curve type.
608 The s-expression is then passed to gcry_pk_genkey(), and the public
609 and private key data is then retrieved from the returned s-expression
610 upon success and used to create the public and private CryptoKeyEC
613 The PlatformECKey type alias is changed to match gcry_sexp_t. The
614 CryptoKeyEC destructor releases the gcry_sexp_t object through
615 a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
617 The method definitions in the CryptoKeyECGCrypt.cpp file are also
618 sorted to match the declaration order in the header.
620 No new tests -- current ones cover this sufficiently, but are not yet
621 enabled due to other missing platform-specific SUBTLE_CRYPTO
624 * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
625 (WebCore::curveSize):
626 (WebCore::curveName):
627 (WebCore::CryptoKeyEC::~CryptoKeyEC):
628 (WebCore::CryptoKeyEC::keySizeInBits):
629 (WebCore::CryptoKeyEC::platformGeneratePair):
630 (WebCore::CryptoKeyEC::platformImportSpki):
631 (WebCore::CryptoKeyEC::platformImportPkcs8):
632 (WebCore::CryptoKeyEC::platformExportRaw):
633 (WebCore::CryptoKeyEC::platformAddFieldElements):
634 (WebCore::CryptoKeyEC::platformExportSpki):
635 * crypto/keys/CryptoKeyEC.h:
637 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
639 [GCrypt] Implement AES_KW support
640 https://bugs.webkit.org/show_bug.cgi?id=170274
642 Reviewed by Michael Catanzaro.
644 Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
645 functionality for configurations that use libgcrypt. This is done
646 by leveraging the gcry_cipher_* APIs for the AES algorithm that's
647 deducted appropriately from the key size and the AESWRAP cipher mode.
649 No new tests -- current ones cover this sufficiently, but are not yet
650 enabled due to other missing platform-specific SUBTLE_CRYPTO
653 * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
654 (WebCore::gcryptWrapKey):
655 (WebCore::gcryptUnwrapKey):
656 (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
657 (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
659 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
661 [GCrypt] Implement AES_GCM support
662 https://bugs.webkit.org/show_bug.cgi?id=170271
664 Reviewed by Michael Catanzaro.
666 Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
667 functionality for configurations that use libgcrypt. This is done
668 by leveraging the gcry_cipher_* APIs for the AES algorithm that's
669 deducted appropriately from the key size and the GCM cipher mode.
671 No new tests -- current ones cover this sufficiently, but are not yet
672 enabled due to other missing platform-specific SUBTLE_CRYPTO
675 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
676 (WebCore::gcryptEncrypt):
677 (WebCore::gcryptDecrypt):
678 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
679 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
681 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
683 [GCrypt] Implement PBKDF2 support
684 https://bugs.webkit.org/show_bug.cgi?id=170270
686 Reviewed by Michael Catanzaro.
688 Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
689 for configurations that use libgcrypt. This is done by leveraging the
690 gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
691 along with the properly deducted SHA algorithm.
693 No new tests -- current ones cover this sufficiently, but are not yet
694 enabled due to other missing platform-specific SUBTLE_CRYPTO
697 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
698 (WebCore::gcryptDeriveBits):
699 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
701 2017-04-01 Simon Fraser <simon.fraser@apple.com>
703 Clean up touch event handler registration when moving nodes between documents
704 https://bugs.webkit.org/show_bug.cgi?id=170384
705 rdar://problem/30816694
707 Reviewed by Chris Dumez.
709 Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
710 old document, and registration on the new document for nodes with touch event listeners,
711 and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
712 already correctly moved via renderer-related teardown.
714 Add assertions that fire when removal was not complete.
716 Use references in more places.
718 Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
719 fast/events/touch/ios/overflow-node-move-between-documents.html
720 fast/events/touch/ios/slider-node-move-between-documents.html
721 fast/events/touch/ios/touch-node-move-between-documents.html
724 (WebCore::EventNames::gestureEventNames):
726 (WebCore::Node::willBeDeletedFrom):
727 (WebCore::Node::didMoveToNewDocument):
728 (WebCore::tryAddEventListener):
729 (WebCore::tryRemoveEventListener):
730 * html/shadow/SliderThumbElement.cpp:
731 (WebCore::SliderThumbElement::registerForTouchEvents):
732 (WebCore::SliderThumbElement::unregisterForTouchEvents):
733 * rendering/RenderLayer.cpp:
734 (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
735 (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
737 2017-04-03 Youenn Fablet <youenn@apple.com>
739 captureStream is getting black frames with webgl canvas
740 https://bugs.webkit.org/show_bug.cgi?id=170325
742 Reviewed by Dean Jackson.
744 Test: fast/mediastream/captureStream/canvas3d.html
746 Changing the webgl context to save buffers in case the canvas is captured.
747 Adding a canvas changed notification in case of clear.
748 In the future, we might want to change this notification and do it when endPaint or similar is called.
750 Adding an Internals API to grab the RGBA equivalent of the next track frame.
751 For that purpose, adding a bunch of WEBCORE_EXPORT.
753 * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
754 (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
755 getter actually transmits the width and height of the source.
756 (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
757 * Modules/mediastream/MediaStreamTrack.h:
758 * bindings/js/JSDOMGuardedObject.h:
759 * bindings/js/JSDOMPromise.h:
760 (WebCore::DeferredPromise::resolve):
761 (WebCore::DeferredPromise::reject):
762 * dom/ActiveDOMCallback.h:
763 * html/HTMLCanvasElement.cpp:
764 (WebCore::HTMLCanvasElement::captureStream):
766 * html/ImageData.idl:
767 * html/canvas/WebGLRenderingContext.cpp:
768 (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
769 * html/canvas/WebGLRenderingContextBase.h:
770 (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
771 * platform/MediaSample.h:
772 (WebCore::MediaSample::getRGBAImageData): Added for internals API.
773 * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
774 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
775 (WebCore::MediaSampleAVFObjC::getRGBAImageData):
776 * platform/graphics/cv/PixelBufferConformerCV.cpp:
777 (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
778 * platform/graphics/cv/PixelBufferConformerCV.h:
779 * platform/mediastream/RealtimeMediaSourceSettings.h:
780 (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
781 (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
782 * platform/mediastream/mac/AVMediaCaptureSource.mm:
783 (WebCore::AVMediaCaptureSource::initializeSettings):
784 * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
785 * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
786 * platform/mock/MockRealtimeMediaSource.cpp:
787 (WebCore::MockRealtimeMediaSource::initializeSettings):
788 * testing/Internals.cpp:
789 (WebCore::Internals::grabNextMediaStreamTrackFrame):
790 (WebCore::Internals::videoSampleAvailable):
791 * testing/Internals.h:
792 * testing/Internals.idl:
794 2017-04-03 Per Arne Vollan <pvollan@apple.com>
796 Implement stroke-miterlimit.
797 https://bugs.webkit.org/show_bug.cgi?id=169078
799 Reviewed by Dean Jackson.
801 Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
803 Tests: fast/css/stroke-miterlimit-default.html
804 fast/css/stroke-miterlimit-large.html
805 fast/css/stroke-miterlimit-zero.html
807 * css/CSSComputedStyleDeclaration.cpp:
808 (WebCore::ComputedStyleExtractor::propertyValue):
809 * css/CSSProperties.json:
810 * css/SVGCSSComputedStyleDeclaration.cpp:
811 (WebCore::ComputedStyleExtractor::svgPropertyValue):
812 * rendering/TextPaintStyle.cpp:
813 (WebCore::computeTextPaintStyle):
814 (WebCore::updateGraphicsContext):
815 * rendering/TextPaintStyle.h:
816 * rendering/style/RenderStyle.cpp:
817 (WebCore::RenderStyle::diff):
818 * rendering/style/RenderStyle.h:
819 (WebCore::RenderStyle::strokeMiterLimit):
820 (WebCore::RenderStyle::setStrokeMiterLimit):
821 (WebCore::RenderStyle::initialStrokeMiterLimit):
822 (WebCore::RenderStyle::setStrokeDashOffset):
823 * rendering/style/RenderStyleConstants.cpp:
824 * rendering/style/RenderStyleConstants.h:
825 * rendering/style/SVGRenderStyle.cpp:
826 (WebCore::SVGRenderStyle::diff):
827 * rendering/style/SVGRenderStyle.h:
828 (WebCore::SVGRenderStyle::initialStrokeDashArray):
829 (WebCore::SVGRenderStyle::strokeDashArray):
830 (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
831 (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
832 (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
833 * rendering/style/SVGRenderStyleDefs.cpp:
834 (WebCore::StyleStrokeData::StyleStrokeData):
835 (WebCore::StyleStrokeData::operator==):
836 * rendering/style/SVGRenderStyleDefs.h:
837 * rendering/style/StyleRareInheritedData.cpp:
838 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
839 (WebCore::StyleRareInheritedData::operator==):
840 * rendering/style/StyleRareInheritedData.h:
841 * rendering/svg/RenderSVGShape.cpp:
842 (WebCore::RenderSVGShape::hasSmoothStroke):
843 * rendering/svg/SVGRenderSupport.cpp:
844 (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
845 * rendering/svg/SVGRenderTreeAsText.cpp:
846 (WebCore::writeStyle):
848 2017-04-03 Alejandro G. Castro <alex@igalia.com>
850 [OWR] Fix class structure for the OWR mock classes after last modifications
851 https://bugs.webkit.org/show_bug.cgi?id=170173
853 Reviewed by Youenn Fablet.
855 In case of OWR MockRealtimeMediaSource inherits from
856 RealtimeMediaSourceOwr, so we have to change some of the function
859 * platform/mock/MockRealtimeMediaSource.h:
861 2017-04-02 Alexey Proskuryakov <ap@apple.com>
864 Add missing text styles
865 https://bugs.webkit.org/show_bug.cgi?id=170295
867 * rendering/RenderThemeIOS.mm:
868 (WebCore::RenderThemeIOS::cachedSystemFontDescription):
869 (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
871 2017-04-01 Zalan Bujtas <zalan@apple.com>
873 Long Arabic text in ContentEditable with css white-space=pre hangs Safari
874 https://bugs.webkit.org/show_bug.cgi?id=170245
876 Reviewed by Myles C. Maxfield.
878 While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
879 When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
880 These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
881 the run still fits, we go back to the main loop (since we are not supposed to wrap the line here) and take the next codepoint.
882 However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
883 until we hit the wrapping point. This is way too expensive.
884 This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.
886 Covered by existing tests.
888 * rendering/line/BreakingContext.h:
889 (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
890 complex text is more likely to fall into this category.
892 2017-04-01 Jon Lee <jonlee@apple.com>
894 Add missing text styles
895 https://bugs.webkit.org/show_bug.cgi?id=170295
896 rdar://problem/30219503
898 Reviewed by Dean Jackson.
900 Updated existing test to include new text styles.
902 * css/CSSValueKeywords.in: Add title0 and title4.
903 * platform/spi/cocoa/CoreTextSPI.h:
904 * rendering/RenderThemeIOS.mm:
905 (WebCore::RenderThemeIOS::cachedSystemFontDescription):
906 (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
908 2017-04-01 Dan Bernstein <mitz@apple.com>
910 [iOS] <input type=file> label should be specified using plural rules
911 https://bugs.webkit.org/show_bug.cgi?id=170388
913 Reviewed by Alexey Proskuryakov.
915 * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
917 * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
918 %lu video(s)", with plural rules covering all the different combinations in English.
919 Other localizations may specify additional combinations as needed.
921 2017-04-01 Alexey Proskuryakov <ap@apple.com>
923 Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
925 Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
926 https://bugs.webkit.org/show_bug.cgi?id=170365
928 * editing/cocoa/DataDetection.mm:
929 (WebCore::searchForLinkRemovingExistingDDLinks):
931 2017-04-01 Chris Dumez <cdumez@apple.com>
933 We should pause silent WebAudio rendering in background tabs
934 https://bugs.webkit.org/show_bug.cgi?id=170299
935 <rdar://problem/31289132>
937 Reviewed by Eric Carlson.
939 We should pause silent WebAudio rendering in background tabs since it uses CPU and is
940 not observable by the user. Such silent WebAudio rendering seems to be used by
943 Test: webaudio/silent-audio-interrupted-in-background.html
945 * Modules/webaudio/AudioContext.cpp:
946 (WebCore::AudioContext::lazyInitialize):
947 (WebCore::AudioContext::uninitialize):
948 Have AudioContext register / unregister itself with the Document to get
949 visibility change notifications, similarly to what HTMLMediaElement was
952 (WebCore::AudioContext::visibilityStateChanged):
953 Begin / End session interruption whenever the page visiblity changes.
955 * Modules/webaudio/AudioContext.h:
956 * WebCore.xcodeproj/project.pbxproj:
959 (WebCore::Document::registerForVisibilityStateChangedCallbacks):
960 (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
961 (WebCore::Document::visibilityStateChanged):
964 * dom/VisibilityChangeClient.h: Added.
965 (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
966 * html/HTMLMediaElement.h:
967 Introduce a new VisibilityChangeClient interface and have both AudioContext
968 and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
969 function was on Element but this prevented AudioContext from registering
970 itself since AudioContext is not an Element.
972 2017-04-01 Dan Bernstein <mitz@apple.com>
974 [Cocoa] A couple of UI strings use three periods instead of an ellipsis
975 https://bugs.webkit.org/show_bug.cgi?id=170386
977 Reviewed by Tim Horton.
979 * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
981 * platform/LocalizedStrings.cpp:
982 (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
984 * platform/cocoa/LocalizedStringsCocoa.mm:
985 (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
987 2017-04-01 Dan Bernstein <mitz@apple.com>
989 Localizable strings files are out of date
990 https://bugs.webkit.org/show_bug.cgi?id=170383
992 Reviewed by Tim Horton.
994 Ran update-webkit-localizable-strings.
996 * English.lproj/Localizable.strings:
998 2017-04-01 Dan Bernstein <mitz@apple.com>
1000 [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1001 https://bugs.webkit.org/show_bug.cgi?id=170385
1003 Reviewed by Tim Horton.
1005 * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
1006 in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
1007 * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
1008 not going to be in the shared cache, even if its install name implies that it might be.
1010 2017-04-01 Alexey Proskuryakov <ap@apple.com>
1012 Rolling back http://trac.webkit.org/r214663 - memory corruption
1014 * Modules/streams/ReadableByteStreamInternals.js:
1016 * bindings/js/JSDOMGlobalObject.cpp:
1017 (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1018 * bindings/js/StructuredClone.cpp:
1019 (WebCore::structuredCloneArrayBuffer):
1020 (WebCore::cloneArrayBufferImpl): Deleted.
1021 (WebCore::cloneArrayBuffer): Deleted.
1022 * bindings/js/StructuredClone.h:
1023 * bindings/js/WebCoreBuiltinNames.h:
1024 * testing/Internals.cpp:
1025 (WebCore::markerTypeFrom):
1026 (WebCore::Internals::resetToConsistentState):
1027 (WebCore::Internals::isLoadingFromMemoryCache):
1028 (WebCore::Internals::setImageFrameDecodingDuration):
1029 (WebCore::deferredStyleRulesCountForList):
1030 (WebCore::deferredGroupRulesCountForList):
1031 (WebCore::deferredKeyframesRulesCountForList):
1032 (WebCore::Internals::eventThrottlingBehaviorOverride):
1033 (WebCore::Internals::enableMockSpeechSynthesizer):
1034 (WebCore::Internals::rangeForDictionaryLookupAtLocation):
1035 (WebCore::Internals::nodesFromRect):
1036 (WebCore::Internals::layerIDForElement):
1037 (WebCore::Internals::setElementUsesDisplayListDrawing):
1038 (WebCore::Internals::setElementTracksDisplayListReplay):
1039 (WebCore::Internals::styleRecalcCount):
1040 (WebCore::Internals::compositingUpdateCount):
1041 (WebCore::Internals::setCaptionDisplayMode):
1042 (WebCore::Internals::endMediaSessionInterruption):
1043 (WebCore::Internals::postRemoteControlCommand):
1044 (WebCore::appendOffsets):
1045 (WebCore::Internals::scrollSnapOffsets):
1046 (WebCore::Internals::setShowAllPlugins):
1047 (WebCore::Internals::cloneArrayBuffer): Deleted.
1048 * testing/Internals.h:
1049 * testing/Internals.idl:
1051 2017-03-31 Zalan Bujtas <zalan@apple.com>
1053 <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
1054 https://bugs.webkit.org/show_bug.cgi?id=170348
1055 <rdar://problem/24727151>
1057 Reviewed by David Hyatt.
1059 1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
1060 during the containing block traversal).
1061 2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
1063 Test: fast/multicol/table-section-page-break.html
1065 * rendering/RenderFlowThread.cpp:
1066 (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
1067 * rendering/RenderTable.cpp:
1068 (WebCore::RenderTable::layout):
1070 2017-03-31 Simon Fraser <simon.fraser@apple.com>
1072 Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
1073 https://bugs.webkit.org/show_bug.cgi?id=170371
1075 Reviewed by Tim Horton.
1077 This count tracks touch and gesture event listeners, so name it appropriately.
1079 * page/DOMWindow.cpp:
1080 (WebCore::DOMWindow::addEventListener):
1081 (WebCore::DOMWindow::removeEventListener):
1082 (WebCore::DOMWindow::removeAllEventListeners):
1085 2017-03-31 Simon Fraser <simon.fraser@apple.com>
1087 When destroying a Node, assert that it's been removed from all the touch handler maps
1088 https://bugs.webkit.org/show_bug.cgi?id=170363
1089 rdar://problem/31377469
1091 Reviewed by Tim Horton.
1093 Assert that the Node has been removed from the touch handler maps in all documents on destruction.
1096 (WebCore::Document::hasTouchEventHandlers):
1097 (WebCore::Document::touchEventTargetsContain):
1099 (WebCore::Node::~Node):
1101 2017-03-31 Alexey Proskuryakov <ap@apple.com>
1103 Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
1106 Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1107 https://bugs.webkit.org/show_bug.cgi?id=170357
1109 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1110 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1112 2017-03-31 Youenn Fablet <youenn@apple.com>
1114 Fix memory leak in RealtimeVideoIncomingSource
1115 https://bugs.webkit.org/show_bug.cgi?id=170356
1117 Reviewed by Eric Carlson.
1119 No change of behavior.
1121 * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1122 (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
1124 2017-03-31 Andy Estes <aestes@apple.com>
1126 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1127 https://bugs.webkit.org/show_bug.cgi?id=170365
1128 <rdar://problem/29205721>
1130 Reviewed by Tim Horton.
1132 r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
1133 consider nodes that are descendants of startNode, but we need to traverse all nodes between
1134 startNode and endNode to find existing non-DD links.
1136 As a result, we'd add a Data Detector link to the following snippet and make the original
1139 <a href='#'>tomorrow</a> <a href='#'>night</a>
1141 Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
1142 will terminate when we reach endNode.
1144 Updated WebKit2.DataDetectionReferenceDate API test.
1146 * editing/cocoa/DataDetection.mm:
1147 (WebCore::searchForLinkRemovingExistingDDLinks):
1149 2017-03-31 Eric Carlson <eric.carlson@apple.com>
1151 Incoming video source doesn't propogate frame rotation
1152 https://bugs.webkit.org/show_bug.cgi?id=170364
1154 Reviewed by Youenn Fablet.
1156 No new tests, the mock video source doesn't support rotation. Test will be added when
1157 this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were
1160 * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1161 (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
1162 orientation and swap width and height when necessary.
1163 (WebCore::RealtimeIncomingVideoSource::processNewSample):
1164 * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1166 2017-03-31 Chris Dumez <cdumez@apple.com>
1168 Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
1169 https://bugs.webkit.org/show_bug.cgi?id=159639
1171 Reviewed by Eric Carlson.
1173 Add a null check for trackBuffer.description before dereferencing as it seems
1176 * Modules/mediasource/SourceBuffer.cpp:
1177 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1179 2017-03-31 Youenn Fablet <youenn@apple.com>
1181 Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1182 https://bugs.webkit.org/show_bug.cgi?id=170357
1184 Reviewed by Geoffrey Garen.
1186 No change of behavior.
1188 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1189 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
1191 2017-03-31 Fujii Hironori <Hironori.Fujii@sony.com>
1193 [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
1194 https://bugs.webkit.org/show_bug.cgi?id=170331
1196 Reviewed by Michael Catanzaro.
1198 WebCore::PlatformDisplay uses atexit to destruct EGL displays
1199 while exiting process. But, when the atexit will be processed,
1200 heap of libGLESv2.dll would be already destructed and causing a
1201 crash on Windows. Do not use atexit for Windows.
1203 AppleWin port does not use PlatformDisplay. Thus, it does not have
1206 * platform/graphics/PlatformDisplay.cpp:
1207 (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
1208 (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
1209 * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
1211 2017-03-31 Yoav Weiss <yoav@yoav.ws>
1213 Remove PRELOAD_DEBUG related code.
1214 https://bugs.webkit.org/show_bug.cgi?id=170352
1216 Reviewed by Youenn Fablet.
1218 As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
1219 it seems safe to assume that we can remove that code. This patch removes it.
1221 No new tests as there's no functional change.
1223 * loader/cache/CachedResourceLoader.cpp:
1224 (WebCore::CachedResourceLoader::preload):
1225 (WebCore::CachedResourceLoader::clearPreloads):
1226 (WebCore::CachedResourceLoader::printPreloadStats): Deleted.
1228 2017-03-31 Brady Eidson <beidson@apple.com>
1230 Clean up the "StorageType" enum.
1231 https://bugs.webkit.org/show_bug.cgi?id=170349
1233 Reviewed by Tim Horton.
1235 - Make this `enum` into an `enum class`
1236 - Add a new type specific for "transient local storage"
1238 No new tests (No behavior change).
1240 * WebCore.xcodeproj/project.pbxproj:
1242 * inspector/InspectorDOMStorageAgent.cpp:
1243 (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
1245 * inspector/InspectorInstrumentation.h:
1247 * loader/EmptyClients.cpp:
1249 * storage/Storage.cpp:
1250 (WebCore::Storage::isDisabledByPrivateBrowsing):
1252 * storage/StorageArea.h:
1255 * storage/StorageEventDispatcher.cpp:
1256 (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1257 (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1259 * storage/StorageType.h:
1260 (WebCore::isLocalStorage):
1262 2017-03-31 Chris Dumez <cdumez@apple.com>
1264 Unreviewed, Mark "HTML interactive form validation" as done.
1266 It is shipping in Safari 10.1.
1270 2017-03-31 Csaba Osztrogonác <ossy@webkit.org>
1272 Mac cmake buildfix after r214666
1273 https://bugs.webkit.org/show_bug.cgi?id=170342
1275 Unreviewed buildfix.
1277 * PlatformMac.cmake:
1278 * testing/MockPreviewLoaderClient.h:
1280 2017-03-31 Sam Weinig <sam@webkit.org>
1282 Remove unneeded custom constructors include.
1284 * WebCore.xcodeproj/project.pbxproj:
1285 * bindings/js/ios: Removed.
1286 * bindings/js/ios/TouchConstructors.cpp: Removed.
1288 2017-03-31 John Wilander <wilander@apple.com>
1290 Resource Load Statistics: Check if the store exists before clearing it
1291 https://bugs.webkit.org/show_bug.cgi?id=170324
1292 <rdar://problem/31258505>
1294 Reviewed by Brent Fulgham.
1296 No new tests. Added a null check.
1298 * loader/ResourceLoadObserver.cpp:
1299 (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1302 2017-03-31 Romain Bellessort <romain.bellessort@crf.canon.fr>
1304 [Readable Streams API] Implement cloneArrayBuffer in WebCore
1305 https://bugs.webkit.org/show_bug.cgi?id=170008
1307 Reviewed by Youenn Fablet.
1309 Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
1310 implementation. The code has been factorized so that both cloneArrayBuffer
1311 and structuredCloneArrayBuffer rely on the same code (which is basically
1312 the previous implementation of structuredCloneArrayBuffer + the ability
1313 to clone only a part of considered buffer).
1315 Added test to check cloneArrayBuffer behaviour.
1317 * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
1318 * bindings/js/JSDOMGlobalObject.cpp:
1319 (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
1320 * bindings/js/StructuredClone.cpp:
1321 (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
1322 (WebCore::cloneArrayBuffer): Added.
1323 (WebCore::structuredCloneArrayBuffer): Updated.
1324 * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
1325 * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
1326 * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
1327 * testing/Internals.h: Added support for testing cloneArrayBuffer.
1328 * testing/Internals.idl: Added support for testing cloneArrayBuffer.
1330 2017-03-31 Antoine Quint <graouts@apple.com>
1332 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1333 https://bugs.webkit.org/show_bug.cgi?id=168409
1334 <rdar://problem/30799198>
1336 Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
1339 (WebCore::Document::requestAnimationFrame):
1341 2017-03-30 Zan Dobersek <zdobersek@igalia.com>
1343 Unreviewed GTK+ build fix. Add missing ANGLE build targets
1348 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1350 Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
1351 https://bugs.webkit.org/show_bug.cgi?id=170323
1352 rdar://problem/23647630
1354 Reviewed by Chris Dumez.
1356 There are two instances where nodes are registered as touch event handlers without
1357 having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
1360 For such nodes, hasEventTargetData() will be false, but we want to ensure
1361 that they are removed from the Document's touchEventHandler set, so move the
1362 call to document.removeTouchEventHandler() outside of the conditional block.
1364 This should be cheap in most cases when the touchEventHandler is empty.
1367 (WebCore::Node::willBeDeletedFrom):
1369 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1371 Minor cleanup checking for gesture event names
1372 https://bugs.webkit.org/show_bug.cgi?id=170319
1374 Reviewed by Tim Horton.
1376 Just use isGestureEventType() in a couple of places.
1379 (WebCore::tryAddEventListener):
1380 (WebCore::tryRemoveEventListener):
1382 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1384 Rename a touch event function, and new touch region test results
1385 https://bugs.webkit.org/show_bug.cgi?id=170309
1386 rdar://problem/31329520
1388 Reviewed by Chris Dumez.
1390 Adapt to a naming change in WebKitAdditions.
1393 (WebCore::Document::removeAllEventListeners):
1394 * page/FrameView.cpp:
1395 (WebCore::FrameView::layout):
1396 * rendering/RenderElement.cpp:
1397 (WebCore::RenderElement::styleWillChange):
1398 * rendering/RenderLayer.cpp:
1399 (WebCore::RenderLayer::scrollTo):
1400 (WebCore::RenderLayer::calculateClipRects):
1402 2017-03-30 Matt Rajca <mrajca@apple.com>
1404 YouTube sometimes does not respect "user gesture" restriction for videos.
1405 https://bugs.webkit.org/show_bug.cgi?id=170297
1407 I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
1408 even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
1409 from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
1410 if we have a playback restriction in place.
1412 Reviewed by Eric Carlson.
1414 * html/HTMLMediaElement.cpp:
1415 (WebCore::HTMLMediaElement::setReadyState):
1417 2017-03-30 Said Abou-Hallawa <sabouhallawa@apple.com>
1419 REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
1420 https://bugs.webkit.org/show_bug.cgi?id=169547
1422 Reviewed by Simon Fraser.
1424 The bug happens when drawing only a rectangle of an image not the whole
1425 image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
1426 scaled by the transformation which is applied to the GraphicsContext. Two
1427 problems with this approach. The first one is destRect can be only part of
1428 the image. The second problem is, the ratio destRect / srcRect is another
1429 scaling that needs to be considered.
1431 To fix this issue, first the base size has to be size of the image and not
1432 destRect.size(). Secondly, we need to scale this base size with the context
1433 transformation multiplied by the ratio destRect / srcRect. This scaling is
1434 exactly the same scaling which is calculated in subsamplingScale(). Finally
1435 we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
1437 Test: fast/images/sprite-sheet-image-draw.html
1439 * platform/graphics/BitmapImage.cpp:
1440 (WebCore::BitmapImage::draw): Fix the bug.
1441 (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
1442 The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
1443 is called and the decoding queue is idle.
1444 (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
1445 * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
1446 * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
1447 (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
1448 * platform/graphics/Image.cpp:
1449 (WebCore::Image::sourceURL): Moved from BitmapImage.
1450 (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
1451 * platform/graphics/Image.h:
1452 * platform/graphics/ImageFrameCache.cpp:
1453 (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
1454 (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
1455 (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
1456 (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
1457 (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
1458 * platform/graphics/ImageFrameCache.h:
1459 * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
1460 * platform/graphics/cairo/NativeImageCairo.cpp:
1461 (WebCore::nativeImageDrawingScale): Ditto.
1462 (WebCore::subsamplingScale): Deleted.
1463 * platform/graphics/cg/NativeImageCG.cpp:
1464 (WebCore::nativeImageDrawingScale): Ditto.
1465 (WebCore::subsamplingScale): Deleted.
1466 * platform/graphics/win/NativeImageDirect2D.cpp:
1467 (WebCore::nativeImageDrawingScale): Ditto.
1468 (WebCore::subsamplingScale): Deleted.
1470 2017-03-30 Matt Baker <mattbaker@apple.com>
1472 Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
1473 https://bugs.webkit.org/show_bug.cgi?id=170279
1474 <rdar://problem/30200492>
1476 Reviewed by David Hyatt.
1478 The SourceRange for a CSSPropertySourceData should be relative to the start
1479 of the declaration body, not the start of the StyleSheetHandler’s parsed
1480 text. This only affected the ranges of unparsed (parsedOK == false) properties
1481 lacking a trailing semi-colon.
1483 This patch doesn't change the behavior of InspectorStyleSheet other than
1484 silencing an irksome assert, as String::substring does a safety check on
1485 the passed in length.
1487 * inspector/InspectorStyleSheet.cpp:
1488 (WebCore::fixUnparsedProperties):
1490 2017-03-30 Youenn Fablet <youenn@apple.com> and Jon Lee <jonlee@apple.com>
1492 Clean up RTCDataChannel
1493 https://bugs.webkit.org/show_bug.cgi?id=169732
1495 Reviewed by Chris Dumez.
1497 Test: webrtc/datachannel/datachannel-event.html
1498 webrtc/datachannel/bufferedAmountLowThreshold.html
1500 Making RTCDataChannel interface closer to the spec updating implementation accordingly.
1501 See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
1502 In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
1503 Doing some additional cleaning refactoring.
1505 Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
1506 libwebrtc without needing to get it from the libwebrtc network thread again.
1507 In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
1508 OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
1509 updated to increase in the send method.
1511 Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
1513 * Modules/mediastream/RTCDataChannel.cpp:
1514 (WebCore::RTCDataChannel::send):
1515 (WebCore::RTCDataChannel::close):
1516 (WebCore::RTCDataChannel::didChangeReadyState):
1517 (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1518 * Modules/mediastream/RTCDataChannel.h:
1519 * Modules/mediastream/RTCDataChannel.idl:
1520 * Modules/mediastream/RTCDataChannelEvent.cpp:
1521 (WebCore::RTCDataChannelEvent::create):
1522 (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1523 (WebCore::RTCDataChannelEvent::channel):
1524 * Modules/mediastream/RTCDataChannelEvent.h:
1525 * Modules/mediastream/RTCDataChannelEvent.idl:
1526 * Modules/mediastream/RTCPeerConnection.idl:
1527 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1528 (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
1529 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1530 (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1531 * WebCore.xcodeproj/project.pbxproj:
1533 * platform/mediastream/RTCDataChannelHandler.h:
1534 * platform/mediastream/RTCDataChannelHandlerClient.h:
1535 * platform/mediastream/RTCDataChannelState.h: Added.
1536 * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1537 * platform/mock/RTCDataChannelHandlerMock.cpp:
1538 (WebCore::RTCDataChannelHandlerMock::setClient):
1539 (WebCore::RTCDataChannelHandlerMock::close):
1540 * platform/mock/RTCNotifiersMock.cpp:
1541 (WebCore::IceConnectionNotifier::IceConnectionNotifier):
1542 (WebCore::SignalingStateNotifier::SignalingStateNotifier):
1543 (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
1544 * platform/mock/RTCNotifiersMock.h:
1546 2017-03-30 Javier Fernandez <jfernandez@igalia.com>
1548 [css-align] Adapt content-alignment properties to the new baseline syntax
1549 https://bugs.webkit.org/show_bug.cgi?id=170262
1551 Reviewed by David Hyatt.
1553 The baseline-position syntax has changed recently, so we need to update
1554 the CSS properties using the old syntax. This patch address only the
1555 content-alignment (align-content and justify-content).
1557 I used this patch to adapt the implementation of the parsing logic for
1558 these properties to the new Blink's CSS Parsing Design.
1560 The new baseline syntax is "[first | last ]? baseline" which implies
1561 modifying the parsing and computed value logic.
1563 There are several layout tests affected by this change, so I'll update
1566 No new tests, just added/modified some cases to the tests we
1567 already have using the new baseline values.
1569 * css/CSSComputedStyleDeclaration.cpp:
1570 (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1571 * css/CSSContentDistributionValue.cpp:
1572 (WebCore::CSSContentDistributionValue::customCSSText):
1573 * css/CSSPrimitiveValueMappings.h:
1574 (WebCore::CSSPrimitiveValue::operator ItemPosition):
1575 (WebCore::CSSPrimitiveValue::operator ContentPosition):
1576 * css/CSSValueKeywords.in:
1577 * css/parser/CSSPropertyParser.cpp:
1578 (WebCore::isBaselineKeyword):
1579 (WebCore::consumeBaselineKeyword):
1580 (WebCore::consumeContentDistributionOverflowPosition):
1581 (WebCore::consumeSelfPositionOverflowPosition):
1583 2017-03-30 James Craig <jcraig@apple.com>
1585 AX: Expose a new AXSubrole for explicit ARIA "group" role
1586 https://bugs.webkit.org/show_bug.cgi?id=169810
1587 <rdar://problem/31039693>
1589 Reviewed by Chris Fleizach.
1591 Split GroupRole into generics (GroupRole) and explicit groups
1592 (ApplicationGroupRole) so we can expose a subrole on the explicit
1593 groups. Account for the change in ARIA Tree and Menu hierachies.
1594 Update the computedRoleValue for WebKit Inspector usage, too.
1596 Updated existing tests.
1598 Test: accessibility/list-detection2.html:
1599 Test: accessibility/roles-computedRoleString.html:
1600 Test: inspector/dom/getAccessibilityPropertiesForNode.html:
1601 Test: inspector/dom/highlightFrame.html:
1602 Test: inspector/dom/highlightSelector.html:
1604 * accessibility/AccessibilityNodeObject.cpp:
1605 (WebCore::AccessibilityNodeObject::helpText):
1606 (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1607 (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
1608 * accessibility/AccessibilityObject.cpp:
1609 (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
1610 (WebCore::AccessibilityObject::ariaTreeItemContent):
1611 (WebCore::initializeRoleMap):
1612 (WebCore::AccessibilityObject::computedRoleString):
1613 * accessibility/AccessibilityObject.h:
1614 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1616 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1617 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1618 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1619 (createAccessibilityRoleMap):
1620 (-[WebAccessibilityObjectWrapper subrole]):
1622 2017-03-30 Chris Dumez <cdumez@apple.com>
1624 We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
1625 https://bugs.webkit.org/show_bug.cgi?id=170288
1626 <rdar://problem/31289132>
1628 Reviewed by Eric Carlson.
1630 We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
1631 to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
1632 0-gain case as much as possible.
1634 No new tests, only an optimization.
1636 * Modules/webaudio/AudioNode.cpp:
1637 (WebCore::AudioNode::processIfNecessary):
1638 Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
1639 API already takes care of clearing its 'silent' flag whenever its buffer changes so
1640 there should be no need to explicitly clearing the 'silent' flag before calling
1641 process(). This was causing us to zero out buffers that were already filled with
1642 zeros because AudioChannel::zero() would no longer return early, not knowing the
1643 channel is already silent. This reduces the number of bzero() calls by ~3.5x on
1644 uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
1646 * Modules/webaudio/AudioNode.h:
1647 * platform/audio/mac/AudioDestinationMac.cpp:
1648 (WebCore::AudioDestinationMac::render):
1649 Avoid clamping the values in the channel buffer if the channel is silent since this
1650 will have no effect (given that the buffer only contains zeros).
1652 2017-03-30 Eric Carlson <eric.carlson@apple.com>
1654 [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
1655 https://bugs.webkit.org/show_bug.cgi?id=169956
1657 Reviewed by Youenn Fablet.
1659 Test: webaudio/audiobuffer-crash.html
1661 * Modules/webaudio/AudioBuffer.cpp:
1662 (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel
1663 array allocation fails.
1664 (WebCore::AudioBuffer::AudioBuffer): Ditto.
1665 (WebCore::AudioBuffer::invalidate): Invalidate the object.
1666 * Modules/webaudio/AudioBuffer.h:
1668 2017-03-30 Antoine Quint <graouts@apple.com>
1670 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1671 https://bugs.webkit.org/show_bug.cgi?id=168409
1672 <rdar://problem/30799198>
1674 Unreview. Print the backtrace when we suspend scripted animations.
1677 (WebCore::Page::suspendScriptedAnimations):
1679 2017-03-30 Antoine Quint <graouts@apple.com>
1681 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1682 https://bugs.webkit.org/show_bug.cgi?id=168409
1683 <rdar://problem/30799198>
1685 Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
1687 * dom/ScriptedAnimationController.cpp:
1688 (WebCore::ScriptedAnimationController::suspend):
1690 2017-03-30 Antoine Quint <graouts@apple.com>
1692 [Modern Media Controls] Invalid placard icon is not visible for short video
1693 https://bugs.webkit.org/show_bug.cgi?id=170277
1694 <rdar://problem/31327955>
1696 Reviewed by Eric Carlson.
1698 Make the minimum dimension needed to display a placard icon configurable and let the
1699 invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
1700 for media controls as having a "text-align: center" inherited value would mess up
1701 positioning of the placard icon and make it flush to the right of the placard.
1703 Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
1705 * Modules/modern-media-controls/controls/invalid-placard.js:
1707 * Modules/modern-media-controls/controls/media-controls.css:
1709 * Modules/modern-media-controls/controls/placard.js:
1710 (Placard.prototype.layout):
1712 2017-03-30 Zan Dobersek <zdobersek@igalia.com>
1714 [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
1715 https://bugs.webkit.org/show_bug.cgi?id=170273
1717 Reviewed by Michael Catanzaro.
1719 * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
1720 (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1721 Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
1724 2017-03-30 Brent Fulgham <bfulgham@apple.com>
1726 Remove unused MediaControlsApple implementation
1727 https://bugs.webkit.org/show_bug.cgi?id=170258
1728 <rdar://problem/31331056>
1730 Reviewed by Eric Carlson.
1732 Remove dead code related to old media controls. We switched to HTML5-based media controls
1735 No new tests. Removing this dead code should have no change in behavior.
1737 * WebCore.xcodeproj/project.pbxproj: Remove unused files.
1738 * dom/EventListener.h: Remove unused event type.
1739 * html/shadow/MediaControlsApple.cpp: Removed.
1740 * html/shadow/MediaControlsApple.h: Removed.
1742 2017-03-30 Fujii Hironori <Hironori.Fujii@sony.com>
1744 [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
1745 https://bugs.webkit.org/show_bug.cgi?id=170275
1747 Reviewed by Said Abou-Hallawa.
1749 Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
1751 * platform/graphics/win/ImageCairoWin.cpp:
1752 (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
1753 (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
1755 2017-03-27 Sergio Villar Senin <svillar@igalia.com>
1757 [css-grid] Clamp the number of autorepeat tracks
1758 https://bugs.webkit.org/show_bug.cgi?id=170120
1760 Reviewed by Manuel Rego Casasnovas.
1762 As suggested by the specs we do clamp the maximum number of tracks per grid in order to
1763 minimize potential OOM situations. However we were not considering the case of the recently
1764 added auto repeat syntax. Abnormally huge values for the width/height on the grid container
1765 could lead to a number of auto repeat tracks higher than the maximum.
1767 A new API was added to Internals in order to test limits without having to create huge
1768 grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
1769 addition of this new API forced us to add GridPosition.cpp to the project to define the
1770 global variable we use for testing. We took the chance to move part of the implementation
1771 from the header file to the source file.
1773 Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
1774 we do not surpass the grid track limits.
1776 Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
1779 * WebCore.xcodeproj/project.pbxproj:
1780 * css/parser/CSSPropertyParser.cpp:
1781 (WebCore::consumeGridTrackRepeatFunction):
1782 * rendering/Grid.cpp:
1783 (WebCore::Grid::ensureGridSize): Added ASSERT.
1784 (WebCore::Grid::setSmallestTracksStart): Ditto.
1785 (WebCore::Grid::setAutoRepeatTracks): Ditto.
1786 (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
1787 (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
1788 * rendering/RenderGrid.cpp:
1789 (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
1790 (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
1791 passing them to the Grid.
1792 * rendering/RenderGrid.h:
1793 * rendering/style/GridArea.h:
1794 (WebCore::GridSpan::GridSpan):
1795 * rendering/style/GridPosition.cpp: Added.
1796 (WebCore::GridPosition::setExplicitPosition):
1797 (WebCore::GridPosition::setAutoPosition):
1798 (WebCore::GridPosition::setSpanPosition):
1799 (WebCore::GridPosition::setNamedGridArea):
1800 (WebCore::GridPosition::integerPosition):
1801 (WebCore::GridPosition::namedGridLine):
1802 (WebCore::GridPosition::spanPosition):
1803 (WebCore::GridPosition::operator==):
1804 * rendering/style/GridPosition.h:
1805 (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
1806 (WebCore::GridPosition::max):
1807 (WebCore::GridPosition::min):
1808 (WebCore::GridPosition::setMaxPositionForTesting):
1809 (WebCore::GridPosition::setExplicitPosition): Deleted.
1810 (WebCore::GridPosition::setAutoPosition): Deleted.
1811 (WebCore::GridPosition::setSpanPosition): Deleted.
1812 (WebCore::GridPosition::setNamedGridArea): Deleted.
1813 (WebCore::GridPosition::integerPosition): Deleted.
1814 (WebCore::GridPosition::namedGridLine): Deleted.
1815 (WebCore::GridPosition::spanPosition): Deleted.
1816 (WebCore::GridPosition::operator==): Deleted.
1817 * rendering/style/GridPositionsResolver.cpp:
1818 (WebCore::GridPositionsResolver::explicitGridColumnCount):
1819 (WebCore::GridPositionsResolver::explicitGridRowCount):
1820 * testing/Internals.cpp:
1821 (WebCore::Internals::setGridMaxTracksLimit):
1822 * testing/Internals.h:
1823 * testing/Internals.idl:
1825 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
1827 Disconnecting a HTMLObjectElement does not always unload its content document
1828 https://bugs.webkit.org/show_bug.cgi?id=169606
1830 Reviewed by Andy Estes.
1832 When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
1833 However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
1834 can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
1836 Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
1838 Test: fast/dom/removing-focused-object-element.html
1841 (WebCore::Document::removeFocusedNodeOfSubtree):
1843 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
1845 Migrate to kCTFontCSSWidthAttribute
1846 https://bugs.webkit.org/show_bug.cgi?id=170265
1848 Reviewed by Darin Adler.
1850 Previously, we were mapping from Core Text widths to CSS widths in WebKit.
1851 However, on some OSes, Core Text can directly tell us what the CSS width
1854 No new tests because there is no behavior change.
1856 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1857 (WebCore::getCSSAttribute):
1858 (WebCore::capabilitiesForFontDescriptor):
1859 * platform/spi/cocoa/CoreTextSPI.h:
1861 2017-03-28 Simon Fraser <simon.fraser@apple.com>
1863 Make it possible to dump touch event regions for testing
1864 https://bugs.webkit.org/show_bug.cgi?id=170209
1865 <rdar://problem/31309258>
1867 Reviewed by Tim Horton.
1869 Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
1870 fetch data via Page.
1872 Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
1874 Test: fast/events/touch/ios/touch-event-regions.html
1877 (WebCore::Page::nonFastScrollableRects):
1878 (WebCore::Page::touchEventRectsForEvent):
1879 (WebCore::Page::passiveTouchEventListenerRects):
1881 * testing/Internals.cpp:
1882 (WebCore::Internals::touchEventRectsForEvent):
1883 (WebCore::Internals::passiveTouchEventListenerRects):
1884 * testing/Internals.h:
1885 * testing/Internals.idl:
1887 2017-03-29 Zalan Bujtas <zalan@apple.com>
1889 RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
1890 https://bugs.webkit.org/show_bug.cgi?id=170259
1891 <rdar://problem/31300584>
1893 Reviewed by Simon Fraser.
1895 r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.
1897 Test: fast/block/float/placing-multiple-floats-crash.html
1899 * rendering/RenderBlockFlow.cpp:
1900 (WebCore::RenderBlockFlow::addFloatsToNewParent):
1902 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
1904 Try to normalize variation ranges
1905 https://bugs.webkit.org/show_bug.cgi?id=170119
1909 Addressing post-review comment.
1911 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1912 (WebCore::isGXVariableFont):
1914 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
1916 Try to normalize variation ranges
1917 https://bugs.webkit.org/show_bug.cgi?id=170119
1919 Reviewed by Simon Fraser.
1921 TrueType GX-style variation fonts use one particular scale for values on their
1922 weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
1923 However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
1924 For the purposes of font selection, these values need to lie on the same scale.
1925 However, when font selection is completed and the variation values are actually
1926 being applied to the fonts, values which lie on the font's actual scale need to
1927 be applied. This patch adds normalize*() and denormalize*() functions to perform
1928 both of these operations.
1930 The conversion itself between the two scales isn't an exact mapping. Mapping
1931 slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
1932 CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
1933 linear relationship which includes the values given in the Microsoft OpenType
1934 spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
1935 plotted the CSS weights and the GX-style weights for every style of San
1936 Francisco, saw that the relationship appears to be linear, and ran a linear
1937 regression to compute the line equation.
1939 As for the actual discrimination of determining whether a font is a GX-style
1940 font or not, we can use the presence of the 'STAT' table. This table didn't
1941 exist when GX fonts were being created, and OpenType 1.8 variable fonts are
1942 required to have this table.
1944 Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
1945 a variation font, but uses the GX-style values. Facebook asks us to create
1946 this font with a weight of 700, and because the values in the font are around
1947 1.0, we were erroneously thinking that the font wasn't bold, so we were then
1948 applying synthetic bold. This was causing text on facebook to look fuzzy and
1951 Test: fast/text/variations/font-selection-properties-expected.html
1953 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1954 (WebCore::isGXVariableFont):
1955 (WebCore::normalizeWeight):
1956 (WebCore::normalizeSlope):
1957 (WebCore::denormalizeWeight):
1958 (WebCore::denormalizeWidth):
1959 (WebCore::denormalizeSlope):
1960 (WebCore::normalizeWidth):
1961 (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
1962 intermediate values, we should use floats instead. This is because
1963 FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
1964 When using this data type to represent values on the GX scale, which are usually
1965 between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
1966 calculations should be done with floats, and converted to FontSelectionValues at
1967 the end when they are representative of values on the CSS scale.
1968 (WebCore::stretchFromCoreTextTraits):
1969 (WebCore::fontWeightFromCoreText):
1970 (WebCore::extractVariationBounds):
1971 (WebCore::variationCapabilitiesForFontDescriptor):
1972 (WebCore::capabilitiesForFontDescriptor):
1974 2017-03-29 Saam Barati <sbarati@apple.com>
1976 LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
1977 https://bugs.webkit.org/show_bug.cgi?id=170210
1979 Reviewed by Mark Lam.
1981 * cssjit/SelectorCompiler.cpp:
1982 (WebCore::SelectorCompiler::compileSelector):
1983 (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
1985 2017-03-29 Javier Fernandez <jfernandez@igalia.com>
1987 [css-align] Adapt self-alignment properties to the new baseline syntax
1988 https://bugs.webkit.org/show_bug.cgi?id=170235
1990 Reviewed by David Hyatt.
1992 The baseline-position syntax has changed recently, so we need to update
1993 the CSS properties using the old syntax. This patch address only the
1994 self-alignment (align-self and justify-self) and default-alignment
1995 (align-items and justify-items).
1997 The content-distribution properties (align-content and justify-content)
1998 will be updated in a follow up patch.
2000 The new baseline syntax is "[first | last ]? baseline" which implies
2001 modifying the parsing and computed value logic.
2003 There are several layout tests affected by this change, so I'll update
2006 No new tests, just added/modified some cases to the tests we already have using the new baseline values.
2008 * css/CSSComputedStyleDeclaration.cpp:
2009 (WebCore::valueForItemPositionWithOverflowAlignment):
2010 * css/CSSValueKeywords.in:
2011 * css/StyleBuilderConverter.h:
2012 (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2013 * css/parser/CSSPropertyParser.cpp:
2014 (WebCore::consumeBaselineKeyword):
2015 (WebCore::consumeSelfPositionOverflowPosition):
2017 2017-03-29 Chris Dumez <cdumez@apple.com>
2019 Animated SVG images are not paused in pages loaded in the background
2020 https://bugs.webkit.org/show_bug.cgi?id=170043
2021 <rdar://problem/31234412>
2023 Reviewed by Simon Fraser.
2025 Animated SVG images are not paused in pages loaded in the background. We rely
2026 on FrameView::isOffscreen() to stop images animations in background tab (See
2027 logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
2028 if a tab is visble and then becomes hidden (i.e. by switching to another
2029 tab). However, in the case where the tab gets loaded while in the background
2030 (e.g. opening link in new background tab, or session restore), then the
2031 animations would not be paused, due to FrameView::isOffscreen() erroneously
2032 returning false in this case.
2034 Normally, the following chain of events happens:
2035 - Page is visible, we construct a main frame and its FrameView for loading
2036 the page. When a FrameView is constructed, we call FrameView::show() to
2037 make it visible. Then, if the page becomes non-visible, we call
2038 Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
2039 that, FrameView::isOffscreen() correctly returns true because we properly
2040 called FrameView::hide().
2042 However, when doing a load while the Page is hidden, the following was
2044 - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
2045 to call FrameView::hide() for the main frame but it does not have a FrameView
2046 yet (because the load has not started). We start the load and end up creating
2047 a FrameView. The FrameView constructor was calling FrameView::show()
2048 unconditionally, thus making the FrameView think is visible, even though its
2049 page isn't. At this point, FrameView::isOffscreen() was returning false
2050 and animations would keep running, even though the page is not visible.
2052 To address the issue, we now call FrameView::show() in FrameView::create() only
2053 if the Page is actually visible, instead of calling it unconditionally. If the
2054 page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
2055 it will take care of calling FrameView::show() then.
2057 Tests: svg/animations/animations-paused-in-background-page-iframe.html
2058 svg/animations/animations-paused-in-background-page.html
2060 * page/FrameView.cpp:
2061 (WebCore::FrameView::create):
2063 2017-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
2065 Links with empty hrefs should not be drag sources
2066 https://bugs.webkit.org/show_bug.cgi?id=170241
2067 <rdar://problem/31305505>
2069 Reviewed by Tim Horton.
2071 The m_dragSouceAction member of DragController represents the drag source actions that are available to the
2072 document, rather than the available actions given the dragging element. Thus, it is not correct to only check
2073 that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
2074 This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
2077 New API test (see Tools/ChangeLog).
2079 * page/DragController.cpp:
2080 (WebCore::DragController::startDrag):
2082 2017-03-29 Jeremy Jones <jeremyj@apple.com>
2084 WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
2085 https://bugs.webkit.org/show_bug.cgi?id=170129
2087 Reviewed by David Kilzer.
2089 No new tests becuase no new behavior.
2091 Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
2092 Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
2094 * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2095 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2096 (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2098 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2100 [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
2101 https://bugs.webkit.org/show_bug.cgi?id=170238
2103 Reviewed by Michael Catanzaro.
2105 The platform-specific CryptoAlgorithmHMAC implementation is modified
2106 to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
2107 is added accordingly.
2109 * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2110 (WebCore::calculateSignature):
2112 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
2114 Variation fonts: Make sure that feature detection and preprocessor macros are right
2115 https://bugs.webkit.org/show_bug.cgi?id=169518
2117 Reviewed by Simon Fraser.
2119 When I added variable fonts support, I made all OSes parse the newly accepted values,
2120 instead of just the OSes which support variable fonts.
2122 Test: fast/text/font-variations-feature-detection.html
2124 * css/parser/CSSPropertyParser.cpp:
2125 (WebCore::consumeFontStretch):
2126 (WebCore::consumeFontStyle):
2127 * css/parser/CSSPropertyParserHelpers.cpp:
2128 (WebCore::CSSPropertyParserHelpers::divisibleBy100):
2129 (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2131 2017-03-29 Antoine Quint <graouts@apple.com>
2133 [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
2134 https://bugs.webkit.org/show_bug.cgi?id=170239
2135 <rdar://problem/31320685>
2137 Reviewed by Dean Jackson.
2139 We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
2140 captions menu is visible. But there were two cases where the behavior was not as intended:
2142 1. the controls bar would hide upon exiting the video.
2143 2. clicking on the controls bar while the caption panel is up would hide the controls bar
2144 as well as the captions panel.
2146 Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
2147 of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
2148 explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
2149 controls bar from fading when exiting the media.
2151 Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
2152 if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
2153 bar and only dismiss the tracks panel.
2155 Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
2157 * Modules/modern-media-controls/controls/controls-bar.js:
2158 (ControlsBar.prototype.set userInteractionEnabled):
2159 (ControlsBar.prototype.handleEvent):
2160 (ControlsBar.prototype._autoHideTimerFired):
2161 * Modules/modern-media-controls/controls/macos-media-controls.js:
2162 (MacOSMediaControls.prototype.showTracksPanel):
2163 (MacOSMediaControls.prototype.hideTracksPanel):
2165 2017-03-29 Antoine Quint <graouts@apple.com>
2167 [Modern Media Controls] Volume slider is initially empty
2168 https://bugs.webkit.org/show_bug.cgi?id=170237
2169 <rdar://problem/31319077>
2171 Reviewed by Dean Jackson.
2173 Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
2174 of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
2175 after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
2176 into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
2178 * Modules/modern-media-controls/controls/slider.js:
2179 (Slider.prototype.commit):
2180 (Slider.prototype.layout): Deleted.
2182 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2184 [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
2185 https://bugs.webkit.org/show_bug.cgi?id=170232
2187 Reviewed by Michael Catanzaro.
2189 Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
2190 directory. The implementation files themselves are no-op, so this is
2191 a simple move-and-rename operation that will enable proceeding with
2192 the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
2194 No change in behavior. The SUBTLE_CRYPTO feature should build as it
2195 did before, and the implementations are empty anyway.
2197 * PlatformGTK.cmake:
2198 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
2199 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
2200 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
2201 * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
2202 * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
2203 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
2204 * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
2205 * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
2206 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
2207 * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
2208 * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
2209 * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
2210 * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
2211 * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
2213 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2215 [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
2216 https://bugs.webkit.org/show_bug.cgi?id=170231
2218 Reviewed by Michael Catanzaro.
2220 * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
2221 is already in use, and this file wasn't even being built.
2223 2017-03-29 Youenn Fablet <youenn@apple.com>
2225 Move DTMF WebRTC extension behind its own compile flag
2226 https://bugs.webkit.org/show_bug.cgi?id=170226
2228 Reviewed by Eric Carlson.
2230 Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
2231 This compile flag is not set on any supported platform yet.
2232 Disabling related test and updated test expectations.
2234 * Modules/mediastream/RTCDTMFSender.cpp:
2235 * Modules/mediastream/RTCDTMFSender.h:
2236 * Modules/mediastream/RTCDTMFSender.idl:
2237 * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2238 * Modules/mediastream/RTCDTMFToneChangeEvent.h:
2239 * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2240 * dom/EventNames.in:
2241 * dom/EventTargetFactory.in:
2242 * platform/mediastream/RTCDTMFSenderHandler.h:
2243 * platform/mediastream/RTCDTMFSenderHandlerClient.h:
2245 2017-03-29 Antoine Quint <graouts@apple.com>
2247 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
2248 https://bugs.webkit.org/show_bug.cgi?id=168409
2249 <rdar://problem/30799198>
2251 Reviewed by Dean Jackson.
2253 Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
2254 through the document. This should allow this flaky test to get information as to why the frame isn't
2255 firing when it times out.
2257 * dom/ScriptedAnimationController.cpp:
2258 (WebCore::ScriptedAnimationController::suspend):
2259 (WebCore::ScriptedAnimationController::resume):
2260 (WebCore::ScriptedAnimationController::addThrottlingReason):
2261 (WebCore::ScriptedAnimationController::removeThrottlingReason):
2262 (WebCore::ScriptedAnimationController::registerCallback):
2263 (WebCore::ScriptedAnimationController::cancelCallback):
2264 (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2265 (WebCore::ScriptedAnimationController::scheduleAnimation):
2266 (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
2267 * dom/ScriptedAnimationController.h:
2269 * testing/InternalSettings.cpp:
2270 (WebCore::InternalSettings::resetToConsistentState):
2271 (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
2272 (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
2273 * testing/InternalSettings.h:
2274 * testing/InternalSettings.idl:
2276 2017-03-28 Youenn Fablet <youenn@apple.com>
2278 [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
2279 https://bugs.webkit.org/show_bug.cgi?id=170192
2281 Reviewed by Jon Lee.
2283 Covered by updated tests.
2285 * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
2286 * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
2288 2017-03-28 Youenn Fablet <youenn@apple.com>
2290 LibWebRTCProvider should allow setting encoder and decoder factories
2291 https://bugs.webkit.org/show_bug.cgi?id=170212
2293 Reviewed by Eric Carlson.
2295 No change of behavior.
2296 Adding the ability to set encoder/decoder libwebrtc factory getters.
2297 Setting default cocoa factory getters.
2299 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2300 (WebCore::staticFactoryAndThreads):
2301 (WebCore::initializePeerConnectionFactoryAndThreads):
2302 (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
2303 (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
2304 (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
2305 * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2307 2017-03-27 Brent Fulgham <bfulgham@apple.com>
2309 Only attach Attributes to a given element one time
2310 https://bugs.webkit.org/show_bug.cgi?id=170125
2311 <rdar://problem/31279676>
2313 Reviewed by Chris Dumez.
2315 Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
2316 arbitrary JavaScript events to fire.
2318 Test: fast/dom/Attr/only-attach-attr-once.html
2321 (WebCore::Element::attachAttributeNodeIfNeeded): Added.
2322 (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'.
2323 (WebCore::Element::setAttributeNodeNS): Ditto.
2326 2017-03-28 Youenn Fablet <youenn@apple.com>
2328 Stop RTCDataChannel when closing page
2329 https://bugs.webkit.org/show_bug.cgi?id=170166
2331 Reviewed by Eric Carlson.
2333 Test: webrtc/datachannel/datachannel-gc.html
2335 Making RTCDataChannel an ActiveDOMObject.
2336 Closing the data channel backend and freeing upon close and stop.
2338 * Modules/mediastream/RTCDataChannel.cpp:
2339 (WebCore::RTCDataChannel::create):
2340 (WebCore::RTCDataChannel::RTCDataChannel):
2341 (WebCore::RTCDataChannel::close):
2342 (WebCore::RTCDataChannel::stop):
2343 * Modules/mediastream/RTCDataChannel.h:
2344 * Modules/mediastream/RTCDataChannel.idl:
2345 * Modules/mediastream/RTCPeerConnection.h:
2347 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
2349 Ranges for variation font properties are not enforced
2350 https://bugs.webkit.org/show_bug.cgi?id=169979
2352 Reviewed by David Hyatt.
2354 The spec specifies that:
2355 - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
2356 - Font stretch values less than or equal to 0% are parse errors
2357 - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
2359 Test: fast/text/variations/out-of-bounds-selection-properties.html
2361 * css/parser/CSSPropertyParser.cpp:
2362 (WebCore::consumeFontWeightRange):
2363 (WebCore::fontStretchIsWithinRange):
2364 (WebCore::consumeFontStretch):
2365 (WebCore::consumeFontStretchRange):
2366 (WebCore::fontStyleIsWithinRange):
2367 (WebCore::consumeFontStyle):
2368 (WebCore::consumeFontStyleRange):
2370 2017-03-28 Andy Estes <aestes@apple.com>
2372 [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
2373 https://bugs.webkit.org/show_bug.cgi?id=170197
2374 <rdar://problem/30314067>
2376 Reviewed by Brady Eidson.
2378 If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
2379 QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
2380 failures in PreviewLoader, not conversion failures, so check if
2381 m_finishedLoadingDataIntoConverter is set before continuing (like we do in
2382 PreviewLoader::didFinishLoading()).
2384 Fixes crash in http/tests/multipart/policy-ignore-crash.php.
2386 * loader/ios/PreviewLoader.mm:
2387 (WebCore::PreviewLoader::didFail):
2389 2017-03-28 Chris Dumez <cdumez@apple.com>
2391 Audio indicator is visible on uni-watch.com but there is no audible audio
2392 https://bugs.webkit.org/show_bug.cgi?id=170200
2393 <rdar://problem/31289132>
2395 Reviewed by Eric Carlson.
2397 Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
2398 - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
2400 When the gain of a GainNode is 0 or 1, the operation of the node can
2401 be optimized. When gain = 1, just copy the input to the output. When
2402 gain = 0; just zero out the output. Currently, the input is
2403 multiplied by the gain to produce the output. This just optimizes the
2404 multiplication away for the two special cases.
2406 Also, have the GainNode set the silence hint if the gain is 0.
2408 And fix a bug in processIfNecessary when unsilenceOutputs was causing the
2409 silence hint to be cleared after the node's process method was finished
2410 and may have set the silence hint. The processing should come after
2411 unsilenceOutputs to preserve any hints from processing the node.
2413 * Modules/webaudio/AudioNode.cpp:
2414 (WebCore::AudioNode::processIfNecessary):
2415 * Modules/webaudio/GainNode.cpp:
2416 (WebCore::GainNode::process):
2417 * platform/audio/AudioBus.cpp:
2418 (WebCore::AudioBus::copyWithGainFrom):
2420 2017-03-28 Chris Dumez <cdumez@apple.com>
2422 Animated SVG images are not paused when outside viewport
2423 https://bugs.webkit.org/show_bug.cgi?id=170155
2424 <rdar://problem/31288893>
2426 Reviewed by Antti Koivisto.
2428 Make sure animated SVG images get paused when outside the viewport,
2429 similarly to what was already done for animated GIF images. Also
2430 make sure they are paused when they no longer have any renderers
2433 Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
2434 svg/animations/animated-svg-image-removed-from-document-paused.html
2436 * loader/cache/CachedImage.cpp:
2437 (WebCore::CachedImage::didAddClient):
2438 Restart the animation whenever a new CachedImage client is added. This
2439 will cause us the re-evaluate if the animation should run. The animation
2440 will pause again if the new renderer is not inside the viewport.
2442 (WebCore::CachedImage::animationAdvanced):
2443 Add a flag to newImageAnimationFrameAvailable() so that the renderers can
2444 let us know if we can pause the animation. Pause the animation if all no
2445 renderer requires it (i.e. they are all outside the viewport, or there
2448 * loader/cache/CachedImageClient.h:
2449 (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
2450 By default, the CachedImageClients allow pausing. Only renderer will
2451 potentially prevent pausing if they are inside the viewport.
2453 * platform/graphics/BitmapImage.cpp:
2454 (WebCore::BitmapImage::isAnimating):
2455 * platform/graphics/BitmapImage.h:
2456 * platform/graphics/Image.h:
2457 (WebCore::Image::isAnimating):
2458 Add isAnimating() flag on Image for layout testing purposes.
2460 * rendering/RenderElement.cpp:
2461 (WebCore::RenderElement::newImageAnimationFrameAvailable):
2462 Set canPause flag to true if the renderer is not inside the viewport.
2464 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2465 Call startAnimation() if the renderer is now visible to resume SVG
2466 animations. Repainting is enough for GIF animations but not for SVG
2467 animations, we have to explicitly resume them.
2469 * rendering/RenderElement.h:
2470 * rendering/RenderView.cpp:
2471 (WebCore::RenderView::addRendererWithPausedImageAnimations):
2472 (WebCore::RenderView::removeRendererWithPausedImageAnimations):
2473 (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
2474 * rendering/RenderView.h:
2475 Store CachedImages with the renderers that have paused animations.
2476 This is required for SVG where we need to explicitly resume the
2477 animation on the CachedImage when the renderer becomes visible
2478 again. Having access to the Image will also allow us to do smarter
2479 visibility checks in RenderElement's shouldRepaintForImageAnimation(),
2482 * svg/SVGSVGElement.cpp:
2483 (WebCore::SVGSVGElement::hasActiveAnimation):
2484 * svg/SVGSVGElement.h:
2485 Add hasActiveAnimation() method.
2487 * svg/graphics/SVGImage.cpp:
2488 (WebCore::SVGImage::startAnimation):
2489 Check that animations are paused before starting them. This avoid
2490 jumping due to unnecessary calls to rootElement->setCurrentTime(0).
2492 (WebCore::SVGImage::isAnimating):
2493 Add isAnimating() method for layout tests purposes.
2495 * svg/graphics/SVGImage.h:
2496 * svg/graphics/SVGImageClients.h:
2497 Call animationAdvanced() on the observer instead of the generic
2498 changedInRect() when the SVGImage is animating. This way, we go
2499 through the same code path as GIF animations and we end up calling
2500 CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
2501 on RenderElement, which determines if the animation should keep
2504 * testing/Internals.cpp:
2505 (WebCore::Internals::isImageAnimating):
2506 * testing/Internals.h:
2507 * testing/Internals.idl:
2508 Add layout testing infrastructure.
2510 2017-03-28 Antti Koivisto <antti@apple.com>
2512 Missing render tree position invalidation when tearing down renderers for display:contents subtree
2513 https://bugs.webkit.org/show_bug.cgi?id=170199
2514 <rdar://problem/31260856>
2516 Reviewed by Zalan Bujtas.
2518 Test: fast/shadow-dom/slot-renderer-teardown.html
2520 * style/RenderTreeUpdater.cpp:
2521 (WebCore::RenderTreeUpdater::updateElementRenderer):
2523 Invalidate the render tree position in case we do a teardown for an element without renderer.
2525 2017-03-28 Ryan Haddad <ryanhaddad@apple.com>
2527 Unreviewed, rolling out r214485.
2529 This change caused LayoutTest crashes.
2533 "Stop RTCDataChannel when closing page"
2534 https://bugs.webkit.org/show_bug.cgi?id=170166
2535 http://trac.webkit.org/changeset/214485
2537 2017-03-28 Anders Carlsson <andersca@apple.com>
2539 ApplePayShippingContactUpdate.idl shouldn't have status field
2540 https://bugs.webkit.org/show_bug.cgi?id=170202
2541 rdar://problem/31307106
2543 Reviewed by Beth Dakin.
2545 * Modules/applepay/ApplePaySession.cpp:
2546 (WebCore::convertAndValidate):
2547 If status isn't set, infer it based on whether there are errors present or not.
2549 * Modules/applepay/ApplePayShippingContactUpdate.h:
2550 Make status optional here; it's still used by the old code path.
2552 * Modules/applepay/ApplePayShippingContactUpdate.idl:
2555 2017-03-28 Brian Burg <bburg@apple.com>
2557 Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
2558 https://bugs.webkit.org/show_bug.cgi?id=169865
2559 <rdar://problem/31250573>
2561 Reviewed by Joseph Pecoraro.
2563 Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
2564 The old implementation was doing weird stuff like setting no-cache headers and evicting the
2565 contents of the memory cache, neither of which is correct. The new approach has no side effects
2566 on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
2569 - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
2570 - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
2572 * inspector/InspectorNetworkAgent.h:
2573 * inspector/InspectorNetworkAgent.cpp:
2574 (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
2575 (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
2576 Implement new command.
2578 (WebCore::InspectorNetworkAgent::willSendRequest):
2579 (WebCore::InspectorNetworkAgent::mainFrameNavigated):
2580 Remove crufty attempts to break caches. I believe these are intended to defeat caching
2581 proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
2584 (WebCore::Page::isResourceCachingDisabled):
2585 (WebCore::Page::setResourceCachingDisabledOverride):
2586 Add an override setting so that Web Inspector's override does not mess up the value
2587 of isResourceCachingDisabled that may have been set by a WebKit API client.
2589 2017-03-28 Youenn Fablet <youenn@apple.com>
2591 Fix addIceCandidate after r214441
2592 https://bugs.webkit.org/show_bug.cgi?id=170146
2594 Reviewed by Chris Dumez.
2596 Covered by rebased test.
2598 * Modules/mediastream/RTCPeerConnection.js:
2599 (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
2601 2017-03-28 Youenn Fablet <youenn@apple.com>
2603 Stop RTCDataChannel when closing page
2604 https://bugs.webkit.org/show_bug.cgi?id=170166
2606 Reviewed by Eric Carlson.
2608 Test: webrtc/datachannel/datachannel-gc.html
2610 Making RTCDataChannel an ActiveDOMObject.
2611 Closing the data channel backend and freeing upon close and stop.
2613 * Modules/mediastream/RTCDataChannel.cpp:
2614 (WebCore::RTCDataChannel::create):
2615 (WebCore::RTCDataChannel::RTCDataChannel):
2616 (WebCore::RTCDataChannel::close):
2617 (WebCore::RTCDataChannel::stop):
2618 * Modules/mediastream/RTCDataChannel.h:
2619 * Modules/mediastream/RTCDataChannel.idl:
2620 * Modules/mediastream/RTCPeerConnection.h:
2622 2017-03-27 Simon Fraser <simon.fraser@apple.com>
2624 Enhance the touch region debug overlay to show regions for the different events
2625 https://bugs.webkit.org/show_bug.cgi?id=170162
2627 Reviewed by Tim Horton.
2629 Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
2630 and to draw a legend showing what the colors mean.
2632 On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
2635 * page/DebugPageOverlays.cpp:
2636 (WebCore::NonFastScrollableRegionOverlay::updateRegion):
2637 (WebCore::touchEventRegionColors):
2638 (WebCore::drawRightAlignedText):
2639 (WebCore::NonFastScrollableRegionOverlay::drawRect):
2640 (WebCore::RegionOverlay::drawRect):
2641 (WebCore::RegionOverlay::drawRegion):
2643 2017-03-27 Simon Fraser <simon.fraser@apple.com>
2645 Make sure the non-fast scrolling debug overlay is correctly updated
2646 https://bugs.webkit.org/show_bug.cgi?id=170142
2648 Reviewed by Tim Horton.
2650 AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
2651 from Document code, so the existing DebugPageOverlays::didLayout() call at the end
2652 of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
2655 * page/scrolling/AsyncScrollingCoordinator.cpp:
2656 (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
2658 2017-03-28 Antoine Quint <graouts@apple.com>
2660 [Modern Media Controls] AirPlay placard text looks bad on 1x displays
2661 https://bugs.webkit.org/show_bug.cgi?id=170183
2662 <rdar://problem/30663416>
2664 Reviewed by Dean Jackson.
2666 Use subpixel antialiasing for all text in modern media controls.
2668 * Modules/modern-media-controls/controls/media-controls.css:
2669 (.media-controls-container,):
2671 2017-03-28 Antoine Quint <graouts@apple.com>
2673 [Modern Media Controls] Improve appearance of tracks panel on macOS
2674 https://bugs.webkit.org/show_bug.cgi?id=168929
2675 <rdar://problem/30741589>
2677 Reviewed by Eric Carlson.
2679 We use a solid color for the focus state that matches the style used on macOS
2680 and blend the titles the same way we blend other non-solid labels in the controls bar.
2682 * Modules/modern-media-controls/controls/tracks-panel.css:
2683 (.tracks-panel section):
2684 (.tracks-panel section > h3):
2685 (.tracks-panel section > ul > li:focus):
2687 2017-03-28 Yoav Weiss <yoav@yoav.ws>
2689 Add a warning for unused link preloads.
2690 https://bugs.webkit.org/show_bug.cgi?id=165670
2692 Reviewed by Youenn Fablet.
2694 Tests: http/tests/preload/single_download_preload_headers_charset.php
2695 http/tests/preload/unused_preload_warning.html
2698 (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
2699 * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
2700 * loader/cache/CachedResource.cpp:
2701 (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
2702 * loader/cache/CachedResourceClient.h:
2703 (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
2704 * loader/cache/CachedResourceLoader.cpp:
2705 (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
2706 (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
2707 (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
2708 (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
2709 (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
2710 * loader/cache/CachedResourceLoader.h:
2711 * page/DOMWindow.cpp:
2712 (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.
2714 2017-03-28 Antoine Quint <graouts@apple.com>
2716 REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
2717 https://bugs.webkit.org/show_bug.cgi?id=170171
2718 <rdar://problem/31095500>
2720 Reviewed by Dean Jackson.
2722 We used to consider that the tracks panel was presented as long as it had a parent, but since we were using for the animated
2723 transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
2724 would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
2725 as presentInParent() and hide() are called.
2727 Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html
2729 * Modules/modern-media-controls/controls/tracks-panel.js:
2730 (TracksPanel.prototype.get presented):
2731 (TracksPanel.prototype.presentInParent):
2732 (TracksPanel.prototype.hide):
2734 2017-03-28 Aaron Chu <aaron_chu@apple.com>
2736 AX: Media controls should be able to be re-activated after faded away
2737 https://bugs.webkit.org/show_bug.cgi?id=170048
2738 <rdar://problem/30157179>
2740 Reviewed by Antoine Quint.
2742 Added a "foucsin" listener for the controls bar so that when an element
2743 within fires a "focusin" event, the controls bar reappears if it is faded.
2745 Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html
2747 * Modules/modern-media-controls/controls/controls-bar.js:
2748 (ControlsBar.prototype.handleEvent):
2750 2017-03-28 Antoine Quint <graouts@apple.com>
2752 [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
2753 https://bugs.webkit.org/show_bug.cgi?id=169145
2754 <rdar://problem/17048858>
2756 Reviewed by Dean Jackson.
2758 There were a variety of issues with media documents, some longstanding, and some specifically
2759 about modern media controls.
2761 One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
2762 due to using a <video> element to load the audio file. We now have additional logic in MediaController
2763 to identify if the loaded media is really an audio file, and using this information to hide the
2764 fullscreen and picture-in-picture buttons.
2766 Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
2767 controls when we could have the modern-media-controls module injected CSS handle this styling. We now
2768 use the injected style in the shadow root to size media documents based on the device characteristics
2769 and ensuring that page styles are overridden.
2771 We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
2772 attribute and not a <source> element.
2774 Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
2775 a media document to hide the controls while we determine the type of media we're loading (audio vs.
2776 video) in order to apply the appropriate styling without flashes.
2778 As a result of the new styles applied by the modern-media-controls module, media documents have a
2779 similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
2780 to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
2781 we want to always play the media at full width, with some padding in the case of audio.
2783 Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
2784 media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
2785 media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
2786 media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
2787 media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
2788 media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
2789 media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
2790 media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
2792 * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
2793 (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
2794 (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
2795 * Modules/modern-media-controls/controls/macos-media-controls.css:
2796 (:host(audio) .media-controls.mac.inline > .controls-bar,):
2797 (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
2798 (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
2799 (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
2800 * Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
2801 (:host(.media-document)):
2802 (:host(.media-document.ready)):
2803 (:host(.media-document.audio.mac)):
2804 (:host(.media-document.audio.ipad)):
2805 (:host(.media-document.audio.iphone)):
2806 (:host(.media-document.video.mac)):
2807 (:host(.media-document.video.ipad)):
2808 (:host(.media-document.video.iphone)):
2809 * Modules/modern-media-controls/js-files:
2810 * Modules/modern-media-controls/media/fullscreen-support.js:
2811 (FullscreenSupport.prototype.syncControl):
2812 (FullscreenSupport):
2813 * Modules/modern-media-controls/media/media-controller.js:
2815 (MediaController.prototype.get isAudio):
2816 * Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
2817 (MediaDocumentController):
2818 (MediaDocumentController.prototype.handleEvent):
2819 (MediaDocumentController.prototype._mediaDocumentHasMetadata):
2820 (MediaDocumentController.prototype._mediaDocumentHasSize):
2821 * Modules/modern-media-controls/media/pip-support.js:
2822 (PiPSupport.prototype.syncControl):
2824 * html/MediaDocument.cpp:
2825 (WebCore::MediaDocumentParser::createDocumentStructure):
2827 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
2829 Follow-up patch after r214364.
2830 https://bugs.webkit.org/show_bug.cgi?id=168895
2834 * platform/graphics/FontDescription.cpp:
2835 (WebCore::FontDescription::FontDescription):
2837 2017-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>
2839 REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
2840 https://bugs.webkit.org/show_bug.cgi?id=169771
2842 Reviewed by Simon Fraser.
2844 Sometimes we have to draw the image immediately like when a canvas calls
2845 drawImage. In this case we have to decode the image synchronously to guarantee
2846 the drawing. Other times we need to decode with the native size of the image.
2847 The animated images have to be decoded with native size always. Otherwise
2848 the frame cache will be messed up if the same image is animated with different
2849 sizes. Currently we always decode asynchronously with sizeForDrawing. We need
2850 to decouple the decoding mode from the sizeForDrawing.
2852 This patch introduce the DecodingOptions class which can store and compare the
2853 following four cases:
2854 -- Synchronous: The frame has be decoded with native size only.
2855 -- Asynchronous + anySize: This is passed from the Image::draw() callers.
2856 -- Asynchronous + fullSize: The image has to be decoded with its full size.
2857 -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
2858 it was decoded with either a full size or sizeForDrawing which is larger than the
2859 requested sizeForDrawing.
2861 A new argument of type DecodingMode will be added to Image::draw() function.
2862 Only when the drawing comes from the render tree, it will be Asynchronous.
2863 Otherwise it will be Synchronous.
2865 Tests: fast/images/animated-image-different-dest-size.html
2866 fast/images/async-image-background-image.html
2867 fast/images/async-image-canvas-draw-image.html
2869 * WebCore.xcodeproj/project.pbxproj:
2870 * platform/graphics/BitmapImage.cpp:
2871 (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
2872 the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
2873 (WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
2874 (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
2875 (WebCore::BitmapImage::nativeImageOfSize): Ditto.
2876 (WebCore::BitmapImage::framesNativeImages): Ditto.
2877 (WebCore::BitmapImage::draw): Change the logic to do the following:
2878 -- The animated image has to be decoded with its full size.
2879 -- The animated image expects the current frame to be ready for drawing.
2880 -- The large image decoding does not need to call internalStartAnimation().
2881 -- The large image has to request async image decoding but draw the current one if it exists.
2882 (WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
2883 (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
2884 since it is only applied for animated images.
2885 (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
2886 (WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
2887 (WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
2888 (WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
2889 (WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
2890 the current frame from the frame cache as is; do not cache a new one.
2891 (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
2892 (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
2893 * platform/graphics/BitmapImage.h:
2894 * platform/graphics/CrossfadeGeneratedImage.cpp:
2895 (WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
2896 * platform/graphics/CrossfadeGeneratedImage.h:
2897 * platform/graphics/DecodingOptions.h: Added.
2898 (WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
2899 (WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
2900 (WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
2901 (WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
2902 (WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
2903 (WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
2904 (WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
2905 (WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
2906 (WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
2907 (WebCore::DecodingOptions::has): A helper function.
2908 (WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
2909 (WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
2910 * platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
2911 * platform/graphics/GradientImage.cpp:
2912 (WebCore::GradientImage::draw): Ditto.
2913 * platform/graphics/GradientImage.h: Ditto.
2914 * platform/graphics/GraphicsContext.cpp:
2915 (WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
2916 * platform/graphics/GraphicsContext.h:
2917 (WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
2918 * platform/graphics/Image.cpp:
2919 (WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
2920 * platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
2921 * platform/graphics/ImageFrame.cpp:
2922 (WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
2923 (WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
2924 (WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
2925 decoded for the image full size.
2926 (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
2927 (WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
2928 (WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
2929 moved to ImageFrameCache.
2930 (WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
2931 * platform/graphics/ImageFrame.h:
2932 (WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
2933 (WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
2934 (WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
2935 (WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
2936 (WebCore::ImageFrame::clearSizeForDecoding): Deleted.
2937 (WebCore::ImageFrame::isBeingDecoded): Deleted.
2938 (WebCore::ImageFrame::sizeForDrawing): Deleted.
2939 (WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
2940 The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
2941 * platform/graphics/ImageFrameCache.cpp:
2942 (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
2943 was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
2944 frameSizeAtIndex() will be called.
2945 (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
2946 metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
2947 DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
2948 !frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
2949 (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
2950 (WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
2951 cacheNativeImageForFrameRequest() for clarity.
2952 (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
2953 Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
2954 by appending the same ImageFrameRequest to m_frameCommitQueue.
2955 (WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
2956 (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
2957 (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
2958 to decode the nativeImage, it has to do it synchronously.
2959 (WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
2960 (WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
2961 is being decoded and is compatible with DecodingOptions.
2962 (WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame.
2963 (WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
2964 (WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
2965 (WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
2966 (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
2967 (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
2968 (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
2969 (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
2970 (WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
2971 (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
2972 (WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
2973 * platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
2974 -- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
2975 dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
2976 thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
2977 while their NativeImages have not been cached yet.
2978 -- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
2979 (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
2980 returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
2982 (WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
2983 * platform/graphics/ImageSource.cpp:
2984 (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
2985 (WebCore::ImageSource::frameImageAtIndex): Deleted.
2986 * platform/graphics/ImageSource.h:
2987 (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
2988 (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
2989 std::optional<IntSize> by an argument of type DecodingOptions.
2990 (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
2991 (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
2992 (WebCore::ImageSource::frameImageAtIndex): Ditto.
2993 (WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
2994 (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
2995 (WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
2996 * platform/graphics/NamedImageGeneratedImage.cpp:
2997 (WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
2998 * platform/graphics/NamedImageGeneratedImage.h: Ditto.
2999 * platform/graphics/cairo/ImageBufferCairo.cpp:
3000 (WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
3001 * platform/graphics/cg/ImageDecoderCG.cpp:
3002 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
3003 for decoding asynchronously for the image full size.
3004 * platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
3005 * platform/graphics/cg/PDFDocumentImage.cpp:
3006 (WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
3007 * platform/graphics/cg/PDFDocumentImage.h:
3008 * platform/graphics/win/ImageCGWin.cpp:
3009 (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
3010 (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
3011 * platform/graphics/win/ImageDecoderDirect2D.cpp:
3012 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3013 * platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
3014 * platform/image-decoders/ImageDecoder.cpp:
3015 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3016 * platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
3017 * rendering/RenderBoxModelObject.cpp:
3018 (WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
3019 * rendering/RenderImage.cpp:
3020 (WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
3021 * svg/graphics/SVGImage.cpp:
3022 (WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
3023 (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
3024 (WebCore::SVGImage::nativeImage): Ditto.
3025 (WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
3026 * svg/graphics/SVGImage.h: Change the prototype of the function.
3027 * svg/graphics/SVGImageForContainer.cpp:
3028 (WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
3029 * svg/graphics/SVGImageForContainer.h: Change the prototype of the function.
3031 2017-03-27 Youenn Fablet <youenn@apple.com>
3033 Activate release libwebrtc logging when WebRTC log channel is on
3034 https://bugs.webkit.org/show_bug.cgi?id=169659
3036 Reviewed by Alex Christensen.
3038 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3039 (WebCore::initializePeerConnectionFactoryAndThreads):
3041 2017-03-27 Antti Koivisto <antti@apple.com>
3043 Move visibleInViewportStateChanged callback from Element to render tree
3044 https://bugs.webkit.org/show_bug.cgi?id=170039
3046 Reviewed by Zalan Bujtas.
3048 Make it easier to use from the render tree.
3050 Also for simplicity move the bits from RenderObject rare data to RenderElement.
3051 There is plenty of space there.
3054 (WebCore::Element::isVisibleInViewportChanged): Deleted.
3055 * html/HTMLMediaElement.h:
3056 * rendering/RenderElement.cpp:
3057 (WebCore::RenderElement::RenderElement):
3058 (WebCore::RenderElement::willBeDestroyed):
3059 (WebCore::RenderElement::registerForVisibleInViewportCallback):
3060 (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
3061 (WebCore::RenderElement::setVisibleInViewportState):
3062 (WebCore::RenderElement::visibleInViewportStateChanged):
3063 * rendering/RenderElement.h:
3064 (WebCore::RenderElement::visibleInViewportState):
3065 * rendering/RenderObject.cpp:
3066 (WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
3067 (WebCore::RenderObject::setVisibleInViewportState): Deleted.
3068 * rendering/RenderObject.h:
3069 (WebCore::RenderObject::hasOutlineAutoAncestor):
3070 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
3071 (WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
3072 (WebCore::RenderObject::visibleInViewportState): Deleted.
3073 * rendering/RenderVideo.cpp:
3074 (WebCore::RenderVideo::visibleInViewportStateChanged):
3075 * rendering/RenderVideo.h:
3076 * rendering/RenderView.cpp:
3077 (WebCore::RenderView::updateVisibleViewportRect):
3079 2017-03-27 Youenn Fablet <youenn@apple.com>
3081 addIceCandidate should not throw if passed null or undefined
3082 https://bugs.webkit.org/show_bug.cgi?id=170118
3084 Reviewed by Eric Carlson.
3086 Covered by updated test.
3088 A null/undefined candidate passed to addIceCandidate means end of Ice candidate..
3090 * Modules/mediastream/PeerConnectionBackend.cpp:
3091 (WebCore::PeerConnectionBackend::addIceCandidate):
3092 * Modules/mediastream/PeerConnectionBackend.h:
3093 (WebCore::PeerConnectionBackend::endOfIceCandidates):
3094 * Modules/mediastream/RTCPeerConnection.cpp:
3095 (WebCore::RTCPeerConnection::queuedAddIceCandidate):
3096 * Modules/mediastream/RTCPeerConnection.h:
3097 * Modules/mediastream/RTCPeerConnection.idl:
3098 * Modules/mediastream/RTCPeerConnection.js:
3101 2017-03-27 Antti Koivisto <antti@apple.com>
3103 Allow the page to render before <link> stylesheet tags in body
3104 https://bugs.webkit.org/show_bug.cgi?id=149157
3105 <rdar://problem/24658830>
3107 Reviewed by Simon Fraser.
3109 Currently we block style and renderer building completely if document has any loading
3110 stylesheets. In case a script queries something layout dependent we construct the render
3111 tree with whatever style we have but block painting in it.
3113 This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
3114 that are after it. The expectation is that such stylesheets rarely affect elements before them
3115 and the elements can be rendered without causing ugly visible styling changes.
3117 The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
3118 fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
3121 For stylesheets in head the behavior should be largely unchanged.
3123 Test: http/tests/incremental/stylesheet-body-incremental-rendering.html
3125 * css/StyleResolver.cpp:
3126 (WebCore::StyleResolver::pseudoStyleRulesForElement):
3128 (WebCore::Document::Document):
3129 (WebCore::Document::resolveStyle):
3130 (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3132 Remove the old FOUC preventation state tracking.
3134 (WebCore::Document::shouldScheduleLayout):
3135 (WebCore::Document::didRemoveAllPendingStylesheet):
3137 Repaints will now get triggered by the normal style mechanism.
3140 (WebCore::Document::hasNodesWithNonFinalStyle):
3141 (WebCore::Document::setHasNodesWithNonFinalStyle):
3143 Track if we need to recompute the style later because non-final or unstyled elements.
3145 (WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
3146 (WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
3147 (WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
3148 * html/HTMLFrameSetElement.cpp:
3149 (WebCore::HTMLFrameSetElement::rendererIsNeeded):
3150 * page/FrameView.cpp:
3151 (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
3153 Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
3154 a fouc-prevented render tree).
3156 (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3157 * rendering/RenderBlock.cpp:
3158 (WebCore::RenderBlock::paintContents):
3160 Instead of a global test, block painting if isNonFinal is set in the renderer's style.
3162 * rendering/RenderLayer.cpp:
3163 (WebCore::shouldSuppressPaintingLayer):
3164 * rendering/style/RenderStyle.cpp:
3165 (WebCore::RenderStyle::changeRequiresRepaint):
3167 The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.
3169 * rendering/style/RenderStyle.h:
3170 (WebCore::RenderStyle::isNotFinal):
3171 (WebCore::RenderStyle::setIsNotFinal):
3172 (WebCore::RenderStyle::isPlaceholderStyle): Deleted.
3173 (WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.
3175 There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.
3177 * rendering/style/StyleRareNonInheritedData.cpp:
3178 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3179 (WebCore::StyleRareNonInheritedData::operator==):
3180 * rendering/style/StyleRareNonInheritedData.h:
3181 * style/StyleScope.cpp:
3182 (WebCore::Style::Scope::analyzeStyleSheetChange):
3183 (WebCore::Style::Scope::updateActiveStyleSheets):
3184 * style/StyleTreeResolver.cpp:
3185 (WebCore::Style::TreeResolver::styleForElement):
3186 (WebCore::Style::TreeResolver::resolveElement):
3188 If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
3189 In case there is a renderer or we are ignoring pending sheets, resolve the style normally
3190 but mark it as non-final.
3192 (WebCore::Style::makePlaceholderStyle): Deleted.
3194 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
3196 Test variation font ranges in the CSS Font Loading API
3197 https://bugs.webkit.org/show_bug.cgi?id=170022
3199 Reviewed by Dean Jackson.
3201 Test: fast/text/variations/font-loading-api-parse-ranges.html
3203 Don't use keywords when reporting font variation range values.
3205 * css/CSSComputedStyleDeclaration.cpp:
3206 (WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
3207 (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
3208 (WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
3209 (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
3210 (WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
3211 (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
3212 * css/CSSComputedStyleDeclaration.h:
3214 (WebCore::FontFace::style):
3215 (WebCore::FontFace::weight):
3216 (WebCore::FontFace::stretch):
3218 2017-03-27 Anders Carlsson <andersca@apple.com>
3220 Propagate shipping contact update errors
3221 https://bugs.webkit.org/show_bug.cgi?id=170141
3222 rdar://problem/31276576
3224 Reviewed by Tim Horton.
3226 * Modules/applepay/ApplePaySession.cpp:
3227 (WebCore::convertAndValidate):
3229 2017-03-27 Ryan Haddad <ryanhaddad@apple.com>
3231 Unreviewed, rolling out r214411.
3233 Two of the LayoutTests for this change time out on ios-
3238 "[Modern Media Controls] Improve media documents across macOS,
3240 https://bugs.webkit.org/show_bug.cgi?id=169145
3241 http://trac.webkit.org/changeset/214411
3243 2017-03-27 Antoine Quint <graouts@apple.com>
3245 [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
3246 https://bugs.webkit.org/show_bug.cgi?id=168517
3247 <rdar://problem/30577636>
3249 Reviewed by Dean Jackson.
3251 We completely turn off default event handling in MediaDocument.cpp since we're implementing the
3252 behavior we expect to pause and resume the video in the modern-media-controls module already. This
3253 gets rid of this odd case where the content would not see the "click" event while the C++ side would
3254 handle it and pause the video.
3256 * Modules/modern-media-controls/media/media-controller.js:
3258 (MediaController.prototype.handleEvent):
3259 (MediaController.prototype._containerWasClicked): Deleted.
3260 * html/MediaDocument.cpp:
3261 (WebCore::MediaDocument::defaultEventHandler):
3263 2017-03-27 Youenn Fablet <youenn@apple.com>
3265 Tighten RTCDatachannel creation and parameter getters
3266 https://bugs.webkit.org/show_bug.cgi?id=170081
3268 Reviewed by Eric Carlson.
3270 Covered by updated tests.
3272 Adding some parameter checks when creating data channels.
3273 Making some getters nullable as per the spec.
3275 * Modules/mediastream/RTCDataChannel.h:
3276 * Modules/mediastream/RTCDataChannel.idl:
3277 * Modules/mediastream/RTCPeerConnection.cpp:
3278 (WebCore::RTCPeerConnection::createDataChannel):
3279 * Modules/mediastream/RTCPeerConnection.idl:
3280 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3281 (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
3282 (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
3283 * platform/mediastream/RTCDataChannelHandler.h:
3286 2017-03-27 Youenn Fablet <youenn@apple.com>
3288 Add support for RTCRtpReceiver/RTCRtpSender getParameters
3289 https://bugs.webkit.org/show_bug.cgi?id=170057
3291 Reviewed by Alex Christensen.
3293 Test: webrtc/video-getParameters.html
3295 getParameters returns a dictionary of values taken from libwebrtc RtpReceiverInterface/RtpSenderInrterface objects.
3296 Added a direct link between WebCore RTCRtpReceiver and libwebrtc RtpReceiverInterface object.
3297 Making the link between WebCore RTCRtpSender and libwebrtc RtpSenderInrterface object through
3298 PeerConnectionBackend to keep the current architecture shared with OpenWebRTC.
3299 In the future, we should try to make the link more direct.
3301 Added routines to support the conversion from libwebrtc to WebCore.
3302 Ensured that RTCRtpReceiver is cleaning its backend when being stopped.
3305 * DerivedSources.make:
3306 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3307 (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
3308 * Modules/mediastream/PeerConnectionBackend.h:
3309 (WebCore::PeerConnectionBackend::getParameters):
3310 * Modules/mediastream/RTCPeerConnection.cpp:
3311 (WebCore::RTCPeerConnection::doClose):
3312 (WebCore::RTCPeerConnection::getParameters):
3313 * Modules/mediastream/RTCPeerConnection.h:
3314 * Modules/mediastream/RTCRtpParameters.h: Added.
3315 * Modules/mediastream/RTCRtpParameters.idl: Added.
3316 * Modules/mediastream/RTCRtpReceiver.cpp:
3317 (WebCore::RTCRtpReceiver::RTCRtpReceiver):
3318 * Modules/mediastream/RTCRtpReceiver.h:
3319 (WebCore::RTCRtpReceiver::Backend::~Backend):
3320 (WebCore::RTCRtpReceiver::Backend::getParameters):
3321 (WebCore::RTCRtpReceiver::create):
3322 (WebCore::RTCRtpReceiver::stop):
3323 (WebCore::RTCRtpReceiver::setBackend):
3324 (WebCore::RTCRtpReceiver::getParameters):
3325 * Modules/mediastream/RTCRtpReceiver.idl:
3326 * Modules/mediastream/RTCRtpSender.cpp:
3327 (WebCore::RTCRtpSender::create):
3328 (WebCore::RTCRtpSender::RTCRtpSender):
3329 (WebCore::RTCRtpSender::replaceTrack):
3330 (WebCore::RTCRtpSender::getParameters):
3331 * Modules/mediastream/RTCRtpSender.h:
3332 (WebCore::RTCRtpSender::Backend::~Backend):
3333 (WebCore::RTCRtpSender::isStopped):
3334 (WebCore::RTCRtpSender::stop):
3335 * Modules/mediastream/RTCRtpSender.idl:
3336 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3337 (WebCore::LibWebRTCMediaEndpoint::addTrack):
3338 (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
3339 (WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
3340 (WebCore::LibWebRTCMediaEndpoint::stop):
3341 (WebCore::fillEncodingParameters):
3342 (WebCore::fillHeaderExtensionParameters):
3343 (WebCore::fillCodecParameters):
3344 (WebCore::fillRtpParameters):
3345 (WebCore::RTCRtpReceiverBackend::getParameters):
3346 (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters):
3347 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3348 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3349 (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
3350 (WebCore::LibWebRTCPeerConnectionBackend::getParameters):
3351 * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3352 * WebCore.xcodeproj/project.pbxproj:
3353 * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3355 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
3357 font variation properties don't need to accept numbers
3358 https://bugs.webkit.org/show_bug.cgi?id=169357
3360 Reviewed by Antti Koivisto.
3362 The CSS Fonts level 4 spec stabilized the grammar accepted by font-weight,
3363 font-style, and font-stretch. The changes are that font-style and
3364 font-stretch no longer accept raw numbers, and the @font-face descriptor
3365 ranges are now separated by spaces instead of slashes.
3367 Tests: fast/text/font-selection-font-face-parse.html
3368 fast/text/font-selection-font-loading-api-parse.html
3369 fast/text/font-stretch-parse.html
3370 fast/text/font-style-parse.html
3371 fast/text/variations/font-selection-properties.html
3373 * css/CSSComputedStyleDeclaration.cpp:
3374 (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
3375 (WebCore::fontWeightFromStyle):
3376 (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
3377 (WebCore::fontStretchFromStyle):
3378 (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
3379 (WebCore::fontStyleFromStyle):
3380 * css/CSSComputedStyleDeclaration.h:
3382 (WebCore::FontFace::style):
3383 (WebCore::FontFace::weight):
3384 (WebCore::FontFace::stretch):
3385 (WebCore::rangeIsSingleValue): Deleted.
3386 * css/StyleBuilderConverter.h:
3387 (WebCore::StyleBuilderConverter::convertFontStretchFromValue):
3388 * css/parser/CSSPropertyParser.cpp:
3389 (WebCore::consumeFontWeightRange):
3390 (WebCore::consumeFontStretch):
3391 (WebCore::consumeFontStretchRange):
3392 (WebCore::consumeFontStyle):
3393 (WebCore::consumeFontStyleRange):
3395 2017-03-27 Youenn Fablet <youenn@apple.com>
3397 Further optimize checkWebRTCAvailability
3398 https://bugs.webkit.org/show_bug.cgi?id=169147
3400 Reviewed by Alex Christensen.
3402 Tested locally by removing libwebrtc.dylib.
3403 Replacing dlopen check by checking an exported symbol, rtc::LogMessage::LogToDebug.
3404 This check is more efficient and accurate. It should work in more configurations than the previous one.
3406 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3407 (WebCore::isNullFunctionPointer):
3408 (WebCore::LibWebRTCProvider::webRTCAvailable):
3410 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>