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