1 2017-04-05 Chris Dumez <cdumez@apple.com>
3 <input type="range"> changing to disabled while active breaks all pointer events
4 https://bugs.webkit.org/show_bug.cgi?id=170447
5 <rdar://problem/31442875>
7 Reviewed by Geoffrey Garen.
9 When a range's slider is being moved, we set SliderThumbElement's m_inDragMode flag
10 to true and mark the range elements as the CapturingMouseEventsElement. When we get
11 the mouseUp event, we are supposed to exit drag mode. However, when the range element
12 gets disabled while dragging, we do not get the mouseUp event and we need to make
13 sure we exit dragging mode anyway. r112547 tried to fix this by calling stopDragging()
14 in SliderThumbElement::defaultEventHandler() when the input element is disabled.
15 While this often works, this is fragile and we sometimes fail to exit dragging mode
18 This patch addressed the issue by calling stopDragging() in
19 SliderThumbElement::disabledAttributeChanged() instead. This is much safer as we
20 guarantee will exit dragging mode whenever the range element gets disabled, even
21 if SliderThumbElement::defaultEventHandler() does not get called after that.
23 Test: fast/forms/range/disabled-while-dragging.html
25 * html/RangeInputType.cpp:
26 (WebCore::RangeInputType::disabledAttributeChanged):
27 * html/RangeInputType.h:
28 * html/shadow/SliderThumbElement.cpp:
29 (WebCore::SliderThumbElement::defaultEventHandler):
30 (WebCore::SliderThumbElement::disabledAttributeChanged):
31 * html/shadow/SliderThumbElement.h:
33 2017-04-05 Eric Carlson <eric.carlson@apple.com>
35 [MediaStream] Video doesn't render in fullscreen on iOS
36 https://bugs.webkit.org/show_bug.cgi?id=170404
38 Reviewed by Youenn Fablet.
40 No new tests, filed https://bugs.webkit.org/show_bug.cgi?id=170512.
42 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
43 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
44 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Include
45 video fullscreen manager on iOS too.
46 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::videoTransformationMatrix): Add paramater
47 to force transform recalculation.
48 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Restructure code since
49 the display layer resize happens elsewhere.
50 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Include video fullscreen
52 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers): Ditto.
53 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto.
54 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer): Ditto.
55 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::backgroundLayerBoundsChanged): Change the
56 display layer size and position immediately instead of waiting for the next sample buffer
57 so the display is correct when fullscreen mode changes when paused.
59 2017-04-05 Youenn Fablet <youenn@apple.com>
61 Deprecate and remove URL.createObjectURL(mediastream)
62 https://bugs.webkit.org/show_bug.cgi?id=167518
63 <rdar://problem/31149607>
65 Reviewed by Eric Carlson.
67 Covered by updated tests.
71 * DerivedSources.make:
72 * Modules/mediastream/DOMURLMediaStream.cpp: Removed.
73 * Modules/mediastream/DOMURLMediaStream.h: Removed.
74 * Modules/mediastream/DOMURLMediaStream.idl: Removed.
75 * WebCore.xcodeproj/project.pbxproj:
78 2017-04-05 Alejandro G. Castro <alex@igalia.com>
80 [Webrtc] Mock realtime sources factories should be static after r213941
81 https://bugs.webkit.org/show_bug.cgi?id=170282
83 Reviewed by Alex Christensen.
85 If we don't make the variables static we would be returning a
88 * platform/mock/MockRealtimeAudioSource.cpp:
89 (WebCore::MockRealtimeAudioSource::factory):
90 * platform/mock/MockRealtimeVideoSource.cpp:
91 (WebCore::MockRealtimeVideoSource::factory):
93 2017-04-05 Alex Christensen <achristensen@webkit.org>
97 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
98 Some JavaScript inline functions were not being accessed from this file with different enable flags.
99 * platform/spi/cf/CFNetworkSPI.h:
100 * platform/spi/cocoa/NSURLConnectionSPI.h:
101 Moved NSURLSession-specific SPI from NSURLConnectionSPI.h to CFNetworkSPI.h.
103 2017-04-05 Chris Dumez <cdumez@apple.com>
105 _blank / _self / _parent / _top browsing context names should be case-insensitive
106 https://bugs.webkit.org/show_bug.cgi?id=169747
108 Reviewed by Alex Christensen.
110 _blank / _self / _parent / _top browsing context names should be case-insensitive
111 as per the HTML specification:
112 - https://html.spec.whatwg.org/#browsing-context-names
114 This aligns our behavior with Firefox as well. See discussion at:
115 - https://github.com/whatwg/html/issues/2443
117 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html
118 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
119 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
120 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
121 imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
123 * loader/FrameLoader.cpp:
124 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
125 (WebCore::createWindow):
126 * page/DOMWindow.cpp:
127 (WebCore::DOMWindow::open):
128 * page/FrameTree.cpp:
129 (WebCore::FrameTree::uniqueChildName):
130 (WebCore::FrameTree::find):
132 2017-04-05 Miguel Gomez <magomez@igalia.com>
134 [GTK+] PNG animations that should run once are not played at all
135 https://bugs.webkit.org/show_bug.cgi?id=170499
137 Reviewed by Carlos Garcia Campos.
139 The repetition count reported bu the PNGImageDecoder is wrong. It's returning m_playCount - 1, which
140 means 0 for the animations that need to be played once. Change it to return an appropriate value.
142 Covered by existent tests.
144 * platform/image-decoders/png/PNGImageDecoder.cpp:
145 (WebCore::PNGImageDecoder::repetitionCount):
146 * platform/image-decoders/png/PNGImageDecoder.h:
148 2017-04-05 Andy Estes <aestes@apple.com>
150 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
151 https://bugs.webkit.org/show_bug.cgi?id=170365
152 <rdar://problem/29205721>
154 Reviewed by Tim Horton.
156 r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
157 consider nodes that are descendants of startNode, but we need to traverse all nodes between
158 startNode and endNode to find existing non-DD links.
160 As a result, we'd add a Data Detector link to the following snippet and make the original
163 <a href='#'>tomorrow</a> <a href='#'>night</a>
165 Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
166 will terminate when we reach endNode.
168 Updated WebKit2.DataDetectionReferenceDate API test.
170 * editing/cocoa/DataDetection.mm:
171 (WebCore::searchForLinkRemovingExistingDDLinks):
173 2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
175 Move WebErrors from WebProcess to Shared and get rid of ErrorsGtk in WebCore
176 https://bugs.webkit.org/show_bug.cgi?id=156974
178 Reviewed by Sam Weinig.
183 * platform/gtk/ErrorsGtk.cpp: Removed.
184 * platform/gtk/ErrorsGtk.h: Removed.
186 2017-04-05 Andy Estes <aestes@apple.com>
188 [ios-simulator] API test WebKit2.DataDetectionReferenceDate timing out
189 https://bugs.webkit.org/show_bug.cgi?id=161967
191 Reviewed by Alexey Proskuryakov.
193 DataDetectorsCoreSPI.h defined DDQueryOffset as a struct of two CFIndexes, which is 16 bytes
194 on LP64, but the struct is actually defined as two CFIndex-typed 32-bit bitfields, which is
195 8 bytes on LP64. This breaks the ABI on Public SDK builds when calling functions that take
196 or return DDQueryOffsets.
198 * platform/spi/cocoa/DataDetectorsCoreSPI.h: Updated the DDQueryOffset definition for
199 Public SDK builds, and added a static_assert to detect future size changes at compile time.
201 2017-04-04 Jer Noble <jer.noble@apple.com>
203 Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
204 https://bugs.webkit.org/show_bug.cgi?id=170471
206 Reviewed by Eric Carlson.
208 Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
210 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
211 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
212 * platform/spi/mac/AVFoundationSPI.h:
214 2017-04-04 Youenn Fablet <youenn@apple.com>
216 Canvas is tainted when painting a video with MediaStreamTrack
217 https://bugs.webkit.org/show_bug.cgi?id=170486
219 Reviewed by Eric Carlson.
221 Test: http/tests/media/media-stream/getusermedia-with-canvas.html
223 Adding the notion of isolated source so that we can later on implement WebRTC isolated tracks.
224 For now, canvas will not be tainted if painted from a MediaStreamTrack.
226 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
227 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
228 (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck):
229 * platform/mediastream/MediaStreamTrackPrivate.h:
230 (WebCore::MediaStreamTrackPrivate::isIsolated):
231 * platform/mediastream/RealtimeMediaSource.h:
233 2017-04-04 Commit Queue <commit-queue@webkit.org>
235 Unreviewed, rolling out r214894, r214895, r214907, r214912,
237 https://bugs.webkit.org/show_bug.cgi?id=170491
239 Caused build failures on Mac (Requested by rniwa on #webkit).
244 http://trac.webkit.org/changeset/214894
246 "Rolling back the build fix, as it broke other builds."
247 http://trac.webkit.org/changeset/214895
249 "Move AVSampleBufferDisplayLayer declarations into
251 https://bugs.webkit.org/show_bug.cgi?id=170471
252 http://trac.webkit.org/changeset/214907
254 "Unreviewed build fix: fix compilation error on Sierra."
255 http://trac.webkit.org/changeset/214912
258 http://trac.webkit.org/changeset/214918
260 2017-04-04 Youenn Fablet <youenn@apple.com>
262 [Mac] Add back web audio support for getUserMedia MediaStreamTrack
263 https://bugs.webkit.org/show_bug.cgi?id=170482
265 Reviewed by Eric Carlson.
267 ´Covered by reenabled test.
269 Exporting method and class used in WebKit2.
271 * WebCore.xcodeproj/project.pbxproj:
272 * platform/audio/mac/CAAudioStreamDescription.h:
273 * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
275 2017-04-04 Alexey Proskuryakov <ap@apple.com>
279 * platform/spi/mac/AVFoundationSPI.h:
281 2017-04-04 Simon Fraser <simon.fraser@apple.com>
283 Do some minor FEColorMatrix code cleanup and optimization
284 https://bugs.webkit.org/show_bug.cgi?id=170474
286 Reviewed by Dean Jackson.
288 Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).
290 Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
291 of multiple times, which is faster.
293 This kind of code benefits from aligning things with spaces for readability, so do so,
294 violating webkit style.
296 Add some off-by-default performance logging code.
298 Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.
300 * platform/graphics/filters/FEColorMatrix.cpp:
302 (WebCore::saturateAndHueRotate):
303 (WebCore::effectType):
304 (WebCore::FEColorMatrix::platformApplySoftware):
306 2017-04-04 Brent Fulgham <bfulgham@apple.com>
308 Do not assert when CharacterData representing an Attr fires events
309 https://bugs.webkit.org/show_bug.cgi?id=170454
310 <rdar://problem/30979320>
312 Reviewed by Ryosuke Niwa.
314 Make the NoEventDispatchAssertion in CharacterData::notifyParentAfterChange conditional
315 since Attr elements should be allowed to fire events.
317 Tests: fast/dom/no-assert-for-malformed-js-url-attribute.html
319 * dom/CharacterData.cpp:
320 (WebCore::CharacterData::notifyParentAfterChange):
322 2017-04-04 Youenn Fablet <youenn@apple.com>
324 LayoutTest webrtc/libwebrtc/descriptionGetters.html is a flaky failure
325 https://bugs.webkit.org/show_bug.cgi?id=169481
327 Reviewed by Eric Carlson.
329 No need to enumerate all network interfaces in most layout tests.
330 Adding an Internals API for that in case we want to use TCP localhost candidates.
332 * testing/Internals.cpp:
333 (WebCore::Internals::Internals):
334 (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
335 * testing/Internals.h:
336 * testing/Internals.idl:
339 2017-04-04 Jer Noble <jer.noble@apple.com>
341 Unreviewed build fix: fix compilation error on Sierra.
343 * platform/spi/mac/AVFoundationSPI.h:
345 2017-04-04 Jer Noble <jer.noble@apple.com>
347 Move AVSampleBufferDisplayLayer declarations into AVFoundationSPI.h
348 https://bugs.webkit.org/show_bug.cgi?id=170471
350 Reviewed by Eric Carlson.
352 Move the declaration of AVSampleBufferDisplayLayer (and related classes) into AVFoundationSPI.
354 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
355 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addDisplayLayer): Deleted.
356 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeDisplayLayer): Deleted.
357 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
358 * platform/spi/mac/AVFoundationSPI.h:
360 2017-04-04 Saam Barati <sbarati@apple.com>
362 WebAssembly: JSWebAssemblyCallee should not be a JSCell
363 https://bugs.webkit.org/show_bug.cgi?id=170135
365 Reviewed by Michael Saboff.
367 * bindings/js/JSDOMWindowBase.cpp:
368 (WebCore::callerDOMWindow):
370 2017-04-04 Simon Fraser <simon.fraser@apple.com>
372 Change Document's lastHandledUserGestureTimestamp to be a MonotonicTime
373 https://bugs.webkit.org/show_bug.cgi?id=170468
375 Reviewed by Zalan Bujtas.
377 Change the double to MonotonicTime. No behavior change.
380 (WebCore::Document::updateLastHandledUserGestureTimestamp):
382 (WebCore::Document::lastHandledUserGestureTimestamp):
383 * html/HTMLPlugInImageElement.cpp:
384 (WebCore::documentHadRecentUserGesture):
385 * loader/FrameLoader.cpp:
386 (WebCore::shouldAskForNavigationConfirmation):
388 2017-04-04 Youenn Fablet <youenn@apple.com>
390 [Debug] ASSERT(!throwScope.exception()) on imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-status-worker.html
391 https://bugs.webkit.org/show_bug.cgi?id=170395
392 <rdar://problem/31394017>
394 Reviewed by Mark Lam.
396 No change of behavior.
398 * bindings/js/JSDOMPromise.cpp:
399 (WebCore::DeferredPromise::reject): Adding early ASSERT that creating an exception is happening correctly.
401 2017-04-04 Alexey Proskuryakov <ap@apple.com>
403 Rolling back the build fix, as it broke other builds.
405 * platform/spi/mac/AVFoundationSPI.h:
407 2017-04-04 Alexey Proskuryakov <ap@apple.com>
411 Rubber-stamped by Jer Noble.
413 * platform/spi/mac/AVFoundationSPI.h:
415 2017-04-04 Tim Horton <timothy_horton@apple.com>
417 [Mac] -[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:] invokes the resultCollector with didWrap = NO even when it wraps
418 https://bugs.webkit.org/show_bug.cgi?id=165801
419 <rdar://problem/29649535>
421 Reviewed by Wenson Hsieh.
423 New API tests: WebKit2.FindInPageWrapping*
425 * page/FrameTree.cpp:
426 (WebCore::FrameTree::traverseNextWithWrap):
427 (WebCore::FrameTree::traversePreviousWithWrap):
428 (WebCore::FrameTree::traverseNextInPostOrderWithWrap):
430 Add CanWrap and DidWrap boolean enums, and add an optional out argument
431 to traverse*WithWrap indicating whether a wrap actually occurred.
433 * history/CachedPage.cpp:
434 (WebCore::firePageShowAndPopStateEvents):
435 * history/PageCache.cpp:
436 (WebCore::destroyRenderTree):
437 Adjust to the new CanWrap enum.
440 (WebCore::incrementFrame):
441 (WebCore::Page::findString):
442 (WebCore::Page::findStringMatchingRanges):
443 (WebCore::Page::rangeOfString):
444 (WebCore::Page::findMatchesForText):
445 (WebCore::Page::unmarkAllTextMatches):
447 Adjust to the new CanWrap enum, and optionally plumb DidWrap through
448 to callers of findString().
450 2017-04-04 Carlos Garcia Campos <cgarcia@igalia.com>
452 [GTK] PLATFORM(GTK) && !USE(COORDINATED_GRAPHICS_THREADED) is no longer possible
453 https://bugs.webkit.org/show_bug.cgi?id=170458
455 Reviewed by Carlos Alberto Lopez Perez.
457 That is not supported anymore, so we can remove dead code from VideoSinkGStreamer.cpp
459 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
460 (VideoRenderRequestScheduler::VideoRenderRequestScheduler):
462 2017-04-04 Per Arne Vollan <pvollan@apple.com>
464 Unreviewed Windows build fix.
466 * bindings/js/JSDOMGuardedObject.h:
468 2017-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
470 Data interaction should register type identifiers in order of priority
471 https://bugs.webkit.org/show_bug.cgi?id=170428
472 <rdar://problem/30633296>
474 Reviewed by Tim Horton.
476 Currently, due to the shared logic for writing to a UIPasteboard (in the case of copy/paste) and the shared
477 UIItemProvider-based pasteboard wrapper (in the case of data interaction), we don't enforce any particular
478 ordering in which type identifiers are registered in the generated item provider. This is because
479 -[UIPasteboard setItems:] only takes an unordered mapping of type identifiers to objects.
481 To fix this, we introduce a separate way to set pasteboard data that first writes a list of object
482 representations in order of priority (which is dependent on the content being interacted with) and then register
483 individual type-data mappings at the end.
485 Augmented existing API tests in DataInteractionTests to check for the existence and priority of type identifiers
486 in the UIItemProviders created upon starting data interaction. Also adds a new unit test:
487 DataInteractionTests.TextAreaToInput.
489 * WebCore.xcodeproj/project.pbxproj:
490 * editing/cocoa/EditorCocoa.mm:
491 (WebCore::archivedDataForAttributedString):
492 (WebCore::Editor::writeSelectionToPasteboard):
493 (WebCore::Editor::writeSelection):
494 * platform/Pasteboard.h:
495 * platform/PasteboardWriterData.h:
496 * platform/PlatformPasteboard.h:
497 * platform/ios/AbstractPasteboard.h:
498 * platform/ios/AbstractPasteboard.mm: Copied from Source/WebCore/platform/ios/AbstractPasteboard.h.
500 Introduce WebPasteboardItemData, a wrapper around a list of objects representating the pasteboard data in order
501 of priority, and a dictionary containing additional NSData blobs that contain data useful for private clients.
503 (+[WebPasteboardItemData itemWithRepresentingObjects:additionalData:]):
504 (-[WebPasteboardItemData initWithRepresentingObjects:additionalData:]):
505 (-[WebPasteboardItemData representingObjects]):
506 (-[WebPasteboardItemData additionalData]):
507 * platform/ios/PlatformPasteboardIOS.mm:
508 (WebCore::richTextRepresentationsForPasteboardWebContent):
509 (WebCore::PlatformPasteboard::writeObjectRepresentations):
510 (WebCore::PlatformPasteboard::write):
512 Tweaked to check whether the pasteboard responds to -setItemsFromObjectRepresentations:. If so, uses the
513 PlatformPasteboard::writeObjectRepresentations codepath to write data to the pasteboard, respecting type
516 * platform/ios/WebItemProviderPasteboard.mm:
517 (-[WebItemProviderPasteboard pasteboardTypes]):
518 (-[WebItemProviderPasteboard setItemProviders:]):
519 (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
521 Replaces -setItems: with -setItemsFromObjectRepresentations:, which respects the priority of each object
522 representation of the data in the pasteboard.
524 (-[WebItemProviderPasteboard setItems:]): Deleted.
526 2017-04-03 Javier Fernandez <jfernandez@igalia.com>
528 [css-align] Adapt place-content alignment shorthand to the new baseline syntax
529 https://bugs.webkit.org/show_bug.cgi?id=170340
531 Reviewed by David Hyatt.
533 Now that the align-content and justify-content CSS properties are
534 adapted to the new baseline-position CSS values syntax we can adapt the
535 shorthand that controls such properties to the new syntax as well.
537 No new tests, just adding some additional cases to the tests we already have.
539 * css/StyleProperties.cpp:
540 (WebCore::StyleProperties::getPropertyValue):
541 (WebCore::StyleProperties::placeContentPropertyValue):
542 * css/StyleProperties.h:
543 * css/parser/CSSPropertyParser.cpp:
544 (WebCore::isContentDistributionKeyword):
545 (WebCore::isContentPositionKeyword):
546 (WebCore::isOverflowKeyword):
547 (WebCore::getBaselineKeyword):
548 (WebCore::consumeContentDistributionOverflowPosition):
549 (WebCore::consumeSimplifiedContentPosition):
551 2017-04-03 Nan Wang <n_wang@apple.com>
553 AX: Expose link children when doing search predication on iOS
554 https://bugs.webkit.org/show_bug.cgi?id=170424
555 <rdar://problem/31413335>
557 The children of links are accessible elements on iOS instead of the link itself,
558 so we should expose the children when doing predicated searches as well.
560 Reviewed by Chris Fleizach.
562 Test: accessibility/ios-simulator/ios-search-predicate-link-children.html
564 * accessibility/AccessibilityObject.cpp:
565 (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
567 2017-04-03 Jer Noble <jer.noble@apple.com>
569 No audio output for MediaStream-backed audio elements on iOS
570 https://bugs.webkit.org/show_bug.cgi?id=170427
572 Reviewed by Eric Carlson.
574 The logic for setting the output timestamp offset in AudioSampleDataSource was reversed; instead of
575 subtracting out the timestamp of the first pull request, it effectively doubled it.
577 * platform/audio/mac/AudioSampleDataSource.mm:
578 (WebCore::AudioSampleDataSource::pullSamplesInternal):
580 2017-04-03 Dave Hyatt <hyatt@apple.com>
582 Japanese fonts in vertical text should support synthesized italics
583 https://bugs.webkit.org/show_bug.cgi?id=169301
585 Reviewed by Simon Fraser.
587 Updated test in fast/text/international.
589 * platform/graphics/Font.cpp:
590 (WebCore::Font::nonSyntheticItalicFont): Deleted.
591 * platform/graphics/Font.h:
592 Removed the non-synthetic italic font member, since it's not used.
594 * platform/graphics/FontCascadeFonts.cpp:
595 (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
596 Patched to ensure that a text-orientation-fallback font data is always
597 returned in the synthetic oblique case, so that non-CJK and CJK are
598 guaranteed to be broken up so that their slants can be applied differently.
600 (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
601 (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
602 (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic): Deleted.
603 Patched to no longer turn off synthetic oblique for CJK.
605 * platform/graphics/cocoa/FontCascadeCocoa.mm:
606 (WebCore::FontCascade::drawGlyphs):
607 Apply the correct italic transform to CJK when in vertical text.
609 2017-04-03 Chris Dumez <cdumez@apple.com>
611 REGRESSION (r206744): CSS background-image in style attribute ignored when using createHTMLDocument method of DOM parsing
612 https://bugs.webkit.org/show_bug.cgi?id=170285
613 <rdar://problem/31378543>
615 Reviewed by Andy Estes.
617 r206744 caused up to stop trying to resolve relative URLs when trying to load an image
618 referred to by CSS. We already try to resolve the relative URL when parsing the CSS
619 property so this will usually work fine. However, in the case when the CSS property
620 is parsed in detached document and then moved to another document, we will not have
623 Test: fast/images/background-image-relative-url-changes-document.html
625 * css/CSSImageValue.cpp:
626 (WebCore::CSSImageValue::loadImage):
628 2017-04-03 Jeremy Jones <jeremyj@apple.com>
630 Do not set WebAVPlayerLayerView background to black in fullscreen.
631 https://bugs.webkit.org/show_bug.cgi?id=170132
632 rdar://problem/30839278
634 Reviewed by Tim Horton.
636 No new tests because no behavior change.
638 The black background on WebAVPlayerLayerView interferes with the fullscreen animation
639 and has been removed.
641 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
642 (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
643 (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
645 2017-04-03 Antti Koivisto <antti@apple.com>
647 REGRESSION (r207669): FileMaker Pro Help pages do not render correctly
648 https://bugs.webkit.org/show_bug.cgi?id=170402
649 <rdar://problem/31004344>
651 Reviewed by Simon Fraser.
653 If a new stylesheet load is started from the load event the document.styleSheets does not
654 always reflect the already loaded stylesheets.
656 Test: fast/css/document-stylesheets-dynamic.html
658 * style/StyleScope.cpp:
659 (WebCore::Style::Scope::updateActiveStyleSheets):
661 Remove an old optimization where we would not update active stylesheets if there were pending
662 (head) stylesheet loads and they had not been updated already.
663 This is probably not a valuable optimization anymore with the new lazy stylesheet update strategy.
665 * style/StyleScope.h:
667 2017-04-03 Anders Carlsson <andersca@apple.com>
669 Tweak ApplePaySession API
670 https://bugs.webkit.org/show_bug.cgi?id=170409
671 rdar://problem/31405459
673 Reviewed by Tim Horton.
675 Rename "address" to "addressLines". Add "postalAddress". Reorder the ApplePayError constructor parameters.
677 * Modules/applepay/ApplePayError.cpp:
678 (WebCore::ApplePayError::create):
679 (WebCore::ApplePayError::ApplePayError):
680 * Modules/applepay/ApplePayError.h:
681 * Modules/applepay/ApplePayError.idl:
682 * Modules/applepay/PaymentRequest.h:
684 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
686 [GCrypt] Implement CryptoKeyEC::keySizeInBits(), ::platformGeneratePair()
687 https://bugs.webkit.org/show_bug.cgi?id=170345
689 Reviewed by Michael Catanzaro.
691 Start implementing the libgcrypt-based platform bits of CryptoKeyEC.
693 Implement keySizeInBits() by returning the appropriate size for this
694 object's curve type. An assertion is added to ensure that this size
695 matches the one that's returned by gcry_pk_get_nbits() for this
696 object's EC key as represented by the m_platformKey gcry_sexp_t object.
698 Implement platformGeneratePair() by constructing a genkey s-expression
699 that requests a generation of an EC key for the specified curve type.
700 The s-expression is then passed to gcry_pk_genkey(), and the public
701 and private key data is then retrieved from the returned s-expression
702 upon success and used to create the public and private CryptoKeyEC
705 The PlatformECKey type alias is changed to match gcry_sexp_t. The
706 CryptoKeyEC destructor releases the gcry_sexp_t object through
707 a PAL::GCrypt::HandleDeleter<gcry_sexp_t> instance.
709 The method definitions in the CryptoKeyECGCrypt.cpp file are also
710 sorted to match the declaration order in the header.
712 No new tests -- current ones cover this sufficiently, but are not yet
713 enabled due to other missing platform-specific SUBTLE_CRYPTO
716 * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
717 (WebCore::curveSize):
718 (WebCore::curveName):
719 (WebCore::CryptoKeyEC::~CryptoKeyEC):
720 (WebCore::CryptoKeyEC::keySizeInBits):
721 (WebCore::CryptoKeyEC::platformGeneratePair):
722 (WebCore::CryptoKeyEC::platformImportSpki):
723 (WebCore::CryptoKeyEC::platformImportPkcs8):
724 (WebCore::CryptoKeyEC::platformExportRaw):
725 (WebCore::CryptoKeyEC::platformAddFieldElements):
726 (WebCore::CryptoKeyEC::platformExportSpki):
727 * crypto/keys/CryptoKeyEC.h:
729 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
731 [GCrypt] Implement AES_KW support
732 https://bugs.webkit.org/show_bug.cgi?id=170274
734 Reviewed by Michael Catanzaro.
736 Implement the CryptoAlgorithmAES_KW::platform{Wrap,Unwrap}Key()
737 functionality for configurations that use libgcrypt. This is done
738 by leveraging the gcry_cipher_* APIs for the AES algorithm that's
739 deducted appropriately from the key size and the AESWRAP cipher mode.
741 No new tests -- current ones cover this sufficiently, but are not yet
742 enabled due to other missing platform-specific SUBTLE_CRYPTO
745 * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
746 (WebCore::gcryptWrapKey):
747 (WebCore::gcryptUnwrapKey):
748 (WebCore::CryptoAlgorithmAES_KW::platformWrapKey):
749 (WebCore::CryptoAlgorithmAES_KW::platformUnwrapKey):
751 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
753 [GCrypt] Implement AES_GCM support
754 https://bugs.webkit.org/show_bug.cgi?id=170271
756 Reviewed by Michael Catanzaro.
758 Implement the CryptoAlgorithmAES_GCM::platform{Encrypt,Decrypt}
759 functionality for configurations that use libgcrypt. This is done
760 by leveraging the gcry_cipher_* APIs for the AES algorithm that's
761 deducted appropriately from the key size and the GCM cipher mode.
763 No new tests -- current ones cover this sufficiently, but are not yet
764 enabled due to other missing platform-specific SUBTLE_CRYPTO
767 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
768 (WebCore::gcryptEncrypt):
769 (WebCore::gcryptDecrypt):
770 (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
771 (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
773 2017-04-03 Zan Dobersek <zdobersek@igalia.com>
775 [GCrypt] Implement PBKDF2 support
776 https://bugs.webkit.org/show_bug.cgi?id=170270
778 Reviewed by Michael Catanzaro.
780 Implement the CryptoAlgorithmPBKDF2::platformDeriveBits() functionality
781 for configurations that use libgcrypt. This is done by leveraging the
782 gcry_kdf_derive() API, using GCRY_KDF_PBKDF2 as the preferred KDF
783 along with the properly deducted SHA algorithm.
785 No new tests -- current ones cover this sufficiently, but are not yet
786 enabled due to other missing platform-specific SUBTLE_CRYPTO
789 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
790 (WebCore::gcryptDeriveBits):
791 (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
793 2017-04-01 Simon Fraser <simon.fraser@apple.com>
795 Clean up touch event handler registration when moving nodes between documents
796 https://bugs.webkit.org/show_bug.cgi?id=170384
797 rdar://problem/30816694
799 Reviewed by Chris Dumez.
801 Make sure that Node::didMoveToNewDocument() does the correct unregistration on the
802 old document, and registration on the new document for nodes with touch event listeners,
803 and gesture event listeners. Touch "handler" nodes (those for overflow and sliders) are
804 already correctly moved via renderer-related teardown.
806 Add assertions that fire when removal was not complete.
808 Use references in more places.
810 Tests: fast/events/touch/ios/gesture-node-move-between-documents.html
811 fast/events/touch/ios/overflow-node-move-between-documents.html
812 fast/events/touch/ios/slider-node-move-between-documents.html
813 fast/events/touch/ios/touch-node-move-between-documents.html
816 (WebCore::EventNames::gestureEventNames):
818 (WebCore::Node::willBeDeletedFrom):
819 (WebCore::Node::didMoveToNewDocument):
820 (WebCore::tryAddEventListener):
821 (WebCore::tryRemoveEventListener):
822 * html/shadow/SliderThumbElement.cpp:
823 (WebCore::SliderThumbElement::registerForTouchEvents):
824 (WebCore::SliderThumbElement::unregisterForTouchEvents):
825 * rendering/RenderLayer.cpp:
826 (WebCore::RenderLayer::registerAsTouchEventListenerForScrolling):
827 (WebCore::RenderLayer::unregisterAsTouchEventListenerForScrolling):
829 2017-04-03 Youenn Fablet <youenn@apple.com>
831 captureStream is getting black frames with webgl canvas
832 https://bugs.webkit.org/show_bug.cgi?id=170325
834 Reviewed by Dean Jackson.
836 Test: fast/mediastream/captureStream/canvas3d.html
838 Changing the webgl context to save buffers in case the canvas is captured.
839 Adding a canvas changed notification in case of clear.
840 In the future, we might want to change this notification and do it when endPaint or similar is called.
842 Adding an Internals API to grab the RGBA equivalent of the next track frame.
843 For that purpose, adding a bunch of WEBCORE_EXPORT.
845 * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
846 (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Adding constraints support so that track settings
847 getter actually transmits the width and height of the source.
848 (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): ensuring webgl canvas context keep their drawing buffer.
849 * Modules/mediastream/MediaStreamTrack.h:
850 * bindings/js/JSDOMGuardedObject.h:
851 * bindings/js/JSDOMPromise.h:
852 (WebCore::DeferredPromise::resolve):
853 (WebCore::DeferredPromise::reject):
854 * dom/ActiveDOMCallback.h:
855 * html/HTMLCanvasElement.cpp:
856 (WebCore::HTMLCanvasElement::captureStream):
858 * html/ImageData.idl:
859 * html/canvas/WebGLRenderingContext.cpp:
860 (WebCore::WebGLRenderingContext::clear): ensuring canvas observers get notified in case of clear calls.
861 * html/canvas/WebGLRenderingContextBase.h:
862 (WebCore::WebGLRenderingContextBase::preserveDrawingBuffer): Added to allow canvas capture to update this property.
863 * platform/MediaSample.h:
864 (WebCore::MediaSample::getRGBAImageData): Added for internals API.
865 * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
866 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
867 (WebCore::MediaSampleAVFObjC::getRGBAImageData):
868 * platform/graphics/cv/PixelBufferConformerCV.cpp:
869 (WebCore::PixelBufferConformerCV::convert): Helper routine for getRGBAImageData.
870 * platform/graphics/cv/PixelBufferConformerCV.h:
871 * platform/mediastream/RealtimeMediaSourceSettings.h:
872 (WebCore::RealtimeMediaSourceSettings::setSupportedConstraints):
873 (WebCore::RealtimeMediaSourceSettings::setSupportedConstraits): Deleted.
874 * platform/mediastream/mac/AVMediaCaptureSource.mm:
875 (WebCore::AVMediaCaptureSource::initializeSettings):
876 * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h:
877 * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h:
878 * platform/mock/MockRealtimeMediaSource.cpp:
879 (WebCore::MockRealtimeMediaSource::initializeSettings):
880 * testing/Internals.cpp:
881 (WebCore::Internals::grabNextMediaStreamTrackFrame):
882 (WebCore::Internals::videoSampleAvailable):
883 * testing/Internals.h:
884 * testing/Internals.idl:
886 2017-04-03 Per Arne Vollan <pvollan@apple.com>
888 Implement stroke-miterlimit.
889 https://bugs.webkit.org/show_bug.cgi?id=169078
891 Reviewed by Dean Jackson.
893 Support stroke-miterlimit for text rendering, see https://drafts.fxtf.org/paint/.
895 Tests: fast/css/stroke-miterlimit-default.html
896 fast/css/stroke-miterlimit-large.html
897 fast/css/stroke-miterlimit-zero.html
899 * css/CSSComputedStyleDeclaration.cpp:
900 (WebCore::ComputedStyleExtractor::propertyValue):
901 * css/CSSProperties.json:
902 * css/SVGCSSComputedStyleDeclaration.cpp:
903 (WebCore::ComputedStyleExtractor::svgPropertyValue):
904 * rendering/TextPaintStyle.cpp:
905 (WebCore::computeTextPaintStyle):
906 (WebCore::updateGraphicsContext):
907 * rendering/TextPaintStyle.h:
908 * rendering/style/RenderStyle.cpp:
909 (WebCore::RenderStyle::diff):
910 * rendering/style/RenderStyle.h:
911 (WebCore::RenderStyle::strokeMiterLimit):
912 (WebCore::RenderStyle::setStrokeMiterLimit):
913 (WebCore::RenderStyle::initialStrokeMiterLimit):
914 (WebCore::RenderStyle::setStrokeDashOffset):
915 * rendering/style/RenderStyleConstants.cpp:
916 * rendering/style/RenderStyleConstants.h:
917 * rendering/style/SVGRenderStyle.cpp:
918 (WebCore::SVGRenderStyle::diff):
919 * rendering/style/SVGRenderStyle.h:
920 (WebCore::SVGRenderStyle::initialStrokeDashArray):
921 (WebCore::SVGRenderStyle::strokeDashArray):
922 (WebCore::SVGRenderStyle::initialStrokeMiterLimit): Deleted.
923 (WebCore::SVGRenderStyle::strokeMiterLimit): Deleted.
924 (WebCore::SVGRenderStyle::setStrokeMiterLimit): Deleted.
925 * rendering/style/SVGRenderStyleDefs.cpp:
926 (WebCore::StyleStrokeData::StyleStrokeData):
927 (WebCore::StyleStrokeData::operator==):
928 * rendering/style/SVGRenderStyleDefs.h:
929 * rendering/style/StyleRareInheritedData.cpp:
930 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
931 (WebCore::StyleRareInheritedData::operator==):
932 * rendering/style/StyleRareInheritedData.h:
933 * rendering/svg/RenderSVGShape.cpp:
934 (WebCore::RenderSVGShape::hasSmoothStroke):
935 * rendering/svg/SVGRenderSupport.cpp:
936 (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
937 * rendering/svg/SVGRenderTreeAsText.cpp:
938 (WebCore::writeStyle):
940 2017-04-03 Alejandro G. Castro <alex@igalia.com>
942 [OWR] Fix class structure for the OWR mock classes after last modifications
943 https://bugs.webkit.org/show_bug.cgi?id=170173
945 Reviewed by Youenn Fablet.
947 In case of OWR MockRealtimeMediaSource inherits from
948 RealtimeMediaSourceOwr, so we have to change some of the function
951 * platform/mock/MockRealtimeMediaSource.h:
953 2017-04-02 Alexey Proskuryakov <ap@apple.com>
956 Add missing text styles
957 https://bugs.webkit.org/show_bug.cgi?id=170295
959 * rendering/RenderThemeIOS.mm:
960 (WebCore::RenderThemeIOS::cachedSystemFontDescription):
961 (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
963 2017-04-01 Zalan Bujtas <zalan@apple.com>
965 Long Arabic text in ContentEditable with css white-space=pre hangs Safari
966 https://bugs.webkit.org/show_bug.cgi?id=170245
968 Reviewed by Myles C. Maxfield.
970 While searching for mid-word break, we measure the text by codepoints in a loop until the accumulated width > available width.
971 When we see that the accumulated width for the individual codepoints overflows, we join the codepoints and re-measure them.
972 These 2 widths could be considerably different for number of reasons (ligatures is a prime example). When we figure that
973 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.
974 However this time we start the measurement from the last whitespace, so we end up remeasuring a potentially long chuck of text
975 until we hit the wrapping point. This is way too expensive.
976 This patch changes the logic so that we just go back to measuring individual codepoints until we hit the constrain again.
978 Covered by existing tests.
980 * rendering/line/BreakingContext.h:
981 (WebCore::BreakingContext::handleText): canUseSimpleFontCodePath() is just to mitigate the potential risk of regression and
982 complex text is more likely to fall into this category.
984 2017-04-01 Jon Lee <jonlee@apple.com>
986 Add missing text styles
987 https://bugs.webkit.org/show_bug.cgi?id=170295
988 rdar://problem/30219503
990 Reviewed by Dean Jackson.
992 Updated existing test to include new text styles.
994 * css/CSSValueKeywords.in: Add title0 and title4.
995 * platform/spi/cocoa/CoreTextSPI.h:
996 * rendering/RenderThemeIOS.mm:
997 (WebCore::RenderThemeIOS::cachedSystemFontDescription):
998 (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
1000 2017-04-01 Dan Bernstein <mitz@apple.com>
1002 [iOS] <input type=file> label should be specified using plural rules
1003 https://bugs.webkit.org/show_bug.cgi?id=170388
1005 Reviewed by Alexey Proskuryakov.
1007 * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1009 * English.lproj/Localizable.stringsdict: Added an entry for the new key "%lu photo(s) and
1010 %lu video(s)", with plural rules covering all the different combinations in English.
1011 Other localizations may specify additional combinations as needed.
1013 2017-04-01 Alexey Proskuryakov <ap@apple.com>
1015 Rolling back <https://trac.webkit.org/r214697>, as it made WebKit2.DataDetectionReferenceDate time out.
1017 Was REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1018 https://bugs.webkit.org/show_bug.cgi?id=170365
1020 * editing/cocoa/DataDetection.mm:
1021 (WebCore::searchForLinkRemovingExistingDDLinks):
1023 2017-04-01 Chris Dumez <cdumez@apple.com>
1025 We should pause silent WebAudio rendering in background tabs
1026 https://bugs.webkit.org/show_bug.cgi?id=170299
1027 <rdar://problem/31289132>
1029 Reviewed by Eric Carlson.
1031 We should pause silent WebAudio rendering in background tabs since it uses CPU and is
1032 not observable by the user. Such silent WebAudio rendering seems to be used by
1035 Test: webaudio/silent-audio-interrupted-in-background.html
1037 * Modules/webaudio/AudioContext.cpp:
1038 (WebCore::AudioContext::lazyInitialize):
1039 (WebCore::AudioContext::uninitialize):
1040 Have AudioContext register / unregister itself with the Document to get
1041 visibility change notifications, similarly to what HTMLMediaElement was
1044 (WebCore::AudioContext::visibilityStateChanged):
1045 Begin / End session interruption whenever the page visiblity changes.
1047 * Modules/webaudio/AudioContext.h:
1048 * WebCore.xcodeproj/project.pbxproj:
1051 (WebCore::Document::registerForVisibilityStateChangedCallbacks):
1052 (WebCore::Document::unregisterForVisibilityStateChangedCallbacks):
1053 (WebCore::Document::visibilityStateChanged):
1056 * dom/VisibilityChangeClient.h: Added.
1057 (WebCore::VisibilityChangeClient::~VisibilityChangeClient):
1058 * html/HTMLMediaElement.h:
1059 Introduce a new VisibilityChangeClient interface and have both AudioContext
1060 and HTMLMediaElement subclass it. Previously, the visibilityStateChanged()
1061 function was on Element but this prevented AudioContext from registering
1062 itself since AudioContext is not an Element.
1064 2017-04-01 Dan Bernstein <mitz@apple.com>
1066 [Cocoa] A couple of UI strings use three periods instead of an ellipsis
1067 https://bugs.webkit.org/show_bug.cgi?id=170386
1069 Reviewed by Tim Horton.
1071 * English.lproj/Localizable.strings: Updated using update-webkit-localizable-strings.
1073 * platform/LocalizedStrings.cpp:
1074 (WebCore::mediaElementLoadingStateText): Changed "Loading..." to "Loading…".
1076 * platform/cocoa/LocalizedStringsCocoa.mm:
1077 (WebCore::contextMenuItemTagStyles): Changed "Styles..." to "Styles…".
1079 2017-04-01 Dan Bernstein <mitz@apple.com>
1081 Localizable strings files are out of date
1082 https://bugs.webkit.org/show_bug.cgi?id=170383
1084 Reviewed by Tim Horton.
1086 Ran update-webkit-localizable-strings.
1088 * English.lproj/Localizable.strings:
1090 2017-04-01 Dan Bernstein <mitz@apple.com>
1092 [Xcode] In engineering builds, linker warns about libwebrtc.dylib’s install name being invalid
1093 https://bugs.webkit.org/show_bug.cgi?id=170385
1095 Reviewed by Tim Horton.
1097 * Configurations/DebugRelease.xcconfig: Set WK_RELOCATABLE_FRAMEWORKS to YES like we do
1098 in some other projects’ DebugRelease.xcconfig. Engineering builds are always relocatable.
1099 * Configurations/WebCore.xcconfig: When WebCore is relocatable, tell the linker that it’s
1100 not going to be in the shared cache, even if its install name implies that it might be.
1102 2017-04-01 Alexey Proskuryakov <ap@apple.com>
1104 Rolling back http://trac.webkit.org/r214663 - memory corruption
1106 * Modules/streams/ReadableByteStreamInternals.js:
1108 * bindings/js/JSDOMGlobalObject.cpp:
1109 (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1110 * bindings/js/StructuredClone.cpp:
1111 (WebCore::structuredCloneArrayBuffer):
1112 (WebCore::cloneArrayBufferImpl): Deleted.
1113 (WebCore::cloneArrayBuffer): Deleted.
1114 * bindings/js/StructuredClone.h:
1115 * bindings/js/WebCoreBuiltinNames.h:
1116 * testing/Internals.cpp:
1117 (WebCore::markerTypeFrom):
1118 (WebCore::Internals::resetToConsistentState):
1119 (WebCore::Internals::isLoadingFromMemoryCache):
1120 (WebCore::Internals::setImageFrameDecodingDuration):
1121 (WebCore::deferredStyleRulesCountForList):
1122 (WebCore::deferredGroupRulesCountForList):
1123 (WebCore::deferredKeyframesRulesCountForList):
1124 (WebCore::Internals::eventThrottlingBehaviorOverride):
1125 (WebCore::Internals::enableMockSpeechSynthesizer):
1126 (WebCore::Internals::rangeForDictionaryLookupAtLocation):
1127 (WebCore::Internals::nodesFromRect):
1128 (WebCore::Internals::layerIDForElement):
1129 (WebCore::Internals::setElementUsesDisplayListDrawing):
1130 (WebCore::Internals::setElementTracksDisplayListReplay):
1131 (WebCore::Internals::styleRecalcCount):
1132 (WebCore::Internals::compositingUpdateCount):
1133 (WebCore::Internals::setCaptionDisplayMode):
1134 (WebCore::Internals::endMediaSessionInterruption):
1135 (WebCore::Internals::postRemoteControlCommand):
1136 (WebCore::appendOffsets):
1137 (WebCore::Internals::scrollSnapOffsets):
1138 (WebCore::Internals::setShowAllPlugins):
1139 (WebCore::Internals::cloneArrayBuffer): Deleted.
1140 * testing/Internals.h:
1141 * testing/Internals.idl:
1143 2017-03-31 Zalan Bujtas <zalan@apple.com>
1145 <table>: Including <caption>, <thead> or <tbody> causes clipping across page breaks
1146 https://bugs.webkit.org/show_bug.cgi?id=170348
1147 <rdar://problem/24727151>
1149 Reviewed by David Hyatt.
1151 1. In RenderFlowThread::offsetFromLogicalTopOfFirstRegion() we need to take table section offset into account (they are skipped
1152 during the containing block traversal).
1153 2. Trigger paginated relayout when body is moved vertically due to caption/thead etc.
1155 Test: fast/multicol/table-section-page-break.html
1157 * rendering/RenderFlowThread.cpp:
1158 (WebCore::RenderFlowThread::offsetFromLogicalTopOfFirstRegion):
1159 * rendering/RenderTable.cpp:
1160 (WebCore::RenderTable::layout):
1162 2017-03-31 Simon Fraser <simon.fraser@apple.com>
1164 Rename DOMWindow's m_touchEventListenerCount to m_touchAndGestureEventListenerCount
1165 https://bugs.webkit.org/show_bug.cgi?id=170371
1167 Reviewed by Tim Horton.
1169 This count tracks touch and gesture event listeners, so name it appropriately.
1171 * page/DOMWindow.cpp:
1172 (WebCore::DOMWindow::addEventListener):
1173 (WebCore::DOMWindow::removeEventListener):
1174 (WebCore::DOMWindow::removeAllEventListeners):
1177 2017-03-31 Simon Fraser <simon.fraser@apple.com>
1179 When destroying a Node, assert that it's been removed from all the touch handler maps
1180 https://bugs.webkit.org/show_bug.cgi?id=170363
1181 rdar://problem/31377469
1183 Reviewed by Tim Horton.
1185 Assert that the Node has been removed from the touch handler maps in all documents on destruction.
1188 (WebCore::Document::hasTouchEventHandlers):
1189 (WebCore::Document::touchEventTargetsContain):
1191 (WebCore::Node::~Node):
1193 2017-03-31 Alexey Proskuryakov <ap@apple.com>
1195 Rolling back https://trac.webkit.org/r214689, as it caused many crashes.
1198 Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1199 https://bugs.webkit.org/show_bug.cgi?id=170357
1201 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1202 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1204 2017-03-31 Youenn Fablet <youenn@apple.com>
1206 Fix memory leak in RealtimeVideoIncomingSource
1207 https://bugs.webkit.org/show_bug.cgi?id=170356
1209 Reviewed by Eric Carlson.
1211 No change of behavior.
1213 * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1214 (WebCore::RealtimeIncomingVideoSource::OnFrame): Adopting the newly created pointer.
1216 2017-03-31 Andy Estes <aestes@apple.com>
1218 REGRESSION (r202472): Data Detection overwrites existing links in detected ranges
1219 https://bugs.webkit.org/show_bug.cgi?id=170365
1220 <rdar://problem/29205721>
1222 Reviewed by Tim Horton.
1224 r202472 changed the node traversal in searchForLinkRemovingExistingDDLinks() to only
1225 consider nodes that are descendants of startNode, but we need to traverse all nodes between
1226 startNode and endNode to find existing non-DD links.
1228 As a result, we'd add a Data Detector link to the following snippet and make the original
1231 <a href='#'>tomorrow</a> <a href='#'>night</a>
1233 Fix this by not specifying a stayWithin node when calling NodeTraversal::next(). The loop
1234 will terminate when we reach endNode.
1236 Updated WebKit2.DataDetectionReferenceDate API test.
1238 * editing/cocoa/DataDetection.mm:
1239 (WebCore::searchForLinkRemovingExistingDDLinks):
1241 2017-03-31 Eric Carlson <eric.carlson@apple.com>
1243 Incoming video source doesn't propogate frame rotation
1244 https://bugs.webkit.org/show_bug.cgi?id=170364
1246 Reviewed by Youenn Fablet.
1248 No new tests, the mock video source doesn't support rotation. Test will be added when
1249 this is fixed in https://bugs.webkit.org/show_bug.cgi?id=169822. The changes were
1252 * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1253 (WebCore::RealtimeIncomingVideoSource::OnFrame): Convert frame rotation to sample
1254 orientation and swap width and height when necessary.
1255 (WebCore::RealtimeIncomingVideoSource::processNewSample):
1256 * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
1258 2017-03-31 Chris Dumez <cdumez@apple.com>
1260 Possible null dereference under SourceBuffer::sourceBufferPrivateDidReceiveSample()
1261 https://bugs.webkit.org/show_bug.cgi?id=159639
1263 Reviewed by Eric Carlson.
1265 Add a null check for trackBuffer.description before dereferencing as it seems
1268 * Modules/mediasource/SourceBuffer.cpp:
1269 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1271 2017-03-31 Youenn Fablet <youenn@apple.com>
1273 Fix memory leak in CreateSessionDescriptionObserver::OnSuccess
1274 https://bugs.webkit.org/show_bug.cgi?id=170357
1276 Reviewed by Geoffrey Garen.
1278 No change of behavior.
1280 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1281 (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded): Adopting the raw pointer parameter.
1283 2017-03-31 Fujii Hironori <Hironori.Fujii@sony.com>
1285 [WinCairo] WebCore::PlatformDisplay::terminateEGLDisplay causes a crash in libGLESv2.dll while processing atexit
1286 https://bugs.webkit.org/show_bug.cgi?id=170331
1288 Reviewed by Michael Catanzaro.
1290 WebCore::PlatformDisplay uses atexit to destruct EGL displays
1291 while exiting process. But, when the atexit will be processed,
1292 heap of libGLESv2.dll would be already destructed and causing a
1293 crash on Windows. Do not use atexit for Windows.
1295 AppleWin port does not use PlatformDisplay. Thus, it does not have
1298 * platform/graphics/PlatformDisplay.cpp:
1299 (WebCore::PlatformDisplay::initializeEGLDisplay): Do not use atexit for Windows.
1300 (WebCore::PlatformDisplay::shutDownEglDisplays): Added.
1301 * platform/graphics/PlatformDisplay.h: Added a declaration of shutDownEglDisplays.
1303 2017-03-31 Yoav Weiss <yoav@yoav.ws>
1305 Remove PRELOAD_DEBUG related code.
1306 https://bugs.webkit.org/show_bug.cgi?id=170352
1308 Reviewed by Youenn Fablet.
1310 As the PRELOAD_DEBUG related code stopped building and it seems like no one noticed,
1311 it seems safe to assume that we can remove that code. This patch removes it.
1313 No new tests as there's no functional change.
1315 * loader/cache/CachedResourceLoader.cpp:
1316 (WebCore::CachedResourceLoader::preload):
1317 (WebCore::CachedResourceLoader::clearPreloads):
1318 (WebCore::CachedResourceLoader::printPreloadStats): Deleted.
1320 2017-03-31 Brady Eidson <beidson@apple.com>
1322 Clean up the "StorageType" enum.
1323 https://bugs.webkit.org/show_bug.cgi?id=170349
1325 Reviewed by Tim Horton.
1327 - Make this `enum` into an `enum class`
1328 - Add a new type specific for "transient local storage"
1330 No new tests (No behavior change).
1332 * WebCore.xcodeproj/project.pbxproj:
1334 * inspector/InspectorDOMStorageAgent.cpp:
1335 (WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
1337 * inspector/InspectorInstrumentation.h:
1339 * loader/EmptyClients.cpp:
1341 * storage/Storage.cpp:
1342 (WebCore::Storage::isDisabledByPrivateBrowsing):
1344 * storage/StorageArea.h:
1347 * storage/StorageEventDispatcher.cpp:
1348 (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1349 (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1351 * storage/StorageType.h:
1352 (WebCore::isLocalStorage):
1354 2017-03-31 Chris Dumez <cdumez@apple.com>
1356 Unreviewed, Mark "HTML interactive form validation" as done.
1358 It is shipping in Safari 10.1.
1362 2017-03-31 Csaba Osztrogonác <ossy@webkit.org>
1364 Mac cmake buildfix after r214666
1365 https://bugs.webkit.org/show_bug.cgi?id=170342
1367 Unreviewed buildfix.
1369 * PlatformMac.cmake:
1370 * testing/MockPreviewLoaderClient.h:
1372 2017-03-31 Sam Weinig <sam@webkit.org>
1374 Remove unneeded custom constructors include.
1376 * WebCore.xcodeproj/project.pbxproj:
1377 * bindings/js/ios: Removed.
1378 * bindings/js/ios/TouchConstructors.cpp: Removed.
1380 2017-03-31 John Wilander <wilander@apple.com>
1382 Resource Load Statistics: Check if the store exists before clearing it
1383 https://bugs.webkit.org/show_bug.cgi?id=170324
1384 <rdar://problem/31258505>
1386 Reviewed by Brent Fulgham.
1388 No new tests. Added a null check.
1390 * loader/ResourceLoadObserver.cpp:
1391 (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1394 2017-03-31 Romain Bellessort <romain.bellessort@crf.canon.fr>
1396 [Readable Streams API] Implement cloneArrayBuffer in WebCore
1397 https://bugs.webkit.org/show_bug.cgi?id=170008
1399 Reviewed by Youenn Fablet.
1401 Implemented cloneArrayBuffer based on existing structuredCloneArrayBuffer
1402 implementation. The code has been factorized so that both cloneArrayBuffer
1403 and structuredCloneArrayBuffer rely on the same code (which is basically
1404 the previous implementation of structuredCloneArrayBuffer + the ability
1405 to clone only a part of considered buffer).
1407 Added test to check cloneArrayBuffer behaviour.
1409 * Modules/streams/ReadableByteStreamInternals.js: Deleted cloneArrayBuffer JS implementation.
1410 * bindings/js/JSDOMGlobalObject.cpp:
1411 (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Add cloneArrayBuffer private declaration.
1412 * bindings/js/StructuredClone.cpp:
1413 (WebCore::cloneArrayBufferImpl): Added (mostly based on previous structuredCloneArrayBuffer).
1414 (WebCore::cloneArrayBuffer): Added.
1415 (WebCore::structuredCloneArrayBuffer): Updated.
1416 * bindings/js/StructuredClone.h: Added cloneArrayBuffer declaration.
1417 * bindings/js/WebCoreBuiltinNames.h: Added cloneArrayBuffer declaration.
1418 * testing/Internals.cpp: Added support for testing cloneArrayBuffer.
1419 * testing/Internals.h: Added support for testing cloneArrayBuffer.
1420 * testing/Internals.idl: Added support for testing cloneArrayBuffer.
1422 2017-03-31 Antoine Quint <graouts@apple.com>
1424 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1425 https://bugs.webkit.org/show_bug.cgi?id=168409
1426 <rdar://problem/30799198>
1428 Unreviewed. Yet more logging to determine under what circumstance ScriptedAnimationController gets suspended.
1431 (WebCore::Document::requestAnimationFrame):
1433 2017-03-30 Zan Dobersek <zdobersek@igalia.com>
1435 Unreviewed GTK+ build fix. Add missing ANGLE build targets
1440 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1442 Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
1443 https://bugs.webkit.org/show_bug.cgi?id=170323
1444 rdar://problem/23647630
1446 Reviewed by Chris Dumez.
1448 There are two instances where nodes are registered as touch event handlers without
1449 having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
1452 For such nodes, hasEventTargetData() will be false, but we want to ensure
1453 that they are removed from the Document's touchEventHandler set, so move the
1454 call to document.removeTouchEventHandler() outside of the conditional block.
1456 This should be cheap in most cases when the touchEventHandler is empty.
1459 (WebCore::Node::willBeDeletedFrom):
1461 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1463 Minor cleanup checking for gesture event names
1464 https://bugs.webkit.org/show_bug.cgi?id=170319
1466 Reviewed by Tim Horton.
1468 Just use isGestureEventType() in a couple of places.
1471 (WebCore::tryAddEventListener):
1472 (WebCore::tryRemoveEventListener):
1474 2017-03-30 Simon Fraser <simon.fraser@apple.com>
1476 Rename a touch event function, and new touch region test results
1477 https://bugs.webkit.org/show_bug.cgi?id=170309
1478 rdar://problem/31329520
1480 Reviewed by Chris Dumez.
1482 Adapt to a naming change in WebKitAdditions.
1485 (WebCore::Document::removeAllEventListeners):
1486 * page/FrameView.cpp:
1487 (WebCore::FrameView::layout):
1488 * rendering/RenderElement.cpp:
1489 (WebCore::RenderElement::styleWillChange):
1490 * rendering/RenderLayer.cpp:
1491 (WebCore::RenderLayer::scrollTo):
1492 (WebCore::RenderLayer::calculateClipRects):
1494 2017-03-30 Matt Rajca <mrajca@apple.com>
1496 YouTube sometimes does not respect "user gesture" restriction for videos.
1497 https://bugs.webkit.org/show_bug.cgi?id=170297
1499 I discovered a code path that does not honor the "user gesture" requirement and playback is able to begin
1500 even though we have a restriction in place. When using Media Source Extensions, which YouTube does, we transition
1501 from a "Have Metadata" to a "Future Data" state that causes playback to begin, however, we never check
1502 if we have a playback restriction in place.
1504 Reviewed by Eric Carlson.
1506 * html/HTMLMediaElement.cpp:
1507 (WebCore::HTMLMediaElement::setReadyState):
1509 2017-03-30 Said Abou-Hallawa <sabouhallawa@apple.com>
1511 REGRESSION (r213764): Background image from sprite sheet incorrectly scaled
1512 https://bugs.webkit.org/show_bug.cgi?id=169547
1514 Reviewed by Simon Fraser.
1516 The bug happens when drawing only a rectangle of an image not the whole
1517 image. In BitmapImage::draw(), sizeForDrawing was calculated as the destRect
1518 scaled by the transformation which is applied to the GraphicsContext. Two
1519 problems with this approach. The first one is destRect can be only part of
1520 the image. The second problem is, the ratio destRect / srcRect is another
1521 scaling that needs to be considered.
1523 To fix this issue, first the base size has to be size of the image and not
1524 destRect.size(). Secondly, we need to scale this base size with the context
1525 transformation multiplied by the ratio destRect / srcRect. This scaling is
1526 exactly the same scaling which is calculated in subsamplingScale(). Finally
1527 we use this scaled size as the sizeForDrawing to send to the ImageDecoder.
1529 Test: fast/images/sprite-sheet-image-draw.html
1531 * platform/graphics/BitmapImage.cpp:
1532 (WebCore::BitmapImage::draw): Fix the bug.
1533 (WebCore::BitmapImage::stopAnimation): Stops the async image decoding for animated images only.
1534 The decoding for large images will be stopped when BitmapImage::newFrameNativeImageAvailableAtIndex()
1535 is called and the decoding queue is idle.
1536 (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex): Add image logging.
1537 * platform/graphics/BitmapImage.h: Move sourceURL() to the Image class.
1538 * platform/graphics/GraphicsContext.cpp: Pass imagePaintingOptions.m_decodingMode to Image::drawTiled().
1539 (WebCore::GraphicsContext::drawTiledImage): Pass imagePaintingOptions.m_decodingMode) to Image::drawTiled().
1540 * platform/graphics/Image.cpp:
1541 (WebCore::Image::sourceURL): Moved from BitmapImage.
1542 (WebCore::Image::drawTiled): Add a DecodingMode argument instead of calling always with DecodingMode::Synchronous.
1543 * platform/graphics/Image.h:
1544 * platform/graphics/ImageFrameCache.cpp:
1545 (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Add image logging.
1546 (WebCore::ImageFrameCache::startAsyncDecodingQueue): Ditto,
1547 (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Ditto.
1548 (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Ditto.
1549 (WebCore::ImageFrameCache::sourceURL): A helper function to avoid checking the value of m_image.
1550 * platform/graphics/ImageFrameCache.h:
1551 * platform/graphics/NativeImage.h: Rename subsamplingScale() to nativeImageDrawingScale() and return image scaling instead.
1552 * platform/graphics/cairo/NativeImageCairo.cpp:
1553 (WebCore::nativeImageDrawingScale): Ditto.
1554 (WebCore::subsamplingScale): Deleted.
1555 * platform/graphics/cg/NativeImageCG.cpp:
1556 (WebCore::nativeImageDrawingScale): Ditto.
1557 (WebCore::subsamplingScale): Deleted.
1558 * platform/graphics/win/NativeImageDirect2D.cpp:
1559 (WebCore::nativeImageDrawingScale): Ditto.
1560 (WebCore::subsamplingScale): Deleted.
1562 2017-03-30 Matt Baker <mattbaker@apple.com>
1564 Web Inspector: Assertion failure in InspectorStyleProperty::setRawTextFromStyleDeclaration
1565 https://bugs.webkit.org/show_bug.cgi?id=170279
1566 <rdar://problem/30200492>
1568 Reviewed by David Hyatt.
1570 The SourceRange for a CSSPropertySourceData should be relative to the start
1571 of the declaration body, not the start of the StyleSheetHandler’s parsed
1572 text. This only affected the ranges of unparsed (parsedOK == false) properties
1573 lacking a trailing semi-colon.
1575 This patch doesn't change the behavior of InspectorStyleSheet other than
1576 silencing an irksome assert, as String::substring does a safety check on
1577 the passed in length.
1579 * inspector/InspectorStyleSheet.cpp:
1580 (WebCore::fixUnparsedProperties):
1582 2017-03-30 Youenn Fablet <youenn@apple.com> and Jon Lee <jonlee@apple.com>
1584 Clean up RTCDataChannel
1585 https://bugs.webkit.org/show_bug.cgi?id=169732
1587 Reviewed by Chris Dumez.
1589 Test: webrtc/datachannel/datachannel-event.html
1590 webrtc/datachannel/bufferedAmountLowThreshold.html
1592 Making RTCDataChannel interface closer to the spec updating implementation accordingly.
1593 See https://w3c.github.io/webrtc-pc/#rtcdatachannel.
1594 In particular adding RTCDataChannelEvent constructor, and missing bufferedAmount related attributes.
1595 Doing some additional cleaning refactoring.
1597 Making bufferedAmountIsDecreasing take a bufferedAmount argument so that we get the actual value passed by
1598 libwebrtc without needing to get it from the libwebrtc network thread again.
1599 In the future, we should store the bufferedAmount value in RTCDataChannel and update its value on each libwebrtc
1600 OnBufferedAmountChange. Special treatment may be needed when the data channel is closed, in which case the bufferedAmount should just be
1601 updated to increase in the send method.
1603 Added some FIXMEs as RTCDataChannel is not aligned with the spec related to send and bufferedAmount.
1605 * Modules/mediastream/RTCDataChannel.cpp:
1606 (WebCore::RTCDataChannel::send):
1607 (WebCore::RTCDataChannel::close):
1608 (WebCore::RTCDataChannel::didChangeReadyState):
1609 (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
1610 * Modules/mediastream/RTCDataChannel.h:
1611 * Modules/mediastream/RTCDataChannel.idl:
1612 * Modules/mediastream/RTCDataChannelEvent.cpp:
1613 (WebCore::RTCDataChannelEvent::create):
1614 (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
1615 (WebCore::RTCDataChannelEvent::channel):
1616 * Modules/mediastream/RTCDataChannelEvent.h:
1617 * Modules/mediastream/RTCDataChannelEvent.idl:
1618 * Modules/mediastream/RTCPeerConnection.idl:
1619 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1620 (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
1621 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1622 (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
1623 * WebCore.xcodeproj/project.pbxproj:
1625 * platform/mediastream/RTCDataChannelHandler.h:
1626 * platform/mediastream/RTCDataChannelHandlerClient.h:
1627 * platform/mediastream/RTCDataChannelState.h: Added.
1628 * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1629 * platform/mock/RTCDataChannelHandlerMock.cpp:
1630 (WebCore::RTCDataChannelHandlerMock::setClient):
1631 (WebCore::RTCDataChannelHandlerMock::close):
1632 * platform/mock/RTCNotifiersMock.cpp:
1633 (WebCore::IceConnectionNotifier::IceConnectionNotifier):
1634 (WebCore::SignalingStateNotifier::SignalingStateNotifier):
1635 (WebCore::DataChannelStateNotifier::DataChannelStateNotifier):
1636 * platform/mock/RTCNotifiersMock.h:
1638 2017-03-30 Javier Fernandez <jfernandez@igalia.com>
1640 [css-align] Adapt content-alignment properties to the new baseline syntax
1641 https://bugs.webkit.org/show_bug.cgi?id=170262
1643 Reviewed by David Hyatt.
1645 The baseline-position syntax has changed recently, so we need to update
1646 the CSS properties using the old syntax. This patch address only the
1647 content-alignment (align-content and justify-content).
1649 I used this patch to adapt the implementation of the parsing logic for
1650 these properties to the new Blink's CSS Parsing Design.
1652 The new baseline syntax is "[first | last ]? baseline" which implies
1653 modifying the parsing and computed value logic.
1655 There are several layout tests affected by this change, so I'll update
1658 No new tests, just added/modified some cases to the tests we
1659 already have using the new baseline values.
1661 * css/CSSComputedStyleDeclaration.cpp:
1662 (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1663 * css/CSSContentDistributionValue.cpp:
1664 (WebCore::CSSContentDistributionValue::customCSSText):
1665 * css/CSSPrimitiveValueMappings.h:
1666 (WebCore::CSSPrimitiveValue::operator ItemPosition):
1667 (WebCore::CSSPrimitiveValue::operator ContentPosition):
1668 * css/CSSValueKeywords.in:
1669 * css/parser/CSSPropertyParser.cpp:
1670 (WebCore::isBaselineKeyword):
1671 (WebCore::consumeBaselineKeyword):
1672 (WebCore::consumeContentDistributionOverflowPosition):
1673 (WebCore::consumeSelfPositionOverflowPosition):
1675 2017-03-30 James Craig <jcraig@apple.com>
1677 AX: Expose a new AXSubrole for explicit ARIA "group" role
1678 https://bugs.webkit.org/show_bug.cgi?id=169810
1679 <rdar://problem/31039693>
1681 Reviewed by Chris Fleizach.
1683 Split GroupRole into generics (GroupRole) and explicit groups
1684 (ApplicationGroupRole) so we can expose a subrole on the explicit
1685 groups. Account for the change in ARIA Tree and Menu hierachies.
1686 Update the computedRoleValue for WebKit Inspector usage, too.
1688 Updated existing tests.
1690 Test: accessibility/list-detection2.html:
1691 Test: accessibility/roles-computedRoleString.html:
1692 Test: inspector/dom/getAccessibilityPropertiesForNode.html:
1693 Test: inspector/dom/highlightFrame.html:
1694 Test: inspector/dom/highlightSelector.html:
1696 * accessibility/AccessibilityNodeObject.cpp:
1697 (WebCore::AccessibilityNodeObject::helpText):
1698 (WebCore::AccessibilityNodeObject::hierarchicalLevel):
1699 (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent):
1700 * accessibility/AccessibilityObject.cpp:
1701 (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
1702 (WebCore::AccessibilityObject::ariaTreeItemContent):
1703 (WebCore::initializeRoleMap):
1704 (WebCore::AccessibilityObject::computedRoleString):
1705 * accessibility/AccessibilityObject.h:
1706 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1708 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1709 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
1710 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1711 (createAccessibilityRoleMap):
1712 (-[WebAccessibilityObjectWrapper subrole]):
1714 2017-03-30 Chris Dumez <cdumez@apple.com>
1716 We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com
1717 https://bugs.webkit.org/show_bug.cgi?id=170288
1718 <rdar://problem/31289132>
1720 Reviewed by Eric Carlson.
1722 We are spending a lot of time bzero'ing AudioChannel buffers on uni-watch.com due
1723 to doubleclick ads using WebAudio with a 0-gain GainNode. We should optimize the
1724 0-gain case as much as possible.
1726 No new tests, only an optimization.
1728 * Modules/webaudio/AudioNode.cpp:
1729 (WebCore::AudioNode::processIfNecessary):
1730 Drop call to unsilenceOutputs() before calling AudioNode::process(). The AudioChannel
1731 API already takes care of clearing its 'silent' flag whenever its buffer changes so
1732 there should be no need to explicitly clearing the 'silent' flag before calling
1733 process(). This was causing us to zero out buffers that were already filled with
1734 zeros because AudioChannel::zero() would no longer return early, not knowing the
1735 channel is already silent. This reduces the number of bzero() calls by ~3.5x on
1736 uni-watch.com (from 100 calls every ~20ms to 100 calls every ~70ms.
1738 * Modules/webaudio/AudioNode.h:
1739 * platform/audio/mac/AudioDestinationMac.cpp:
1740 (WebCore::AudioDestinationMac::render):
1741 Avoid clamping the values in the channel buffer if the channel is silent since this
1742 will have no effect (given that the buffer only contains zeros).
1744 2017-03-30 Eric Carlson <eric.carlson@apple.com>
1746 [Crash] WebCore::AudioBuffer::AudioBuffer don't checking illegal value
1747 https://bugs.webkit.org/show_bug.cgi?id=169956
1749 Reviewed by Youenn Fablet.
1751 Test: webaudio/audiobuffer-crash.html
1753 * Modules/webaudio/AudioBuffer.cpp:
1754 (WebCore::AudioBuffer::AudioBuffer): Invalidate the object and return early if the channel
1755 array allocation fails.
1756 (WebCore::AudioBuffer::AudioBuffer): Ditto.
1757 (WebCore::AudioBuffer::invalidate): Invalidate the object.
1758 * Modules/webaudio/AudioBuffer.h:
1760 2017-03-30 Antoine Quint <graouts@apple.com>
1762 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1763 https://bugs.webkit.org/show_bug.cgi?id=168409
1764 <rdar://problem/30799198>
1766 Unreview. Print the backtrace when we suspend scripted animations.
1769 (WebCore::Page::suspendScriptedAnimations):
1771 2017-03-30 Antoine Quint <graouts@apple.com>
1773 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
1774 https://bugs.webkit.org/show_bug.cgi?id=168409
1775 <rdar://problem/30799198>
1777 Unreview. Pring the backtrace when we suspend ScriptedAnimationController.
1779 * dom/ScriptedAnimationController.cpp:
1780 (WebCore::ScriptedAnimationController::suspend):
1782 2017-03-30 Antoine Quint <graouts@apple.com>
1784 [Modern Media Controls] Invalid placard icon is not visible for short video
1785 https://bugs.webkit.org/show_bug.cgi?id=170277
1786 <rdar://problem/31327955>
1788 Reviewed by Eric Carlson.
1790 Make the minimum dimension needed to display a placard icon configurable and let the
1791 invalid placard use a 50pt dimension. We also make a drive-by fix to reset "text-align"
1792 for media controls as having a "text-align: center" inherited value would mess up
1793 positioning of the placard icon and make it flush to the right of the placard.
1795 Test: media/modern-media-controls/invalid-placard/invalid-placard-constrained-metrics.html
1797 * Modules/modern-media-controls/controls/invalid-placard.js:
1799 * Modules/modern-media-controls/controls/media-controls.css:
1801 * Modules/modern-media-controls/controls/placard.js:
1802 (Placard.prototype.layout):
1804 2017-03-30 Zan Dobersek <zdobersek@igalia.com>
1806 [GCrypt] Register missing algorithms in CryptoAlgorithmRegistry::platformRegisterAlgoritmhs()
1807 https://bugs.webkit.org/show_bug.cgi?id=170273
1809 Reviewed by Michael Catanzaro.
1811 * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
1812 (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1813 Add registerAlgorithm<> calls for AES_CFB, AES_GCM, ECDH and
1816 2017-03-30 Brent Fulgham <bfulgham@apple.com>
1818 Remove unused MediaControlsApple implementation
1819 https://bugs.webkit.org/show_bug.cgi?id=170258
1820 <rdar://problem/31331056>
1822 Reviewed by Eric Carlson.
1824 Remove dead code related to old media controls. We switched to HTML5-based media controls
1827 No new tests. Removing this dead code should have no change in behavior.
1829 * WebCore.xcodeproj/project.pbxproj: Remove unused files.
1830 * dom/EventListener.h: Remove unused event type.
1831 * html/shadow/MediaControlsApple.cpp: Removed.
1832 * html/shadow/MediaControlsApple.h: Removed.
1834 2017-03-30 Fujii Hironori <Hironori.Fujii@sony.com>
1836 [WinCairo] ImageCairoWin.cpp: error C2660: 'WebCore::BitmapImage::draw': function does not take 6 arguments
1837 https://bugs.webkit.org/show_bug.cgi?id=170275
1839 Reviewed by Said Abou-Hallawa.
1841 Apply the similar change of ImageCGWin.cpp of r214450 to ImageCairoWin.cpp.
1843 * platform/graphics/win/ImageCairoWin.cpp:
1844 (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
1845 (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
1847 2017-03-27 Sergio Villar Senin <svillar@igalia.com>
1849 [css-grid] Clamp the number of autorepeat tracks
1850 https://bugs.webkit.org/show_bug.cgi?id=170120
1852 Reviewed by Manuel Rego Casasnovas.
1854 As suggested by the specs we do clamp the maximum number of tracks per grid in order to
1855 minimize potential OOM situations. However we were not considering the case of the recently
1856 added auto repeat syntax. Abnormally huge values for the width/height on the grid container
1857 could lead to a number of auto repeat tracks higher than the maximum.
1859 A new API was added to Internals in order to test limits without having to create huge
1860 grids. This new API allows clients to set an arbitrary limit to the number of tracks. The
1861 addition of this new API forced us to add GridPosition.cpp to the project to define the
1862 global variable we use for testing. We took the chance to move part of the implementation
1863 from the header file to the source file.
1865 Last but not least, several new ASSERTs were added to Grid.cpp implementation to ensure that
1866 we do not surpass the grid track limits.
1868 Test: fast/css-grid-layout/grid-auto-repeat-huge-grid.html
1871 * WebCore.xcodeproj/project.pbxproj:
1872 * css/parser/CSSPropertyParser.cpp:
1873 (WebCore::consumeGridTrackRepeatFunction):
1874 * rendering/Grid.cpp:
1875 (WebCore::Grid::ensureGridSize): Added ASSERT.
1876 (WebCore::Grid::setSmallestTracksStart): Ditto.
1877 (WebCore::Grid::setAutoRepeatTracks): Ditto.
1878 (WebCore::Grid::setAutoRepeatEmptyColumns): Ditto.
1879 (WebCore::Grid::setAutoRepeatEmptyRows): Ditto.
1880 * rendering/RenderGrid.cpp:
1881 (WebCore::RenderGrid::clampAutoRepeatTracks): New method.
1882 (WebCore::RenderGrid::placeItemsOnGrid): Clamp the number of auto repeat tracks before
1883 passing them to the Grid.
1884 * rendering/RenderGrid.h:
1885 * rendering/style/GridArea.h:
1886 (WebCore::GridSpan::GridSpan):
1887 * rendering/style/GridPosition.cpp: Added.
1888 (WebCore::GridPosition::setExplicitPosition):
1889 (WebCore::GridPosition::setAutoPosition):
1890 (WebCore::GridPosition::setSpanPosition):
1891 (WebCore::GridPosition::setNamedGridArea):
1892 (WebCore::GridPosition::integerPosition):
1893 (WebCore::GridPosition::namedGridLine):
1894 (WebCore::GridPosition::spanPosition):
1895 (WebCore::GridPosition::operator==):
1896 * rendering/style/GridPosition.h:
1897 (WebCore::GridPosition::shouldBeResolvedAgainstOppositePosition):
1898 (WebCore::GridPosition::max):
1899 (WebCore::GridPosition::min):
1900 (WebCore::GridPosition::setMaxPositionForTesting):
1901 (WebCore::GridPosition::setExplicitPosition): Deleted.
1902 (WebCore::GridPosition::setAutoPosition): Deleted.
1903 (WebCore::GridPosition::setSpanPosition): Deleted.
1904 (WebCore::GridPosition::setNamedGridArea): Deleted.
1905 (WebCore::GridPosition::integerPosition): Deleted.
1906 (WebCore::GridPosition::namedGridLine): Deleted.
1907 (WebCore::GridPosition::spanPosition): Deleted.
1908 (WebCore::GridPosition::operator==): Deleted.
1909 * rendering/style/GridPositionsResolver.cpp:
1910 (WebCore::GridPositionsResolver::explicitGridColumnCount):
1911 (WebCore::GridPositionsResolver::explicitGridRowCount):
1912 * testing/Internals.cpp:
1913 (WebCore::Internals::setGridMaxTracksLimit):
1914 * testing/Internals.h:
1915 * testing/Internals.idl:
1917 2017-03-29 Ryosuke Niwa <rniwa@webkit.org>
1919 Disconnecting a HTMLObjectElement does not always unload its content document
1920 https://bugs.webkit.org/show_bug.cgi?id=169606
1922 Reviewed by Andy Estes.
1924 When removing a node, we first disconnect all subframes then update the focused element as we remove each child.
1925 However, when the removed element is a focused object element with a content document, removeFocusedNodeOfSubtree
1926 can update the style tree synchronously inside Document::setFocusedElement, and reload the document.
1928 Avoid this by instantiating a SubframeLoadingDisabler on the parent of the focused element.
1930 Test: fast/dom/removing-focused-object-element.html
1933 (WebCore::Document::removeFocusedNodeOfSubtree):
1935 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
1937 Migrate to kCTFontCSSWidthAttribute
1938 https://bugs.webkit.org/show_bug.cgi?id=170265
1940 Reviewed by Darin Adler.
1942 Previously, we were mapping from Core Text widths to CSS widths in WebKit.
1943 However, on some OSes, Core Text can directly tell us what the CSS width
1946 No new tests because there is no behavior change.
1948 * platform/graphics/cocoa/FontCacheCoreText.cpp:
1949 (WebCore::getCSSAttribute):
1950 (WebCore::capabilitiesForFontDescriptor):
1951 * platform/spi/cocoa/CoreTextSPI.h:
1953 2017-03-28 Simon Fraser <simon.fraser@apple.com>
1955 Make it possible to dump touch event regions for testing
1956 https://bugs.webkit.org/show_bug.cgi?id=170209
1957 <rdar://problem/31309258>
1959 Reviewed by Tim Horton.
1961 Expose internals.touchEventRectsForEvent() and internals.passiveTouchEventListenerRects(), which
1962 fetch data via Page.
1964 Because the regions are normally updated on a timer, we have to force an eager update via Document::updateTouchEventRegions().
1966 Test: fast/events/touch/ios/touch-event-regions.html
1969 (WebCore::Page::nonFastScrollableRects):
1970 (WebCore::Page::touchEventRectsForEvent):
1971 (WebCore::Page::passiveTouchEventListenerRects):
1973 * testing/Internals.cpp:
1974 (WebCore::Internals::touchEventRectsForEvent):
1975 (WebCore::Internals::passiveTouchEventListenerRects):
1976 * testing/Internals.h:
1977 * testing/Internals.idl:
1979 2017-03-29 Zalan Bujtas <zalan@apple.com>
1981 RenderBlockFlow::addFloatsToNewParent should check if float is already added to the object list.
1982 https://bugs.webkit.org/show_bug.cgi?id=170259
1983 <rdar://problem/31300584>
1985 Reviewed by Simon Fraser.
1987 r210145 assumed that m_floatingObjects would simply ignore the floating box if it was already in the list.
1989 Test: fast/block/float/placing-multiple-floats-crash.html
1991 * rendering/RenderBlockFlow.cpp:
1992 (WebCore::RenderBlockFlow::addFloatsToNewParent):
1994 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
1996 Try to normalize variation ranges
1997 https://bugs.webkit.org/show_bug.cgi?id=170119
2001 Addressing post-review comment.
2003 * platform/graphics/cocoa/FontCacheCoreText.cpp:
2004 (WebCore::isGXVariableFont):
2006 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
2008 Try to normalize variation ranges
2009 https://bugs.webkit.org/show_bug.cgi?id=170119
2011 Reviewed by Simon Fraser.
2013 TrueType GX-style variation fonts use one particular scale for values on their
2014 weight/width/slope axes - usually the values lie between -1 and 1 on that scale.
2015 However, OpenType 1.8-style fonts use the CSS scale for values on these axes.
2016 For the purposes of font selection, these values need to lie on the same scale.
2017 However, when font selection is completed and the variation values are actually
2018 being applied to the fonts, values which lie on the font's actual scale need to
2019 be applied. This patch adds normalize*() and denormalize*() functions to perform
2020 both of these operations.
2022 The conversion itself between the two scales isn't an exact mapping. Mapping
2023 slope is just a linear relationship with 0deg <=> 0 and 20deg <=> 1 (as per the
2024 CSS Fonts spec). Mapping widths is similar, it uses a 2-component piecewise
2025 linear relationship which includes the values given in the Microsoft OpenType
2026 spec for the OS/2 table's usWidthClass field. Weights are more difficult, so I
2027 plotted the CSS weights and the GX-style weights for every style of San
2028 Francisco, saw that the relationship appears to be linear, and ran a linear
2029 regression to compute the line equation.
2031 As for the actual discrimination of determining whether a font is a GX-style
2032 font or not, we can use the presence of the 'STAT' table. This table didn't
2033 exist when GX fonts were being created, and OpenType 1.8 variable fonts are
2034 required to have this table.
2036 Facebook uses the string ".SFNSText" in their @font-face blocks. This font is
2037 a variation font, but uses the GX-style values. Facebook asks us to create
2038 this font with a weight of 700, and because the values in the font are around
2039 1.0, we were erroneously thinking that the font wasn't bold, so we were then
2040 applying synthetic bold. This was causing text on facebook to look fuzzy and
2043 Test: fast/text/variations/font-selection-properties-expected.html
2045 * platform/graphics/cocoa/FontCacheCoreText.cpp:
2046 (WebCore::isGXVariableFont):
2047 (WebCore::normalizeWeight):
2048 (WebCore::normalizeSlope):
2049 (WebCore::denormalizeWeight):
2050 (WebCore::denormalizeWidth):
2051 (WebCore::denormalizeSlope):
2052 (WebCore::normalizeWidth):
2053 (WebCore::preparePlatformFont): Instead of using FontSelectionValues for the
2054 intermediate values, we should use floats instead. This is because
2055 FontSelectionValues are fixed-point numbers with the denominator having 2 bits.
2056 When using this data type to represent values on the GX scale, which are usually
2057 between 0 and 1, you lose a lot of fidelity. Instead, our intermediate
2058 calculations should be done with floats, and converted to FontSelectionValues at
2059 the end when they are representative of values on the CSS scale.
2060 (WebCore::stretchFromCoreTextTraits):
2061 (WebCore::fontWeightFromCoreText):
2062 (WebCore::extractVariationBounds):
2063 (WebCore::variationCapabilitiesForFontDescriptor):
2064 (WebCore::capabilitiesForFontDescriptor):
2066 2017-03-29 Saam Barati <sbarati@apple.com>
2068 LinkBuffer and ExecutableAllocator shouldn't have anything to do with VM
2069 https://bugs.webkit.org/show_bug.cgi?id=170210
2071 Reviewed by Mark Lam.
2073 * cssjit/SelectorCompiler.cpp:
2074 (WebCore::SelectorCompiler::compileSelector):
2075 (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2077 2017-03-29 Javier Fernandez <jfernandez@igalia.com>
2079 [css-align] Adapt self-alignment properties to the new baseline syntax
2080 https://bugs.webkit.org/show_bug.cgi?id=170235
2082 Reviewed by David Hyatt.
2084 The baseline-position syntax has changed recently, so we need to update
2085 the CSS properties using the old syntax. This patch address only the
2086 self-alignment (align-self and justify-self) and default-alignment
2087 (align-items and justify-items).
2089 The content-distribution properties (align-content and justify-content)
2090 will be updated in a follow up patch.
2092 The new baseline syntax is "[first | last ]? baseline" which implies
2093 modifying the parsing and computed value logic.
2095 There are several layout tests affected by this change, so I'll update
2098 No new tests, just added/modified some cases to the tests we already have using the new baseline values.
2100 * css/CSSComputedStyleDeclaration.cpp:
2101 (WebCore::valueForItemPositionWithOverflowAlignment):
2102 * css/CSSValueKeywords.in:
2103 * css/StyleBuilderConverter.h:
2104 (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2105 * css/parser/CSSPropertyParser.cpp:
2106 (WebCore::consumeBaselineKeyword):
2107 (WebCore::consumeSelfPositionOverflowPosition):
2109 2017-03-29 Chris Dumez <cdumez@apple.com>
2111 Animated SVG images are not paused in pages loaded in the background
2112 https://bugs.webkit.org/show_bug.cgi?id=170043
2113 <rdar://problem/31234412>
2115 Reviewed by Simon Fraser.
2117 Animated SVG images are not paused in pages loaded in the background. We rely
2118 on FrameView::isOffscreen() to stop images animations in background tab (See
2119 logic in RenderElement's shouldRepaintForImageAnimation()). This works fine
2120 if a tab is visble and then becomes hidden (i.e. by switching to another
2121 tab). However, in the case where the tab gets loaded while in the background
2122 (e.g. opening link in new background tab, or session restore), then the
2123 animations would not be paused, due to FrameView::isOffscreen() erroneously
2124 returning false in this case.
2126 Normally, the following chain of events happens:
2127 - Page is visible, we construct a main frame and its FrameView for loading
2128 the page. When a FrameView is constructed, we call FrameView::show() to
2129 make it visible. Then, if the page becomes non-visible, we call
2130 Page::setIsVisibleInternal(false) which calls FrameView::hide(). After
2131 that, FrameView::isOffscreen() correctly returns true because we properly
2132 called FrameView::hide().
2134 However, when doing a load while the Page is hidden, the following was
2136 - Page is not visible, we call Page::setIsVisibleInternal(false) which tries
2137 to call FrameView::hide() for the main frame but it does not have a FrameView
2138 yet (because the load has not started). We start the load and end up creating
2139 a FrameView. The FrameView constructor was calling FrameView::show()
2140 unconditionally, thus making the FrameView think is visible, even though its
2141 page isn't. At this point, FrameView::isOffscreen() was returning false
2142 and animations would keep running, even though the page is not visible.
2144 To address the issue, we now call FrameView::show() in FrameView::create() only
2145 if the Page is actually visible, instead of calling it unconditionally. If the
2146 page ever becomes visible, Page::setIsVisibleInternal(true) will be called and
2147 it will take care of calling FrameView::show() then.
2149 Tests: svg/animations/animations-paused-in-background-page-iframe.html
2150 svg/animations/animations-paused-in-background-page.html
2152 * page/FrameView.cpp:
2153 (WebCore::FrameView::create):
2155 2017-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
2157 Links with empty hrefs should not be drag sources
2158 https://bugs.webkit.org/show_bug.cgi?id=170241
2159 <rdar://problem/31305505>
2161 Reviewed by Tim Horton.
2163 The m_dragSouceAction member of DragController represents the drag source actions that are available to the
2164 document, rather than the available actions given the dragging element. Thus, it is not correct to only check
2165 that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
2166 This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
2169 New API test (see Tools/ChangeLog).
2171 * page/DragController.cpp:
2172 (WebCore::DragController::startDrag):
2174 2017-03-29 Jeremy Jones <jeremyj@apple.com>
2176 WebVideoFullscreenInterfaceAVKit needs a strong self ref before dispatching to the main thread.
2177 https://bugs.webkit.org/show_bug.cgi?id=170129
2179 Reviewed by David Kilzer.
2181 No new tests becuase no new behavior.
2183 Hold a strong reference to WebVideoFullscreenInterfaceAVKit when dispatching to the main thread.
2184 Make WebVideoFullscreenInterfaceAVKit safe to retain from non-main thread.
2186 * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2187 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2188 (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
2190 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2192 [GCrypt] Add a Handle<> class to help with GCrypt object lifetime control
2193 https://bugs.webkit.org/show_bug.cgi?id=170238
2195 Reviewed by Michael Catanzaro.
2197 The platform-specific CryptoAlgorithmHMAC implementation is modified
2198 to showcase the GCrypt::Handle<> use. HandleDeleter<gcry_mac_hd_t>
2199 is added accordingly.
2201 * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
2202 (WebCore::calculateSignature):
2204 2017-03-29 Myles C. Maxfield <mmaxfield@apple.com>
2206 Variation fonts: Make sure that feature detection and preprocessor macros are right
2207 https://bugs.webkit.org/show_bug.cgi?id=169518
2209 Reviewed by Simon Fraser.
2211 When I added variable fonts support, I made all OSes parse the newly accepted values,
2212 instead of just the OSes which support variable fonts.
2214 Test: fast/text/font-variations-feature-detection.html
2216 * css/parser/CSSPropertyParser.cpp:
2217 (WebCore::consumeFontStretch):
2218 (WebCore::consumeFontStyle):
2219 * css/parser/CSSPropertyParserHelpers.cpp:
2220 (WebCore::CSSPropertyParserHelpers::divisibleBy100):
2221 (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
2223 2017-03-29 Antoine Quint <graouts@apple.com>
2225 [Modern Media Controls] Controls bar may disappear while captions menu is visible (redux)
2226 https://bugs.webkit.org/show_bug.cgi?id=170239
2227 <rdar://problem/31320685>
2229 Reviewed by Dean Jackson.
2231 We did some work in webkit.org/b/168751 to prevent the controls bar from disappearing while the
2232 captions menu is visible. But there were two cases where the behavior was not as intended:
2234 1. the controls bar would hide upon exiting the video.
2235 2. clicking on the controls bar while the caption panel is up would hide the controls bar
2236 as well as the captions panel.
2238 Instead of determining that the "userInteractionEnabled" property being set to "false" is indicative
2239 of secondary UI, such as the tracks panel, being attached to the controls bar, we now have an
2240 explicit property to specify this. Now, when "hasSecondaryUIAttached" is "true", we prevent the
2241 controls bar from fading when exiting the media.
2243 Additionally, when dismissing the tracks panel, we check whether a mouse event lead to this and check
2244 if the mouse was positioned over the controls bar. If that is the case, we no longer hide the controls
2245 bar and only dismiss the tracks panel.
2247 Test: media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html
2249 * Modules/modern-media-controls/controls/controls-bar.js:
2250 (ControlsBar.prototype.set userInteractionEnabled):
2251 (ControlsBar.prototype.handleEvent):
2252 (ControlsBar.prototype._autoHideTimerFired):
2253 * Modules/modern-media-controls/controls/macos-media-controls.js:
2254 (MacOSMediaControls.prototype.showTracksPanel):
2255 (MacOSMediaControls.prototype.hideTracksPanel):
2257 2017-03-29 Antoine Quint <graouts@apple.com>
2259 [Modern Media Controls] Volume slider is initially empty
2260 https://bugs.webkit.org/show_bug.cgi?id=170237
2261 <rdar://problem/31319077>
2263 Reviewed by Dean Jackson.
2265 Fixing fallout from https://bugs.webkit.org/show_bug.cgi?id=167935 where we changed the behavior
2266 of layout() to happen prior to a commit. In this one instance, we were overriding layout() to run
2267 after a commit, so we now override commit(). Otherwise, the <canvas> that we draw the volume slider
2268 into would have its "width" and "height" properties set after we drew, which would clear the <canvas>.
2270 * Modules/modern-media-controls/controls/slider.js:
2271 (Slider.prototype.commit):
2272 (Slider.prototype.layout): Deleted.
2274 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2276 [GCrypt] Move over empty GnuTLS-based SUBTLE_CRYPTO implementation files
2277 https://bugs.webkit.org/show_bug.cgi?id=170232
2279 Reviewed by Michael Catanzaro.
2281 Migrate the GnuTLS SUBTLE_CRYPTO implementation files to the gcrypt/
2282 directory. The implementation files themselves are no-op, so this is
2283 a simple move-and-rename operation that will enable proceeding with
2284 the libgcrypt-based implementation of SUBTLE_CRYPTO functionality.
2286 No change in behavior. The SUBTLE_CRYPTO feature should build as it
2287 did before, and the implementations are empty anyway.
2289 * PlatformGTK.cmake:
2290 * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp.
2291 * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp.
2292 * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp.
2293 * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp.
2294 * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmECDHGnuTLS.cpp.
2295 * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmPBKDF2GnuTLS.cpp.
2296 * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp.
2297 * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: This one already exists.
2298 * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp.
2299 * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoAlgorithmRegistryGnuTLS.cpp.
2300 * crypto/gcrypt/CryptoKeyECGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyECGnuTLS.cpp.
2301 * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/CryptoKeyRSAGnuTLS.cpp.
2302 * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: Renamed from Source/WebCore/crypto/gnutls/SerializedCryptoKeyWrapGnuTLS.cpp.
2303 * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp: Removed.
2305 2017-03-29 Zan Dobersek <zdobersek@igalia.com>
2307 [GnuTLS] Remove unused CryptoDigestGnuTLS, CryptoAlgorithmHMACGnuTLS implementation files
2308 https://bugs.webkit.org/show_bug.cgi?id=170231
2310 Reviewed by Michael Catanzaro.
2312 * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp: Removed. The GCrypt counterpart
2313 is already in use, and this file wasn't even being built.
2315 2017-03-29 Youenn Fablet <youenn@apple.com>
2317 Move DTMF WebRTC extension behind its own compile flag
2318 https://bugs.webkit.org/show_bug.cgi?id=170226
2320 Reviewed by Eric Carlson.
2322 Moving RTCDTMFSender and RTCDTMFToneChangeEvent behinf a WEB_RTC_DTMF compile flag.
2323 This compile flag is not set on any supported platform yet.
2324 Disabling related test and updated test expectations.
2326 * Modules/mediastream/RTCDTMFSender.cpp:
2327 * Modules/mediastream/RTCDTMFSender.h:
2328 * Modules/mediastream/RTCDTMFSender.idl:
2329 * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
2330 * Modules/mediastream/RTCDTMFToneChangeEvent.h:
2331 * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2332 * dom/EventNames.in:
2333 * dom/EventTargetFactory.in:
2334 * platform/mediastream/RTCDTMFSenderHandler.h:
2335 * platform/mediastream/RTCDTMFSenderHandlerClient.h:
2337 2017-03-29 Antoine Quint <graouts@apple.com>
2339 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout
2340 https://bugs.webkit.org/show_bug.cgi?id=168409
2341 <rdar://problem/30799198>
2343 Reviewed by Dean Jackson.
2345 Add a new internals setting to opt into ScriptedAnimationController logging through DOM events dispatched
2346 through the document. This should allow this flaky test to get information as to why the frame isn't
2347 firing when it times out.
2349 * dom/ScriptedAnimationController.cpp:
2350 (WebCore::ScriptedAnimationController::suspend):
2351 (WebCore::ScriptedAnimationController::resume):
2352 (WebCore::ScriptedAnimationController::addThrottlingReason):
2353 (WebCore::ScriptedAnimationController::removeThrottlingReason):
2354 (WebCore::ScriptedAnimationController::registerCallback):
2355 (WebCore::ScriptedAnimationController::cancelCallback):
2356 (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
2357 (WebCore::ScriptedAnimationController::scheduleAnimation):
2358 (WebCore::ScriptedAnimationController::dispatchLoggingEventIfRequired):
2359 * dom/ScriptedAnimationController.h:
2361 * testing/InternalSettings.cpp:
2362 (WebCore::InternalSettings::resetToConsistentState):
2363 (WebCore::InternalSettings::shouldDispatchRequestAnimationFrameEvents):
2364 (WebCore::InternalSettings::setShouldDispatchRequestAnimationFrameEvents):
2365 * testing/InternalSettings.h:
2366 * testing/InternalSettings.idl:
2368 2017-03-28 Youenn Fablet <youenn@apple.com>
2370 [WebRTC] After r214441 addIceCandidate no longer accepts an RTCIceCandidateInit dictionary
2371 https://bugs.webkit.org/show_bug.cgi?id=170192
2373 Reviewed by Jon Lee.
2375 Covered by updated tests.
2377 * Modules/mediastream/RTCIceCandidate.idl: Candidate is no longer a required field in RTCIceCandidateInit.
2378 * Modules/mediastream/RTCPeerConnectionInternals.js: Reworking defaultsToNull to handle both undefined and null cases.
2380 2017-03-28 Youenn Fablet <youenn@apple.com>
2382 LibWebRTCProvider should allow setting encoder and decoder factories
2383 https://bugs.webkit.org/show_bug.cgi?id=170212
2385 Reviewed by Eric Carlson.
2387 No change of behavior.
2388 Adding the ability to set encoder/decoder libwebrtc factory getters.
2389 Setting default cocoa factory getters.
2391 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2392 (WebCore::staticFactoryAndThreads):
2393 (WebCore::initializePeerConnectionFactoryAndThreads):
2394 (WebCore::LibWebRTCProvider::setDecoderFactoryGetter):
2395 (WebCore::LibWebRTCProvider::setEncoderFactoryGetter):
2396 (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
2397 * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2399 2017-03-27 Brent Fulgham <bfulgham@apple.com>
2401 Only attach Attributes to a given element one time
2402 https://bugs.webkit.org/show_bug.cgi?id=170125
2403 <rdar://problem/31279676>
2405 Reviewed by Chris Dumez.
2407 Attach the attribute node to the Element before calling 'setAttributeInternal', since that method may cause
2408 arbitrary JavaScript events to fire.
2410 Test: fast/dom/Attr/only-attach-attr-once.html
2413 (WebCore::Element::attachAttributeNodeIfNeeded): Added.
2414 (WebCore::Element::setAttributeNode): Use new method. Revise to attach attribute before calling 'setAttributeInternal'.
2415 (WebCore::Element::setAttributeNodeNS): Ditto.
2418 2017-03-28 Youenn Fablet <youenn@apple.com>
2420 Stop RTCDataChannel when closing page
2421 https://bugs.webkit.org/show_bug.cgi?id=170166
2423 Reviewed by Eric Carlson.
2425 Test: webrtc/datachannel/datachannel-gc.html
2427 Making RTCDataChannel an ActiveDOMObject.
2428 Closing the data channel backend and freeing upon close and stop.
2430 * Modules/mediastream/RTCDataChannel.cpp:
2431 (WebCore::RTCDataChannel::create):
2432 (WebCore::RTCDataChannel::RTCDataChannel):
2433 (WebCore::RTCDataChannel::close):
2434 (WebCore::RTCDataChannel::stop):
2435 * Modules/mediastream/RTCDataChannel.h:
2436 * Modules/mediastream/RTCDataChannel.idl:
2437 * Modules/mediastream/RTCPeerConnection.h:
2439 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
2441 Ranges for variation font properties are not enforced
2442 https://bugs.webkit.org/show_bug.cgi?id=169979
2444 Reviewed by David Hyatt.
2446 The spec specifies that:
2447 - Font weights less than or equal to 0, or greater than or equal to 1000 are parse errors
2448 - Font stretch values less than or equal to 0% are parse errors
2449 - Font style values less than or equal to -90deg or greater than or equal to 90deg are parse errors
2451 Test: fast/text/variations/out-of-bounds-selection-properties.html
2453 * css/parser/CSSPropertyParser.cpp:
2454 (WebCore::consumeFontWeightRange):
2455 (WebCore::fontStretchIsWithinRange):
2456 (WebCore::consumeFontStretch):
2457 (WebCore::consumeFontStretchRange):
2458 (WebCore::fontStyleIsWithinRange):
2459 (WebCore::consumeFontStyle):
2460 (WebCore::consumeFontStyleRange):
2462 2017-03-28 Andy Estes <aestes@apple.com>
2464 [iOS] Crash in -[WebPreviewLoader failed] when running http/tests/multipart/policy-ignore-crash.php
2465 https://bugs.webkit.org/show_bug.cgi?id=170197
2466 <rdar://problem/30314067>
2468 Reviewed by Brady Eidson.
2470 If QuickLook conversion fails, we call ResourceLoader::didFail() with the NSError from
2471 QuickLook, which will call back into PreviewLoader::didFail(). We only care about network
2472 failures in PreviewLoader, not conversion failures, so check if
2473 m_finishedLoadingDataIntoConverter is set before continuing (like we do in
2474 PreviewLoader::didFinishLoading()).
2476 Fixes crash in http/tests/multipart/policy-ignore-crash.php.
2478 * loader/ios/PreviewLoader.mm:
2479 (WebCore::PreviewLoader::didFail):
2481 2017-03-28 Chris Dumez <cdumez@apple.com>
2483 Audio indicator is visible on uni-watch.com but there is no audible audio
2484 https://bugs.webkit.org/show_bug.cgi?id=170200
2485 <rdar://problem/31289132>
2487 Reviewed by Eric Carlson.
2489 Cherry-pick the following patch from Blink by <rtoy@chromium.org>:
2490 - https://chromium.googlesource.com/chromium/src.git/+/439de5bb2a31384666db1a0e2dadb2b97d2f3ce4
2492 When the gain of a GainNode is 0 or 1, the operation of the node can
2493 be optimized. When gain = 1, just copy the input to the output. When
2494 gain = 0; just zero out the output. Currently, the input is
2495 multiplied by the gain to produce the output. This just optimizes the
2496 multiplication away for the two special cases.
2498 Also, have the GainNode set the silence hint if the gain is 0.
2500 And fix a bug in processIfNecessary when unsilenceOutputs was causing the
2501 silence hint to be cleared after the node's process method was finished
2502 and may have set the silence hint. The processing should come after
2503 unsilenceOutputs to preserve any hints from processing the node.
2505 * Modules/webaudio/AudioNode.cpp:
2506 (WebCore::AudioNode::processIfNecessary):
2507 * Modules/webaudio/GainNode.cpp:
2508 (WebCore::GainNode::process):
2509 * platform/audio/AudioBus.cpp:
2510 (WebCore::AudioBus::copyWithGainFrom):
2512 2017-03-28 Chris Dumez <cdumez@apple.com>
2514 Animated SVG images are not paused when outside viewport
2515 https://bugs.webkit.org/show_bug.cgi?id=170155
2516 <rdar://problem/31288893>
2518 Reviewed by Antti Koivisto.
2520 Make sure animated SVG images get paused when outside the viewport,
2521 similarly to what was already done for animated GIF images. Also
2522 make sure they are paused when they no longer have any renderers
2525 Tests: svg/animations/animated-svg-image-outside-viewport-paused.html
2526 svg/animations/animated-svg-image-removed-from-document-paused.html
2528 * loader/cache/CachedImage.cpp:
2529 (WebCore::CachedImage::didAddClient):
2530 Restart the animation whenever a new CachedImage client is added. This
2531 will cause us the re-evaluate if the animation should run. The animation
2532 will pause again if the new renderer is not inside the viewport.
2534 (WebCore::CachedImage::animationAdvanced):
2535 Add a flag to newImageAnimationFrameAvailable() so that the renderers can
2536 let us know if we can pause the animation. Pause the animation if all no
2537 renderer requires it (i.e. they are all outside the viewport, or there
2540 * loader/cache/CachedImageClient.h:
2541 (WebCore::CachedImageClient::newImageAnimationFrameAvailable):
2542 By default, the CachedImageClients allow pausing. Only renderer will
2543 potentially prevent pausing if they are inside the viewport.
2545 * platform/graphics/BitmapImage.cpp:
2546 (WebCore::BitmapImage::isAnimating):
2547 * platform/graphics/BitmapImage.h:
2548 * platform/graphics/Image.h:
2549 (WebCore::Image::isAnimating):
2550 Add isAnimating() flag on Image for layout testing purposes.
2552 * rendering/RenderElement.cpp:
2553 (WebCore::RenderElement::newImageAnimationFrameAvailable):
2554 Set canPause flag to true if the renderer is not inside the viewport.
2556 (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2557 Call startAnimation() if the renderer is now visible to resume SVG
2558 animations. Repainting is enough for GIF animations but not for SVG
2559 animations, we have to explicitly resume them.
2561 * rendering/RenderElement.h:
2562 * rendering/RenderView.cpp:
2563 (WebCore::RenderView::addRendererWithPausedImageAnimations):
2564 (WebCore::RenderView::removeRendererWithPausedImageAnimations):
2565 (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
2566 * rendering/RenderView.h:
2567 Store CachedImages with the renderers that have paused animations.
2568 This is required for SVG where we need to explicitly resume the
2569 animation on the CachedImage when the renderer becomes visible
2570 again. Having access to the Image will also allow us to do smarter
2571 visibility checks in RenderElement's shouldRepaintForImageAnimation(),
2574 * svg/SVGSVGElement.cpp:
2575 (WebCore::SVGSVGElement::hasActiveAnimation):
2576 * svg/SVGSVGElement.h:
2577 Add hasActiveAnimation() method.
2579 * svg/graphics/SVGImage.cpp:
2580 (WebCore::SVGImage::startAnimation):
2581 Check that animations are paused before starting them. This avoid
2582 jumping due to unnecessary calls to rootElement->setCurrentTime(0).
2584 (WebCore::SVGImage::isAnimating):
2585 Add isAnimating() method for layout tests purposes.
2587 * svg/graphics/SVGImage.h:
2588 * svg/graphics/SVGImageClients.h:
2589 Call animationAdvanced() on the observer instead of the generic
2590 changedInRect() when the SVGImage is animating. This way, we go
2591 through the same code path as GIF animations and we end up calling
2592 CachedImage::animationAdvanced() which calls newImageAnimationFrameAvailable()
2593 on RenderElement, which determines if the animation should keep
2596 * testing/Internals.cpp:
2597 (WebCore::Internals::isImageAnimating):
2598 * testing/Internals.h:
2599 * testing/Internals.idl:
2600 Add layout testing infrastructure.
2602 2017-03-28 Antti Koivisto <antti@apple.com>
2604 Missing render tree position invalidation when tearing down renderers for display:contents subtree
2605 https://bugs.webkit.org/show_bug.cgi?id=170199
2606 <rdar://problem/31260856>
2608 Reviewed by Zalan Bujtas.
2610 Test: fast/shadow-dom/slot-renderer-teardown.html
2612 * style/RenderTreeUpdater.cpp:
2613 (WebCore::RenderTreeUpdater::updateElementRenderer):
2615 Invalidate the render tree position in case we do a teardown for an element without renderer.
2617 2017-03-28 Ryan Haddad <ryanhaddad@apple.com>
2619 Unreviewed, rolling out r214485.
2621 This change caused LayoutTest crashes.
2625 "Stop RTCDataChannel when closing page"
2626 https://bugs.webkit.org/show_bug.cgi?id=170166
2627 http://trac.webkit.org/changeset/214485
2629 2017-03-28 Anders Carlsson <andersca@apple.com>
2631 ApplePayShippingContactUpdate.idl shouldn't have status field
2632 https://bugs.webkit.org/show_bug.cgi?id=170202
2633 rdar://problem/31307106
2635 Reviewed by Beth Dakin.
2637 * Modules/applepay/ApplePaySession.cpp:
2638 (WebCore::convertAndValidate):
2639 If status isn't set, infer it based on whether there are errors present or not.
2641 * Modules/applepay/ApplePayShippingContactUpdate.h:
2642 Make status optional here; it's still used by the old code path.
2644 * Modules/applepay/ApplePayShippingContactUpdate.idl:
2647 2017-03-28 Brian Burg <bburg@apple.com>
2649 Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open
2650 https://bugs.webkit.org/show_bug.cgi?id=169865
2651 <rdar://problem/31250573>
2653 Reviewed by Joseph Pecoraro.
2655 Rewrite the network agent's command for disabling resource caching to use Page::setResourceCachingEnabled.
2656 The old implementation was doing weird stuff like setting no-cache headers and evicting the
2657 contents of the memory cache, neither of which is correct. The new approach has no side effects
2658 on the network, disk, or memory cache so it can be turned on temporarily without causing problems.
2661 - http/tests/inspector/network/set-resource-caching-disabled-disk-cache.html
2662 - http/tests/inspector/network/set-resource-caching-disabled-memory-cache.html
2664 * inspector/InspectorNetworkAgent.h:
2665 * inspector/InspectorNetworkAgent.cpp:
2666 (WebCore::InspectorNetworkAgent::setCacheDisabled): Deleted.
2667 (WebCore::InspectorNetworkAgent::setResourceCachingDisabled): Added.
2668 Implement new command.
2670 (WebCore::InspectorNetworkAgent::willSendRequest):
2671 (WebCore::InspectorNetworkAgent::mainFrameNavigated):
2672 Remove crufty attempts to break caches. I believe these are intended to defeat caching
2673 proxies and similar middlemen, but this is just as likely to cause unusual loading behavior.
2676 (WebCore::Page::isResourceCachingDisabled):
2677 (WebCore::Page::setResourceCachingDisabledOverride):
2678 Add an override setting so that Web Inspector's override does not mess up the value
2679 of isResourceCachingDisabled that may have been set by a WebKit API client.
2681 2017-03-28 Youenn Fablet <youenn@apple.com>
2683 Fix addIceCandidate after r214441
2684 https://bugs.webkit.org/show_bug.cgi?id=170146
2686 Reviewed by Chris Dumez.
2688 Covered by rebased test.
2690 * Modules/mediastream/RTCPeerConnection.js:
2691 (addIceCandidate): Setting function length to 1 and throwing if no parameter is passed.
2693 2017-03-28 Youenn Fablet <youenn@apple.com>
2695 Stop RTCDataChannel when closing page
2696 https://bugs.webkit.org/show_bug.cgi?id=170166
2698 Reviewed by Eric Carlson.
2700 Test: webrtc/datachannel/datachannel-gc.html
2702 Making RTCDataChannel an ActiveDOMObject.
2703 Closing the data channel backend and freeing upon close and stop.
2705 * Modules/mediastream/RTCDataChannel.cpp:
2706 (WebCore::RTCDataChannel::create):
2707 (WebCore::RTCDataChannel::RTCDataChannel):
2708 (WebCore::RTCDataChannel::close):
2709 (WebCore::RTCDataChannel::stop):
2710 * Modules/mediastream/RTCDataChannel.h:
2711 * Modules/mediastream/RTCDataChannel.idl:
2712 * Modules/mediastream/RTCPeerConnection.h:
2714 2017-03-27 Simon Fraser <simon.fraser@apple.com>
2716 Enhance the touch region debug overlay to show regions for the different events
2717 https://bugs.webkit.org/show_bug.cgi?id=170162
2719 Reviewed by Tim Horton.
2721 Have NonFastScrollableRegionOverlay use a different color for each region in EventTrackingRegions,
2722 and to draw a legend showing what the colors mean.
2724 On Mac, this overlay displays the non-fast scrollable region (which we don't keep separate from the wheel event
2727 * page/DebugPageOverlays.cpp:
2728 (WebCore::NonFastScrollableRegionOverlay::updateRegion):
2729 (WebCore::touchEventRegionColors):
2730 (WebCore::drawRightAlignedText):
2731 (WebCore::NonFastScrollableRegionOverlay::drawRect):
2732 (WebCore::RegionOverlay::drawRect):
2733 (WebCore::RegionOverlay::drawRegion):
2735 2017-03-27 Simon Fraser <simon.fraser@apple.com>
2737 Make sure the non-fast scrolling debug overlay is correctly updated
2738 https://bugs.webkit.org/show_bug.cgi?id=170142
2740 Reviewed by Tim Horton.
2742 AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged() is called on a timer
2743 from Document code, so the existing DebugPageOverlays::didLayout() call at the end
2744 of FrameView::layout() wasn't sufficient to keep the non-fast scrollable region up-to-date
2747 * page/scrolling/AsyncScrollingCoordinator.cpp:
2748 (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
2750 2017-03-28 Antoine Quint <graouts@apple.com>
2752 [Modern Media Controls] AirPlay placard text looks bad on 1x displays
2753 https://bugs.webkit.org/show_bug.cgi?id=170183
2754 <rdar://problem/30663416>
2756 Reviewed by Dean Jackson.
2758 Use subpixel antialiasing for all text in modern media controls.
2760 * Modules/modern-media-controls/controls/media-controls.css:
2761 (.media-controls-container,):
2763 2017-03-28 Antoine Quint <graouts@apple.com>
2765 [Modern Media Controls] Improve appearance of tracks panel on macOS
2766 https://bugs.webkit.org/show_bug.cgi?id=168929
2767 <rdar://problem/30741589>
2769 Reviewed by Eric Carlson.
2771 We use a solid color for the focus state that matches the style used on macOS
2772 and blend the titles the same way we blend other non-solid labels in the controls bar.
2774 * Modules/modern-media-controls/controls/tracks-panel.css:
2775 (.tracks-panel section):
2776 (.tracks-panel section > h3):
2777 (.tracks-panel section > ul > li:focus):
2779 2017-03-28 Yoav Weiss <yoav@yoav.ws>
2781 Add a warning for unused link preloads.
2782 https://bugs.webkit.org/show_bug.cgi?id=165670
2784 Reviewed by Youenn Fablet.
2786 Tests: http/tests/preload/single_download_preload_headers_charset.php
2787 http/tests/preload/unused_preload_warning.html
2790 (WebCore::Document::prepareForDestruction): Stop the timer once the document is destructed.
2791 * loader/LinkPreloadResourceClients.h: Add shouldMarkAsReferenced overides for the LinkPreloadResourceClient classes.
2792 * loader/cache/CachedResource.cpp:
2793 (WebCore::CachedResource::addClientToSet): Make sure LinkPreloadResourceClients don't set resource to be referenced.
2794 * loader/cache/CachedResourceClient.h:
2795 (WebCore::CachedResourceClient::shouldMarkAsReferenced): Make sure that ResourceClients mark preloads as referenced by default.
2796 * loader/cache/CachedResourceLoader.cpp:
2797 (WebCore::CachedResourceLoader::CachedResourceLoader): Initialize timer.
2798 (WebCore::CachedResourceLoader::~CachedResourceLoader): Stop timer.
2799 (WebCore::CachedResourceLoader::documentDidFinishLoadEvent): Trigger a timer if preloads weren't cleared at load time.
2800 (WebCore::CachedResourceLoader::stopUnusedPreloadsTimer): Stop the timer.
2801 (WebCore::CachedResourceLoader::warnUnusedPreloads): Iterate over m_preloads and issue a warning for non-referenced preloads.
2802 * loader/cache/CachedResourceLoader.h:
2803 * page/DOMWindow.cpp:
2804 (WebCore::DOMWindow::willDetachDocumentFromFrame): Clear Resource Timing buffer when document detaches, to avoid test flakiness.
2806 2017-03-28 Antoine Quint <graouts@apple.com>
2808 REGRESSION: Double-clicking the captions button while the captions popover is open prevents the popover from being opened again
2809 https://bugs.webkit.org/show_bug.cgi?id=170171
2810 <rdar://problem/31095500>
2812 Reviewed by Dean Jackson.
2814 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
2815 transition to complete before actually removing the panel from the node hierarchy, consecutive calls to hide then present
2816 would fail to present the panel. We now use a private instance variable to track the presented state which is set immediately
2817 as presentInParent() and hide() are called.
2819 Test: media/modern-media-controls/tracks-support/tracks-support-show-panel-then-double-click-on-tracks-button.html
2821 * Modules/modern-media-controls/controls/tracks-panel.js:
2822 (TracksPanel.prototype.get presented):
2823 (TracksPanel.prototype.presentInParent):
2824 (TracksPanel.prototype.hide):
2826 2017-03-28 Aaron Chu <aaron_chu@apple.com>
2828 AX: Media controls should be able to be re-activated after faded away
2829 https://bugs.webkit.org/show_bug.cgi?id=170048
2830 <rdar://problem/30157179>
2832 Reviewed by Antoine Quint.
2834 Added a "foucsin" listener for the controls bar so that when an element
2835 within fires a "focusin" event, the controls bar reappears if it is faded.
2837 Test: media/modern-media-controls/media-controls/media-controls-appear-when-focus.html
2839 * Modules/modern-media-controls/controls/controls-bar.js:
2840 (ControlsBar.prototype.handleEvent):
2842 2017-03-28 Antoine Quint <graouts@apple.com>
2844 [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
2845 https://bugs.webkit.org/show_bug.cgi?id=169145
2846 <rdar://problem/17048858>
2848 Reviewed by Dean Jackson.
2850 There were a variety of issues with media documents, some longstanding, and some specifically
2851 about modern media controls.
2853 One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
2854 due to using a <video> element to load the audio file. We now have additional logic in MediaController
2855 to identify if the loaded media is really an audio file, and using this information to hide the
2856 fullscreen and picture-in-picture buttons.
2858 Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
2859 controls when we could have the modern-media-controls module injected CSS handle this styling. We now
2860 use the injected style in the shadow root to size media documents based on the device characteristics
2861 and ensuring that page styles are overridden.
2863 We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
2864 attribute and not a <source> element.
2866 Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
2867 a media document to hide the controls while we determine the type of media we're loading (audio vs.
2868 video) in order to apply the appropriate styling without flashes.
2870 As a result of the new styles applied by the modern-media-controls module, media documents have a
2871 similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
2872 to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
2873 we want to always play the media at full width, with some padding in the case of audio.
2875 Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
2876 media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
2877 media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
2878 media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
2879 media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
2880 media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
2881 media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
2882 media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
2884 * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
2885 (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
2886 (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
2887 * Modules/modern-media-controls/controls/macos-media-controls.css:
2888 (:host(audio) .media-controls.mac.inline > .controls-bar,):
2889 (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
2890 (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
2891 (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
2892 * Modules/modern-media-controls/controls/media-document.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/macos-media-controls.css.
2893 (:host(.media-document)):
2894 (:host(.media-document.ready)):
2895 (:host(.media-document.audio.mac)):
2896 (:host(.media-document.audio.ipad)):
2897 (:host(.media-document.audio.iphone)):
2898 (:host(.media-document.video.mac)):
2899 (:host(.media-document.video.ipad)):
2900 (:host(.media-document.video.iphone)):
2901 * Modules/modern-media-controls/js-files:
2902 * Modules/modern-media-controls/media/fullscreen-support.js:
2903 (FullscreenSupport.prototype.syncControl):
2904 (FullscreenSupport):
2905 * Modules/modern-media-controls/media/media-controller.js:
2907 (MediaController.prototype.get isAudio):
2908 * Modules/modern-media-controls/media/media-document-controller.js: Copied from Source/WebCore/Modules/modern-media-controls/media/fullscreen-support.js.
2909 (MediaDocumentController):
2910 (MediaDocumentController.prototype.handleEvent):
2911 (MediaDocumentController.prototype._mediaDocumentHasMetadata):
2912 (MediaDocumentController.prototype._mediaDocumentHasSize):
2913 * Modules/modern-media-controls/media/pip-support.js:
2914 (PiPSupport.prototype.syncControl):
2916 * html/MediaDocument.cpp:
2917 (WebCore::MediaDocumentParser::createDocumentStructure):
2919 2017-03-28 Myles C. Maxfield <mmaxfield@apple.com>
2921 Follow-up patch after r214364.
2922 https://bugs.webkit.org/show_bug.cgi?id=168895
2926 * platform/graphics/FontDescription.cpp:
2927 (WebCore::FontDescription::FontDescription):
2929 2017-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>
2931 REGRESSION(213764): Large images should not be decoded asynchronously when they are drawn on a canvas
2932 https://bugs.webkit.org/show_bug.cgi?id=169771
2934 Reviewed by Simon Fraser.
2936 Sometimes we have to draw the image immediately like when a canvas calls
2937 drawImage. In this case we have to decode the image synchronously to guarantee
2938 the drawing. Other times we need to decode with the native size of the image.
2939 The animated images have to be decoded with native size always. Otherwise
2940 the frame cache will be messed up if the same image is animated with different
2941 sizes. Currently we always decode asynchronously with sizeForDrawing. We need
2942 to decouple the decoding mode from the sizeForDrawing.
2944 This patch introduce the DecodingOptions class which can store and compare the
2945 following four cases:
2946 -- Synchronous: The frame has be decoded with native size only.
2947 -- Asynchronous + anySize: This is passed from the Image::draw() callers.
2948 -- Asynchronous + fullSize: The image has to be decoded with its full size.
2949 -- Asynchronous + sizeForDrawing: The image can be decoded with sizeForDrawing unless
2950 it was decoded with either a full size or sizeForDrawing which is larger than the
2951 requested sizeForDrawing.
2953 A new argument of type DecodingMode will be added to Image::draw() function.
2954 Only when the drawing comes from the render tree, it will be Asynchronous.
2955 Otherwise it will be Synchronous.
2957 Tests: fast/images/animated-image-different-dest-size.html
2958 fast/images/async-image-background-image.html
2959 fast/images/async-image-canvas-draw-image.html
2961 * WebCore.xcodeproj/project.pbxproj:
2962 * platform/graphics/BitmapImage.cpp:
2963 (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded): Gets the frame image, cache it synchronously if
2964 the current one is invalid. frameImageAtIndex() returns whatever stored in the cache.
2965 (WebCore::BitmapImage::nativeImage): Call frameImageAtIndexCacheIfNeeded() instead of frameImageAtIndex().
2966 (WebCore::BitmapImage::nativeImageForCurrentFrame): Ditto.
2967 (WebCore::BitmapImage::nativeImageOfSize): Ditto.
2968 (WebCore::BitmapImage::framesNativeImages): Ditto.
2969 (WebCore::BitmapImage::draw): Change the logic to do the following:
2970 -- The animated image has to be decoded with its full size.
2971 -- The animated image expects the current frame to be ready for drawing.
2972 -- The large image decoding does not need to call internalStartAnimation().
2973 -- The large image has to request async image decoding but draw the current one if it exists.
2974 (WebCore::BitmapImage::drawPattern): Draw the pattern synchronously.
2975 (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Delete the call to shouldUseAsyncDecodingForTesting()
2976 since it is only applied for animated images.
2977 (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
2978 (WebCore::BitmapImage::internalStartAnimation): Request decoding with the full size.
2979 (WebCore::BitmapImage::advanceAnimation): Call shouldUseAsyncDecodingForAnimatedImageForTesting().
2980 (WebCore::BitmapImage::internalAdvanceAnimation): Assert the current frame is not being decoding asynchronously for any size.
2981 (WebCore::BitmapImage::frameImageAtIndex): Deleted. Moved to the header file but with a new purpose: return
2982 the current frame from the frame cache as is; do not cache a new one.
2983 (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImage): Deleted. Function was renamed to shouldUseAsyncDecodingForLargeImages.
2984 (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImage): Deleted. Function was renamed to shouldUseAsyncDecodingForAnimatedImages.
2985 * platform/graphics/BitmapImage.h:
2986 * platform/graphics/CrossfadeGeneratedImage.cpp:
2987 (WebCore::CrossfadeGeneratedImage::draw): Add a new argument of type DecodingMode.
2988 * platform/graphics/CrossfadeGeneratedImage.h:
2989 * platform/graphics/DecodingOptions.h: Added.
2990 (WebCore::DecodingOptions::DecodingOptions): Default constructor: Synchronous mode.
2991 (WebCore::DecodingOptions::operator==): Compares two DecodingOptions for equality.
2992 (WebCore::DecodingOptions::isSynchronous): Is the frame decoded synchronously?
2993 (WebCore::DecodingOptions::isAsynchronous): Is the frame decoded asynchronously?
2994 (WebCore::DecodingOptions::isAsynchronousCompatibleWith): Is this DecodingOptions compatible with another one?
2995 (WebCore::DecodingOptions::hasFullSize): Is the decoding mode asynchronous but for the image full size?
2996 (WebCore::DecodingOptions::hasSizeForDrawing): Is this decoding mode asynchronous but for a sizeForDrawing?
2997 (WebCore::DecodingOptions::sizeForDrawing): Returns the sizeForDrawing. m_decodingModeOrSize has to hold an IntSize.
2998 (WebCore::DecodingOptions::maxDimension): Moved form ImageFrame.cpp.
2999 (WebCore::DecodingOptions::has): A helper function.
3000 (WebCore::DecodingOptions::hasDecodingMode): Does m_decodingModeOrSize a DecodingMode?
3001 (WebCore::DecodingOptions::hasSize): Does m_decodingModeOrSize an IntSize?
3002 * platform/graphics/GeneratedImage.h: Add a new argument of type DecodingMode.
3003 * platform/graphics/GradientImage.cpp:
3004 (WebCore::GradientImage::draw): Ditto.
3005 * platform/graphics/GradientImage.h: Ditto.
3006 * platform/graphics/GraphicsContext.cpp:
3007 (WebCore::GraphicsContext::drawImage): Pass the ImagePaintingOptions::m_DecodingMode to Image::draw().
3008 * platform/graphics/GraphicsContext.h:
3009 (WebCore::ImagePaintingOptions::ImagePaintingOptions): Add a new member of type DecodingMode to ImagePaintingOptions.
3010 * platform/graphics/Image.cpp:
3011 (WebCore::Image::drawTiled): Pass DecodingMode::Synchronous to Image::draw().
3012 * platform/graphics/Image.h: Add a new argument of type DecodingMode to Image::draw().
3013 * platform/graphics/ImageFrame.cpp:
3014 (WebCore::ImageFrame::operator=): Replace m_sizeForDrawing by m_decodingOptions.
3015 (WebCore::ImageFrame::hasNativeImage): Check if m_nativeImage is valid and the subsamplingLevels match.
3016 (WebCore::ImageFrame::hasFullSizeNativeImage): Checks hasNativeImage() and whether the image frame was
3017 decoded for the image full size.
3018 (WebCore::ImageFrame::hasDecodedNativeImageCompatibleWithOptions): Checks hasNativeImage() and the DecodingOptions match.
3019 (WebCore::maxDimension): Deleted. Moved to DecodingOptions.h.
3020 (WebCore::ImageFrame::isBeingDecoded): Deleted. The check for having an ImageFrame being decoded is
3021 moved to ImageFrameCache.
3022 (WebCore::ImageFrame::hasValidNativeImage): Deleted. No need to this function.
3023 * platform/graphics/ImageFrame.h:
3024 (WebCore::ImageFrame::hasNativeImage): Add an std::optional<SubsamplingLevel> argument.
3025 (WebCore::ImageFrame::hasFullSizeNativeImage): Checks whether the ImageFrame was decoded for the image full size.
3026 (WebCore::ImageFrame::enqueueSizeForDecoding): Deleted.
3027 (WebCore::ImageFrame::dequeueSizeForDecoding): Deleted.
3028 (WebCore::ImageFrame::clearSizeForDecoding): Deleted.
3029 (WebCore::ImageFrame::isBeingDecoded): Deleted.
3030 (WebCore::ImageFrame::sizeForDrawing): Deleted.
3031 (WebCore::ImageFrame::hasDecodedNativeImage): Deleted.
3032 The logic of knowing whether an ImageFrame is being decoded is moved to ImageFrameCache.
3033 * platform/graphics/ImageFrameCache.cpp:
3034 (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Caches the metadata of an ImageFrame. If the NativeImage
3035 was decoded for a sizeForDrawing, the size of the ImageFrame will be the nativeImageSize(). Otherwise, the
3036 frameSizeAtIndex() will be called.
3037 (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Cache a new NativeImage which involves caching new
3038 metadata and updating the memory cache. No need to check if the existing native image is valid or not for the
3039 DecodingOptions. Actually it would be a bug if it happens. This is why cacheNativeImageForFrameRequest() asserts
3040 !frame.hasAsyncNativeImage() before calling cacheFrameNativeImageAtIndex().
3041 (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Cache new NativeImage which was decoded asynchronously.
3042 (WebCore::ImageFrameCache::startAsyncDecodingQueue): Call cacheAsyncFrameNativeImageAtIndex() instead of
3043 cacheNativeImageForFrameRequest() for clarity.
3044 (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex): Call hasAsyncNativeImage() instead of hasValidNativeImage()
3045 Call frameIsDecodingCompatibleWithOptionsAtIndex() instead of frame.isBeingDecoded(). Replace the call to enqueueSizeForDecoding()
3046 by appending the same ImageFrameRequest to m_frameCommitQueue.
3047 (WebCore::ImageFrameCache::isAsyncDecodingQueueIdle): Use m_frameCommitQueue to answer the question whether the decodingQueue is idle.
3048 (WebCore::ImageFrameCache::stopAsyncDecodingQueue): Use m_frameCommitQueue to loop through all the ImageFrames which are currently being decoded.
3049 (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): For getting the metadata, this function needs a valid frame. If it is requested
3050 to decode the nativeImage, it has to do it synchronously.
3051 (WebCore::ImageFrameCache::singlePixelSolidColor): Don't cache the frame if it is an animated image or the size is not a single pixel.
3052 (WebCore::ImageFrameCache::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Use m_frameCommitQueue to answer the question whether an ImageFrame
3053 is being decoded and is compatible with DecodingOptions.
3054 (WebCore::ImageFrameCache::frameHasFullSizeNativeImageAtIndex): Calls ImageFrame::hasFullNativeImage() for a frame.
3055 (WebCore::ImageFrameCache::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Calls ImageFrame::hasDecodedNativeImageCompatibleWithOptions() for a frame.
3056 (WebCore::ImageFrameCache::frameImageAtIndex): Returns the current NativeImage without caching.
3057 (WebCore::ImageFrameCache::frameImageAtIndexCacheIfNeeded): Returns the current NativeImage but cache it synchronously if needed.
3058 (WebCore::ImageFrameCache::setFrameNativeImageAtIndex): Deleted.
3059 (WebCore::ImageFrameCache::setFrameMetadataAtIndex): Deleted.
3060 (WebCore::ImageFrameCache::replaceFrameNativeImageAtIndex): Deleted.
3061 (WebCore::ImageFrameCache::frameIsBeingDecodedAtIndex): Deleted.
3062 (WebCore::ImageFrameCache::frameHasImageAtIndex): Deleted.
3063 (WebCore::ImageFrameCache::frameHasValidNativeImageAtIndex): Deleted.
3064 (WebCore::ImageFrameCache::frameHasDecodedNativeImage): Deleted.
3065 * platform/graphics/ImageFrameCache.h: Two ImageFrameRequest queues will be used.
3066 -- The existing one m_frameRequestQueue which is shared between the main thread and decoding thread. The requests will be
3067 dequeued from it before starting the decoding. The decoded NativeImage will be cached only on the main thread. The decoding
3068 thread is not blocked by the callOnMainThread(). This means there might be multiple ImageFrameRequests which were dequeued
3069 while their NativeImages have not been cached yet.
3070 -- A new one m_frameCommitQueue which is track all the ImageFrameRequests whose NativeImages have not been cached yet.
3071 (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded): Be explicit about caching the image frame. frameImageAtIndex()
3072 returns the current image frame without caching. frameAtIndexCacheIfNeeded(). returns the current image frame but cache
3074 (WebCore::ImageFrameCache::ImageFrameRequest::operator==): Compares two ImageFrameRequests for equality.
3075 * platform/graphics/ImageSource.cpp:
3076 (WebCore::ImageSource::frameImageAtIndexCacheIfNeeded):
3077 (WebCore::ImageSource::frameImageAtIndex): Deleted.
3078 * platform/graphics/ImageSource.h:
3079 (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Change the type of the argument from IntSize to be const std::optional<IntSize>.
3080 (WebCore::ImageSource::frameIsBeingDecodedAndIsCompatibleWithOptionsAtIndex): Rename of frameIsBeingDecodedAtIndex(). Replace the argument of type
3081 std::optional<IntSize> by an argument of type DecodingOptions.
3082 (WebCore::ImageSource::frameHasFullSizeNativeImageAtIndex): A wrapper around the ImageFrameCache function.
3083 (WebCore::ImageSource::frameHasDecodedNativeImageCompatibleWithOptionsAtIndex): Ditto.
3084 (WebCore::ImageSource::frameImageAtIndex): Ditto.
3085 (WebCore::ImageSource::frameIsBeingDecodedAtIndex): Deleted.
3086 (WebCore::ImageSource::frameHasValidNativeImageAtIndex): Deleted.
3087 (WebCore::ImageSource::frameHasDecodedNativeImage): Deleted.
3088 * platform/graphics/NamedImageGeneratedImage.cpp:
3089 (WebCore::NamedImageGeneratedImage::draw): Add a new argument of type DecodingMode.
3090 * platform/graphics/NamedImageGeneratedImage.h: Ditto.
3091 * platform/graphics/cairo/ImageBufferCairo.cpp:
3092 (WebCore::ImageBuffer::draw): Add a new argument of type DecodingMode.
3093 * platform/graphics/cg/ImageDecoderCG.cpp:
3094 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument. Add a new handling
3095 for decoding asynchronously for the image full size.
3096 * platform/graphics/cg/ImageDecoderCG.h: Change the prototype of the function.
3097 * platform/graphics/cg/PDFDocumentImage.cpp:
3098 (WebCore::PDFDocumentImage::draw): Add a new argument of type DecodingMode.
3099 * platform/graphics/cg/PDFDocumentImage.h:
3100 * platform/graphics/win/ImageCGWin.cpp:
3101 (WebCore::BitmapImage::getHBITMAPOfSize): Pass DecodingMode::Synchronous to Image::draw().
3102 (WebCore::BitmapImage::drawFrameMatchingSourceSize): Ditto.
3103 * platform/graphics/win/ImageDecoderDirect2D.cpp:
3104 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3105 * platform/graphics/win/ImageDecoderDirect2D.h: Change the prototype of the function.
3106 * platform/image-decoders/ImageDecoder.cpp:
3107 (WebCore::ImageDecoder::createFrameImageAtIndex): Replace the sizeForDrawing argument by a DecodingMode argument.
3108 * platform/image-decoders/ImageDecoder.h: Change the prototype of the function.
3109 * rendering/RenderBoxModelObject.cpp:
3110 (WebCore::RenderBoxModelObject::paintFillLayerExtended): Draw the background image asynchronously if the image size is large.
3111 * rendering/RenderImage.cpp:
3112 (WebCore::RenderImage::paintIntoRect): Draw the background image element asynchronously if the image size is large.
3113 * svg/graphics/SVGImage.cpp:
3114 (WebCore::SVGImage::drawForContainer): Pass DecodingMode::Synchronous to draw().
3115 (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
3116 (WebCore::SVGImage::nativeImage): Ditto.
3117 (WebCore::SVGImage::draw): Add a new argument of type DecodingMode.
3118 * svg/graphics/SVGImage.h: Change the prototype of the function.
3119 * svg/graphics/SVGImageForContainer.cpp:
3120 (WebCore::SVGImageForContainer::draw): Add a new argument of type DecodingMode.
3121 * svg/graphics/SVGImageForContainer.h: Change the prototype of the function.
3123 2017-03-27 Youenn Fablet <youenn@apple.com>
3125 Activate release libwebrtc logging when WebRTC log channel is on
3126 https://bugs.webkit.org/show_bug.cgi?id=169659
3128 Reviewed by Alex Christensen.
3130 * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3131 (WebCore::initializePeerConnectionFactoryAndThreads):
3133 2017-03-27 Antti Koivisto <antti@apple.com>
3135 Move visibleInViewportStateChanged callback from Element to render tree
3136 https://bugs.webkit.org/show_bug.cgi?id=170039
3138 Reviewed by Zalan Bujtas.
3140 Make it easier to use from the render tree.
3142 Also for simplicity move the bits from RenderObject rare data to RenderElement.
3143 There is plenty of space there.
3146 (WebCore::Element::isVisibleInViewportChanged): Deleted.
3147 * html/HTMLMediaElement.h:
3148 * rendering/RenderElement.cpp:
3149 (WebCore::RenderElement::RenderElement):
3150 (WebCore::RenderElement::willBeDestroyed):
3151 (WebCore::RenderElement::registerForVisibleInViewportCallback):
3152 (WebCore::RenderElement::unregisterForVisibleInViewportCallback):
3153 (WebCore::RenderElement::setVisibleInViewportState):
3154 (WebCore::RenderElement::visibleInViewportStateChanged):
3155 * rendering/RenderElement.h:
3156 (WebCore::RenderElement::visibleInViewportState):
3157 * rendering/RenderObject.cpp:
3158 (WebCore::RenderObject::setIsRegisteredForVisibleInViewportCallback): Deleted.
3159 (WebCore::RenderObject::setVisibleInViewportState): Deleted.
3160 * rendering/RenderObject.h:
3161 (WebCore::RenderObject::hasOutlineAutoAncestor):
3162 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
3163 (WebCore::RenderObject::isRegisteredForVisibleInViewportCallback): Deleted.
3164 (WebCore::RenderObject::visibleInViewportState): Deleted.
3165 * rendering/RenderVideo.cpp:
3166 (WebCore::RenderVideo::visibleInViewportStateChanged):
3167 * rendering/RenderVideo.h:
3168 * rendering/RenderView.cpp:
3169 (WebCore::RenderView::updateVisibleViewportRect):
3171 2017-03-27 Youenn Fablet <youenn@apple.com>
3173 addIceCandidate should not throw if passed null or undefined
3174 https://bugs.webkit.org/show_bug.cgi?id=170118
3176 Reviewed by Eric Carlson.
3178 Covered by updated test.
3180 A null/undefined candidate passed to addIceCandidate means end of Ice candidate..
3182 * Modules/mediastream/PeerConnectionBackend.cpp:
3183 (WebCore::PeerConnectionBackend::addIceCandidate):
3184 * Modules/mediastream/PeerConnectionBackend.h:
3185 (WebCore::PeerConnectionBackend::endOfIceCandidates):
3186 * Modules/mediastream/RTCPeerConnection.cpp:
3187 (WebCore::RTCPeerConnection::queuedAddIceCandidate):
3188 * Modules/mediastream/RTCPeerConnection.h:
3189 * Modules/mediastream/RTCPeerConnection.idl:
3190 * Modules/mediastream/RTCPeerConnection.js:
3193 2017-03-27 Antti Koivisto <antti@apple.com>
3195 Allow the page to render before <link> stylesheet tags in body
3196 https://bugs.webkit.org/show_bug.cgi?id=149157
3197 <rdar://problem/24658830>
3199 Reviewed by Simon Fraser.
3201 Currently we block style and renderer building completely if document has any loading
3202 stylesheets. In case a script queries something layout dependent we construct the render
3203 tree with whatever style we have but block painting in it.
3205 This patch changes behavior so that a loading stylesheet in body only blocks rendering for elements
3206 that are after it. The expectation is that such stylesheets rarely affect elements before them
3207 and the elements can be rendered without causing ugly visible styling changes.
3209 The patch replaces the old flash-of-unstyled-content (FOUC) preventation mechanism with a more
3210 fine-grained one. Paint blocking is now done on per-renderer basis with based on isNonFinal flag in
3213 For stylesheets in head the behavior should be largely unchanged.
3215 Test: http/tests/incremental/stylesheet-body-incremental-rendering.html
3217 * css/StyleResolver.cpp:
3218 (WebCore::StyleResolver::pseudoStyleRulesForElement):
3220 (WebCore::Document::Document):
3221 (WebCore::Document::resolveStyle):
3222 (WebCore::Document::updateLayoutIgnorePendingStylesheets):
3224 Remove the old FOUC preventation state tracking.
3226 (WebCore::Document::shouldScheduleLayout):
3227 (WebCore::Document::didRemoveAllPendingStylesheet):
3229 Repaints will now get triggered by the normal style mechanism.
3232 (WebCore::Document::hasNodesWithNonFinalStyle):
3233 (WebCore::Document::setHasNodesWithNonFinalStyle):
3235 Track if we need to recompute the style later because non-final or unstyled elements.
3237 (WebCore::Document::didLayoutWithPendingStylesheets): Deleted.
3238 (WebCore::Document::hasNodesWithPlaceholderStyle): Deleted.
3239 (WebCore::Document::setHasNodesWithPlaceholderStyle): Deleted.
3240 * html/HTMLFrameSetElement.cpp:
3241 (WebCore::HTMLFrameSetElement::rendererIsNeeded):
3242 * page/FrameView.cpp:
3243 (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
3245 Don't qualify as visually non-empty if we have loading stylesheets in head (even if there is
3246 a fouc-prevented render tree).
3248 (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
3249 * rendering/RenderBlock.cpp:
3250 (WebCore::RenderBlock::paintContents):
3252 Instead of a global test, block painting if isNonFinal is set in the renderer's style.
3254 * rendering/RenderLayer.cpp:
3255 (WebCore::shouldSuppressPaintingLayer):
3256 * rendering/style/RenderStyle.cpp:
3257 (WebCore::RenderStyle::changeRequiresRepaint):
3259 The isNonFinal flag prevents painting so we need to trigger repaint when it gets cleared.
3261 * rendering/style/RenderStyle.h:
3262 (WebCore::RenderStyle::isNotFinal):
3263 (WebCore::RenderStyle::setIsNotFinal):
3264 (WebCore::RenderStyle::isPlaceholderStyle): Deleted.
3265 (WebCore::RenderStyle::setIsPlaceholderStyle): Deleted.
3267 There is no need for placeholder styles anymore. Reuse the bit for isNotFinal.
3269 * rendering/style/StyleRareNonInheritedData.cpp:
3270 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3271 (WebCore::StyleRareNonInheritedData::operator==):
3272 * rendering/style/StyleRareNonInheritedData.h:
3273 * style/StyleScope.cpp:
3274 (WebCore::Style::Scope::analyzeStyleSheetChange):
3275 (WebCore::Style::Scope::updateActiveStyleSheets):
3276 * style/StyleTreeResolver.cpp:
3277 (WebCore::Style::TreeResolver::styleForElement):
3278 (WebCore::Style::TreeResolver::resolveElement):
3280 If we have seens a loading stylesheet and don't have a renderer yet don't style the element.
3281 In case there is a renderer or we are ignoring pending sheets, resolve the style normally
3282 but mark it as non-final.
3284 (WebCore::Style::makePlaceholderStyle): Deleted.
3286 2017-03-27 Myles C. Maxfield <mmaxfield@apple.com>
3288 Test variation font ranges in the CSS Font Loading API
3289 https://bugs.webkit.org/show_bug.cgi?id=170022
3291 Reviewed by Dean Jackson.
3293 Test: fast/text/variations/font-loading-api-parse-ranges.html
3295 Don't use keywords when reporting font variation range values.
3297 * css/CSSComputedStyleDeclaration.cpp:
3298 (WebCore::ComputedStyleExtractor::fontNonKeywordWeightFromStyleValue):
3299 (WebCore::ComputedStyleExtractor::fontWeightFromStyleValue):
3300 (WebCore::ComputedStyleExtractor::fontNonKeywordStretchFromStyleValue):
3301 (WebCore::ComputedStyleExtractor::fontStretchFromStyleValue):
3302 (WebCore::ComputedStyleExtractor::fontNonKeywordStyleFromStyleValue):
3303 (WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
3304 * css/CSSComputedStyleDeclaration.h:
3306 (WebCore::FontFace::style):
3307 (WebCore::FontFace::weight):
3308 (WebCore::FontFace::stretch):
3310 2017-03-27 Anders Carlsson <andersca@apple.com>
3312 Propagate shipping contact update errors
3313 https://bugs.webkit.org/show_bug.cgi?id=170141
3314 rdar://problem/31276576
3316 Reviewed by Tim Horton.
3318 * Modules/applepay/ApplePaySession.cpp:
3319 (WebCore::convertAndValidate):
3321 2017-03-27 Ryan Haddad <ryanhaddad@apple.com>
3323 Unreviewed, rolling out r214411.
3325 Two of the LayoutTests for this change time out on ios-
3330 "[Modern Media Controls] Improve media documents across macOS,
3332 https://bugs.webkit.org/show_bug.cgi?id=169145
3333 http://trac.webkit.org/changeset/214411
3335 2017-03-27 Antoine Quint <graouts@apple.com>
3337 [Modern Media Controls] Clicking on the tracks button when the tracks panel is up in a media document pauses the video
3338 https://bugs.webkit.org/show_bug.cgi?id=168517
3339 <rdar://problem/30577636>
3341 Reviewed by Dean Jackson.
3343 We completely turn off default event handling in MediaDocument.cpp since we're implementing the
3344 behavior we expect to pause and resume the video in the modern-media-controls module already. This
3345 gets rid of this odd case where the content would not see the "click" event while the C++ side would
3346 handle it and pause the video.
3348 * Modules/modern-media-controls/media/media-controller.js:
3350 (MediaController.prototype.handleEvent):
3351 (MediaController.prototype._containerWasClicked): Deleted.
3352 * html/MediaDocument.cpp:
3353 (WebCore::MediaDocument::defaultEventHandler):
3355 2017-03-27 Youenn Fablet <youenn@apple.com>
3357 Tighten RTCDatachannel creation and parameter getters
3358 https://bugs.webkit.org/show_bug.cgi?id=170081
3360 Reviewed by Eric Carlson.
3362 Covered by updated tests.
3364 Adding some parameter checks when creating data channels.
3365 Making some getters nullable as per the spec.
3367 * Modules/mediastream/RTCDataChannel.h:
3368 * Modules/mediastream/RTCDataChannel.idl:
3369 * Modules/mediastream/RTCPeerConnection.cpp:
3370 (WebCore::RTCPeerConnection::createDataChannel):
3371 * Modules/mediastream/RTCPeerConnection.idl:
3372 * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3373 (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
3374 (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
3375 * platform/mediastream/RTCDataChannelHandler.h:
3378 2017-03-27 Youenn Fablet <youenn@apple.com>
3380 Add support for RTCRtpReceiver/RTCRtpSender getParameters
3381 https://bugs.webkit.org/show_bug.cgi?id=170057
3383 Reviewed by Alex Christensen.
3385 Test: webrtc/video-getParameters.html
3387 getParameters returns a dictionary of values taken from libwebrtc RtpReceiverInterface/RtpSenderInrterface objects.
3388 Added a direct link between WebCore RTCRtpReceiver and libwebrtc RtpReceiverInterface object.
3389 Making the link between WebCore RTCRtpSender and libwebrtc RtpSenderInrterface object through
3390 PeerConnectionBackend to keep the current architecture shared with OpenWebRTC.
3391 In the future, we should try to make the link more direct.
3393 Added routines to support the conversion from libwebrtc to WebCore.
3394 Ensured that RTCRtpReceiver is cleaning its backend when being stopped.
3397 * DerivedSources.make:
3398 * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3399 (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
3400 * Modules/mediastream/PeerConnectionBackend.h:
3401 (WebCore::PeerConnectionBackend::getParameters):
3402 * Modules/mediastream/RTCPeerConnection.cpp:
3403 (WebCore::RTCPeerConnection::doClose):
3404 (WebCore::RTCPeerConnection::getParameters):
3405 * Modules/mediastream/RTCPeerConnection.h:
3406 * Modules/mediastream/RTCRtpParameters.h: Added.
3407 * Modules/mediastream/RTCRtpParameters.idl: Added.
3408 * Modules/mediastream/RTCRtpReceiver.cpp:
3409 (WebCore::RTCRtpReceiver::RTCRtpReceiver):