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