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