018ac36dbc5992b95743ba066d8ebc207d7f08a9
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-15  David Kilzer  <ddkilzer@apple.com>
2
3         Fix -Wreturn-std-move warnings in WebKit found by new clang compiler
4         <https://webkit.org/b/185621>
5
6         Reviewed by Youenn Fablet.
7
8         Fix warnings like the following:
9
10             In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
11             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
12                     return sdp;
13                            ^~~
14             ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
15                     return sdp;
16                            ^~~
17                            std::move(sdp)
18             1 error generated.
19
20         * Modules/mediastream/PeerConnectionBackend.cpp:
21         (WebCore::PeerConnectionBackend::filterSDP const):
22         * accessibility/AccessibilityObject.cpp:
23         (WebCore::rangeClosestToRange):
24         * bindings/js/JSDOMConvertSequences.h:
25         (WebCore::Detail::GenericSequenceConverter::convert):
26         (WebCore::Detail::NumericSequenceConverter::convertArray):
27         * bindings/js/JSDOMConvertStrings.cpp:
28         (WebCore::stringToByteString):
29         (WebCore::stringToUSVString):
30         - Use WTFMove() in return statements to fix the warnings.
31
32 2018-05-14  Dean Jackson  <dino@apple.com>
33
34         Download and present System Preview
35         https://bugs.webkit.org/show_bug.cgi?id=185459
36         <rdar://problem/40079228>
37
38         Reviewed by Tim Horton.
39
40         If an <a> is a system preview, tell the resource request about it.
41
42         * html/HTMLAnchorElement.cpp:
43         (WebCore::HTMLAnchorElement::handleClick):
44
45 2018-05-15  Antti Koivisto  <antti@apple.com>
46
47         animation-play-state: paused causes very high cpu load because of style invalidation loop
48         https://bugs.webkit.org/show_bug.cgi?id=182436
49         <rdar://problem/37182562>
50
51         Reviewed by Dean Jackson.
52
53         Test: animations/animation-playstate-paused-style-resolution.html
54
55         If the style of an element with 'animation-play-state: paused' is recomputed so it stays
56         paused we would enter zero-duration animation timer loop.
57
58         * page/animation/AnimationBase.cpp:
59         (WebCore::AnimationBase::updateStateMachine):
60
61         Don't move to AnimationState::PausedWaitResponse unless we get AnimationStateInput::StyleAvailable
62         (matching the comments). Otherwise just stay in the existing paused state.
63
64         Remove AnimationStateInput::StartAnimation from assertion as the case can't happen.
65
66 2018-05-14  Youenn Fablet  <youenn@apple.com>
67
68         readableStreamDefaultControllerError should return early if stream is not readable
69         https://bugs.webkit.org/show_bug.cgi?id=185602
70
71         Reviewed by Chris Dumez.
72
73         Return early if stream is not readable in @readableStreamDefaultControllerError.
74         Update call sites to no longer check for ReadableStream state.
75         Covered by unflaked and rebased tests.
76
77         * Modules/streams/ReadableStreamDefaultController.js:
78         (error):
79         * Modules/streams/ReadableStreamInternals.js:
80         (readableStreamDefaultControllerError):
81         (readableStreamDefaultControllerCallPullIfNeeded):
82
83 2018-05-14  Zalan Bujtas  <zalan@apple.com>
84
85         [LFC] Implement width computation for non-replaced block level inflow elements.
86         https://bugs.webkit.org/show_bug.cgi?id=185641
87
88         Reviewed by Sam Weinig.
89
90         Block level inflow elements participate in block formatting context.
91
92         * layout/FormattingContext.cpp:
93         (WebCore::Layout::FormattingContext::computeWidth const):
94         * layout/FormattingContext.h:
95         * layout/blockformatting/BlockFormattingContext.cpp:
96         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
97         * layout/blockformatting/BlockFormattingContext.h:
98         * layout/inlineformatting/InlineFormattingContext.cpp:
99         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
100         * layout/inlineformatting/InlineFormattingContext.h:
101
102 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
103
104         Unreviewed, fix the iOS build after r231779
105
106         Also address a minor in-person review comment by returning "extrazoom" instead of the empty string.
107
108         * page/DisabledAdaptations.cpp:
109         (WebCore::extraZoomModeAdaptationName):
110
111 2018-05-14  Zalan Bujtas  <zalan@apple.com>
112
113         [LFC] FormattingContext:computeOutOfFlowNonReplacedHeight/Width should use the computed margins/paddings/borders
114         https://bugs.webkit.org/show_bug.cgi?id=185633
115
116         Reviewed by Sam Weinig.
117
118         By the time we start computing height and width, DisplayBox should already have the computed values for margin/padding/border.
119
120         * layout/FormattingContext.cpp:
121         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
122         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
123         * layout/displaytree/DisplayBox.h:
124         (WebCore::Display::Box::paddingTop const):
125         (WebCore::Display::Box::paddingLeft const):
126         (WebCore::Display::Box::paddingBottom const):
127         (WebCore::Display::Box::paddingRight const):
128         (WebCore::Display::Box::borderTop const):
129         (WebCore::Display::Box::borderLeft const):
130         (WebCore::Display::Box::borderBottom const):
131         (WebCore::Display::Box::borderRight const):
132
133 2018-05-14  Wenson Hsieh  <wenson_hsieh@apple.com>
134
135         [Extra zoom mode] Google search results are excessively zoomed in
136         https://bugs.webkit.org/show_bug.cgi?id=185347
137         <rdar://problem/39999778>
138
139         Reviewed by Tim Horton.
140
141         It turns out that basing minimum layout size and shrink-to-fit behaviors off of the `shrink-to-fit` viewport
142         argument poses compatibility risks with web pages that already specify `shrink-to-fit` to opt out of default
143         viewport shrinking behaviors in 1/3 multitasking mode on iPad.
144
145         One way to resolve this is to introduce a new viewport meta content attribute to disable viewport heuristics in
146         extra zoom mode. However, combined shrink-to-fit and minimum device width behaviors are difficult to describe
147         using a single backwards-compatible viewport meta content attribute, and the need to suppress the default
148         behavior of `shrink-to-fit=no` if such an attribute is not disabled further muddles our viewport story.
149
150         After some internal deliberation, we’ve decided to experiment with a new meta tag named "disabled-adaptations".
151         The content of this meta tag is a comma-separated list of adaptation names; if an adaptation name matches a
152         known adaptation type (for instance, extra zoom mode), we disable the class of behaviors used to adapt web
153         content. The first and only known adaptation type is extra zoom mode, which affects `shrink-to-fit` and layout
154         size adjustments.
155
156         See per-method changes below for more details.
157
158         Test: fast/viewport/extrazoom/viewport-disable-extra-zoom-adaptations.html
159
160         * Sources.txt:
161         * WebCore.xcodeproj/project.pbxproj:
162         * dom/Document.cpp:
163         (WebCore::Document::processDisabledAdaptations):
164         * dom/Document.h:
165         (WebCore::Document::disabledAdaptations const):
166
167         Add disabled adaptations to Document. Changes to disabled adaptations are not propagated if the parsed disabled
168         adaptation types don't change; upon changing adaptation types, notify the client to adjust for the new disabled
169         adaptations (currently, this only affects the viewport configuration).
170
171         * dom/ViewportArguments.h:
172         * html/HTMLMetaElement.cpp:
173         (WebCore::HTMLMetaElement::process):
174         * html/parser/HTMLPreloadScanner.cpp:
175         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
176         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
177         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
178         * loader/FrameLoader.cpp:
179         (WebCore::FrameLoader::commitProvisionalLoad):
180
181         Restore the set of disabled adaptations when restoring a page from the cache.
182
183         * page/Chrome.cpp:
184         (WebCore::Chrome::dispatchDisabledAdaptationsDidChange const):
185         * page/Chrome.h:
186         * page/ChromeClient.h:
187
188         Add plumbing for changes to the set of disabled adaptations.
189
190         * page/DisabledAdaptations.cpp: Added.
191         (WebCore::extraZoomModeAdaptationName):
192         * page/DisabledAdaptations.h: Added.
193
194         Introduce a header containing a new enum for the extra zoom mode adaptation, as well as a helper function to
195         return the extra zoom mode adaptation name.
196
197         * page/Page.cpp:
198         (WebCore::Page::disabledAdaptations const):
199
200         Returns the mainframe's set of adaptations to disable.
201
202         * page/Page.h:
203         * page/RemoteFrame.h:
204         * page/RuntimeEnabledFeatures.h:
205         (WebCore::RuntimeEnabledFeatures::setDisabledAdaptationsMetaTagEnabled):
206         (WebCore::RuntimeEnabledFeatures::disabledAdaptationsMetaTagEnabled const):
207
208         Add a new runtime feature to gate handling the "disabled-adaptations" meta tag.
209
210         * page/ViewportConfiguration.cpp:
211         (WebCore::shouldOverrideShrinkToFitArgument):
212         (WebCore::needsUpdateAfterChangingDisabledAdaptations):
213         (WebCore::ViewportConfiguration::setDisabledAdaptations):
214         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
215
216         Consult whether or not extra zoom mode adaptations are disabled, instead of the shrink-to-fit attribute value.
217
218         (WebCore::ViewportConfiguration::updateConfiguration):
219         * page/ViewportConfiguration.h:
220
221         Add an OptionSet of disabled adaptation types to ViewportConfiguration. Updates to the adaptation type are
222         propagated to the ViewportConfiguration from Document, through the ChromeClient and the client layer (refer to
223         changes in WebKit). Once the OptionSet is changed, we recompute the viewport configuration only if needed by the
224         platform.
225
226         (WebCore::ViewportConfiguration::viewLayoutSize const):
227         (WebCore::ViewportConfiguration::disabledAdaptations const):
228         * page/WindowFeatures.cpp:
229         (WebCore::parseDisabledAdaptations):
230         * page/WindowFeatures.h:
231
232         Add a new helper to parse the meta content of a "disabled-adaptations" tag as an OptionSet of disabled
233         adaptation types. The string is parsed by first splitting on the comma character, and then iterating over lower
234         case, whitespace-stripped tokens to look for known adaptation names. So far, only extra zoom mode is supported.
235
236         * testing/Internals.cpp:
237         (WebCore::Internals::extraZoomModeAdaptationName const):
238         * testing/Internals.h:
239         * testing/Internals.idl:
240
241         Expose the extra zoom mode adaptation name to the DOM, only when running layout tests.
242
243 2018-05-14  Joanmarie Diggs  <jdiggs@igalia.com>
244
245         AX: Listbox and Combobox roles embedded in labels should participate in name calculation
246         https://bugs.webkit.org/show_bug.cgi?id=185521
247
248         Reviewed by Chris Fleizach.
249
250         Take selected children into account when computing the name in accessibleNameForNode.
251         Add ListBox to the roles for which accessibleNameDerivesFromContent returns false so
252         that native select elements with size > 1 are treated the same way as ARIA listbox.
253         Also add ListBox to the roles which are treated as controls when used in ARIA. Finally,
254         prevent labels which contain unrelated controls from being used as an AXTitleUIElement.
255         This causes us to build a string from the label and its descendants, ensuring the latter
256         participate in the name calculation.
257
258         Test: accessibility/text-alternative-calculation-from-listbox.html
259
260         * accessibility/AccessibilityLabel.cpp:
261         (WebCore::childrenContainUnrelatedControls):
262         (WebCore::AccessibilityLabel::containsUnrelatedControls const):
263         * accessibility/AccessibilityLabel.h:
264         * accessibility/AccessibilityNodeObject.cpp:
265         (WebCore::accessibleNameForNode):
266         * accessibility/AccessibilityObject.cpp:
267         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
268         (WebCore::AccessibilityObject::isARIAControl):
269         * accessibility/AccessibilityRenderObject.cpp:
270         (WebCore::AccessibilityRenderObject::exposesTitleUIElement const):
271         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
272
273 2018-05-14  Antoine Quint  <graouts@apple.com>
274
275         [Web Animations] Tests using the new animation engine may crash under WebCore::FrameView::didDestroyRenderTree when using internals methods
276         https://bugs.webkit.org/show_bug.cgi?id=185612
277         <rdar://problem/39579344>
278
279         Reviewed by Dean Jackson.
280
281         Add a new internals.pseudoElement() method to obtain a pseudo element matching a given pseudo-id. This is necessary to be able to move off
282         internals.pauseTransitionAtTimeOnPseudoElement() and internals.pauseAnimationAtTimeOnPseudoElement() for Web Animations testing.
283
284         * testing/Internals.cpp:
285         (WebCore::Internals::pseudoElement):
286         * testing/Internals.h:
287         * testing/Internals.idl:
288
289 2018-05-14  Antoine Quint  <graouts@apple.com>
290
291         REGRESSION (r230574): Interrupted hardware transitions don't behave correctly
292         https://bugs.webkit.org/show_bug.cgi?id=185299
293         <rdar://problem/39630230>
294
295         Reviewed by Simon Fraser.
296
297         In r230574, the fix for webkit.org/b/184518, we changed the processing order in GraphicsLayerCA::updateAnimations() to first
298         process m_uncomittedAnimations and then m_animationsToProcess, so we are guaranteed animations exist before we attempt to pause
299         or seek them. This broke interrupting and resuming hardware animations (such as an interrupted CSS Transition or an animation
300         running in a non-visible tab) since a pause operation recorded _before_ an animation was added would be paused anyway since
301         the animation was now first added, and then paused. The fix is simply to clear any pending AnimationProcessingAction for a
302         newly-uncommitted animation.
303
304         Test: transitions/interrupted-transition-hardware.html
305
306         * platform/graphics/ca/GraphicsLayerCA.cpp:
307         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
308         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
309         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
310         * platform/graphics/ca/GraphicsLayerCA.h:
311         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
312
313 2018-05-14  Thibault Saunier  <tsaunier@igalia.com>
314
315         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamerBase
316         https://bugs.webkit.org/show_bug.cgi?id=185510
317
318         Reviewed by Philippe Normand.
319
320         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:629:  More than one command on the same line  [whitespace/newline] [4]
321         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:684:  More than one command on the same line  [whitespace/newline] [4]
322         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:807:  More than one command on the same line  [whitespace/newline] [4]
323
324         Indentation and style issue fixed only.
325
326         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
327         (WebCore::MediaPlayerPrivateGStreamerBase::volumeChangedCallback):
328         (WebCore::MediaPlayerPrivateGStreamerBase::muteChangedCallback):
329         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
330
331 2018-05-14  Zalan Bujtas  <zalan@apple.com>
332
333         [LFC] Implement height computation for non-replaced out of flow elements.
334         https://bugs.webkit.org/show_bug.cgi?id=185585
335
336         Reviewed by Antti Koivisto.
337
338         * layout/FormattingContext.cpp:
339         (WebCore::Layout::FormattingContext::computeHeight const):
340         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
341         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
342         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedHeight const):
343         (WebCore::Layout::FormattingContext::computeHeightForBlockFormattingContextRootWithAutoHeight const):
344         * layout/FormattingContext.h:
345         * layout/blockformatting/BlockFormattingContext.h:
346         * layout/displaytree/DisplayBox.h:
347
348 2018-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
349
350         Renaming of overrides in LayoutBox
351         https://bugs.webkit.org/show_bug.cgi?id=185609
352
353         Reviewed by Javier Fernandez.
354
355         The names of the methods for the overrides were not consistent,
356         this patch fixes it by using the same structure in all the cases.
357
358         No new tests, no change of behavior.
359
360         * rendering/GridLayoutFunctions.cpp:
361         (WebCore::GridLayoutFunctions::hasOverrideContainingBlockContentSizeForChild):
362         * rendering/GridTrackSizingAlgorithm.cpp:
363         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
364         * rendering/RenderBlock.cpp:
365         (WebCore::RenderBlock::computeChildPreferredLogicalWidths const):
366         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
367         * rendering/RenderBlockFlow.cpp:
368         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
369         * rendering/RenderBlockLineLayout.cpp:
370         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
371         * rendering/RenderBox.cpp:
372         (WebCore::RenderBox::willBeDestroyed):
373         (WebCore::RenderBox::hasOverrideContentLogicalHeight const):
374         (WebCore::RenderBox::hasOverrideContentLogicalWidth const):
375         (WebCore::RenderBox::setOverrideContentLogicalHeight):
376         (WebCore::RenderBox::setOverrideContentLogicalWidth):
377         (WebCore::RenderBox::clearOverrideContentLogicalHeight):
378         (WebCore::RenderBox::clearOverrideContentLogicalWidth):
379         (WebCore::RenderBox::clearOverrideContentSize):
380         (WebCore::RenderBox::overrideContentLogicalWidth const):
381         (WebCore::RenderBox::overrideContentLogicalHeight const):
382         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth const):
383         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight const):
384         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalWidth const):
385         (WebCore::RenderBox::hasOverrideContainingBlockContentLogicalHeight const):
386         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
387         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
388         (WebCore::RenderBox::clearOverrideContainingBlockContentSize):
389         (WebCore::RenderBox::clearOverrideContainingBlockContentLogicalHeight):
390         (WebCore::RenderBox::containingBlockLogicalWidthForContent const):
391         (WebCore::RenderBox::containingBlockLogicalHeightForContent const):
392         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight const):
393         (WebCore::RenderBox::computeLogicalWidthInFragment const):
394         (WebCore::RenderBox::computeLogicalHeight const):
395         (WebCore::RenderBox::computePercentageLogicalHeight const):
396         (WebCore::RenderBox::computeReplacedLogicalHeightUsing const):
397         (WebCore::RenderBox::availableLogicalHeightUsing const):
398         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned const):
399         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned const):
400         * rendering/RenderBox.h:
401         * rendering/RenderBoxModelObject.cpp:
402         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const):
403         * rendering/RenderDeprecatedFlexibleBox.cpp:
404         (WebCore::contentWidthForChild):
405         (WebCore::contentHeightForChild):
406         (WebCore::gatherFlexChildrenInfo):
407         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
408         (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
409         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
410         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
411         * rendering/RenderFlexibleBox.cpp:
412         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
413         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
414         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
415         (WebCore::RenderFlexibleBox::constructFlexItem):
416         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
417         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
418         * rendering/RenderFullScreen.cpp:
419         (WebCore::RenderFullScreen::unwrapRenderer):
420         * rendering/RenderGrid.cpp:
421         (WebCore::RenderGrid::layoutBlock):
422         (WebCore::RenderGrid::layoutGridItems):
423         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
424         * rendering/RenderRubyBase.cpp:
425         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds const):
426         * rendering/RenderTableCell.cpp:
427         (WebCore::RenderTableCell::setOverrideContentLogicalHeightFromRowHeight):
428         * rendering/RenderTableCell.h:
429         * rendering/RenderTableSection.cpp:
430         (WebCore::RenderTableSection::calcRowLogicalHeight):
431         (WebCore::RenderTableSection::relayoutCellIfFlexed):
432
433 2018-05-14  Zalan Bujtas  <zalan@apple.com>
434
435         [LFC] Implement width computation for non-replaced out of flow elements.
436         https://bugs.webkit.org/show_bug.cgi?id=185598
437
438         Reviewed by Antti Koivisto.
439
440         * layout/FormattingContext.cpp:
441         (WebCore::Layout::FormattingContext::computeWidth const):
442         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
443         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
444         (WebCore::Layout::FormattingContext::computeOutOfFlowNonReplacedWidth const):
445         (WebCore::Layout::FormattingContext::shrinkToFitWidth const):
446         * layout/FormattingContext.h:
447         * layout/blockformatting/BlockFormattingContext.cpp:
448         (WebCore::Layout::BlockFormattingContext::layout const):
449         * layout/displaytree/DisplayBox.h:
450
451 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
452
453         Drop the m_compositorTexture member variable in TextureMapperGC3DPlatformLayer.
454         It's not used at all inside the class or outside it.
455
456         Rubber-stamped by Michael Catanzaro.
457
458         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
459
460 2018-05-14  Zan Dobersek  <zdobersek@igalia.com>
461
462         [GTK] REGRESSION(r231170) Build broken with Clang 5.0
463         https://bugs.webkit.org/show_bug.cgi?id=185198
464
465         Reviewed by Michael Catanzaro.
466
467         Avoid gperf files using the register keyword which has been made
468         reserved and as such unusable in C++17.
469
470         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
471         * css/makeSelectorPseudoElementsMap.py:
472         * css/makeprop.pl:
473         * css/makevalues.pl:
474         * platform/ColorData.gperf:
475         * platform/ReferrerPolicy.h: With std::optional forward declaration
476         gone, explicitly include the WTF Optional.h header.
477         * platform/Theme.h: Ditto.
478         * platform/network/create-http-header-name-table:
479
480 2018-05-14  Commit Queue  <commit-queue@webkit.org>
481
482         Unreviewed, rolling out r219515.
483         https://bugs.webkit.org/show_bug.cgi?id=185603
484
485         It sometimes makes AudioUnitInitialize call to fail in
486         CoreAudioCaptureSource (Requested by youenn on #webkit).
487
488         Reverted changeset:
489
490         "Remove CoreAudioCaptureSource speaker configuration"
491         https://bugs.webkit.org/show_bug.cgi?id=174512
492         https://trac.webkit.org/changeset/219515
493
494 2018-05-13  Dirk Schulze  <krit@webkit.org>
495
496         Implement SVGGeometryElement's isPointInFill and isPointInStroke
497         https://bugs.webkit.org/show_bug.cgi?id=185580
498
499         Reviewed by Antti Koivisto.
500
501         Implement isPointInFill and isPointInStroke methods for
502         SVGGeometryElement interface from SVG2.
503
504         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
505
506         Tests: svg/dom/SVGGeometry-isPointInFill.xhtml
507                svg/dom/SVGGeometry-isPointInStroke.xhtml
508
509         * rendering/svg/RenderSVGEllipse.cpp:
510         (WebCore::RenderSVGEllipse::shapeDependentStrokeContains): Flag
511                 to switch between local and "global" coordinate space for hit testing.
512         * rendering/svg/RenderSVGEllipse.h:
513         * rendering/svg/RenderSVGPath.cpp:
514         (WebCore::RenderSVGPath::shapeDependentStrokeContains): Flag
515                 to switch between local and "global" coordinate space for hit testing.
516         * rendering/svg/RenderSVGPath.h:
517         * rendering/svg/RenderSVGRect.cpp:
518         (WebCore::RenderSVGRect::shapeDependentStrokeContains): Flag
519                 to switch between local and "global" coordinate space for hit testing.
520         * rendering/svg/RenderSVGRect.h:
521         * rendering/svg/RenderSVGShape.cpp:
522         (WebCore::RenderSVGShape::shapeDependentStrokeContains): Flag
523                 to switch between local and "global" coordinate space for hit testing.
524         (WebCore::RenderSVGShape::isPointInFill): Take the winding rule given by
525                 `fill-rule` to test if a given point is in the fill area of a path.
526         (WebCore::RenderSVGShape::isPointInStroke): Take stroke properties into
527                 account to check if a point is on top of the stroke area.
528         * rendering/svg/RenderSVGShape.h:
529         * svg/SVGGeometryElement.cpp:
530         (WebCore::SVGGeometryElement::isPointInFill):
531         (WebCore::SVGGeometryElement::isPointInStroke):
532         (WebCore::SVGGeometryElement::createElementRenderer): Deleted. This is getting implemented
533                 by inheriting classes. No need to create RenderSVGPath here.
534         * svg/SVGGeometryElement.h:
535         * svg/SVGGeometryElement.idl:
536
537 2018-05-12  Zalan Bujtas  <zalan@apple.com>
538
539         Use WeakPtr for m_enclosingPaginationLayer in RenderLayer
540         https://bugs.webkit.org/show_bug.cgi?id=185566
541         <rdar://problem/36486052>
542
543         Reviewed by Simon Fraser.
544
545         Since RenderLayer does not own the enclosing pagination layout, it should
546         construct a weak pointer instead of holding on to a raw pointer.
547
548         Unable to create a reliably reproducible test case.
549
550         * page/mac/EventHandlerMac.mm:
551         (WebCore::scrollableAreaForEventTarget):
552         (WebCore::scrollableAreaForContainerNode):
553         (WebCore::EventHandler::platformPrepareForWheelEvents):
554         * platform/ScrollableArea.h:
555         (WebCore::ScrollableArea::weakPtrFactory const):
556         (WebCore::ScrollableArea::createWeakPtr): Deleted.
557         * rendering/RenderLayer.cpp:
558         (WebCore::RenderLayer::RenderLayer):
559         (WebCore::RenderLayer::updatePagination):
560         * rendering/RenderLayer.h:
561
562 2018-05-11  Daniel Bates  <dabates@apple.com>
563
564         X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
565         https://bugs.webkit.org/show_bug.cgi?id=185567
566         <rdar://problem/40175008>
567
568         Reviewed by Brent Fulgham.
569
570         Change the behavior of "X-Frame-Options: SAMEORIGIN" to ensure that all ancestors frames
571         are same-origin with the document that delivered this header. This prevents an intermediary
572         malicious frame from clickjacking a child frame whose document is same-origin with the top-
573         level frame. It also makes the behavior of X-Frame-Options in WebKit more closely match
574         the behavior of X-Frame-Options in other browsers, including Chrome and Firefox.
575         
576         Currently a document delivered with "X-Frame-Options: SAMEORIGIN" must only be same-origin
577         with the top-level frame's document in order to be displayed. This prevents clickjacking by
578         a malicious page that embeds a page delivered with "X-Frame-Options: SAMEORIGIN". However,
579         it does not protect against clickjacking of the "X-Frame-Options: SAMEORIGIN" page (victim)
580         if embedded by an intermediate malicious iframe, say a "rogue ad", that was embedded in a
581         document same origin with the victim page. We should protect against such attacks. 
582
583         Tests: http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-allow.html
584                http/tests/security/XFrameOptions/x-frame-options-ancestors-same-origin-deny.html
585
586         * loader/FrameLoader.cpp:
587         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
588
589 2018-05-11  Daniel Bates  <dabates@apple.com>
590
591         [iOS] Text decoration of dragged content does not paint with opacity
592         https://bugs.webkit.org/show_bug.cgi?id=185551
593         <rdar://problem/40166867>
594
595         Reviewed by Wenson Hsieh.
596
597         Respect alpha when painting the text decoration for dragged content.
598
599         * rendering/InlineTextBox.cpp:
600         (WebCore::InlineTextBox::MarkedTextStyle::areDecorationMarkedTextStylesEqual): Consider alpha when
601         comparing decoration styles for equality so that we do not coalesce styles with differing alpha.
602         (WebCore::InlineTextBox::paintMarkedTextDecoration): Respect alpha when painting dragged content.
603
604 2018-05-11  Nan Wang  <n_wang@apple.com>
605
606         AX: In role=dialog elements with aria-modal=true VoiceOver iOS/macOS can't manually focus or read dialog paragraph description text inside the modal.
607         https://bugs.webkit.org/show_bug.cgi?id=185219
608         <rdar://problem/39920009>
609
610         Reviewed by Chris Fleizach.
611
612         The text node descendants of a modal dialog are ignored. Fixed it by using AccessibilityObject's 
613         node() to determine if it's the descendant of the modal dialog node.
614
615         Test: accessibility/aria-modal-text-descendants.html
616
617         * accessibility/AccessibilityObject.cpp:
618         (WebCore::AccessibilityObject::isModalDescendant const):
619
620 2018-05-11  Ryosuke Niwa  <rniwa@webkit.org>
621
622         Tapping after CSS-based table casues an infinite loop in wordRangeFromPosition
623         https://bugs.webkit.org/show_bug.cgi?id=185465
624         <rdar://problem/35263057>
625
626         Reviewed by Antti Koivisto.
627
628         The bug was caused by TextIterator not emitting a line break when exiting a CSS-based table when an element
629         with `display: table-row` has an invisible text node. Specifically, TextIterator::exitNode is never called on
630         an element with `table-cell: row` when m_node is a text node with whitespaces which appears after an element
631         with `display: table-cell`.
632
633         For example, for a tree structure like:
634         table-row (R)
635           table-cell (C)
636             "text" (1)
637           " " (2)
638         Getting out of (C) would result in moving onto (2) without generating a line break for (R).
639
640         When this happens in nextBoundary as it tries to find the end of the last word in the table cell, we end up
641         finding the end of the document as the end of the word. As a result, nextWordBoundaryInDirection, the caller
642         of nextBoundary, ends up infinite looping between the positon at the end of the document and the position
643         immediately before the last word in the last table cell when it traverses words backwards.
644
645         This patch fixes the hang by addressing this root cause in TextIterator. Namely, TextIterator now generates
646         a line break when exiting a block while walking up ancestors in TextIterator::advance().
647
648         Tests: editing/selection/tapping-in-table-at-end-of-document.html
649                editing/text-iterator/table-at-end-of-document.html
650
651         * editing/TextIterator.cpp:
652         (WebCore::TextIterator::advance): Fixed the bug.
653         (WebCore::shouldEmitNewlineAfterNode): Do generate a new line at the end of a document when we're trying to
654         generate every visible poitions even there are no renderers beyond this point. e.g. a position inside the
655         last cell of a table at the end of a document hits this condition.
656         (WebCore::shouldEmitExtraNewlineForNode): Don't emit a line break when the render box's height is 0px
657         to avoid generating many empty lines for empty paragraph and header elements (this function is used to generate
658         a blank line between p's and h1/h2/...'s).
659         (WebCore::TextIterator::exitNode):
660
661 2018-05-11  Dean Jackson  <dino@apple.com>
662
663         System preview badge doesn't show on <picture> elements
664         https://bugs.webkit.org/show_bug.cgi?id=185559
665         <rdar://problem/40150066>
666
667         Reviewed by Tim Horton.
668
669         We should also identify <img>s that are the child of a <picture>
670         contained inside the appropriate <a> element.
671
672         Tested internally, since the badge is platform specific.
673
674         * html/HTMLImageElement.cpp:
675         (WebCore::HTMLImageElement::isSystemPreviewImage const): Add logic
676         to look for <picture> parents.
677
678 2018-05-11  Chris Dumez  <cdumez@apple.com>
679
680         REGRESSION (async policy delegate): Revoking an object URL immediately after triggering download breaks file download
681         https://bugs.webkit.org/show_bug.cgi?id=185531
682         <rdar://problem/39909589>
683
684         Reviewed by Geoffrey Garen.
685
686         Whenever we start an asynchronous navigation policy decision for a blob URL, create a temporary
687         blob URL pointing to the same data, and update the request's URL. This way, if the page's JS revokes
688         the URL during the policy decision, the load will still succeed.
689
690         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-then-revoke.html
691
692         * loader/DocumentLoader.cpp:
693         (WebCore::DocumentLoader::willSendRequest):
694         * loader/FrameLoader.cpp:
695         (WebCore::FrameLoader::loadURL):
696         (WebCore::FrameLoader::load):
697         (WebCore::FrameLoader::loadPostRequest):
698         * loader/PolicyChecker.cpp:
699         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
700         (WebCore::PolicyChecker::checkNavigationPolicy):
701         (WebCore::PolicyChecker::checkNewWindowPolicy):
702         * loader/PolicyChecker.h:
703
704 2018-05-11  Antti Koivisto  <antti@apple.com>
705
706         LinkLoader fails to remove CachedResourceClient in some cases
707         https://bugs.webkit.org/show_bug.cgi?id=185553
708         <rdar://problem/36879656>
709
710         Reviewed by Geoffrey Garen.
711
712         Test: http/tests/preload/link-preload-client-remove.html
713
714         * loader/LinkLoader.cpp:
715         (WebCore::LinkLoader::loadLink):
716
717         If there is a link preload already in progress, we fail to clear the client for the ongoing load.
718         This may leave the CachedResource client map in a bad state.
719
720 2018-05-11  Charles Vazac  <cvazac@gmail.com>
721
722         Runtime feature flag for Server-Timing
723         https://bugs.webkit.org/show_bug.cgi?id=184758
724
725         Reviewed by Youenn Fablet.
726
727         * Source/WebCore/CMakeLists.txt: Added reference to PerformanceServerTiming.idl.
728         * Source/WebCore/DerivedSources.make: Added reference to PerformanceServerTiming.idl.
729         * Source/WebCore/Sources.txt: Added reference to PerformanceServerTiming.cpp and JSPerformanceServerTiming.cpp.
730         * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Added references to PerformanceServerTiming.cpp, PerformanceServerTiming.h, and PerformanceServerTiming.idl.
731         * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Added PerformanceServerTiming.
732         * Source/WebCore/page/PerformanceResourceTiming.h: Added serverTiming member.
733         * Source/WebCore/page/PerformanceResourceTiming.idl: Added serverTiming attribute.
734         * Source/WebCore/page/PerformanceServerTiming.cpp: Added.
735         * Source/WebCore/page/PerformanceServerTiming.h: Added.
736         * Source/WebCore/page/PerformanceServerTiming.idl: Added.
737
738 2018-05-11  Brady Eidson  <beidson@apple.com>
739
740         Make sure history navigations reuse the existing process when necessary.
741         <rdar://problem/39746516> and https://bugs.webkit.org/show_bug.cgi?id=185532
742
743         Reviewed by Ryosuke Niwa.
744
745         Covered by new API tests.
746
747         In WebCore-land, make sure *all* NavigationActions to a back/forward item are tagged with
748         the item identifier.
749
750         * history/HistoryItem.cpp:
751         (WebCore::HistoryItem::HistoryItem):
752         (WebCore::HistoryItem::logString const):
753         * history/HistoryItem.h:
754
755         * loader/FrameLoader.cpp:
756         (WebCore::FrameLoader::loadDifferentDocumentItem):
757
758         * loader/NavigationAction.cpp:
759         (WebCore::NavigationAction::setTargetBackForwardItem):
760
761         * loader/NavigationAction.h:
762         (WebCore::NavigationAction::targetBackForwardItemIdentifier const):
763
764 2018-05-11  Yacine Bandou  <yacine.bandou_ext@softathome.com>
765
766         [EME][GStreamer] Handle the protection event in MediaPlayerPrivate
767         https://bugs.webkit.org/show_bug.cgi?id=185535
768
769         Reviewed by Xabier Rodriguez-Calvar.
770
771         This patch is based on this calvaris's commit
772         https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d966168b0d2b65f9ca9415426e26d3752c78b03e
773
774         It adds a handler for the protection event in MediaPalyerPrivateGStreamerBase, it extracts the InitData from the event
775         and sends the encrypted event to JS via HTMLMediaElement.
776         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
777         (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
778         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
779         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
780         * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Add a new type InitData.
781
782 2018-05-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
783
784         [Curl] Make the cipher suites, the signing algorithms and the curve lists configurable.
785         https://bugs.webkit.org/show_bug.cgi?id=185139
786
787         Add interface to configure the cipher suites, the signing algorithms and the curve lists 
788         used by OpenSSL and libcurl to exchange, to sign or to verify keys.
789
790         Reviewed by Youenn Fablet.
791
792         No new tests in public. Have tested internally.
793
794         * platform/network/curl/CurlContext.cpp:
795         (WebCore::CurlHandle::setSslCipherList):
796         * platform/network/curl/CurlContext.h:
797         * platform/network/curl/CurlRequest.cpp:
798         (WebCore::CurlRequest::setupTransfer):
799         (WebCore::CurlRequest::willSetupSslCtx):
800         * platform/network/curl/CurlSSLHandle.cpp:
801         (WebCore::CurlSSLHandle::getCACertPathEnv):
802         * platform/network/curl/CurlSSLHandle.h:
803         (WebCore::CurlSSLHandle::getCipherList const):
804         (WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
805         (WebCore::CurlSSLHandle::getCurvesList const):
806         (WebCore::CurlSSLHandle::setCipherList):
807         (WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
808         (WebCore::CurlSSLHandle::setCurvesList):
809         (WebCore::CurlSSLHandle::getCACertPath const):
810         (WebCore::CurlSSLHandle::setCACertPath):
811         * platform/network/curl/CurlSSLVerifier.cpp:
812         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
813
814 2018-05-10  Daniel Bates  <dabates@apple.com>
815
816         Use PlatformStrategies to switch between WebKit and WebKitLegacy checking of CSP frame-ancestors and X-Frame-Options
817         https://bugs.webkit.org/show_bug.cgi?id=185412
818
819         Reviewed by Ryosuke Niwa.
820
821         Consolidate the knowledge on how to determine whether security checks were performed on a ResourceResponse
822         into LoaderStrategy::havePerformedSecurityChecks() (default implementation returns false) and query it
823         to determine whether CSP frame-ancestors and X-Frame-Options need to be checked for a ResourceResponse.
824
825         Additionally, rename LoaderStrategy::isDoingLoadingSecurityChecks() to shouldPerformSecurityChecks()
826         for consistency with havePerformedSecurityChecks(). Querying shouldPerformSecurityChecks() answers the
827         question of whether the loader strategy is responsible for performing security checks when building up
828         a ResourceRequest to have the loader strategy load. And LoaderStrategy::havePerformedSecurityChecks()
829         is used to determine whether the loader strategy performed these security checks for a given ResourceResponse.
830
831         * inspector/agents/InspectorNetworkAgent.cpp:
832         (WebCore::InspectorNetworkAgent::didReceiveResponse):
833         (WebCore::InspectorNetworkAgent::didFinishLoading):
834         (WebCore::isResponseProbablyComingFromNetworkProcess): Deleted.
835         * loader/DocumentLoader.cpp:
836         (WebCore::DocumentLoader::responseReceived):
837         * loader/DocumentThreadableLoader.cpp:
838         (WebCore::shouldPerformSecurityChecks):
839         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
840         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
841         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
842         (WebCore::DocumentThreadableLoader::redirectReceived):
843         (WebCore::DocumentThreadableLoader::didFail):
844         (WebCore::DocumentThreadableLoader::loadRequest):
845         (WebCore::isDoingSecurityChecksInNetworkProcess): Deleted.
846         (WebCore::isResponseComingFromNetworkProcess): Deleted.
847         * loader/LoaderStrategy.cpp:
848         * loader/LoaderStrategy.h:
849         * page/Settings.yaml: Remove setting networkProcessCSPFrameAncestorsCheckingEnabled as we now make
850         use of the loader strategy to determine whether to perform CSP frame-ancestors and X-Frame-Options
851         checking in DocumentLoader.
852         * platform/network/ResourceResponseBase.h:
853         (WebCore::ResourceResponseBase::setSource): Added an ASSERT to catch the programming error of setting
854         source to ResourceResponse::Source::Unknown. This source type represents an uninitialized ResourceResponse.
855
856 2018-05-10  Tim Horton  <timothy_horton@apple.com>
857
858         Lookup sometimes shows a second yellow highlight on top of WebKit's TextIndicator
859         https://bugs.webkit.org/show_bug.cgi?id=185538
860         <rdar://problem/38817825>
861
862         Reviewed by Sam Weinig.
863
864         * editing/mac/DictionaryLookup.mm:
865         (WebCore::showPopupOrCreateAnimationController):
866         Options can be nil, in which case we can't mutableCopy it and add
867         LUTermOptionDisableSearchTermIndicator. Instead, create a new dictionary,
868         and add the items from options, if it's not nil.
869
870 2018-05-10  Matt Baker  <mattbaker@apple.com>
871
872         Web Inspector: ASSERT_NOT_REACHED in PageDebuggerAgent::didAddEventListener when page adds attribute event listener
873         https://bugs.webkit.org/show_bug.cgi?id=181580
874         <rdar://problem/36461309>
875
876         Reviewed by Brian Burg.
877
878         EventTarget should pass newly added EventListeners to InspectorInstrumentation,
879         instead of PageDebuggerAgent assuming the last item in the EventListenerVector
880         is the most recently added listener. This assumption does not hold when
881         the new listener replaces an existing listener.
882
883         * dom/EventTarget.cpp:
884         (WebCore::EventTarget::addEventListener):
885         (WebCore::EventTarget::setAttributeEventListener):
886
887         * inspector/InspectorInstrumentation.cpp:
888         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
889
890         * inspector/InspectorInstrumentation.h:
891         (WebCore::InspectorInstrumentation::didAddEventListener):
892
893         * inspector/agents/page/PageDebuggerAgent.cpp:
894         (WebCore::PageDebuggerAgent::didAddEventListener):
895         * inspector/agents/page/PageDebuggerAgent.h:
896
897 2018-05-10  Chris Dumez  <cdumez@apple.com>
898
899         'Cross-Origin-Options header implementation follow-up
900         https://bugs.webkit.org/show_bug.cgi?id=185520
901
902         Reviewed by Ryosuke Niwa.
903
904         * dom/Document.cpp:
905         * dom/Document.h:
906         * loader/FrameLoader.cpp:
907         (WebCore::FrameLoader::didBeginDocument):
908         Using isNull() check is sufficient here as the header parsing
909         function will do the right thing when passed the empty string.
910         Also set the options directly on the window instead of the
911         document. The window is guaranteed to have been constructed
912         by then because didBeginDocument() is called DocumentWriter::begin()
913         which calls Document::createDOMWindow() or Document::takeDOMWindowFrom().
914
915         * page/AbstractDOMWindow.cpp:
916         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
917         * page/AbstractDOMWindow.h:
918         * page/DOMWindow.cpp:
919         (WebCore::DOMWindow::DOMWindow):
920         (WebCore::DOMWindow::didSecureTransitionTo):
921         * page/RemoteDOMWindow.cpp:
922         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
923         * page/RemoteDOMWindow.h:
924         CrossOriginOptions are now stored only on the Window, not the Document.
925
926         * platform/network/HTTPParsers.cpp:
927         (WebCore::parseCrossOriginOptionsHeader):
928         Drop strippedHeader local variable as it is not strictly needed.
929
930 2018-05-10  Tim Horton  <timothy_horton@apple.com>
931
932         Fix the build after r231393
933         https://bugs.webkit.org/show_bug.cgi?id=185519
934         <rdar://problem/40131741>
935
936         Reviewed by Simon Fraser.
937
938         * Configurations/WebCore.xcconfig:
939
940 2018-05-10  Eric Carlson  <eric.carlson@apple.com>
941
942         Log missing cues correctly
943         https://bugs.webkit.org/show_bug.cgi?id=185499
944         <rdar://problem/40113821>
945
946         Reviewed by Daniel Bates.
947
948         No new tests, tested manually.
949
950         * html/track/InbandGenericTextTrack.cpp:
951         (WebCore::InbandGenericTextTrack::removeGenericCue): Log the cue we searched for, not
952         the NULL cue.
953
954 2018-05-10  Zalan Bujtas  <zalan@apple.com>
955
956         [LFC] Implement height computation for non-replaced inflow elements.
957         https://bugs.webkit.org/show_bug.cgi?id=185474
958
959         Reviewed by Antti Koivisto.
960
961         Initial implementation. Does not cover all the cases.
962
963         * layout/FormattingContext.cpp:
964         (WebCore::Layout::FormattingContext::computeHeight const):
965         * layout/FormattingContext.h:
966         * layout/blockformatting/BlockFormattingContext.cpp:
967         (WebCore::Layout::BlockFormattingContext::layout const):
968         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
969         (WebCore::Layout::BlockFormattingContext::computeInFlowNonReplacedHeight const):
970         * layout/blockformatting/BlockFormattingContext.h:
971         * layout/blockformatting/BlockMarginCollapse.cpp:
972         (WebCore::Layout::collapsedMarginBottomFromLastChild):
973         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent):
974         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
975         (WebCore::Layout::isMarginBottomCollapsedWithParent): Deleted.
976         * layout/blockformatting/BlockMarginCollapse.h:
977         * layout/inlineformatting/InlineFormattingContext.cpp:
978         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
979         * layout/inlineformatting/InlineFormattingContext.h:
980         * layout/layouttree/LayoutBox.cpp:
981         (WebCore::Layout::Box::isReplaced const):
982         * layout/layouttree/LayoutBox.h:
983
984 2018-05-10  Thibault Saunier  <tsaunier@igalia.com>
985
986         [GTK] Implement ImageBuffer::toBGRAData
987         https://bugs.webkit.org/show_bug.cgi?id=185511
988
989         Reviewed by Michael Catanzaro.
990
991         This was never implemented but will be required for the MediaStream API
992         tests.
993
994         * platform/graphics/ImageBuffer.cpp:
995         (WebCore::ImageBuffer::toBGRAData const):
996         * platform/graphics/cg/ImageBufferCG.cpp:
997         (WebCore::ImageBuffer::toBGRAData const):
998         * platform/graphics/gtk/ImageBufferGtk.cpp:
999         (WebCore::ImageBuffer::toBGRAData const):
1000
1001 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1002
1003         [EME][GStreamer] Add a handler for GStreamer protection event
1004         https://bugs.webkit.org/show_bug.cgi?id=185245
1005
1006         Reviewed by Xabier Rodriguez-Calvar.
1007
1008         Qtdemux sends the protection event when encountered a new PSSH box (encrypted content).
1009
1010         The Decryptor is moved from AppendPipeline to PlaybackPipeline (see https://bugs.webkit.org/show_bug.cgi?id=181855),
1011         thus the protection event is no longer handled because the Decryptor is not in the same pipeline as qtdemux.
1012
1013         AppendPipeline: httpsrc-->qtdemux-->appsink
1014         PlaybackPipeline: appsrc-->parser--> decryptor-->decoder-->sink
1015
1016         This patch attaches a probe to the sink pad of the appsink in the appendPipeline in order to
1017         catch and manage the protection event.
1018
1019         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1020         (WebCore::AppendPipeline::AppendPipeline):
1021         (WebCore::AppendPipeline::~AppendPipeline):
1022         (WebCore::appendPipelineAppsinkPadEventProbe):
1023         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1024         (WebCore::AppendPipeline::playerPrivate):
1025
1026 2018-05-10  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1027
1028         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
1029         https://bugs.webkit.org/show_bug.cgi?id=181855
1030
1031         Reviewed by Xabier Rodriguez-Calvar.
1032
1033         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
1034
1035         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
1036         the decrypted GstBuffers that are in SVP memory.
1037         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
1038
1039         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
1040         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
1041
1042         This new architecture also allows to start the buffering before obtaining the DRM license
1043         and it makes easier to manage dynamic change of the license or Key.
1044
1045         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
1046
1047         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
1048         protected by a hardware access control engine, it is not accessible to other unauthorised
1049         software or hardware components.
1050
1051         Tests:
1052             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
1053             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
1054
1055         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1056         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1057         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1058         (WebCore::dumpAppendState):
1059         (WebCore::AppendPipeline::AppendPipeline):
1060         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
1061         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
1062         (WebCore::AppendPipeline::setAppendState):
1063         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1064         (WebCore::AppendPipeline::appsinkNewSample):
1065         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1066         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1067         (WebCore::appendPipelineElementMessageCallback): Deleted.
1068         (WebCore::AppendPipeline::handleElementMessage): Deleted.
1069         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
1070         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
1071         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1072         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1073         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
1074         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
1075
1076 2018-05-09  Nan Wang  <n_wang@apple.com>
1077
1078         AX: VoiceOver iframe scrolling focus jumping bug
1079         https://bugs.webkit.org/show_bug.cgi?id=176615
1080         <rdar://problem/34333067>
1081
1082         Reviewed by Chris Fleizach.
1083
1084         Scrolling to make elements visible is not working correctly for elements inside an
1085         offscreen iframe. Fixed it by using RenderLayer::scrollRectToVisible() to handle
1086         scrolling more properly.
1087
1088         Test: accessibility/scroll-to-make-visible-iframe-offscreen.html
1089
1090         * accessibility/AccessibilityObject.cpp:
1091         (WebCore::AccessibilityObject::scrollToMakeVisible const):
1092
1093 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
1094
1095         AX: accessibleNameForNode should simplify whitespace when using innerText
1096         https://bugs.webkit.org/show_bug.cgi?id=185498
1097
1098         Reviewed by Chris Fleizach.
1099
1100         Test: accessibility/text-alternative-calculation-from-unrendered-table.html
1101
1102         Call simplifyWhiteSpace() before returning the innerText value.
1103
1104         * accessibility/AccessibilityNodeObject.cpp:
1105         (WebCore::accessibleNameForNode):
1106
1107 2018-05-09  Chris Dumez  <cdumez@apple.com>
1108
1109         Add initial support for 'Cross-Origin-Options' HTTP response header
1110         https://bugs.webkit.org/show_bug.cgi?id=184996
1111         <rdar://problem/39664620>
1112
1113         Reviewed by Geoff Garen.
1114
1115         Add initial support for 'Cross-Origin-Options' HTTP response header behind an experimental
1116         feature flag, on by default. When the HTTP server services this HTTP response header for a
1117         main resource, we'll set these options on the corresponding Document. This will impact the
1118         behavior of the Document's associated Window API when cross-origin.
1119
1120         The HTTP header has 3 possible values:
1121         - allow: This is the default. Regular cross-origin Window API is available.
1122         - allow-postmessage: Only postMessage() is available on a cross-origin window, trying to
1123           access anything else will throw a SecurityError.
1124         - deny: Trying to do anything with a cross-origin window will throw a SecurityError.
1125
1126         The header has no effect when accessing same origin windows.
1127
1128         Note that on cross-origin access from Window A to Window B, we check the cross-origin
1129         options for both Window A and Window B and use the lowest common denominator as effective
1130         cross-origin options for the access. So if Window A has 'Cross-Origin-Options: deny' and
1131         tries to call postMessage() on Window B which has 'Cross-Origin-Options: allow-postmessage',
1132         we will throw a SecurityError. This is because Window A's more restrictive options (deny)
1133         apply.
1134
1135         Tests: http/wpt/cross-origin-options/allow-postmessage-from-deny.html
1136                http/wpt/cross-origin-options/allow-postmessage.html
1137                http/wpt/cross-origin-options/cross-origin-options-header.html
1138
1139         * bindings/js/JSDOMBindingSecurity.cpp:
1140         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginOptions):
1141         * bindings/js/JSDOMBindingSecurity.h:
1142         * bindings/js/JSDOMWindowCustom.cpp:
1143         (WebCore::effectiveCrossOriginOptionsForAccess):
1144         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1145         (WebCore::JSDOMWindow::getOwnPropertySlot):
1146         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1147         (WebCore::addCrossOriginWindowPropertyNames):
1148         (WebCore::addScopedChildrenIndexes):
1149         (WebCore::addCrossOriginWindowOwnPropertyNames):
1150         (WebCore::JSDOMWindow::getOwnPropertyNames):
1151         * bindings/js/JSDOMWindowCustom.h:
1152         * bindings/js/JSRemoteDOMWindowCustom.cpp:
1153         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
1154         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
1155         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
1156         * bindings/scripts/CodeGeneratorJS.pm:
1157         (GenerateAttributeGetterBodyDefinition):
1158         (GetCrossOriginsOptionsFromExtendedAttributeValue):
1159         (GenerateAttributeSetterBodyDefinition):
1160         (GenerateOperationBodyDefinition):
1161         * bindings/scripts/IDLAttributes.json:
1162         * dom/Document.cpp:
1163         (WebCore::Document::setCrossOriginOptions):
1164         * dom/Document.h:
1165         (WebCore::Document::crossOriginOptions const):
1166         * loader/FrameLoader.cpp:
1167         (WebCore::FrameLoader::didBeginDocument):
1168         * page/AbstractDOMWindow.cpp:
1169         (WebCore::AbstractDOMWindow::AbstractDOMWindow):
1170         * page/AbstractDOMWindow.h:
1171         (WebCore::AbstractDOMWindow::crossOriginOptions):
1172         (WebCore::AbstractDOMWindow::setCrossOriginOptions):
1173         * page/DOMWindow.cpp:
1174         (WebCore::DOMWindow::DOMWindow):
1175         (WebCore::DOMWindow::didSecureTransitionTo):
1176         * page/DOMWindow.idl:
1177         * page/Frame.h:
1178         * page/RemoteDOMWindow.cpp:
1179         (WebCore::RemoteDOMWindow::RemoteDOMWindow):
1180         * page/RemoteDOMWindow.h:
1181         * page/Settings.yaml:
1182         * platform/network/HTTPHeaderNames.in:
1183         * platform/network/HTTPParsers.cpp:
1184         (WebCore::parseCrossOriginOptionsHeader):
1185         * platform/network/HTTPParsers.h:
1186
1187 2018-05-09  Ryosuke Niwa  <rniwa@webkit.org>
1188
1189         Release assert in TreeScopeOrderedMap::remove via HTMLImageElement::removedFromAncestor
1190         https://bugs.webkit.org/show_bug.cgi?id=185493
1191
1192         Reviewed by Brent Fulgham.
1193
1194         Fixed the bug that HTMLImageElement::removedFromAncestor and HTMLMapElement::removedFromAncestor
1195         were calling removeImageElementByUsemap on the document instead of the shadow tree from which it was removed.
1196
1197         Test: fast/images/imagemap-in-shadow-tree-removed.html
1198
1199         * html/HTMLImageElement.cpp:
1200         (WebCore::HTMLImageElement::removedFromAncestor):
1201         * html/HTMLMapElement.cpp:
1202         (WebCore::HTMLMapElement::removedFromAncestor):
1203
1204 2018-05-09  Joanmarie Diggs  <jdiggs@igalia.com>
1205
1206         AX: Hidden nodes which are not directly referenced should not participate name/description from content
1207         https://bugs.webkit.org/show_bug.cgi?id=185478
1208
1209         Reviewed by Chris Fleizach.
1210
1211         Add a check to AccessibilityNodeObject::textUnderElement() and return early
1212         if the node is hidden, not referenced by aria-labelledby or aria-describedby,
1213         not an HTMLLabelElement, and not fallback content for an HTMLCanvasElement.
1214
1215         Test: accessibility/text-alternative-calculation-hidden-nodes.html
1216
1217         * accessibility/AccessibilityNodeObject.cpp:
1218         (WebCore::AccessibilityNodeObject::textUnderElement const):
1219
1220 2018-05-09  Eric Carlson  <eric.carlson@apple.com>
1221
1222         Update MediaSession to use release logging
1223         https://bugs.webkit.org/show_bug.cgi?id=185376
1224         <rdar://problem/40022203>
1225
1226         Reviewed by Youenn Fablet.
1227
1228         No new tests, tested manually.
1229
1230         * Modules/mediastream/MediaStream.h: hostingDocument() doesn't need to return a const Document.
1231         * Modules/webaudio/AudioContext.cpp:
1232         (WebCore::AudioContext::hostingDocument const): Ditto.
1233         * Modules/webaudio/AudioContext.h:
1234
1235         * html/HTMLMediaElement.h: Ditto.
1236
1237         * html/MediaElementSession.cpp:
1238         (WebCore::MediaElementSession::MediaElementSession):
1239         (WebCore::MediaElementSession::addBehaviorRestriction):
1240         (WebCore::MediaElementSession::removeBehaviorRestriction):
1241         (WebCore::MediaElementSession::dataLoadingPermitted const):
1242         (WebCore::MediaElementSession::fullscreenPermitted const):
1243         (WebCore::MediaElementSession::pageAllowsDataLoading const):
1244         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
1245         (WebCore::MediaElementSession::canShowControlsManager const):
1246         (WebCore::MediaElementSession::showPlaybackTargetPicker):
1247         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
1248         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
1249         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
1250         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
1251         (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
1252         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1253         (WebCore::MediaElementSession::mediaEngineUpdated):
1254         (WebCore::MediaElementSession::willLog const): Deleted.
1255         (WebCore::MediaElementSession::logger const): Deleted.
1256         (WebCore::MediaElementSession::logIdentifier const): Deleted.
1257         (WebCore::MediaElementSession::logChannel const): Deleted.
1258         * html/MediaElementSession.h:
1259
1260         * platform/audio/PlatformMediaSession.cpp:
1261         (WebCore::nextLogIdentifier):
1262         (WebCore::convertEnumerationToString):
1263         (WebCore::PlatformMediaSession::PlatformMediaSession):
1264         (WebCore::PlatformMediaSession::setState):
1265         (WebCore::PlatformMediaSession::beginInterruption):
1266         (WebCore::PlatformMediaSession::endInterruption):
1267         (WebCore::PlatformMediaSession::clientWillBeginAutoplaying):
1268         (WebCore::PlatformMediaSession::clientWillPausePlayback):
1269         (WebCore::PlatformMediaSession::pauseSession):
1270         (WebCore::PlatformMediaSession::stopSession):
1271         (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
1272         (WebCore::PlatformMediaSession::logChannel const):
1273         (WebCore::stateName): Deleted.
1274         (WebCore::interruptionName): Deleted.
1275         * platform/audio/PlatformMediaSession.h:
1276         (WTF::LogArgument<WebCore::PlatformMediaSession::State>::toString):
1277         (WTF::LogArgument<WebCore::PlatformMediaSession::InterruptionType>::toString):
1278
1279 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
1280
1281         [GStreamer] Never call updateTracks if running on legacy pipeline
1282         https://bugs.webkit.org/show_bug.cgi?id=184581
1283
1284         This makes sure failling code path is never reached in the conditions where it should not have been reached.
1285
1286         Reviewed by Philippe Normand.
1287
1288         Re enables all tests that were disabled after fixing.
1289
1290         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1291         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1292
1293 2018-05-09  Daniel Bates  <dabates@apple.com>
1294
1295         REGRESSION (r231479): http/tests/appcache/x-frame-options-prevents-framing.php is timing out
1296         https://bugs.webkit.org/show_bug.cgi?id=185443
1297         <rdar://problem/40100660>
1298
1299         Reviewed by Andy Estes.
1300
1301         Following r231479 when using WebKit2 and Restricted HTTP Response Access is enabled (enabled in
1302         WebKitTestRunner) we only check the CSP frame-ancestors directive and X-Frame-Options in
1303         NetworkProcess. We need to check these security requirements in WebContent process whenever
1304         we are performing a substitute data load, such as for app cache, as these loads do not go
1305         through NetworkProcess.
1306
1307         * loader/DocumentLoader.cpp:
1308         (WebCore::DocumentLoader::responseReceived):
1309
1310 2018-05-09  Justin Fan  <justin_fan@apple.com>
1311
1312         Hooked up ASTC support in WebGL; requires OpenGL ES 3 context to work. 
1313         https://bugs.webkit.org/show_bug.cgi?id=185272
1314         <rdar://problem/15745737>
1315
1316         Reviewed by Dean Jackson.
1317
1318         Also added in Khronos' ASTC test from version 1.0.4 beta of their conformance test suite,
1319         although again, this requires OpenGL ES 3 context for WebKit to detect proper support.
1320
1321         Test: fast/canvas/webgl/webgl-compressed-texture-astc.html
1322
1323         * DerivedSources.make:
1324         * Sources.txt:
1325         * WebCore.xcodeproj/project.pbxproj:
1326         * bindings/js/JSDOMConvertWebGL.cpp:
1327         (WebCore::convertToJSValue):
1328         * html/canvas/WebGL2RenderingContext.cpp:
1329         (WebCore::WebGL2RenderingContext::getExtension):
1330         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1331         * html/canvas/WebGLCompressedTextureASTC.cpp: Added.
1332         (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
1333         (WebCore::WebGLCompressedTextureASTC::getName const):
1334         (WebCore::WebGLCompressedTextureASTC::supported):
1335         (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
1336         * html/canvas/WebGLCompressedTextureASTC.h: Added.
1337         * html/canvas/WebGLCompressedTextureASTC.idl: Added.
1338         * html/canvas/WebGLExtension.h:
1339         * html/canvas/WebGLRenderingContext.cpp:
1340         (WebCore::WebGLRenderingContext::getExtension):
1341         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1342         * html/canvas/WebGLRenderingContextBase.cpp:
1343         (WebCore::WebGLRenderingContextBase::validateCompressedTexFuncData):
1344         (WebCore::WebGLRenderingContextBase::validateCompressedTexDimensions):
1345         * html/canvas/WebGLRenderingContextBase.h:
1346         * platform/graphics/Extensions3D.h:
1347
1348 2018-05-09  Youenn Fablet  <youenn@apple.com>
1349
1350         Allow WebResourceLoader to cancel a load served from a service worker
1351         https://bugs.webkit.org/show_bug.cgi?id=185274
1352
1353         Reviewed by Chris Dumez.
1354
1355         Add support for cancelling a fetch from WebProcess to service worker process.
1356         Use FetchIdentifier instead of uint64_t.
1357
1358         * Modules/fetch/FetchIdentifier.h: Added.
1359         * WebCore.xcodeproj/project.pbxproj:
1360         * workers/service/context/ServiceWorkerFetch.h:
1361         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1362         (WebCore::ServiceWorkerThreadProxy::startFetch):
1363         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
1364         * workers/service/context/ServiceWorkerThreadProxy.h:
1365
1366 2018-05-09  Thibault Saunier  <tsaunier@igalia.com>
1367
1368         [GStreamer] Fix style issue in MediaPlayerPrivateGStreamer
1369         https://bugs.webkit.org/show_bug.cgi?id=185479
1370
1371         Reviewed by Philippe Normand.
1372
1373         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:114:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1374         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:194:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1375         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:398:  One line control clauses should not use braces.  [whitespace/braces] [4]
1376         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:440:  One line control clauses should not use braces.  [whitespace/braces] [4]
1377         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:806:  More than one command on the same line  [whitespace/newline] [4]
1378         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:869:  More than one command on the same line  [whitespace/newline] [4]
1379         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:880:  More than one command on the same line  [whitespace/newline] [4]
1380         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:940:  More than one command on the same line  [whitespace/newline] [4]
1381         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1102:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1382         ERROR: Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:1109:  Multi line control clauses should use braces.  [whitespace/braces] [4]
1383
1384         Indentation and style issue fixed only.
1385
1386         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1387         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
1388         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1389         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
1390         (WebCore::MediaPlayerPrivateGStreamer::play):
1391         (WebCore::MediaPlayerPrivateGStreamer::videoChangedCallback):
1392         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
1393         (WebCore::MediaPlayerPrivateGStreamer::audioChangedCallback):
1394         (WebCore::MediaPlayerPrivateGStreamer::textChangedCallback):
1395         (WebCore::MediaPlayerPrivateGStreamer::buffered const):
1396         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1397
1398 2018-05-09  Daniel Bates  <dabates@apple.com>
1399
1400         REGRESSION (r231479): com.apple.WebCore crash in WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied()
1401         https://bugs.webkit.org/show_bug.cgi?id=185475
1402         <rdar://problem/40093853>
1403
1404         Reviewed by Andy Estes.
1405
1406         DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() must extends its lifetime
1407         until completion as dispatching a DOM load event at the associated frame can cause JavaScript execution
1408         that can do anything, including destroying the loader that dispatched the event.
1409
1410         Following r231479 DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() is now
1411         invoked by both DocumentLoader::responseReceived() and WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
1412         The latter only can happen when using WebKit2 and the experimental feature Restricted HTTP Response Access
1413         is enabled (RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()). Unlike DocumentLoader::responseReceived()
1414         WebResourceLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() does not take out a ref
1415         on the DocumentLoader before invoking DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
1416         Therefore, DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() can cause its
1417         own destruction as a result of dispatching a DOM load event at the frame. We should take out a ref on
1418         the DocumentLoader when executing DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
1419
1420         * loader/DocumentLoader.cpp:
1421         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
1422
1423 2018-05-09  Tim Horton  <timothy_horton@apple.com>
1424
1425         Fix the build by ignoring some deprecation warnings
1426
1427         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1428         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
1429
1430 2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1431
1432         [WPE] Build cleanly with GCC 8 and ICU 60
1433         https://bugs.webkit.org/show_bug.cgi?id=185462
1434
1435         Reviewed by Carlos Alberto Lopez Perez.
1436
1437         * PlatformGTK.cmake: Include directories are in the wrong place.
1438         * accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
1439         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
1440         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
1441         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
1442         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
1443         * css/CSSFontFace.cpp: Silence -Wfallthrough
1444         (WebCore::CSSFontFace::fontLoadTiming const):
1445         * css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
1446         (WebCore::CSSSelectorList::adoptSelectorVector):
1447         * editing/TextIterator.cpp: Silence ICU deprecation warnings.
1448         * platform/Length.h:
1449         (WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
1450         * platform/graphics/Gradient.cpp:
1451         (WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
1452         * platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
1453         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1454         (WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
1455         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1456         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
1457         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1458         (WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
1459         * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
1460         (gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
1461         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1462         (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
1463         (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
1464         (WebCore::findHLSQueue): Fix -Wcast-function-type.
1465         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1466         (webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
1467         * platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
1468         (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
1469         * platform/text/TextEncoding.cpp: Silence ICU deprecration.
1470
1471 2018-05-08  Simon Fraser  <simon.fraser@apple.com>
1472
1473         SVG lighting colors need to be converted into linearSRGB
1474         https://bugs.webkit.org/show_bug.cgi?id=181196
1475
1476         Reviewed by Darin Adler.
1477
1478         Address post-commit comments. Don't make a Color that contains linearRGB components,
1479         but use FloatComponents instead. Since these FloatComponents are in the 0-1 range,
1480         FELighting::setPixelInternal() needs to multiply by 255 since the output pixels are
1481         8-bit 0-255.
1482         
1483         Change linearToSRGBColorComponent() and sRGBToLinearColorComponent() to do math in
1484         floats without promoting to doubles.
1485
1486         * platform/graphics/ColorUtilities.cpp:
1487         (WebCore::FloatComponents::FloatComponents):
1488         (WebCore::linearToSRGBColorComponent):
1489         (WebCore::sRGBToLinearColorComponent):
1490         (WebCore::sRGBColorToLinearComponents):
1491         (WebCore::linearToSRGBColor): Deleted.
1492         (WebCore::sRGBToLinearColor): Deleted.
1493         * platform/graphics/ColorUtilities.h:
1494         * platform/graphics/filters/FELighting.cpp:
1495         (WebCore::FELighting::setPixelInternal):
1496         (WebCore::FELighting::drawLighting):
1497
1498 2018-05-09  Timothy Hatcher  <timothy@apple.com>
1499
1500         Use StyleColor::Options in more places.
1501
1502         https://bugs.webkit.org/show_bug.cgi?id=185458
1503         rdar://problem/39853798
1504
1505         Add UseDefaultAppearance to StyleColor::Options, to avoid passing yet another
1506         boolean on some of these functions.
1507
1508         Reviewed by Tim Horton.
1509
1510         * css/MediaQueryEvaluator.cpp:
1511         * css/StyleColor.h:
1512         * dom/Document.cpp:
1513         (WebCore::Document::useDefaultAppearance const):
1514         (WebCore::Document::styleColorOptions const):
1515         * dom/Document.h:
1516         * platform/Theme.cpp:
1517         (WebCore::Theme::paint):
1518         * platform/Theme.h:
1519         * platform/mac/LocalDefaultSystemAppearance.h:
1520         * platform/mac/LocalDefaultSystemAppearance.mm:
1521         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1522         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1523         * platform/mac/ThemeMac.h:
1524         * platform/mac/ThemeMac.mm:
1525         (WebCore::paintToggleButton):
1526         (WebCore::paintButton):
1527         (WebCore::ThemeMac::ensuredView):
1528         (WebCore::ThemeMac::drawCellOrFocusRingWithViewIntoContext):
1529         (WebCore::ThemeMac::paint):
1530         (-[WebCoreThemeView initWithUseSystemAppearance:]): Deleted.
1531         * platform/wpe/ThemeWPE.cpp:
1532         (WebCore::ThemeWPE::paint):
1533         * platform/wpe/ThemeWPE.h:
1534         * rendering/RenderListBox.cpp:
1535         (WebCore::RenderListBox::paintItemBackground):
1536         * rendering/RenderTheme.cpp:
1537         (WebCore::RenderTheme::paint):
1538         (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
1539         (WebCore::RenderTheme::platformInactiveListBoxSelectionBackgroundColor const):
1540         * rendering/RenderTheme.h:
1541         * rendering/RenderThemeGtk.cpp:
1542         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor const):
1543         * rendering/RenderThemeGtk.h:
1544         * rendering/RenderThemeMac.h:
1545         * rendering/RenderThemeMac.mm:
1546         (WebCore::RenderThemeMac::documentViewFor const):
1547         (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
1548         (WebCore::RenderThemeMac::systemColor const):
1549         (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
1550         (WebCore::RenderThemeMac::paintSliderThumb):
1551
1552 2018-05-09  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1553
1554         [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf
1555         https://bugs.webkit.org/show_bug.cgi?id=185244
1556
1557         Reviewed by Xabier Rodriguez-Calvar.
1558
1559         The function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" is expected to be called once,
1560         so there is an ASSERT(!m_cdmInstance).
1561         But when the MediaKeys are created before loading the media, the cdminstance is created and attached
1562         to the MediaPlayerPrivate via "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached" before loading
1563         the media, then when the media is loading, the function "MediaPlayerPrivateGStreamerBase::cdmInstanceAttached"
1564         will be called several times via the function "mediaEngineWasUpdated" wich is called for each change
1565         in the MediaElement state, thus the WebProcess crashes in the ASSERT(!m_cdmInstance).
1566
1567         This commit avoid the crash by replacing the assert with a simple check.
1568
1569         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1570         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1571         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
1572
1573 2018-05-09  Antti Koivisto  <antti@apple.com>
1574
1575         Add OptionSet::operator& and operator bool
1576         https://bugs.webkit.org/show_bug.cgi?id=185306
1577
1578         Reviewed by Anders Carlsson.
1579
1580         Use it in a few places.
1581
1582         * loader/FrameLoader.cpp:
1583         (WebCore::FrameLoader::reload):
1584         * rendering/RenderLayerCompositor.cpp:
1585         (WebCore::RenderLayerCompositor::logReasonsForCompositing):
1586         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1587
1588 2018-05-08  Dean Jackson  <dino@apple.com>
1589
1590         Disable system preview link fetching
1591         https://bugs.webkit.org/show_bug.cgi?id=185463
1592
1593         Reviewed by Jon Lee.
1594
1595         Temporarily disable system preview detection when a link
1596         is clicked.
1597
1598         * html/HTMLAnchorElement.cpp:
1599         (WebCore::HTMLAnchorElement::handleClick):
1600
1601 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1602
1603         Unreviewed, fix the internal iOS build
1604
1605         Add a missing import statement in an implementation file.
1606
1607         * editing/cocoa/WebContentReaderCocoa.mm:
1608
1609 2018-05-08  Ryan Haddad  <ryanhaddad@apple.com>
1610
1611         Unreviewed, rolling out r231486.
1612
1613         Caused service worker LayoutTest failures on macOS Debug WK2.
1614
1615         Reverted changeset:
1616
1617         "Allow WebResourceLoader to cancel a load served from a
1618         service worker"
1619         https://bugs.webkit.org/show_bug.cgi?id=185274
1620         https://trac.webkit.org/changeset/231486
1621
1622 2018-05-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1623
1624         Consolidate WebContentReaderIOS and WebContentReaderMac into WebContentReaderCocoa
1625         https://bugs.webkit.org/show_bug.cgi?id=185340
1626
1627         Reviewed by Tim Horton.
1628
1629         WebContentReader::readURL is currently the only method implemented separately in iOS and macOS platform
1630         WebContentReader files. The implementation across macOS and iOS is nearly identical (with some exceptions with
1631         the way iOS handles file URLs and plain text editing), so we can merge these into a single method
1632         WebContentReaderCocoa and delete WebContentReaderIOS and WebContentReaderMac.
1633
1634         This also has the added bonus of fixing a latent bug in WebContentReaderMac, wherein URLs written to the
1635         pasteboard using -[NSPasteboard writeObjects:] are currently pasted as empty anchor elements. In this case, the
1636         link title isn't made explicit, so the `title` passed in to WebContentReader::readURL is empty. On iOS, we have
1637         code to fall back to pasting the absolute string of the URL if the title is empty, but on macOS, we'll just use
1638         this empty string as the title of the anchor.
1639
1640         Test: PasteMixedContent.PasteURLWrittenToPasteboardUsingWriteObjects
1641
1642         * SourcesCocoa.txt:
1643         * WebCore.xcodeproj/project.pbxproj:
1644         * editing/cocoa/WebContentReaderCocoa.mm:
1645         (WebCore::WebContentReader::readURL):
1646         * editing/ios/WebContentReaderIOS.mm: Removed.
1647         * editing/mac/WebContentReaderMac.mm: Removed.
1648
1649 2018-05-08  Zalan Bujtas  <zalan@apple.com>
1650
1651         [Simple line layout] Cache run resolver.
1652         https://bugs.webkit.org/show_bug.cgi?id=185411
1653
1654         Reviewed by Antti Koivisto.
1655
1656         This patch caches the run resolver on the [SimpleLine]Layout object. 
1657         In certain cases, when the block container has thousands of elements (foobar1<br>foobar2<br>.....foobar9999<br>),
1658         constructing the resolver (and its dependencies) in a repeating fashion could hang the WebProcess.
1659
1660         Covered by existing tests.
1661
1662         * rendering/SimpleLineLayout.cpp:
1663         (WebCore::SimpleLineLayout::create):
1664         (WebCore::SimpleLineLayout::Layout::create):
1665         (WebCore::SimpleLineLayout::Layout::Layout):
1666         * rendering/SimpleLineLayout.h:
1667         (WebCore::SimpleLineLayout::Layout::runResolver const):
1668         * rendering/SimpleLineLayoutFunctions.cpp:
1669         (WebCore::SimpleLineLayout::paintFlow):
1670         (WebCore::SimpleLineLayout::hitTestFlow):
1671         (WebCore::SimpleLineLayout::collectFlowOverflow):
1672         (WebCore::SimpleLineLayout::computeBoundingBox):
1673         (WebCore::SimpleLineLayout::computeFirstRunLocation):
1674         (WebCore::SimpleLineLayout::collectAbsoluteRects):
1675         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
1676         (WebCore::SimpleLineLayout::textOffsetForPoint):
1677         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange):
1678         (WebCore::SimpleLineLayout::generateLineBoxTree):
1679         * rendering/SimpleLineLayoutResolver.cpp:
1680         (WebCore::SimpleLineLayout::LineResolver::LineResolver):
1681         * rendering/SimpleLineLayoutResolver.h:
1682         (WebCore::SimpleLineLayout::lineResolver):
1683
1684 2018-05-08  Brent Fulgham  <bfulgham@apple.com>
1685
1686         Switch some RELEASE_ASSERTS to plain debug ASSERTS in PlatformScreenMac.mm
1687         https://bugs.webkit.org/show_bug.cgi?id=185451
1688         <rdar://problem/39620348>
1689
1690         Reviewed by Zalan Bujtas.
1691
1692         Change a set of RELEASE_ASSERTS used to prevent accessing NSScreen related functions in the
1693         PlatformScreenMac implementation to less expensive Debug ASSERTS.
1694
1695         No change in behavior.
1696
1697         * platform/mac/PlatformScreenMac.mm:
1698         (WebCore::screenHasInvertedColors):
1699         (WebCore::screenDepth):
1700         (WebCore::screenDepthPerComponent):
1701         (WebCore::screenRectForDisplay):
1702         (WebCore::screenRect):
1703         (WebCore::screenAvailableRect):
1704         (WebCore::screenColorSpace):
1705         (WebCore::screenSupportsExtendedColor):
1706
1707 2018-05-08  Daniel Bates  <dabates@apple.com>
1708
1709         Resign Strong Password appearance when text field value changes
1710         https://bugs.webkit.org/show_bug.cgi?id=185433
1711         <rdar://problem/39958508>
1712
1713         Reviewed by Ryosuke Niwa.
1714
1715         Remove the Strong Password decoration when the text field's value changes to avoid interfering
1716         with web sites that allow a person to clear the password field.
1717
1718         Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
1719                fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
1720                fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html
1721
1722         * html/HTMLInputElement.cpp:
1723         (WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
1724         (WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
1725         into a function that can be shared by this function and HTMLInputElement::setValue().
1726         (WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
1727         changed programmatically (i.e. no DOM change event was dispatched).
1728         * html/HTMLInputElement.h:
1729
1730 2018-05-08  Jer Noble  <jer.noble@apple.com>
1731
1732         Unreviewed build fix; add missing function definition.
1733
1734         * html/HTMLMediaElement.h:
1735         (WebCore::HTMLMediaElement::didPassCORSAccessCheck const):
1736
1737 2018-05-08  Jer Noble  <jer.noble@apple.com>
1738
1739         Mute MediaElementSourceNode when tainted.
1740         https://bugs.webkit.org/show_bug.cgi?id=184866
1741
1742         Reviewed by Eric Carlson.
1743
1744         Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html
1745
1746         * Modules/webaudio/AudioContext.cpp:
1747         (WebCore::AudioContext::wouldTaintOrigin const):
1748         * Modules/webaudio/AudioContext.h:
1749         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1750         (WebCore::MediaElementAudioSourceNode::setFormat):
1751         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
1752         (WebCore::MediaElementAudioSourceNode::process):
1753         * Modules/webaudio/MediaElementAudioSourceNode.h:
1754
1755 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
1756
1757         Log rtcstats as JSON
1758         https://bugs.webkit.org/show_bug.cgi?id=185437
1759         <rdar://problem/40065332>
1760
1761         Reviewed by Youenn Fablet.
1762
1763         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1764         (WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
1765         toJSONString method to libwebrtc.
1766         (WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
1767         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
1768         it doesn't work well inside of a lambda.
1769         (WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
1770         used here.
1771         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1772         (WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.
1773
1774 2018-05-08  Dean Jackson  <dino@apple.com>
1775
1776         System Preview links should trigger a download
1777         https://bugs.webkit.org/show_bug.cgi?id=185439
1778         <rdar://problem/40065545>
1779
1780         Reviewed by Jon Lee.
1781
1782         Add a new field to FrameLoadRequest, which then is copied
1783         into ResourceRequest, identifying if the link clicked
1784         is a system preview.
1785
1786         * html/HTMLAnchorElement.cpp:
1787         (WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
1788         * loader/FrameLoadRequest.cpp:
1789         (WebCore::FrameLoadRequest::FrameLoadRequest):
1790         * loader/FrameLoadRequest.h: New property.
1791         (WebCore::FrameLoadRequest::FrameLoadRequest):
1792         (WebCore::FrameLoadRequest::isSystemPreview const):
1793         * loader/FrameLoader.cpp:
1794         (WebCore::FrameLoader::urlSelected):
1795         (WebCore::FrameLoader::loadURL):
1796         * loader/FrameLoader.h:
1797         * platform/network/ResourceRequestBase.cpp:
1798         (WebCore::ResourceRequestBase::isSystemPreview const):
1799         (WebCore::ResourceRequestBase::setSystemPreview):
1800         * platform/network/ResourceRequestBase.h:
1801
1802 2018-05-08  Commit Queue  <commit-queue@webkit.org>
1803
1804         Unreviewed, rolling out r231491.
1805         https://bugs.webkit.org/show_bug.cgi?id=185434
1806
1807         Setting the Created key on a cookie does not work yet, due a
1808         bug in CFNetwork (Requested by ggaren on #webkit).
1809
1810         Reverted changeset:
1811
1812         "[WKHTTPCookieStore getAllCookies] returns inconsistent
1813         creation time"
1814         https://bugs.webkit.org/show_bug.cgi?id=185041
1815         https://trac.webkit.org/changeset/231491
1816
1817 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
1818
1819         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
1820         https://bugs.webkit.org/show_bug.cgi?id=185041
1821         <rdar://problem/34684214>
1822
1823         Reviewed by Geoffrey Garen.
1824
1825         Set creationtime property when creating Cookie object to keep consistency after conversion.
1826
1827         New API test: WebKit.WKHTTPCookieStoreCreationTime.
1828
1829         * platform/network/cocoa/CookieCocoa.mm:
1830         (WebCore::Cookie::operator NSHTTPCookie * const):
1831
1832 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
1833
1834         Text track cue logging should include cue text
1835         https://bugs.webkit.org/show_bug.cgi?id=185353
1836         <rdar://problem/40003565>
1837
1838         Reviewed by Brent Fulgham.
1839
1840         No new tests, tested manually.
1841
1842         * html/track/VTTCue.cpp:
1843         (WebCore::VTTCue::toJSON const):
1844         * platform/graphics/InbandTextTrackPrivateClient.h:
1845         (WebCore::GenericCueData::toJSONString const):
1846         * platform/graphics/iso/ISOVTTCue.cpp:
1847         (WebCore::ISOWebVTTCue::toJSONString const):
1848
1849 2018-05-08  Sam Weinig  <sam@webkit.org>
1850
1851         More cleanup of XMLHttpRequestUpload
1852         https://bugs.webkit.org/show_bug.cgi?id=185409
1853
1854         Reviewed by Alex Christensen.
1855
1856         - Remove unneeded #includes
1857         - Rename m_xmlHttpRequest to m_request
1858         - Make some overloaded some methods private, and mark them as final rather
1859           than override.
1860
1861         * xml/XMLHttpRequestUpload.cpp:
1862         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
1863         * xml/XMLHttpRequestUpload.h:
1864
1865 2018-05-08  Zalan Bujtas  <zalan@apple.com>
1866
1867         [LFC] Start using BlockMarginCollapse
1868         https://bugs.webkit.org/show_bug.cgi?id=185424
1869
1870         Reviewed by Antti Koivisto.
1871
1872         BlockMarginCollapse could be all static.
1873
1874         * layout/blockformatting/BlockFormattingContext.cpp:
1875         (WebCore::Layout::BlockFormattingContext::marginTop const):
1876         (WebCore::Layout::BlockFormattingContext::marginBottom const):
1877         * layout/blockformatting/BlockMarginCollapse.cpp:
1878         (WebCore::Layout::isMarginTopCollapsedWithSibling):
1879         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
1880         (WebCore::Layout::isMarginTopCollapsedWithParent):
1881         (WebCore::Layout::isMarginBottomCollapsedWithParent):
1882         (WebCore::Layout::collapsedMarginTopFromFirstChild):
1883         (WebCore::Layout::collapsedMarginBottomFromLastChild):
1884         (WebCore::Layout::nonCollapsedMarginTop):
1885         (WebCore::Layout::nonCollapsedMarginBottom):
1886         (WebCore::Layout::BlockMarginCollapse::marginTop):
1887         (WebCore::Layout::BlockMarginCollapse::marginBottom):
1888         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
1889         (WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
1890         (WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
1891         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
1892         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
1893         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
1894         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
1895         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
1896         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
1897         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
1898         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
1899         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
1900         * layout/blockformatting/BlockMarginCollapse.h:
1901
1902 2018-05-08  Youenn Fablet  <youenn@apple.com>
1903
1904         Allow WebResourceLoader to cancel a load served from a service worker
1905         https://bugs.webkit.org/show_bug.cgi?id=185274
1906
1907         Reviewed by Chris Dumez.
1908
1909         Add support for cancelling a fetch from WebProcess to service worker process.
1910         Use FetchIdentifier instead of uint64_t.
1911
1912         * Modules/fetch/FetchIdentifier.h: Added.
1913         * WebCore.xcodeproj/project.pbxproj:
1914         * workers/service/context/ServiceWorkerFetch.h:
1915         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1916         (WebCore::ServiceWorkerThreadProxy::startFetch):
1917         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
1918         * workers/service/context/ServiceWorkerThreadProxy.h:
1919
1920 2018-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
1921
1922         feTurbulence is not rendered correctly on Retina display
1923         https://bugs.webkit.org/show_bug.cgi?id=183798
1924
1925         Reviewed by Simon Fraser.
1926
1927         On 2x display the feTurbulence filter creates a scaled ImageBuffer but
1928         processes only the unscaled size. This is a remaining work of r168577 and
1929         is very similar to what was done for the feMorphology filter in r188271.
1930
1931         Test: fast/hidpi/filters-turbulence.html
1932
1933         * platform/graphics/filters/FETurbulence.cpp:
1934         (WebCore::FETurbulence::fillRegion const):
1935         (WebCore::FETurbulence::platformApplySoftware):
1936
1937 2018-05-07  Zalan Bujtas  <zalan@apple.com>
1938
1939         [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
1940         https://bugs.webkit.org/show_bug.cgi?id=185377
1941
1942         Reviewed by Antti Koivisto.
1943
1944         Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
1945         In theory LayoutContext is needed only during ::layout() call. 
1946
1947         * layout/FormattingContext.cpp:
1948         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
1949         * layout/FormattingContext.h:
1950         (WebCore::Layout::FormattingContext::layoutContext const):
1951         * layout/LayoutContext.cpp:
1952         (WebCore::Layout::LayoutContext::updateLayout):
1953         * layout/blockformatting/BlockFormattingContext.cpp:
1954         (WebCore::Layout::BlockFormattingContext::layout const):
1955         * layout/blockformatting/BlockFormattingContext.h:
1956         * layout/inlineformatting/InlineFormattingContext.cpp:
1957         (WebCore::Layout::InlineFormattingContext::layout const):
1958         * layout/inlineformatting/InlineFormattingContext.h:
1959
1960 2018-05-07  Daniel Bates  <dabates@apple.com>
1961
1962         Check X-Frame-Options and CSP frame-ancestors in network process
1963         https://bugs.webkit.org/show_bug.cgi?id=185410
1964         <rdar://problem/37733934>
1965
1966         Reviewed by Ryosuke Niwa.
1967
1968         * WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
1969         * loader/DocumentLoader.cpp:
1970         (WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
1971         we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
1972         unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
1973         in subsequent bugs.
1974         * loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
1975         private to public and export it so that we can call it from the WebKit.
1976         * loader/PingLoader.h:
1977         * page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
1978         and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
1979         Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
1980         However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
1981         at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
1982         is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
1983         to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
1984         and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
1985         will also need to be enabled.
1986         * page/csp/ContentSecurityPolicy.cpp:
1987         (WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
1988         * page/csp/ContentSecurityPolicy.h:
1989         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1990         (WebCore::checkFrameAncestors): Ditto.
1991         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
1992         * page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
1993         * page/csp/ContentSecurityPolicyResponseHeaders.h:
1994         * platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.
1995
1996 2018-05-07  Daniel Bates  <dabates@apple.com>
1997
1998         Abstract logic to log console messages and send CSP violation reports into a client
1999         https://bugs.webkit.org/show_bug.cgi?id=185393
2000         <rdar://problem/40036053>
2001
2002         Reviewed by Brent Fulgham.
2003
2004         First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
2005         Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
2006         takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
2007         to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.
2008
2009         Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
2010         instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
2011         object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.
2012
2013         We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
2014         delegate callback in this patch. We will make use of this functionality in a subsequent patch to
2015         support collecting script state (e.g. source line number) when reporting CSP violations in worker
2016         threads. We also no longer go through the unnecessary motions to try to collect script state for a
2017         frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
2018         implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
2019         is checked before a document is parsed and executes script; => there will never be any script state
2020         to collect; => it is not necessary to try to collect it as we currently do.
2021
2022         * Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
2023         below on why we have this file.
2024         * WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
2025         * dom/Document.cpp:
2026         (WebCore::Document::initSecurityContext): Pass the URL of the protected document.
2027         * loader/DocumentLoader.cpp:
2028         (WebCore::DocumentLoader::responseReceived): Ditto.
2029         (WebCore::DocumentLoader::addConsoleMessage): Added.
2030         (WebCore::DocumentLoader::sendCSPViolationReport): Added.
2031         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
2032         * loader/DocumentLoader.h:
2033         * loader/FrameLoaderClient.h: Fix typo in comment.
2034         * loader/WorkerThreadableLoader.cpp:
2035         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
2036         * page/csp/ContentSecurityPolicy.cpp:
2037         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
2038         ContentSecurityPolicyClient*.
2039         (WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
2040         into this member function.
2041         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
2042         one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
2043         (WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
2044         (WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
2045         * page/csp/ContentSecurityPolicy.h:
2046         * page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
2047         destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
2048         defined in the translation unit of each derived class.
2049         * page/csp/ContentSecurityPolicyClient.h: Added.
2050         * page/csp/ContentSecurityPolicySource.cpp:
2051         (WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
2052         * page/csp/ContentSecurityPolicySource.h:
2053         * workers/WorkerGlobalScope.cpp:
2054         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
2055         URL of the worker script.
2056
2057 2018-05-07  Simon Fraser  <simon.fraser@apple.com>
2058
2059         CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
2060         https://bugs.webkit.org/show_bug.cgi?id=185343
2061
2062         Reviewed by Dean Jackson.
2063
2064         Test: css3/filters/color-interpolation-filters.html
2065         
2066         When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
2067         referenced filter effect element, just as we do for SVG filters.
2068
2069         * rendering/FilterEffectRenderer.cpp:
2070         (WebCore::FilterEffectRenderer::buildReferenceFilter):
2071
2072 2018-05-07  Daniel Bates  <dabates@apple.com>
2073
2074         CSP status-code incorrect for document blocked due to violation of its frame-ancestors directive
2075         https://bugs.webkit.org/show_bug.cgi?id=185366
2076         <rdar://problem/40035116>
2077
2078         Reviewed by Brent Fulgham.
2079
2080         Fixes an issue where the status-code in the sent CSP report for an HTTP document blocked because
2081         its frame-ancestors directive was violated would be the status code of the previously loaded
2082         document in the frame. If the previously loaded document was about:blank then this would be 0.
2083
2084         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for the
2085         HTTP status code for the last response. Document::loader() returns the loader for the last committed
2086         document its frame. For a frame-ancestors violation, a CSP report is sent before the document
2087         that had the frame-ancestors directive has been committed and after it has been associate with a frame.
2088         As a result we are in are in a transient transition state for the frame and hence the last response
2089         for new document's loader (Document::loader()) is actually the last response of the previously loaded
2090         document in the frame. Instead we need to take care to tell CSP about the HTTP status code for the
2091         response associated with the document the CSP came from.
2092
2093         * dom/Document.cpp:
2094         (WebCore::Document::processHttpEquiv):
2095         (WebCore::Document::initSecurityContext):
2096         Pass the HTTP status code to CSP.
2097
2098         * page/csp/ContentSecurityPolicy.cpp:
2099         (WebCore::ContentSecurityPolicy::copyStateFrom):
2100         (WebCore::ContentSecurityPolicy::responseHeaders const):
2101         (WebCore::ContentSecurityPolicy::didReceiveHeaders):
2102         (WebCore::ContentSecurityPolicy::didReceiveHeader):
2103         (WebCore::ContentSecurityPolicy::reportViolation const):
2104         * page/csp/ContentSecurityPolicy.h:
2105         Modify existing functions to take the HTTP status code, store it in a instance variable,
2106         and reference this variable when reporting a violation.
2107
2108         * page/csp/ContentSecurityPolicyResponseHeaders.cpp:
2109         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders):
2110         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
2111         * page/csp/ContentSecurityPolicyResponseHeaders.h:
2112         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
2113         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
2114         Store the HTTP status code along with the response headers.
2115
2116 2018-05-07  Daniel Bates  <dabates@apple.com>
2117
2118         CSP referrer incorrect for document blocked due to violation of its frame-ancestors directive
2119         https://bugs.webkit.org/show_bug.cgi?id=185380
2120
2121         Reviewed by Brent Fulgham.
2122
2123         Similar to <https://bugs.webkit.org/show_bug.cgi?id=185366>, fixes an issue where the referrer
2124         in the sent CSP report for an HTTP document blocked because its frame-ancestors directive was
2125         violated would be the referrer of the previously loaded document in the frame.
2126
2127         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for
2128         the referrer for the last request. Document::loader() returns the loader for the last committed
2129         document in its frame. For a frame-ancestors violation, a CSP report is sent before the document
2130         that had the frame-ancestors directive has been committed and after it has been associate with a
2131         frame. As a result we are in a transient transition state for the frame and hence the last request
2132         for the new document's loader (Document::loader()) is actually the last request of the previously
2133         loaded document in the frame. Instead we need to take care to tell CSP about the referrer for the
2134         request associated with the document the CSP came from.
2135
2136         * loader/DocumentLoader.cpp:
2137         (WebCore::DocumentLoader::responseReceived):
2138
2139 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
2140
2141         Add experimental feature to prompt for Storage Access API use
2142         https://bugs.webkit.org/show_bug.cgi?id=185335
2143         <rdar://problem/39994649>
2144
2145         Reviewed by Alex Christensen and Youenn Fablet.
2146
2147         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
2148         Storage Access API is invoked.
2149
2150         Currently this feature doesn't have any user-visible impact.
2151
2152         * page/RuntimeEnabledFeatures.h:
2153         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
2154         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
2155         * testing/InternalSettings.cpp:
2156         (WebCore::InternalSettings::Backup::Backup):
2157         (WebCore::InternalSettings::Backup::restoreTo):
2158         (WebCore::InternalSettings::setStorageAccessPromptsEnabled):
2159         * testing/InternalSettings.h:
2160         * testing/InternalSettings.idl:
2161
2162 2018-05-07  Chris Dumez  <cdumez@apple.com>
2163
2164         Stop using an iframe's id as fallback if its name attribute is not set
2165         https://bugs.webkit.org/show_bug.cgi?id=11388
2166
2167         Reviewed by Geoff Garen.
2168
2169         WebKit had logic to use an iframe's id as fallback name when its name
2170         content attribute is not set. This behavior was not standard and did not
2171         match other browsers:
2172         - https://html.spec.whatwg.org/#attr-iframe-name
2173
2174         Gecko / Trident never behaved this way. Blink was aligned with us until
2175         they started to match the specification in:
2176         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
2177
2178         This WebKit quirk was causing some Web-compatibility issues because it
2179         would affect the behavior of Window's name property getter when trying
2180         to look up an iframe by id. Because of Window's named property getter
2181         behavior [1], we would return the frame's contentWindow instead of the
2182         iframe element itself.
2183
2184         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
2185
2186         Test: fast/dom/Window/named-getter-frame-id.html
2187
2188         * html/HTMLFrameElementBase.cpp:
2189         (WebCore::HTMLFrameElementBase::openURL):
2190         (WebCore::HTMLFrameElementBase::parseAttribute):
2191         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
2192         * html/HTMLFrameElementBase.h:
2193
2194 2018-05-07  Chris Dumez  <cdumez@apple.com>
2195
2196         ASSERT(!childItemWithTarget(child->target())) is hit in HistoryItem::addChildItem()
2197         https://bugs.webkit.org/show_bug.cgi?id=185322
2198
2199         Reviewed by Geoff Garen.
2200
2201         We generate unique names for Frame to be used in HistoryItem. Those names not only
2202         need to be unique, they also need to be repeatable to avoid layout tests flakiness
2203         and for things like restoring form state from a HistoryItem.
2204
2205         The previously generated frame names were relying on the Frame's index among a
2206         parent Frame's children. The issue was that we could end up with duplicate names
2207         because one could insert a Frame *before* an existing one. This is because the code
2208         would not take care of updating existing Frames' unique name on frame tree mutation.
2209
2210         Updating frame tree names on mutation would be inefficient and is also not necessary.
2211         The approach chosen in this patch is to stop using the Frame's index and instead rely
2212         on an increasing counter stored on the top-frame's FrameTree. To make the names
2213         repeatable, we reset the counter on page navigation.
2214
2215         * page/Frame.cpp:
2216         (WebCore::Frame::setDocument):
2217         * page/FrameTree.cpp:
2218         (WebCore::FrameTree::uniqueChildName const):
2219         (WebCore::FrameTree::generateUniqueName const):
2220         * page/FrameTree.h:
2221         (WebCore::FrameTree::resetFrameIdentifiers):
2222
2223 2018-05-07  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2224
2225         [EME][GStreamer] Fix wrong subsample parsing on r227067
2226         https://bugs.webkit.org/show_bug.cgi?id=185382
2227
2228         Reviewed by Philippe Normand.
2229
2230         The initialization of sampleIndex should be moved outside of the loop.
2231         Without this patch we will have a bad log and the check of the subsample
2232         count will be useless.
2233
2234         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
2235         (webKitMediaClearKeyDecryptorDecrypt):
2236
2237 2018-05-07  Daniel Bates  <dabates@apple.com>
2238
2239         CSP should be passed the referrer
2240         https://bugs.webkit.org/show_bug.cgi?id=185367
2241
2242         Reviewed by Per Arne Vollan.
2243
2244         As a step towards formalizing a CSP delegate object and removing the dependencies
2245         on ScriptExecutionContext and Frame, we should pass the document's referrer directly
2246         instead of indirectly obtaining it from the ScriptExecutionContext or Frame used
2247         to instantiate the ContentSecurityPolicy object.
2248
2249         * dom/Document.cpp:
2250         (WebCore::Document::processHttpEquiv): Pass the document's referrer.
2251         (WebCore::Document::initSecurityContext): Ditto.
2252         (WebCore::Document::applyQuickLookSandbox): Ditto.
2253         * loader/DocumentLoader.cpp:
2254         (WebCore::DocumentLoader::responseReceived): Ditto.
2255         * loader/FrameLoader.cpp:
2256         (WebCore::FrameLoader::didBeginDocument): Ditto.
2257         * page/csp/ContentSecurityPolicy.cpp:
2258         (WebCore::ContentSecurityPolicy::copyStateFrom): We pass a null string for the referrer
2259         to didReceiveHeader() as a placeholder since it requires the referrer be given to it. We
2260         fix up the referrer (m_referrer) after copying all the policy headers.
2261         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
2262         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take a referrer and WTFMove()s
2263         it into an instance variable (m_referrer).
2264         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to use the stored referrer.
2265         * page/csp/ContentSecurityPolicy.h:
2266         * workers/WorkerGlobalScope.cpp:
2267         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Pass a null string
2268         for the referrer as a worker does not have a referrer.
2269
2270 2018-05-07  Daniel Bates  <dabates@apple.com>
2271
2272         CSP should only notify Inspector to pause the debugger on the first policy to violate a directive
2273         https://bugs.webkit.org/show_bug.cgi?id=185364
2274
2275         Reviewed by Brent Fulgham.
2276
2277         Notify Web Inspector that a script was blocked on the first enforced CSP policy that it
2278         violates.
2279
2280         A page can have more than one enforced Content Security Policy. Currently for inline
2281         scripts, inline event handlers, JavaScript URLs, and eval() that are blocked by CSP
2282         we notify Web Inspector that it was blocked for each CSP policy that blocked it. When
2283         Web Inspector is notified it pauses script execution. It does not seem very meaningful
2284         to pause script execution on the same script for each CSP policy that blocked it.
2285         Therefore, only tell Web Inspector that a script was blocked for the first enforced CSP
2286         policy that blocked it.
2287
2288         * page/csp/ContentSecurityPolicy.cpp:
2289         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
2290         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const):
2291         (WebCore::ContentSecurityPolicy::allowInlineScript const):
2292         (WebCore::ContentSecurityPolicy::allowEval const):
2293
2294 2018-05-07  Daniel Bates  <dabates@apple.com>
2295
2296         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
2297         https://bugs.webkit.org/show_bug.cgi?id=185170
2298
2299         Reviewed by Per Arne Vollan.
2300
2301         Rename CrossOriginPreflightResultCache::empty() to CrossOriginPreflightResultCache::clear() make
2302         it consistent with the terminology we use in WebKit to signify a function that clears a collection.
2303         A member function named "empty" is expected to return an instance of a class in its "empty state".
2304         For example, StringImpl::empty() returns a StringImpl instance that represents the empty string.
2305         However CrossOriginPreflightResultCache::empty() clears out the cache in-place. We should rename
2306         this function to better describe its purpose.
2307
2308         * loader/CrossOriginPreflightResultCache.cpp:
2309         (WebCore::CrossOriginPreflightResultCache::clear):
2310         (WebCore::CrossOriginPreflightResultCache::empty): Deleted.
2311         * loader/CrossOriginPreflightResultCache.h:
2312
2313 2018-05-06  Dean Jackson  <dino@apple.com>
2314
2315         WebGL: Reset simulated values after validation fails
2316         https://bugs.webkit.org/show_bug.cgi?id=185363
2317         <rdar://problem/39733417>
2318
2319         Reviewed by Anders Carlsson.
2320
2321         While fixing a previous bug, I forgot to reset some values
2322         when validation fails. This caused a bug where a subsequent
2323         invalid call might use those values and escape detection.
2324
2325         Test: fast/canvas/webgl/index-validation-with-subsequent-draws.html
2326
2327         * html/canvas/WebGLRenderingContextBase.cpp:
2328         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Reset the
2329         sizes when validation fails.
2330         * html/canvas/WebGLRenderingContextBase.h:
2331
2332 2018-05-07  Ms2ger  <Ms2ger@igalia.com>
2333
2334         Support negative sw/sh values in createImageBitmap().
2335         https://bugs.webkit.org/show_bug.cgi?id=184449
2336
2337         Reviewed by Dean Jackson.
2338
2339         Tests: LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
2340                LayoutTests/http/wpt/2dcontext/imagebitmap/createImageBitmap.html
2341
2342         * html/ImageBitmap.cpp:
2343         (WebCore::ImageBitmap::createPromise): handle negative values per spec.
2344
2345 2018-05-07  Brian Burg  <bburg@apple.com>
2346
2347         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
2348         https://bugs.webkit.org/show_bug.cgi?id=184861
2349         <rdar://problem/39153768>
2350
2351         Reviewed by Timothy Hatcher.
2352
2353         Notify the client of the current connection count whenever a frontend connects or disconnects.
2354
2355         Covered by new API test.
2356
2357         * inspector/InspectorClient.h:
2358         (WebCore::InspectorClient::frontendCountChanged):
2359         * inspector/InspectorController.cpp:
2360         (WebCore::InspectorController::connectFrontend):
2361         (WebCore::InspectorController::disconnectFrontend):
2362         (WebCore::InspectorController::disconnectAllFrontends):
2363         * inspector/InspectorController.h:
2364
2365 2018-05-07  Eric Carlson  <eric.carlson@apple.com>
2366
2367         Text track cue logging should include cue text
2368         https://bugs.webkit.org/show_bug.cgi?id=185353
2369         <rdar://problem/40003565>
2370
2371         Reviewed by Youenn Fablet.
2372
2373         No new tests, tested manually.
2374
2375         * html/track/VTTCue.cpp:
2376         (WebCore::VTTCue::toJSONString const): Use toJSON.
2377         (WebCore::VTTCue::toJSON const): New.
2378         * html/track/VTTCue.h:
2379
2380         * platform/graphics/InbandTextTrackPrivateClient.h:
2381         (WebCore::GenericCueData::toJSONString const): Log m_content.
2382
2383         * platform/graphics/iso/ISOVTTCue.cpp:
2384         (WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
2385
2386 2018-05-06  Zalan Bujtas  <zalan@apple.com>
2387
2388         [LFC] Add assertions for stale Display::Box geometry
2389         https://bugs.webkit.org/show_bug.cgi?id=185357
2390
2391         Reviewed by Antti Koivisto.
2392
2393         Ensure that we don't access stale geometry of other boxes during layout.
2394         For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)
2395
2396         * layout/displaytree/DisplayBox.h:
2397         (WebCore::Display::Box::invalidateTop):
2398         (WebCore::Display::Box::invalidateLeft):
2399         (WebCore::Display::Box::invalidateWidth):
2400         (WebCore::Display::Box::invalidateHeight):
2401         (WebCore::Display::Box::hasValidPosition const):
2402         (WebCore::Display::Box::hasValidSize const):
2403         (WebCore::Display::Box::hasValidGeometry const):
2404         (WebCore::Display::Box::invalidatePosition):
2405         (WebCore::Display::Box::invalidateSize):
2406         (WebCore::Display::Box::setHasValidPosition):
2407         (WebCore::Display::Box::setHasValidSize):
2408         (WebCore::Display::Box::setHasValidGeometry):
2409         (WebCore::Display::Box::rect const):
2410         (WebCore::Display::Box::top const):
2411         (WebCore::Display::Box::left const):
2412         (WebCore::Display::Box::bottom const):
2413         (WebCore::Display::Box::right const):
2414         (WebCore::Display::Box::topLeft const):
2415         (WebCore::Display::Box::bottomRight const):
2416         (WebCore::Display::Box::size const):
2417         (WebCore::Display::Box::width const):
2418         (WebCore::Display::Box::height const):
2419         (WebCore::Display::Box::setRect):
2420         (WebCore::Display::Box::setTopLeft):
2421         (WebCore::Display::Box::setTop):
2422         (WebCore::Display::Box::setLeft):
2423         (WebCore::Display::Box::setSize):
2424         (WebCore::Display::Box::setWidth):
2425         (WebCore::Display::Box::setHeight):
2426
2427 2018-05-06  Zalan Bujtas  <zalan@apple.com>
2428
2429         [LFC] Add BlockFormattingContext::computeStaticPosition
2430         https://bugs.webkit.org/show_bug.cgi?id=185352
2431
2432         Reviewed by Antti Koivisto.
2433
2434         This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
2435
2436         * layout/blockformatting/BlockFormattingContext.cpp:
2437         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2438         * layout/displaytree/DisplayBox.h:
2439
2440 2018-05-05  Sam Weinig  <sam@webkit.org>
2441
2442         Cleanup XMLHttpRequestUpload a little
2443         https://bugs.webkit.org/show_bug.cgi?id=185344
2444
2445         Reviewed by Yusuke Suzuki.
2446
2447         * bindings/js/JSXMLHttpRequestCustom.cpp:
2448         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
2449         Use auto to reduce redundancy.
2450
2451         * xml/XMLHttpRequest.cpp:
2452         (WebCore::XMLHttpRequest::upload):
2453         * xml/XMLHttpRequest.h:
2454         Switch upload() to return a reference.
2455         
2456         * xml/XMLHttpRequestUpload.cpp:
2457         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
2458         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
2459         * xml/XMLHttpRequestUpload.h:
2460         Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
2461         to a reference.
2462
2463 2018-05-05  Dean Jackson  <dino@apple.com>
2464
2465         Draw a drop-shadow behind the system preview badge
2466         https://bugs.webkit.org/show_bug.cgi?id=185356
2467         <rdar://problem/40004936>
2468
2469         Reviewed by Wenson Hsieh.
2470
2471         Draw a very subtle drop-shadow under the system
2472         preview badge so that it is more visible on a pure
2473         white background.
2474
2475         I also moved some code around to make it more clear
2476         and improved comments.
2477
2478         * rendering/RenderThemeIOS.mm:
2479         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2480
2481 2018-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2482
2483         [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
2484         https://bugs.webkit.org/show_bug.cgi?id=185289
2485         <rdar://problem/35756912>
2486
2487         Reviewed by Tim Horton and Darin Adler.
2488
2489         When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
2490         (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
2491         tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
2492         the first item to be inserted in the resulting document fragment.
2493
2494         Augments existing API tests in DataInteractionTests.
2495
2496         * editing/ios/WebContentReaderIOS.mm:
2497
2498         Additionally remove some extraneous header imports from this implementation file.
2499
2500         (WebCore::WebContentReader::readURL):
2501
2502 2018-05-02  Dean Jackson  <dino@apple.com>
2503
2504         Use IOSurfaces for CoreImage operations where possible
2505         https://bugs.webkit.org/show_bug.cgi?id=185230
2506         <rdar://problem/39926929>
2507
2508         Reviewed by Jon Lee.
2509
2510         On iOS hardware, we can use IOSurfaces as a rendering destination
2511         for CoreImage, which means we're keeping data on the GPU
2512         for rendering.
2513
2514         As a drive-by fix, I used a convenience method for Gaussian blurs.
2515
2516         * rendering/RenderThemeIOS.mm:
2517         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
2518
2519 2018-05-04  Tim Horton  <timothy_horton@apple.com>
2520
2521         Shift to a lower-level framework for simplifying URLs
2522         https://bugs.webkit.org/show_bug.cgi?id=185334
2523
2524         Reviewed by Dan Bernstein.
2525
2526         * Configurations/WebCore.xcconfig:
2527         * platform/mac/DragImageMac.mm:
2528         (WebCore::LinkImageLayout::LinkImageLayout):
2529
2530 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
2531
2532         Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
2533         https://bugs.webkit.org/show_bug.cgi?id=185288
2534
2535         Reviewed by Jer Noble.
2536
2537         The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
2538         which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
2539         Speculatively fix the crash by scheduling the check instead.
2540
2541         In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
2542
2543         Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
2544
2545         * html/HTMLMediaElement.cpp:
2546         (WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
2547         (WebCore::HTMLMediaElementDestructorScope): Added.
2548         (WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
2549         (WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
2550         (WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
2551         * html/HTMLMediaElement.h:
2552         * loader/FrameLoader.cpp:
2553         (WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
2554         checkCompleted if we're in the middle of destructing a HTMLMediaElement.
2555
2556 2018-05-04  Ryosuke Niwa  <rniwa@webkit.org>
2557
2558         Rename DocumentOrderedMap to TreeScopeOrderedMap
2559         https://bugs.webkit.org/show_bug.cgi?id=185290
2560
2561         Reviewed by Zalan Bujtas.
2562
2563         Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
2564
2565         * Sources.txt:
2566         * WebCore.xcodeproj/project.pbxproj:
2567         * dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
2568         * dom/TreeScope.cpp:
2569         (WebCore::TreeScope::addElementById):
2570         (WebCore::TreeScope::addElementByName):
2571         (WebCore::TreeScope::addImageMap):
2572         (WebCore::TreeScope::addImageElementByUsemap):
2573         (WebCore::TreeScope::labelElementForId):
2574         * dom/TreeScope.h:
2575         * dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
2576         * dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
2577         * html/HTMLDocument.h:
2578
2579 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
2580
2581         [Win][WebKit] Fix forwarding headers for Windows build
2582         https://bugs.webkit.org/show_bug.cgi?id=184412
2583
2584         Reviewed by Alex Christensen.
2585
2586         No new tests. No change in behavior.
2587
2588         * PlatformWin.cmake:
2589
2590 2018-05-04  Zalan Bujtas  <zalan@apple.com>
2591
2592         [Simple line layout] Add support for line layout box generation with multiple text renderers.
2593         https://bugs.webkit.org/show_bug.cgi?id=185276
2594
2595         Reviewed by Antti Koivisto.
2596
2597         Covered by existing tests.
2598
2599         * rendering/SimpleLineLayoutFunctions.cpp:
2600         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
2601         (WebCore::SimpleLineLayout::generateLineBoxTree):
2602         * rendering/SimpleLineLayoutResolver.cpp:
2603         (WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
2604         (WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
2605         (WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
2606         * rendering/SimpleLineLayoutResolver.h:
2607
2608 2018-05-04  Timothy Hatcher  <timothy@apple.com>
2609
2610         Deprecate legacy WebView and friends
2611         https://bugs.webkit.org/show_bug.cgi?id=185279
2612         rdar://problem/33268700
2613
2614         Reviewed by Tim Horton.
2615
2616         * Configurations/WebCore.xcconfig:
2617         Added BUILDING_WEBKIT define to disable the deprecation macros.
2618         * bridge/objc/WebScriptObject.h:
2619         Added deprecation macros to WebScriptObject and WebUndefined.
2620         * platform/cocoa/WebKitAvailability.h:
2621         Added more macros and a way to disable deprecation warnings for
2622         WebKit build and in clients like Safari.
2623
2624 2018-05-04  Eric Carlson  <eric.carlson@apple.com>
2625
2626         Log media time range as JSON
2627         https://bugs.webkit.org/show_bug.cgi?id=185321
2628         <rdar://problem/39986746>
2629
2630         Reviewed by Youenn Fablet.
2631
2632         No new tests, tested manually.
2633
2634         * html/HTMLMediaElement.cpp:
2635         (WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
2636         (WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
2637
2638         * platform/graphics/MediaPlayer.h:
2639         (WTF::LogArgument<MediaTime>::toString):
2640         (WTF::LogArgument<MediaTimeRange>::toString):
2641
2642         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2643         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
2644
2645 2018-05-04  Zalan Bujtas  <zalan@apple.com>
2646
2647         Use the containing block to compute the pagination gap when the container is inline.
2648         https://bugs.webkit.org/show_bug.cgi?id=184724
2649         <rdar://problem/39521800>
2650
2651         Reviewed by Simon Fraser.
2652
2653         Test: fast/overflow/page-overflow-with-inline-body-crash.html
2654
2655         * page/FrameView.cpp:
2656         (WebCore::FrameView::applyPaginationToViewport):
2657
2658 2018-05-04  Tim Horton  <timothy_horton@apple.com>
2659
2660         Don't use GSFont* in minimal simulator mode
2661         https://bugs.webkit.org/show_bug.cgi?id=185320
2662         <rdar://problem/39734478>
2663
2664         Reviewed by Beth Dakin.
2665
2666         * page/cocoa/MemoryReleaseCocoa.mm:
2667         (WebCore::platformReleaseMemory):
2668
2669 2018-05-04  Chris Dumez  <cdumez@apple.com>
2670
2671         Unreviewed, rolling out r231331.
2672
2673         Caused a few tests to assert
2674
2675         Reverted changeset:
2676
2677         "Stop using an iframe's id as fallback if its name attribute
2678         is not set"
2679         https://bugs.webkit.org/show_bug.cgi?id=11388
2680         https://trac.webkit.org/changeset/231331
2681
2682 2018-05-04  Youenn Fablet  <youenn@apple.com>
2683
2684         Use more references in updateTracksOfType
2685         https://bugs.webkit.org/show_bug.cgi?id=185305
2686
2687         Reviewed by Eric Carlson.
2688
2689         No change of behavior.
2690
2691         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2692         (WebCore::updateTracksOfType):
2693         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
2694
2695 2018-05-04  Myles C. Maxfield  <mmaxfield@apple.com>
2696
2697         Text shaping in the simple path is flipped in the y direction
2698         https://bugs.webkit.org/show_bug.cgi?id=185062
2699         <rdar://problem/39778678>
2700
2701         Reviewed by Simon Fraser.
2702
2703         Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
2704         code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
2705         because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
2706         neither of which move glyphs vertically in the common case.
2707
2708         Test: fast/text/vertical-displacement-simple-codepath.html
2709
2710         * platform/graphics/Font.cpp:
2711         (WebCore::Font::applyTransforms const):
2712         * platform/graphics/WidthIterator.cpp:
2713         (WebCore::WidthIterator::applyFontTransforms):
2714
2715 2018-05-04  Chris Nardi  <cnardi@chromium.org>
2716
2717         Serialize all URLs with double-quotes per CSSOM spec
2718         https://bugs.webkit.org/show_bug.cgi?id=184935
2719
2720         Reviewed by Antti Koivisto.
2721
2722         According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
2723         which means they should have double quotes around the text of the URL. Update our implementation to match
2724         this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
2725
2726         Tests: Many LayoutTests updated to use double quotes.
2727
2728         * css/CSSMarkup.cpp:
2729         (WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
2730         (WebCore::serializeURL): Remove FIXME and update implementation.
2731
2732 2018-05-04  Youenn Fablet  <youenn@apple.com>
2733
2734         LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
2735         https://bugs.webkit.org/show_bug.cgi?id=185303
2736
2737         Reviewed by Eric Carlson.
2738
2739         We need to stop observing the audio track like we do for video track once we are no longer interested in it.
2740         Covered by test no longer crashing.
2741
2742         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2743         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
2744
2745 2018-05-04  Zalan Bujtas  <zalan@apple.com>
2746
2747         [LFC] Set the invalidation root as the result of style change.
2748         https://bugs.webkit.org/show_bug.cgi?id=185301
2749
2750         Reviewed by Antti Koivisto.
2751
2752         Compute/propagate the update type on the ancestor chain and return the invalidation root
2753         so that LayoutContext could use it as the entry point for the next layout frame.
2754
2755         * layout/LayoutContext.cpp:
2756         (WebCore::Layout::LayoutContext::updateLayout):
2757         (WebCore::Layout::LayoutContext::styleChanged):
2758         * layout/LayoutContext.h: order is not important.
2759         * layout/blockformatting/BlockInvalidation.cpp:
2760         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
2761         (WebCore::Layout::computeUpdateType):
2762         (WebCore::Layout::computeUpdateTypeForAncestor):
2763         (WebCore::Layout::BlockInvalidation::invalidate):
2764         * layout/blockformatting/BlockInvalidation.h:
2765         * layout/inlineformatting/InlineInvalidation.cpp:
2766         (WebCore::Layout::InlineInvalidation::invalidate):
2767         * layout/inlineformatting/InlineInvalidation.h:
2768
2769 2018-05-04  Youenn Fablet  <youenn@apple.com>
2770
2771         PeerConnection should have its connectionState closed even if doing gathering
2772         https://bugs.webkit.org/show_bug.cgi?id=185267
2773
2774         Reviewed by Darin Adler.
2775
2776         Test: webrtc/addICECandidate-closed.html
2777
2778         In case m_iceConnectionState is closed, m_connectionState should also be set to closed
2779         and RTCPeerConnection should be closed so as to reject any other call.
2780
2781         * Modules/mediastream/RTCPeerConnection.cpp:
2782         (WebCore::RTCPeerConnection::close):
2783         (WebCore::RTCPeerConnection::updateConnectionState):
2784
2785 2018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
2786
2787         [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
2788         https://bugs.webkit.org/show_bug.cgi?id=185242
2789
2790         Reviewed by Xabier Rodriguez-Calvar.
2791
2792         When the sourceBuffer is removed from mediasource, the appropriate stream is not
2793         properly deleted from WebKitMediaSource, because the appsrc and parser elements
2794         of the stream are not removed from the WebKitMediaSource bin.
2795
2796         This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
2797
2798         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2799         (webKitMediaSrcFreeStream):
2800
2801 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2802
2803         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
2804         https://bugs.webkit.org/show_bug.cgi?id=174730
2805
2806         Reviewed by Michael Catanzaro.
2807
2808         Export ResourceRequestBase::hasHTTPHeaderField().
2809
2810         * platform/network/ResourceRequestBase.h:
2811
2812 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2813
2814         Use subprocess.call instead of os.system to handle path with spaces
2815         https://bugs.webkit.org/show_bug.cgi?id=185291
2816
2817         Reviewed by Darin Adler.
2818
2819         If gperf path includes spaces, these python scripts fail to execute gperf.
2820         We use subprocess module instead of os.system to invoke gperf.
2821
2822         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2823         * css/makeSelectorPseudoElementsMap.py:
2824         * platform/network/create-http-header-name-table:
2825
2826 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2827
2828         Unreviewed, attempt to fix WinCairo build failure
2829         https://bugs.webkit.org/show_bug.cgi?id=185218
2830
2831         * platform/text/win/LocaleWin.cpp:
2832         (WebCore::LocaleWin::getLocaleInfoString):
2833
2834 2018-05-03  Filip Pizlo  <fpizlo@apple.com>
2835
2836         Strings should not be allocated in a gigacage
2837         https://bugs.webkit.org/show_bug.cgi?id=185218
2838
2839         Reviewed by Saam Barati.
2840
2841         No new tests because no new behavior.
2842
2843         * Modules/indexeddb/server/IDBSerialization.cpp:
2844         (WebCore::decodeKey):
2845         * bindings/js/SerializedScriptValue.cpp:
2846         (WebCore::CloneDeserializer::readString):
2847         * html/canvas/CanvasRenderingContext2D.cpp:
2848         (WebCore::normalizeSpaces):
2849         * html/parser/HTMLTreeBuilder.cpp:
2850         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
2851         * platform/URLParser.cpp:
2852         (WebCore::percentEncodeByte):
2853         (WebCore::serializeURLEncodedForm):
2854         (WebCore::URLParser::serialize):
2855         * platform/URLParser.h:
2856         * platform/graphics/FourCC.cpp:
2857         (WebCore::FourCC::toString const):
2858         * platform/graphics/ca/GraphicsLayerCA.cpp:
2859         (WebCore::GraphicsLayerCA::ReplicaState::cloneID const):
2860         * platform/text/LocaleICU.cpp:
2861         (WebCore::LocaleICU::decimalSymbol):
2862         (WebCore::LocaleICU::decimalTextAttribute):
2863         (WebCore::getDateFormatPattern):
2864         (WebCore::LocaleICU::createLabelVector):
2865         (WebCore::getFormatForSkeleton):
2866         * platform/win/FileSystemWin.cpp:
2867         (WebCore::FileSystem::getFinalPathName):
2868         (WebCore::FileSystem::pathByAppendingComponent):
2869         (WebCore::FileSystem::storageDirectory):
2870
2871 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
2872
2873         Widgets should hold a WeakPtr to their parents
2874         https://bugs.webkit.org/show_bug.cgi?id=185239
2875         <rdar://problem/39741250>
2876
2877         Reviewed by Zalan Bujtas.
2878
2879         * platform/ScrollView.h:
2880         (WebCore::ScrollView::weakPtrFactory): Added.
2881         * platform/Widget.cpp:
2882         (WebCore::Widget::init): Don't perform an unnecessary assignment.
2883         (WebCore::Widget::setParent): Grab a WeakPtr to the parent ScrollView.
2884         * platform/Widget.h:
2885         (WebCore::Widget::parent const): Change type to a WeakPtr.
2886
2887 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
2888
2889         Use pointer instead of std::optional<T&>
2890         https://bugs.webkit.org/show_bug.cgi?id=185186
2891
2892         Reviewed by Alex Christensen.
2893
2894         std::optional<T&> is not accepted in C++17 spec.
2895         In this patch, we replace it with T*, which is well-aligned to
2896         WebKit's convention.
2897
2898         * Modules/mediastream/RTCPeerConnection.cpp:
2899         (WebCore::iceServersFromConfiguration):
2900         (WebCore::RTCPeerConnection::initializeConfiguration):
2901         (WebCore::RTCPeerConnection::setConfiguration):
2902         * css/parser/CSSParser.cpp:
2903         (WebCore::CSSParser::parseSystemColor):
2904         * css/parser/CSSParser.h:
2905         * dom/DatasetDOMStringMap.cpp:
2906         (WebCore::DatasetDOMStringMap::item const):
2907         (WebCore::DatasetDOMStringMap::namedItem const):
2908         (WebCore:: const): Deleted.
2909         * dom/DatasetDOMStringMap.h:
2910         * dom/Element.cpp:
2911         (WebCore::Element::insertAdjacentHTML):
2912         * dom/Element.h:
2913         * html/canvas/CanvasStyle.cpp:
2914         (WebCore::parseColor):
2915         * inspector/DOMEditor.cpp:
2916         * platform/network/curl/CurlFormDataStream.cpp:
2917         (WebCore::CurlFormDataStream::getPostData):
2918         (): Deleted.
2919         * platform/network/curl/CurlFormDataStream.h:
2920         * platform/network/curl/CurlRequest.cpp:
2921         (WebCore::CurlRequest::setupPOST):
2922         * testing/MockCDMFactory.cpp:
2923         (WebCore::MockCDMFactory::keysForSessionWithID const):
2924         (WebCore::MockCDMInstance::updateLicense):
2925         (WebCore:: const): Deleted.
2926         * testing/MockCDMFactory.h:
2927
2928 2018-05-03  Chris Dumez  <cdumez@apple.com>
2929
2930         Stop using an iframe's id as fallback if its name attribute is not set
2931         https://bugs.webkit.org/show_bug.cgi?id=11388
2932
2933         Reviewed by Geoff Garen.
2934
2935         WebKit had logic to use an iframe's id as fallback name when its name
2936         content attribute is not set. This behavior was not standard and did not
2937         match other browsers:
2938         - https://html.spec.whatwg.org/#attr-iframe-name
2939
2940         Gecko / Trident never behaved this way. Blink was aligned with us until
2941         they started to match the specification in:
2942         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
2943
2944         This WebKit quirk was causing some Web-compatibility issues because it
2945         would affect the behavior of Window's name property getter when trying
2946         to look up an iframe by id. Because of Window's named property getter
2947         behavior [1], we would return the frame's contentWindow instead of the
2948         iframe element itself.
2949
2950         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
2951
2952         Test: fast/dom/Window/named-getter-frame-id.html
2953
2954         * html/HTMLFrameElementBase.cpp:
2955         (WebCore::HTMLFrameElementBase::openURL):
2956         (WebCore::HTMLFrameElementBase::parseAttribute):
2957         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
2958         * html/HTMLFrameElementBase.h:
2959
2960 2018-05-03  Eric Carlson  <eric.carlson@apple.com>
2961
2962         [iOS] Internal text and audio tracks not in fullscreen menu
2963         https://bugs.webkit.org/show_bug.cgi?id=185268
2964         <rdar://problem/38673440>
2965
2966         Reviewed by Jer Noble.
2967
2968         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2969         (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
2970         events are fired at the track lists, not the media element.
2971
2972 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
2973
2974         Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
2975         https://bugs.webkit.org/show_bug.cgi?id=185238
2976
2977         Reviewed by Antti Koivisto.
2978
2979         The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
2980         even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
2981
2982         Test: fast/images/imagemap-in-nested-shadow-tree.html
2983               fast/images/imagemap-in-shadow-tree.html
2984
2985         * dom/Document.cpp:
2986         (WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
2987         (WebCore::Document::removeImageElementByUsemap): Ditto.
2988         (WebCore::Document::imageElementByUsemap const): Ditto.
2989         * dom/Document.h:
2990         * dom/TreeScope.cpp:
2991         (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
2992         (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
2993         which used to call this function with the raw value of the usemap content attribute now calls it
2994         via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
2995         (WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
2996         (WebCore::TreeScope::removeImageElementByUsemap): Ditto.
2997         (WebCore::TreeScope::imageElementByUsemap const): Ditto.
2998         * dom/TreeScope.h:
2999         * html/HTMLImageElement.cpp:
3000         (WebCore::HTMLImageElement::parseAttribute):
3001         (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
3002         if it's connected to a document.
3003         (WebCore::HTMLImageElement::removedFromAncestor):
3004         (WebCore::HTMLImageElement::associatedMapElement const):
3005         * html/HTMLImageElement.h:
3006         * html/HTMLMapElement.cpp:
3007         (WebCore::HTMLMapElement::imageElement):
3008         * rendering/RenderImage.cpp:
3009         (WebCore::RenderImage::imageMap const):
3010
3011 2018-05-03  Justin Fan  <justin_fan@apple.com>
3012
3013         [WebGL] Add runtime flag for enabling ASTC support in WebGL
3014         https://bugs.webkit.org/show_bug.cgi?id=184840
3015
3016         Reviewed by Myles C. Maxfield.
3017
3018         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
3019
3020         * page/RuntimeEnabledFeatures.h:
3021         (WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
3022         (WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
3023
3024 2018-05-03  Chris Nardi  <cnardi@chromium.org>
3025
3026         Remove [NoInterfaceObject] from DOMRectList
3027         https://bugs.webkit.org/show_bug.cgi?id=185255
3028
3029         Reviewed by Chris Dumez.
3030
3031         In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
3032         from DOMRectList. Remove it from our implementation to match the spec, as well as
3033         Chrome and Firefox.
3034
3035         Updated web platform tests IDL test for the Geometry spec.
3036
3037         * dom/DOMRectList.idl:
3038
3039 2018-05-03  Chris Dumez  <cdumez@apple.com>
3040
3041         REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
3042         https://bugs.webkit.org/show_bug.cgi?id=185073
3043         <rdar://problem/39821223>
3044
3045         Reviewed by Alexey Proskuryakov.
3046
3047         The following changes were made:
3048         - Make sure SocketStream callbacks are always scheduled on the right runloop:
3049           WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
3050           main runloop otherwise.
3051         - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
3052           before calling methods on the SocketStream client. Previously, this code path
3053           was specific to Windows but there is no reason to have platform-specific code here.
3054           callOnMainThreadAndWait() calls the function right away if we're already on the main
3055           thread, which will be the case on other platform than Windows.
3056
3057         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3058         (WebCore::callbacksRunLoop):
3059         (WebCore::callbacksRunLoopMode):
3060         (WebCore::SocketStreamHandleImpl::scheduleStreams):
3061         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
3062         (WebCore::SocketStreamHandleImpl::executePACFileURL):
3063         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
3064         (WebCore::SocketStreamHandleImpl::readStreamCallback):
3065         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
3066         (WebCore::SocketStreamHandleImpl::platformClose):
3067
3068 2018-05-03  Zalan Bujtas  <zalan@apple.com>
3069
3070         [LFC] Enable multiple layout roots for incremental layout.
3071         https://bugs.webkit.org/show_bug.cgi?id=185185
3072
3073         Reviewed by Antti Koivisto.
3074
3075         With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
3076         When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
3077         the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
3078
3079         * layout/FormattingState.h:
3080         * layout/LayoutContext.cpp:
3081         (WebCore::Layout::LayoutContext::updateLayout):
3082         (WebCore::Layout::LayoutContext::addLayoutEntryPoint):
3083         * layout/LayoutContext.h:
3084
3085 2018-05-03  Zalan Bujtas  <zalan@apple.com>
3086
3087         [LFC] Box invalidation logic should go to dedicated classes.
3088         https://bugs.webkit.org/show_bug.cgi?id=185249
3089
3090         Reviewed by Antti Koivisto.
3091
3092         Each formatting context can initiate a different type of invalidation when
3093         style attribute changes in a box.
3094
3095         * Sources.txt:
3096         * WebCore.xcodeproj/project.pbxproj:
3097         * layout/FormattingState.cpp:
3098         (WebCore::Layout::FormattingState::FormattingState):
3099         * layout/FormattingState.h:
3100         (WebCore::Layout::FormattingState::isBlockFormattingState const):
3101         (WebCore::Layout::FormattingState::isInlineFormattingState const):
3102         * layout/LayoutContext.cpp:
3103         (WebCore::Layout::LayoutContext::styleChanged):
3104         (WebCore::Layout::LayoutContext::markNeedsUpdate):
3105         * layout/LayoutContext.h:
3106         * layout/blockformatting/BlockFormattingState.cpp:
3107         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3108         * layout/blockformatting/BlockFormattingState.h:
3109         * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
3110         (WebCore::Layout::BlockInvalidation::invalidate):
3111         * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
3112         * layout/inlineformatting/InlineFormattingState.cpp:
3113         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3114         * layout/inlineformatting/InlineFormattingState.h:
3115         * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
3116         (WebCore::Layout::InlineInvalidation::invalidate):
3117         * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
3118
3119 2018-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
3120
3121         WebKit should send fake macOS user agent to docs.google.com
3122         https://bugs.webkit.org/show_bug.cgi?id=185165
3123
3124         Reviewed by Carlos Garcia Campos.
3125
3126         * platform/UserAgentQuirks.cpp:
3127         (WebCore::urlRequiresMacintoshPlatform):
3128         (WebCore::urlRequiresLinuxDesktopPlatform):
3129
3130 2018-05-03  Commit Queue  <commit-queue@webkit.org>
3131
3132         Unreviewed, rolling out r231223 and r231288.
3133         https://bugs.webkit.org/show_bug.cgi?id=185256
3134
3135         The change in r231223 breaks internal builds, and r231288 is a
3136         dependent change. (Requested by ryanhaddad on #webkit).
3137
3138         Reverted changesets:
3139
3140         "Use default std::optional if it is provided"
3141         https://bugs.webkit.org/show_bug.cgi?id=185159
3142         https://trac.webkit.org/changeset/231223
3143
3144         "Use pointer instead of
3145         std::optional<std::reference_wrapper<>>"
3146         https://bugs.webkit.org/show_bug.cgi?id=185186
3147         https://trac.webkit.org/changeset/231288
3148
3149 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
3150
3151         Unreviewed, rolling out r231253.
3152
3153         The API test added with this change is crashing on the bots.
3154
3155         Reverted changeset:
3156
3157         "Web Inspector: opt out of process swap on navigation if a Web
3158         Inspector frontend is connected"
3159         https://bugs.webkit.org/show_bug.cgi?id=184861
3160         https://trac.webkit.org/changeset/231253
3161
3162 2018-05-03  Youenn Fablet  <youenn@apple.com>
3163
3164         A MediaStream being played should allow removing some of its tracks
3165         https://bugs.webkit.org/show_bug.cgi?id=185233
3166
3167         Reviewed by Eric Carlson.
3168
3169         Update the tracks out of the for loop.
3170         Test: fast/mediastream/change-tracks-media-stream-being-played.html
3171
3172         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3173         (WebCore::updateTracksOfType):
3174
3175 2018-05-03  Miguel Gomez  <magomez@igalia.com>
3176
3177         WebCore::TextureMapperLayer object used after freed
3178         https://bugs.webkit.org/show_bug.cgi?id=184729
3179
3180         Reviewed by Michael Catanzaro.
3181
3182         Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
3183         inside TextureMapperLayer.
3184
3185         * platform/graphics/texmap/TextureMapperLayer.cpp:
3186         (WebCore::TextureMapperLayer::~TextureMapperLayer):
3187         (WebCore::TextureMapperLayer::setMaskLayer):
3188         (WebCore::TextureMapperLayer::setReplicaLayer):
3189         * platform/graphics/texmap/TextureMapperLayer.h:
3190
3191 2018-05-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3192
3193         [Curl] Add OpenSSL/LibreSSL multi-threading support
3194         https://bugs.webkit.org/show_bug.cgi?id=185138
3195
3196         The older OpenSSL manual says the locking_function and threadid_function should
3197         be set when use it in multi-threading environment. This applies to LibreSSL also.
3198         https://www.openssl.org/docs/man1.0.2/crypto/threads.html
3199
3200         For unix and other similar os, the default threadId_function implementation is
3201         good enough. We'll set custom callback only for Windows OS.
3202
3203         Note it's not required for OpenSSL 1.1.0 and after.
3204         https://www.openssl.org/blog/blog/2017/02/21/threads/
3205
3206         Reviewed by Per Arne Vollan.
3207
3208         * platform/network/curl/CurlSSLHandle.cpp:
3209         (WebCore::CurlSSLHandle::CurlSSLHandle):
3210         (WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
3211         (WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
3212         (WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
3213         * platform/network/curl/CurlSSLHandle.h:
3214         (WebCore::CurlSSLHandle::ThreadSupport::setup):
3215         (WebCore::CurlSSLHandle::ThreadSupport::singleton):
3216         (WebCore::CurlSSLHandle::ThreadSupport::lock):
3217         (WebCore::CurlSSLHandle::ThreadSupport::unlock):
3218
3219 2018-05-02  Ryosuke Niwa  <rniwa@webkit.org>
3220
3221         Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
3222         https://bugs.webkit.org/show_bug.cgi?id=185227
3223
3224         Reviewed by Chris Dumez.
3225
3226         Removed the check. The attribute value string can never be null.
3227
3228         * dom/Element.cpp:
3229         (WebCore::Element::removeAttributeInternal):
3230
3231 2018-05-02  Zalan Bujtas  <zalan@apple.com>
3232
3233         [LFC] Implement LayoutContext::createDisplayBox
3234         https://bugs.webkit.org/show_bug.cgi?id=185158
3235
3236         Reviewed by Antti Koivisto.
3237
3238         Now compute*() functions take both the const layout and the corresponding non-const display boxes.
3239         Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
3240         (This might need to change in the future if we decide to arrange them in some sort of painting order)
3241
3242         * layout/FloatingContext.cpp:
3243         (WebCore::Layout::FloatingContext::computePosition):
3244         * layout/FloatingContext.h:
3245         * layout/FormattingContext.cpp:
3246         (WebCore::Layout::FormattingContext::computeStaticPosition const):
3247         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
3248         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
3249         (WebCore::Layout::FormattingContext::computeWidth const):
3250         (WebCore::Layout::FormattingContext::computeHeight const):
3251         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
3252         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
3253         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
3254         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
3255         * layout/FormattingContext.h:
3256         * layout/LayoutContext.cpp:
3257         (WebCore::Layout::LayoutContext::createDisplayBox):
3258         * layout/LayoutContext.h:
3259         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
3260         * layout/blockformatting/BlockFormattingContext.cpp:
3261         (WebCore::Layout::BlockFormattingContext::layout const):
3262         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3263         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
3264         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
3265         * layout/blockformatting/BlockFormattingContext.h:
3266         * layout/displaytree/DisplayBox.h:
3267         (WebCore::Display::Box::parent const): Deleted.
3268         (WebCore::Display::Box::nextSibling const): Deleted.
3269         (WebCore::Display::Box::previousSibling const): Deleted.
3270         (WebCore::Display::Box::firstChild const): Deleted.
3271         (WebCore::Display::Box::lastChild const): Deleted.
3272         (WebCore::Display::Box::setParent): Deleted.
3273         (WebCore::Display::Box::setNextSibling): Deleted.
3274         (WebCore::Display::Box::setPreviousSibling): Deleted.
3275         (WebCore::Display::Box::setFirstChild): Deleted.
3276         (WebCore::Display::Box::setLastChild): Deleted.
3277         (): Deleted.
3278         * layout/inlineformatting/InlineFormattingContext.cpp:
3279         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
3280         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
3281         * layout/inlineformatting/InlineFormattingContext.h:
3282
3283 2018-05-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
3284
3285         Hiding then showing an <object> of type image makes the underlaying image disappear
3286         https://bugs.webkit.org/show_bug.cgi?id=185216
3287         <rdar://problem/39055630>
3288
3289         Reviewed by Youenn Fablet.
3290
3291         Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
3292         RenderImage with the CachedImage of its ImageLoader when the RenderImage
3293         is recreated.
3294
3295         Test: fast/images/object-image-hide-show.html
3296
3297         * html/HTMLPlugInImageElement.cpp:
3298         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
3299         This is very similar to what we do in HTMLImageElement::didAttachRenderers().
3300
3301
3302 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
3303
3304         Use RetainPtr for form input type
3305         https://bugs.webkit.org/show_bug.cgi?id=185210
3306         <rdar://problem/39734040>
3307
3308         Reviewed by Ryosuke Niwa.
3309
3310         Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
3311
3312         Test: fast/forms/access-key-mutation-2.html.
3313
3314         * html/HTMLInputElement.cpp:
3315         (WebCore::HTMLInputElement::HTMLInputElement):
3316         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
3317         (WebCore::HTMLInputElement::accessKeyAction):
3318         (WebCore::HTMLInputElement::parseAttribute):
3319         (WebCore::HTMLInputElement::appendFormData):
3320         * html/HTMLInputElement.h:
3321         * html/InputType.cpp:
3322         (WebCore::createInputType):
3323         (WebCore::InputType::create):
3324         (WebCore::InputType::createText):
3325         * html/InputType.h:
3326
3327 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3328
3329         Use pointer instead of std::optional<std::reference_wrapper<>>
3330         https://bugs.webkit.org/show_bug.cgi?id=185186
3331
3332         Reviewed by Alex Christensen.
3333
3334         std::optional<T&> is not accepted in C++17 spec. So we replaced it
3335         with std::optional<std::reference_wrapper<T>>.
3336
3337         In this patch, we replace it with T*, which is well-aligned to
3338         WebKit's convention.
3339
3340         * Modules/mediastream/RTCPeerConnection.cpp:
3341         (WebCore::iceServersFromConfiguration):
3342         (WebCore::RTCPeerConnection::initializeConfiguration):
3343         (WebCore::RTCPeerConnection::setConfiguration):
3344         * css/parser/CSSParser.cpp:
3345         (WebCore::CSSParser::parseSystemColor):
3346         * css/parser/CSSParser.h:
3347         * dom/DatasetDOMStringMap.cpp:
3348         (WebCore::DatasetDOMStringMap::item const):
3349         (WebCore::DatasetDOMStringMap::namedItem const):
3350         * dom/DatasetDOMStringMap.h:
3351         * dom/Element.cpp:
3352         (WebCore::Element::insertAdjacentHTML):
3353         * dom/Element.h:
3354         * html/canvas/CanvasStyle.cpp:
3355         (WebCore::parseColor):
3356         * inspector/DOMEditor.cpp:
3357         * platform/network/curl/CurlFormDataStream.cpp:
3358         (WebCore::CurlFormDataStream::getPostData):
3359         * platform/network/curl/CurlFormDataStream.h:
3360         * platform/network/curl/CurlRequest.cpp:
3361         (WebCore::CurlRequest::setupPOST):
3362         * testing/MockCDMFactory.cpp:
3363         (WebCore::MockCDMFactory::keysForSessionWithID const):
3364         (WebCore::MockCDMInstance::updateLicense):
3365         * testing/MockCDMFactory.h:
3366
3367 2018-05-02  Keith Rollin  <krollin@apple.com>
3368
3369         Add facility for tracking times and results of page and resource loading
3370         https://bugs.webkit.org/show_bug.cgi?id=184838
3371         <rdar://problem/36548974>
3372
3373         Reviewed by Brent Fulgham.
3374
3375         Update FrameProgressTracker to send the necessary page load start/stop
3376         signals so that we can track the entire page load at a network level.
3377         Add an empty override of the pure virtual
3378         LoaderStrategy::pageLoadCompleted method.
3379
3380         No new tests. There is no testable effect from these changes. On
3381         Cocoa, measurable changes take place in another (non-WebKit) process.
3382         On non-Cocoa systems, this facility is currently disabled.
3383
3384         * loader/FrameLoader.cpp:
3385         (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
3386         * loader/LoaderStrategy.h:
3387
3388 2018-05-02  Aditya Keerthi  <akeerthi@apple.com>
3389
3390         Can't copy and paste URLs that have no title into Mail (macOS)
3391         https://bugs.webkit.org/show_bug.cgi?id=185205
3392         <rdar://problem/36352406>
3393
3394         Reviewed by Tim Horton.
3395
3396         The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
3397
3398         To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.
3399
3400         Augmented WebKitLegacy.ContextMenuCanCopyURL test
3401
3402         * platform/mac/PasteboardMac.mm:
3403         (WebCore::writeURLForTypes):
3404
3405 2018-05-01  Ryosuke Niwa  <rniwa@webkit.org>
3406
3407         REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
3408         https://bugs.webkit.org/show_bug.cgi?id=182188
3409         <rdar://problem/36689240>
3410
3411         Reviewed by Antti Koivisto.
3412
3413         Fixed the crash by removing up the release assert.
3414
3415         The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
3416         Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
3417         without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
3418         in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
3419         invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
3420         whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
3421
3422         There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
3423         true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
3424         this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
3425
3426         This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
3427         since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
3428         and there is no evidence that r225868 has led to new UAFs even after five months.
3429
3430         No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
3431
3432         * dom/Document.cpp:
3433         (WebCore::Document::removeSVGUseElement):
3434
3435 2018-05-02  Dirk Schulze  <dschulze@chromium.org>
3436
3437         getCharNumAtPosition should take DOMPointInit as argument
3438         https://bugs.webkit.org/show_bug.cgi?id=184695
3439
3440         Reviewed by Antti Koivisto.
3441
3442         Extend existing tests for getCharNumAtPosition.
3443
3444         * svg/SVGTextContentElement.cpp:
3445         (WebCore::SVGTextContentElement::getCharNumAtPosition):
3446         * svg/SVGTextContentElement.h:
3447         * svg/SVGTextContentElement.idl: Use DOMPointInit argument.
3448
3449 2018-05-02  Youenn Fablet  <youenn@apple.com>
3450
3451         Use NetworkLoadChecker for navigation loads
3452         https://bugs.webkit.org/show_bug.cgi?id=184892
3453         <rdar://problem/39652686>
3454
3455         Reviewed by Chris Dumez.
3456
3457         Sanitize headers according response tainting.
3458         If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
3459         If tainting is Opaque, we filter all uncommon headers.
3460         If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
3461         Covered by updated test.
3462
3463         * platform/network/ResourceResponseBase.cpp:
3464         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
3465         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
3466         * platform/network/ResourceResponseBase.h:
3467
3468 2018-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
3469
3470         Collection fragment identifiers don't use PostScript names
3471         https://bugs.webkit.org/show_bug.cgi?id=184624
3472         <rdar://problem/39432089>
3473
3474         Reviewed by Simon Fraser.
3475
3476         In a previous version of the CSS Fonts spec, there was text saying that items in font collections
3477         should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
3478         inserting an item into the middle of a collection would throw off all content that uses the file.
3479         Instead, the spec has since changed to use PostScript names (so the content instead would say
3480         MyFonts.ttc#MyFont-Regular).
3481
3482         Test: fast/text/font-collection.html
3483
3484         * css/CSSFontFaceSource.cpp:
3485         (WebCore::CSSFontFaceSource::load):
3486         * loader/cache/CachedFont.cpp:
3487         (WebCore::CachedFont::calculateItemInCollection const):
3488         (WebCore::CachedFont::ensureCustomFontData):
3489         (WebCore::CachedFont::createCustomFontData):
3490         (WebCore::CachedFont::calculateIndex const): Deleted.
3491         * loader/cache/CachedFont.h:
3492         * platform/graphics/mac/FontCustomPlatformData.cpp:
3493         (WebCore::createFontCustomPlatformData):
3494         * platform/graphics/mac/FontCustomPlatformData.h:
3495
3496 2018-05-02  Brian Burg  <bburg@apple.com>
3497
3498         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
3499         https://bugs.webkit.org/show_bug.cgi?id=184861
3500         <rdar://problem/39153768>
3501
3502         Reviewed by Ryosuke Niwa.
3503
3504         Notify the client of the current connection count whenever a frontend connects or disconnects.
3505
3506         Covered by new API test.
3507
3508         * inspector/InspectorClient.h:
3509         (WebCore::InspectorClient::frontendCountChanged):
3510         * inspector/InspectorController.cpp:
3511         (WebCore::InspectorController::connectFrontend):
3512         (WebCore::InspectorController::disconnectFrontend):
3513         (WebCore::InspectorController::disconnectAllFrontends):
3514         * inspector/InspectorController.h:
3515
3516 2018-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3517
3518         [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
3519         https://bugs.webkit.org/show_bug.cgi?id=185207
3520
3521         Reviewed by Michael Catanzaro.
3522
3523         Remove unneeded include of gstgldisplay_wayland.h
3524
3525         No new tests, no change in behaviour.
3526
3527         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3528
3529 2018-05-02  Chris Dumez  <cdumez@apple.com>
3530
3531         document.open() event listener removal is not immediate
3532         https://bugs.webkit.org/show_bug.cgi?id=185191
3533
3534         Reviewed by Darin Adler.
3535
3536         We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
3537         whenever they get removed from the EventListenerMap. We were doing so correctly
3538         in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
3539         updates clear() accordingly.
3540
3541         The reason we need to set this flag is that RegisteredEventListeners is RefCounted
3542         and EventTarget::fireEventListeners() may be currently running and calling
3543         each listener one by one, holding a reference to all listener of a given event.
3544
3545         Test: fast/dom/Document/document-open-removes-all-listeners.html
3546
3547         * dom/EventListenerMap.cpp:
3548         (WebCore::EventListenerMap::clear):
3549
3550 2018-05-02  Zalan Bujtas <zalan@apple.com>
3551
3552         Use WeakPtr in GridCell
3553         https://bugs.webkit.org/show_bug.cgi?id=185180
3554         <rdar://problem/39432165>
3555
3556         Reviewed by Antti Koivisto.
3557
3558         Since GridCell does not own the renderers, it should
3559         construct weak pointers.
3560
3561         Unable to create a reliably reproducible test case.
3562
3563         * rendering/Grid.cpp:
3564         (WebCore::Grid::insert):
3565         (WebCore::GridIterator::nextGridItem):
3566         * rendering/Grid.h:
3567         * rendering/RenderGrid.cpp:
3568         (WebCore::RenderGrid::firstLineBaseline const):
3569
3570 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
3571
3572         [iOS] Provide audio route information when invoking AirPlay picker
3573         https://bugs.webkit.org/show_bug.cgi?id=185199
3574         <rdar://problem/39853103>
3575
3576         Reviewed by Jer Noble.
3577
3578         No new tests, this requires a specific hardware setup.
3579
3580         * dom/Document.cpp:
3581         (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
3582         * dom/Document.h:
3583
3584         * html/MediaElementSession.cpp:
3585         (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
3586
3587         * loader/EmptyClients.h:
3588         * page/ChromeClient.h:
3589
3590         * page/Page.cpp:
3591         (WebCore::Page::showPlaybackTargetPicker): Ditto.
3592         * page/Page.h:
3593
3594         * platform/audio/AudioSession.cpp:
3595         (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
3596         (WebCore::routingContextUID const): Ditto.
3597         * platform/audio/AudioSession.h:
3598
3599         * platform/audio/ios/AudioSessionIOS.mm:
3600         (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
3601         (WebCore::AudioSession::routingContextUID const): Return the route context UID.
3602
3603 2018-05-02  Dean Jackson  <dino@apple.com>
3604
3605         Draw SystemPreview badge to specification on iOS
3606         https://bugs.webkit.org/show_bug.cgi?id=185203
3607         <rdar://problem/39908855>
3608
3609         Reviewed by Tim Horton.
3610
3611         Use CoreImage to render a badge with a blurred background,
3612         at particular sizes.
3613
3614         This will be tested internally while we're getting artwork
3615         from WebKitAdditions.
3616
3617         * Configurations/WebCore.xcconfig: Link against CoreImage.
3618         * rendering/RenderThemeIOS.h:
3619         * rendering/RenderThemeIOS.mm:
3620         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
3621         in the iOS platform RenderTheme that draws the system preview.
3622
3623 2018-05-01  Brent Fulgham  <bfulgham@apple.com>
3624
3625         Prevent Debug ASSERT when changing forms
3626         https://bugs.webkit.org/show_bug.cgi?id=185173
3627         <rdar://problem/39738669>
3628
3629         Reviewed by Ryosuke Niwa.
3630
3631         Form submission could trigger a debug assertion during validation when
3632         a form is changed during an input submission. Fix this by cleaning up
3633         the event handling logic and make it more consistent with modern WebKit
3634         coding style.
3635
3636         Test: fast/forms/form-submission-crash-3.html
3637
3638         * html/HTMLButtonElement.cpp:
3639         (WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
3640         attempting to perform event handling.
3641         * html/HTMLFormElement.cpp:
3642         (WebCore::HTMLFormElement::reportValidity): Ditto.
3643         (WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
3644         since we expect this to happen earlier in the layout pass. Add an assertion that the
3645         tree is not dirty.
3646         * html/ImageInputType.cpp:
3647         (WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
3648         attempting to perform event handling.
3649         * html/SubmitInputType.cpp:
3650         (WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
3651
3652 2018-05-02  Jer Noble  <jer.noble@apple.com>
3653
3654         Unreviewed; address review comments made before landing r231231.
3655
3656         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3657         (VideoFullscreenControllerContext::volume const):
3658
3659 2018-05-02  Jer Noble  <jer.noble@apple.com>
3660
3661         Pipe volume through PlaybackSessionManager/Proxy.
3662         https://bugs.webkit.org/show_bug.cgi?id=185182
3663
3664         Reviewed by Eric Carlson.
3665
3666         Add support for the volume property to PlaybackSessionModel, and all its clients.
3667
3668         * platform/cocoa/PlaybackSessionModel.h:
3669         (WebCore::PlaybackSessionModelClient::volumeChanged):
3670         * platform/cocoa/PlaybackSessionModelMediaElement.h:
3671         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
3672         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
3673         (WebCore::PlaybackSessionModelMediaElement::setVolume):
3674         (WebCore::PlaybackSessionModelMediaElement::volume const):
3675         * platform/ios/PlaybackSessionInterfaceAVKit.h:
3676         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
3677         (WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
3678         * platform/ios/WebAVPlayerController.h:
3679         * platform/ios/WebAVPlayerController.mm:
3680         (-[WebAVPlayerController volume]):
3681         (-[WebAVPlayerController setVolume:]):
3682         (-[WebAVPlayerController volumeChanged:]):
3683         (-[WebAVPlayerController resetMediaState]):
3684         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3685         (VideoFullscreenControllerContext::volumeChanged):
3686         (VideoFullscreenControllerContext::volume const):
3687         (VideoFullscreenControllerContext::setVolume):
3688
3689 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3690
3691         Unreviewed, fix build in WinCairo
3692         https://bugs.webkit.org/show_bug.cgi?id=185169
3693
3694         * bindings/js/JSDOMWindowBase.cpp:
3695         (WebCore::JSDOMWindowBase::instantiateStreaming):
3696         * bindings/js/JSDOMWindowBase.h:
3697
3698 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
3699
3700         Use default std::optional if it is provided
3701         https://bugs.webkit.org/show_bug.cgi?id=185159
3702
3703         Reviewed by JF Bastien.
3704
3705         * Modules/mediastream/RTCPeerConnection.cpp:
3706         (WebCore::iceServersFromConfiguration):
3707         (WebCore::RTCPeerConnection::setConfiguration):
3708         * css/parser/CSSParser.cpp:
3709         (WebCore::CSSParser::parseSystemColor):
3710         * css/parser/CSSParser.h:
3711         * dom/DatasetDOMStringMap.cpp:
3712         (WebCore::DatasetDOMStringMap::item const):
3713         (WebCore::DatasetDOMStringMap::namedItem const):
3714         (WebCore:: const): Deleted.
3715         * dom/DatasetDOMStringMap.h:
3716         * dom/Element.cpp:
3717         (WebCore::Element::insertAdjacentHTML):
3718         * dom/Element.h:
3719         * inspector/DOMEditor.cpp:
3720         * platform/network/curl/CurlFormDataStream.cpp:
3721         (WebCore::CurlFormDataStream::getPostData):
3722         (): Deleted.
3723         * platform/network/curl/CurlFormDataStream.h:
3724         * testing/MockCDMFactory.cpp:
3725         (WebCore::MockCDMFactory::keysForSessionWithID const):
3726         (WebCore::MockCDMInstance::updateLicense):
3727         (WebCore:: const): Deleted.
3728         * testing/MockCDMFactory.h:
3729
3730 2018-05-01  Chris Dumez  <cdumez@apple.com>
3731
3732         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
3733         https://bugs.webkit.org/show_bug.cgi?id=185181
3734
3735         Reviewed by Geoffrey Garen.
3736
3737         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
3738         on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
3739         which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
3740         to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
3741         the UIthread instead of the WebThread on iOS WebKitLegacy.
3742
3743         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3744         (WebCore::SocketStreamHandleImpl::scheduleStreams):
3745         (WebCore::SocketStreamHandleImpl::readStreamCallback):
3746
3747 2018-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
3748
3749         Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
3750
3751         * page/RuntimeEnabledFeatures.h:
3752
3753 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
3754
3755         Fix build error after r231194
3756         https://bugs.webkit.org/show_bug.cgi?id=185169
3757
3758         Reviewed by JF Bastien.
3759
3760         Prevent compile error in iOS Simulator debug build
3761         by tagging function
3762
3763         * bindings/js/JSDOMWindowBase.cpp:
3764         (WebCore::JSDOMWindowBase::compileStreaming):
3765         (WebCore::JSDOMWindowBase::instantiateStreaming):
3766
3767 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
3768
3769         WebAssembly: add support for stream APIs - JavaScript API
3770         https://bugs.webkit.org/show_bug.cgi?id=183442
3771
3772         Reviewed by Yusuke Suzuki and JF Bastien.
3773
3774         Add WebAssembly streaming API to WebCore.
3775
3776         * Configurations/FeatureDefines.xcconfig:
3777         * bindings/js/JSDOMWindowBase.cpp:
3778         (WebCore::tryAllocate):
3779         (WebCore::isResponseCorrect):
3780         (WebCore::handleResponseOnStreamingAction):
3781         (WebCore::JSDOMWindowBase::compileStreaming):
3782         (WebCore::JSDOMWindowBase::instantiateStreaming):
3783         * bindings/js/JSDOMWindowBase.h:
3784         * bindings/js/JSRemoteDOMWindowBase.cpp:
3785         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3786
3787 2018-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
3788
3789         Improve the performance of FontCascadeDescription's effectiveFamilies
3790         https://bugs.webkit.org/show_bug.cgi?id=184720
3791         <rdar://problem/38970927>
3792
3793         Reviewed by Simon Fraser.
3794
3795         The page that had the performance problem renders many different Chinese characters in system-ui
3796         with only a small number of individual fonts. It turns out we were calling into the system-ui
3797         machinery for each character in order to opportunistically start loading data URLs (see also:
3798         https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
3799         font, so we don't need to invoke the system-ui machinery at all.
3800
3801         This patch makes a 92x performance improvement on the associated performance test. This test is
3802         designed to test Chinese text rendered with system-ui.
3803
3804         Performance test: Layout/system-ui.html
3805
3806         * platform/graphics/FontCascadeFonts.cpp:
3807         (WebCore::opportunisticallyStartFontDataURLLoading):
3808
3809 2018-04-30  Jer Noble  <jer.noble@apple.com>
3810
3811         <img src=mp4> does not display on ios despite Accept: video/* advertisement
3812         https://bugs.webkit.org/show_bug.cgi?id=185029
3813         <rdar://problem/39771989>
3814
3815         Reviewed by Eric Carlson.
3816
3817         Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
3818         even if the resource request is successfully fulfilled prior to the return. Always return YES in
3819         the case that loading succeeded.
3820
3821         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
3822         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
3823
3824 2018-04-30  Zalan Bujtas  <zalan@apple.com>
3825
3826         REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
3827         https://bugs.webkit.org/show_bug.cgi?id=185142
3828         <rdar://problem/39821446>
3829
3830         Reviewed by Simon Fraser.
3831
3832         Set the overflow rect on the inline textbox when needed.
3833
3834         Test: fast/text/simple-line-layout-selection-with-overflow.html
3835
3836         * rendering/SimpleLineLayoutFunctions.cpp:
3837         (WebCore::SimpleLineLayout::initializeInlineTextBox):
3838         (WebCore::SimpleLineLayout::generateLineBoxTree):
3839         (WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
3840
3841 2018-04-30  JF Bastien  <jfbastien@apple.com>
3842
3843         Use some C++17 features
3844         https://bugs.webkit.org/show_bug.cgi?id=185135
3845
3846         Reviewed by Alex Christensen.
3847
3848         As discussed here [0] let's move WebKit to a subset of C++17. We
3849         now require GCC 6 [1] which means that, according to [2] we can
3850         use the following C++17 language features (I removed some
3851         uninteresting ones):
3852
3853          - New auto rules for direct-list-initialization
3854          - static_assert with no message
3855          - typename in a template template parameter
3856          - Nested namespace definition
3857          - Attributes for namespaces and enumerators
3858          - u8 character literals
3859          - Allow constant evaluation for all non-type template arguments
3860          - Fold Expressions
3861          - Unary fold expressions and empty parameter packs
3862          - __has_include in preprocessor conditional
3863          - Differing begin and end types in range-based for
3864          - Improving std::pair and std::tuple
3865
3866         Consult the Tony Tables [3] to see before / after examples.
3867
3868         Of course we can use any library feature if we're willing to
3869         import them to WTF (and they don't require language support).
3870
3871
3872           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
3873           [1]: https://trac.webkit.org/changeset/231152/webkit
3874           [2]: https://en.cppreference.com/w/cpp/compiler_support
3875           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
3876
3877         * DerivedSources.make:
3878         * platform/URLParser.cpp: work around an odd GCC 6 bug with class
3879           static value as a template parameter.
3880         (WebCore::URLParser::percentDecode):
3881         (WebCore::URLParser::domainToASCII):
3882         (WebCore::URLParser::hasForbiddenHostCodePoint):
3883         (WebCore::URLParser::parseHostAndPort):
3884         * platform/URLParser.h:
3885
3886 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3887
3888         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
3889         https://bugs.webkit.org/show_bug.cgi?id=185132
3890         <rdar://problem/39834562>
3891
3892         Reviewed by Tim Horton.
3893
3894         Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
3895         `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
3896         behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
3897
3898         Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
3899
3900         * dom/ViewportArguments.cpp:
3901         (WebCore::setViewportFeature):
3902         (WebCore::operator<<):
3903         * dom/ViewportArguments.h:
3904
3905         Removes the `minDeviceWidth` viewport argument.
3906
3907         * page/RuntimeEnabledFeatures.h:
3908         (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
3909         (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
3910
3911         Removes the runtime switch for `min-device-width`.
3912
3913         * page/ViewportConfiguration.cpp:
3914         (WebCore::platformDeviceWidthOverride):
3915
3916         Hard-code the override device width in extra zoom mode.
3917
3918         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
3919
3920         In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
3921         device width is less than the override device width.
3922
3923         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
3924         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
3925         (WebCore::ViewportConfiguration::updateConfiguration):
3926         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
3927
3928         Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
3929         device width is greater than the override device width.
3930
3931         (WebCore::computedMinDeviceWidth): Deleted.
3932         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
3933         * page/ViewportConfiguration.h:
3934
3935 2018-04-30  Chris Nardi  <cnardi@chromium.org>
3936
3937         Serialize font-variation-settings with double-quotes per spec
3938         https://bugs.webkit.org/show_bug.cgi?id=182542
3939
3940         Reviewed by Myles C. Maxfield.
3941
3942         According to the CSSOM spec [1], all strings should be serialized with double-quotes.
3943         The axis name in font-variation-settings was previously serialized with single-quotes;
3944         change this to double-quotes to match the spec and non-WebKit browsers.
3945
3946         [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
3947
3948         Updated fast/text/variations/getComputedStyle.html to test the change.
3949
3950         * css/CSSFontVariationValue.cpp:
3951         (WebCore::CSSFontVariationValue::customCSSText const):
3952
3953 2018-04-30  Chris Dumez  <cdumez@apple.com>
3954
3955         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
3956         https://bugs.webkit.org/show_bug.cgi?id=185134
3957
3958         Reviewed by Geoffrey Garen.
3959
3960         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
3961         and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
3962         the WebThread.
3963
3964         * dom/MessagePort.cpp:
3965         (WebCore::MessagePort::dispatchMessages):
3966
3967 2018-04-30  Simon Fraser  <simon.fraser@apple.com>
3968
3969         Make color-filter affect caret-color
3970         https://bugs.webkit.org/show_bug.cgi?id=185129
3971         rdar://problem/39829066
3972
3973         Reviewed by Tim Horton.
3974         
3975         Transform the colors used to compare the caret color with the background through
3976         color-filter (since we want contrasting colors after filters are applied), and
3977         transform caret-color itself.
3978
3979         Test: css3/color-filters/color-filter-caret-color.html
3980
3981         * editing/FrameSelection.cpp:
3982         (WebCore::CaretBase::paintCaret const):
3983
3984 2018-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
3985
3986         [GTK] Webkit should spoof as Safari on a Mac when on Chase.com
3987         https://bugs.webkit.org/show_bug.cgi?id=185103
3988
3989         Reviewed by Carlos Garcia Campos.
3990
3991         Send a fake user agent to chase.com to make it work.
3992
3993         * platform/UserAgentQuirks.cpp:
3994         (WebCore::urlRequiresMacintoshPlatform):
3995         (WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
3996
3997 2018-04-29  Simon Fraser  <simon.fraser@apple.com>
3998
3999         Make color-filter affect <attachment>
4000         https://bugs.webkit.org/show_bug.cgi?id=185122
4001         rdar://problem/39818763
4002
4003         Reviewed by Tim Horton.
4004         
4005         Convert the colors used to render <attachment> through color-filter, except
4006         for those parts that render over the icon (like the progress bar).
4007
4008         Not easily testable.
4009
4010