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