d3bfa44a670ed17590cdb1b0453c3e9fb0e42a4f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-22  Antoine Quint  <graouts@apple.com>
2
3         [Modern Media Controls] Scrubber stops moving while scrubbing on macOS
4         https://bugs.webkit.org/show_bug.cgi?id=168518
5         <rdar://problem/30577637>
6
7         Reviewed by Dean Jackson.
8
9         As we start to scrub, controlValueWillStartChanging() is called on
10         ScrubberSupport and pauses the media if it's not already paused. This
11         causes the play/pause button to change icon and for layout() to be
12         called on MacOSInlineMediaControls. This in turns sets the .children
13         property on the .controlsBar and eventually yields a DOM manipulation
14         which re-inserts the scrubber's DOM hierarchy, causing stutters during
15         user interaction.
16
17         Our solution is to make the .children setter smarter about identifying
18         that the children list hasn't changed and that no DOM invalidation is
19         necessary.
20
21         * Modules/modern-media-controls/controls/layout-node.js:
22         (LayoutNode.prototype.set children):
23
24 2017-02-22  Antoine Quint  <graouts@apple.com>
25
26         [Modern Media Controls] Controls bar may disappear while captions menu is visible
27         https://bugs.webkit.org/show_bug.cgi?id=168751
28         <rdar://problem/30663411>
29
30         Reviewed by Dean Jackson.
31
32         We now prevent the controls bar from fading out due to the auto-hide timer firing
33         when the tracks panel is up, and wait until the track panel is hidden before fading
34         the controls bar.
35
36         Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html
37
38         * Modules/modern-media-controls/controls/controls-bar.js:
39         (ControlsBar.prototype.set userInteractionEnabled):
40         (ControlsBar.prototype._autoHideTimerFired):
41
42 2017-02-22  Antoine Quint  <graouts@apple.com>
43
44         [Modern Media Controls] Can't set the volume slider with macOS inline controls
45         https://bugs.webkit.org/show_bug.cgi?id=168747
46         <rdar://problem/30605528>
47
48         Reviewed by Dean Jackson.
49
50         Only call super for events we haven't registered specifically in the context
51         of this class. Otherwise we'd invalidate the volume container visibility for
52         a "mousedown" event registered by the MacOSMediaControls, the super class.
53
54         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
55         (MacOSInlineMediaControls.prototype.handleEvent):
56
57 2017-02-22  Antti Koivisto  <antti@apple.com>
58
59         Replace SimpleLineLayout::Range by WTF::IteratorRange
60         https://bugs.webkit.org/show_bug.cgi?id=168742
61
62         Reviewed by Zalan Bujtas.
63
64         Kill a redundant custom type.
65
66         * rendering/SimpleLineLayoutResolver.cpp:
67         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
68         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
69         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
70         * rendering/SimpleLineLayoutResolver.h:
71         (WebCore::SimpleLineLayout::LineResolver::rangeForRect):
72         (WebCore::SimpleLineLayout::Range::Range): Deleted.
73         (WebCore::SimpleLineLayout::Range::begin): Deleted.
74         (WebCore::SimpleLineLayout::Range::end): Deleted.
75
76 2017-02-22  Simon Fraser  <simon.fraser@apple.com>
77
78         Add the Web Authentication API as "Under Consideration".
79
80         * features.json:
81
82 2017-02-22  Zalan Bujtas  <zalan@apple.com>
83
84         Simple line layout: Set the pagination strut on the flow when the first line does not fit the page.
85         https://bugs.webkit.org/show_bug.cgi?id=168738
86         <rdar://problem/30659469>
87
88         Reviewed by Antti Koivisto.
89
90         The pagination strut for the first line is tracked by the parent RenderBlockFlow and not by
91         the line itself (see RenderBlockFlow::adjustLinePositionForPagination()). Also renamed *PaginationStrut* to
92         *LineStrut* to make sure we don't confuse it with the block level strut.
93
94         Not enabled yet.
95
96         * rendering/SimpleLineLayout.cpp:
97         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
98         (WebCore::SimpleLineLayout::computeLineBreakIndex):
99         (WebCore::SimpleLineLayout::setPageBreakForLine):
100         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
101         (WebCore::SimpleLineLayout::create):
102         (WebCore::SimpleLineLayout::Layout::create):
103         (WebCore::SimpleLineLayout::Layout::Layout):
104         * rendering/SimpleLineLayout.h:
105         (WebCore::SimpleLineLayout::Layout::hasLineStruts):
106         (WebCore::SimpleLineLayout::Layout::struts):
107         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts): Deleted.
108         * rendering/SimpleLineLayoutFunctions.cpp:
109         (WebCore::SimpleLineLayout::paintFlow):
110         * rendering/SimpleLineLayoutFunctions.h:
111         (WebCore::SimpleLineLayout::computeFlowHeight):
112         * rendering/SimpleLineLayoutResolver.h:
113         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
114
115 2017-02-22  Youenn Fablet  <youenn@apple.com>
116
117         [WebRTC] Disable libwebrtc stderr logging in release mode
118         https://bugs.webkit.org/show_bug.cgi?id=168734
119
120         Reviewed by Tim Horton.
121
122         No change of behavior.
123
124         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
125         (WebCore::initializePeerConnectionFactoryAndThreads):
126
127 2017-02-22  Jer Noble  <jer.noble@apple.com>
128
129         MediaStreamSourceNode never receives audio from MockRealtimeAudioSourceMac.
130         https://bugs.webkit.org/show_bug.cgi?id=168731
131
132         Reviewed by Eric Carlson.
133
134         Test: fast/mediastream/mock-media-source-webaudio.html
135
136         Because the audioSourceProvider can be created before the mock source is configured, explicitly configure the
137         source if necessary after creating the audioSourceProvider.
138
139         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
140         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
141
142 2017-02-22  Chris Dumez  <cdumez@apple.com>
143
144         Do not aggressively throttle DOM timers until they've reached their max nesting level
145         https://bugs.webkit.org/show_bug.cgi?id=168700
146         <rdar://problem/29808005>
147
148         Reviewed by Simon Fraser.
149
150         Do not aggressively throttle DOM timers until they've actually areached their max
151         nesting level (5). This overly aggressive throttling of non-nested timers is what
152         was causing Google Maps to use 100% CPU in background tabs for several minutes.
153
154         Test: fast/dom/timer-throttling-hidden-page-non-nested.html
155
156         * dom/Document.cpp:
157         (WebCore::Document::timerAlignmentInterval):
158
159 2017-02-22  Eric Carlson  <eric.carlson@apple.com>
160
161         [MediaStream iOS] Respond to capture interruptions and notifications
162         https://bugs.webkit.org/show_bug.cgi?id=168610
163
164         Reviewed by Jer Noble.
165
166         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
167         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup: don't create
168         a sample buffer display layer unless there is an active video track.
169
170         * platform/mediastream/mac/AVMediaCaptureSource.h:
171         * platform/mediastream/mac/AVMediaCaptureSource.mm:
172         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Add static_asserts to ensure that
173         WebCore::InterruptionReason values map directly to AVCaptureSessionInterruptionReason values.
174         (WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Minor cleanup.
175         (WebCore::AVMediaCaptureSource::startProducingData): Start listening for notifications before
176         starting the session.
177         (WebCore::AVMediaCaptureSource::stopProducingData): Remove the notification observers before
178         stopping the session.
179         (WebCore::AVMediaCaptureSource::setupSession): Minor style cleanup.
180         (WebCore::AVMediaCaptureSource::captureSessionRuntimeError): New. When the error is AVErrorMediaServicesWereReset,
181         sometimes caused by a mediaserverd crash, try to restart the session one time.
182         (WebCore::AVMediaCaptureSource::captureSessionBeginInterruption): Store the interruption reason.
183         (WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Try to restart the session if
184         it was interrupted because the app went into multi-app layout mode.
185         (WebCore::sessionKVOProperties): Drive-by cleanup.
186         (-[WebCoreAVMediaCaptureSourceObserver initWithCallback:]):
187         (-[WebCoreAVMediaCaptureSourceObserver disconnect]):
188         (-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
189         (-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
190         (-[WebCoreAVMediaCaptureSourceObserver sessionRuntimeError:]):
191         (-[WebCoreAVMediaCaptureSourceObserver beginSessionInterrupted:]):
192         (-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):
193
194         * platform/mediastream/mac/AVVideoCaptureSource.mm:
195         (WebCore::AVVideoCaptureSource::initializeCapabilities): Not all AVCaptureSession preset strings
196         are available on all platforms so load with SOFT_LINK_POINTER_OPTIONAL and NULL check before use.
197         (WebCore::sizeForPreset): Ditto.
198         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Ditto.
199
200 2017-02-22  Zalan Bujtas  <zalan@apple.com>
201
202         Simple line layout: ensureLineBoxes for paginated content.
203         https://bugs.webkit.org/show_bug.cgi?id=168729
204         <rdar://problem/30654400>
205
206         Reviewed by Antti Koivisto.
207
208         This patch sets the layout state bits for paginated subtree layout, when we are switching
209         over from simple line runs to inline tree. 
210
211         Not enabled yet.
212
213         * rendering/RenderBlockFlow.cpp:
214         (WebCore::RenderBlockFlow::ensureLineBoxes):
215         * rendering/RenderView.cpp:
216         (WebCore::RenderView::pushLayoutStateForPagination): LayoutUnit(1) is not the real height, it's just
217         an indicator that we've got paginated content.
218         * rendering/RenderView.h:
219         * rendering/SimpleLineLayout.cpp:
220         (WebCore::SimpleLineLayout::create):
221         (WebCore::SimpleLineLayout::Layout::create):
222         (WebCore::SimpleLineLayout::Layout::Layout):
223         * rendering/SimpleLineLayout.h:
224         (WebCore::SimpleLineLayout::Layout::isPaginated):
225         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts):
226         * rendering/SimpleLineLayoutFunctions.h:
227         (WebCore::SimpleLineLayout::computeFlowHeight):
228         * rendering/SimpleLineLayoutResolver.h:
229         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
230
231 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
232
233         [Win] Compile fix.
234         https://bugs.webkit.org/show_bug.cgi?id=168713
235
236         Reviewed by Brent Fulgham.
237
238         The include file <ANGLE/ShaderLang.h> is not found.
239
240         * testing/Internals.cpp:
241
242 2017-02-22  Xabier Rodriguez Calvar  <calvaris@igalia.com>
243
244         [GStreamer][EME] Fix issue with allowed systems extraction
245         https://bugs.webkit.org/show_bug.cgi?id=168717
246
247         Reviewed by Carlos Garcia Campos.
248
249         The allowed systems were not being extracted from the need-context
250         message because the loop was not stopping on the right condition.
251
252         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
253         (WebCore::extractEventsAndSystemsFromMessage): Fix wrong
254         condition.
255         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
256         Add better debug category.
257
258 2017-02-22  Antti Koivisto  <antti@apple.com>
259
260         REGRESSION(r207669): Crash after mutating selector text
261         https://bugs.webkit.org/show_bug.cgi?id=168655
262         <rdar://problem/30632111>
263
264         Reviewed by Andreas Kling.
265
266         Test: fast/css/selector-text-mutation-crash.html
267
268         * style/StyleScope.cpp:
269         (WebCore::Style::Scope::resolver):
270         (WebCore::Style::Scope::updateStyleResolver):
271
272         Protect against entering scheduleUpdate and wiping style resolver while updating it.
273         Extension stylesheets can trigger this.
274
275         (WebCore::Style::Scope::scheduleUpdate):
276
277         Clear the style resolver immediately if style sheet content changes. The resolver may
278         have data structures that point to the old sheet contents.
279
280         The resolver would get wiped anyway when the scheduled update actually occurs.
281
282         * style/StyleScope.h:
283
284 2017-02-08  Sergio Villar Senin  <svillar@igalia.com>
285
286         [css-grid] Move the track sizing algorithm to its own class
287         https://bugs.webkit.org/show_bug.cgi?id=167988
288
289         Reviewed by Manuel Rego Casasnovas.
290
291         This is about moving the track sizing algorithm code out of RenderGrid to a new class
292         GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
293         effect of this patch is the removal of the GridSizingData structure as it is no longer
294         needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
295         as private attribute members. The GridTrack class was also moved to the new file.
296
297         The algorithm execution starts with the call to run(). It's mandatory to call setup() before
298         any call to run() in order to properly configure the behaviour of the algorithm. You can
299         call setup() & run() multiple times for a single layout operation (normally twice, one for
300         columns and another one for rows). The algorithm uses a state machine to verify that the
301         client issues the calls in the proper order (i.e. first columns and then rows). After
302         finishing the layout, the client should call reset() to allow the algorithm to perform
303         cleanups and to prepare itself for another round of calls.
304
305         In order to implement the different behaviours of the algorithm depending on whether the
306         available size is definite or not, a strategy pattern was implemented in the
307         GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
308         another one for indefinite ones.
309
310         We took advantage of this change to perform some renames of the track sizing algorithm
311         methods that were still using the names from the first versions of the specs. Not only that,
312         the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
313         different parts representing the 4 steps of the algorithm.
314
315         No new tests as this is about moving code and refactoring.
316
317         * CMakeLists.txt:
318         * WebCore.xcodeproj/project.pbxproj:
319         * rendering/GridTrackSizingAlgorithm.cpp: Added.
320         (WebCore::GridTrack::baseSize):
321         (WebCore::GridTrack::growthLimit):
322         (WebCore::GridTrack::setBaseSize):
323         (WebCore::GridTrack::setGrowthLimit):
324         (WebCore::GridTrack::growthLimitIfNotInfinite):
325         (WebCore::GridTrack::setTempSize):
326         (WebCore::GridTrack::growTempSize):
327         (WebCore::GridTrack::setGrowthLimitCap):
328         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
329         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
330         (WebCore::hasOverrideContainingBlockContentSizeForChild):
331         (WebCore::setOverrideContainingBlockContentSizeForChild):
332         (WebCore::flowAwareDirectionForChild):
333         (WebCore::overrideContainingBlockContentSizeForChild):
334         (WebCore::computeMarginLogicalSizeForChild):
335         (WebCore::marginIntrinsicLogicalWidthForChild):
336         (WebCore::GridTrackSizingAlgorithm::setFreeSpace):
337         (WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
338         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
339         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
340         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
341         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
342         (WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
343         (WebCore::GridItemWithSpan::GridItemWithSpan):
344         (WebCore::GridItemWithSpan::gridItem):
345         (WebCore::GridItemWithSpan::span):
346         (WebCore::GridItemWithSpan::operator<):
347         (WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
348         (WebCore::shouldProcessTrackForTrackSizeComputationPhase):
349         (WebCore::trackSizeForTrackSizeComputationPhase):
350         (WebCore::updateTrackSizeForTrackSizeComputationPhase):
351         (WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
352         (WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
353         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
354         (WebCore::sortByGridTrackGrowthPotential):
355         (WebCore::clampGrowthShareIfNeeded):
356         (WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
357         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
358         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
359         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
360         (WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
361         (WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
362         (WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
363         (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
364         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
365         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
366         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
367         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
368         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
369         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
370         (WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
371         (WebCore::IndefiniteSizeStrategy::maximizeTracks):
372         (WebCore::normalizedFlexFraction):
373         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
374         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
375         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
376         (WebCore::DefiniteSizeStrategy::maximizeTracks):
377         (WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
378         (WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
379         (WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
380         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
381         (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
382         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
383         (WebCore::GridTrackSizingAlgorithm::advanceNextState):
384         (WebCore::GridTrackSizingAlgorithm::isValidTransition):
385         (WebCore::GridTrackSizingAlgorithm::setup):
386         (WebCore::GridTrackSizingAlgorithm::run):
387         (WebCore::GridTrackSizingAlgorithm::reset):
388         (WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
389         (WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
390         (WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
391         * rendering/GridTrackSizingAlgorithm.h: Added.
392         (WebCore::GridTrack::GridTrack):
393         (WebCore::GridTrack::infiniteGrowthPotential):
394         (WebCore::GridTrack::plannedSize):
395         (WebCore::GridTrack::setPlannedSize):
396         (WebCore::GridTrack::tempSize):
397         (WebCore::GridTrack::infinitelyGrowable):
398         (WebCore::GridTrack::setInfinitelyGrowable):
399         (WebCore::GridTrack::growthLimitCap):
400         (WebCore::GridTrack::growthLimitIsInfinite):
401         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
402         (WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
403         (WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
404         (WebCore::GridTrackSizingAlgorithmStrategy::direction):
405         (WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
406         (WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
407         (WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
408         * rendering/RenderGrid.cpp:
409         (WebCore::RenderGrid::RenderGrid):
410         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
411         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
412         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
413         (WebCore::RenderGrid::layoutBlock):
414         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
415         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
416         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
417         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
418         (WebCore::RenderGrid::layoutGridItems):
419         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
420         (WebCore::RenderGrid::populateGridPositionsForDirection):
421         (WebCore::RenderGrid::columnAxisOffsetForChild):
422         (WebCore::RenderGrid::rowAxisOffsetForChild):
423         (WebCore::RenderGrid::findChildLogicalPosition):
424         (WebCore::GridTrack::GridTrack): Deleted.
425         (WebCore::GridTrack::baseSize): Deleted.
426         (WebCore::GridTrack::growthLimit): Deleted.
427         (WebCore::GridTrack::setBaseSize): Deleted.
428         (WebCore::GridTrack::setGrowthLimit): Deleted.
429         (WebCore::GridTrack::infiniteGrowthPotential): Deleted.
430         (WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
431         (WebCore::GridTrack::plannedSize): Deleted.
432         (WebCore::GridTrack::setPlannedSize): Deleted.
433         (WebCore::GridTrack::tempSize): Deleted.
434         (WebCore::GridTrack::setTempSize): Deleted.
435         (WebCore::GridTrack::growTempSize): Deleted.
436         (WebCore::GridTrack::infinitelyGrowable): Deleted.
437         (WebCore::GridTrack::setInfinitelyGrowable): Deleted.
438         (WebCore::GridTrack::setGrowthLimitCap): Deleted.
439         (WebCore::GridTrack::growthLimitCap): Deleted.
440         (WebCore::GridTrack::growthLimitIsInfinite): Deleted.
441         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
442         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
443         (WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
444         (WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
445         (WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
446         (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
447         (WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
448         (WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
449         (WebCore::RenderGrid::GridSizingData::grid): Deleted.
450         (WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
451         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
452         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
453         (WebCore::normalizedFlexFraction): Deleted.
454         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
455         (WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
456         (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
457         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
458         (WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
459         (WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
460         (WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
461         (WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
462         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
463         (WebCore::RenderGrid::rawGridTrackSize): Deleted.
464         (WebCore::RenderGrid::gridTrackSize): Deleted.
465         (WebCore::RenderGrid::logicalHeightForChild): Deleted.
466         (WebCore::RenderGrid::minSizeForChild): Deleted.
467         (WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
468         (WebCore::RenderGrid::minContentForChild): Deleted.
469         (WebCore::RenderGrid::maxContentForChild): Deleted.
470         (WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
471         (WebCore::GridItemWithSpan::gridItem): Deleted.
472         (WebCore::GridItemWithSpan::span): Deleted.
473         (WebCore::GridItemWithSpan::operator<): Deleted.
474         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
475         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
476         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
477         (WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
478         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
479         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
480         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
481         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
482         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
483         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
484         (WebCore::sortByGridTrackGrowthPotential): Deleted.
485         (WebCore::clampGrowthShareIfNeeded): Deleted.
486         (WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
487         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
488         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
489         (WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
490         * rendering/RenderGrid.h:
491
492 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
493
494         [Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
495         https://bugs.webkit.org/show_bug.cgi?id=168711
496
497         Reviewed by Alex Christensen.
498
499         Add null pointer check.
500
501         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
502         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
503
504 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
505
506         [GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
507         https://bugs.webkit.org/show_bug.cgi?id=168662
508
509         Reviewed by Michael Catanzaro.
510
511         When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
512         there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
513         stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
514         nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
515         doesn't implement buffered and always returns an empty PlatformTimeRanges.
516
517         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
518         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.
519
520 2017-02-21  Youenn Fablet  <youenn@apple.com>
521
522         [WebRTC][Mac] Activate libwebrtc
523         https://bugs.webkit.org/show_bug.cgi?id=167293
524
525         Reviewed by Alex Christensen.
526
527         * Configurations/WebCore.xcconfig:
528         * Configurations/WebCoreTestSupport.xcconfig:
529         * Configurations/FeatureDefines.xcconfig:
530
531 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
532
533         Unreviewed. Fix WinCairo build after r212703.
534
535         * platform/TextureMapper.cmake:
536
537 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
538
539         Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
540         https://bugs.webkit.org/show_bug.cgi?id=168601
541         rdar://problem/30583872
542
543         Reviewed by Simon Fraser.
544
545         Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin,
546         see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class,
547         where text is painted in three phases (fill, stroke, markers), where the order follows the
548         paint-order property. The linecap and linejoin properties are set on the graphics context before
549         rendering the text.
550
551         Tests: fast/css/paint-order.html
552                fast/css/paint-order-shadow.html
553
554         * css/CSSComputedStyleDeclaration.cpp:
555         (WebCore::paintOrder):
556         * css/StyleBuilderConverter.h:
557         (WebCore::StyleBuilderConverter::convertPaintOrder):
558         * rendering/TextPaintStyle.cpp:
559         (WebCore::computeTextPaintStyle):
560         (WebCore::updateGraphicsContext):
561         * rendering/TextPaintStyle.h:
562         * rendering/TextPainter.cpp:
563         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
564         * rendering/style/RenderStyle.cpp:
565         (WebCore::RenderStyle::paintTypesForPaintOrder):
566         * rendering/style/RenderStyle.h:
567         (WebCore::RenderStyle::setPaintOrder):
568         (WebCore::RenderStyle::initialPaintOrder):
569         * rendering/style/RenderStyleConstants.h:
570         * rendering/style/SVGRenderStyleDefs.h:
571         * rendering/style/StyleRareInheritedData.cpp:
572         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
573         * rendering/svg/RenderSVGShape.cpp:
574         (WebCore::RenderSVGShape::fillStrokeMarkers):
575         * rendering/svg/SVGInlineTextBox.cpp:
576         (WebCore::SVGInlineTextBox::paint):
577
578 2017-02-21  Joseph Pecoraro  <pecoraro@apple.com>
579
580         [User Timing] Throw a SyntaxError for performance.measure if mark name is not found
581         https://bugs.webkit.org/show_bug.cgi?id=168707
582
583         Reviewed by Ryosuke Niwa.
584
585         Test: performance-api/performance-measure-name.html
586
587         * page/PerformanceUserTiming.cpp:
588         (WebCore::UserTiming::findExistingMarkStartTime):
589         Instead of returning zero, throw a SyntaxError. This is more in line
590         with User Timing Level 1 and behavior in Window. This is an issue with
591         the Level 2 spec: https://github.com/w3c/user-timing/issues/21
592
593 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
594
595         Unreviewed attempt to fix the Windows build.
596
597         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
598         (PlatformCALayerWin::supportsSubpixelAntialiasedText):
599
600 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
601
602         Unreviewed, rolling out r212737.
603
604         This change caused an existing LayoutTest to crash.
605
606         Reverted changeset:
607
608         "REGRESSION(r207669): Crash after mutating selector text"
609         https://bugs.webkit.org/show_bug.cgi?id=168655
610         http://trac.webkit.org/changeset/212737
611
612 2017-02-21  Chris Dumez  <cdumez@apple.com>
613
614         REGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
615         https://bugs.webkit.org/show_bug.cgi?id=168632
616         <rdar://problem/30620129>
617
618         Reviewed by Darin Adler.
619
620         After r207720, the following WebGL conformance tests started failing:
621         - /more/conformance/conformance/quickCheckAPI-S_V.html
622         - /context/context-lost.html
623
624         We started throwing security errors in case where we did not before.
625         Chrome and Firefox are both passing these tests so our new behavior was not interoperable.
626
627         This patch reverts part of r207720 to restore our previous behavior.
628
629         * html/canvas/WebGLRenderingContextBase.cpp:
630         (WebCore::WebGLRenderingContextBase::texSubImage2D):
631         (WebCore::WebGLRenderingContextBase::texImage2D):
632         (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
633         (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
634         (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
635         * html/canvas/WebGLRenderingContextBase.h:
636
637 2017-02-21  Dean Jackson  <dino@apple.com>
638
639         No need for static attributes when creating a pixel format
640         https://bugs.webkit.org/show_bug.cgi?id=168688
641         <rdar://problem/30642256>
642
643         Reviewed by Myles Maxfield.
644
645         Just create the attributes when needed.
646
647         * platform/graphics/mac/GraphicsContext3DMac.mm:
648         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
649
650 2017-02-20  Filip Pizlo  <fpizlo@apple.com>
651
652         The collector thread should only start when the mutator doesn't have heap access
653         https://bugs.webkit.org/show_bug.cgi?id=167737
654
655         Reviewed by Keith Miller.
656
657         Added new tests in JSTests.
658         
659         The WebCore changes involve:
660         
661         - Refactoring around new header discipline.
662         
663         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
664
665         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
666         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
667         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
668         * ForwardingHeaders/heap/RunningScope.h: Added.
669         * bindings/js/CommonVM.cpp:
670         * testing/Internals.cpp:
671         (WebCore::Internals::parserMetaData):
672         (WebCore::Internals::isReadableStreamDisturbed):
673         (WebCore::Internals::isGCRunning):
674         (WebCore::Internals::addGCFinalizationCallback):
675         (WebCore::Internals::stopSweeping):
676         (WebCore::Internals::startSweeping):
677         * testing/Internals.h:
678         * testing/Internals.idl:
679
680 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
681
682         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
683         https://bugs.webkit.org/show_bug.cgi?id=168620
684         <rdar://problem/30617772>
685
686         Reviewed by Tim Horton.
687
688         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
689         PlatformCALayer, where it ultimately affects the layer contents format.
690         
691         TileControllers are slightly special because we communicate with them via an Obj-C
692         WebTiledBackingLayer.
693
694         Test: compositing/contents-format/subpixel-antialiased-text-enabled.html
695
696         * page/Settings.in:
697         * platform/graphics/GraphicsLayer.cpp:
698         (WebCore::GraphicsLayer::GraphicsLayer):
699         (WebCore::GraphicsLayer::dumpProperties):
700         * platform/graphics/GraphicsLayer.h:
701         (WebCore::GraphicsLayer::supportsSubpixelAntialiasedText):
702         (WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText):
703         * platform/graphics/ca/GraphicsLayerCA.cpp:
704         (WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText):
705         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
706         (WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText):
707         * platform/graphics/ca/GraphicsLayerCA.h:
708         * platform/graphics/ca/PlatformCALayer.cpp:
709         (WebCore::PlatformCALayer::drawRepaintIndicator):
710         * platform/graphics/ca/PlatformCALayer.h:
711         * platform/graphics/ca/TileController.cpp:
712         (WebCore::TileController::setWantsDeepColorBackingStore):
713         (WebCore::TileController::setSupportsSubpixelAntialiasedText):
714         (WebCore::TileController::setTilesOpaque):
715         * platform/graphics/ca/TileController.h:
716         * platform/graphics/ca/TileGrid.cpp:
717         (WebCore::TileGrid::updateTileLayerProperties):
718         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
719         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
720         (PlatformCALayerCocoa::supportsSubpixelAntialiasedText):
721         (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText):
722         (layerContentsFormat):
723         (PlatformCALayerCocoa::updateContentsFormat):
724         (PlatformCALayer::drawLayerContents):
725         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
726         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
727         (-[WebTiledBackingLayer drawsAsynchronously]):
728         (-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]):
729         (-[WebTiledBackingLayer supportsSubpixelAntialiasedText]):
730         * platform/spi/cocoa/QuartzCoreSPI.h:
731         * rendering/RenderLayerBacking.cpp:
732         (WebCore::RenderLayerBacking::createGraphicsLayer):
733
734 2017-02-21  Chris Dumez  <cdumez@apple.com>
735
736         REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
737         https://bugs.webkit.org/show_bug.cgi?id=168677
738         <rdar://problem/30640101>
739
740         Reviewed by Ryosuke Niwa.
741
742         Add quirk to initMouseEvent to unbreak iAd Producer.
743
744         * dom/MouseEvent.cpp:
745         (WebCore::MouseEvent::initMouseEventQuirk):
746         * dom/MouseEvent.h:
747         * dom/MouseEvent.idl:
748         * platform/RuntimeApplicationChecks.h:
749         * platform/RuntimeApplicationChecks.mm:
750         (WebCore::MacApplication::isIADProducer):
751
752 2017-02-21  Jer Noble  <jer.noble@apple.com>
753
754         AudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
755         https://bugs.webkit.org/show_bug.cgi?id=168640
756
757         Reviewed by Eric Carlson.
758
759         Rather than copying the pulled data into a scratch buffer, applying a volume transformation
760         and then copying back out, just do the volume transformation in-place in the destination
761         buffer.
762
763         * platform/audio/mac/AudioSampleDataSource.cpp:
764         (WebCore::AudioSampleDataSource::pullSamplesInternal):
765
766 2017-02-21  Youenn Fablet  <youenn@apple.com>
767
768         [WebRTC] Implement Incoming libwebrtc audio source support.
769         https://bugs.webkit.org/show_bug.cgi?id=167961
770
771         Reviewed by Eric Carlson.
772
773         Hook libwebrtc incoming audio source into WebCore audio rendering path.
774         Manually testing that muted sources produce data with zeros and unmuted sources provide data with non zeros.
775
776         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
777         (WebCore::RealtimeIncomingAudioSource::create):
778         (WebCore::streamDescription):
779         (WebCore::RealtimeIncomingAudioSource::OnData):
780         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
781         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
782
783 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
784
785         Fix ImageBitmap comment to not insert a <canvas>.
786
787         * features.json:
788
789 2017-02-21  Alex Christensen  <achristensen@webkit.org>
790
791         Fix CMake build.
792
793         * PlatformMac.cmake:
794
795 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
796
797         Add Media Streams and Capture to features.json.
798
799         * features.json:
800
801 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
802
803         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
804
805         * features.json:
806
807 2017-02-21  Romain Bellessort  <romain.bellessort@crf.canon.fr>
808
809         [Readable Streams API] Add ReadableStreamBYOBRequest view getter
810         https://bugs.webkit.org/show_bug.cgi?id=168652
811
812         Reviewed by Youenn Fablet.
813
814         Implemented getter for ReadableStreamBYOBRequest view attribute.
815         
816         Added 1 test checking that view length corresponds to autoAllocateChunkSize.
817         Also updated test expectations for W3C imported tests.
818
819         * Modules/streams/ReadableByteStreamInternals.js:
820         (isReadableStreamBYOBRequest): Added.
821         * Modules/streams/ReadableStreamBYOBRequest.js:
822         (view): Added.
823
824 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
825
826         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
827
828         * features.json:
829
830 2017-02-21  Youenn Fablet  <youenn@apple.com>
831
832         [WebRTC] ICE candidates should be filtered according a policy
833         https://bugs.webkit.org/show_bug.cgi?id=168348
834
835         Reviewed by Alex Christensen.
836
837         Covered by manual tests. Should be covered in the future by layout tests with dedicated internals API.
838
839         Adding support for ICE candidate filtering at RTCPeerConnection level.
840         If ICE candidate filtering is on (by default), host candidates are stored and not sent immediately.
841         Reflexive candidates are purged from raddr information to not leak the host IP address.
842
843         Stored candidates may be advertised to the JS layer if RTCController is notified of a change of filtering policy.
844         To implement that, PeerConnectionBackend stores all filtered out candidates and RTCPeerConnection register
845         themselves to RTCController to get notifications of filtering policy changes.
846
847         Making RTCPeerConnection use setPendingActivity throughout its lifetime.
848         This ensures it does not get collected until the page is off or close() is called on the object.
849
850         Adding support for enumerating or not all interfaces at libwebrtc level.
851         This choice is done at creation of the peer connection.
852
853         * Modules/mediastream/PeerConnectionBackend.cpp:
854         (WebCore::PeerConnectionBackend::enableICECandidateFiltering):
855         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
856         (WebCore::filterICECandidate):
857         (WebCore::PeerConnectionBackend::newICECandidate):
858         * Modules/mediastream/PeerConnectionBackend.h:
859         * Modules/mediastream/RTCController.cpp: Added.
860         (WebCore::RTCController::remove):
861         (WebCore::RTCController::add):
862         (WebCore::RTCController::disableICECandidateFiltering):
863         (WebCore::RTCController::enableICECandidateFiltering):
864         * Modules/mediastream/RTCController.h: Added.
865         * Modules/mediastream/RTCPeerConnection.cpp:
866         (WebCore::RTCPeerConnection::create):
867         (WebCore::RTCPeerConnection::close):
868         (WebCore::RTCPeerConnection::rtcController):
869         (WebCore::RTCPeerConnection::registerToController):
870         (WebCore::RTCPeerConnection::unregisterFromController):
871         * Modules/mediastream/RTCPeerConnection.h:
872         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
873         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
874         * WebCore.xcodeproj/project.pbxproj:
875         * page/Page.h:
876         (WebCore::Page::rtcController):
877         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
878         (WebCore::LibWebRTCProvider::createPeerConnection):
879         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
880
881 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
882
883         Unreviewed, update WebCrypto API feature status.
884
885         * features.json:
886
887 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
888
889         Fix the bad JSON.
890
891         * features.json:
892
893 2017-02-21  Andreas Kling  <akling@apple.com>
894
895         [iOS] WebKit1 should use shared memory pressure handler code.
896         <https://webkit.org/b/168653>
897
898         Reviewed by Antti Koivisto.
899
900         Remove iOS WebKit1 specific members and code from MemoryPressureHandler in favor
901         of using the same code that iOS WebKit2 and macOS WebKit uses.
902
903         * page/cocoa/MemoryReleaseCocoa.mm:
904         (WebCore::platformReleaseMemory): Add two cleanup calls that were only in the iOS WebView code.
905         * platform/MemoryPressureHandler.h:
906         (WebCore::MemoryPressureHandler::m_releaseMemoryBlock): Deleted.
907         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
908         (WebCore::respondToMemoryPressureCallback): Deleted.
909         (WebCore::MemoryPressureHandler::installMemoryReleaseBlock): Deleted.
910         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure): Deleted.
911         (WebCore::MemoryPressureHandler::clearMemoryPressure): Deleted.
912         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage): Deleted.
913         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded): Deleted.
914
915 2017-02-21  Anders Carlsson  <andersca@apple.com>
916
917         Fix two failing WebKit legacy tests
918         https://bugs.webkit.org/show_bug.cgi?id=168667
919
920         Reviewed by Tim Horton.
921
922         Handle the NSPasteboardTypeString type.
923
924         * platform/mac/PasteboardMac.mm:
925         (WebCore::Pasteboard::read):
926         (WebCore::addHTMLClipboardTypesForCocoaType):
927
928 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
929
930         Add Web Audio and Web MIDI to features.json.
931
932         * features.json:
933
934 2017-02-21  Antti Koivisto  <antti@apple.com>
935
936         REGRESSION(r207669): Crash after mutating selector text
937         https://bugs.webkit.org/show_bug.cgi?id=168655
938         <rdar://problem/30632111>
939
940         Reviewed by Brent Fulgham.
941
942         Test: fast/css/selector-text-mutation-crash.html
943
944         * style/StyleScope.cpp:
945         (WebCore::Style::Scope::scheduleUpdate):
946
947         Clear the style resolver immediately if style sheet content changes. The resolver may
948         have data structures that point to the old sheet contents.
949
950         The resolver would get wiped anyway when the scheduled update actually occurs.
951
952 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
953
954         [WebCrypto] Add support for AES-CFB
955         https://bugs.webkit.org/show_bug.cgi?id=168344
956         <rdar://problem/20940221>
957
958         Reviewed by Brent Fulgham.
959
960         This patch adds support for AES-CFB. Operations of AES-CFB include: encrypt, decrypt, generateKey,
961         importKey, exportKey, wrapKey, and unwrapKey. This implementation follows a slightly old version
962         of WebCryptoAPI spec: https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#aes-cfb.
963
964         Tests: crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html
965                crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html
966                crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html
967                crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html
968                crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html
969                crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html
970                crypto/subtle/aes-cfb-generate-export-raw-key.html
971                crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html
972                crypto/subtle/aes-cfb-generate-key.html
973                crypto/subtle/aes-cfb-import-jwk-key-length-128.html
974                crypto/subtle/aes-cfb-import-jwk-key-length-192.html
975                crypto/subtle/aes-cfb-import-jwk-key-length-256.html
976                crypto/subtle/aes-cfb-import-key-decrypt.html
977                crypto/subtle/aes-cfb-import-key-encrypt.html
978                crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html
979                crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html
980                crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html
981                crypto/subtle/aes-cfb-import-key-wrap-raw-key.html
982                crypto/subtle/aes-cfb-import-raw-key.html
983                crypto/workers/subtle/aes-cfb-import-key-decrypt.html
984                crypto/workers/subtle/aes-cfb-import-key-encrypt.html
985                crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html
986                crypto/workers/subtle/aes-cfb-import-key-wrap-key.html
987
988         * CMakeLists.txt:
989         * DerivedSources.make:
990         * PlatformGTK.cmake:
991         * PlatformMac.cmake:
992         * WebCore.xcodeproj/project.pbxproj:
993         Add CryptoAlgorithmAES_CFB.cpp,
994         change AesCbcParams.idl to AesCbcCfbParams.idl.
995         * bindings/js/JSSubtleCryptoCustom.cpp:
996         (WebCore::normalizeCryptoAlgorithmParameters):
997         Add support for AES-CFB.
998         * crypto/CryptoAlgorithm.h:
999         Include <wtf/Variant.h>.
1000         * crypto/CryptoAlgorithmParameters.h:
1001         Add support for AES-CFB.
1002         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1003         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
1004         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
1005         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
1006         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: Added.
1007         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CFB):
1008         (WebCore::CryptoAlgorithmAES_CFB::create):
1009         (WebCore::CryptoAlgorithmAES_CFB::identifier):
1010         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
1011         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
1012         (WebCore::CryptoAlgorithmAES_CFB::generateKey):
1013         (WebCore::CryptoAlgorithmAES_CFB::importKey):
1014         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
1015         * crypto/algorithms/CryptoAlgorithmAES_CFB.h: Added.
1016         * crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp: Added.
1017         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
1018         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
1019         Add dummy support of AES_CFB for GTK+.
1020         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
1021         (WebCore::transformAES_CBC):
1022         Drop conditional PLATFORM(COCOA).
1023         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
1024         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
1025         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
1026         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: Added.
1027         (WebCore::transformAES_CFB):
1028         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
1029         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
1030         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1031         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1032         Add support for AES-CFB.
1033         * crypto/parameters/AesCbcCfbParams.idl: Renamed from Source/WebCore/crypto/parameters/AesCbcParams.idl.
1034         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
1035         Since dictionaries AesCbcParams and AesCfbParams are essentially the same, I combine them together in our implementations.
1036
1037 2017-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1038
1039         Unreviewed, fix the ToT iOS build
1040
1041         Adopt updated UIKit SPI and remove calls to the deprecated version.
1042
1043         * platform/ios/WebItemProviderPasteboard.mm:
1044         (-[WebItemProviderPasteboard setItems:]):
1045
1046 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
1047
1048         [Win] WebView is not painting in accelerated compositing mode.
1049         https://bugs.webkit.org/show_bug.cgi?id=168654
1050
1051         Reviewed by Brent Fulgham.
1052
1053         Initializing the uncommitted layer change flags to CoverageRectChanged in GraphicsLayerCA,
1054         stops WebView painting in accelerated mode.
1055
1056         Covered by existing tests.
1057
1058         * platform/graphics/ca/GraphicsLayerCA.h:
1059
1060 2017-02-21  Jer Noble  <jer.noble@apple.com>
1061
1062         Make logging in high-priority audio threads less expensive
1063         https://bugs.webkit.org/show_bug.cgi?id=168639
1064
1065         Reviewed by Jon Lee.
1066
1067         Logging from inside a high-priority audio thread will make a number of calls to malloc, block, and
1068         therefore cause audio glitches. Make this logging less expensive by dispatching to the main thread
1069         before creating and outputting the log string.
1070
1071         * WebCore.xcodeproj/project.pbxproj:
1072         * platform/audio/mac/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp.
1073         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1074         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1075
1076 2017-02-21  Jer Noble  <jer.noble@apple.com>
1077
1078         Give the Mock audio input a "hum" to make drop-outs more detectable
1079         https://bugs.webkit.org/show_bug.cgi?id=168641
1080
1081         Reviewed by Eric Carlson.
1082
1083         Add two helper functions to generate waveforms: addHum() and writeHum(). Use these methods
1084         to create a bip-bop audio buffer which can be used to "blit" a portion the waveform into the
1085         destination buffer during rendering. The background hum must be seamless across multiple
1086         pull operations, so add the hum sound during rendering.
1087
1088         To ensure the waveform buffer is created, initialize the sampleRate to zero, then call
1089         applySampleRate() with the desired default rate, 44.1kHz.
1090
1091         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1092         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1093         (WebCore::writeHum):
1094         (WebCore::addHum):
1095         (WebCore::MockRealtimeAudioSource::create):
1096         (WebCore::MockRealtimeAudioSourceMac::render):
1097         (WebCore::MockRealtimeAudioSourceMac::applySampleRate):
1098
1099 2017-02-21  Jer Noble  <jer.noble@apple.com>
1100
1101         Make TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main threads
1102         https://bugs.webkit.org/show_bug.cgi?id=168642
1103
1104         Reviewed by Eric Carlson.
1105
1106         AudioTrackPrivateMediaStreamCocoa has two entry points from background threads:
1107         audioSamplesAvailable() and render(). Protect against being destroyed mid-execution by
1108         retaining this for the duration of those methods.
1109
1110         * platform/graphics/TrackPrivateBase.h:
1111         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1112         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1113         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
1114
1115 2017-02-21  Jer Noble  <jer.noble@apple.com>
1116
1117         Pulling too quickly from an AudioSampleDataSource should increase the pre-buffer amount
1118         https://bugs.webkit.org/show_bug.cgi?id=168645
1119
1120         Reviewed by Eric Carlson.
1121
1122         If a pull operation runs past the end of the buffered range of a CARingBuffer, the underrun
1123         is zero-filled, causing an audible glitch.  In this case, bias m_outputSampleOffset by the
1124         amount of the underrun, which should keep the underrun from reoccurring.
1125
1126         * platform/audio/mac/AudioSampleDataSource.cpp:
1127         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1128
1129 2017-02-21  Jer Noble  <jer.noble@apple.com>
1130
1131         AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
1132         https://bugs.webkit.org/show_bug.cgi?id=168635
1133
1134         Reviewed by Jon Lee.
1135
1136         * platform/audio/mac/AudioSampleDataSource.cpp:
1137         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1138         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1139
1140 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1141
1142         REGRESSION(r212681): Crash when dragging links without a drag image
1143         https://bugs.webkit.org/show_bug.cgi?id=168648
1144
1145         Reviewed by Tim Horton.
1146
1147         This happens in GTK+ port, because we don't use a drag image for links.
1148
1149         Fixes: editing/pasteboard/drop-link.html
1150                editing/pasteboard/drop-text-without-selection.html
1151                editing/pasteboard/files-during-page-drags.html
1152                fast/events/content-changed-during-drop.html
1153                fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
1154                fast/events/drag-and-drop-link-into-focused-contenteditable.html
1155                fast/events/drag-and-drop-link.html
1156                fast/events/drag-in-frames.html
1157                fast/events/drag-parent-node.html
1158                fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
1159
1160         * page/DragController.cpp:
1161         (WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
1162         returns nullptr.
1163
1164 2017-02-21  Alex Christensen  <achristensen@webkit.org>
1165
1166         Unreviewed, rolling out r212699.
1167
1168         Internal build not ready
1169
1170         Reverted changeset:
1171
1172         "[WebRTC][Mac] Activate libwebrtc"
1173         https://bugs.webkit.org/show_bug.cgi?id=167293
1174         http://trac.webkit.org/changeset/212699
1175
1176 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1177
1178         Remove ENABLE_THREADED_COMPOSITOR build option
1179         https://bugs.webkit.org/show_bug.cgi?id=168606
1180
1181         Reviewed by Michael Catanzaro.
1182
1183         * platform/TextureMapper.cmake:
1184
1185 2017-02-20  Alex Christensen  <achristensen@webkit.org>
1186
1187         Fix some 32-bit builds after r212699
1188
1189         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
1190         (WebCore::RealtimeIncomingVideoSource::OnFrame):
1191         Explicitly cast OSStatus to int for logging.
1192
1193 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
1194
1195         Remove unnecessary PerformanceEntry virtual methods
1196         https://bugs.webkit.org/show_bug.cgi?id=168633
1197
1198         Reviewed by Ryosuke Niwa.
1199
1200         * page/PerformanceEntry.h:
1201         (WebCore::PerformanceEntry::isResource):
1202         (WebCore::PerformanceEntry::isMark):
1203         (WebCore::PerformanceEntry::isMeasure):
1204         Implement based on the Type.
1205
1206         * page/PerformanceMark.h:
1207         * page/PerformanceMeasure.h:
1208         * page/PerformanceResourceTiming.h:
1209         Remove virtual overrides.
1210
1211 2017-02-20  Youenn Fablet  <youenn@apple.com>
1212
1213         [WebRTC][Mac] Activate libwebrtc
1214         https://bugs.webkit.org/show_bug.cgi?id=167293
1215
1216         Reviewed by Alex Christensen.
1217
1218         * Configurations/WebCore.xcconfig:
1219         * Configurations/WebCoreTestSupport.xcconfig:
1220
1221 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
1222
1223         ASSERTION FAILED: m_normalWorld->hasOneRef() under WorkerThread::stop
1224         https://bugs.webkit.org/show_bug.cgi?id=168356
1225         <rdar://problem/30592486>
1226
1227         Reviewed by Ryosuke Niwa.
1228
1229         * page/DOMWindow.cpp:
1230         (WebCore::DOMWindow::removeAllEventListeners):
1231         Remove Performance object EventListeners.
1232
1233         * workers/WorkerGlobalScope.cpp:
1234         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
1235         (WebCore::WorkerGlobalScope::removeAllEventListeners):
1236         (WebCore::WorkerGlobalScope::performance):
1237         * workers/WorkerGlobalScope.h:
1238         Remove Performance object EventListeners.
1239         Also clear Performance early in destruction since its ContextDestructionObserver
1240         destruction makes checks about the WorkerThread.
1241
1242 2017-02-20  Jer Noble  <jer.noble@apple.com>
1243
1244         Local audio-only stream will not trigger playback to begin
1245         https://bugs.webkit.org/show_bug.cgi?id=168412
1246
1247         Reviewed by Youenn Fablet.
1248
1249         Test: fast/mediastream/local-audio-playing-event.html
1250
1251         With video-bearing streams, the first video sample emitted from the stream causes the
1252         readyState to move from HAVE_NOTHING to HAVE_ENOUGH_DATA. Wire up this same behavior for
1253         audio-bearing streams. Add a MediaStreamTrackPrivate::Observer callback method
1254         audioSamplesAvailable(), which gets passed up to MediaPlayerPrivateMediaStreamAVFObjC.
1255         Because this callback may be (and probably will be) called on a background thread, run the
1256         updateReadyState() task in a scheduledDeferredTask().
1257
1258         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1259         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1260         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::audioSamplesAvailable):
1261         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
1262         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1263         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
1264         * platform/mediastream/MediaStreamTrackPrivate.h:
1265         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
1266
1267 2017-02-20  Zalan Bujtas  <zalan@apple.com>
1268
1269         Simple line layout: Implement absoluteQuadsForRange.
1270         https://bugs.webkit.org/show_bug.cgi?id=168613
1271         <rdar://problem/30614618>
1272
1273         Reviewed by Simon Fraser.
1274
1275         This patch ensures that the commonly used Range::getClientRects calls do not
1276         throw us off of the simple line layout path.
1277
1278         Test: fast/dom/Range/simple-line-layout-getclientrects.html
1279
1280         * rendering/RenderText.cpp:
1281         (WebCore::RenderText::absoluteQuadsForRange):
1282         * rendering/SimpleLineLayoutFunctions.cpp:
1283         (WebCore::SimpleLineLayout::collectAbsoluteQuadsForRange): Special case empty ranges with multiple empty runs.
1284         * rendering/SimpleLineLayoutFunctions.h:
1285         * rendering/SimpleLineLayoutResolver.cpp:
1286         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
1287         * rendering/SimpleLineLayoutResolver.h:
1288
1289 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
1290
1291         Unreviewed, rolling out r212685.
1292
1293         This change broke the 32-bit Sierra build.
1294
1295         Reverted changeset:
1296
1297         "Resource Load Statistics: Add alternate classification
1298         method"
1299         https://bugs.webkit.org/show_bug.cgi?id=168347
1300         http://trac.webkit.org/changeset/212685
1301
1302 2017-02-20  Sam Weinig  <sam@webkit.org>
1303
1304         [WebIDL] Add support for constructors that have variadic parameters
1305         https://bugs.webkit.org/show_bug.cgi?id=168614
1306
1307         Reviewed by Alex Christensen.
1308
1309         In preparation of removing some more custom bindings, move the constructor calling
1310         code over to using GenerateParametersCheck completely. This required
1311         - Removing special case of NamedConstructors automatically getting a Document passed
1312           to them. The three named constructors that expected this have been updated to add
1313           the required attributes.
1314         - Add a version of the GenerateCallWith prologue for constructors.
1315         - Remove now unnecessary argumentCount return value from GenerateParametersCheck.
1316
1317         * bindings/scripts/CodeGeneratorJS.pm:
1318         (GenerateImplementation):
1319         (GenerateCallWithUsingReferences):
1320         (GenerateCallWithUsingPointers):
1321         (GenerateConstructorCallWithUsingPointers):
1322         (GenerateCallWith):
1323         (GenerateParametersCheck):
1324         (GenerateConstructorDefinition):
1325
1326         * bindings/scripts/test/JS/JSTestInterface.cpp:
1327         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1328         * bindings/scripts/test/JS/JSTestObj.cpp:
1329         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1330         Update results for more consistent placement of ScriptExecutionContext and Document
1331         accessors, add UNLIKELY to context checks, and remove automatic Document passing
1332         for NamedConstructors.
1333
1334         * html/HTMLAudioElement.idl:
1335         * html/HTMLImageElement.idl:
1336         * html/HTMLOptionElement.idl:
1337         Add ConstructorCallWith=Document.
1338
1339 2017-02-20  John Wilander  <wilander@apple.com>
1340
1341         Resource Load Statistics: Add alternate classification method
1342         https://bugs.webkit.org/show_bug.cgi?id=168347
1343         <rdar://problem/30352793>
1344
1345         Reviewed by Alex Christensen.
1346
1347         This patch only adds test infrastructure in WebCore.
1348
1349         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
1350                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
1351                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
1352                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
1353                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
1354                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
1355                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
1356                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
1357
1358         * loader/ResourceLoadObserver.cpp:
1359         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
1360         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
1361         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
1362         * loader/ResourceLoadObserver.h:
1363
1364 2017-02-20  Anders Carlsson  <andersca@apple.com>
1365
1366         Use the new drag code path when dragging links
1367         https://bugs.webkit.org/show_bug.cgi?id=168612
1368
1369         Reviewed by Tim Horton.
1370
1371         * editing/Editor.cpp:
1372         (WebCore::Editor::copyURL):
1373         Use userVisibleString instead of fillInUserVisibleForm.
1374
1375         (WebCore::Editor::pasteboardWriterURL):
1376         New function that returns a PasteboardWriterData::URL for a given URL + title.
1377
1378         * editing/Editor.h:
1379         Add new members.
1380
1381         * editing/mac/EditorMac.mm:
1382         (WebCore::Editor::userVisibleString):
1383         (WebCore::Editor::fillInUserVisibleForm): Deleted.
1384         Add a getter instead of a function that fills in a struct member.
1385
1386         * page/DragController.cpp:
1387         (WebCore::DragController::startDrag):
1388         Add the new DragItem code path when dragging links.
1389
1390         * platform/PasteboardWriterData.cpp:
1391         (WebCore::PasteboardWriterData::isEmpty):
1392         Check for m_url as well.
1393
1394         (WebCore::PasteboardWriterData::setURL):
1395         Set m_url.
1396
1397         * platform/PasteboardWriterData.h:
1398         Add new members.
1399
1400         * platform/mac/PasteboardWriter.mm:
1401         (WebCore::toUTI):
1402         New helper function that returns an UTI from a pasteboard type.
1403
1404         (WebCore::createPasteboardWriter):
1405         Handle converting URLs to the various pasteboard types.
1406
1407 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1408
1409         Add plumbing to the UI process for TextIndicatorData when computing the drag image
1410         https://bugs.webkit.org/show_bug.cgi?id=168583
1411         Work towards <rdar://problem/30313681>
1412
1413         Reviewed by Tim Horton.
1414
1415         Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData
1416         for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is
1417         propagated to the UI process via SetDragImage in the WebDragClient.
1418
1419         Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
1420
1421         No new tests, since there is no behavior change.
1422
1423         * page/DragController.cpp:
1424         (WebCore::DragController::startDrag):
1425         * page/Page.cpp:
1426         (WebCore::Page::hasSelectionAtPosition):
1427         (WebCore::Page::hasDataInteractionAtPosition): Deleted.
1428         * page/Page.h:
1429         * platform/DragImage.cpp:
1430         (WebCore::createDragImageForSelection):
1431         (WebCore::createDragImageForLink):
1432         (WebCore::DragImage::operator=):
1433         * platform/DragImage.h:
1434         * platform/gtk/DragImageGtk.cpp:
1435         (WebCore::createDragImageForLink):
1436         * platform/mac/DragImageMac.mm:
1437         (WebCore::createDragImageForLink):
1438         * platform/win/DragImageWin.cpp:
1439         (WebCore::createDragImageForLink):
1440
1441 2017-02-20  Brent Fulgham  <bfulgham@apple.com>
1442
1443         Nullptr dereferences when stopping a load
1444         https://bugs.webkit.org/show_bug.cgi?id=168608
1445         <rdar://problem/29852056>
1446
1447         Reviewed by Ryosuke Niwa.
1448
1449         Don't attempt to notify a detached frame's load client that the load is
1450         stopped.
1451
1452         * loader/DocumentLoader.cpp:
1453         (WebCore::DocumentLoader::stopLoading): Check for null frame loader and
1454         bypass dereferencing it. 
1455
1456 2017-02-17  Anders Carlsson  <andersca@apple.com>
1457
1458         Add a new drag code path and use it for dragging plain text
1459         https://bugs.webkit.org/show_bug.cgi?id=168534
1460
1461         Reviewed by Geoffrey Garen.
1462
1463         The new code path is currently only used for plain text selection dragging.
1464
1465         * WebCore.xcodeproj/project.pbxproj:
1466         * page/DragClient.h:
1467         (WebCore::DragClient::useLegacyDragClient):
1468         Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
1469
1470         (WebCore::DragClient::beginDrag):
1471         Add new empty member function.
1472
1473         * page/DragController.cpp:
1474         (WebCore::dragImageAnchorPointForSelectionDrag):
1475         Helper function that returns the anchor point for a selection drag image.
1476
1477         (WebCore::DragController::startDrag):
1478         If we can use the new code path, set up a drag item with an image and pasteboard data.
1479
1480         (WebCore::DragController::beginDrag):
1481         New function that calls out to the client.
1482
1483         * page/DragController.h:
1484         Add new members.
1485
1486         * platform/DragItem.h:
1487         Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
1488
1489         * platform/mac/PasteboardWriter.h:
1490         Rename createPasteboardWriting to createPasteboardWriter.
1491
1492         * platform/mac/PasteboardWriter.mm:
1493         (WebCore::createPasteboardWriter):
1494         Use the UTI pasteboard type.
1495
1496 2017-02-20  Alex Christensen  <achristensen@webkit.org>
1497
1498         Fix libwebrtc build after r212644.
1499         https://bugs.webkit.org/show_bug.cgi?id=168596
1500
1501         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1502         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1503         m_endpoint changed from a c++ reference to a WTF::Ref, so we need to use operator -> instead of .
1504
1505 2017-02-20  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1506
1507         [Readable Streams API] Add ReadableByteStreamController byobRequest attribute
1508         https://bugs.webkit.org/show_bug.cgi?id=168319
1509
1510         Reviewed by Youenn Fablet.
1511
1512         Added ReadableByteStreamController byobRequest attribute.
1513
1514         Added tests related to ReadableStreamBYOBRequest as a dedicated object
1515         and also as an attribute of ReadableByteStreamController.
1516
1517         * CMakeLists.txt: Added new files.
1518         * DerivedSources.cpp: Added new files.
1519         * DerivedSources.make: Added new files.
1520         * Modules/streams/ReadableByteStreamController.idl: Added byobRequest support.
1521         * Modules/streams/ReadableByteStreamController.js: Added byobRequest support.
1522         * Modules/streams/ReadableByteStreamInternals.js:
1523         (privateInitializeReadableStreamBYOBRequest): Added constructor.
1524         * Modules/streams/ReadableStreamBYOBRequest.idl: Added.
1525         * Modules/streams/ReadableStreamBYOBRequest.js: Added.
1526         (respond): Not implemented yet.
1527         (respondWithNewView): Not implemented yet.
1528         (view): Not implemented yet.
1529         * WebCore.xcodeproj/project.pbxproj: Added new files.
1530         * bindings/js/JSDOMGlobalObject.cpp: Added ReadableStreamBYOBRequest support.
1531         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
1532         (WebCore::JSDOMGlobalObject::finishCreation):
1533         (WebCore::JSDOMGlobalObject::visitChildren):
1534         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added ReadableStreamBYOBRequest support.
1535         (WebCore::constructJSReadableByteStreamController):
1536         (WebCore::constructJSReadableStreamBYOBRequest):
1537         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
1538         (WebCore::createReadableStreamBYOBRequestPrivateConstructor):
1539         * bindings/js/JSReadableStreamPrivateConstructors.h: Added ReadableStreamBYOBRequest support.
1540         * bindings/js/WebCoreBuiltinNames.h: Added ReadableStreamBYOBRequest support.
1541
1542 2017-02-20  Per Arne Vollan  <pvollan@apple.com>
1543
1544         [Win] Custom scale factor is not applied in all cases.
1545         https://bugs.webkit.org/show_bug.cgi?id=168117
1546
1547         Reviewed by Brent Fulgham.
1548
1549         We should not call the function deviceScaleFactorForWindow directly, since this
1550         will return the system scale factor, and ignore the custom scale factor.
1551
1552         * platform/graphics/ca/win/CACFLayerTreeHost.h:
1553         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
1554         (WebCore::WKCACFViewLayerTreeHost::initializeContext):
1555         (WebCore::WKCACFViewLayerTreeHost::resize):
1556         (WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
1557         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
1558         * platform/win/GDIUtilities.h:
1559         (WebCore::makeScaledPoint):
1560         * platform/win/PlatformMouseEventWin.cpp:
1561         (WebCore::positionForEvent):
1562         * platform/win/PopupMenuWin.cpp:
1563         (WebCore::PopupMenuWin::show):
1564         (WebCore::PopupMenuWin::wndProc):
1565         * platform/win/PopupMenuWin.h:
1566
1567 2017-02-20  Jon Lee  <jonlee@apple.com>
1568
1569         Fix build error for iOS. Unreviewed.
1570
1571         * platform/graphics/GraphicsContext3D.cpp: Move stub function into !PLATFORM(COCOA) instead of !PLATFORM(MAC).
1572
1573 2017-02-20  Jon Lee  <jonlee@apple.com>
1574
1575         Unreviewed, rolling out r212639.
1576
1577         Have a fix for the linker error on iOS.
1578
1579         Reverted changeset:
1580
1581         "Unreviewed, rolling out r212637."
1582         https://bugs.webkit.org/show_bug.cgi?id=168595
1583         http://trac.webkit.org/changeset/212639
1584
1585 2017-02-20  Youenn Fablet  <youenn@apple.com>
1586
1587         [WebRTC] Fix some memory leaks in libwebrtc binding code
1588         https://bugs.webkit.org/show_bug.cgi?id=168596
1589
1590         Reviewed by Eric Carlson.
1591
1592         Covered by manual testing.
1593
1594         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1595         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector): Using the libwebrtc way of creating such objects.
1596         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1597         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::create):
1598         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1599         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
1600
1601 2017-02-20  Alexey Proskuryakov  <ap@apple.com>
1602
1603         Clean up how WebKit exports _WebCreateFragment
1604         https://bugs.webkit.org/show_bug.cgi?id=168579
1605
1606         Reviewed by Dan Bernstein.
1607
1608         * editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
1609         * editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
1610
1611 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
1612
1613         Unreviewed, rolling out r212637.
1614
1615         This change broke iOS builds.
1616
1617         Reverted changeset:
1618
1619         "Add 'webglcontextchanged' WebGLContextEvent"
1620         https://bugs.webkit.org/show_bug.cgi?id=168595
1621         http://trac.webkit.org/changeset/212637
1622
1623 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1624
1625         Remove code under USE(GRAPHICS_SURFACE)
1626         https://bugs.webkit.org/show_bug.cgi?id=168592
1627
1628         Reviewed by Michael Catanzaro.
1629
1630         This was only used by EFL port.
1631
1632         * platform/TextureMapper.cmake:
1633         * platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
1634         * platform/graphics/surfaces/GLTransportSurface.cpp: Removed.
1635         * platform/graphics/surfaces/GLTransportSurface.h: Removed.
1636         * platform/graphics/surfaces/GraphicsSurface.cpp: Removed.
1637         * platform/graphics/surfaces/GraphicsSurface.h: Removed.
1638         * platform/graphics/surfaces/GraphicsSurfaceToken.h: Removed.
1639         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Removed.
1640         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Removed.
1641         * platform/graphics/surfaces/egl/EGLContext.cpp: Removed.
1642         * platform/graphics/surfaces/egl/EGLContext.h: Removed.
1643         * platform/graphics/surfaces/egl/EGLHelper.cpp: Removed.
1644         * platform/graphics/surfaces/egl/EGLHelper.h: Removed.
1645         * platform/graphics/surfaces/egl/EGLSurface.cpp: Removed.
1646         * platform/graphics/surfaces/egl/EGLSurface.h: Removed.
1647         * platform/graphics/surfaces/egl/EGLXSurface.cpp: Removed.
1648         * platform/graphics/surfaces/egl/EGLXSurface.h: Removed.
1649         * platform/graphics/surfaces/glx/GLXConfigSelector.h: Removed.
1650         * platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
1651         * platform/graphics/surfaces/glx/GLXContext.h: Removed.
1652         * platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
1653         * platform/graphics/surfaces/glx/GLXSurface.h: Removed.
1654         * platform/graphics/surfaces/glx/X11Helper.cpp: Removed.
1655         * platform/graphics/surfaces/glx/X11Helper.h: Removed.
1656         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
1657         * platform/graphics/texmap/TextureMapperBackingStore.h:
1658         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
1659         (WebCore::TextureMapperPlatformLayer::setClient):
1660         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Removed.
1661         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Removed.
1662         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1663         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1664         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
1665         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
1666         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
1667         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1668         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1669         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
1670
1671 2017-02-20  Dean Jackson  <dino@apple.com>
1672
1673         Add 'webglcontextchanged' WebGLContextEvent
1674         https://bugs.webkit.org/show_bug.cgi?id=168595
1675         <rdar://problem/30604254>
1676
1677         Reviewed by Antoine Quint.
1678
1679         Add a new event that is dispatched when the GraphicsContext3D
1680         notices that the active GPU has changed.
1681
1682         Test: fast/canvas/webgl/webglcontextchangedevent.html
1683
1684         * dom/EventNames.h: Add 'webglcontextchanged'.
1685         * html/canvas/WebGLRenderingContextBase.cpp:
1686         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Dispatch the new event.
1687         (WebCore::WebGLRenderingContextBase::simulateContextChanged): Tell the GraphicsContext3D to
1688         pretend there was a GPU switch. This is called from Internals for testing.
1689         * html/canvas/WebGLRenderingContextBase.h:
1690         * html/canvas/WebGLRenderingContextBase.idl: Export the interface so Internals can see it.
1691
1692         * platform/graphics/GraphicsContext3D.cpp:
1693         (WebCore::GraphicsContext3D::simulateContextChanged): Tell the GraphicsContext3DManager
1694         that it should pretend a GPU change has happened, which causes it to notify all the
1695         active contexts.
1696         * platform/graphics/GraphicsContext3D.h:
1697
1698         * platform/graphics/mac/GraphicsContext3DMac.mm:
1699         (WebCore::GraphicsContext3DManager::updateAllContexts): Tell the GraphicsContext3Ds
1700         to tell their WebGLRenderingContexts to dispatch an event.
1701         (WebCore::GraphicsContext3D::simulateContextChanged): Fake the display change.
1702         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1703         (WebCore::GraphicsContext3D::dispatchContextChangedNotification): Tell the WebGLRenderingContext
1704         that a change has occurred, and that it should dispatch an event. This is a layering
1705         violation which will need to be fixed (although with other communication from GC3D back
1706         to WebGL).
1707         * testing/Internals.cpp:
1708         (WebCore::Internals::simulateWebGLContextChanged):
1709         * testing/Internals.h:
1710         * testing/Internals.idl:
1711
1712 2017-02-19  Dean Jackson  <dino@apple.com>
1713
1714         Activate/deactivate high performance GPU when requested
1715         https://bugs.webkit.org/show_bug.cgi?id=168559
1716         <rdar://problem/30592266>
1717
1718         Reviewed by Jon Lee.
1719
1720         Respect the high-performance powerPreference for WebGL, by managing an
1721         object that enables the high-performance GPU. If a WebGL context wants
1722         high-performance, and it is visible, then a manager class in GraphicsContext3D
1723         creates and retains the object, causing all the WebGL contexts to move GPUs.
1724         If all the high-performance contexts are not visible, such as in a background tab,
1725         then the manager will release the object, allowing the GPU to power down.
1726
1727         The swapping back from the high-performance GPU happens on a timer, to make
1728         sure we don't churn between GPUs if the user is swapping between a lot of tabs,
1729         or windows.
1730
1731         Unfortunately testing this change properly requires hardware with
1732         multiple GPUs. I plan to write an API test that fakes most of the
1733         system interaction, such as occluding the page. An API test might
1734         also be able to verify if the system has more than one GPU. Otherwise
1735         I'll have to plumb everything through Internals.
1736
1737         * html/canvas/WebGLRenderingContextBase.cpp:
1738         (WebCore::isHighPerformanceContext): Helper to detect if the GraphicsContext3D actually
1739         used high-performance mode.
1740         (WebCore::WebGLRenderingContextBase::create): Add logging if we are
1741         actually overriding a high-performance request.
1742         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): If we are high-performance,
1743         then register for activity state changes.
1744         (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
1745         (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
1746         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): Call removeActivityStateChangeObserver
1747         as the GC3D is destroyed.
1748         (WebCore::WebGLRenderingContextBase::maybeRestoreContext): If the context was
1749         restored successfully, and came back in high-performance, then we need
1750         to listen for activity state changes as usual.
1751         (WebCore::WebGLRenderingContextBase::activityStateDidChange): If we changed visibility,
1752         tell the GC3D.
1753         * html/canvas/WebGLRenderingContextBase.h: Class inherits ActivityStateChangeObserver.
1754
1755         * page/Settings.in: No longer force low-power everywhere.
1756
1757         * platform/graphics/GraphicsContext3D.cpp:
1758         (WebCore::GraphicsContext3D::setContextVisibility): Empty implementation for non-Mac.
1759         * platform/graphics/GraphicsContext3D.h:
1760         (WebCore::GraphicsContext3D::powerPreferenceUsedForCreation): Tells clients what power preference
1761         was actually used during creation (e.g. a single GPU system will use default, even if
1762         they requested high-performance).
1763
1764         * platform/graphics/mac/GraphicsContext3DMac.mm:
1765         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Helper class to
1766         look after all GraphicsContext3Ds.
1767         (WebCore::GraphicsContext3DManager::hasTooManyContexts): We have a limit on the
1768         number of contexts we can keep alive at any one time.
1769         (WebCore::manager): Helper to return the static instance.
1770         (WebCore::displayWasReconfigured): Send a message to all the contexts.
1771         (WebCore::GraphicsContext3DManager::addContext):
1772         (WebCore::GraphicsContext3DManager::removeContext):
1773         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
1774         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
1775         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Check if the number
1776         of contexts requiring high-performance means we need to enable/disable that GPU.
1777         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Releases our
1778         object that keeps the high-performance GPU on.
1779         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Get rid of the first (oldest)
1780         context. This code was in GC3D proper, but it made more sense here in the helper.
1781         (WebCore::setPixelFormat): All contexts are created muxable now.
1782         (WebCore::GraphicsContext3D::create): Use the manager.
1783         (WebCore::GraphicsContext3D::GraphicsContext3D): Ditto.
1784         (WebCore::GraphicsContext3D::~GraphicsContext3D): Add logging.
1785         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Better logging.
1786         (WebCore::GraphicsContext3D::updateCGLContext):
1787         (WebCore::GraphicsContext3D::setContextVisibility): This is the responder to the
1788         ActivityStateChanges in the WebGLRenderingContext.
1789         (WebCore::activeContexts): Deleted.
1790         (WebCore::addActiveContext): Deleted.
1791         (WebCore::removeActiveContext): Deleted.
1792
1793 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
1794
1795         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
1796         https://bugs.webkit.org/show_bug.cgi?id=167693
1797
1798         Reviewed by Sergio Villar Senin.
1799
1800         * Configurations/FeatureDefines.xcconfig:
1801         * css/CSSComputedStyleDeclaration.cpp:
1802         (WebCore::valueForGridPosition):
1803         (WebCore::isLayoutDependent):
1804         (WebCore::resolveJustifySelfAuto):
1805         (WebCore::isImplicitlyInheritedGridOrFlexProperty):
1806         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
1807         (WebCore::ComputedStyleExtractor::propertyValue):
1808         * css/CSSGridAutoRepeatValue.cpp:
1809         * css/CSSGridAutoRepeatValue.h:
1810         * css/CSSGridLineNamesValue.cpp:
1811         * css/CSSGridLineNamesValue.h:
1812         * css/CSSGridTemplateAreasValue.cpp:
1813         * css/CSSGridTemplateAreasValue.h:
1814         * css/CSSPrimitiveValueMappings.h:
1815         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1816         * css/CSSProperties.json:
1817         * css/CSSValue.cpp:
1818         (WebCore::CSSValue::equals):
1819         (WebCore::CSSValue::cssText):
1820         (WebCore::CSSValue::destroy):
1821         * css/CSSValue.h:
1822         (WebCore::CSSValue::isContentDistributionValue):
1823         (WebCore::CSSValue::isGridLineNamesValue):
1824         * css/CSSValueKeywords.in:
1825         * css/StyleBuilderConverter.h:
1826         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
1827         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
1828         * css/StyleBuilderCustom.h:
1829         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
1830         * css/StyleProperties.cpp:
1831         (WebCore::StyleProperties::getPropertyValue):
1832         * css/StyleResolver.cpp:
1833         (WebCore::equivalentBlockDisplay):
1834         * css/StyleResolver.h:
1835         * css/parser/CSSParser.cpp:
1836         (WebCore::CSSParserContext::CSSParserContext):
1837         (WebCore::operator==):
1838         * css/parser/CSSParserFastPaths.cpp:
1839         (WebCore::isSimpleLengthPropertyID):
1840         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1841         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1842         * css/parser/CSSParserMode.h:
1843         (WebCore::CSSParserContextHash::hash):
1844         * css/parser/CSSPropertyParser.cpp:
1845         (WebCore::consumeGridAutoFlow):
1846         (WebCore::consumeGridTemplateAreas):
1847         (WebCore::CSSPropertyParser::parseSingleValue):
1848         (WebCore::CSSPropertyParser::consumeGridShorthand):
1849         (WebCore::CSSPropertyParser::parseShorthand):
1850         * dom/Document.cpp:
1851         * dom/Document.h:
1852         * dom/Position.cpp:
1853         (WebCore::Position::isCandidate):
1854         * page/RuntimeEnabledFeatures.h:
1855         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
1856         * rendering/Grid.cpp:
1857         * rendering/Grid.h:
1858         * rendering/RenderBlock.cpp:
1859         (WebCore::RenderBlock::getFirstLetter):
1860         * rendering/RenderBox.cpp:
1861         (WebCore::RenderBox::~RenderBox):
1862         (WebCore::RenderBox::styleDidChange):
1863         (WebCore::RenderBox::clearExtraInlineAndBlockOffests):
1864         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
1865         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
1866         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
1867         (WebCore::RenderBox::computeLogicalWidthInRegion):
1868         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1869         (WebCore::RenderBox::computeLogicalHeight):
1870         (WebCore::RenderBox::computePercentageLogicalHeight):
1871         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
1872         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
1873         (WebCore::RenderBox::computePositionedLogicalWidth):
1874         (WebCore::RenderBox::computePositionedLogicalHeight):
1875         (WebCore::RenderBox::createsNewFormattingContext):
1876         (WebCore::logicalWidthIsResolvable):
1877         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
1878         (WebCore::RenderBox::hasDefiniteLogicalHeight):
1879         * rendering/RenderBox.h:
1880         (WebCore::RenderBox::isGridItem):
1881         * rendering/RenderElement.cpp:
1882         (WebCore::RenderElement::createFor):
1883         * rendering/RenderFlexibleBox.cpp:
1884         (WebCore::RenderFlexibleBox::alignChildren):
1885         * rendering/RenderGrid.cpp:
1886         * rendering/RenderGrid.h:
1887         * rendering/RenderObject.h:
1888         (WebCore::RenderObject::isRenderGrid):
1889         * rendering/style/GridArea.h:
1890         * rendering/style/GridLength.h:
1891         * rendering/style/GridPosition.h:
1892         * rendering/style/GridPositionsResolver.cpp:
1893         * rendering/style/GridPositionsResolver.h:
1894         * rendering/style/GridTrackSize.h:
1895         * rendering/style/RenderStyle.cpp:
1896         (WebCore::RenderStyle::isCSSGridLayoutEnabled):
1897         (WebCore::RenderStyle::changeRequiresLayout):
1898         * rendering/style/RenderStyle.h:
1899         (WebCore::RenderStyle::gridItemRowEnd):
1900         (WebCore::RenderStyle::setGridRowGap):
1901         (WebCore::RenderStyle::initialGridItemRowEnd):
1902         (WebCore::RenderStyle::isDisplayReplacedType):
1903         (WebCore::RenderStyle::isDisplayGridBox):
1904         * rendering/style/RenderStyleConstants.h:
1905         * rendering/style/StyleGridData.cpp:
1906         * rendering/style/StyleGridData.h:
1907         * rendering/style/StyleGridItemData.cpp:
1908         * rendering/style/StyleGridItemData.h:
1909         * rendering/style/StyleRareNonInheritedData.cpp:
1910         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1911         (WebCore::StyleRareNonInheritedData::operator==):
1912         * rendering/style/StyleRareNonInheritedData.h:
1913         * testing/InternalSettings.cpp:
1914         (WebCore::InternalSettings::Backup::Backup):
1915         (WebCore::InternalSettings::Backup::restoreTo):
1916         (WebCore::InternalSettings::setCSSGridLayoutEnabled):
1917
1918 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1919
1920         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
1921         https://bugs.webkit.org/show_bug.cgi?id=168375
1922
1923         Reviewed by Alex Christensen.
1924
1925         Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
1926         cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
1927         session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
1928         set.
1929
1930         * platform/network/NetworkStorageSession.h:
1931         * platform/network/soup/CookieStorageSoup.cpp:
1932         (WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
1933         (WebCore::stopObservingCookieChanges): Ditto.
1934         (WebCore::cookieChangeCallbackMap): Deleted.
1935         (WebCore::soupCookiesChanged): Deleted.
1936         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1937         (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
1938         (WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
1939         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
1940         (WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
1941         (WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
1942         (WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
1943         needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
1944         (WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
1945
1946 2017-02-19  Chris Dumez  <cdumez@apple.com>
1947
1948         onbeforeunload event return value coercion is not per-spec
1949         https://bugs.webkit.org/show_bug.cgi?id=168382
1950
1951         Reviewed by Darin Adler.
1952
1953         Update handling of value returned by onbeforeunload event listeners
1954         to match Firefox and the specification:
1955         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
1956
1957         Namely, the following changes were made:
1958         - Only set the event's returnValue attribute to the returned value if the attribute
1959           value is the empty string (so as to not override the attribute value if it has
1960           explicitly been set by JS).
1961         - Cancel the event when the return value is not null by calling preventDefault().
1962
1963         Additionally, the following changes were made:
1964         - Ask the user to confirm the navigation if the event was canceled, not just if the
1965           returnValue attribute was set to a non-empty string.
1966         as per:
1967         - https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
1968
1969         Tests: fast/events/before-unload-return-string-conversion.html
1970                imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
1971
1972         * bindings/js/JSEventListener.cpp:
1973         (WebCore::handleBeforeUnloadEventReturnValue):
1974         (WebCore::JSEventListener::handleEvent):
1975         * loader/FrameLoader.cpp:
1976         (WebCore::shouldAskForNavigationConfirmation):
1977         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
1978
1979 2017-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1980
1981         [SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
1982         https://bugs.webkit.org/show_bug.cgi?id=168571
1983
1984         Reviewed by Michael Catanzaro.
1985
1986         Fixes: http/tests/ssl/upgrade-origin-usage.html
1987
1988         * testing/InternalSettings.cpp:
1989         (WebCore::InternalSettings::setAllowsAnySSLCertificate):
1990
1991 2017-02-18  Ryosuke Niwa  <rniwa@webkit.org>
1992
1993         REGRESSION(r212218): Assertion failures in and after parserRemoveChild
1994         https://bugs.webkit.org/show_bug.cgi?id=168458
1995
1996         Reviewed by Antti Koivisto.
1997
1998         The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
1999         oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
2000         Fixed the bug by checking this condition and exiting early.
2001
2002         Also fixed various callers of parserRemoveChild to not call parserAppendChild when
2003         the removed node had already been inserted elsewhere by scripts.
2004
2005         Tests: fast/parser/adoption-agency-unload-iframe-3.html
2006                fast/parser/adoption-agency-unload-iframe-4.html
2007                fast/parser/xml-error-unload-iframe.html
2008
2009         * dom/ContainerNode.cpp:
2010         (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
2011         inserted elsewhere while firing unload events. Also moved the call to
2012         notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
2013         synchrnously fire a focus event.
2014         (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
2015         NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
2016         * html/parser/HTMLConstructionSite.cpp:
2017         (WebCore::executeReparentTask): Added an early exit when the node had already been
2018         inserted elsewhere.
2019         (WebCore::executeInsertAlreadyParsedChildTask): Ditto.
2020         * xml/XMLErrors.cpp:
2021         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
2022         * xml/parser/XMLDocumentParser.cpp:
2023         (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
2024         Exit early when insertErrorMessageBlock detached the parser (by author scripts).
2025         (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
2026
2027 2017-02-19  Chris Dumez  <cdumez@apple.com>
2028
2029         <input type=color readonly> doesn't act per spec
2030         https://bugs.webkit.org/show_bug.cgi?id=168421
2031         <rdar://problem/30593185>
2032
2033         Reviewed by Ryosuke Niwa.
2034
2035         The 'readonly' attribute should not apply to <input type=color> as per the
2036         HTML specification:
2037         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
2038
2039         Chrome / Firefox and Edge already behave as per the specification.
2040
2041         Tests: fast/forms/color/input-color-disabled.html
2042                fast/forms/color/input-color-readonly.html
2043
2044         * html/ColorInputType.cpp:
2045         (WebCore::ColorInputType::handleDOMActivateEvent):
2046         (WebCore::ColorInputType::didChooseColor):
2047
2048 2017-02-19  Commit Queue  <commit-queue@webkit.org>
2049
2050         Unreviewed, rolling out r212466.
2051         https://bugs.webkit.org/show_bug.cgi?id=168577
2052
2053         causes crashes on AArch64 on linux, maybe it's causing crashes
2054         on iOS too (Requested by pizlo on #webkit).
2055
2056         Reverted changeset:
2057
2058         "The collector thread should only start when the mutator
2059         doesn't have heap access"
2060         https://bugs.webkit.org/show_bug.cgi?id=167737
2061         http://trac.webkit.org/changeset/212466
2062
2063 2017-02-19  Zalan Bujtas  <zalan@apple.com>
2064
2065         Simple line layout: Implement positionForPoint.
2066         https://bugs.webkit.org/show_bug.cgi?id=168565
2067         <rdar://problem/30593370>
2068
2069         Reviewed by Antti Koivisto.
2070
2071         With this patch, now we don't need to switch over to line box tree anymore when positionForPoint()
2072         is called on a single RenderText content (which is the majority of the simple line content).
2073         This patch also adds a new positionForPoint method which returns a Position object instead of VisiblePosition.
2074         Some of the positionForPoint() callsites are only interested in the Position object so constructing a VisiblePosition
2075         (which could potentially kick off a layout) is a waste. At this point the non-simple line layout codepath still constructs
2076         a VisiblePosition and that should be addresses as part of webkit.org/b/168566.
2077
2078         Covered by existing tests.
2079
2080         * dom/Document.cpp:
2081         (WebCore::Document::caretRangeFromPoint):
2082         * rendering/RenderBlockFlow.cpp:
2083         (WebCore::RenderBlockFlow::positionForPoint):
2084         * rendering/RenderBlockFlow.h:
2085         * rendering/RenderObject.cpp:
2086         (WebCore::RenderObject::positionForPoint):
2087         * rendering/RenderObject.h:
2088         * rendering/RenderText.cpp:
2089         (WebCore::RenderText::positionForPoint):
2090         * rendering/RenderText.h:
2091         * rendering/SimpleLineLayoutFunctions.cpp:
2092         (WebCore::SimpleLineLayout::positionForPoint):
2093         * rendering/SimpleLineLayoutFunctions.h:
2094         * rendering/SimpleLineLayoutResolver.cpp:
2095         (WebCore::SimpleLineLayout::RunResolver::runForPoint):
2096         * rendering/SimpleLineLayoutResolver.h:
2097         (WebCore::SimpleLineLayout::RunResolver::Run::logicalLeft):
2098         (WebCore::SimpleLineLayout::RunResolver::Run::logicalRight):
2099
2100 2017-02-19  Antti Koivisto  <antti@apple.com>
2101
2102         Execute pending scripts asynchronously after stylesheet loads complete
2103         https://bugs.webkit.org/show_bug.cgi?id=168367
2104         rdar://problem/30561379
2105
2106         Reviewed by Andreas Kling.
2107
2108         The current synchronous execution is fragile and creates various problems.
2109
2110         * css/StyleSheetContents.cpp:
2111         (WebCore::StyleSheetContents::checkLoaded):
2112         * dom/ContainerNode.cpp:
2113         (WebCore::ContainerNode::takeAllChildrenFrom):
2114         (WebCore::ContainerNode::notifyChildInserted):
2115         (WebCore::ContainerNode::removeChild):
2116         (WebCore::ContainerNode::parserRemoveChild):
2117         (WebCore::ContainerNode::removeChildren):
2118
2119             Remove various places where we would trigger delayed synchronous execution.
2120
2121         * dom/Document.cpp:
2122         (WebCore::Document::Document):
2123         (WebCore::Document::recalcStyle):
2124
2125             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
2126
2127         (WebCore::Document::didRemoveAllPendingStylesheet):
2128
2129             Call asynchronous script execution function.
2130
2131         * dom/Document.h:
2132         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
2133         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
2134         * dom/ScriptableDocumentParser.cpp:
2135         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
2136         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
2137         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
2138
2139             Add a timer for executing pending scripts.
2140
2141         (WebCore::ScriptableDocumentParser::detach):
2142         * dom/ScriptableDocumentParser.h:
2143         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
2144         * html/HTMLLinkElement.cpp:
2145         (WebCore::HTMLLinkElement::removedFrom):
2146         (WebCore::HTMLLinkElement::removePendingSheet):
2147         * html/HTMLLinkElement.h:
2148         * html/parser/HTMLDocumentParser.cpp:
2149         (WebCore::HTMLDocumentParser::detach):
2150         * loader/DocumentLoader.cpp:
2151         (WebCore::DocumentLoader::isLoadingInAPISense):
2152
2153             Stay in loading state if we have a pending script. This matches existing behavior.
2154
2155         * style/StyleScope.cpp:
2156         (WebCore::Style::Scope::removePendingSheet):
2157         * style/StyleScope.h:
2158
2159 2017-02-18  Chris Dumez  <cdumez@apple.com>
2160
2161         <input type=range readonly> doesn't act per spec
2162         https://bugs.webkit.org/show_bug.cgi?id=168422
2163         <rdar://problem/30593189>
2164
2165         Reviewed by Ryosuke Niwa.
2166
2167         'readonly' attribute should not apply to <input type=range> as per the HTML
2168         specification:
2169         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
2170
2171         Firefox and Edge already behave as per the specification.
2172
2173         No new tests, updated existing tests.
2174
2175         * html/RangeInputType.cpp:
2176         (WebCore::RangeInputType::handleMouseDownEvent):
2177         (WebCore::RangeInputType::handleTouchEvent):
2178         (WebCore::RangeInputType::handleKeydownEvent):
2179         * html/shadow/SliderThumbElement.cpp:
2180         (WebCore::SliderThumbElement::defaultEventHandler):
2181         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
2182         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
2183
2184 2017-02-18  Chris Dumez  <cdumez@apple.com>
2185
2186         Recursive MessagePort.postMessage() calls causes tab to become unresponsive
2187         https://bugs.webkit.org/show_bug.cgi?id=168548
2188         <rdar://problem/29808005>
2189
2190         Reviewed by Darin Adler.
2191
2192         MessagePort::dispatchMessages() was getting messages one by one of the
2193         channel's MessageQueue and firing the MessageEvent for each of them.
2194         The issue is that we can get stuck in an infinite loop if the
2195         MessageEvent handler posts a message on the same post.
2196
2197         To address the issue, we now takes all messages from the queue before
2198         iterating over them to fire the event. This way, if new messages are
2199         added to the queue in one of the MessageEvent handlers, they will not
2200         be processed until the next event loop iteration, as is expected.
2201
2202         Test: fast/events/message-port-postMessage-recursive.html
2203
2204         * dom/MessagePort.cpp:
2205         (WebCore::MessagePort::dispatchMessages):
2206         * dom/MessagePortChannel.h:
2207         (WebCore::MessagePortChannel::EventData::EventData):
2208         * dom/default/PlatformMessagePortChannel.cpp:
2209         (WebCore::MessagePortChannel::postMessageToRemote):
2210         * dom/default/PlatformMessagePortChannel.h:
2211         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeMessage):
2212         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeAllMessages):
2213         (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
2214
2215 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2216
2217         Remove COORDINATED_GRAPHICS_MULTIPROCESS
2218         https://bugs.webkit.org/show_bug.cgi?id=168514
2219
2220         Reviewed by Darin Adler.
2221
2222         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2223         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2224
2225 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
2226
2227         Allow properties in CSSProperties.json that don't trigger code generation
2228         https://bugs.webkit.org/show_bug.cgi?id=168535
2229
2230         Reviewed by Sam Weinig.
2231         
2232         In order to track the development of CSS properties that we have not yet implemented,
2233         support '"skip-codegen" : true' in "codegen-properties".
2234
2235         Test by adding a few fill-related properties with this attribute.
2236
2237         * css/CSSProperties.json:
2238         * css/makeprop.pl:
2239         (isPropertyEnabled):
2240         (addProperty):
2241
2242 2017-02-17  Brian Burg  <bburg@apple.com>
2243
2244         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
2245         https://bugs.webkit.org/show_bug.cgi?id=168273
2246         <rdar://problem/29949325>
2247
2248         Reviewed by Matt Baker.
2249
2250         Add the ability to dock Web Inspector to the left of the inspected view.
2251         The frontend decides whether the Dock to Side button docks left or right
2252         based on the current layout direction.
2253
2254         * inspector/InspectorFrontendClient.h:
2255         * inspector/InspectorFrontendClientLocal.cpp:
2256         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
2257         * inspector/InspectorFrontendHost.cpp:
2258         (WebCore::InspectorFrontendHost::requestSetDockSide):
2259
2260 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2261
2262         Allow PlatformCALayers to specify that they want deep color backing store
2263         https://bugs.webkit.org/show_bug.cgi?id=168495
2264
2265         Reviewed by Tim Horton.
2266         
2267         Currently capable iOS devices get deep color backing store by virtue of a supports
2268         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
2269
2270         Future work will make layer contents format selection more complex, so express the need
2271         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
2272         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
2273         is needed to propagte the state to TileControllers.
2274         
2275         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
2276         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
2277
2278         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
2279         that we no longer use.
2280
2281         An iphone7 test verifies that page tiles, normal layers and tiled layers get the deep
2282         color state set on them.
2283
2284         Test: tiled-drawing/ios/iphone7/compositing-layers-deep-color.html
2285
2286         * platform/graphics/ca/GraphicsLayerCA.cpp:
2287         (WebCore::GraphicsLayerCA::createPlatformCALayer):
2288         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
2289         * platform/graphics/ca/GraphicsLayerCA.h:
2290         * platform/graphics/ca/PlatformCALayer.cpp:
2291         (WebCore::PlatformCALayer::canHaveBackingStore):
2292         (WebCore::operator<<):
2293         * platform/graphics/ca/PlatformCALayer.h:
2294         * platform/graphics/ca/TileController.cpp:
2295         (WebCore::TileController::setZoomedOutContentsScale):
2296         (WebCore::TileController::setAcceleratesDrawing):
2297         (WebCore::TileController::setWantsDeepColorBackingStore):
2298         (WebCore::TileController::createTileLayer):
2299         * platform/graphics/ca/TileController.h:
2300         * platform/graphics/ca/TileGrid.cpp:
2301         (WebCore::TileGrid::updateTileLayerProperties):
2302         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2303         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2304         (PlatformCALayerCocoa::PlatformCALayerCocoa):
2305         (PlatformCALayerCocoa::commonInit):
2306         (PlatformCALayerCocoa::wantsDeepColorBackingStore):
2307         (PlatformCALayerCocoa::setWantsDeepColorBackingStore):
2308         (layerContentsFormat):
2309         (PlatformCALayerCocoa::updateContentsFormat):
2310         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
2311         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
2312         (-[WebTiledBackingLayer setWantsDeepColorBackingStore:]):
2313         (-[WebTiledBackingLayer wantsDeepColorBackingStore]):
2314         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2315         (PlatformCALayerWin::wantsDeepColorBackingStore):
2316         (PlatformCALayerWin::setWantsDeepColorBackingStore):
2317         (printLayer):
2318         * platform/graphics/ca/win/PlatformCALayerWin.h:
2319         * platform/spi/cocoa/QuartzCoreSPI.h:
2320
2321 2017-02-17  Jer Noble  <jer.noble@apple.com>
2322
2323         Refactoring: Make sure to unprepare WebAudioSourceProviderAVFObjC when its owner is destroyed.
2324         https://bugs.webkit.org/show_bug.cgi?id=168532
2325
2326         Reviewed by Youenn Fablet.
2327
2328         Because WebAudioSourceProviderAVFObjC has a back-pointer to the object which creted it, make
2329         sure that back-pointer is invalidated once the creating object is destroyed by calling
2330         WebAudioSOurceProviderAVFObjC::unprepare().
2331
2332         Drive-by Fix: In WebAudioSourceProviderAVFObjC::audioSamplesAvailable(), PlatformAudioData will
2333         always be of the WebAudioBufferList type. If this ever becomes untrue, an invalid downcast will
2334         be caught by downcast<>, so just remove the is<> check.
2335
2336         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2337         (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
2338         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2339         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2340         (WebCore::MockRealtimeAudioSourceMac::~MockRealtimeAudioSourceMac):
2341         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
2342         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
2343         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
2344         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2345         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
2346         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
2347         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
2348         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2349
2350 2017-02-17  Antoine Quint  <graouts@apple.com>
2351
2352         [Modern Media Controls] Improve handling of <video> with only audio tracks
2353         https://bugs.webkit.org/show_bug.cgi?id=167836
2354         <rdar://problem/30255812>
2355
2356         Reviewed by Dean Jackson.
2357
2358         We now check for the availability of video tracks before considering a <video>
2359         element is displaying an actual video file and turning auto-hide on. We also
2360         check that we have video tracks before enabling the fullscreen button. This
2361         brings the behavior of a <video> pointing to a resource with no video tracks
2362         to be the same as an <audio> element.
2363
2364         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
2365
2366         * Modules/modern-media-controls/media/controls-visibility-support.js:
2367         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
2368         (ControlsVisibilitySupport.prototype._updateControls):
2369         (ControlsVisibilitySupport):
2370         * Modules/modern-media-controls/media/fullscreen-support.js:
2371         (FullscreenSupport.prototype.syncControl):
2372         (FullscreenSupport):
2373
2374 2017-02-17  Antoine Quint  <graouts@apple.com>
2375
2376         [Modern Media Controls] Toggle playback when clicking on the video on macOS
2377         https://bugs.webkit.org/show_bug.cgi?id=168515
2378         <rdar://problem/30577441>
2379
2380         Reviewed by Dean Jackson.
2381
2382         Listen to click events on the macOS media controls. Detect any clicks that were on the
2383         background instead of the controls widgets themselves, and tell the delegate (MediaController)
2384         about them.
2385
2386         Tests: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html
2387                media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html
2388                media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html
2389
2390         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2391         (MacOSFullscreenMediaControls.prototype._handleMousedown):
2392         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2393         (MacOSInlineMediaControls.prototype.handleEvent):
2394         * Modules/modern-media-controls/controls/macos-media-controls.js:
2395         (MacOSMediaControls.prototype.handleEvent):
2396         (MacOSMediaControls):
2397         * Modules/modern-media-controls/media/media-controller.js:
2398         (MediaController.prototype.togglePlayback):
2399         (MediaController.prototype.macOSControlsBackgroundWasClicked):
2400         (MediaController.prototype._updateControlsIfNeeded):
2401         * Modules/modern-media-controls/media/playback-support.js:
2402         (PlaybackSupport.prototype.buttonWasPressed):
2403
2404 2017-02-17  Jer Noble  <jer.noble@apple.com>
2405
2406         Refactoring: Remove AudioSourceObserverObjC and AudioCaptureSourceProviderObjC
2407         https://bugs.webkit.org/show_bug.cgi?id=168520
2408
2409         Reviewed by Youenn Fablet.
2410
2411         Having AudioCaptureSourceProviderObjC as the type provided to WebAudioSourceProviderAVFObjC
2412         (and only ever to WebAudioSourceProviderAVFObjC) makes it impossible for that class to add
2413         an observer on RealtimeMediaSource, of which all classes inheriting from
2414         WebAudioSourceProviderAVFObjC are subclasses. There is no need to treat
2415         WebAudioSourceProviderAVFObjC as an "observer", since the only thing it will ever observe is
2416         the object which created it and hold an explicit reference to it. So replace all instances
2417         of the "observer" pattern with direct calls to the necessary (newly non-virtual) methods.
2418         This allows WebAudioSourceProviderAVFObjC to register as an observer directly on
2419         RealtimeMediaSource, to listen for audioSamplesAvailable() instead of process(), and remove
2420         a lot of unnecessary conversion code and observer duplication.
2421
2422         * WebCore.xcodeproj/project.pbxproj:
2423         * platform/mediastream/RealtimeMediaSource.h:
2424         (WebCore::RealtimeMediaSource::Observer::sourceStopped):
2425         (WebCore::RealtimeMediaSource::Observer::sourceMutedChanged):
2426         (WebCore::RealtimeMediaSource::Observer::sourceEnabledChanged):
2427         (WebCore::RealtimeMediaSource::Observer::sourceSettingsChanged):
2428         (WebCore::RealtimeMediaSource::Observer::preventSourceFromStopping):
2429         * platform/mediastream/mac/AVAudioCaptureSource.h:
2430         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2431         (WebCore::AVAudioCaptureSource::shutdownCaptureSession):
2432         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2433         (WebCore::AVAudioCaptureSource::addObserver): Deleted.
2434         (WebCore::AVAudioCaptureSource::removeObserver): Deleted.
2435         (WebCore::AVAudioCaptureSource::start): Deleted.
2436         * platform/mediastream/mac/AudioCaptureSourceProviderObjC.h: Removed.
2437         * platform/mediastream/mac/AudioSourceObserverObjC.h: Removed.
2438         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2439         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
2440         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2441         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
2442         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
2443         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
2444         (WebCore::MockRealtimeAudioSourceMac::addObserver): Deleted.
2445         (WebCore::MockRealtimeAudioSourceMac::removeObserver): Deleted.
2446         (WebCore::MockRealtimeAudioSourceMac::start): Deleted.
2447         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
2448         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
2449         (WebCore::RealtimeIncomingAudioSource::addObserver): Deleted.
2450         (WebCore::RealtimeIncomingAudioSource::removeObserver): Deleted.
2451         (WebCore::RealtimeIncomingAudioSource::start): Deleted.
2452         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
2453         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2454         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2455         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
2456         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2457         (WebCore::WebAudioSourceProviderAVFObjC::create):
2458         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
2459         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
2460         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
2461         (WebCore::WebAudioSourceProviderAVFObjC::process): Deleted.
2462
2463 2017-02-17  Antoine Quint  <graouts@apple.com>
2464
2465         REGRESSION: Subtitles menu in media controls allows multiple items to be selected
2466         https://bugs.webkit.org/show_bug.cgi?id=168168
2467         <rdar://problem/30488605>
2468
2469         Reviewed by Dean Jackson.
2470
2471         Ensure that only a single audio track and a single text track can be selected
2472         in the tracks panel at any given point.
2473
2474         * Modules/modern-media-controls/media/tracks-support.js:
2475         (TracksSupport.prototype.tracksPanelSelectionDidChange):
2476         (TracksSupport.prototype._sortedTrackList):
2477         (TracksSupport):
2478
2479 2017-02-17  Jeremy Jones  <jeremyj@apple.com>
2480
2481         Invalidate WebAVSampleBufferStatusChangeListener when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
2482         https://bugs.webkit.org/show_bug.cgi?id=168488
2483
2484         Reviewed by Jer Noble.
2485
2486         Fixes periodically crashing test: fast/mediastream/MediaStream-video-element-track-stop.html
2487
2488         WebAVSampleBufferStatusChangeListener has an unretained referecne to MediaPlayerPrivateMediaStreamAVFObjC
2489         that must be invaldated when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
2490
2491         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2492         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
2493
2494 2017-02-17  Antoine Quint  <graouts@apple.com>
2495
2496         [Modern Media Controls] Improve handling of live broadcast video
2497         https://bugs.webkit.org/show_bug.cgi?id=168506
2498         <rdar://problem/30432094>
2499
2500         Reviewed by Dean Jackson.
2501
2502         We improve the handling of live broadcast video by:
2503         
2504             - checking that we have a media source before deciding to show the controls
2505               bar and start button
2506             - support a mode where neither the status text nor the scrubber is visible
2507               in case we're still waiting on sufficient data to determine the video
2508               time and we haven't really started loading data yet
2509             - not showing time labels when we have an infinite duration
2510             - ensuring the status label is left-aligned
2511
2512         Test: media/modern-media-controls/status-label/status-label-text-align.html
2513
2514         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2515         (MacOSInlineMediaControls.prototype.layout):
2516         * Modules/modern-media-controls/controls/status-label.css:
2517         (.status-label):
2518         * Modules/modern-media-controls/controls/status-label.js:
2519         (StatusLabel.prototype.get enabled):
2520         (StatusLabel.prototype.set enabled):
2521         * Modules/modern-media-controls/media/controls-visibility-support.js:
2522         (ControlsVisibilitySupport.prototype._updateControls):
2523         (ControlsVisibilitySupport):
2524         * Modules/modern-media-controls/media/status-support.js:
2525         (StatusSupport.prototype.syncControl):
2526         (StatusSupport):
2527         * Modules/modern-media-controls/media/time-labels-support.js:
2528         (TimeLabelsSupport.prototype.syncControl):
2529         (TimeLabelsSupport):
2530
2531 2017-02-17  Anders Carlsson  <andersca@apple.com>
2532
2533         Begin overhauling the pasteboard implementation
2534         https://bugs.webkit.org/show_bug.cgi?id=168525
2535
2536         Reviewed by Tim Horton.
2537
2538         Add a new PasteboardWriterData object. This object will hold data that is going
2539         to be written to the pasteboard at some point. Currently it only supports plain text.
2540
2541         Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
2542         into an object that conforms to NSPasteboardWriting.
2543
2544         The basic idea is that instead of doing a bunch of pasteboard operations,
2545         we'll just package all the pasteboard data up into an object and ship it over to WebKit.
2546
2547         This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
2548
2549         * WebCore.xcodeproj/project.pbxproj:
2550         * platform/PasteboardWriterData.cpp: Added.
2551         (WebCore::PasteboardWriterData::PasteboardWriterData):
2552         (WebCore::PasteboardWriterData::~PasteboardWriterData):
2553         (WebCore::PasteboardWriterData::isEmpty):
2554         (WebCore::PasteboardWriterData::setPlainText):
2555         * platform/PasteboardWriterData.h: Added.
2556         * platform/mac/PasteboardWriter.h: Added.
2557         * platform/mac/PasteboardWriter.mm: Added.
2558         (WebCore::createPasteboardWriting):
2559         * platform/spi/mac/NSPasteboardSPI.h: Added.
2560
2561 2017-02-17  Per Arne Vollan  <pvollan@apple.com>
2562
2563         Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
2564         https://bugs.webkit.org/show_bug.cgi?id=168044
2565         rdar://problem/30165746
2566
2567         Reviewed by Simon Fraser.
2568
2569         This patch moves these styles out of svg, and sets the properties on video cues.
2570
2571         Tests: fast/css/parsing-paint-order.html
2572                fast/css/parsing-stroke-linecap.html
2573                fast/css/parsing-stroke-linejoin.html
2574                fast/css/parsing-stroke-width.html
2575
2576         * css/CSSComputedStyleDeclaration.cpp:
2577         (WebCore::paintOrder):
2578         (WebCore::ComputedStyleExtractor::propertyValue):
2579         * css/CSSProperties.json:
2580         * css/SVGCSSComputedStyleDeclaration.cpp:
2581         (WebCore::ComputedStyleExtractor::svgPropertyValue):
2582         (WebCore::paintOrder): Deleted.
2583         * css/StyleResolver.cpp:
2584         (WebCore::StyleResolver::isValidCueStyleProperty):
2585         * page/CaptionUserPreferencesMediaAF.cpp:
2586         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
2587         * rendering/style/RenderStyle.cpp:
2588         (WebCore::RenderStyle::diff):
2589         (WebCore::RenderStyle::paintTypesForPaintOrder):
2590         * rendering/style/RenderStyle.h:
2591         (WebCore::RenderStyle::setPaintOrder):
2592         (WebCore::RenderStyle::paintOrder):
2593         (WebCore::RenderStyle::initialPaintOrder):
2594         (WebCore::RenderStyle::setCapStyle):
2595         (WebCore::RenderStyle::capStyle):
2596         (WebCore::RenderStyle::initialCapStyle):
2597         (WebCore::RenderStyle::setJoinStyle):
2598         (WebCore::RenderStyle::joinStyle):
2599         (WebCore::RenderStyle::initialJoinStyle):
2600         (WebCore::RenderStyle::strokeWidth):
2601         (WebCore::RenderStyle::setStrokeWidth):
2602         (WebCore::RenderStyle::hasVisibleStroke):
2603         (WebCore::RenderStyle::setStrokeOpacity):
2604         * rendering/style/SVGRenderStyle.cpp:
2605         (WebCore::SVGRenderStyle::diff):
2606         (WebCore::SVGRenderStyle::paintTypesForPaintOrder): Deleted.
2607         * rendering/style/SVGRenderStyle.h:
2608         (WebCore::SVGRenderStyle::initialBufferedRendering):
2609         (WebCore::SVGRenderStyle::initialFillRule):
2610         (WebCore::SVGRenderStyle::initialMaskType):
2611         (WebCore::SVGRenderStyle::setBufferedRendering):
2612         (WebCore::SVGRenderStyle::setFillRule):
2613         (WebCore::SVGRenderStyle::setMaskType):
2614         (WebCore::SVGRenderStyle::bufferedRendering):
2615         (WebCore::SVGRenderStyle::fillRule):
2616         (WebCore::SVGRenderStyle::strokeMiterLimit):
2617         (WebCore::SVGRenderStyle::maskType):
2618         (WebCore::SVGRenderStyle::hasStroke):
2619         (WebCore::SVGRenderStyle::setBitDefaults):
2620         (WebCore::SVGRenderStyle::InheritedFlags::operator==):
2621         (WebCore::SVGRenderStyle::initialCapStyle): Deleted.
2622         (WebCore::SVGRenderStyle::initialJoinStyle): Deleted.
2623         (WebCore::SVGRenderStyle::initialPaintOrder): Deleted.
2624         (WebCore::SVGRenderStyle::setCapStyle): Deleted.
2625         (WebCore::SVGRenderStyle::setJoinStyle): Deleted.
2626         (WebCore::SVGRenderStyle::setPaintOrder): Deleted.
2627         (WebCore::SVGRenderStyle::capStyle): Deleted.
2628         (WebCore::SVGRenderStyle::joinStyle): Deleted.
2629         (WebCore::SVGRenderStyle::strokeWidth): Deleted.
2630         (WebCore::SVGRenderStyle::paintOrder): Deleted.
2631         (WebCore::SVGRenderStyle::hasVisibleStroke): Deleted.
2632         (WebCore::SVGRenderStyle::setStrokeWidth): Deleted.
2633         * rendering/style/SVGRenderStyleDefs.cpp:
2634         (WebCore::StyleStrokeData::StyleStrokeData):
2635         (WebCore::StyleStrokeData::operator==):
2636         * rendering/style/SVGRenderStyleDefs.h:
2637         * rendering/style/StyleRareInheritedData.cpp:
2638         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2639         (WebCore::StyleRareInheritedData::operator==):
2640         * rendering/style/StyleRareInheritedData.h:
2641         * rendering/svg/RenderSVGEllipse.cpp:
2642         (WebCore::RenderSVGEllipse::strokeShape):
2643         * rendering/svg/RenderSVGPath.cpp:
2644         (WebCore::RenderSVGPath::strokeShape):
2645         (WebCore::RenderSVGPath::shapeDependentStrokeContains):
2646         (WebCore::RenderSVGPath::shouldStrokeZeroLengthSubpath):
2647         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
2648         * rendering/svg/RenderSVGRect.cpp:
2649         (WebCore::RenderSVGRect::strokeShape):
2650         * rendering/svg/RenderSVGShape.cpp:
2651         (WebCore::RenderSVGShape::strokeShape):
2652         (WebCore::RenderSVGShape::fillStrokeMarkers):
2653         (WebCore::RenderSVGShape::strokeWidth):
2654         (WebCore::RenderSVGShape::hasSmoothStroke):
2655         * rendering/svg/RenderSVGText.cpp:
2656         (WebCore::RenderSVGText::strokeBoundingBox):
2657         * rendering/svg/SVGInlineTextBox.cpp:
2658         (WebCore::SVGInlineTextBox::paint):
2659         (WebCore::SVGInlineTextBox::paintDecoration):
2660         * rendering/svg/SVGRenderSupport.cpp:
2661         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
2662         * rendering/svg/SVGRenderTreeAsText.cpp:
2663         (WebCore::writeStyle):
2664
2665 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2666
2667         [SOUP] Handle Settings::allowsAnySSLCertificate() in SSL sockets
2668         https://bugs.webkit.org/show_bug.cgi?id=168521
2669
2670         Reviewed by Michael Catanzaro.
2671
2672         When Settings::allowsAnySSLCertificate() is enabled, connect to accept-certificate signal of the GTlsConnection
2673         to always accept the certificates.
2674
2675         Fixes: http/tests/websocket/tests/hybi/simple-wss.html
2676
2677         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2678         (WebCore::wssConnectionAcceptCertificateCallback):
2679         (WebCore::wssSocketClientEventCallback):
2680         (WebCore::SocketStreamHandleImpl::create):
2681
2682 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
2683
2684         Fixed elements bounce when rubber-banding at the bottom of the page
2685         https://bugs.webkit.org/show_bug.cgi?id=168493
2686         rdar://problem/30567713
2687
2688         Reviewed by Tim Horton.
2689
2690         FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
2691         by adding rubberBandBottom which is negative, rather than subtracting.
2692
2693         Log some more scrolling stuff.
2694
2695         Ironically, the existing test didn't test stick-to-viewport fixed position because
2696         backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
2697         that sets this, to test both behaviors.
2698
2699         This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
2700         to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().
2701
2702         Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
2703
2704         * page/FrameView.cpp:
2705         (WebCore::FrameView::updateLayoutViewport):
2706         (WebCore::FrameView::visibleDocumentRect):
2707         * page/scrolling/AsyncScrollingCoordinator.cpp:
2708         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2709         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2710         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
2711         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2712         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
2713         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2714         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
2715         (WebCore::ScrollingCoordinatorMac::commitTreeState):
2716
2717 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
2718
2719         REGRESSION (209396): Apple Pay buttons do not render
2720         https://bugs.webkit.org/show_bug.cgi?id=168523
2721         rdar://problem/30451563
2722
2723         Reviewed by Geoffrey Garen.
2724
2725         The new CSS parser mistakenly converted -apple-pay-button values to
2726         -webkit-pay-button, breaking -webkit-appearance: -apple-pay-button.
2727
2728         Fix by excluding "-apple-pay" prefixed values from the conversion.
2729
2730         Test: fast/css/appearance-apple-pay-button.html
2731
2732         * css/parser/CSSPropertyParser.cpp:
2733         (WebCore::isAppleLegacyCssValueKeyword):
2734
2735 2017-02-17  Commit Queue  <commit-queue@webkit.org>
2736
2737         Unreviewed, rolling out r212463.
2738         https://bugs.webkit.org/show_bug.cgi?id=168526
2739
2740         Some crashes with GuardMalloc (Requested by anttik on
2741         #webkit).
2742
2743         Reverted changeset:
2744
2745         "Execute pending scripts asynchronously after stylesheet loads
2746         complete"
2747         https://bugs.webkit.org/show_bug.cgi?id=168367
2748         http://trac.webkit.org/changeset/212463
2749
2750 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
2751
2752         RenderView needs to be updated when FrameView changes
2753         https://bugs.webkit.org/show_bug.cgi?id=168481
2754         <rdar://problem/30339638>
2755
2756         Reviewed by Andreas Kling.
2757
2758         The state of the Document's RenderView can get out of sync with the Frame's FrameView.
2759         We need a notification mechanism so that modifications to the Frame's view are properly
2760         relayed to Document so that it can have a correct RenderView.
2761
2762         * dom/Document.cpp:
2763         (WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
2764         one does not already exist).
2765         (WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
2766         code when the Frame uses 'setView(nullptr)', which happens during certain  updates.
2767         * dom/Document.h:
2768         * page/Frame.cpp:
2769         (WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
2770         the new view. Then notify the document that it is now the current document in the new view.
2771
2772 2017-02-17  Enrique Ocaña González  <eocanha@igalia.com>
2773
2774         [GStreamer] Fast replay on video hide/unhide on platforms with limited video buffer pools
2775         https://bugs.webkit.org/show_bug.cgi?id=168505
2776
2777         Reviewed by Žan Doberšek.
2778
2779         The WebKit code isn't consuming the video samples when the video layer is hidden,
2780         so the buffers aren't being returned to the pool and starve the decoder when the
2781         buffer pool runs out of buffers (on platforms using a buffer pool and a custom
2782         allocator, such as OMX on the Raspberry Pi 2). When the video layer is restored,
2783         the pipeline tries to catch up and the user sees the video "going fast forward".
2784
2785         The added code "consumes" (removes and unrefs) the buffer in that case. However,
2786         the sample isn't completely removed because it still holds important info (eg:
2787         caps) needed for the proper operation of the video element.
2788
2789         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2790         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2791
2792 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2793
2794         [SOUP] Stop removing the fragment identifier from resource requests
2795         https://bugs.webkit.org/show_bug.cgi?id=168509
2796
2797         Reviewed by Sergio Villar Senin.
2798
2799         I don't know why, but have always removed the fragment identifier from the URL when creating the SoupURI that
2800         is passed to libsoup. Maybe it was a bug in a very old version of libsoup, but it doesn't look necessary anymore
2801         and it's causing several layout test failures.
2802
2803         Fixes: http/tests/svg/svg-use-external.html
2804                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-with-hash.html
2805                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-with-hash.html
2806
2807         * platform/network/soup/ResourceRequestSoup.cpp:
2808         (WebCore::ResourceRequest::createSoupURI): Do not remove the fragment identifier from the URL.
2809
2810 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2811
2812         [JSC] Drop PassRefPtr from ArrayBuffer
2813         https://bugs.webkit.org/show_bug.cgi?id=168455
2814
2815         Reviewed by Geoffrey Garen.
2816
2817         * bindings/js/SerializedScriptValue.cpp:
2818         (WebCore::CloneDeserializer::readArrayBufferView):
2819         * css/FontFace.cpp:
2820         (WebCore::FontFace::create):
2821         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2822         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
2823         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2824         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2825         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2826         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
2827         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2828         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2829
2830 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2831
2832         REGRESSION(r212439): Web Inspector Toolbar / Window appears broken
2833         https://bugs.webkit.org/show_bug.cgi?id=168494
2834
2835         Reviewed by Joseph Pecoraro.
2836
2837         Missed one conversion from acceleratesDrawing to drawsAsynchronously, which
2838         caused non-Whippet GrpahicsContext shadow drawing to happen unexpectedly.
2839
2840         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
2841         (-[WebTiledBackingLayer drawsAsynchronously]):
2842         (-[WebTiledBackingLayer acceleratesDrawing]): Deleted.
2843
2844 2017-02-16  Chris Dumez  <cdumez@apple.com>
2845
2846         <input>.labels is empty if type changes from text->hidden->checkbox
2847         https://bugs.webkit.org/show_bug.cgi?id=168358
2848
2849         Reviewed by Ryosuke Niwa.
2850
2851         We were invalidating LabelsNodeLists on 'for' attribute change.
2852         We now also invalidate them of 'type' attribute change since
2853         HTMLInputElements whose type is 'hidden' do not support labels.
2854
2855         No new tests, updated existing test.
2856
2857         * dom/Document.h:
2858         * dom/LiveNodeList.h:
2859         (WebCore::shouldInvalidateTypeOnAttributeChange):
2860         * html/LabelsNodeList.cpp:
2861         (WebCore::LabelsNodeList::LabelsNodeList):
2862
2863 2017-02-16  Michael Catanzaro  <mcatanzaro@igalia.com>
2864
2865         Remove even more EFL from WebCore
2866         https://bugs.webkit.org/show_bug.cgi?id=168485
2867
2868         Reviewed by Alex Christensen.
2869
2870         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2871         (webkitAccessibleGetAttributes):
2872         (atkRole):
2873         * css/StyleRule.cpp:
2874         (WebCore::StyleRuleBase::copy):
2875         * platform/ContextMenuItem.h:
2876         * platform/graphics/OpenGLESShims.h:
2877         * platform/graphics/PlatformDisplay.cpp:
2878         (WebCore::PlatformDisplay::createPlatformDisplay):
2879         * platform/graphics/PlatformDisplay.h:
2880         * platform/graphics/cairo/ImageBufferCairo.cpp:
2881         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
2882         (WebCore::Font::platformInit):
2883         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2884         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
2885         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2886         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
2887         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
2888         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
2889         * platform/network/soup/ResourceErrorSoup.cpp:
2890         (WebCore::ResourceError::timeoutError):
2891         * platform/network/soup/SoupNetworkSession.cpp:
2892         (WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Deleted.
2893         * platform/network/soup/SoupNetworkSession.h:
2894
2895 2017-02-16  Daniel Bates  <dabates@apple.com>
2896
2897         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
2898         https://bugs.webkit.org/show_bug.cgi?id=168417
2899         <rdar://problem/30541748>
2900
2901         Reviewed by Brent Fulgham.
2902
2903         Remove Chromium-specific code that was added in r125500 to call FrameLoaderClient::redirectDataToPlugin(nullptr)
2904         in PluginDocument::detachFromPluginElement(). Calling redirectDataToPlugin() with nullptr was used by the
2905         Chromium port to signify that the plugin document was being destroyed so that they could tear down their
2906         plugin widget. And PluginDocument::detachFromPluginElement() is the only place that calls redirectDataToPlugin()
2907         passing nullptr. No other port made use of this machinery and the Chromium port has long since been removed
2908         from the Open Source WebKit Project. We should remove this code.
2909
2910         * html/PluginDocument.cpp:
2911         (WebCore::PluginDocumentParser::appendBytes): Pass the plugin widget by reference.
2912         (WebCore::PluginDocument::detachFromPluginElement): Remove call to FrameLoaderClient::redirectDataToPlugin().
2913         This call was only used by the Chromium port as means to be notified when the plugin document was being
2914         destroyed. No other port made use of this notification or needed such a notification.
2915         * loader/EmptyClients.cpp: Change argument of redirectDataToPlugin() from Widget* to Widget& to convey
2916         that this function always takes a valid Widget. Also remove unnecessary argument name as the data type
2917         of the argument and the name of the function sufficiently describes the purpose of the argument.
2918         * loader/FrameLoaderClient.h: Ditto.
2919
2920 2017-02-16  Myles C. Maxfield  <mmaxfield@apple.com>
2921
2922         font-weight in @font-face can cause a font to be downloaded even when it's not used
2923         https://bugs.webkit.org/show_bug.cgi?id=168114
2924         <rdar://problem/30301317>
2925
2926         Reviewed by Darin Adler.
2927
2928         There were two problems with our font loading code.
2929
2930         When we are in the middle of a download, we will use a special interstitial font,
2931         and this special font has a flag set which will cause it to be invisible when it is
2932         drawn. However, when we start using this font during the load, we give it a
2933         unicode-range of U+0-0 which means that it will never be used, and fallback will
2934         happen to other weights immediately. 
2935
2936         The second problem with the font loading code is that this interstital font is just
2937         Times. Times doesn't support every character, which means that if we are trying
2938         to render some exotic character, we fall back to other weights. The solution here
2939         is to use LastResort as the interstitial font, because it supports all characters.
2940         Because its metrics are reasonable and we don't ever actually paint this
2941         interstitial font, this choice is no worse than Times.
2942
2943         Tests: fast/text/font-style-download.html
2944                fast/text/font-weight-download-2.html
2945                fast/text/font-weight-download.html
2946                fast/text/font-weight-fallback.html
2947
2948         * css/CSSFontFace.cpp:
2949         (WebCore::CSSFontFace::font):
2950         * css/CSSSegmentedFontFace.cpp:
2951         (WebCore::appendFont):
2952         (WebCore::CSSSegmentedFontFace::fontRanges):
2953         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Deleted.
2954         * platform/graphics/Font.h:
2955         (WebCore::Font::widthForGlyph):
2956         * platform/graphics/FontCache.h:
2957         * platform/graphics/freetype/FontCacheFreeType.cpp:
2958         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
2959         * platform/graphics/mac/FontCacheMac.mm:
2960         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
2961         * platform/graphics/win/FontCacheWin.cpp:
2962         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
2963
2964 2017-02-16  Alex Christensen  <achristensen@webkit.org>
2965
2966         Remove EFL-specific files in Source.
2967
2968         Rubber-stamped by Anders Carlsson.
2969
2970         * editing/efl: Removed.
2971         * page/efl: Removed.
2972         * platform/audio/efl: Removed.
2973         * platform/efl: Removed.
2974         * platform/efl/DefaultTheme: Removed.
2975         * platform/efl/DefaultTheme/widget: Removed.
2976         * platform/efl/DefaultTheme/widget/button: Removed.
2977         * platform/efl/DefaultTheme/widget/check: Removed.
2978         * platform/efl/DefaultTheme/widget/combo: Removed.
2979         * platform/efl/DefaultTheme/widget/entry: Removed.
2980         * platform/efl/DefaultTheme/widget/progressbar: Removed.
2981         * platform/efl/DefaultTheme/widget/radio: Removed.
2982         * platform/efl/DefaultTheme/widget/scrollbar: Removed.
2983         * platform/efl/DefaultTheme/widget/search: Removed.
2984         * platform/efl/DefaultTheme/widget/search/cancel: Removed.
2985         * platform/efl/DefaultTheme/widget/search/decoration: Removed.
2986         * platform/efl/DefaultTheme/widget/search/field: Removed.
2987         * platform/efl/DefaultTheme/widget/slider: Removed.
2988         * platform/efl/DefaultTheme/widget/spinner: Removed.
2989         * platform/gamepad/efl: Removed.
2990         * platform/graphics/efl: Removed.
2991         * platform/graphics/surfaces/efl: Removed.
2992         * platform/network/efl: Removed.
2993
2994 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2995
2996         Add WebUSB to features.json as a "Not Considering".
2997
2998         * features.json:
2999
3000 2017-02-16  Alex Christensen  <achristensen@webkit.org>
3001
3002         Remove old URL parser
3003         https://bugs.webkit.org/show_bug.cgi?id=168483
3004
3005         Reviewed by Tim Horton.
3006
3007         * platform/URL.cpp:
3008         (WebCore::isSchemeFirstChar):
3009         (WebCore::isSchemeChar):
3010         (WebCore::URL::URL):
3011         (WebCore::URL::setProtocol):
3012         (WebCore::URL::setHost):
3013         (WebCore::URL::removePort):
3014         (WebCore::URL::setPort):
3015         (WebCore::URL::setHostAndPort):
3016         (WebCore::URL::setUser):
3017         (WebCore::URL::setPass):
3018         (WebCore::URL::setFragmentIdentifier):
3019         (WebCore::URL::setQuery):
3020         (WebCore::URL::setPath):
3021         (WebCore::URL::serialize):
3022         (WebCore::isUserInfoChar): Deleted.
3023         (WebCore::isHostnameChar): Deleted.
3024         (WebCore::isIPv6Char): Deleted.
3025         (WebCore::isPathSegmentEndChar): Deleted.
3026         (WebCore::appendASCII): Deleted.
3027         (WebCore::findFirstOf): Deleted.
3028         (WebCore::checkEncodedString): Deleted.
3029         (WebCore::URL::init): Deleted.
3030         (WebCore::appendEscapingBadChars): Deleted.
3031         (WebCore::escapeAndAppendNonHierarchicalPart): Deleted.
3032         (WebCore::copyPathRemovingDots): Deleted.
3033         (WebCore::hasSlashDotOrDotDot): Deleted.
3034         (WebCore::URL::parse): Deleted.
3035         (WebCore::cannotBeABaseURL): Deleted.
3036         (WebCore::isDefaultPortForScheme): Deleted.
3037         (WebCore::hostPortIsEmptyButCredentialsArePresent): Deleted.
3038         (WebCore::isNonFileHierarchicalScheme): Deleted.
3039         (WebCore::isCanonicalHostnameLowercaseForScheme): Deleted.
3040         (WebCore::findHostnamesInMailToURL): Deleted.
3041         (WebCore::findHostnameInHierarchicalURL): Deleted.
3042         (WebCore::encodeHostnames): Deleted.
3043         (WebCore::encodeRelativeString): Deleted.
3044         (WebCore::substituteBackslashes): Deleted.
3045         * platform/URLParser.cpp:
3046         (WebCore::URLParser::URLParser):
3047         (WebCore::URLParser::setEnabled): Deleted.
3048         (WebCore::URLParser::enabled): Deleted.
3049         * platform/URLParser.h:
3050         * platform/cf/URLCF.cpp:
3051         (WebCore::URL::URL):
3052         * platform/mac/URLMac.mm:
3053         (WebCore::URL::URL):
3054
3055 2017-02-16  Anders Carlsson  <andersca@apple.com>
3056
3057         Build fixes.
3058
3059         * page/gtk/EventHandlerGtk.cpp:
3060         (WebCore::EventHandler::createDraggingDataTransfer):
3061         * page/win/EventHandlerWin.cpp:
3062         (WebCore::EventHandler::createDraggingDataTransfer):
3063
3064 2017-02-16  Anders Carlsson  <andersca@apple.com>
3065
3066         Remove EFL from WebCore
3067         https://bugs.webkit.org/show_bug.cgi?id=168477
3068
3069         Reviewed by Brian Burg.
3070
3071         * accessibility/AccessibilityList.cpp:
3072         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
3073         * accessibility/AccessibilityNodeObject.cpp:
3074         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
3075         * accessibility/AccessibilityObject.cpp:
3076         (WebCore::AccessibilityObject::AccessibilityObject):
3077         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
3078         * accessibility/AccessibilityObject.h:
3079         * accessibility/AccessibilityRenderObject.cpp:
3080         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3081         * accessibility/AccessibilityTableColumn.cpp:
3082         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
3083         * accessibility/AccessibilityTableHeaderContainer.cpp:
3084         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
3085         * crypto/CryptoKey.cpp:
3086         * crypto/keys/CryptoKeyRSA.h:
3087         * dom/Document.cpp:
3088         (WebCore::Document::implicitClose):
3089         * editing/Editor.cpp:
3090         (WebCore::Editor::performCutOrCopy):
3091         (WebCore::Editor::copyImage):
3092         * editing/Editor.h:
3093         * editing/FrameSelection.h:
3094         * html/HTMLCanvasElement.cpp:
3095         (WebCore::requiresAcceleratedCompositingForWebGL):
3096         * inspector/InspectorFrontendHost.cpp:
3097         (WebCore::InspectorFrontendHost::port):
3098         * loader/HistoryController.cpp:
3099         (WebCore::HistoryController::restoreScrollPositionAndViewState):
3100         * loader/icon/IconDatabase.cpp:
3101         (WebCore::IconDatabase::performURLImport):
3102         * page/ContextMenuController.cpp:
3103         (WebCore::ContextMenuController::contextMenuItemSelected):
3104         (WebCore::ContextMenuController::populate):
3105         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
3106         * page/DragController.cpp:
3107         (WebCore::DragController::startDrag):
3108         * page/EventHandler.cpp:
3109         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
3110         * page/FrameView.cpp:
3111         (WebCore::FrameView::layout):
3112         * platform/ContextMenuItem.h:
3113         * platform/Cursor.h:
3114         * platform/DragData.h:
3115         * platform/DragImage.h:
3116         * platform/FileSystem.h:
3117         * platform/LocalizedStrings.h:
3118         * platform/MIMETypeRegistry.cpp:
3119         (WebCore::initializeSupportedImageMIMETypesForEncoding):
3120         * platform/NotImplemented.h:
3121         * platform/Pasteboard.h:
3122         * platform/PlatformKeyboardEvent.h:
3123         * platform/PlatformMouseEvent.h:
3124         * platform/PlatformSpeechSynthesizer.h:
3125         * platform/PlatformWheelEvent.h:
3126         * platform/Widget.h:
3127         * platform/graphics/ANGLEWebKitBridge.h:
3128         * platform/graphics/BitmapImage.h:
3129         * platform/graphics/GraphicsContext3D.h:
3130         * platform/graphics/Icon.h:
3131         * platform/graphics/Image.h:
3132         (WebCore::Image::getEvasObject): Deleted.
3133         * platform/graphics/IntPoint.h:
3134         * platform/graphics/IntRect.h:
3135         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3136         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
3137         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
3138         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
3139         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
3140         (WebCore::Extensions3DOpenGL::supportsExtension):
3141         * platform/graphics/opengl/Extensions3DOpenGL.h:
3142         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3143         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3144         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3145         (WebCore::GraphicsContext3D::createForCurrentGLContext):
3146         (WebCore::GraphicsContext3D::reshape):
3147         (WebCore::GraphicsContext3D::createVertexArray):
3148         (WebCore::GraphicsContext3D::deleteVertexArray):
3149         (WebCore::GraphicsContext3D::isVertexArray):
3150         (WebCore::GraphicsContext3D::bindVertexArray):
3151         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
3152         * platform/network/NetworkStateNotifier.h:
3153         * platform/posix/FileSystemPOSIX.cpp:
3154         * rendering/RenderLayerCompositor.cpp:
3155         (WebCore::RenderLayerCompositor::ensureRootLayer):
3156         * rendering/RenderText.cpp:
3157         (WebCore::RenderText::previousOffsetForBackwardDeletion):
3158         * xml/XSLStyleSheetLibxslt.cpp:
3159         * xml/XSLTExtensions.cpp:
3160         * xml/XSLTProcessorLibxslt.cpp:
3161         * xml/XSLTUnicodeSort.cpp:
3162
3163 2017-02-16  Zalan Bujtas  <zalan@apple.com>
3164
3165         Simple line layout: Add forced line layout info to coverage print.
3166         https://bugs.webkit.org/show_bug.cgi?id=168470
3167
3168         Reviewed by Simon Fraser.
3169
3170         This is about potential vs. actual coverage:
3171
3172         Simple line layout potential coverage: 65.05%
3173         Simple line layout actual coverage: 46.60%
3174         Forced line layout blocks: 4 content length: 57(18.45%)
3175
3176         Not testable.
3177
3178         * rendering/SimpleLineLayout.cpp:
3179         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
3180
3181 2017-02-16  Anders Carlsson  <andersca@apple.com>
3182
3183         Rename DataTransfer functions to indicate whether they are for dragging or dropping
3184         https://bugs.webkit.org/show_bug.cgi?id=168478
3185
3186         Reviewed by Tim Horton.
3187
3188         * dom/DataTransfer.cpp:
3189         (WebCore::DataTransfer::createForDrag):
3190         (WebCore::DataTransfer::createForDrop):
3191         (WebCore::DataTransfer::createForDragAndDrop): Deleted.
3192         * dom/DataTransfer.h:
3193         * page/DragController.cpp:
3194         (WebCore::DragController::dragExited):
3195         (WebCore::DragController::performDragOperation):
3196         (WebCore::DragController::tryDHTMLDrag):
3197         * page/mac/EventHandlerMac.mm:
3198         (WebCore::EventHandler::createDraggingDataTransfer):
3199
3200 2017-02-16  Anders Carlsson  <andersca@apple.com>
3201
3202         Rename EventHandler::freeDataTransfer to invalidateDataTransfer
3203         https://bugs.webkit.org/show_bug.cgi?id=168472
3204
3205         Reviewed by Tim Horton.
3206
3207         The code doesn't necessarily free the data transfer object, so rename the member function
3208         to reflect that. Also, get rid of a goto.
3209
3210         * page/EventHandler.cpp:
3211         (WebCore::EventHandler::invalidateDataTransfer):
3212         (WebCore::EventHandler::dragSourceEndedAt):
3213         (WebCore::EventHandler::handleDrag):
3214         (WebCore::EventHandler::freeDataTransfer): Deleted.
3215         * page/EventHandler.h:
3216
3217 2017-02-16  Alex Christensen  <achristensen@webkit.org>
3218
3219         Special URLs without a host are invalid
3220         https://bugs.webkit.org/show_bug.cgi?id=168461
3221
3222         Reviewed by Tim Horton.
3223
3224         http://? should be invalid.  This matches Chrome and the spec and the intent of my implementation
3225         of URLParser which already fails with urls like http:// and this was just an oversight.
3226         Covered by newly passing web platform tests.  Updated API tests.
3227
3228         * platform/URLParser.cpp:
3229         (WebCore::URLParser::parse):
3230
3231 2017-02-16  Zalan Bujtas  <zalan@apple.com>
3232
3233         Simple line layout: Add support for pagination.
3234         https://bugs.webkit.org/show_bug.cgi?id=168355
3235         <rdar://problem/30119769>
3236
3237         Reviewed by David Hyatt.
3238
3239         This patch adds basic support for paginated content including widows and orphans.
3240
3241         This is based on the normal line layout pagination logic. However there are 2 major
3242         advantages here (and they allow us to have a much simpler logic):
3243         1. all the lines are positioned by the time we start paginating them and
3244         2. lines always have uniform heights. 
3245
3246         This is not enabled yet.
3247
3248         * rendering/RenderBlockFlow.h:
3249         * rendering/SimpleLineLayout.cpp:
3250         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
3251         (WebCore::SimpleLineLayout::computeLineBreakIndex):
3252         (WebCore::SimpleLineLayout::setPageBreakForLine):
3253         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
3254         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
3255         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
3256         (WebCore::SimpleLineLayout::create):
3257         (WebCore::SimpleLineLayout::Layout::create):
3258         (WebCore::SimpleLineLayout::Layout::Layout):
3259         * rendering/SimpleLineLayout.h:
3260         (WebCore::SimpleLineLayout::Layout::isPaginated):
3261         (WebCore::SimpleLineLayout::Layout::struts):
3262         * rendering/SimpleLineLayoutFunctions.h:
3263         (WebCore::SimpleLineLayout::computeFlowHeight):
3264         * rendering/SimpleLineLayoutResolver.h:
3265         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
3266
3267 2017-02-11  Filip Pizlo  <fpizlo@apple.com>
3268
3269         The collector thread should only start when the mutator doesn't have heap access
3270         https://bugs.webkit.org/show_bug.cgi?id=167737
3271
3272         Reviewed by Keith Miller.
3273
3274         Added new tests in JSTests and LayoutTests.
3275         
3276         The WebCore changes involve:
3277         
3278         - Refactoring around new header discipline.
3279         
3280         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
3281
3282         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
3283         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
3284         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
3285         * ForwardingHeaders/heap/RunningScope.h: Added.
3286         * bindings/js/CommonVM.cpp:
3287         * testing/Internals.cpp:
3288         (WebCore::Internals::parserMetaData):
3289         (WebCore::Internals::isReadableStreamDisturbed):
3290         (WebCore::Internals::isGCRunning):
3291         (WebCore::Internals::addGCFinalizationCallback):
3292         (WebCore::Internals::stopSweeping):
3293         (WebCore::Internals::startSweeping):
3294         * testing/Internals.h:
3295         * testing/Internals.idl:
3296
3297 2017-02-16  Jiewen Tan  <jiewen_tan@apple.com>
3298
3299         [WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
3300         https://bugs.webkit.org/show_bug.cgi?id=167026
3301
3302         Reviewed by Chris Dumez.
3303
3304         Covered by existing tests.
3305
3306         * bindings/js/JSSubtleCryptoCustom.cpp:
3307         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
3308         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
3309         (WebCore::toJSValueFromJsonWebKey): Deleted.
3310         * crypto/JsonWebKey.h:
3311         * crypto/JsonWebKey.idl:
3312         * crypto/RsaOtherPrimesInfo.idl:
3313         Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
3314         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3315         (WebCore::CryptoAlgorithmAES_CBC::importKey):
3316         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
3317         (WebCore::CryptoAlgorithmAES_KW::importKey):
3318         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3319         (WebCore::CryptoAlgorithmHMAC::importKey):
3320         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3321         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
3322         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3323         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
3324         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3325         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
3326         * crypto/keys/CryptoKeyAES.cpp:
3327         (WebCore::CryptoKeyAES::importJwk):
3328         Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
3329         as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
3330         * crypto/keys/CryptoKeyAES.h:
3331         * crypto/keys/CryptoKeyHMAC.cpp:
3332         (WebCore::CryptoKeyHMAC::importJwk):
3333         * crypto/keys/CryptoKeyHMAC.h:
3334         * crypto/keys/CryptoKeyRSA.cpp:
3335         (WebCore::CryptoKeyRSA::importJwk):
3336         Accommodate the change from std::optional<String> to String.
3337         * crypto/mac/CryptoKeyRSAMac.cpp:
3338         (WebCore::CryptoKeyRSA::create):
3339         Add a null check for p.
3340
3341 2017-02-16  Antti Koivisto  <antti@apple.com>
3342
3343         Execute pending scripts asynchronously after stylesheet loads complete
3344         https://bugs.webkit.org/show_bug.cgi?id=168367
3345         rdar://problem/30561379
3346
3347         Reviewed by Andreas Kling.
3348
3349         The current synchronous execution is fragile and creates various problems.
3350
3351         * css/StyleSheetContents.cpp:
3352         (WebCore::StyleSheetContents::checkLoaded):
3353         * dom/ContainerNode.cpp:
3354         (WebCore::ContainerNode::takeAllChildrenFrom):
3355         (WebCore::ContainerNode::notifyChildInserted):
3356         (WebCore::ContainerNode::removeChild):
3357         (WebCore::ContainerNode::parserRemoveChild):
3358         (WebCore::ContainerNode::removeChildren):
3359
3360             Remove various places where we would trigger delayed synchronous execution.
3361
3362         * dom/Document.cpp:
3363         (WebCore::Document::Document):
3364         (WebCore::Document::recalcStyle):
3365
3366             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
3367
3368         (WebCore::Document::didRemoveAllPendingStylesheet):
3369
3370             Call asynchronous script execution function.
3371
3372         * dom/Document.h:
3373         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
3374         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
3375         * dom/ScriptableDocumentParser.cpp:
3376         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
3377         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
3378         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
3379
3380             Add a timer for executing pending scripts.
3381
3382         (WebCore::ScriptableDocumentParser::detach):
3383         * dom/ScriptableDocumentParser.h:
3384         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
3385         * html/HTMLLinkElement.cpp:
3386         (WebCore::HTMLLinkElement::removedFrom):
3387         (WebCore::HTMLLinkElement::removePendingSheet):
3388         * html/HTMLLinkElement.h:
3389         * html/parser/HTMLDocumentParser.cpp:
3390         (WebCore::HTMLDocumentParser::detach):
3391         * loader/DocumentLoader.cpp:
3392         (WebCore::DocumentLoader::isLoadingInAPISense):
3393
3394             Stay in loading state if we have a pending script. This matches existing behavior.
3395
3396         * style/StyleScope.cpp:
3397         (WebCore::Style::Scope::removePendingSheet):
3398         * style/StyleScope.h:
3399
3400 2017-02-16  Anders Carlsson  <andersca@apple.com>
3401
3402         Set the DHTML drag image in the DHTML type check
3403         https://bugs.webkit.org/show_bug.cgi?id=168451
3404
3405         Reviewed by Wenson Hsieh.
3406
3407         * page/DragController.cpp:
3408         (WebCore::DragController::startDrag):
3409
3410 2017-02-16  Anders Carlsson  <andersca@apple.com>
3411
3412         Begin removing EFL code from WebCore.
3413
3414         Rubber-stamped by Alex Christensen.
3415
3416         * PlatformEfl.cmake: Removed.
3417         * editing/efl/EditorEfl.cpp: Removed.
3418         * page/efl/DragControllerEfl.cpp: Removed.
3419         * page/efl/EventHandlerEfl.cpp: Removed.
3420         * platform/audio/efl/AudioBusEfl.cpp: Removed.
3421         * platform/efl/CursorEfl.cpp: Removed.
3422         * platform/efl/DefaultTheme/CMakeLists.txt: Removed.
3423         * platform/efl/DefaultTheme/default.edc: Removed.
3424         * platform/efl/DefaultTheme/widget/button/button.edc: Removed.
3425         * platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
3426         * platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
3427         * platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
3428         * platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
3429         * platform/efl/DefaultTheme/widget/check/check.edc: Removed.
3430         * platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
3431         * platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
3432         * platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
3433         * platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
3434         * platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.