An SVG element without intrinsic size inherits the container size as its viewport...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2
3         An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport.
4         https://bugs.webkit.org/show_bug.cgi?id=141725.
5
6         Reviewed by Darin Adler.
7
8         The current viewport of the <svg> element should be retrieved from its
9         renderer if the renderer is available. If the renderer is not created yet,
10         this means the viewport is needed to calculate the size of the renderer.
11         In this case, we should return the element size if it is intrinsic size.
12         
13         Test: svg/css/svg-css-different-intrinsic-sizes.html
14
15         * svg/SVGSVGElement.cpp:
16         (WebCore::SVGSVGElement::currentViewportSize): Change the order for
17         returning the viewport of the <svg> element. We should consider the case
18         of a valid renderer before considering the case of an intrinsic size.
19
20 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
21
22         Allow composited clip-path to be updated without a layer repaint
23         https://bugs.webkit.org/show_bug.cgi?id=142384
24
25         Reviewed by Zalan Bujtas.
26         
27         When clip-path is mapped to a compositing shape layer mask, we can just
28         push a new shape to the GraphicsLayer to update the clip path, without
29         needing to repaint.
30         
31         Achieve this by adding ContextSensitivePropertyClipPath. When set, and the
32         stars are aligned, issue a StyleDifferenceRecompositeLayer rather than
33         a StyleDifferenceRepaint.
34         
35         We ask RenderLayerCompositor whether the clip path can be composited
36         to hide platform differences related to whether GraphicsLayer supports
37         shape masks.
38
39         Test: compositing/masks/compositing-clip-path-change-no-repaint.html
40
41         * rendering/RenderElement.cpp:
42         (WebCore::RenderElement::adjustStyleDifference): Remove obvious comment
43         about opacity. Handle ContextSensitivePropertyClipPath.
44         * rendering/RenderLayerCompositor.cpp:
45         (WebCore::RenderLayerCompositor::canCompositeClipPath): If we have a mask
46         we have to paint the mask + clip path into the mask layer (mirrors code in
47         RenderLayerBacking::updateMaskingLayer but isn't quite similar enough to share).
48         * rendering/RenderLayerCompositor.h:
49         * rendering/style/RenderStyle.cpp:
50         (WebCore::RenderStyle::changeRequiresRepaint): Set ContextSensitivePropertyClipPath
51         and don't return, as is normal for context-sensitive property handling.
52         * rendering/style/RenderStyleConstants.h: Line things up to avoid future bit
53         fumbles, and remove unnecessary braces.
54
55 2015-03-06  Alex Christensen  <achristensen@webkit.org>
56
57         [Content Extensions] Process all actions when blocking a URL.
58         https://bugs.webkit.org/show_bug.cgi?id=142363
59
60         Reviewed by Darin Adler.
61
62         This can only be tested once we implement css selectors.
63
64         * contentextensions/ContentExtensionsBackend.cpp:
65         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
66         Do not return early when adding a block action.
67         * loader/cache/CachedResourceLoader.cpp:
68         (WebCore::CachedResourceLoader::requestResource):
69         Process all actions before returning.
70
71 2015-03-05  Darin Adler  <darin@apple.com>
72
73         Make JavaScript binding get and set legacy event listener attributes directly
74         https://bugs.webkit.org/show_bug.cgi?id=142282
75
76         Reviewed by Antti Koivisto.
77
78         Test: fast/dom/legacy-event-handler-attributes.html
79
80         This patch changes the JavaScript getters and setters for these attributes
81         to work directly without requiring any functions in the C++ DOM implementation.
82         A subsequent patch will remove the now-unused C++ DOM implementation.
83
84         * Modules/webaudio/AudioScheduledSourceNode.cpp:
85         (WebCore::AudioScheduledSourceNode::setOnended): Remove code to set
86         m_hasEndedListener; this was incorrect since it only detected event listeners
87         set up with the event handler attribute, not with addEventListener.
88         (WebCore::AudioScheduledSourceNode::addEventListener): Added code to update
89         m_hasEndedListener after making changes to the event listeners.
90         (WebCore::AudioScheduledSourceNode::removeEventListener): Ditto.
91         (WebCore::AudioScheduledSourceNode::removeAllEventListeners): Ditto.
92         * Modules/webaudio/AudioScheduledSourceNode.h: Added above overrides.
93
94         * Modules/webaudio/ScriptProcessorNode.cpp:
95         (WebCore::ScriptProcessorNode::setOnaudioprocess): Remove code to set
96         m_hasAudioProcessListener; this was incorrect since it only detected event listeners
97         set up with the event handler attribute, not with addEventListener.
98         (WebCore::ScriptProcessorNode::addEventListener): Added code to update
99         m_hasAudioProcessListener after making changes to the event listeners.
100         (WebCore::ScriptProcessorNode::removeEventListener): Ditto.
101         (WebCore::ScriptProcessorNode::removeAllEventListeners): Ditto.
102         * Modules/webaudio/ScriptProcessorNode.h: Added above overrides.
103
104         * bindings/js/JSEventListener.cpp:
105         (WebCore::legacyEventListenerAttribute): Added.
106         (WebCore::createEventListenerForLegacyAttribute): Added.
107         (WebCore::setLegacyEventListenerAttribute): Added.
108         (WebCore::legacyWindowEventListenerAttribute): Added.
109         (WebCore::setLegacyWindowEventListenerAttribute): Added.
110
111         * bindings/js/JSEventListener.h:
112         (WebCore::createJSEventListenerForAttribute): Deleted.
113
114         * bindings/scripts/CodeGeneratorJS.pm:
115         (GenerateAttributeEventListenerCall): Deleted.
116         (LegacyEventListenerAttributeEventName): Added.
117         (LegacyEventListenerAttributePrefix): Added.
118         (GenerateImplementation): Use "auto" in lots of places to simplify the code
119         generation. Replaced the old inlined code to deal with legacy event listener
120         attributes with code that simply calls the new functions from JSEventLister.h.
121         (GenerateCallWith): Use "auto".
122         (GenerateConstructorDefinition): Ditto.
123
124         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated expected
125         results since these now use auto.
126         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
127         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Ditto.
128         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
129         * bindings/scripts/test/JS/JSTestException.cpp: Ditto.
130         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Ditto.
131         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
132         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
133         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
134         * bindings/scripts/test/JS/JSTestNode.cpp: Ditto.
135         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
136         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
137         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
138         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
139         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
140         * bindings/scripts/test/JS/JSattribute.cpp: Ditto.
141         * bindings/scripts/test/JS/JSreadonly.cpp: Ditto.
142
143         * dom/MessagePort.cpp:
144         (WebCore::MessagePort::addEventListener): Moved logic that calls the start
145         function in here from setOnmessage, since the latter will no longer be called.
146         * dom/MessagePort.h: Ditto.
147
148 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
149
150         [iOS] SVG fonts are garbled
151         https://bugs.webkit.org/show_bug.cgi?id=142377
152
153         Reviewed by Simon Fraser.
154
155         The C++ spec says that casting a negative floating point number to
156         an unsigned integer is undefined. Instead, use clamping.
157
158         Covered by existing SVG font tests.
159
160         * Configurations/FeatureDefines.xcconfig:
161         * svg/SVGToOTFFontConversion.cpp:
162         (WebCore::writeCFFEncodedNumber):
163
164 2015-03-06  Commit Queue  <commit-queue@webkit.org>
165
166         Unreviewed, rolling out r181139.
167         https://bugs.webkit.org/show_bug.cgi?id=142394
168
169         "Caused many crashes in API tests and layout tests in Debug
170         builds on bots." (Requested by ddkilzer on #webkit).
171
172         Reverted changeset:
173
174         "Allow tree dumping functions to be used in release builds by
175         switching a flag"
176         https://bugs.webkit.org/show_bug.cgi?id=142379
177         http://trac.webkit.org/changeset/181139
178
179 2015-03-05  Philippe Normand  <pnormand@igalia.com>
180
181         [MediaStream] new load method for MediaStreamPrivate objects
182         https://bugs.webkit.org/show_bug.cgi?id=142346
183
184         Reviewed by Eric Carlson.
185
186         No new tests, existing mediastream tests cover this use-case.
187
188         * html/HTMLMediaElement.cpp:
189         (WebCore::HTMLMediaElement::loadResource): Use new load method for MediaStreams.
190         * platform/graphics/MediaPlayer.cpp:
191         (WebCore::NullMediaPlayerPrivate::load): New stub.
192         (WebCore::MediaPlayer::load): New load method for
193         MediaStreamPrivate.
194         (WebCore::MediaPlayer::nextBestMediaEngine): Set a new boolean on
195         the MediaEngineSupportParameters to differenciate with MSE and
196         normal video resources.
197         (WebCore::MediaPlayer::loadWithNextMediaEngine): Defer loading of
198         the MediaStream to the MediaPlayerPrivate backend.
199         * platform/graphics/MediaPlayer.h:
200         (WebCore::MediaEngineSupportParameters::MediaEngineSupportParameters):
201         * platform/graphics/MediaPlayerPrivate.h:
202         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
203         (WebCore::MediaPlayerPrivateAVFoundation::load): New empty load
204         method for MediaStreamPrivate objects.
205         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
206         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto.
207         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
208         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
209         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
210         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
211         (WebCore::MediaPlayerPrivateQTKit::load): Ditto.
212         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
213
214 2015-03-05  Philippe Normand  <pnormand@igalia.com>
215
216         Rename MediaStreamSource to RealtimeMediaSource
217         https://bugs.webkit.org/show_bug.cgi?id=142330
218
219         Reviewed by Eric Carlson.
220
221         MediaStreamSource is a misleading name, it's not the source of a
222         MediaStream.
223
224         The chain from high level to low level is: MediaStream -
225         MediaStreamTrack - MediaStreamTrackPrivate - RealTimeMediaSource
226         and a MediaStream can contains several MediaStreamTrack objects of
227         different types.
228
229         MediaStreamSourceStates was also renamed to
230         RealtimeMediaSourceStates, and MediaStreamSourceCapabilities to
231         RealtimeMediaSourceCapabilities, for consistency.
232
233 2015-03-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
234
235         Unreviewed WinCairo port build fix since r181136.
236
237         * platform/network/curl/ResourceRequest.h:
238         (WebCore::ResourceRequest::doPlatformAdopt): Missing ":" in std::unique_ptr.
239
240 2015-03-06  David Kilzer  <ddkilzer@apple.com>
241
242         Rename SOFT_LINK_{CONSTANT,FUNCTION}_{HEADER,SOURCE} to SOFT_LINK_{CONSTANT,FUNCTION}_FOR_{HEADER,SOURCE}
243         <http://webkit.org/b/142177>
244
245         Reviewed by Alex Christensen.
246
247         * platform/cf/CoreMediaSoftLink.cpp:
248         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_SOURCE() to
249           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_SOURCE().
250         * platform/cf/CoreMediaSoftLink.h:
251         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_HEADER() to
252           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_HEADER().
253
254         * platform/mac/SoftLinking.h:
255         * platform/win/SoftLinking.h:
256         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_{HEADER,SOURCE}() to
257           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_{HEADER,SOURCE}().
258
259 2015-03-06  Sergio Villar Senin  <svillar@igalia.com>
260
261         [CSS Grid Layout] ASSERTION FAILED !track.growthLimitIsInfinite() in RenderGrid::computeUsedBreadthOfGridTracks
262         https://bugs.webkit.org/show_bug.cgi?id=142265
263
264         Reviewed by Darin Adler.
265
266          The problem is that computeUsedBreadthOfGridTracks() could return
267         -1 for rows because we're calling computeContentLogicalHeight()
268         which can indeed return -1. In those cases we should clamp the
269         value to 0 the same as Flexbox does otherwise we could end up with
270         a negative value in the min track sizing function.
271
272         Test: fast/css-grid-layout/grid-indefinite-calculated-height-crash.html
273
274         * rendering/RenderGrid.cpp:
275         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
276
277 2015-03-05  Simon Fraser  <simon.fraser@apple.com>
278
279         Allow tree dumping functions to be used in release builds by switching a flag
280         https://bugs.webkit.org/show_bug.cgi?id=142379
281
282         Reviewed by Zalan Bujtas.
283
284         There are various tree dumping functions that are useful for debugging, and sometimes
285         you want to be able to use them in release builds. Currently they are surrounded by
286         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
287         in config.h
288
289         * config.h:
290         * dom/DocumentMarkerController.cpp:
291         * dom/DocumentMarkerController.h:
292         * dom/Element.cpp:
293         * dom/Element.h:
294         * dom/Node.cpp:
295         * dom/Node.h:
296         * dom/Position.cpp: Position::debugPosition(const char* msg) was available in release builds, but this changes
297         is to respect ENABLE_TREE_DEBUGGING, which I think is correct.
298         * dom/Position.h:
299         * dom/Range.cpp:
300         * dom/Range.h:
301         * dom/Text.cpp:
302         * dom/Text.h:
303         * rendering/CounterNode.cpp:
304         * rendering/CounterNode.h:
305         * rendering/InlineBox.cpp:
306         * rendering/InlineBox.h:
307         * rendering/InlineFlowBox.cpp:
308         * rendering/InlineFlowBox.h:
309         * rendering/InlineTextBox.cpp:
310         * rendering/InlineTextBox.h:
311         * rendering/RenderBlockFlow.cpp:
312         * rendering/RenderBlockFlow.h:
313         * rendering/RenderCounter.cpp:
314         * rendering/RenderCounter.h:
315         * rendering/RenderLayer.cpp:
316         * rendering/RenderLayer.h:
317         * rendering/RenderLayerBacking.cpp:
318         (WebCore::RenderLayerBacking::createGraphicsLayer):
319         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
320         (WebCore::RenderLayerBacking::updateForegroundLayer):
321         (WebCore::RenderLayerBacking::updateBackgroundLayer):
322         * rendering/RenderLayerCompositor.cpp:
323         (WebCore::CompositingState::CompositingState):
324         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
325         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
326         (WebCore::RenderLayerCompositor::updateLayerForHeader):
327         (WebCore::RenderLayerCompositor::updateLayerForFooter):
328         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
329         (WebCore::RenderLayerCompositor::ensureRootLayer):
330         * rendering/RenderObject.cpp:
331         * rendering/RenderObject.h: showTreeCharacterOffset was unused.
332         * rendering/RootInlineBox.cpp:
333         * rendering/RootInlineBox.h:
334         * rendering/SimpleLineLayoutFunctions.cpp:
335         * rendering/SimpleLineLayoutFunctions.h:
336         * rendering/svg/SVGResources.cpp:
337         * rendering/svg/SVGResources.h:
338
339 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
340
341         [Mac] 'Gliding' phase of scroll snap points is incorrect on desktop
342         https://bugs.webkit.org/show_bug.cgi?id=142351
343         <rdar://problem/20058023>
344
345         Reviewed by Dean Jackson.
346
347         This problem was caused by incorrectly starting a new snapping animation timer when the
348         "end momentum" phase event had been received. This caused WebKit to recalculate the
349         animation curve for the remaining distance, resulting in the bad animation behavior.
350
351         Removing this incorrect start animation command when entering the momentum ended state
352         resolves the problem.
353
354         * platform/cocoa/ScrollController.mm:
355         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Remove the command to
356         start a new snap animation when entering the "end momentum" state.
357
358 2015-03-05  Joonghun Park  <jh718.park@samsung.com>
359
360         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceRequest
361         https://bugs.webkit.org/show_bug.cgi?id=142349
362
363         Reviewed by Darin Adler.
364
365         No new tests, no behavior changes.
366
367         * loader/WorkerThreadableLoader.cpp:
368         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
369         * loader/cache/MemoryCache.cpp:
370         (WebCore::MemoryCache::removeRequestFromSessionCaches):
371         * platform/CrossThreadCopier.h:
372         * platform/network/ResourceRequestBase.cpp:
373         (WebCore::ResourceRequestBase::adopt):
374         (WebCore::ResourceRequestBase::copyData):
375         * platform/network/ResourceRequestBase.h:
376         * platform/network/cf/ResourceRequest.h:
377         * platform/network/cf/ResourceRequestCFNet.cpp:
378         (WebCore::ResourceRequest::doPlatformCopyData):
379         (WebCore::ResourceRequest::doPlatformAdopt):
380         * platform/network/curl/ResourceRequest.h:
381         (WebCore::ResourceRequest::doPlatformCopyData):
382         (WebCore::ResourceRequest::doPlatformAdopt):
383         * platform/network/soup/ResourceRequest.h:
384         (WebCore::ResourceRequest::doPlatformCopyData):
385         (WebCore::ResourceRequest::doPlatformAdopt):
386
387 2015-03-05  Oliver Hunt  <oliver@apple.com>
388
389         Block mixed mode content
390         https://bugs.webkit.org/show_bug.cgi?id=142378
391
392         Reviewed by Darin Adler.
393
394         Switched to blocking mixed mode content by default,
395         and modify the blocking rules to allow us to match
396         the behaviours of other browsers.
397
398         * loader/DocumentLoader.cpp:
399         (WebCore::DocumentLoader::willSendRequest):
400         * loader/MixedContentChecker.cpp:
401         (WebCore::MixedContentChecker::canDisplayInsecureContent):
402         (WebCore::MixedContentChecker::canRunInsecureContent):
403         (WebCore::MixedContentChecker::logWarning):
404         * loader/MixedContentChecker.h:
405         * loader/cache/CachedResourceLoader.cpp:
406         (WebCore::contentTypeFromResourceType):
407         (WebCore::CachedResourceLoader::checkInsecureContent):
408         * page/Settings.in:
409
410 2015-03-05  Chris Dumez  <cdumez@apple.com>
411
412         Document::recalcStyle() shouldn't call viewportContentsChanged() if there is a pending layout
413         https://bugs.webkit.org/show_bug.cgi?id=142140
414
415         Reviewed by Darin Adler.
416
417         Stop calling FrameView::viewportContentsChanged() in Document::recalcStyle()
418         if there is a layout pending to avoid doing unncessary work. If there is a
419         layout pending, we don't need to do anything because viewportContentsChanged()
420         will be called after layout.
421
422         We only need to call FrameView::viewportContentsChanged() in
423         Document::recalcStyle() if a style recalc does not cause a layout. For e.g.
424         a '-webkit-transform' could make an animated GIF visible without causing a
425         layout, in which case we need to resume the animated GIF after style recalc.
426
427         No new tests, already covered by:
428         fast/images/animated-gif-webkit-transform.html
429
430         * dom/Document.cpp:
431         (WebCore::Document::recalcStyle):
432
433 2015-03-05  Dean Jackson  <dino@apple.com>
434
435         [iOS Media] Web video on iPad appears black and missing the AirPlay placard when connected to an AirPlay route
436         https://bugs.webkit.org/show_bug.cgi?id=142373
437         <rdar://problem/19866072>
438
439         Reviewed by Brent Fulgham.
440
441         There was no style for the placard, which meant it had
442         zero height (and thus was invisible).
443
444         * Modules/mediacontrols/mediaControlsiOS.css:
445         (audio::-webkit-media-controls-wireless-playback-status): Added.
446         (audio::-webkit-media-controls-wireless-playback-status.hidden):
447
448 2015-03-05  Roger Fong  <roger_fong@apple.com>
449
450         Adjust volume box to not intersect with rest of inline media controls on OSX.
451         https://bugs.webkit.org/show_bug.cgi?id=142372.
452         <rdar://problem/20064327>
453
454         Reviewed by Brent Fulgham.
455
456         * Modules/mediacontrols/mediaControlsApple.css:
457         (audio::-webkit-media-controls-panel .volume-box):
458         (audio::-webkit-media-controls-panel .volume-box:active):
459
460 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
461
462         <attachment> should allow the title property to override its title
463         https://bugs.webkit.org/show_bug.cgi?id=142369
464
465         Reviewed by Anders Carlsson.
466
467         Test: fast/attachment/attachment-title.html
468
469         * html/HTMLAttachmentElement.cpp:
470         (WebCore::HTMLAttachmentElement::parseAttribute):
471         Invalidate the attachment if the title changes.
472
473         (WebCore::HTMLAttachmentElement::attachmentTitle):
474         Use the title attribute for the title, unless it's empty, in which
475         case we'll use the file's name.
476
477         * html/HTMLAttachmentElement.h:
478         * rendering/RenderThemeMac.mm:
479         (WebCore::AttachmentLayout::layOutTitle):
480         Use attachmentTitle() instead of reaching into the file. Also rename
481         some things from filename to title.
482
483 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
484
485         Two text carets result when dragging a file into a contentEditable area that preventDefault()s the "drop" event
486         https://bugs.webkit.org/show_bug.cgi?id=142362
487         <rdar://problem/20046434>
488
489         Reviewed by Simon Fraser.
490
491         * page/DragController.h:
492         * page/DragController.cpp:
493         (WebCore::DragController::clearDragCaret):
494         Rename cancelDrag to clearDragCaret, since that's really what it does.
495
496         (WebCore::DragController::tryDocumentDrag):
497         When updating the drag position, if we're now over a <input type="file">,
498         clear the drag caret. This avoids leaving a caret behind when dragging
499         over a <input type="file"> inside a contentEditable area.
500
501         (WebCore::DragController::performDragOperation):
502         When the content preventDefault()s while finishing a drag, we should still
503         clear the drag caret, because it's possible that the client did not
504         preventDefault() on dragover/etc., so we would have set a cursor, and
505         now need to clear it so that it doesn't get left behind.
506
507         (WebCore::DragController::mouseMovedIntoDocument):
508         (WebCore::DragController::dragEnteredOrUpdated):
509         (WebCore::DragController::concludeEditDrag):
510         Adjust to renamed clearDragCaret.
511
512         (WebCore::DragController::dragEnded):
513         Make use of clearDragCaret (which is equivalent to this line).
514
515 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
516
517         <attachment> should support indication of download progress
518         https://bugs.webkit.org/show_bug.cgi?id=142336
519         <rdar://problem/19982504>
520
521         Reviewed by Anders Carlsson.
522
523         * html/HTMLAttachmentElement.cpp:
524         (WebCore::HTMLAttachmentElement::parseAttribute):
525         Invalidate the attachment if the progress attribute changes.
526
527         * platform/graphics/FloatRoundedRect.h:
528         (WebCore::FloatRoundedRect::Radii::Radii):
529         Add a Radii constructor that takes a single argument that is used
530         as the radius for all corners, for convenience.
531
532         * rendering/RenderThemeMac.mm:
533         (WebCore::attachmentProgressBarBackgroundColor):
534         (WebCore::attachmentProgressBarFillColor):
535         (WebCore::attachmentProgressBarBorderColor):
536         Add a bunch of constants for the progress bar.
537
538         (WebCore::paintAttachmentIconBackground):
539         Make use of fillRoundedRect instead of creating a path.
540
541         (WebCore::paintAttachmentProgress):
542         (WebCore::RenderThemeMac::paintAttachment):
543         Paint a progress bar if the progress attribute exists and
544         is a valid floating point number.
545
546 2015-03-05  Commit Queue  <commit-queue@webkit.org>
547
548         Unreviewed, rolling out r180846.
549         https://bugs.webkit.org/show_bug.cgi?id=142368
550
551         Caused missing image banners in iTunes store pages (Requested
552         by smfr on #webkit).
553
554         Reverted changeset:
555
556         "FrameView::layoutTimerFired() should update style if needed
557         before doing layout"
558         https://bugs.webkit.org/show_bug.cgi?id=141688
559         http://trac.webkit.org/changeset/180846
560
561 2015-03-05  Sandy Perez  <sperez@indaba.es>
562
563         Fix the build when NEON_INTRINSICS is enabled
564         https://bugs.webkit.org/show_bug.cgi?id=142361
565
566         Reviewed by Csaba Osztrogonác.
567
568         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
569         (WebCore::FEBlend::platformApplySoftware):
570         * platform/graphics/filters/FEGaussianBlur.cpp:
571         (WebCore::standardBoxBlur):
572
573 2015-03-05  Benjamin Poulain  <bpoulain@apple.com>
574
575         Add basic support for character sets to the URL Filter parser
576         https://bugs.webkit.org/show_bug.cgi?id=142257
577
578         Reviewed by Alex Christensen.
579
580         This patch is a first step toward making the URL filter parser a bit
581         more powerful: it adds support for character set atom.
582
583         I did not attempt to integrate that into the prefix tree in this patch,
584         instead, the GraphBuilder gets a two modes of generating the NFA:
585         PrefixTree and DirectGeneration.
586
587         As long as we only see trivial atoms, we use the PrefixTree generation
588         to minimize the number of nodes we need. As soon as we start a character
589         class, we switch to DirectGeneration and we generate the NFA from the input
590         without merging with previously seen patterns.
591
592         To differentiate between Trivial atoms and CharacterSet, we also gain
593         an AtomType state.
594
595         The character set themself are very simple: each character is represented by
596         a bit in a 16bytes bit vector.
597
598         * contentextensions/URLFilterParser.cpp:
599         (WebCore::ContentExtensions::quantifyTrivialAtom):
600         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
601         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
602         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
603         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
604         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
605         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
606         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
607         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassEnd):
608         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
609         (WebCore::ContentExtensions::GraphBuilder::sinkAtom):
610         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
611         (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom):
612         (WebCore::ContentExtensions::GraphBuilder::sinkCharacterSet):
613         (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary):
614
615 2015-03-05  Roger Fong  <roger_fong@apple.com>
616
617         Implement new fullscreen media controls on Mac.
618         https://bugs.webkit.org/show_bug.cgi?id=142355.
619         <rdar://problem/16175787>
620
621         Reviewed by Dean Jackson.
622
623         Adjust sizes and positioning of all fullscreen media control elements.
624         * Modules/mediacontrols/mediaControlsApple.css:
625         (audio::-webkit-media-controls-fullscreen-button.exit): Update to match entering fullscreen button.
626         (video:-webkit-full-screen::-webkit-media-controls-panel):
627         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
628         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
629         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
630         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
631         (video:-webkit-full-screen::-webkit-media-controls-play-button):
632         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
633         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
634         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
635         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
636         (video:-webkit-full-screen::-webkit-media-controls-current-time-display):
637         (video:-webkit-full-screen::-webkit-media-controls-time-remaining-display):
638         (audio:-webkit-full-screen::-webkit-media-controls-toggle-closed-captions-button):
639         (video:-webkit-full-screen::-webkit-media-controls-volume-slider::-webkit-slider-thumb): Deleted.
640         (video:-webkit-full-screen::-webkit-media-controls-rewind-button): Deleted. Not used in full screen.
641
642 2015-03-05  Roger Fong  <roger_fong@apple.com>
643
644         Minor touchups to inline media control icons.
645         https://bugs.webkit.org/show_bug.cgi?id=142354.
646         <rdar://problem/20058854>.
647
648         Reviewed by Brent Fulgham.
649
650         Increase sizes of play/pause and fullscreen buttons slightly.
651         * Modules/mediacontrols/mediaControlsApple.css:
652         (audio::-webkit-media-controls-play-button):
653         (audio::-webkit-media-controls-play-button.paused):
654         (audio::-webkit-media-controls-fullscreen-button):
655
656 2015-03-05  Roger Fong  <roger_fong@apple.com>
657
658         Update inline media control icons for OSX.
659         https://bugs.webkit.org/show_bug.cgi?id=142305.
660         <rdar://problem/19997484>
661
662         Reviewed by Dean Jackson.
663
664         Changes include: new volume button, new full screen button, new play/pause button.
665         Repositioning of 30 second and play buttons.
666         * Modules/mediacontrols/mediaControlsApple.css:
667         (audio::-webkit-media-controls-panel button):
668         (audio::-webkit-media-controls-rewind-button):
669         (audio::-webkit-media-controls-play-button):
670         (audio::-webkit-media-controls-play-button.paused):
671         (audio::-webkit-media-controls-panel .mute-box):
672         (video::-webkit-media-controls-volume-max-button):
673         (video::-webkit-media-controls-volume-min-button):
674         (audio::-webkit-media-controls-toggle-closed-captions-button):
675         (audio::-webkit-media-controls-fullscreen-button):
676         (audio::-webkit-media-controls-current-time-display):
677         * Modules/mediacontrols/mediaControlsApple.js:
678         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
679         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
680         (Controller.prototype.updateVolume): Ditto
681
682 2015-03-05  David Hyatt  <hyatt@apple.com>
683
684         Caps lock indicator in text fields is laying out in the wrong place.
685         https://bugs.webkit.org/show_bug.cgi?id=142352
686
687         Reviewed by Dean Jackson.
688
689         * css/html.css:
690         (input::-webkit-caps-lock-indicator):
691         Change the CSS to give the SVG image an intrinsic size, and to use align-self:stretch so that
692         the image always stretches to fill the height of the text box. Get rid of height:100%, as that
693         just resolves to auto in strict mode and was not ever going to work there.
694
695 2015-03-04  Dean Jackson  <dino@apple.com>
696
697         [iOS Media] Use a blurry background for media controls
698         https://bugs.webkit.org/show_bug.cgi?id=142316
699         <rdar://problem/14911098>
700
701         Reviewed by Eric Carlson.
702
703         Start using the -webkit-appearance media-controls-light-bar-background
704         in order to get the blurry background of media controls.
705
706         * Modules/mediacontrols/mediaControlsApple.js: Keep the panel and the
707         panel background in sync when it comes to hiding and showing. It would
708         be better if this could be done on a container element in the future.
709         (Controller.prototype.handlePanelTransitionEnd):
710         (Controller.prototype.setPlaying):
711         (Controller.prototype.showControls):
712         (Controller.prototype.hideControls):
713
714         * Modules/mediacontrols/mediaControlsiOS.css: New background container
715         with the special appearance. I also renamed "composited-parent" to
716         "container", which makes more sense.
717         (video::-webkit-media-controls-panel-container):
718         (audio::-webkit-media-controls-panel-container):
719         (video::-webkit-media-controls-panel-background):
720         (audio::-webkit-media-controls-panel-background):
721         (video::-webkit-media-controls-panel-background.paused):
722         (video::-webkit-media-controls-panel):
723         (audio::-webkit-media-controls-panel):
724         (video::-webkit-media-controls-panel.paused):
725         (audio::-webkit-media-controls-optimized-fullscreen-button):
726         (audio::-webkit-media-controls-timeline):
727         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
728         (video::-webkit-media-controls-panel-composited-parent): Deleted.
729         (video::-webkit-media-controls-panel:hover): Deleted.
730
731         * Modules/mediacontrols/mediaControlsiOS.js:
732         (ControllerIOS.prototype.createControls): Create the new background element.
733         (ControllerIOS.prototype.addControls):
734         (ControllerIOS.prototype.set pageScaleFactor): Temporarily disable
735         this because the background disappears when the zoom factor
736         is too high - we start tiling the background. This will be addressed
737         by https://bugs.webkit.org/show_bug.cgi?id=142317.
738
739 2015-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
740
741         Mechanical text-related cleanup
742         https://bugs.webkit.org/show_bug.cgi?id=142326
743
744         Reviewed by Andreas Kling.
745
746         Use nullptr instead of 0.
747         Use references instead of pointers.
748
749         No new tests because there is no behavior change.
750
751         * platform/graphics/cocoa/FontCascadeCocoa.mm:
752         (WebCore::FontCascade::adjustSelectionRectForComplexText):
753         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
754         (WebCore::FontCascade::floatWidthForComplexText):
755         (WebCore::FontCascade::offsetForPositionForComplexText):
756         * platform/graphics/mac/ComplexTextController.cpp:
757         (WebCore::TextLayout::TextLayout):
758         (WebCore::ComplexTextController::ComplexTextController):
759         * platform/graphics/mac/ComplexTextController.h:
760         * rendering/InlineIterator.h:
761         (WebCore::InlineIterator::InlineIterator):
762         (WebCore::InlineIterator::clear):
763         (WebCore::bidiNextShared):
764         (WebCore::bidiNextSkippingEmptyInlines):
765         (WebCore::bidiNextIncludingEmptyInlines):
766         (WebCore::InlineWalker::InlineWalker):
767         (WebCore::InlineIterator::increment):
768         * rendering/RenderBlockLineLayout.cpp:
769         (WebCore::setLogicalWidthForTextRun):
770         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
771         * rendering/line/BreakingContextInlineHeaders.h:
772         (WebCore::measureHyphenWidth):
773         (WebCore::textWidth):
774         (WebCore::tryHyphenating):
775         (WebCore::BreakingContext::handleText):
776         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
777
778 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
779
780         Move AxisScrollSnapAnimator logic to ScrollController
781         https://bugs.webkit.org/show_bug.cgi?id=142293
782         <rdar://problem/20039867>
783
784         Reviewed by Dean Jackson.
785
786         No change in function.
787
788         Move the animation logic out of 'AxisScrollSnapAnimator' into 'ScrollController'. Rename the remaining
789         bits of 'AxisScrollSnapAnimator' as 'ScrollSnapAnimatorState'. Remove a number of delegate methods required
790         by 'AxisScrollSnapAnimatorClient' that are no longer needed.
791
792         Also, break up some of the Scroll Snap Point math to be a little easier to understand.
793
794         * WebCore.xcodeproj/project.pbxproj: Rename 'platform/mac/AxisScrollSnapAnimator.{h,mm}' -> 'platform/cocoa/ScrollSnapAnimatorState.h'
795         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Mark 'scrollOffsetOnAxis' as const.
796         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
797         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Make 'const'
798         * platform/ScrollAnimator.cpp:
799         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Make 'const'
800         * platform/ScrollAnimator.h:
801         * platform/cocoa/ScrollController.h: No longer subclass from AxisScrollSnapAnimatorClient.
802         * platform/cocoa/ScrollController.mm:
803         (WebCore::ScrollController::scrollSnapPointState): Added accessors (const and non-const) for the individual
804         Scroll Snap State of each axis.
805         (WebCore::toWheelEventStatus): Moved from AxisScrollSnapAnimator.
806         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Added helper function containing the snap wheel handler code
807         from AxisScrollSnapAnimator.
808         (WebCore::ScrollController::shouldOverrideWheelEvent): Moved from AxisScrollSnapAnimator.
809         (WebCore::ScrollController::processWheelEventForScrollSnap): Update to use new methods moved from AxisScrollSnapAnimator.
810         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Update for new ScrollSnapAnimatorState class.
811         (WebCore::ScrollController::updateScrollSnapPoints): Ditto.
812         (WebCore::ScrollController::startScrollSnapTimer): Call client (delegate) method.
813         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
814         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Call new 'scrollSnapAnimationUpdate' method passing the
815         correct axis to animate.
816         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
817         (WebCore::ScrollController::scrollSnapAnimationUpdate): Moved from AxisScrollSnapAnimator.
818         (WebCore::projectedInertialScrollDistance): Moved from AxisScrollSnapAnimator.
819         (WebCore::ScrollController::initializeGlideParameters): Ditto.
820         (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
821         (WebCore::ScrollController::endScrollSnapAnimation): Ditto.
822         (WebCore::snapProgress): Created a new function for this calculation to make reasoning about the 'computeSnapDelta' and
823         'computeGlideDelta' easier.
824         (WebCore::clampedSnapMagnitude): Ditto.
825         (WebCore::ScrollController::computeSnapDelta): Moved from AxisScrollSnapAnimator.
826         (WebCore::snapGlide): Created a new function for this calculation to make reasoning about the 'computeGlideDelta' easier.
827         (WebCore::ScrollController::computeGlideDelta): Moved from AxisScrollSnapAnimator.
828         (WebCore::ScrollController::scrollOffsetOnAxis): Deleted.
829         (WebCore::ScrollController::immediateScrollOnAxis): Deleted.
830         * platform/cocoa/ScrollSnapAnimatorState.h: Copied from platform/mac/AxisScrollSnapAnimator.h.
831         (WebCore::AxisScrollSnapAnimatorClient::~AxisScrollSnapAnimatorClient): Deleted.
832         * platform/cocoa/ScrollSnapAnimatorState.mm: Copied from platform/mac/AxisScrollSnapAnimator.mm.
833         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState):
834         (WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta):
835         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta):
836         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow):
837         (WebCore::toWheelEventStatus): Deleted.
838         (WebCore::projectedInertialScrollDistance): Deleted.
839         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Deleted.
840         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Deleted.
841         (WebCore::AxisScrollSnapAnimator::shouldOverrideWheelEvent): Deleted.
842         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Deleted.
843         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Deleted.
844         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation): Deleted.
845         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Deleted.
846         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Deleted.
847         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters): Deleted.
848         (WebCore::AxisScrollSnapAnimator::pushInitialWheelDelta): Deleted.
849         (WebCore::AxisScrollSnapAnimator::averageInitialWheelDelta): Deleted.
850         (WebCore::AxisScrollSnapAnimator::clearInitialWheelDeltaWindow): Deleted.
851         * platform/mac/AxisScrollSnapAnimator.h: Removed.
852         * platform/mac/AxisScrollSnapAnimator.mm: Removed.
853         * platform/mac/ScrollAnimatorMac.h:
854         * platform/mac/ScrollAnimatorMac.mm:
855         (WebCore::ScrollAnimatorMac::pinnedInDirection): Removed.
856
857 2015-03-04  Dean Jackson  <dino@apple.com>
858
859         [iOS Media] Small inline controls can clip the time widgets
860         https://bugs.webkit.org/show_bug.cgi?id=142319
861
862         Reviewed by Eric Carlson.
863
864         Start counting the number of digits in a duration so that
865         we can assign classes to the time widgets that specify
866         a minimum width.
867
868         * Modules/mediacontrols/mediaControlsApple.css: Replace the hour-long and ten-hour-long
869         classes with number of digits.
870         (audio::-webkit-media-controls-time-remaining-display.five-digit-time):
871         (audio::-webkit-media-controls-current-time-display.five-digit-time):
872         (audio::-webkit-media-controls-time-remaining-display.six-digit-time):
873         (audio::-webkit-media-controls-current-time-display.six-digit-time):
874         (audio::-webkit-media-controls-time-remaining-display.hour-long-time): Deleted.
875         (audio::-webkit-media-controls-current-time-display.hour-long-time): Deleted.
876         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time): Deleted.
877         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time): Deleted.
878
879         * Modules/mediacontrols/mediaControlsApple.js: Add some new class names.
880         (Controller.prototype.updateDuration): Set the class of the time
881         widgets when we know how long the media runs.
882
883         * Modules/mediacontrols/mediaControlsiOS.css: Values for iOS that
884         are big enough to avoid clipping.
885         (video::-webkit-media-controls-current-time-display):
886         (video::-webkit-media-controls-time-remaining-display):
887         (video::-webkit-media-controls-current-time-display.three-digit-time):
888         (video::-webkit-media-controls-time-remaining-display.three-digit-time):
889         (video::-webkit-media-controls-current-time-display.four-digit-time):
890         (video::-webkit-media-controls-time-remaining-display.four-digit-time):
891         (video::-webkit-media-controls-current-time-display.five-digit-time):
892         (video::-webkit-media-controls-time-remaining-display.five-digit-time):
893         (video::-webkit-media-controls-current-time-display.six-digit-time):
894         (video::-webkit-media-controls-time-remaining-display.six-digit-time):
895         (audio::-webkit-media-controls-timeline-container): Deleted.
896         (video::-webkit-media-text-track-container): Deleted.
897
898 2015-03-05  Csaba Osztrogonác  <ossy@webkit.org>
899
900         [cmake] Fix the web replay build
901         https://bugs.webkit.org/show_bug.cgi?id=142331
902
903         Reviewed by Gyuyoung Kim.
904
905         * CMakeLists.txt:
906         * inspector/InspectorReplayAgent.cpp:
907         (WebCore::buildInspectorObjectForSessionState):
908         (WebCore::buildInspectorObjectForSegmentState):
909
910 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
911
912         [SOUP] Check TLS errors as soon as they are set in the SoupMessage
913         https://bugs.webkit.org/show_bug.cgi?id=142244
914
915         Reviewed by Sergio Villar Senin.
916
917         Connect to the notify::tls-errors signal of SoupMessage to cancel
918         the load earlier in case of TLS failure, preventing any private
919         data from being sent to the server before the TLS errors are checked.
920
921         * platform/network/soup/ResourceHandleSoup.cpp:
922         (WebCore::tlsErrorsChangedCallback):
923         (WebCore::gotHeadersCallback):
924         (WebCore::createSoupMessageForHandleAndRequest):
925
926 2015-03-05  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
927
928         TextCheckingParagraph::isEmpty() is sufficient to check whether paragraph is empty
929         https://bugs.webkit.org/show_bug.cgi?id=142276
930
931         Reviewed by Darin Adler.
932
933         TextCheckingParagraph::isEmpty() already calls TextCheckingParagraph::isRangeEmpty().
934         There is no need to call them both at the caller site.
935
936         No new tests. No behavior change.
937
938         * editing/Editor.cpp:
939         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
940         Update caller site.
941
942         * editing/TextCheckingHelper.cpp:
943         (WebCore::TextCheckingParagraph::isEmpty):
944         Avoid using helepers here to get rid of them as they are
945         no longer needed outside TextCheckingParagraph.
946
947         * editing/TextCheckingHelper.h:
948         (WebCore::TextCheckingParagraph::isTextEmpty): Deleted.
949         (WebCore::TextCheckingParagraph::isRangeEmpty): Deleted.
950         Do not expose isTextEmpty() and isRangeEmpty().
951
952 2015-03-04  Simon Fraser  <simon.fraser@apple.com>
953
954         Clarify RenderElement::adjustStyleDifference()
955         https://bugs.webkit.org/show_bug.cgi?id=142256
956
957         Reviewed by David Hyatt.
958
959         Make RenderElement::adjustStyleDifference() clearer in two ways.
960         
961         First, replace lots of if (diff < X) diff = X with
962         diff = std::max(diff, X). I did this even in cases where diff was
963         being set unconditionally, because it's never correct to change the diff
964         to a lesser value.
965         
966         Second the "set at least SimplifiedLayout, but if we have PositionedMovementOnly
967         set it to SimplifiedLayoutAndPositionedMovement" was confusingly written.
968
969         * rendering/RenderElement.cpp:
970         (WebCore::RenderElement::adjustStyleDifference):
971
972 2015-03-04  David Kilzer  <ddkilzer@apple.com>
973
974         Switch new soft-linking debug asserts to release asserts
975         <http://webkit.org/b/142176>
976
977         Reviewed by Alex Christensen.
978
979         * platform/mac/SoftLinking.h:
980         (SOFT_LINK_CONSTANT_SOURCE): Switch to release assert.
981         (SOFT_LINK_FUNCTION_SOURCE): Ditto.
982         * platform/win/SoftLinking.h:
983         (SOFT_LINK_CONSTANT_SOURCE): Ditto.
984         (SOFT_LINK_FUNCTION_SOURCE): Ditto.  Note that this method is
985         effectively only called once because the function pointer is
986         replaced after the first time it's called.
987
988 2015-03-04  Alex Christensen  <achristensen@webkit.org>
989
990         Optimize content extensions.
991         https://bugs.webkit.org/show_bug.cgi?id=142295
992
993         Reviewed by Benjamin Poulain.
994
995         * contentextensions/ContentExtensionCompiler.cpp:
996         (WebCore::ContentExtensions::serializeActions):
997         There is no need to add duplicate sequential actions.
998         * contentextensions/ContentExtensionRule.h:
999         (WebCore::ContentExtensions::Action::operator==):
1000         Added to compare actions.
1001         * contentextensions/ContentExtensionsBackend.cpp:
1002         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
1003         Return early if a block action is found instead of moving to the next extension.
1004
1005 2015-03-04  Commit Queue  <commit-queue@webkit.org>
1006
1007         Unreviewed, rolling out r181046.
1008         https://bugs.webkit.org/show_bug.cgi?id=142318
1009
1010         Broke two layout tests (Requested by sundiamonde on #webkit).
1011
1012         Reverted changeset:
1013
1014         "Update inline media control icons for OSX."
1015         https://bugs.webkit.org/show_bug.cgi?id=142305
1016         http://trac.webkit.org/changeset/181046
1017
1018 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1019
1020         <attachment> icons are low-resolution when transformed or under page scale
1021         https://bugs.webkit.org/show_bug.cgi?id=142262
1022         <rdar://problem/20035480>
1023
1024         Reviewed by Dean Jackson.
1025
1026         We should use Icon::createIconForFiles, just like <input type="file"> does,
1027         instead of directly talking to IconServices. This results both in less code
1028         and in NSImage's multiresolution magic making the icons sharp even under
1029         the influence of transforms and page scale.
1030
1031         * WebCore.xcodeproj/project.pbxproj:
1032         * platform/spi/mac/IconServicesSPI.h: Removed.
1033         * platform/spi/mac/LaunchServicesSPI.h: Removed.
1034         Get rid of IconServicesSPI.h and LaunchServicesSPI.h.
1035
1036         * platform/graphics/Icon.h:
1037         Include RetainPtr just once.
1038         paint() should take a GraphicsContext reference (null is not an option)
1039         and a FloatRect (after all, it just turns around and converts to NSRect).
1040
1041         * platform/graphics/ios/IconIOS.mm:
1042         (WebCore::Icon::paint):
1043         * platform/graphics/mac/IconMac.mm:
1044         (WebCore::Icon::createIconForFiles):
1045         (WebCore::Icon::paint):
1046         * platform/graphics/efl/IconEfl.cpp:
1047         (WebCore::Icon::paint):
1048         * platform/graphics/gtk/IconGtk.cpp:
1049         (WebCore::Icon::paint):
1050         * platform/graphics/win/IconWin.cpp:
1051         (WebCore::Icon::paint):
1052         Adapt to the paint() signature changes, fix some style, etc.
1053
1054         * rendering/RenderFileUploadControl.cpp:
1055         (WebCore::RenderFileUploadControl::paintObject):
1056         * rendering/RenderThemeIOS.mm:
1057         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1058         Adapt to the paint() signature changes.
1059
1060         * rendering/RenderThemeMac.mm:
1061         (WebCore::paintAttachmentIcon):
1062         Use Icon::createIconForFiles instead of IconServices.
1063
1064 2015-03-04  Tim Horton  <timothy_horton@apple.com>
1065
1066         <attachment> should not appear selected when the cursor is adjacent to it
1067         https://bugs.webkit.org/show_bug.cgi?id=142311
1068         <rdar://problem/20045862>
1069
1070         Reviewed by Dean Jackson.
1071
1072         * rendering/RenderAttachment.cpp:
1073         (WebCore::RenderAttachment::isSelected): Deleted.
1074         * rendering/RenderAttachment.h:
1075         * rendering/RenderThemeMac.mm:
1076         (WebCore::titleTextColorForAttachment):
1077         (WebCore::RenderThemeMac::paintAttachment):
1078         (WebCore::labelTextColorForAttachment): Deleted.
1079         We were using the wrong (and far too complicated) mechanism to determine
1080         if the attachment is selected (to decide which highlight color to use).
1081         Instead, just check selectionState().
1082
1083 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1084
1085         <attachment> should show the file size as detail text below the icon
1086         https://bugs.webkit.org/show_bug.cgi?id=142261
1087         <rdar://problem/20009570>
1088
1089         Reviewed by Dean Jackson.
1090
1091         Test: fast/attachment/attachment-subtitle.html
1092
1093         * html/HTMLAttachmentElement.cpp:
1094         (WebCore::HTMLAttachmentElement::setFile):
1095         (WebCore::HTMLAttachmentElement::parseAttribute):
1096         * html/HTMLAttachmentElement.h:
1097         Let RenderAttachment know when the subtitle attribute changes.
1098
1099         * html/HTMLAttributeNames.in:
1100         Add a subtitle attribute.
1101
1102         * rendering/RenderAttachment.cpp:
1103         (WebCore::RenderAttachment::invalidate):
1104         (WebCore::RenderAttachment::representedFileChanged): Deleted.
1105         * rendering/RenderAttachment.h:
1106         Rename representedFileChanged to invalidate; it will cause layout and
1107         repaint of the attachment. Mostly for use from HTMLAttachmentElement,
1108         when properties that affect the display and/or intrinsic size change.
1109
1110         * rendering/RenderThemeMac.mm:
1111         (WebCore::attachmentTitleInactiveBackgroundColor):
1112         (WebCore::attachmentTitleInactiveTextColor):
1113         (WebCore::attachmentSubtitleTextColor):
1114         (WebCore::titleTextColorForAttachment):
1115         (WebCore::AttachmentLayout::addTitleLine):
1116         (WebCore::AttachmentLayout::layOutTitle):
1117         (WebCore::AttachmentLayout::layOutSubtitle):
1118         (WebCore::AttachmentLayout::AttachmentLayout):
1119         (WebCore::addAttachmentTitleBackgroundRightCorner):
1120         (WebCore::addAttachmentTitleBackgroundLeftCorner):
1121         (WebCore::paintAttachmentTitleBackground):
1122         (WebCore::paintAttachmentTitle):
1123         (WebCore::paintAttachmentSubtitle):
1124         (WebCore::RenderThemeMac::paintAttachment):
1125         (WebCore::attachmentLabelInactiveBackgroundColor): Deleted.
1126         (WebCore::attachmentLabelInactiveTextColor): Deleted.
1127         (WebCore::labelTextColorForAttachment): Deleted.
1128         (WebCore::AttachmentLayout::addLine): Deleted.
1129         (WebCore::AttachmentLayout::layOutLabel): Deleted.
1130         (WebCore::addAttachmentLabelBackgroundRightCorner): Deleted.
1131         (WebCore::addAttachmentLabelBackgroundLeftCorner): Deleted.
1132         (WebCore::paintAttachmentLabelBackground): Deleted.
1133         (WebCore::paintAttachmentLabel): Deleted.
1134         Rename everything "label" to "title" (except LabelLine, which is not
1135         specifically about the title). We're going to use "title" for the
1136         main text below the icon, and "subtitle" for the secondary text below that.
1137
1138         Avoid keeping the CTFonts on the AttachmentLayout; there's no need for it.
1139
1140         Add layOutSubtitle and paintAttachmentSubtitle, which orient and paint
1141         the subtitle (below the title, in blue, smaller than the label).
1142
1143 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1144
1145         [Windows] Build fix: Make sure to include <CoreMedia/CoreMedia.h> before redefining CMSampleBuffer
1146
1147         More fallout from:
1148
1149         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1150         <http://webkit.org/b/141870>
1151
1152         * platform/cf/CoreMediaSoftLink.cpp:
1153         * platform/cf/CoreMediaSoftLink.h:
1154         - Remove include of <CoreMedia/CoreMedia.h> here.  These already
1155           include CoreMediaSPI.h.
1156         * platform/spi/cf/CoreMediaSPI.h:
1157         - Add include of <CoreMedia/CoreMedia.h> here.
1158         - Remove redundant include of <CoreMedia/CMTime.h> for Windows.
1159
1160 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1161
1162         [iOS] Fix build with newer clang due to duplicate macro definition
1163
1164         Fallout from:
1165
1166         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1167         <http://webkit.org/b/141870>
1168
1169         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1170         Remove duplicate kCMTimeIndefinite macro.
1171
1172 2015-03-04  Roger Fong  <roger_fong@apple.com>
1173
1174         Update inline media control icons for OSX.
1175         https://bugs.webkit.org/show_bug.cgi?id=142305.
1176         <rdar://problem/19997484>
1177
1178         Reviewed by Dean Jackson.
1179
1180         Changes include: new volume button, new full screen button, new play/pause button.
1181         Repositioning of 30 second and play buttons.
1182         * Modules/mediacontrols/mediaControlsApple.css:
1183         (audio::-webkit-media-controls-panel button):
1184         (audio::-webkit-media-controls-rewind-button):
1185         (audio::-webkit-media-controls-play-button):
1186         (audio::-webkit-media-controls-play-button.paused):
1187         (audio::-webkit-media-controls-panel .mute-box):
1188         (video::-webkit-media-controls-volume-max-button):
1189         (video::-webkit-media-controls-volume-min-button):
1190         (audio::-webkit-media-controls-toggle-closed-captions-button):
1191         (audio::-webkit-media-controls-fullscreen-button):
1192         (audio::-webkit-media-controls-current-time-display):
1193         * Modules/mediacontrols/mediaControlsApple.js:
1194         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
1195         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
1196         (Controller.prototype.updateVolume): Ditto
1197
1198 2015-03-04  Andy Estes  <aestes@apple.com>
1199
1200         [Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
1201         https://bugs.webkit.org/show_bug.cgi?id=142313
1202
1203         Reviewed by Anders Carlsson.
1204
1205         ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.
1206
1207         * WebCore.xcodeproj/project.pbxproj:
1208         * platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
1209         * platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.
1210
1211 2015-03-04  Dean Jackson  <dino@apple.com>
1212
1213         REGRESSION (r179597): Can't see power saver banner for plugins
1214         https://bugs.webkit.org/show_bug.cgi?id=142312
1215         <rdar://problem/20040517>
1216
1217         Reviewed by Brent Fulgham.
1218
1219         We were being a bit too restrictive when deciding a child
1220         should not create a renderer. All shadow root children
1221         of the snapshotted plugin need one.
1222
1223         * html/HTMLPlugInImageElement.cpp:
1224         (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer):
1225         Test if we're part of the shadow tree.
1226
1227 2015-03-03  Andy Estes  <aestes@apple.com>
1228
1229         [Content Filtering] Make it easier to add new content filters
1230         https://bugs.webkit.org/show_bug.cgi?id=142255
1231
1232         Reviewed by Sam Weinig.
1233
1234         ContentFilter was becoming a bit of a mess, with both the WebFilterEvaluator and NEFilterSource implementations
1235         awkwardly living side-by-side. This patch cleans things up by moving these implementations into two separate
1236         classes and turning ContentFilter itself into an abstract interface that each implements. A new class called
1237         ContentFilterCollection, which also inherits from ContentFilter, manages the collection of individual content
1238         filters and is vended to the rest of the system by ContentFilter::createIfNeeded().
1239
1240         This refactoring will make it easier to add a third type of content filter in a follow-on patch, namely a mock
1241         content filter for testing purposes.
1242
1243         * WebCore.xcodeproj/project.pbxproj:
1244         * loader/DocumentLoader.cpp:
1245         (WebCore::DocumentLoader::responseReceived): Called ContentFilter::createIfNeeded() instead of instantiating a ContentFilter directly.
1246         * platform/ContentFilter.h:
1247         (WebCore::ContentFilter::~ContentFilter):
1248         * platform/cocoa/NetworkExtensionContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
1249         * platform/cocoa/NetworkExtensionContentFilter.mm: Added.
1250         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Moved NEFilterSource code from ContentFilterMac.mm to here.
1251         (WebCore::NetworkExtensionContentFilter::create): Ditto.
1252         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Ditto.
1253         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Ditto.
1254         (WebCore::NetworkExtensionContentFilter::addData): Ditto.
1255         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Ditto.
1256         (WebCore::NetworkExtensionContentFilter::needsMoreData): Ditto.
1257         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
1258         (WebCore::NetworkExtensionContentFilter::getReplacementData): Ditto.
1259         (WebCore::NetworkExtensionContentFilter::unblockHandler): Ditto.
1260         * platform/cocoa/ParentalControlsContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
1261         * platform/cocoa/ParentalControlsContentFilter.mm: Added.
1262         (WebCore::ParentalControlsContentFilter::canHandleResponse): Moved WebFilterEvaluator code from ContentFilterMac.mm to here.
1263         (WebCore::ParentalControlsContentFilter::create): Ditto.
1264         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Ditto.
1265         (WebCore::ParentalControlsContentFilter::addData): Ditto.
1266         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
1267         (WebCore::ParentalControlsContentFilter::needsMoreData): Ditto.
1268         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
1269         (WebCore::ParentalControlsContentFilter::getReplacementData): Ditto.
1270         (WebCore::ParentalControlsContentFilter::unblockHandler): Ditto.
1271         * platform/mac/ContentFilterMac.mm:
1272         (WebCore::contentFilterType): Added a helper function template that creates a new ContentFilterType.
1273         (WebCore::contentFilterTypes): Registered a ContentFilterType for each type of content filter.
1274         (WebCore::ContentFilter::createIfNeeded): Created a ContentFilterCollection containing each content filter that can handle the given response.
1275         (WebCore::ContentFilterCollection::ContentFilterCollection): Constructs a ContentFilterCollection given a Vector of content filters.
1276         (WebCore::ContentFilterCollection::addData): Forwarded the call to each content filter in m_contentFilters.
1277         (WebCore::ContentFilterCollection::finishedAddingData): Ditto.
1278         (WebCore::ContentFilterCollection::needsMoreData): Ditto.
1279         (WebCore::ContentFilterCollection::didBlockData): Ditto.
1280         (WebCore::ContentFilterCollection::getReplacementData): Returned replacement data for the first filter that blocked the load.
1281         If no filter blocked the load, returned the first filter's replacement data.
1282         (WebCore::ContentFilterCollection::unblockHandler): Returned the unblock handler for the first filter that blocked the load.
1283         (WebCore::ContentFilter::ContentFilter): Deleted.
1284         (WebCore::ContentFilter::~ContentFilter): Deleted.
1285         (WebCore::ContentFilter::canHandleResponse): Deleted.
1286         (WebCore::ContentFilter::addData): Deleted.
1287         (WebCore::ContentFilter::finishedAddingData): Deleted.
1288         (WebCore::ContentFilter::needsMoreData): Deleted.
1289         (WebCore::ContentFilter::didBlockData): Deleted.
1290         (WebCore::ContentFilter::getReplacementData): Deleted.
1291         (WebCore::ContentFilter::unblockHandler): Deleted.
1292
1293 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1294
1295         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1296         <http://webkit.org/b/141870>
1297
1298         Reviewed by Alex Christensen.
1299
1300         * Configurations/WebCore.unexp:
1301         - Remove all weak symbols for CoreMedia.framework as they should
1302           no longer appear.
1303
1304         * Modules/plugins/QuickTimePluginReplacement.mm:
1305         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
1306         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1307         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1308         - Clean up headers.
1309
1310         * platform/cf/CoreMediaSoftLink.cpp:
1311         * platform/cf/CoreMediaSoftLink.h:
1312         - Add soft-link functions and constants from remaining source
1313           files.
1314
1315         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1316         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1317         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1318         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1319         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1320         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1321         * platform/mac/PlatformClockCM.mm:
1322         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1323         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1324         - Switch to using CoreMediaSoftLink.h.
1325
1326         * platform/mac/SoftLinking.h:
1327         * platform/win/SoftLinking.h:
1328         - Remove 'const' from SOFT_LINK_CONSTANT_{HEADER,SOURCE}()
1329           macros since it won't work with const structs.
1330
1331         * platform/spi/cf/CoreMediaSPI.h:
1332         - Add SPI declarations for Windows originally from
1333           InbandTextTrackPrivateAVF.cpp.
1334
1335 2015-03-04  Commit Queue  <commit-queue@webkit.org>
1336
1337         Unreviewed, rolling out r181001 and r181003.
1338         https://bugs.webkit.org/show_bug.cgi?id=142307
1339
1340         Broke many tests (Requested by ap on #webkit).
1341
1342         Reverted changesets:
1343
1344         "Make JavaScript binding get and set legacy event listener
1345         attributes directly"
1346         https://bugs.webkit.org/show_bug.cgi?id=142282
1347         http://trac.webkit.org/changeset/181001
1348
1349         "Update bindings tests after r181001."
1350         http://trac.webkit.org/changeset/181003
1351
1352 2015-03-04  Roger Fong  <roger_fong@apple.com>
1353
1354         Update elapsed/remaining time displays on media inline controls on OSX.
1355         https://bugs.webkit.org/show_bug.cgi?id=142264.
1356         <rdar://problem/19997487>
1357
1358         Reviewed by Dean Jackson.
1359
1360         Div surrounding times are set widths. A larger width is used for times that are
1361         an hour or longer. Time elapsed is right justified. Time remaining is left justified.
1362         Times are displayed in 11pt Helvetica Neue.
1363         * Modules/mediacontrols/mediaControlsApple.css:
1364         (audio::-webkit-media-controls-time-remaining-display):
1365         (audio::-webkit-media-controls-current-time-display):
1366         (audio::-webkit-media-controls-time-remaining-display.hour-long-time):
1367         (audio::-webkit-media-controls-current-time-display.hour-long-time):
1368         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time):
1369         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time):
1370         * Modules/mediacontrols/mediaControlsApple.js:
1371         (Controller.prototype.updateDuration):
1372
1373 2015-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
1374
1375         Implement -apple-trailing-word: -apple-partially-balanced
1376         https://bugs.webkit.org/show_bug.cgi?id=142253
1377
1378         Reviewed by David Hyatt.
1379
1380         This patch implements a history mechanism for line breaking. In particular, this patch partitions
1381         the updates to the current line breaking location into two kinds: conceptually new breaking locations,
1382         and fixups to existing locations. Then, this patch remembers all the fixed up breaking locations, up
1383         to a maximum number of remembered locations.
1384
1385         The patch then uses this memory to change the line-breaking selection based on the rules of
1386         -apple-trailing-word.
1387
1388         Test: fast/text/trailing-word.html
1389
1390         * rendering/line/BreakingContextInlineHeaders.h:
1391         Use InlineIteratorHistory as a proxy for the current breaking location. Note that all these functions
1392         are inlined, so the overhead should be next to nothing when -apple-trailing-word is not in use.
1393         (WebCore::BreakingContext::BreakingContext): Use InlineIteratorHistory instead of InlineIterator
1394         (WebCore::BreakingContext::lineBreak): Ditto.
1395         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine): Ditto
1396         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Ditto
1397         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Keeps track of historical
1398         breaking locations
1399         (WebCore::BreakingContext::InlineIteratorHistory::push): Remember a new breaking location
1400         (WebCore::BreakingContext::InlineIteratorHistory::update): Update an existing breaking location
1401         (WebCore::BreakingContext::InlineIteratorHistory::renderer): Forwarded to the current breaking location
1402         (WebCore::BreakingContext::InlineIteratorHistory::offset): Ditto
1403         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):  Ditto
1404         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode): Ditto
1405         (WebCore::BreakingContext::InlineIteratorHistory::get): Get one of the remembered breaking locations
1406         (WebCore::BreakingContext::InlineIteratorHistory::current): Get the current breaking location
1407         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
1408         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Forwarded to the current breaking location.
1409         (WebCore::BreakingContext::InlineIteratorHistory::increment): Ditto
1410         (WebCore::BreakingContext::InlineIteratorHistory::clear): Ditto
1411         (WebCore::BreakingContext::handleBR): Use InlineIteratorHistory instead of InlineIterator
1412         (WebCore::BreakingContext::handleFloat): Ditto
1413         (WebCore::BreakingContext::handleText): Use InlineIteratorHistory instead of InlineIterator
1414         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Style
1415         (WebCore::checkMidpoints): Use InlineIteratorHistory instead of InlineIterator
1416         (WebCore::BreakingContext::handleEndOfLine): If -apple-trailing-word is in effect, use
1417         optimalLineBreakLocationForTrailingWord().
1418         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Use the remembered breaking
1419         locations and choose the optimal one.
1420         (WebCore::BreakingContext::lineBreakRef): Deleted.
1421
1422 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1423
1424         <attachment> title text disappears when dragging
1425         https://bugs.webkit.org/show_bug.cgi?id=142263
1426         <rdar://problem/20035515>
1427
1428         Reviewed by Sam Weinig.
1429
1430         * rendering/RenderThemeMac.mm:
1431         (WebCore::RenderThemeMac::paintAttachment):
1432         We use NSColors with CoreText, which requires that Cocoa knows the current
1433         CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
1434         Otherwise, sometimes (especially when dragging), it will try to apply the
1435         text foreground color to a null context, complain to the system log, and fail
1436         to render the text.
1437
1438 2015-03-04  Jer Noble  <jer.noble@apple.com>
1439
1440         [Mac] YouTube playback at 1.5x speed has audible distortion
1441         https://bugs.webkit.org/show_bug.cgi?id=142280
1442
1443         Reviewed by Eric Carlson.
1444
1445         Use the high-quality AVAudioTimePitchAlgorithmSpectral algorithm for the 
1446         AVSampleBufferAudioRenderer rather than its default value of 
1447         AVAudioTimePitchAlgorithmTimeDomain.
1448
1449         Drive-by fix:
1450
1451         Might as well add support for MediaPlayer::setPreservesPitch() while we're
1452         changing the audio pitch algorithm. If preservesPitch() is false use the
1453         AVAudioTimePitchAlgorithmVarispeed algorithm in both AVFObjC-based media players
1454         (MediaPlayerPrivateAVFoundationObjC & MediaPlayerPrivateMediaSourceAVFObjC).
1455
1456         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1457         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1458         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1459         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch):
1460         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Deleted.
1461         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1462         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1463         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1464         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1465
1466 2015-03-04  Jer Noble  <jer.noble@apple.com>
1467
1468         [MSE][EME][Mac] Calling close on a MediaKeysSession will cause many decoding errors to be emitted
1469         https://bugs.webkit.org/show_bug.cgi?id=142285
1470
1471         Reviewed by Eric Carlson.
1472
1473         When a MediaKeySession (backed by CDMSessionMediaSourceAVFObjC) is closed and the
1474         underlying AVStreamSession is invalidated, the decryption context for in-flight
1475         CMSampleBuffers is also invalidated, and the AVSampleBufferDisplayLayer will issue
1476         one error for each enqueued and un-displayed sample in its image-queue. -flush-ing
1477         the AVSampleBufferDisplayLayer is not enough, as the flush only takes effect
1478         asynchronously the next time the layer needs new samples.
1479
1480         Add a workaround until framework-level support lands to fully flush enqueued and
1481         encrypted frames.
1482
1483         When the CDMSessionMediaSOurceAVFObjC object recieves an error from the layer,
1484         check to see if the session has been stopped. If so, and if the error in question is
1485         one that indicates that the samples decryption context has been invalidated, suppress
1486         the error and instruct the sender to suppress the error as well. This workaround will
1487         be removed once real support for synchronous flushing lands in <rdar://problem/20027434.>
1488
1489         Still, we'll make our best effort to flush undisplayed frames when our CDM session is
1490         invalidated. Move away from std::map and instead use HashMap to store the set of 
1491         AVSampleBufferAudioRenderers. This allows us to use C++11 style loops against just
1492         the HashMap's set of values.
1493
1494         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1495         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1496         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys): Flush and set m_stopped.
1497         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Check m_stopped and the
1498             error code and bail before issuing the error.
1499         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Ditto.
1500         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1501         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1502         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): Drive-by fix. Check whether
1503             the layer is in the set of listened-to layers only back in the main thread; the
1504             listnener may have been unregistered by the time the main thread was called.
1505         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): std::map -> HashMap.
1506         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Ditto.
1507         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Ditto.
1508         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
1509         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
1510         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
1511         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
1512         (WebCore::SourceBufferPrivateAVFObjC::flush): Added; call -flush on all the display
1513             layers and audio renderers.
1514         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Check if any clients
1515             asked to ignore the error, and if so, bail.
1516         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Ditto.
1517
1518 2015-03-04  Alex Christensen  <achristensen@webkit.org>
1519
1520         Update bindings tests after r181001.
1521
1522         * bindings/scripts/test/JS/*.cpp:
1523         Class names changed to auto.
1524
1525 2015-03-04  Brent Fulgham  <bfulgham@apple.com>
1526
1527         [Win] Missing dependency checking in DerivedSources.make for FeatureDefines.props
1528         https://bugs.webkit.org/show_bug.cgi?id=142284
1529
1530         Reviewed by David Kilzer.
1531
1532         Make DerivedSources.make understand its build dependency on FeatureDefines.props
1533         when building on Windows:
1534         1. Modify DerivedSources.make to declare a default dependency (on Windows)
1535            to $(WEBKIT_LIBRARIES)/tools/vsprops/FeatureDefines.props.
1536         2. Update the Windows script 'build-generated-files.pl' to specify the correct
1537            FeatureDefines{Cairo}.props value to use, depending on build environment.
1538
1539         * DerivedSources.make:
1540         * WebCore.vcxproj/build-generated-files.pl:
1541
1542 2015-03-04  Darin Adler  <darin@apple.com>
1543
1544         Make JavaScript binding get and set legacy event listener attributes directly
1545         https://bugs.webkit.org/show_bug.cgi?id=142282
1546
1547         Reviewed by Sam Weinig.
1548
1549         Test: fast/dom/legacy-event-handler-attributes.html
1550
1551         This patch changes the JavaScript getters and setters for these attributes
1552         to work directly without requiring any functions in the C++ DOM implementation.
1553         A subsequent patch will remove the now-unused C++ DOM implementation.
1554
1555         * bindings/js/JSEventListener.cpp:
1556         (WebCore::legacyEventListenerAttribute): Added.
1557         (WebCore::createEventListenerForLegacyAttribute): Added.
1558         (WebCore::setLegacyEventListenerAttribute): Added.
1559         (WebCore::legacyWindowEventListenerAttribute): Added.
1560         (WebCore::setLegacyWindowEventListenerAttribute): Added.
1561
1562         * bindings/js/JSEventListener.h:
1563         (WebCore::createJSEventListenerForAttribute): Deleted.
1564
1565         * bindings/scripts/CodeGeneratorJS.pm:
1566         (GenerateAttributeEventListenerCall): Deleted.
1567         (LegacyEventListenerAttributeEventName): Added.
1568         (LegacyEventListenerAttributePrefix): Added.
1569         (GenerateImplementation): Use "auto" in lots of places to simplify the code
1570         generation. Replaced the old inlined code to deal with legacy event listener
1571         attributes with code that simply calls the new functions from JSEventLister.h.
1572         (GenerateCallWith): Use "auto".
1573         (GenerateConstructorDefinition): Ditto.
1574
1575 2015-03-03  Sam Weinig  <sam@webkit.org>
1576
1577         [Content Extensions] Split parsing and compiling of content extensions into their own files
1578         https://bugs.webkit.org/show_bug.cgi?id=142259
1579
1580         Reviewed by Anders Carlsson.
1581
1582         Added new unit test:
1583             ContentFilterTest.Basic
1584
1585         * WebCore.xcodeproj/project.pbxproj:
1586         Add new files (CompiledContentExtension.h/cpp, ContentExtensionCompiler.h/cpp, and ContentExtensionParser.h/cpp)
1587
1588         * contentextensions/CompiledContentExtension.cpp: Added.
1589         * contentextensions/CompiledContentExtension.h: Added.
1590         Add new class for holding onto the compiled content extension itself. Make it ThreadSafeRefCounted so it is easy
1591         to move between threads which will be important in a subsequent patch where we enable compilation on a background
1592         thread.
1593
1594         * contentextensions/ContentExtensionCompiler.cpp: Added.
1595         (WebCore::ContentExtensions::serializeActions):
1596         (WebCore::ContentExtensions::compileRuleList):
1597         * contentextensions/ContentExtensionCompiler.h: Added.
1598         Moving compilation to its own file. Was previously in ContentExtensionsBackend. This is necessary because
1599         we will want to be able to compile without the need of a backend.
1600
1601         * contentextensions/ContentExtensionParser.cpp: Copied from contentextensions/ContentExtensionsManager.cpp.
1602         * contentextensions/ContentExtensionParser.h: Copied from contentextensions/ContentExtensionsManager.h.
1603         Renamed ContentExtensionsManager to ContentExtensionParser, since that is all it is doing.
1604
1605         * contentextensions/ContentExtensionsBackend.cpp:
1606         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
1607         (WebCore::ContentExtensions::ContentExtensionsBackend::removeContentExtension):
1608         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllContentExtensions):
1609         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
1610         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions): Deleted.
1611         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList): Deleted.
1612         (WebCore::ContentExtensions::ContentExtensionsBackend::removeRuleList): Deleted.
1613         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists): Deleted.
1614         * contentextensions/ContentExtensionsBackend.h:
1615         Change the backend to use the new CompiledContentExtension and change the terminology to
1616         reference content extensions, rather than rule lists.
1617
1618         * page/UserContentController.cpp:
1619         (WebCore::UserContentController::addUserContentFilter):
1620         (WebCore::UserContentController::removeUserContentFilter):
1621         (WebCore::UserContentController::removeAllUserContentFilters):
1622         Update for new names and change addUserContentFilter to explicitly compile the JSON
1623         rule list before handing it to the backend. In subsequent changes, addUserContentFilter
1624         should be changed to take the compiled content extension, and it should become the responsibility
1625         of the called (WebKit) to create them.
1626
1627 2015-03-04  Philippe Normand  <pnormand@igalia.com>
1628
1629         [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef
1630         https://bugs.webkit.org/show_bug.cgi?id=142274
1631
1632         Reviewed by Carlos Garcia Campos.
1633
1634         Don't handle scheduling queries if building against versions of
1635         GStreamer older than 1.2.0.
1636
1637         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1638         (webKitWebSrcQueryWithParent):
1639
1640 2015-03-03  Yoav Weiss  <yoav@yoav.ws>
1641
1642         Add a microtask abstraction
1643         https://bugs.webkit.org/show_bug.cgi?id=137496
1644
1645         Reviewed by Sam Weinig.
1646
1647         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
1648         That abstraction is required in order to enable async loading of images,
1649         which is in turn required to enable support for the picture element, as well as
1650         to make sure that the order of properties set on HTMLImageElement has no implications.
1651
1652         A similar patch was rolled back in r180914. This patch is an improved version.
1653
1654         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
1655         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
1656         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
1657         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
1658         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
1659         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
1660         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
1661         (WebCore::MicroTask::~MicroTask):
1662         (WebCore::MicroTask::run): Run the microtask.
1663         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
1664         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
1665         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
1666         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
1667         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
1668         (WebCore::ScriptRunner::timerFired):
1669         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
1670         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
1671         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
1672         (WebCore::HTMLScriptRunner::runScript):
1673         * testing/Internals.cpp: Add a method to queue a test microtask.
1674         (WebCore::Internals::queueMicroTask):
1675         * testing/Internals.h: Add a method to queue a test microtask.
1676         (WebCore::Internals::queueMicroTask):
1677         * testing/Internals.idl: Expose test microtask queueing to test JS.
1678         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
1679         (WebCore::MicroTaskTest::run): Run the microtask
1680         (WebCore::MicroTaskTest::create): Create a test microtask.
1681         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
1682         (WebCore::MicroTaskTest::run):
1683         (WebCore::MicroTaskTest::create):
1684
1685 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
1686
1687         Scroll snap points are not supported on the main frame
1688         https://bugs.webkit.org/show_bug.cgi?id=141973
1689         <rdar://problem/19938393>
1690
1691         Reviewed by Simon Fraser.
1692
1693         No new tests. Tests will be added when the animation behavior is finalized. Manual tests are attached to the bug.
1694
1695         Update the ScrollingTreeFrameScrollingNodeMac class to implement the delegate interface needed by the
1696         ScrollController. This involves the following:
1697         1. Implement scrollOffsetOnAxis: Used by the AxisScrollAnimator to determine the current position of the ScrollableArea.
1698         2. Implement immediateScrollOnAxis: Used by the AxisScrollAnimator to scroll the ScrollableArea
1699
1700         We also need to hold a copy of the snap points vector to send to the scrolling thread.
1701
1702         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1703         (WebCore::convertToLayoutUnits): Added helper function to match Scroll Snap Points API.
1704         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Recognize and react to changes to
1705         Scroll Snap Points on top-level frames.
1706         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Implement delegate method needed by the ScrollController.
1707         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1708         * platform/cocoa/ScrollController.h:
1709         * platform/cocoa/ScrollController.mm:
1710         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Pass snap offsets to AxisScrollSnapAnimator constructor as references.
1711         (WebCore::ScrollController::updateScrollSnapPoints): Added. Used by ScrollingTreeFrameScrollingNodeMac to update scroll snap point
1712         settings in the scrolling thread.
1713         * platform/mac/AxisScrollSnapAnimator.h:
1714         * platform/mac/AxisScrollSnapAnimator.mm:
1715         (WebCore::toWheelEventStatus): Don't ignore the "MayBegin" or "Cancelled" event phases.
1716         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Revise signature to take a reference to the layout units.
1717         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Handle the case where this method gets called from a thread
1718         when the scrollable area has already reached its final destination.
1719         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Handle the possibility that the snap offset point vector might be
1720         empty. Update method to account for m_snapOffsets being a value, instead of a pointer.
1721
1722 2015-03-03  Andy Estes  <aestes@apple.com>
1723
1724         [Content Filtering] Separate unblock handling into its own class
1725         https://bugs.webkit.org/show_bug.cgi?id=142251
1726
1727         Reviewed by Andreas Kling.
1728
1729         Unblock handling is currently supported only for one type of content filter (WebFilterEvaluator) on one
1730         platform (iOS). Having its implementation in ContentFilter is making it difficult to support other filters and
1731         platforms, so let's separate unblock handling into its own class called ContentFilterUnblockHandler.
1732
1733         * WebCore.xcodeproj/project.pbxproj:
1734         * loader/DocumentLoader.cpp:
1735         (WebCore::DocumentLoader::finishedLoading): Passed a ContentFilterUnblockHandler to FrameLoaderClient::contentFilterDidBlockLoad.
1736         (WebCore::DocumentLoader::dataReceived): Ditto.
1737         * loader/FrameLoaderClient.h:
1738         * platform/ContentFilter.h:
1739         * platform/ContentFilterUnblockHandler.h: Copied from Source/WebCore/platform/ios/ContentFilterIOS.mm.
1740         (WebCore::ContentFilterUnblockHandler::clear):
1741         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: Renamed from Source/WebCore/platform/ios/ContentFilterIOS.mm.
1742         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler):
1743         (WebCore::ContentFilterUnblockHandler::encode):
1744         (WebCore::ContentFilterUnblockHandler::decode):
1745         (WebCore::scheme):
1746         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful):
1747         * platform/mac/ContentFilterMac.mm:
1748         (WebCore::ContentFilter::unblockHandler):
1749         (WebCore::ContentFilter::ContentFilter): Deleted.
1750         (WebCore::ContentFilter::encode): Deleted.
1751         (WebCore::ContentFilter::decode): Deleted.
1752
1753 2015-03-03  Alexey Proskuryakov  <ap@apple.com>
1754
1755         [Mac] Track localized name follows locale instead of primary language
1756         https://bugs.webkit.org/show_bug.cgi?id=142242
1757         rdar://problem/20000365
1758
1759         Reviewed by Eric Carlson.
1760
1761         * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::trackDisplayName): Use the
1762         language for localization, as CFBundle does.
1763
1764 2015-03-03  Alex Christensen  <achristensen@webkit.org>
1765
1766         [Win] Unreviewed build fix.
1767
1768         * WebCore.vcxproj/WebCoreIncludeCommon.props:
1769         Include contentextensions subdirectory.
1770
1771 2015-03-03  Alex Christensen  <achristensen@webkit.org>
1772
1773         Prepare to use CSS selectors in content extensions.
1774         https://bugs.webkit.org/show_bug.cgi?id=142227
1775
1776         Reviewed by Benjamin Poulain.
1777
1778         Test: http/tests/usercontentfilter/css-display-none.html
1779
1780         * CMakeLists.txt:
1781         * WebCore.xcodeproj/project.pbxproj:
1782         * contentextensions/ContentExtensionActions.h: Added.
1783         * contentextensions/ContentExtensionRule.cpp:
1784         (WebCore::ContentExtensions::Action::deserialize):
1785         * contentextensions/ContentExtensionRule.h:
1786         (WebCore::ContentExtensions::Action::Action):
1787         (WebCore::ContentExtensions::Action::type):
1788         (WebCore::ContentExtensions::Action::cssSelector):
1789         * contentextensions/ContentExtensionsBackend.cpp:
1790         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
1791         Put action descriptions into a compact format in a Vector 
1792         to be able to be put into one block of shared read-only memory.
1793         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1794         Put an index of the beginning of the description into the NFA instead of the index of the rule
1795         because we will be sharing the descriptions of the actions and not the rules.
1796         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
1797         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
1798         Return a vector of actions to be able to do multiple actions for one URL.
1799         * contentextensions/ContentExtensionsBackend.h:
1800         * contentextensions/ContentExtensionsManager.cpp:
1801         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
1802         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
1803         Added the css-display-none action type, which requires a selector.
1804         (WebCore::ContentExtensions::ExtensionsManager::loadRule):
1805         * loader/cache/CachedResourceLoader.cpp:
1806         (WebCore::CachedResourceLoader::requestResource):
1807         * page/UserContentController.cpp:
1808         (WebCore::UserContentController::actionsForURL):
1809         (WebCore::UserContentController::actionForURL): Deleted.
1810         * page/UserContentController.h:
1811
1812 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
1813
1814         Move scroll animating functions from ScrollAnimator to ScrollController
1815         https://bugs.webkit.org/show_bug.cgi?id=142102
1816         <rdar://problem/20007161>
1817
1818         Reviewed by Simon Fraser.
1819
1820         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html.
1821
1822         Do some refactoring of the various scrolling classes:
1823         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
1824            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
1825         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
1826         3. Move code from ScrollAnimator{Mac} -> ScrollController.
1827         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
1828         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
1829
1830         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
1831         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
1832         events, just as is done for the "event not handled" case in EventHandler.cpp. 
1833         (WebCore::EventHandler::platformCompleteWheelEvent):
1834         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
1835         methods, now that ScrollController is controlling this state.
1836         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1837         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
1838         need to clean up the CFRunLoopTimer.
1839         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Make sure scroll
1840         state is updated after rubber band snap.
1841         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
1842         until Bug1973 is completed.).
1843         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
1844         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
1845         * platform/ScrollAnimator.cpp:
1846         (WebCore::ScrollAnimator::ScrollAnimator):
1847         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
1848         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
1849         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
1850         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
1851         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
1852         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
1853         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
1854         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
1855         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
1856         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
1857         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
1858         * platform/ScrollAnimator.h:
1859         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
1860         (WebCore::ScrollControllerClient::startSnapRubberbandTimer):
1861         (WebCore::ScrollControllerClient::stopSnapRubberbandTimer):
1862         (WebCore::ScrollControllerClient::startScrollSnapTimer):
1863         (WebCore::ScrollControllerClient::stopScrollSnapTimer):
1864         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
1865         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
1866         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
1867         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
1868         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
1869         require client to maintain timers.
1870         (WebCore::ScrollController::snapRubberBand): Ditto.
1871         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
1872         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
1873         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1874         (WebCore::ScrollController::stopScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
1875         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
1876         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
1877         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
1878         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
1879         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
1880         * platform/mac/AxisScrollSnapAnimator.mm:
1881         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Update for 'InAxis' to 'OnAxis' renaming.
1882         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Ditto.
1883         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Ditto.
1884         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Ditto.
1885         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Ditto.
1886         * platform/mac/ScrollAnimatorMac.h:
1887         * platform/mac/ScrollAnimatorMac.mm:
1888         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
1889         controlled in the ScrollController)
1890         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
1891         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
1892         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
1893         * platform/mac/ScrollController.h: Removed.
1894         * platform/mac/ScrollController.mm: Removed.
1895
1896 2015-03-03  Commit Queue  <commit-queue@webkit.org>
1897
1898         Unreviewed, rolling out r180683.
1899         https://bugs.webkit.org/show_bug.cgi?id=142249
1900
1901         Broke fast/css/acid2-pixel.html (Requested by ap on #webkit).
1902
1903         Reverted changeset:
1904
1905         "Setting any of the <object> element plugin controlling
1906         attributes does not have any affect."
1907         https://bugs.webkit.org/show_bug.cgi?id=141936
1908         http://trac.webkit.org/changeset/180683
1909
1910 2015-03-03  Dean Jackson  <dino@apple.com>
1911
1912         Controls panel should have system blurry background
1913         https://bugs.webkit.org/show_bug.cgi?id=142154
1914         <rdar://problem/20000964>
1915
1916         Reviewed by Simon Fraser.
1917
1918         In order to replicate the system style of media controls
1919         on OS X and iOS, we need to expose a special -webkit-appearance.
1920         This patch adds the new property value, and implements
1921         the iOS part of the appearance, which is a blurry shaded
1922         background.
1923
1924         Test: compositing/media-controls-bar-appearance.html
1925
1926         * css/CSSPrimitiveValueMappings.h:
1927         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map the new
1928         keywords from ControlParts.
1929
1930         * css/CSSValueKeywords.in: Add media-controls-light-bar-background
1931         and media-controls-dark-bar-background. Darin suggested they
1932         be sorted, so I did this at the same time.
1933         * platform/ThemeTypes.h: New ControlParts for the values, and
1934         sort the values since they need to be in sync with
1935         CSSValueKeywords.in.
1936
1937         * platform/graphics/GraphicsLayer.h: Expose two new custom appearance
1938         values.
1939         * platform/graphics/ca/GraphicsLayerCA.cpp:
1940         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1941         (WebCore::layerTypeForCustomBackdropAppearance): Helper function.
1942         (WebCore::isCustomBackdropLayerType): Ditto.
1943         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Merge setting
1944         a system backdrop layer in with the code that swaps to/from tiled layers.
1945         (WebCore::GraphicsLayerCA::changeLayerTypeTo): New method that does what
1946         swapFromOrToTiledLayer implemented, but also allows us to change to a
1947         system backdrop layer.
1948         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Deleted.
1949         * platform/graphics/ca/GraphicsLayerCA.h:
1950
1951         * platform/graphics/ca/PlatformCALayer.h: New layer types.
1952         * platform/graphics/ca/mac/PlatformCALayerMac.mm: For now expose these
1953         as regular backdrop layers.
1954         (PlatformCALayerMac::PlatformCALayerMac):
1955         (PlatformCALayerMac::updateCustomAppearance):
1956
1957         * rendering/RenderLayerBacking.cpp:
1958         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Make sure to update
1959         custom appearance,
1960         (WebCore::RenderLayerBacking::updateCustomAppearance): New method.
1961         * rendering/RenderLayerBacking.h:
1962
1963 2015-03-03  Chris Dumez  <cdumez@apple.com>
1964
1965         Access ApplicationCacheStorage global instance via singleton() static member function
1966         https://bugs.webkit.org/show_bug.cgi?id=142239
1967
1968         Reviewed by Anders Carlsson.
1969
1970         Access ApplicationCacheStorage global instance via singleton() static
1971         member function as per WebKit coding style.
1972
1973 2015-03-03  Anders Carlsson  <andersca@apple.com>
1974
1975         Try to fix the build.
1976
1977         * platform/spi/cf/CFNetworkSPI.h:
1978
1979 2015-03-03  Timothy Horton  <timothy_horton@apple.com>
1980
1981         <attachment> label can get very wide, doesn't wrap/truncate
1982         https://bugs.webkit.org/show_bug.cgi?id=142214
1983         <rdar://problem/19982499>
1984
1985         Reviewed by Simon Fraser.
1986
1987         Test: fast/attachment/attachment-label-highlight.html
1988
1989         * rendering/RenderThemeMac.h:
1990         * rendering/RenderThemeMac.mm:
1991         (WebCore::labelTextColorForAttachment):
1992         (WebCore::AttachmentLayout::addLine):
1993         (WebCore::AttachmentLayout::layOutText):
1994         (WebCore::AttachmentLayout::AttachmentLayout):
1995         Make it possible to lay out multiple lines of label text.
1996         We lay out the whole string normally, but then only draw N (where N=1 for now,
1997         but is adjustable) of the lines. The remainder of the string is then
1998         merged into a single line, which is middle-truncated with an ellipsis
1999         and drawn in place of the N+1 line.
2000
2001         (WebCore::addAttachmentLabelBackgroundRightCorner):
2002         (WebCore::addAttachmentLabelBackgroundLeftCorner):
2003         (WebCore::paintAttachmentLabelBackground):
2004         Wrap the label background around the multiple lines of text with curved edges.
2005         We run first down the right side of the label, determining whether to use
2006         concave or convex arcs based on the relative widths of adjacent lines.
2007         Then, we run back up the left side of the label doing the same thing.
2008
2009         If the background rects of two lines are very similar (within the rounded rect radius),
2010         they will be expanded to the larger of the two, because otherwise the arcs
2011         look quite wrong.
2012
2013         (WebCore::paintAttachmentLabel):
2014         Draw the label with CoreText directly instead of bothering with WebCore
2015         text layout primitives. There's no need, and it makes wrapping much more complicated.
2016
2017         (WebCore::RenderThemeMac::paintAttachment):
2018         (WebCore::RenderThemeMac::paintAttachmentLabelBackground): Deleted.
2019         (WebCore::RenderThemeMac::paintAttachmentLabel): Deleted.
2020
2021 2015-03-03  Simon Fraser  <simon.fraser@apple.com>
2022
2023         Avoid applying the clip-path when painting, if a layer also has a shape layer mask
2024         https://bugs.webkit.org/show_bug.cgi?id=142212
2025
2026         Reviewed by Zalan Bujtas.
2027
2028         After r180882 we translate clip-path into a composited shape mask when the layer
2029         is composited. However, we were also still applying the clip-path when painting
2030         the layer contents.
2031         
2032         Now, we set the GraphicsLayer bits GraphicsLayerPaintClipPath and GraphicsLayerPaintMask
2033         only for the m_maskLayer's painting. This translate into setting PaintLayerPaintingCompositingMaskPhase
2034         and PaintLayerPaintingCompositingClipPathPhase only when painting that same mask layer,
2035         rather than always. To ensure that masks and clip-path get applied for software paints,
2036         add shouldPaintMask() and shouldApplyClipPath() that return true for non-composited layers,
2037         and when doing a flattening paint.
2038
2039         * rendering/RenderLayer.cpp:
2040         (WebCore::RenderLayer::paintLayerContents): Use shouldApplyClipPath().
2041         Pull three chunks of code under a single "if (shouldPaintContent && !selectionOnly)" condition.
2042         The condition for paintChildClippingMaskForFragments() is changed slightly; we need to call this
2043         only when painting the clip-path/mask layer contents, but also only when there is no mask to fill
2044         the clipped area for us.
2045         (WebCore::RenderLayer::calculateClipRects):
2046         (WebCore::RenderLayer::paintsWithClipPath): Deleted.
2047         * rendering/RenderLayer.h:
2048         * rendering/RenderLayerBacking.cpp:
2049         (WebCore::RenderLayerBacking::updateMaskingLayer): Be sure to set the GraphicsLayerPaintClipPath bit
2050         when having a mask forces us onto the painting path.
2051
2052 2015-03-03  Anders Carlsson  <andersca@apple.com>
2053
2054         Use the correct display name for website data for local files
2055         https://bugs.webkit.org/show_bug.cgi?id=142228
2056
2057         Reviewed by Dan Bernstein.
2058
2059         * English.lproj/Localizable.strings:
2060         Add local file display name.
2061
2062         * platform/spi/cf/CFNetworkSPI.h:
2063         Add kCFHTTPCookieLocalFileDomain declaration.
2064
2065 2015-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
2066
2067         BreakingContext cleanup
2068         https://bugs.webkit.org/show_bug.cgi?id=142146
2069
2070         Reviewed by Dean Jackson.
2071
2072         1. Use commitLineBreakAtCurrentWidth() instead of directly
2073         updating m_width and m_lineBreak, because the name makes the
2074         intent clearer.
2075         2. Remove duplicate function LineBreaker::nextSegmentBreak().
2076         3. lineStyle() takes care of inspecting RenderText's parent's
2077         style.
2078         4. Add FIXME to BreakingContext::initializeForCurrentObject()
2079         because it seems like we are ignoring first-line style for
2080         some properties.
2081
2082         No new tests because there is no behavior change.
2083
2084         * rendering/line/BreakingContextInlineHeaders.h:
2085         (WebCore::BreakingContext::BreakingContext):
2086         (WebCore::BreakingContext::initializeForCurrentObject):
2087         (WebCore::BreakingContext::handleReplaced):
2088         (WebCore::BreakingContext::handleText):
2089         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2090         (WebCore::BreakingContext::handleEndOfLine):
2091         * rendering/line/LineBreaker.cpp:
2092         (WebCore::LineBreaker::nextLineBreak): Deleted.
2093         (WebCore::LineBreaker::nextSegmentBreak): Deleted.
2094         * rendering/line/LineBreaker.h:
2095         * rendering/line/LineInlineHeaders.h:
2096         (WebCore::lineStyle):
2097
2098 2015-03-03  Chris Dumez  <cdumez@apple.com>
2099
2100         Make AudioContext suspendable when it is not rendering
2101         https://bugs.webkit.org/show_bug.cgi?id=142210
2102         <rdar://problem/19923085>
2103
2104         Reviewed by Eric Carlson.
2105
2106         Make AudioContext suspendable when it is not rendering to increase the
2107         likelihood of entering the PageCache for pages using WebAudio.
2108
2109         This patch adds a state member to AudioContext with 3 possible states:
2110         Suspended / Running / Closed, as defined in the specification:
2111         http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
2112
2113         This state is used to decide if we can suspend the page or not. We
2114         can safely suspend if the AudioContext's state is suspended (did not
2115         start rendering) or closed (Stopped rendering).
2116
2117         Note that this patch does not expose the AudioContext's state to the
2118         Web yet, even though it is exposed in the latest specification.
2119
2120         Tests: fast/history/page-cache-closed-audiocontext.html
2121                fast/history/page-cache-running-audiocontext.html
2122                fast/history/page-cache-suspended-audiocontext.html
2123
2124         * Modules/webaudio/AudioContext.cpp:
2125         (WebCore::AudioContext::AudioContext):
2126         (WebCore::AudioContext::uninitialize):
2127         (WebCore::AudioContext::canSuspend):
2128         (WebCore::AudioContext::startRendering):
2129         (WebCore::AudioContext::fireCompletionEvent):
2130         * Modules/webaudio/AudioContext.h:
2131
2132 2015-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2133
2134         [SOUP] Use SoupMessage::starting instead of SoupSession::request-started
2135         https://bugs.webkit.org/show_bug.cgi?id=142164
2136
2137         Reviewed by Sergio Villar Senin.
2138
2139         SoupSession::request-started is deprecated in libsoup 2.50. Both
2140         signals are equivalent, but SoupMessage::starting is also emitted
2141         for resources loaded from the disk cache. This fixes web timing
2142         calculations for cached resources, since we were not initializing
2143         m_requestStart.
2144
2145         * platform/network/soup/ResourceHandleSoup.cpp:
2146         (WebCore::startingCallback):
2147         (WebCore::createSoupMessageForHandleAndRequest):
2148         * platform/network/soup/SoupNetworkSession.cpp:
2149         (WebCore::SoupNetworkSession::SoupNetworkSession):
2150
2151 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2152
2153         [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
2154         https://bugs.webkit.org/show_bug.cgi?id=141508
2155
2156         Reviewed by Sergio Villar Senin.
2157
2158         Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
2159         synchronous message instead of increasing the maximum number of
2160         connections allowed if the soup version is recent enough.
2161         The current solution of increasing/decreasing the limits doesn't
2162         always work, because connections are not marked as IDLE in libsoup
2163         until the message is unqueued, but we don't wait for the message
2164         to be unqueued to finish our loads in WebKit, we finish them as
2165         soon as we have finished reading the stream. This causes that
2166         synchronous loads keep blocked in the nested main loop until the
2167         timeout of 10 seconds is fired and the load fails.
2168         Also marked WebCoreSynchronousLoader class as final, the virtual
2169         methods as override and removed the unsused method isSynchronousClient.
2170
2171         * platform/network/soup/ResourceHandleSoup.cpp:
2172         (WebCore::createSoupMessageForHandleAndRequest):
2173         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
2174         (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
2175         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
2176         (WebCore::WebCoreSynchronousLoader::didReceiveData):
2177         (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
2178         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
2179         (WebCore::WebCoreSynchronousLoader::didFail):
2180         (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
2181         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
2182
2183 2015-03-02  David Kilzer  <ddkilzer@apple.com>
2184
2185         [iOS] Disable -Wdeprecated-declaration warnings in WebVideoFullscreenInterfaceAVKit.mm
2186
2187         Fixing the deprecations is tracked by: <rdar://problem/20018692>
2188
2189         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2190         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized):
2191         Ignore -Wdeprecated-declaration warnings via clang pragmas.
2192
2193 2015-03-02  Commit Queue  <commit-queue@webkit.org>
2194
2195         Unreviewed, rolling out r180902.
2196         https://bugs.webkit.org/show_bug.cgi?id=142205
2197
2198         It broke scrolling in some cases. See bug 142202 for details.
2199         (Requested by bdash on #webkit).
2200
2201         Reverted changeset:
2202
2203         "Move scroll animating functions from ScrollAnimator to
2204         ScrollController"
2205         https://bugs.webkit.org/show_bug.cgi?id=142102
2206         http://trac.webkit.org/changeset/180902
2207
2208 2015-03-02  Commit Queue  <commit-queue@webkit.org>
2209
2210         Unreviewed, rolling out r180911.
2211         https://bugs.webkit.org/show_bug.cgi?id=142204
2212
2213         The tests it added are crashing (Requested by bdash on
2214         #webkit).
2215
2216         Reverted changeset:
2217
2218         "Add a microtask abstraction"
2219         https://bugs.webkit.org/show_bug.cgi?id=137496
2220         http://trac.webkit.org/changeset/180911
2221
2222 2015-03-02  Yoav Weiss  <yoav@yoav.ws>
2223
2224         Add a microtask abstraction
2225         https://bugs.webkit.org/show_bug.cgi?id=137496
2226
2227         Reviewed by Sam Weinig.
2228
2229         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
2230         That abstraction is required in order to enable async loading of images,
2231         which is in turn required to enable support for the picture element, as well as
2232         to make sure that the order of properties set on HTMLImageElement has no implications.
2233
2234         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
2235         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
2236         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
2237         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
2238         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
2239         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
2240         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
2241         (WebCore::MicroTask::~MicroTask):
2242         (WebCore::MicroTask::run): Run the microtask.
2243         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
2244         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
2245         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
2246         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
2247         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
2248         (WebCore::ScriptRunner::timerFired):
2249         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
2250         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2251         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
2252         (WebCore::HTMLScriptRunner::runScript):
2253         * testing/Internals.cpp: Add a method to queue a test microtask.
2254         (WebCore::Internals::queueMicroTask):
2255         * testing/Internals.h: Add a method to queue a test microtask.
2256         (WebCore::Internals::queueMicroTask):
2257         * testing/Internals.idl: Expose test microtask queueing to test JS.
2258         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
2259         (WebCore::MicroTaskTest::run): Run the microtask
2260         (WebCore::MicroTaskTest::create): Create a test microtask.
2261         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
2262         (WebCore::MicroTaskTest::run):
2263         (WebCore::MicroTaskTest::create):
2264
2265 2015-03-02  Jeremy Jones  <jeremyj@apple.com>
2266
2267         RenderVideo should not paint the video frame when video is fullscreen.
2268         https://bugs.webkit.org/show_bug.cgi?id=142097
2269
2270         Reviewed by Eric Carlson.
2271
2272         For performance and correctness, RenderVideo should not paint the current video frame
2273         inline when video is fullscreen. This happens when snapshots are taken and can have a
2274         negative performance impact.
2275
2276         * rendering/RenderVideo.cpp:
2277         (WebCore::RenderVideo::paintReplaced):
2278
2279 2015-03-02  Dean Jackson  <dino@apple.com>
2280
2281         [iOS Media] Airplay button should be blue when active
2282         https://bugs.webkit.org/show_bug.cgi?id=142193
2283
2284         Reviewed by Brent Fulgham.
2285
2286         Add a blue form of the Airplay button that is used
2287         when we are actively displaying on another screen.
2288
2289         * Modules/mediacontrols/mediaControlsiOS.css:
2290         (video::-webkit-media-controls-wireless-playback-picker-button):
2291         (video::-webkit-media-controls-wireless-playback-picker-button:active):
2292         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
2293         * Modules/mediacontrols/mediaControlsiOS.js:
2294         (ControllerIOS.prototype.updateWirelessPlaybackStatus):
2295
2296 2015-03-02  Brent Fulgham  <bfulgham@apple.com>
2297
2298         Move scroll animating functions from ScrollAnimator to ScrollController
2299         https://bugs.webkit.org/show_bug.cgi?id=142102
2300         <rdar://problem/20007161>
2301
2302         Reviewed by Simon Fraser.
2303
2304         No change in functionality.
2305         
2306         Do some refactoring of the various scrolling classes:
2307         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
2308            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
2309         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
2310         3. Move code from ScrollAnimator{Mac} -> ScrollController.
2311         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
2312         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
2313
2314         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
2315         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
2316         events, just as is done for the "event not handled" case in EventHandler.cpp. 
2317         (WebCore::EventHandler::platformCompleteWheelEvent):
2318         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
2319         methods, now that ScrollController is controlling this state.
2320         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2321         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
2322         need to clean up the CFRunLoopTimer.
2323         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
2324         until Bug 141973 is completed.).
2325         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
2326         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
2327         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
2328         * platform/ScrollAnimator.cpp:
2329         (WebCore::ScrollAnimator::ScrollAnimator):
2330         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
2331         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
2332         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
2333         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
2334         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
2335         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
2336         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
2337         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
2338         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
2339         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
2340         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
2341         * platform/ScrollAnimator.h:
2342         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
2343         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
2344         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
2345         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
2346         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
2347         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
2348         require client to maintain timers.
2349         (WebCore::ScrollController::snapRubberBand): Ditto.
2350         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
2351         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
2352         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
2353         (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
2354         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
2355         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
2356         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
2357         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
2358         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
2359         * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
2360         * platform/mac/ScrollAnimatorMac.h:
2361         * platform/mac/ScrollAnimatorMac.mm:
2362         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
2363         controlled in the ScrollController)
2364         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
2365         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
2366         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
2367         * platform/mac/ScrollController.h: Removed.
2368         * platform/mac/ScrollController.mm: Removed.
2369
2370 2015-03-02  Mark Lam  <mark.lam@apple.com>
2371
2372         The InspectorTimelineAgent should gracefully handle attempts to start more than once.
2373         <https://webkit.org/b/142189>
2374
2375         Reviewed by Joseph Pecoraro.
2376
2377         No new tests.  Unskipped an existing test that already asserts this.
2378
2379         InspectorTimelineAgent::internalStop() already checks for redundant calls to it in
2380         case the InspectorTimelineAgent is already disabled. Similarly,
2381         InspectorTimelineAgent::internalStart() should check if the InspectorTimelineAgent
2382         is already enabled before proceeding to do work to enable it. Though wasteful,
2383         it is legal for clients of the InspectorTimelineAgent to invoke start on it more
2384         than once. Hence, this check is needed.
2385
2386         This check fixes the debug assertion failure when running the
2387         inspector/timeline/debugger-paused-while-recording.html test. The test can now
2388         be unskipped.
2389
2390         * inspector/InspectorTimelineAgent.cpp:
2391         (WebCore::InspectorTimelineAgent::internalStart):
2392
2393 2015-03-02  Roger Fong  <roger_fong@apple.com>
2394
2395         Update backgrounds of sliders for inline media controls on OS X.
2396         https://bugs.webkit.org/show_bug.cgi?id=142188.
2397         <rdar://problem/20012413>
2398
2399         Reviewed by Dean Jackson.
2400
2401         Don’t use CSS to draw volume and timeline slider backgrounds.
2402         * Modules/mediacontrols/mediaControlsApple.css:
2403         (video::-webkit-media-controls-volume-slider):
2404         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb):
2405         (audio::-webkit-media-controls-timeline):
2406         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
2407         (audio::-webkit-media-controls-panel .thumbnail-track):
2408         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb:active::-webkit-slider-thumb): Deleted.
2409         (audio::-webkit-media-controls-timeline:active::-webkit-slider-thumb,): Deleted.
2410
2411         Draw volume and timeline slider backgrounds using 2d canvases.
2412         * Modules/mediacontrols/mediaControlsApple.js:
2413         (Controller.prototype.createControls):
2414         (Controller.prototype.handleVolumeSliderInput):
2415         (Controller.prototype.addRoundedRect):
2416         (Controller.prototype.drawTimelineBackground):
2417         (Controller.prototype.drawVolumeBackground):
2418         (Controller.prototype.showControls):
2419         * Modules/mediacontrols/mediaControlsiOS.js:
2420         (ControllerIOS.prototype.addRoundedRect): Deleted.
2421
2422 2015-03-01  Roger Fong  <roger_fong@apple.com>
2423
2424         Update inline media element controls appearance Part 1.
2425         https://bugs.webkit.org/show_bug.cgi?id=142138.
2426         <rdar://problem/19997384>
2427
2428         Reviewed by Dean Jackson.
2429
2430         Update positioning, sizes, and background colors media control elements.
2431         Volume and timeline sliders will be drawn in a separate patch via 2d canvases.
2432
2433         * Modules/mediacontrols/mediaControlsApple.css:
2434         (audio::-webkit-media-controls-panel):
2435         (video::-webkit-media-controls-panel):
2436         (audio::-webkit-media-controls-rewind-button):
2437         (audio::-webkit-media-controls-play-button):
2438         (audio::-webkit-media-controls-panel .mute-box):
2439         (video::-webkit-media-controls-volume-max-button):
2440         (audio::-webkit-media-controls-panel .volume-box):
2441         (audio::-webkit-media-controls-panel .volume-box:active):
2442         (video::-webkit-media-controls-volume-slider):
2443         (audio::-webkit-media-controls-toggle-closed-captions-button):
2444         (audio::-webkit-media-controls-fullscreen-button):
2445         (audio::-webkit-media-controls-current-time-display):
2446         (audio::-webkit-media-controls-time-remaining-display):
2447         (audio::-webkit-media-controls-timeline-container .hour-long-time): Deleted.
2448
2449 2015-03-02  David Kilzer  <ddkilzer@apple.com>
2450
2451         REGRESSION (r180882): Build failure: Methods not marked override in GraphicsLayerCA.h
2452         <http://webkit.org/b/138684>
2453
2454         Fixes the following build failures:
2455
2456             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
2457             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
2458             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
2459             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:123:33: error: 'setShapeLayerPath' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2460                 WEBCORE_EXPORT virtual void setShapeLayerPath(const Path&);
2461                                             ^
2462             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
2463             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
2464             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
2465             WebCore.framework/PrivateHeaders/GraphicsLayer.h:390:18: note: overridden virtual function is here
2466                 virtual void setShapeLayerPath(const Path&);
2467                              ^
2468             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
2469             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
2470             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
2471             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:124:33: error: 'setShapeLayerWindRule' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2472                 WEBCORE_EXPORT virtual void setShapeLayerWindRule(WindRule);
2473                                             ^
2474             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
2475             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
2476             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
2477             WebCore.framework/PrivateHeaders/GraphicsLayer.h:393:18: note: overridden virtual function is here
2478                 virtual void setShapeLayerWindRule(WindRule);
2479                              ^
2480             2 errors generated.
2481
2482         * platform/graphics/ca/GraphicsLayerCA.h:
2483         (WebCore::GraphicsLayer::setShapeLayerPath): Mark as override.
2484         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
2485
2486 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
2487
2488         Make clip-path work on <video>, <canvas> etc.
2489         https://bugs.webkit.org/show_bug.cgi?id=138684
2490
2491         Reviewed by Darin Adler.
2492         
2493         clip-path only worked in compositing layers on the painted contents of the layer,
2494         and failed to clip children. Fix this by translating the clip path into a Path
2495         which is set on a CA shape layer (for Mac and iOS), or painted into the
2496         RenderLayerBacking's mask layer. There are two code paths:
2497
2498         1. clip-path which is a <basic-shape> or <geometry-box>, and no mask.
2499             Here we can use the optimal code path of converting the clip into a path
2500             that is put onto a CAShapeLayer, which is then used as a mask. There is no
2501             additional backing store.
2502         2. clip-path with an SVG reference, or clip-path combined with -webkit-mask:
2503             Here we have to allocate backing store for the mask layer, and paint the
2504             clip path (possibly with the mask).
2505         
2506         We add GraphicsLayer::Type::Shape, and add a getter for the layer type.
2507
2508         Tests: compositing/masks/compositing-clip-path-and-mask.html
2509                compositing/masks/compositing-clip-path-mask-change.html
2510                compositing/masks/compositing-clip-path.html
2511                compositing/masks/reference-clip-path-on-composited.html
2512
2513         * platform/graphics/GraphicsLayer.cpp:
2514         (WebCore::GraphicsLayer::GraphicsLayer): Store the type in the layer so the getter can return it.
2515         (WebCore::GraphicsLayer::shapeLayerPath): Get and set the shape layer path.
2516         (WebCore::GraphicsLayer::setShapeLayerPath): Ditto.
2517         (WebCore::GraphicsLayer::shapeLayerWindRule): Get and set the shape layer wind rule.
2518         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
2519         * platform/graphics/GraphicsLayer.h:
2520         (WebCore::GraphicsLayer::type): Expose the type.
2521         (WebCore::GraphicsLayer::supportsLayerType): Allow the cross-platform code to use
2522         shape layers when it knows they are available.
2523         (WebCore::GraphicsLayer::needsClippingMaskLayer): Deleted. This was never used.
2524         * platform/graphics/GraphicsLayerClient.h: Align the bits (helps avoid typos). Add a
2525         GraphicsLayerPaintClipPath phase.
2526         * platform/graphics/Path.h: Some exports since WK2 needs to encode Paths now.
2527         * platform/graphics/ca/GraphicsLayerCA.cpp:
2528         (WebCore::GraphicsLayerCA::initialize): Make shape layers.
2529         (WebCore::GraphicsLayerCA::setShapeLayerPath): Setter for the shape path. Sadly we
2530         can't early return on unchanged paths yet.
2531         (WebCore::GraphicsLayerCA::setShapeLayerWindRule):
2532         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Updates for shape path
2533         and wind rule.
2534         (WebCore::GraphicsLayerCA::updateShape):
2535         (WebCore::GraphicsLayerCA::updateWindRule):
2536         * platform/graphics/ca/GraphicsLayerCA.h: Some new dirty bits for shape path and wind rule.
2537         * platform/graphics/ca/PlatformCALayer.h:
2538         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2539         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Got rid of lots of m_layer.get().
2540         (PlatformCALayerMac::~PlatformCALayerMac):
2541         (PlatformCALayerMac::setNeedsDisplay):
2542         (PlatformCALayerMac::setNeedsDisplayInRect):
2543         (PlatformCALayerMac::removeFromSuperlayer):
2544         (PlatformCALayerMac::setSublayers):
2545         (PlatformCALayerMac::removeAllSublayers):
2546         (PlatformCALayerMac::appendSublayer):
2547         (PlatformCALayerMac::insertSublayer):
2548         (PlatformCALayerMac::replaceSublayer):
2549         (PlatformCALayerMac::adoptSublayers):
2550         (PlatformCALayerMac::addAnimationForKey):
2551         (PlatformCALayerMac::removeAnimationForKey):
2552         (PlatformCALayerMac::animationForKey):
2553         (PlatformCALayerMac::setMask):
2554         (PlatformCALayerMac::isOpaque):
2555         (PlatformCALayerMac::setOpaque):
2556         (PlatformCALayerMac::bounds):
2557         (PlatformCALayerMac::setBounds):
2558         (PlatformCALayerMac::position):
2559         (PlatformCALayerMac::setPosition):
2560         (PlatformCALayerMac::anchorPoint):
2561         (PlatformCALayerMac::setAnchorPoint):
2562         (PlatformCALayerMac::transform):
2563         (PlatformCALayerMac::setTransform):
2564         (PlatformCALayerMac::sublayerTransform):
2565         (PlatformCALayerMac::setSublayerTransform):
2566         (PlatformCALayerMac::setHidden):
2567         (PlatformCALayerMac::setGeometryFlipped):
2568         (PlatformCALayerMac::isDoubleSided):
2569         (PlatformCALayerMac::setDoubleSided):
2570         (PlatformCALayerMac::masksToBounds):
2571         (PlatformCALayerMac::setMasksToBounds):
2572         (PlatformCALayerMac::acceleratesDrawing):
2573         (PlatformCALayerMac::setAcceleratesDrawing):
2574         (PlatformCALayerMac::contents):
2575         (PlatformCALayerMac::setContents):
2576         (PlatformCALayerMac::setContentsRect):
2577         (PlatformCALayerMac::setMinificationFilter):
2578         (PlatformCALayerMac::setMagnificationFilter):
2579         (PlatformCALayerMac::backgroundColor):
2580         (PlatformCALayerMac::setBackgroundColor):
2581         (PlatformCALayerMac::setBorderWidth):
2582         (PlatformCALayerMac::setBorderColor):
2583         (PlatformCALayerMac::opacity):
2584         (PlatformCALayerMac::setOpacity):
2585         (PlatformCALayerMac::copyFiltersFrom):
2586         (PlatformCALayerMac::setName):
2587         (PlatformCALayerMac::setSpeed):
2588         (PlatformCALayerMac::setTimeOffset):
2589         (PlatformCALayerMac::contentsScale):
2590         (PlatformCALayerMac::setContentsScale):
2591         (PlatformCALayerMac::cornerRadius):
2592         (PlatformCALayerMac::setCornerRadius):
2593         (PlatformCALayerMac::setEdgeAntialiasingMask):
2594         (PlatformCALayerMac::shapeWindRule): New function.
2595         (PlatformCALayerMac::setShapeWindRule): Ditto.
2596         (PlatformCALayerMac::shapePath): Ditto.
2597         (PlatformCALayerMac::setShapePath): Ditto.
2598         (PlatformCALayer::isWebLayer):
2599         * platform/graphics/cg/PathCG.cpp:
2600         (WebCore::Path::Path): nullptr.
2601         * rendering/RenderLayer.cpp:
2602         (WebCore::RenderLayer::paintsWithClipPath): Return true if the clip path is painted.
2603         (WebCore::RenderLayer::computeClipPath): Factor code that computes the clip path into this
2604         function, so we can call it from RenderLayerBacking too.
2605         (WebCore::RenderLayer::setupClipPath):
2606         (WebCore::RenderLayer::paintLayerContents): We only want to apply the clip path
2607         for painting when we're either painting a non-composited layer, or we're painting the
2608         mask layer of a composited layer. We in the latter case, we just want to fill the clip
2609         path with black, so re-use the paintChildClippingMaskForFragments() which does this.
2610         * rendering/RenderLayer.h: Align the bits, add PaintLayerPaintingCompositingClipPathPhase.
2611         * rendering/RenderLayerBacking.cpp:
2612         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2613         (WebCore::RenderLayerBacking::updateConfiguration):
2614         (WebCore::RenderLayerBacking::updateGeometry): Move mask updating into its own function.
2615         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): If we're using the shape layer
2616         code path, compute the Path and set it and the wind rule on the mask layer.
2617         (WebCore::RenderLayerBacking::updateMaskingLayer): This is now more complex, as it has
2618         to deal with combinations of clip-path and mask, some of which allow for the shape layer
2619         mask, and we handle dynamic changes between these and painted masks.
2620         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer): Include the GraphicsLayerPaintClipPath phase.
2621         (WebCore::RenderLayerBacking::paintIntoLayer): Map GraphicsLayerPaintClipPath to PaintLayerPaintingCompositingClipPathPhase.
2622         (WebCore::RenderLayerBacking::updateMaskLayer): Deleted.
2623         * rendering/RenderLayerBacking.h:
2624
2625 2015-03-01  Hunseop Jeong  <hs85.jeong@samsung.com>
2626
2627         [Cairo] Implement Path::addEllipse 
2628         https://bugs.webkit.org/show_bug.cgi?id=142144
2629
2630         Reviewed by Gyuyoung Kim.
2631
2632         Add support for addEllipse method for platforms using cairo.
2633
2634         * platform/graphics/cairo/PathCairo.cpp:
2635         (WebCore::Path::addEllipse):
2636
2637 2015-03-01  Joonghun Park  <jh718.park@samsung.com>
2638
2639         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ScrollAnimator
2640         https://bugs.webkit.org/show_bug.cgi?id=142143
2641
2642         Reviewed by Darin Adler.
2643
2644         No new tests, no behavior changes.
2645
2646         * platform/ScrollAnimator.cpp:
2647         (WebCore::ScrollAnimator::create):
2648         * platform/ScrollAnimator.h:
2649         * platform/ScrollAnimatorNone.cpp:
2650         (WebCore::ScrollAnimator::create):
2651         * platform/ScrollableArea.h:
2652         * platform/ios/ScrollAnimatorIOS.mm:
2653         (WebCore::ScrollAnimator::create):
2654         * platform/mac/ScrollAnimatorMac.mm:
2655         (WebCore::ScrollAnimator::create):
2656
2657 2015-02-26  Andy Estes  <aestes@apple.com>
2658
2659         [Content Filtering] Move another declaration to WebFilterEvaluatorSPI.h
2660         https://bugs.webkit.org/show_bug.cgi?id=142066
2661
2662         Reviewed by Andreas Kling.
2663
2664         * platform/ios/ContentFilterIOS.mm:
2665         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
2666
2667 2015-03-01  Chris Dumez  <cdumez@apple.com>
2668
2669         Make NotificationCenter / Notification suspendable
2670         https://bugs.webkit.org/show_bug.cgi?id=142117
2671         <rdar://problem/19923085>
2672
2673         Reviewed by Andreas Kling.
2674
2675         Make NotificationCenter / Notification suspendable so that pages using
2676         them can enter the PageCache.
2677
2678         NotificationCenter can safely be suspended if there are no pending
2679         permission requests. This required adding an
2680         "hasPendingPermissionRequests()" callback to the NotificationClient.
2681
2682         Notification can safely be suspended if it is either idle (not showing
2683         yet) or closed.
2684
2685         Tests: fast/history/page-cache-notification-non-suspendable.html
2686                fast/history/page-cache-notification-suspendable.html
2687
2688         * Modules/notifications/Notification.cpp:
2689         (WebCore::Notification::canSuspend):
2690         * Modules/notifications/NotificationCenter.cpp:
2691         (WebCore::NotificationCenter::canSuspend):
2692         * Modules/notifications/NotificationClient.h:
2693
2694 2015-03-01  Ryosuke Niwa  <rniwa@webkit.org>
2695
2696         isContentEditable shouldn't trigger synchronous style recalc in most cases
2697         https://bugs.webkit.org/show_bug.cgi?id=129034
2698
2699         Reviewed by Antti Koivisto.
2700
2701         Avoid style recalc inside isContentEditable when the document doesn't contain -webkit-user-modify or
2702         -webkit-user-select: all. Instead, compute the value from contenteditable attributes in ancestors.
2703         However, still compute the editability from the style tree when it's up-to-date in order to avoid
2704         repeatedly walking up the DOM tree in a hot code path inside editing.
2705
2706         Test: fast/dom/HTMLElement/dynamic-editability-change.html
2707
2708         * css/CSSGrammar.y.in: No need to pass in "true" as we never call this function with false.
2709         * css/CSSParser.cpp:
2710         (WebCore::isValidKeywordPropertyAndValue): Calls parserSetUsesStyleBasedEditability as needed.
2711         (WebCore::parseKeywordValue): Passes around StyleSheetContents*.
2712         (WebCore::CSSParser::parseValue): Ditto.
2713         (WebCore::CSSParser::parseFont): Ditto.
2714
2715         * css/StyleSheetContents.cpp:
2716         (WebCore::StyleSheetContents::StyleSheetContents): Initializes and copies m_usesStyleBasedEditability.
2717
2718         * css/StyleSheetContents.h:
2719         (WebCore::StyleSheetContents::parserSetUsesRemUnits): Removed the argument since it was always true.
2720         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability): Added.
2721         (WebCore::StyleSheetContents::usesStyleBasedEditability): Added.
2722
2723         * dom/Document.cpp:
2724         (WebCore::Document::recalcStyle): Added a FIXME as well as a comment explaining why we don't call
2725         setUsesStyleBasedEditability. Since Node::computeEditability triggers style recalc only when the flag
2726         is set to true, it's too late to update the flag here.
2727         (WebCore::Document::updateStyleIfNeeded): Uses a newly extracted needsStyleRecalc.
2728         (WebCore::Document::updateBaseURL): Preserves m_usesStyleBasedEditability as well as m_usesRemUnit.
2729         (WebCore::Document::usesStyleBasedEditability): Added. Returns true when inline style declarations or
2730         any active stylesheet uses -webkit-user-modify or -webkit-user-select: all. Flushing pending stylesheet
2731         changes here is fine because the alternative is to trigger a full blown style recalc.
2732
2733         * dom/Document.h:
2734         (WebCore::Document::needsStyleRecalc): Added. Extracted from updateStyleIfNeeded.
2735
2736         * dom/DocumentStyleSheetCollection.cpp:
2737         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
2738         (WebCore::styleSheetsUseRemUnits): Deleted.
2739         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Updates m_usesStyleBasedEditability
2740         as well as m_usesRemUnit.
2741
2742         * dom/DocumentStyleSheetCollection.h:
2743         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Added.
2744         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Added.
2745
2746         * dom/Node.cpp:
2747         (WebCore::computeEditabilityFromComputedStyle): Extracted from computeEditability.
2748         (WebCore::Node::computeEditability): When the style recalc is requested and the render tree is dirty,
2749         check if the document uses any CSS property that can affect the editability of elements. If it doesn't,
2750         compute the editability from contenteditable attributes in the anchors via matchesReadWritePseudoClass.
2751         Continue to use the style-based computation when the render tree isn't dirty to avoid the tree walk.
2752
2753         * html/HTMLElement.cpp:
2754         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Extracted from matchesReadWritePseudoClass
2755         to be called in Node::computeEditability. Also made it return Editability instead of boolean.
2756         (WebCore::HTMLElement::matchesReadWritePseudoClass):
2757         * html/HTMLElement.h:
2758
2759 2015-03-01  Brent Fulgham  <bfulgham@apple.com>
2760
2761         [Win] Unreviewed build fix.
2762
2763         * WebCorePrefix.h: Provide some default definitions to help build on Windows
2764         machines with different application support libraries.
2765
2766 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2767
2768         Viewport units should not dirty style just before we do layout
2769         https://bugs.webkit.org/show_bug.cgi?id=141682
2770
2771         Reviewed by Zalan Bujtas.
2772         
2773         In documents using viewport units, we dirtied style every time layout changed
2774         the size of the document. This is nonsensical, because viewport units depend on the
2775         viewport size, not the document size.
2776         
2777         Move the style dirtying from layout() into availableContentSizeChanged(). Hook
2778         this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and,
2779         since that causes availableContentSizeChanged() to be called for WK1 for the first
2780         time, protect the call to updateScrollbars() with a !platformWidget check.
2781
2782         Covered by existing viewport unit tests.
2783
2784         * page/FrameView.cpp:
2785         (WebCore::FrameView::layout):
2786         (WebCore::FrameView::availableContentSizeChanged):
2787         (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether
2788         scrollbars are ignored depends on the value of the overflow property on the root element.
2789         * page/FrameView.h:
2790         * platform/ScrollView.cpp:
2791         (WebCore::ScrollView::availableContentSizeChanged):
2792
2793 2015-02-28  Andreas Kling  <akling@apple.com>
2794
2795         [Cocoa] Purge SQLite page cache when under memory pressure.
2796         <https://webkit.org/b/142139>
2797         <rdar://problem/19997739>
2798
2799         Reviewed by Pratik Solanki.
2800
2801         Call out to sqlite3 cache purging SPI on Cocoa platforms when
2802         we need to free up some extra memory.
2803
2804         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2805         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2806
2807 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2808
2809         FrameView::layoutTimerFired() should update style if needed before doing layout
2810         https://bugs.webkit.org/show_bug.cgi?id=141688
2811
2812         Reviewed by Andreas Kling.
2813
2814         If the style recalc timer has been scheduled to fire after the layout timer,
2815         when the layout timer fires, we might as well just do the style recalc
2816         too. The call to updateStyleIfNeeded() will cancel the pending style
2817         recalc timer.
2818         
2819         This doesn't have much impact on the number of layouts (measured via PLT)
2820         but seems like a reasonable thing to do.
2821
2822         * page/FrameView.cpp:
2823         (WebCore::FrameView::layoutTimerFired):
2824
2825 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
2826
2827         Fullscreen video layers are off by one sometimes
2828         https://bugs.webkit.org/show_bug.cgi?id=142122
2829         rdar://problem/19878821
2830
2831         Reviewed by Eric Carlson.
2832
2833         Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
2834         isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
2835         backends to use FloatSizes for natural size. Convert the video image drawing code
2836         paths to FloatSize, since naturalSize is used on the destination rect computation,
2837         and painting should be floating point anyway.
2838         
2839         Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
2840
2841         * html/HTMLVideoElement.cpp:
2842         (WebCore::HTMLVideoElement::videoWidth):
2843         (WebCore::HTMLVideoElement::videoHeight):
2844         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
2845         * html/HTMLVideoElement.h:
2846         * html/canvas/CanvasRenderingContext2D.cpp:
2847         (WebCore::size):
2848         (WebCore::CanvasRenderingContext2D::drawImage):
2849         * html/canvas/WebGLRenderingContextBase.cpp:
2850         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
2851         * platform/graphics/MediaPlayer.cpp:
2852         (WebCore::NullMediaPlayerPrivate::naturalSize):
2853         (WebCore::MediaPlayer::naturalSize):
2854         (WebCore::MediaPlayer::paint):
2855         (WebCore::MediaPlayer::paintCurrentFrameInContext):
2856         (WebCore::NullMediaPlayerPrivate::paint): Deleted.
2857         * platform/graphics/MediaPlayer.h:
2858         * platform/graphics/MediaPlayerPrivate.h:
2859         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
2860         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2861         (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
2862         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
2863         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2864         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2865         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2866         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
2867         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
2868         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
2869         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
2870         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2871         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
2872         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2873         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2874         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2875         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
2876         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
2877         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
2878         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2879         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2880         (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
2881         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2882         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2883         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2884         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
2885         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
2886         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
2887         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
2888         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2889         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2890         (WebCore::MediaPlayerPrivateQTKit::naturalSize):
2891         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
2892         (WebCore::MediaPlayerPrivateQTKit::paint):
2893         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2894         (WebCore::MockMediaPlayerMediaSource::naturalSize):
2895         (WebCore::MockMediaPlayerMediaSource::paint):
2896         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2897         * rendering/RenderVideo.cpp:
2898         (WebCore::RenderVideo::calculateIntrinsicSize):
2899         (WebCore::RenderVideo::paintReplaced):
2900
2901 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
2902
2903         [EFL][GTK] Fix build break after r180790,180798
2904         https://bugs.webkit.org/show_bug.cgi?id=142127
2905
2906         Reviewed by Gyuyoung Kim.
2907
2908         * platform/graphics/cairo/PathCairo.cpp:
2909         (WebCore::Path::addEllipse):
2910
2911 2015-02-27  Zalan Bujtas  <zalan@apple.com>
2912
2913         Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
2914         https://bugs.webkit.org/show_bug.cgi?id=142065
2915
2916         Reviewed by Simon Fraser.
2917
2918         We should not pixelsnap (ceil in this case) logical coordinates during layout.
2919         Should this cause content to be partially cut off, we need to
2920         find the broken piece in the computation logic.
2921
2922         Covered by the unskipped test.
2923
2924         * rendering/RootInlineBox.cpp:
2925         (WebCore::RootInlineBox::paddedLayoutOverflowRect):
2926
2927 2015-02-27  Ryosuke Niwa  <rniwa@webkit.org>
2928
2929         Node::hasEditableStyle and isEditablePosition have too many options
2930         https://bugs.webkit.org/show_bug.cgi?id=142078
2931
2932         Reviewed by Andreas Kling.
2933
2934         Moved the code that dealt with accessibility to htmlediting.cpp from Node. This patch introduces
2935         new editing helper functions hasEditableStyle and isEditableNode for this purpose.
2936
2937         Also removed UserSelectAllTreatment from isContentEditable's arguments in the favor of using
2938         newly extracted computeEditability in call sites that specify this option since isContentEditable
2939         is a public DOM API.
2940
2941         No new tests since there should be no observable behavior changes.
2942
2943         * accessibility/AXObjectCache.h: Removed the declaration of an undefined function.
2944
2945         * dom/Element.cpp:
2946         (WebCore::Element::shouldUseInputMethod): Uses newly added computeEditability.
2947
2948         * dom/Node.cpp:
2949         (WebCore::Node::isContentEditable): Ditto. No longer takes UserSelectAllTreatment as an argument.
2950         (WebCore::Node::isContentRichlyEditable): Ditto.
2951         (WebCore::Node::computeEditability): Renamed from hasEditableStyle to avoid the confusion with
2952         a helper function of the same name. Added ShouldUpdateStyle as an argument to optionally update
2953         style tree. Also returns tri-state Editability enum instead of returning a boolean based on
2954         the value of EditableLevel argument.
2955         (WebCore::Node::isEditableToAccessibility): Moved to htmlediting.cpp.
2956         (WebCore::Node::willRespondToMouseClickEvents): Uses newly added computeEditability.
2957         (WebCore::Node::rootEditableElement): Moved to htmlediting.cpp.
2958
2959         * dom/Node.h: No longer includes EditingBoundary.h.
2960         (WebCore::Node::isContentEditable):
2961         (WebCore::Node::hasEditableStyle): No longer takes EditableType as an argument.
2962         (WebCore::Node::hasRichlyEditableStyle): Ditto.
2963
2964         * editing/ApplyStyleCommand.cpp:
2965         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Uses newly added isEditableNode.
2966         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
2967         * editing/DeleteFromTextNodeCommand.cpp:
2968         (WebCore::DeleteFromTextNodeCommand::doApply): Ditto.
2969         * editing/FrameSelection.cpp:
2970         (WebCore::CaretBase::invalidateCaretRect): Ditto.
2971         * editing/InsertNodeBeforeCommand.cpp:
2972         (WebCore::InsertNodeBeforeCommand::doApply): Ditto.
2973         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
2974         * editing/RemoveNodeCommand.cpp:
2975         (WebCore::RemoveNodeCommand::doApply): Ditto.
2976
2977         * editing/VisibleSelection.cpp:
2978         (WebCore::VisibleSelection::hasEditableStyle): Since this is the only caller of isEditablePosition
2979         which sets DoNotUpdateStyle, directly call hasEditableStyle on the container node instead. This was
2980         not possible prior to r180726 because isEditablePosition had to move out of tables.
2981
2982         * editing/VisibleUnits.cpp:
2983         (WebCore::previousLeafWithSameEditability): Uses newly added hasEditableStyle.
2984         (WebCore::nextLeafWithSameEditability): Ditto.
2985         (WebCore::rootEditableOrDocumentElement): Extracted from previousLinePosition. Use helper functions
2986         in htmlediting.cpp instead of member functions of Node since they no longer support EditableType.
2987         (WebCore::previousLinePosition):
2988         (WebCore::nextLinePosition):
2989
2990         * editing/htmlediting.cpp:
2991         (WebCore::highestEditableRoot): Uses newly added hasEditableStyle.
2992         (WebCore::isEditableToAccessibility): Moved from Node.
2993         (WebCore::computeEditability): Extracted from isEditablePosition.
2994         (WebCore::hasEditableStyle): Added.
2995         (WebCore::isEditableNode): Added.
2996         (WebCore::isEditablePosition): Now calls computeEditability.
2997         (WebCore::isRichlyEditablePosition): No longer takes EditableType since that variant was never used.
2998         (WebCore::editableRootForPosition): Moved the code from Node::rootEditableElement.
2999
3000         * editing/htmlediting.h:
3001
3002 2015-02-27  Chris Dumez  <cdumez@apple.com>
3003
3004         Make ActiveDOMObject::canSuspend() pure virtual
3005         https://bugs.webkit.org/show_bug.cgi?id=142096
3006         <rdar://problem/19923085>
3007
3008         Reviewed by Andreas Kling.
3009
3010         Make ActiveDOMObject::canSuspend() pure virtual so that people at least
3011         try to provide an implementation for it. The default implementation was
3012         returning false unconditionally and thus was preventing pages from
3013         entering the PageCache.
3014
3015 2015-02-27  Commit Queue  <commit-queue@webkit.org>
3016
3017         Unreviewed, rolling out r180203 and r180210.
3018         https://bugs.webkit.org/show_bug.cgi?id=142116
3019
3020         broke process suspension and tile map (Requested by thorton on
3021         #webkit).
3022
3023         Reverted changesets:
3024
3025         "Adopt CAMachPort-as-layer-contents"
3026         https://bugs.webkit.org/show_bug.cgi?id=141687
3027         http://trac.webkit.org/changeset/180203
3028
3029         "Fix the !USE(IOSURFACE) build"
3030         http://trac.webkit.org/changeset/180210
3031
3032 2015-02-27  Sam Weinig  <sam@webkit.org>
3033
3034         Add WebKit2 SPI to create a DOM File object
3035         https://bugs.webkit.org/show_bug.cgi?id=142109
3036
3037         Reviewed by Tim Horton.
3038
3039         * WebCore.xcodeproj/project.pbxproj:
3040         Make <WebCore/File.h> (and associated files) available to WebKit2.
3041
3042 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3043
3044         [Subpixel] Subpixelize RenderListMarker
3045         https://bugs.webkit.org/show_bug.cgi?id=142093
3046
3047         Reviewed by Zalan Bujtas.
3048
3049         Use floats instead of ints.
3050
3051         Test: fast/lists/rtl-marker.html
3052
3053         * rendering/RenderListMarker.cpp:
3054         (WebCore::RenderListMarker::paint):
3055         (WebCore::RenderListMarker::updateContent):
3056         (WebCore::RenderListMarker::getRelativeMarkerRect):
3057         * rendering/RenderListMarker.h:
3058
3059 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
3060
3061         <attachment> should be selected immediately upon click, and be drag/copyable upon click
3062         https://bugs.webkit.org/show_bug.cgi?id=142114
3063         <rdar://problem/19982520>
3064
3065         Reviewed by Enrica Casucci.
3066
3067         * css/html.css:
3068         (attachment):
3069         Make attachment use 'user-select: all' to act as a single click-to-select unit.
3070
3071         * html/HTMLAttachmentElement.cpp:
3072         (WebCore::HTMLAttachmentElement::setFocus): Deleted.
3073         * html/HTMLAttachmentElement.h:
3074         * rendering/RenderAttachment.cpp:
3075         (WebCore::RenderAttachment::isFocused): Deleted.
3076         (WebCore::RenderAttachment::focusChanged): Deleted.
3077         * rendering/RenderAttachment.h:
3078         * rendering/RenderThemeMac.mm:
3079         (WebCore::RenderThemeMac::paintAttachment):
3080         Remove focus-related code; instead of focusing the element upon click,
3081         we get a selection including just the <attachment>, and everything
3082         behaves much more consistently (copy works, drag works, etc.).
3083
3084 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3085
3086         [iOS] Some MathML tests crash in RenderMathMLOperator::advanceForGlyph() or boundsForGlyph()
3087         https://bugs.webkit.org/show_bug.cgi?id=141371
3088
3089         Reviewed by David Kilzer.
3090
3091         Null checks.
3092
3093         Covered by existing mathml tests.
3094
3095         * rendering/mathml/RenderMathMLOperator.cpp:
3096         (WebCore::RenderMathMLOperator::boundsForGlyph):
3097         (WebCore::RenderMathMLOperator::advanceForGlyph):
3098         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator):
3099
3100 2015-02-27  Chris Dumez  <cdumez@apple.com>
3101
3102         Make SourceBuffer ActiveDOMObject suspendable
3103         https://bugs.webkit.org/show_bug.cgi?id=142108
3104         <rdar://problem/19923085>
3105
3106         Reviewed by Jer Noble.
3107
3108         Make SourceBuffer ActiveDOMObject suspendable if it is removed from its
3109         MediaSource and does not have any pending events. This makes it more
3110         likely for pages using SourceBuffer objects to go into the PageCache.
3111
3112         Test: fast/history/page-cache-removed-source-buffer.html
3113
3114         * Modules/mediasource/SourceBuffer.cpp:
3115         (WebCore::SourceBuffer::canSuspend):
3116         * Modules/mediasource/SourceBuffer.h:
3117
3118 2015-02-26  Sam Weinig  <sam@webkit.org>
3119
3120         Add support for canvas ellipse method
3121         https://bugs.webkit.org/show_bug.cgi?id=82791
3122         <rdar://problem/11159172>
3123
3124         Reviewed by Dirk Schulze.
3125
3126         Tests: fast/canvas/canvas-ellipse-360-winding.html
3127                fast/canvas/canvas-ellipse-circumference-fill.html
3128                fast/canvas/canvas-ellipse-circumference.html
3129                fast/canvas/canvas-ellipse-connecting-line.html
3130                fast/canvas/canvas-ellipse-negative-radius.html
3131                fast/canvas/canvas-ellipse-zero-lineto.html
3132                fast/canvas/canvas-ellipse.html
3133
3134         * html/canvas/CanvasPathMethods.h:
3135         * html/canvas/CanvasPathMethods.cpp:
3136         (WebCore::CanvasPathMethods::lineTo):
3137         Convenience for passing a FloatPoint instead of two floats.
3138
3139         (WebCore::normalizeAngles):
3140         Normalizes the angles as described in the HTML spec. Ensuring the startAngle
3141         is greater than 0 and less than 2pi, and the the endAngle is at most 2pi
3142         from the start angle.
3143
3144         (WebCore::CanvasPathMethods::arc):
3145         - Renames some of the parameters to be clearer.
3146         - Normalizes the angles for consistency with ellipse.
3147         - Moves hasInvertibleTransform() higher in the function for consistency.
3148
3149         (WebCore::CanvasPathMethods::ellipse): Added.
3150
3151         * html/canvas/CanvasRenderingContext2D.idl:
3152         * html/canvas/DOMPath.idl:
3153         Add ellipse(...).
3154
3155         * platform/graphics/Path.h:
3156         * platform/graphics/cg/PathCG.cpp:
3157         (WebCore::Path::addArc):
3158         Rename parameters for clarity and use a nullptr.
3159
3160         (WebCore::Path::addEllipse):
3161         Added. Constructs an ellipse via a transformed arc.
3162
3163 2015-02-27  Enrica Casucci  <enrica@apple.com>
3164
3165         Adding support for serializing HTMLAttachment elements.
3166         https://bugs.webkit.org/show_bug.cgi?id=142026
3167
3168         Reviewed by Tim Horton.
3169
3170         Test: editing/pasteboard/copy-paste-attachment.html
3171
3172         Adding support to serialize the attachment element
3173         and properly handle it when converting a DOM range
3174         to NSAttributedString.
3175
3176         * editing/cocoa/HTMLConverter.mm:
3177         (HTMLConverter::_processElement):
3178         * editing/markup.cpp:
3179         (WebCore::StyledMarkupAccumulator::appendCustomAttributes): Create new attribute
3180         for attachment element when serializating.
3181         (WebCore::StyledMarkupAccumulator::appendElement):
3182         (WebCore::createFragmentFromMarkup): Remove the attribute from the attachment element
3183         when creating the fragment.
3184         * html/HTMLAttachmentElement.cpp:
3185         (WebCore::HTMLAttachmentElement::file): Added const to file() to
3186         use it in appendCustonAttributes where the element is a const reference.
3187         * html/HTMLAttachmentElement.h:
3188         * html/HTMLAttributeNames.in:
3189
3190 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
3191
3192         <attachment> should have an inactive style (gray in background)
3193         https://bugs.webkit.org/show_bug.cgi?id=142103
3194         <rdar://problem/19982486>
3195
3196         Reviewed by Dan Bernstein.
3197
3198         * rendering/RenderThemeMac.mm:
3199         (WebCore::attachmentLabelInactiveBackgroundColor):
3200         (WebCore::attachmentLabelInactiveTextColor):
3201         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
3202         (WebCore::RenderThemeMac::paintAttachmentLabel):
3203         Use a gray background and gray text when the selection containing the
3204         attachment isn't focused and active.
3205
3206 2015-02-27  Brady Eidson  <beidson@apple.com>
3207
3208         Add a "block-cookies" rule to the user content filter.
3209         https://bugs.webkit.org/show_bug.cgi?id=142105
3210
3211         Reviewed by Alex Christensen.
3212
3213         Tests: http/tests/usercontentfilter/block-cookies-basic.html
3214                http/tests/usercontentfilter/block-cookies-send.html
3215
3216         * contentextensions/ContentExtensionRule.h:
3217
3218         * contentextensions/ContentExtensionsBackend.cpp:
3219         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL):
3220         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL): Deleted.
3221         * contentextensions/ContentExtensionsBackend.h:
3222
3223         * contentextensions/ContentExtensionsManager.cpp:
3224         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
3225
3226         * loader/cache/CachedResourceLoader.cpp:
3227         (WebCore::CachedResourceLoader::requestResource):
3228
3229         * page/UserContentController.cpp:
3230         (WebCore::UserContentController::actionForURL):
3231         (WebCore::UserContentController::contentFilterBlocksURL): Deleted.
3232         * page/UserContentController.h:
3233
3234 2015-02-27  Alex Christensen  <achristensen@webkit.org>
3235
3236         [WinCairo] Unreviewed build fix.
3237
3238         * platform/graphics/BitmapImage.h:
3239         * platform/win/BitmapInfo.h:
3240         Added WEBCORE_EXPORT.
3241
3242 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
3243
3244         <attachment>'s label baseline should match that of the surrounding text
3245         https://bugs.webkit.org/show_bug.cgi?id=142099
3246         rdar://problem/19982495
3247
3248         Reviewed by Dan Bernstein.
3249
3250         * rendering/RenderAttachment.cpp:
3251         (WebCore::RenderAttachment::baselinePosition):
3252         * rendering/RenderAttachment.h:
3253         Override baselinePosition and retrieve it from RenderTheme.
3254
3255         * rendering/RenderTheme.h:
3256         (WebCore::RenderTheme::attachmentBaseline):
3257         * rendering/RenderThemeMac.h:
3258         * rendering/RenderThemeMac.mm:
3259         (WebCore::AttachmentLayout::AttachmentLayout):
3260         (WebCore::RenderThemeMac::attachmentBaseline):
3261         Plumb the label baseline from AttachmentLayout to RenderAttachment.
3262
3263 2015-02-27  Commit Queue  <commit-queue@webkit.org>
3264
3265         Unreviewed, rolling out r180752.
3266         https://bugs.webkit.org/show_bug.cgi?id=142098
3267
3268         Causes 10 SVG test failures on Windows. (Requested by
3269         bfulgham_ on #webkit).
3270
3271         Reverted changeset:
3272
3273         "Cache glyph widths to GlyphPages"
3274         https://bugs.webkit.org/show_bug.cgi?id=142028
3275         http://trac.webkit.org/changeset/180752
3276
3277 2015-02-27  David Kilzer  <ddkilzer@apple.com>
3278
3279         [iOS] Fix build by defining EAGL_IOSURFACE macro before including <OpenGLES/EAGLPrivate.h>
3280
3281         * platform/spi/ios/OpenGLESSPI.h:  Define EAGL_IOSURFACE macro
3282         until header refactoring is completed.
3283
3284 2015-02-27  Chris Dumez  <cdumez@apple.com>
3285
3286         MediaSource should be suspendable when closed
3287         https://bugs.webkit.org/show_bug.cgi?id=142089
3288         <rdar://problem/19923085>
3289
3290         Reviewed by Jer Noble.
3291
3292         Make MediaSource ActiveDOMObject suspendable when it is in closed state
3293         and it has no pending events. This increases the likelihood of pages
3294         using MediaSource to enter the PageCache.
3295
3296         Tests: fast/history/page-cache-media-source-closed-2.html
3297                fast/history/page-cache-media-source-closed.html
3298                fast/history/page-cache-media-source-opened.html
3299
3300 2015-02-27  Andreas Kling  <akling@apple.com>
3301
3302         Use NeverDestroyed for JS wrapper owners.
3303         <https://webkit.org/b/142090>
3304
3305         Reviewed by Chris Dumez.
3306
3307         Using NeverDestroyed puts these objects in BSS which is preferable
3308         since that prevents them from pinning down entire malloc pages forever.
3309
3310         * bindings/scripts/CodeGeneratorJS.pm:
3311         (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
3312
3313         * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change.
3314
3315 2015-02-27  Chris Dumez  <cdumez@apple.com>
3316
3317         Make IDBDatabase / IDBRequest suspendable
3318         https://bugs.webkit.org/show_bug.cgi?id=142076
3319         <rdar://problem/19923085>
3320
3321         Reviewed by Andreas Kling.
3322
3323         Make IDBDatabase / IDBRequest suspendable under certain conditions to
3324         make it more likely for pages using indexeddb to enter the PageCache.
3325
3326         IDBDatabase is safely suspendable if the database is closed. IDBRequest
3327         is safely suspendable if the request no longer has any pending activity
3328         (i.e. state is DONE and success / failure handler was called). We may
3329         be able to do better later but this is the bare minimum for now.
3330
3331         Tests: fast/history/page-cache-indexed-closed-db.html
3332                fast/history/page-cache-indexed-opened-db.html
3333
3334         * Modules/indexeddb/IDBDatabase.cpp:
3335         (WebCore::IDBDatabase::IDBDatabase):
3336         (WebCore::IDBDatabase::closeConnection):
3337         (WebCore::IDBDatabase::enqueueEvent):
3338         (WebCore::IDBDatabase::canSuspend):
3339         * Modules/indexeddb/IDBDatabase.h:
3340         * Modules/indexeddb/IDBRequest.cpp:
3341         (WebCore::IDBRequest::canSuspend):
3342         * Modules/indexeddb/IDBRequest.h:
3343
3344 2015-02-27  Chris Dumez  <cdumez@apple.com>
3345
3346         Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame()
3347         https://bugs.webkit.org/show_bug.cgi?id=142052
3348
3349         Reviewed by Andreas Kling.
3350
3351         Drop WebDatabase special-handling from PageCache::canCachePageContainingThisFrame().
3352         DatabaseContext is already an ActiveDOMObject and DatabaseContext::canSuspend() was
3353         returning false so pages using WebDatabase would never enter the PageCache anyway.
3354
3355         This patch also overrides ActiveDOMObject::canSuspend() in DatabaseContext to only
3356         return false when there are open databases. This check is now equivalent to the one
3357         that was in PageCache.
3358
3359         An issue that remains is that DatabaseContext::m_hasOpenDatabases is never reset
3360         to false so once a page opened a database, it will never be page-cacheable. This
3361         will be taken care of separately though.
3362
3363         Test: fast/history/page-cache-webdatabase-opened-db.html
3364
3365         * Modules/webdatabase/DatabaseContext.cpp: