[SOUP] Use SoupMessage::starting instead of SoupSession::request-started
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [SOUP] Use SoupMessage::starting instead of SoupSession::request-started
4         https://bugs.webkit.org/show_bug.cgi?id=142164
5
6         Reviewed by Sergio Villar Senin.
7
8         SoupSession::request-started is deprecated in libsoup 2.50. Both
9         signals are equivalent, but SoupMessage::starting is also emitted
10         for resources loaded from the disk cache. This fixes web timing
11         calculations for cached resources, since we were not initializing
12         m_requestStart.
13
14         * platform/network/soup/ResourceHandleSoup.cpp:
15         (WebCore::startingCallback):
16         (WebCore::createSoupMessageForHandleAndRequest):
17         * platform/network/soup/SoupNetworkSession.cpp:
18         (WebCore::SoupNetworkSession::SoupNetworkSession):
19
20 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
21
22         [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
23         https://bugs.webkit.org/show_bug.cgi?id=141508
24
25         Reviewed by Sergio Villar Senin.
26
27         Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
28         synchronous message instead of increasing the maximum number of
29         connections allowed if the soup version is recent enough.
30         The current solution of increasing/decreasing the limits doesn't
31         always work, because connections are not marked as IDLE in libsoup
32         until the message is unqueued, but we don't wait for the message
33         to be unqueued to finish our loads in WebKit, we finish them as
34         soon as we have finished reading the stream. This causes that
35         synchronous loads keep blocked in the nested main loop until the
36         timeout of 10 seconds is fired and the load fails.
37         Also marked WebCoreSynchronousLoader class as final, the virtual
38         methods as override and removed the unsused method isSynchronousClient.
39
40         * platform/network/soup/ResourceHandleSoup.cpp:
41         (WebCore::createSoupMessageForHandleAndRequest):
42         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
43         (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
44         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
45         (WebCore::WebCoreSynchronousLoader::didReceiveData):
46         (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
47         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
48         (WebCore::WebCoreSynchronousLoader::didFail):
49         (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
50         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
51
52 2015-03-02  David Kilzer  <ddkilzer@apple.com>
53
54         [iOS] Disable -Wdeprecated-declaration warnings in WebVideoFullscreenInterfaceAVKit.mm
55
56         Fixing the deprecations is tracked by: <rdar://problem/20018692>
57
58         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
59         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized):
60         Ignore -Wdeprecated-declaration warnings via clang pragmas.
61
62 2015-03-02  Commit Queue  <commit-queue@webkit.org>
63
64         Unreviewed, rolling out r180902.
65         https://bugs.webkit.org/show_bug.cgi?id=142205
66
67         It broke scrolling in some cases. See bug 142202 for details.
68         (Requested by bdash on #webkit).
69
70         Reverted changeset:
71
72         "Move scroll animating functions from ScrollAnimator to
73         ScrollController"
74         https://bugs.webkit.org/show_bug.cgi?id=142102
75         http://trac.webkit.org/changeset/180902
76
77 2015-03-02  Commit Queue  <commit-queue@webkit.org>
78
79         Unreviewed, rolling out r180911.
80         https://bugs.webkit.org/show_bug.cgi?id=142204
81
82         The tests it added are crashing (Requested by bdash on
83         #webkit).
84
85         Reverted changeset:
86
87         "Add a microtask abstraction"
88         https://bugs.webkit.org/show_bug.cgi?id=137496
89         http://trac.webkit.org/changeset/180911
90
91 2015-03-02  Yoav Weiss  <yoav@yoav.ws>
92
93         Add a microtask abstraction
94         https://bugs.webkit.org/show_bug.cgi?id=137496
95
96         Reviewed by Sam Weinig.
97
98         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
99         That abstraction is required in order to enable async loading of images,
100         which is in turn required to enable support for the picture element, as well as
101         to make sure that the order of properties set on HTMLImageElement has no implications.
102
103         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
104         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
105         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
106         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
107         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
108         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
109         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
110         (WebCore::MicroTask::~MicroTask):
111         (WebCore::MicroTask::run): Run the microtask.
112         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
113         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
114         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
115         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
116         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
117         (WebCore::ScriptRunner::timerFired):
118         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
119         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
120         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
121         (WebCore::HTMLScriptRunner::runScript):
122         * testing/Internals.cpp: Add a method to queue a test microtask.
123         (WebCore::Internals::queueMicroTask):
124         * testing/Internals.h: Add a method to queue a test microtask.
125         (WebCore::Internals::queueMicroTask):
126         * testing/Internals.idl: Expose test microtask queueing to test JS.
127         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
128         (WebCore::MicroTaskTest::run): Run the microtask
129         (WebCore::MicroTaskTest::create): Create a test microtask.
130         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
131         (WebCore::MicroTaskTest::run):
132         (WebCore::MicroTaskTest::create):
133
134 2015-03-02  Jeremy Jones  <jeremyj@apple.com>
135
136         RenderVideo should not paint the video frame when video is fullscreen.
137         https://bugs.webkit.org/show_bug.cgi?id=142097
138
139         Reviewed by Eric Carlson.
140
141         For performance and correctness, RenderVideo should not paint the current video frame
142         inline when video is fullscreen. This happens when snapshots are taken and can have a
143         negative performance impact.
144
145         * rendering/RenderVideo.cpp:
146         (WebCore::RenderVideo::paintReplaced):
147
148 2015-03-02  Dean Jackson  <dino@apple.com>
149
150         [iOS Media] Airplay button should be blue when active
151         https://bugs.webkit.org/show_bug.cgi?id=142193
152
153         Reviewed by Brent Fulgham.
154
155         Add a blue form of the Airplay button that is used
156         when we are actively displaying on another screen.
157
158         * Modules/mediacontrols/mediaControlsiOS.css:
159         (video::-webkit-media-controls-wireless-playback-picker-button):
160         (video::-webkit-media-controls-wireless-playback-picker-button:active):
161         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
162         * Modules/mediacontrols/mediaControlsiOS.js:
163         (ControllerIOS.prototype.updateWirelessPlaybackStatus):
164
165 2015-03-02  Brent Fulgham  <bfulgham@apple.com>
166
167         Move scroll animating functions from ScrollAnimator to ScrollController
168         https://bugs.webkit.org/show_bug.cgi?id=142102
169         <rdar://problem/20007161>
170
171         Reviewed by Simon Fraser.
172
173         No change in functionality.
174         
175         Do some refactoring of the various scrolling classes:
176         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
177            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
178         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
179         3. Move code from ScrollAnimator{Mac} -> ScrollController.
180         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
181         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
182
183         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
184         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
185         events, just as is done for the "event not handled" case in EventHandler.cpp. 
186         (WebCore::EventHandler::platformCompleteWheelEvent):
187         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
188         methods, now that ScrollController is controlling this state.
189         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
190         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
191         need to clean up the CFRunLoopTimer.
192         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
193         until Bug 141973 is completed.).
194         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
195         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
196         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
197         * platform/ScrollAnimator.cpp:
198         (WebCore::ScrollAnimator::ScrollAnimator):
199         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
200         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
201         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
202         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
203         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
204         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
205         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
206         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
207         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
208         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
209         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
210         * platform/ScrollAnimator.h:
211         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
212         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
213         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
214         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
215         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
216         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
217         require client to maintain timers.
218         (WebCore::ScrollController::snapRubberBand): Ditto.
219         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
220         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
221         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
222         (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
223         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
224         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
225         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
226         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
227         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
228         * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
229         * platform/mac/ScrollAnimatorMac.h:
230         * platform/mac/ScrollAnimatorMac.mm:
231         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
232         controlled in the ScrollController)
233         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
234         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
235         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
236         * platform/mac/ScrollController.h: Removed.
237         * platform/mac/ScrollController.mm: Removed.
238
239 2015-03-02  Mark Lam  <mark.lam@apple.com>
240
241         The InspectorTimelineAgent should gracefully handle attempts to start more than once.
242         <https://webkit.org/b/142189>
243
244         Reviewed by Joseph Pecoraro.
245
246         No new tests.  Unskipped an existing test that already asserts this.
247
248         InspectorTimelineAgent::internalStop() already checks for redundant calls to it in
249         case the InspectorTimelineAgent is already disabled. Similarly,
250         InspectorTimelineAgent::internalStart() should check if the InspectorTimelineAgent
251         is already enabled before proceeding to do work to enable it. Though wasteful,
252         it is legal for clients of the InspectorTimelineAgent to invoke start on it more
253         than once. Hence, this check is needed.
254
255         This check fixes the debug assertion failure when running the
256         inspector/timeline/debugger-paused-while-recording.html test. The test can now
257         be unskipped.
258
259         * inspector/InspectorTimelineAgent.cpp:
260         (WebCore::InspectorTimelineAgent::internalStart):
261
262 2015-03-02  Roger Fong  <roger_fong@apple.com>
263
264         Update backgrounds of sliders for inline media controls on OS X.
265         https://bugs.webkit.org/show_bug.cgi?id=142188.
266         <rdar://problem/20012413>
267
268         Reviewed by Dean Jackson.
269
270         Don’t use CSS to draw volume and timeline slider backgrounds.
271         * Modules/mediacontrols/mediaControlsApple.css:
272         (video::-webkit-media-controls-volume-slider):
273         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb):
274         (audio::-webkit-media-controls-timeline):
275         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
276         (audio::-webkit-media-controls-panel .thumbnail-track):
277         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb:active::-webkit-slider-thumb): Deleted.
278         (audio::-webkit-media-controls-timeline:active::-webkit-slider-thumb,): Deleted.
279
280         Draw volume and timeline slider backgrounds using 2d canvases.
281         * Modules/mediacontrols/mediaControlsApple.js:
282         (Controller.prototype.createControls):
283         (Controller.prototype.handleVolumeSliderInput):
284         (Controller.prototype.addRoundedRect):
285         (Controller.prototype.drawTimelineBackground):
286         (Controller.prototype.drawVolumeBackground):
287         (Controller.prototype.showControls):
288         * Modules/mediacontrols/mediaControlsiOS.js:
289         (ControllerIOS.prototype.addRoundedRect): Deleted.
290
291 2015-03-01  Roger Fong  <roger_fong@apple.com>
292
293         Update inline media element controls appearance Part 1.
294         https://bugs.webkit.org/show_bug.cgi?id=142138.
295         <rdar://problem/19997384>
296
297         Reviewed by Dean Jackson.
298
299         Update positioning, sizes, and background colors media control elements.
300         Volume and timeline sliders will be drawn in a separate patch via 2d canvases.
301
302         * Modules/mediacontrols/mediaControlsApple.css:
303         (audio::-webkit-media-controls-panel):
304         (video::-webkit-media-controls-panel):
305         (audio::-webkit-media-controls-rewind-button):
306         (audio::-webkit-media-controls-play-button):
307         (audio::-webkit-media-controls-panel .mute-box):
308         (video::-webkit-media-controls-volume-max-button):
309         (audio::-webkit-media-controls-panel .volume-box):
310         (audio::-webkit-media-controls-panel .volume-box:active):
311         (video::-webkit-media-controls-volume-slider):
312         (audio::-webkit-media-controls-toggle-closed-captions-button):
313         (audio::-webkit-media-controls-fullscreen-button):
314         (audio::-webkit-media-controls-current-time-display):
315         (audio::-webkit-media-controls-time-remaining-display):
316         (audio::-webkit-media-controls-timeline-container .hour-long-time): Deleted.
317
318 2015-03-02  David Kilzer  <ddkilzer@apple.com>
319
320         REGRESSION (r180882): Build failure: Methods not marked override in GraphicsLayerCA.h
321         <http://webkit.org/b/138684>
322
323         Fixes the following build failures:
324
325             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
326             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
327             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
328             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:123:33: error: 'setShapeLayerPath' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
329                 WEBCORE_EXPORT virtual void setShapeLayerPath(const Path&);
330                                             ^
331             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
332             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
333             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
334             WebCore.framework/PrivateHeaders/GraphicsLayer.h:390:18: note: overridden virtual function is here
335                 virtual void setShapeLayerPath(const Path&);
336                              ^
337             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
338             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
339             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
340             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:124:33: error: 'setShapeLayerWindRule' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
341                 WEBCORE_EXPORT virtual void setShapeLayerWindRule(WindRule);
342                                             ^
343             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
344             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
345             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
346             WebCore.framework/PrivateHeaders/GraphicsLayer.h:393:18: note: overridden virtual function is here
347                 virtual void setShapeLayerWindRule(WindRule);
348                              ^
349             2 errors generated.
350
351         * platform/graphics/ca/GraphicsLayerCA.h:
352         (WebCore::GraphicsLayer::setShapeLayerPath): Mark as override.
353         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
354
355 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
356
357         Make clip-path work on <video>, <canvas> etc.
358         https://bugs.webkit.org/show_bug.cgi?id=138684
359
360         Reviewed by Darin Adler.
361         
362         clip-path only worked in compositing layers on the painted contents of the layer,
363         and failed to clip children. Fix this by translating the clip path into a Path
364         which is set on a CA shape layer (for Mac and iOS), or painted into the
365         RenderLayerBacking's mask layer. There are two code paths:
366
367         1. clip-path which is a <basic-shape> or <geometry-box>, and no mask.
368             Here we can use the optimal code path of converting the clip into a path
369             that is put onto a CAShapeLayer, which is then used as a mask. There is no
370             additional backing store.
371         2. clip-path with an SVG reference, or clip-path combined with -webkit-mask:
372             Here we have to allocate backing store for the mask layer, and paint the
373             clip path (possibly with the mask).
374         
375         We add GraphicsLayer::Type::Shape, and add a getter for the layer type.
376
377         Tests: compositing/masks/compositing-clip-path-and-mask.html
378                compositing/masks/compositing-clip-path-mask-change.html
379                compositing/masks/compositing-clip-path.html
380                compositing/masks/reference-clip-path-on-composited.html
381
382         * platform/graphics/GraphicsLayer.cpp:
383         (WebCore::GraphicsLayer::GraphicsLayer): Store the type in the layer so the getter can return it.
384         (WebCore::GraphicsLayer::shapeLayerPath): Get and set the shape layer path.
385         (WebCore::GraphicsLayer::setShapeLayerPath): Ditto.
386         (WebCore::GraphicsLayer::shapeLayerWindRule): Get and set the shape layer wind rule.
387         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
388         * platform/graphics/GraphicsLayer.h:
389         (WebCore::GraphicsLayer::type): Expose the type.
390         (WebCore::GraphicsLayer::supportsLayerType): Allow the cross-platform code to use
391         shape layers when it knows they are available.
392         (WebCore::GraphicsLayer::needsClippingMaskLayer): Deleted. This was never used.
393         * platform/graphics/GraphicsLayerClient.h: Align the bits (helps avoid typos). Add a
394         GraphicsLayerPaintClipPath phase.
395         * platform/graphics/Path.h: Some exports since WK2 needs to encode Paths now.
396         * platform/graphics/ca/GraphicsLayerCA.cpp:
397         (WebCore::GraphicsLayerCA::initialize): Make shape layers.
398         (WebCore::GraphicsLayerCA::setShapeLayerPath): Setter for the shape path. Sadly we
399         can't early return on unchanged paths yet.
400         (WebCore::GraphicsLayerCA::setShapeLayerWindRule):
401         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Updates for shape path
402         and wind rule.
403         (WebCore::GraphicsLayerCA::updateShape):
404         (WebCore::GraphicsLayerCA::updateWindRule):
405         * platform/graphics/ca/GraphicsLayerCA.h: Some new dirty bits for shape path and wind rule.
406         * platform/graphics/ca/PlatformCALayer.h:
407         * platform/graphics/ca/mac/PlatformCALayerMac.h:
408         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Got rid of lots of m_layer.get().
409         (PlatformCALayerMac::~PlatformCALayerMac):
410         (PlatformCALayerMac::setNeedsDisplay):
411         (PlatformCALayerMac::setNeedsDisplayInRect):
412         (PlatformCALayerMac::removeFromSuperlayer):
413         (PlatformCALayerMac::setSublayers):
414         (PlatformCALayerMac::removeAllSublayers):
415         (PlatformCALayerMac::appendSublayer):
416         (PlatformCALayerMac::insertSublayer):
417         (PlatformCALayerMac::replaceSublayer):
418         (PlatformCALayerMac::adoptSublayers):
419         (PlatformCALayerMac::addAnimationForKey):
420         (PlatformCALayerMac::removeAnimationForKey):
421         (PlatformCALayerMac::animationForKey):
422         (PlatformCALayerMac::setMask):
423         (PlatformCALayerMac::isOpaque):
424         (PlatformCALayerMac::setOpaque):
425         (PlatformCALayerMac::bounds):
426         (PlatformCALayerMac::setBounds):
427         (PlatformCALayerMac::position):
428         (PlatformCALayerMac::setPosition):
429         (PlatformCALayerMac::anchorPoint):
430         (PlatformCALayerMac::setAnchorPoint):
431         (PlatformCALayerMac::transform):
432         (PlatformCALayerMac::setTransform):
433         (PlatformCALayerMac::sublayerTransform):
434         (PlatformCALayerMac::setSublayerTransform):
435         (PlatformCALayerMac::setHidden):
436         (PlatformCALayerMac::setGeometryFlipped):
437         (PlatformCALayerMac::isDoubleSided):
438         (PlatformCALayerMac::setDoubleSided):
439         (PlatformCALayerMac::masksToBounds):
440         (PlatformCALayerMac::setMasksToBounds):
441         (PlatformCALayerMac::acceleratesDrawing):
442         (PlatformCALayerMac::setAcceleratesDrawing):
443         (PlatformCALayerMac::contents):
444         (PlatformCALayerMac::setContents):
445         (PlatformCALayerMac::setContentsRect):
446         (PlatformCALayerMac::setMinificationFilter):
447         (PlatformCALayerMac::setMagnificationFilter):
448         (PlatformCALayerMac::backgroundColor):
449         (PlatformCALayerMac::setBackgroundColor):
450         (PlatformCALayerMac::setBorderWidth):
451         (PlatformCALayerMac::setBorderColor):
452         (PlatformCALayerMac::opacity):
453         (PlatformCALayerMac::setOpacity):
454         (PlatformCALayerMac::copyFiltersFrom):
455         (PlatformCALayerMac::setName):
456         (PlatformCALayerMac::setSpeed):
457         (PlatformCALayerMac::setTimeOffset):
458         (PlatformCALayerMac::contentsScale):
459         (PlatformCALayerMac::setContentsScale):
460         (PlatformCALayerMac::cornerRadius):
461         (PlatformCALayerMac::setCornerRadius):
462         (PlatformCALayerMac::setEdgeAntialiasingMask):
463         (PlatformCALayerMac::shapeWindRule): New function.
464         (PlatformCALayerMac::setShapeWindRule): Ditto.
465         (PlatformCALayerMac::shapePath): Ditto.
466         (PlatformCALayerMac::setShapePath): Ditto.
467         (PlatformCALayer::isWebLayer):
468         * platform/graphics/cg/PathCG.cpp:
469         (WebCore::Path::Path): nullptr.
470         * rendering/RenderLayer.cpp:
471         (WebCore::RenderLayer::paintsWithClipPath): Return true if the clip path is painted.
472         (WebCore::RenderLayer::computeClipPath): Factor code that computes the clip path into this
473         function, so we can call it from RenderLayerBacking too.
474         (WebCore::RenderLayer::setupClipPath):
475         (WebCore::RenderLayer::paintLayerContents): We only want to apply the clip path
476         for painting when we're either painting a non-composited layer, or we're painting the
477         mask layer of a composited layer. We in the latter case, we just want to fill the clip
478         path with black, so re-use the paintChildClippingMaskForFragments() which does this.
479         * rendering/RenderLayer.h: Align the bits, add PaintLayerPaintingCompositingClipPathPhase.
480         * rendering/RenderLayerBacking.cpp:
481         (WebCore::RenderLayerBacking::~RenderLayerBacking):
482         (WebCore::RenderLayerBacking::updateConfiguration):
483         (WebCore::RenderLayerBacking::updateGeometry): Move mask updating into its own function.
484         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): If we're using the shape layer
485         code path, compute the Path and set it and the wind rule on the mask layer.
486         (WebCore::RenderLayerBacking::updateMaskingLayer): This is now more complex, as it has
487         to deal with combinations of clip-path and mask, some of which allow for the shape layer
488         mask, and we handle dynamic changes between these and painted masks.
489         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer): Include the GraphicsLayerPaintClipPath phase.
490         (WebCore::RenderLayerBacking::paintIntoLayer): Map GraphicsLayerPaintClipPath to PaintLayerPaintingCompositingClipPathPhase.
491         (WebCore::RenderLayerBacking::updateMaskLayer): Deleted.
492         * rendering/RenderLayerBacking.h:
493
494 2015-03-01  Hunseop Jeong  <hs85.jeong@samsung.com>
495
496         [Cairo] Implement Path::addEllipse 
497         https://bugs.webkit.org/show_bug.cgi?id=142144
498
499         Reviewed by Gyuyoung Kim.
500
501         Add support for addEllipse method for platforms using cairo.
502
503         * platform/graphics/cairo/PathCairo.cpp:
504         (WebCore::Path::addEllipse):
505
506 2015-03-01  Joonghun Park  <jh718.park@samsung.com>
507
508         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ScrollAnimator
509         https://bugs.webkit.org/show_bug.cgi?id=142143
510
511         Reviewed by Darin Adler.
512
513         No new tests, no behavior changes.
514
515         * platform/ScrollAnimator.cpp:
516         (WebCore::ScrollAnimator::create):
517         * platform/ScrollAnimator.h:
518         * platform/ScrollAnimatorNone.cpp:
519         (WebCore::ScrollAnimator::create):
520         * platform/ScrollableArea.h:
521         * platform/ios/ScrollAnimatorIOS.mm:
522         (WebCore::ScrollAnimator::create):
523         * platform/mac/ScrollAnimatorMac.mm:
524         (WebCore::ScrollAnimator::create):
525
526 2015-02-26  Andy Estes  <aestes@apple.com>
527
528         [Content Filtering] Move another declaration to WebFilterEvaluatorSPI.h
529         https://bugs.webkit.org/show_bug.cgi?id=142066
530
531         Reviewed by Andreas Kling.
532
533         * platform/ios/ContentFilterIOS.mm:
534         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
535
536 2015-03-01  Chris Dumez  <cdumez@apple.com>
537
538         Make NotificationCenter / Notification suspendable
539         https://bugs.webkit.org/show_bug.cgi?id=142117
540         <rdar://problem/19923085>
541
542         Reviewed by Andreas Kling.
543
544         Make NotificationCenter / Notification suspendable so that pages using
545         them can enter the PageCache.
546
547         NotificationCenter can safely be suspended if there are no pending
548         permission requests. This required adding an
549         "hasPendingPermissionRequests()" callback to the NotificationClient.
550
551         Notification can safely be suspended if it is either idle (not showing
552         yet) or closed.
553
554         Tests: fast/history/page-cache-notification-non-suspendable.html
555                fast/history/page-cache-notification-suspendable.html
556
557         * Modules/notifications/Notification.cpp:
558         (WebCore::Notification::canSuspend):
559         * Modules/notifications/NotificationCenter.cpp:
560         (WebCore::NotificationCenter::canSuspend):
561         * Modules/notifications/NotificationClient.h:
562
563 2015-03-01  Ryosuke Niwa  <rniwa@webkit.org>
564
565         isContentEditable shouldn't trigger synchronous style recalc in most cases
566         https://bugs.webkit.org/show_bug.cgi?id=129034
567
568         Reviewed by Antti Koivisto.
569
570         Avoid style recalc inside isContentEditable when the document doesn't contain -webkit-user-modify or
571         -webkit-user-select: all. Instead, compute the value from contenteditable attributes in ancestors.
572         However, still compute the editability from the style tree when it's up-to-date in order to avoid
573         repeatedly walking up the DOM tree in a hot code path inside editing.
574
575         Test: fast/dom/HTMLElement/dynamic-editability-change.html
576
577         * css/CSSGrammar.y.in: No need to pass in "true" as we never call this function with false.
578         * css/CSSParser.cpp:
579         (WebCore::isValidKeywordPropertyAndValue): Calls parserSetUsesStyleBasedEditability as needed.
580         (WebCore::parseKeywordValue): Passes around StyleSheetContents*.
581         (WebCore::CSSParser::parseValue): Ditto.
582         (WebCore::CSSParser::parseFont): Ditto.
583
584         * css/StyleSheetContents.cpp:
585         (WebCore::StyleSheetContents::StyleSheetContents): Initializes and copies m_usesStyleBasedEditability.
586
587         * css/StyleSheetContents.h:
588         (WebCore::StyleSheetContents::parserSetUsesRemUnits): Removed the argument since it was always true.
589         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability): Added.
590         (WebCore::StyleSheetContents::usesStyleBasedEditability): Added.
591
592         * dom/Document.cpp:
593         (WebCore::Document::recalcStyle): Added a FIXME as well as a comment explaining why we don't call
594         setUsesStyleBasedEditability. Since Node::computeEditability triggers style recalc only when the flag
595         is set to true, it's too late to update the flag here.
596         (WebCore::Document::updateStyleIfNeeded): Uses a newly extracted needsStyleRecalc.
597         (WebCore::Document::updateBaseURL): Preserves m_usesStyleBasedEditability as well as m_usesRemUnit.
598         (WebCore::Document::usesStyleBasedEditability): Added. Returns true when inline style declarations or
599         any active stylesheet uses -webkit-user-modify or -webkit-user-select: all. Flushing pending stylesheet
600         changes here is fine because the alternative is to trigger a full blown style recalc.
601
602         * dom/Document.h:
603         (WebCore::Document::needsStyleRecalc): Added. Extracted from updateStyleIfNeeded.
604
605         * dom/DocumentStyleSheetCollection.cpp:
606         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
607         (WebCore::styleSheetsUseRemUnits): Deleted.
608         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Updates m_usesStyleBasedEditability
609         as well as m_usesRemUnit.
610
611         * dom/DocumentStyleSheetCollection.h:
612         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Added.
613         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Added.
614
615         * dom/Node.cpp:
616         (WebCore::computeEditabilityFromComputedStyle): Extracted from computeEditability.
617         (WebCore::Node::computeEditability): When the style recalc is requested and the render tree is dirty,
618         check if the document uses any CSS property that can affect the editability of elements. If it doesn't,
619         compute the editability from contenteditable attributes in the anchors via matchesReadWritePseudoClass.
620         Continue to use the style-based computation when the render tree isn't dirty to avoid the tree walk.
621
622         * html/HTMLElement.cpp:
623         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Extracted from matchesReadWritePseudoClass
624         to be called in Node::computeEditability. Also made it return Editability instead of boolean.
625         (WebCore::HTMLElement::matchesReadWritePseudoClass):
626         * html/HTMLElement.h:
627
628 2015-03-01  Brent Fulgham  <bfulgham@apple.com>
629
630         [Win] Unreviewed build fix.
631
632         * WebCorePrefix.h: Provide some default definitions to help build on Windows
633         machines with different application support libraries.
634
635 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
636
637         Viewport units should not dirty style just before we do layout
638         https://bugs.webkit.org/show_bug.cgi?id=141682
639
640         Reviewed by Zalan Bujtas.
641         
642         In documents using viewport units, we dirtied style every time layout changed
643         the size of the document. This is nonsensical, because viewport units depend on the
644         viewport size, not the document size.
645         
646         Move the style dirtying from layout() into availableContentSizeChanged(). Hook
647         this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and,
648         since that causes availableContentSizeChanged() to be called for WK1 for the first
649         time, protect the call to updateScrollbars() with a !platformWidget check.
650
651         Covered by existing viewport unit tests.
652
653         * page/FrameView.cpp:
654         (WebCore::FrameView::layout):
655         (WebCore::FrameView::availableContentSizeChanged):
656         (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether
657         scrollbars are ignored depends on the value of the overflow property on the root element.
658         * page/FrameView.h:
659         * platform/ScrollView.cpp:
660         (WebCore::ScrollView::availableContentSizeChanged):
661
662 2015-02-28  Andreas Kling  <akling@apple.com>
663
664         [Cocoa] Purge SQLite page cache when under memory pressure.
665         <https://webkit.org/b/142139>
666         <rdar://problem/19997739>
667
668         Reviewed by Pratik Solanki.
669
670         Call out to sqlite3 cache purging SPI on Cocoa platforms when
671         we need to free up some extra memory.
672
673         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
674         (WebCore::MemoryPressureHandler::platformReleaseMemory):
675
676 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
677
678         FrameView::layoutTimerFired() should update style if needed before doing layout
679         https://bugs.webkit.org/show_bug.cgi?id=141688
680
681         Reviewed by Andreas Kling.
682
683         If the style recalc timer has been scheduled to fire after the layout timer,
684         when the layout timer fires, we might as well just do the style recalc
685         too. The call to updateStyleIfNeeded() will cancel the pending style
686         recalc timer.
687         
688         This doesn't have much impact on the number of layouts (measured via PLT)
689         but seems like a reasonable thing to do.
690
691         * page/FrameView.cpp:
692         (WebCore::FrameView::layoutTimerFired):
693
694 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
695
696         Fullscreen video layers are off by one sometimes
697         https://bugs.webkit.org/show_bug.cgi?id=142122
698         rdar://problem/19878821
699
700         Reviewed by Eric Carlson.
701
702         Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
703         isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
704         backends to use FloatSizes for natural size. Convert the video image drawing code
705         paths to FloatSize, since naturalSize is used on the destination rect computation,
706         and painting should be floating point anyway.
707         
708         Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
709
710         * html/HTMLVideoElement.cpp:
711         (WebCore::HTMLVideoElement::videoWidth):
712         (WebCore::HTMLVideoElement::videoHeight):
713         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
714         * html/HTMLVideoElement.h:
715         * html/canvas/CanvasRenderingContext2D.cpp:
716         (WebCore::size):
717         (WebCore::CanvasRenderingContext2D::drawImage):
718         * html/canvas/WebGLRenderingContextBase.cpp:
719         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
720         * platform/graphics/MediaPlayer.cpp:
721         (WebCore::NullMediaPlayerPrivate::naturalSize):
722         (WebCore::MediaPlayer::naturalSize):
723         (WebCore::MediaPlayer::paint):
724         (WebCore::MediaPlayer::paintCurrentFrameInContext):
725         (WebCore::NullMediaPlayerPrivate::paint): Deleted.
726         * platform/graphics/MediaPlayer.h:
727         * platform/graphics/MediaPlayerPrivate.h:
728         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
729         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
730         (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
731         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
732         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
733         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
734         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
735         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
736         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
737         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
738         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
739         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
740         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
741         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
742         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
743         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
744         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
745         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
746         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
747         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
748         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
749         (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
750         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
751         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
752         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
753         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
754         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
755         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
756         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
757         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
758         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
759         (WebCore::MediaPlayerPrivateQTKit::naturalSize):
760         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
761         (WebCore::MediaPlayerPrivateQTKit::paint):
762         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
763         (WebCore::MockMediaPlayerMediaSource::naturalSize):
764         (WebCore::MockMediaPlayerMediaSource::paint):
765         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
766         * rendering/RenderVideo.cpp:
767         (WebCore::RenderVideo::calculateIntrinsicSize):
768         (WebCore::RenderVideo::paintReplaced):
769
770 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
771
772         [EFL][GTK] Fix build break after r180790,180798
773         https://bugs.webkit.org/show_bug.cgi?id=142127
774
775         Reviewed by Gyuyoung Kim.
776
777         * platform/graphics/cairo/PathCairo.cpp:
778         (WebCore::Path::addEllipse):
779
780 2015-02-27  Zalan Bujtas  <zalan@apple.com>
781
782         Subpixel-layout: width: max-content; property might cause unnecessary scrollbar.
783         https://bugs.webkit.org/show_bug.cgi?id=142065
784
785         Reviewed by Simon Fraser.
786
787         We should not pixelsnap (ceil in this case) logical coordinates during layout.
788         Should this cause content to be partially cut off, we need to
789         find the broken piece in the computation logic.
790
791         Covered by the unskipped test.
792
793         * rendering/RootInlineBox.cpp:
794         (WebCore::RootInlineBox::paddedLayoutOverflowRect):
795
796 2015-02-27  Ryosuke Niwa  <rniwa@webkit.org>
797
798         Node::hasEditableStyle and isEditablePosition have too many options
799         https://bugs.webkit.org/show_bug.cgi?id=142078
800
801         Reviewed by Andreas Kling.
802
803         Moved the code that dealt with accessibility to htmlediting.cpp from Node. This patch introduces
804         new editing helper functions hasEditableStyle and isEditableNode for this purpose.
805
806         Also removed UserSelectAllTreatment from isContentEditable's arguments in the favor of using
807         newly extracted computeEditability in call sites that specify this option since isContentEditable
808         is a public DOM API.
809
810         No new tests since there should be no observable behavior changes.
811
812         * accessibility/AXObjectCache.h: Removed the declaration of an undefined function.
813
814         * dom/Element.cpp:
815         (WebCore::Element::shouldUseInputMethod): Uses newly added computeEditability.
816
817         * dom/Node.cpp:
818         (WebCore::Node::isContentEditable): Ditto. No longer takes UserSelectAllTreatment as an argument.
819         (WebCore::Node::isContentRichlyEditable): Ditto.
820         (WebCore::Node::computeEditability): Renamed from hasEditableStyle to avoid the confusion with
821         a helper function of the same name. Added ShouldUpdateStyle as an argument to optionally update
822         style tree. Also returns tri-state Editability enum instead of returning a boolean based on
823         the value of EditableLevel argument.
824         (WebCore::Node::isEditableToAccessibility): Moved to htmlediting.cpp.
825         (WebCore::Node::willRespondToMouseClickEvents): Uses newly added computeEditability.
826         (WebCore::Node::rootEditableElement): Moved to htmlediting.cpp.
827
828         * dom/Node.h: No longer includes EditingBoundary.h.
829         (WebCore::Node::isContentEditable):
830         (WebCore::Node::hasEditableStyle): No longer takes EditableType as an argument.
831         (WebCore::Node::hasRichlyEditableStyle): Ditto.
832
833         * editing/ApplyStyleCommand.cpp:
834         (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Uses newly added isEditableNode.
835         (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Ditto.
836         * editing/DeleteFromTextNodeCommand.cpp:
837         (WebCore::DeleteFromTextNodeCommand::doApply): Ditto.
838         * editing/FrameSelection.cpp:
839         (WebCore::CaretBase::invalidateCaretRect): Ditto.
840         * editing/InsertNodeBeforeCommand.cpp:
841         (WebCore::InsertNodeBeforeCommand::doApply): Ditto.
842         (WebCore::InsertNodeBeforeCommand::doUnapply): Ditto.
843         * editing/RemoveNodeCommand.cpp:
844         (WebCore::RemoveNodeCommand::doApply): Ditto.
845
846         * editing/VisibleSelection.cpp:
847         (WebCore::VisibleSelection::hasEditableStyle): Since this is the only caller of isEditablePosition
848         which sets DoNotUpdateStyle, directly call hasEditableStyle on the container node instead. This was
849         not possible prior to r180726 because isEditablePosition had to move out of tables.
850
851         * editing/VisibleUnits.cpp:
852         (WebCore::previousLeafWithSameEditability): Uses newly added hasEditableStyle.
853         (WebCore::nextLeafWithSameEditability): Ditto.
854         (WebCore::rootEditableOrDocumentElement): Extracted from previousLinePosition. Use helper functions
855         in htmlediting.cpp instead of member functions of Node since they no longer support EditableType.
856         (WebCore::previousLinePosition):
857         (WebCore::nextLinePosition):
858
859         * editing/htmlediting.cpp:
860         (WebCore::highestEditableRoot): Uses newly added hasEditableStyle.
861         (WebCore::isEditableToAccessibility): Moved from Node.
862         (WebCore::computeEditability): Extracted from isEditablePosition.
863         (WebCore::hasEditableStyle): Added.
864         (WebCore::isEditableNode): Added.
865         (WebCore::isEditablePosition): Now calls computeEditability.
866         (WebCore::isRichlyEditablePosition): No longer takes EditableType since that variant was never used.
867         (WebCore::editableRootForPosition): Moved the code from Node::rootEditableElement.
868
869         * editing/htmlediting.h:
870
871 2015-02-27  Chris Dumez  <cdumez@apple.com>
872
873         Make ActiveDOMObject::canSuspend() pure virtual
874         https://bugs.webkit.org/show_bug.cgi?id=142096
875         <rdar://problem/19923085>
876
877         Reviewed by Andreas Kling.
878
879         Make ActiveDOMObject::canSuspend() pure virtual so that people at least
880         try to provide an implementation for it. The default implementation was
881         returning false unconditionally and thus was preventing pages from
882         entering the PageCache.
883
884 2015-02-27  Commit Queue  <commit-queue@webkit.org>
885
886         Unreviewed, rolling out r180203 and r180210.
887         https://bugs.webkit.org/show_bug.cgi?id=142116
888
889         broke process suspension and tile map (Requested by thorton on
890         #webkit).
891
892         Reverted changesets:
893
894         "Adopt CAMachPort-as-layer-contents"
895         https://bugs.webkit.org/show_bug.cgi?id=141687
896         http://trac.webkit.org/changeset/180203
897
898         "Fix the !USE(IOSURFACE) build"
899         http://trac.webkit.org/changeset/180210
900
901 2015-02-27  Sam Weinig  <sam@webkit.org>
902
903         Add WebKit2 SPI to create a DOM File object
904         https://bugs.webkit.org/show_bug.cgi?id=142109
905
906         Reviewed by Tim Horton.
907
908         * WebCore.xcodeproj/project.pbxproj:
909         Make <WebCore/File.h> (and associated files) available to WebKit2.
910
911 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
912
913         [Subpixel] Subpixelize RenderListMarker
914         https://bugs.webkit.org/show_bug.cgi?id=142093
915
916         Reviewed by Zalan Bujtas.
917
918         Use floats instead of ints.
919
920         Test: fast/lists/rtl-marker.html
921
922         * rendering/RenderListMarker.cpp:
923         (WebCore::RenderListMarker::paint):
924         (WebCore::RenderListMarker::updateContent):
925         (WebCore::RenderListMarker::getRelativeMarkerRect):
926         * rendering/RenderListMarker.h:
927
928 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
929
930         <attachment> should be selected immediately upon click, and be drag/copyable upon click
931         https://bugs.webkit.org/show_bug.cgi?id=142114
932         <rdar://problem/19982520>
933
934         Reviewed by Enrica Casucci.
935
936         * css/html.css:
937         (attachment):
938         Make attachment use 'user-select: all' to act as a single click-to-select unit.
939
940         * html/HTMLAttachmentElement.cpp:
941         (WebCore::HTMLAttachmentElement::setFocus): Deleted.
942         * html/HTMLAttachmentElement.h:
943         * rendering/RenderAttachment.cpp:
944         (WebCore::RenderAttachment::isFocused): Deleted.
945         (WebCore::RenderAttachment::focusChanged): Deleted.
946         * rendering/RenderAttachment.h:
947         * rendering/RenderThemeMac.mm:
948         (WebCore::RenderThemeMac::paintAttachment):
949         Remove focus-related code; instead of focusing the element upon click,
950         we get a selection including just the <attachment>, and everything
951         behaves much more consistently (copy works, drag works, etc.).
952
953 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
954
955         [iOS] Some MathML tests crash in RenderMathMLOperator::advanceForGlyph() or boundsForGlyph()
956         https://bugs.webkit.org/show_bug.cgi?id=141371
957
958         Reviewed by David Kilzer.
959
960         Null checks.
961
962         Covered by existing mathml tests.
963
964         * rendering/mathml/RenderMathMLOperator.cpp:
965         (WebCore::RenderMathMLOperator::boundsForGlyph):
966         (WebCore::RenderMathMLOperator::advanceForGlyph):
967         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator):
968
969 2015-02-27  Chris Dumez  <cdumez@apple.com>
970
971         Make SourceBuffer ActiveDOMObject suspendable
972         https://bugs.webkit.org/show_bug.cgi?id=142108
973         <rdar://problem/19923085>
974
975         Reviewed by Jer Noble.
976
977         Make SourceBuffer ActiveDOMObject suspendable if it is removed from its
978         MediaSource and does not have any pending events. This makes it more
979         likely for pages using SourceBuffer objects to go into the PageCache.
980
981         Test: fast/history/page-cache-removed-source-buffer.html
982
983         * Modules/mediasource/SourceBuffer.cpp:
984         (WebCore::SourceBuffer::canSuspend):
985         * Modules/mediasource/SourceBuffer.h:
986
987 2015-02-26  Sam Weinig  <sam@webkit.org>
988
989         Add support for canvas ellipse method
990         https://bugs.webkit.org/show_bug.cgi?id=82791
991         <rdar://problem/11159172>
992
993         Reviewed by Dirk Schulze.
994
995         Tests: fast/canvas/canvas-ellipse-360-winding.html
996                fast/canvas/canvas-ellipse-circumference-fill.html
997                fast/canvas/canvas-ellipse-circumference.html
998                fast/canvas/canvas-ellipse-connecting-line.html
999                fast/canvas/canvas-ellipse-negative-radius.html
1000                fast/canvas/canvas-ellipse-zero-lineto.html
1001                fast/canvas/canvas-ellipse.html
1002
1003         * html/canvas/CanvasPathMethods.h:
1004         * html/canvas/CanvasPathMethods.cpp:
1005         (WebCore::CanvasPathMethods::lineTo):
1006         Convenience for passing a FloatPoint instead of two floats.
1007
1008         (WebCore::normalizeAngles):
1009         Normalizes the angles as described in the HTML spec. Ensuring the startAngle
1010         is greater than 0 and less than 2pi, and the the endAngle is at most 2pi
1011         from the start angle.
1012
1013         (WebCore::CanvasPathMethods::arc):
1014         - Renames some of the parameters to be clearer.
1015         - Normalizes the angles for consistency with ellipse.
1016         - Moves hasInvertibleTransform() higher in the function for consistency.
1017
1018         (WebCore::CanvasPathMethods::ellipse): Added.
1019
1020         * html/canvas/CanvasRenderingContext2D.idl:
1021         * html/canvas/DOMPath.idl:
1022         Add ellipse(...).
1023
1024         * platform/graphics/Path.h:
1025         * platform/graphics/cg/PathCG.cpp:
1026         (WebCore::Path::addArc):
1027         Rename parameters for clarity and use a nullptr.
1028
1029         (WebCore::Path::addEllipse):
1030         Added. Constructs an ellipse via a transformed arc.
1031
1032 2015-02-27  Enrica Casucci  <enrica@apple.com>
1033
1034         Adding support for serializing HTMLAttachment elements.
1035         https://bugs.webkit.org/show_bug.cgi?id=142026
1036
1037         Reviewed by Tim Horton.
1038
1039         Test: editing/pasteboard/copy-paste-attachment.html
1040
1041         Adding support to serialize the attachment element
1042         and properly handle it when converting a DOM range
1043         to NSAttributedString.
1044
1045         * editing/cocoa/HTMLConverter.mm:
1046         (HTMLConverter::_processElement):
1047         * editing/markup.cpp:
1048         (WebCore::StyledMarkupAccumulator::appendCustomAttributes): Create new attribute
1049         for attachment element when serializating.
1050         (WebCore::StyledMarkupAccumulator::appendElement):
1051         (WebCore::createFragmentFromMarkup): Remove the attribute from the attachment element
1052         when creating the fragment.
1053         * html/HTMLAttachmentElement.cpp:
1054         (WebCore::HTMLAttachmentElement::file): Added const to file() to
1055         use it in appendCustonAttributes where the element is a const reference.
1056         * html/HTMLAttachmentElement.h:
1057         * html/HTMLAttributeNames.in:
1058
1059 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
1060
1061         <attachment> should have an inactive style (gray in background)
1062         https://bugs.webkit.org/show_bug.cgi?id=142103
1063         <rdar://problem/19982486>
1064
1065         Reviewed by Dan Bernstein.
1066
1067         * rendering/RenderThemeMac.mm:
1068         (WebCore::attachmentLabelInactiveBackgroundColor):
1069         (WebCore::attachmentLabelInactiveTextColor):
1070         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
1071         (WebCore::RenderThemeMac::paintAttachmentLabel):
1072         Use a gray background and gray text when the selection containing the
1073         attachment isn't focused and active.
1074
1075 2015-02-27  Brady Eidson  <beidson@apple.com>
1076
1077         Add a "block-cookies" rule to the user content filter.
1078         https://bugs.webkit.org/show_bug.cgi?id=142105
1079
1080         Reviewed by Alex Christensen.
1081
1082         Tests: http/tests/usercontentfilter/block-cookies-basic.html
1083                http/tests/usercontentfilter/block-cookies-send.html
1084
1085         * contentextensions/ContentExtensionRule.h:
1086
1087         * contentextensions/ContentExtensionsBackend.cpp:
1088         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL):
1089         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL): Deleted.
1090         * contentextensions/ContentExtensionsBackend.h:
1091
1092         * contentextensions/ContentExtensionsManager.cpp:
1093         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
1094
1095         * loader/cache/CachedResourceLoader.cpp:
1096         (WebCore::CachedResourceLoader::requestResource):
1097
1098         * page/UserContentController.cpp:
1099         (WebCore::UserContentController::actionForURL):
1100         (WebCore::UserContentController::contentFilterBlocksURL): Deleted.
1101         * page/UserContentController.h:
1102
1103 2015-02-27  Alex Christensen  <achristensen@webkit.org>
1104
1105         [WinCairo] Unreviewed build fix.
1106
1107         * platform/graphics/BitmapImage.h:
1108         * platform/win/BitmapInfo.h:
1109         Added WEBCORE_EXPORT.
1110
1111 2015-02-27  Timothy Horton  <timothy_horton@apple.com>
1112
1113         <attachment>'s label baseline should match that of the surrounding text
1114         https://bugs.webkit.org/show_bug.cgi?id=142099
1115         rdar://problem/19982495
1116
1117         Reviewed by Dan Bernstein.
1118
1119         * rendering/RenderAttachment.cpp:
1120         (WebCore::RenderAttachment::baselinePosition):
1121         * rendering/RenderAttachment.h:
1122         Override baselinePosition and retrieve it from RenderTheme.
1123
1124         * rendering/RenderTheme.h:
1125         (WebCore::RenderTheme::attachmentBaseline):
1126         * rendering/RenderThemeMac.h:
1127         * rendering/RenderThemeMac.mm:
1128         (WebCore::AttachmentLayout::AttachmentLayout):
1129         (WebCore::RenderThemeMac::attachmentBaseline):
1130         Plumb the label baseline from AttachmentLayout to RenderAttachment.
1131
1132 2015-02-27  Commit Queue  <commit-queue@webkit.org>
1133
1134         Unreviewed, rolling out r180752.
1135         https://bugs.webkit.org/show_bug.cgi?id=142098
1136
1137         Causes 10 SVG test failures on Windows. (Requested by
1138         bfulgham_ on #webkit).
1139
1140         Reverted changeset:
1141
1142         "Cache glyph widths to GlyphPages"
1143         https://bugs.webkit.org/show_bug.cgi?id=142028
1144         http://trac.webkit.org/changeset/180752
1145
1146 2015-02-27  David Kilzer  <ddkilzer@apple.com>
1147
1148         [iOS] Fix build by defining EAGL_IOSURFACE macro before including <OpenGLES/EAGLPrivate.h>
1149
1150         * platform/spi/ios/OpenGLESSPI.h:  Define EAGL_IOSURFACE macro
1151         until header refactoring is completed.
1152
1153 2015-02-27  Chris Dumez  <cdumez@apple.com>
1154
1155         MediaSource should be suspendable when closed
1156         https://bugs.webkit.org/show_bug.cgi?id=142089
1157         <rdar://problem/19923085>
1158
1159         Reviewed by Jer Noble.
1160
1161         Make MediaSource ActiveDOMObject suspendable when it is in closed state
1162         and it has no pending events. This increases the likelihood of pages
1163         using MediaSource to enter the PageCache.
1164
1165         Tests: fast/history/page-cache-media-source-closed-2.html
1166                fast/history/page-cache-media-source-closed.html
1167                fast/history/page-cache-media-source-opened.html
1168
1169 2015-02-27  Andreas Kling  <akling@apple.com>
1170
1171         Use NeverDestroyed for JS wrapper owners.
1172         <https://webkit.org/b/142090>
1173
1174         Reviewed by Chris Dumez.
1175
1176         Using NeverDestroyed puts these objects in BSS which is preferable
1177         since that prevents them from pinning down entire malloc pages forever.
1178
1179         * bindings/scripts/CodeGeneratorJS.pm:
1180         (GenerateHeader): Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
1181
1182         * bindings/scripts/test/JS/*: Rebaseline bindings tests for this change.
1183
1184 2015-02-27  Chris Dumez  <cdumez@apple.com>
1185
1186         Make IDBDatabase / IDBRequest suspendable
1187         https://bugs.webkit.org/show_bug.cgi?id=142076
1188         <rdar://problem/19923085>
1189
1190         Reviewed by Andreas Kling.
1191
1192         Make IDBDatabase / IDBRequest suspendable under certain conditions to
1193         make it more likely for pages using indexeddb to enter the PageCache.
1194
1195         IDBDatabase is safely suspendable if the database is closed. IDBRequest
1196         is safely suspendable if the request no longer has any pending activity
1197         (i.e. state is DONE and success / failure handler was called). We may
1198         be able to do better later but this is the bare minimum for now.
1199
1200         Tests: fast/history/page-cache-indexed-closed-db.html
1201                fast/history/page-cache-indexed-opened-db.html
1202
1203         * Modules/indexeddb/IDBDatabase.cpp:
1204         (WebCore::IDBDatabase::IDBDatabase):
1205         (WebCore::IDBDatabase::closeConnection):
1206         (WebCore::IDBDatabase::enqueueEvent):
1207         (WebCore::IDBDatabase::canSuspend):
1208         * Modules/indexeddb/IDBDatabase.h:
1209         * Modules/indexeddb/IDBRequest.cpp:
1210         (WebCore::IDBRequest::canSuspend):
1211         * Modules/indexeddb/IDBRequest.h:
1212
1213 2015-02-27  Chris Dumez  <cdumez@apple.com>
1214
1215         Drop unnecessary DatabaseManager::hasOpenDatabases() in PageCache::canCachePageContainingThisFrame()
1216         https://bugs.webkit.org/show_bug.cgi?id=142052
1217
1218         Reviewed by Andreas Kling.
1219
1220         Drop WebDatabase special-handling from PageCache::canCachePageContainingThisFrame().
1221         DatabaseContext is already an ActiveDOMObject and DatabaseContext::canSuspend() was
1222         returning false so pages using WebDatabase would never enter the PageCache anyway.
1223
1224         This patch also overrides ActiveDOMObject::canSuspend() in DatabaseContext to only
1225         return false when there are open databases. This check is now equivalent to the one
1226         that was in PageCache.
1227
1228         An issue that remains is that DatabaseContext::m_hasOpenDatabases is never reset
1229         to false so once a page opened a database, it will never be page-cacheable. This
1230         will be taken care of separately though.
1231
1232         Test: fast/history/page-cache-webdatabase-opened-db.html
1233
1234         * Modules/webdatabase/DatabaseContext.cpp:
1235         (WebCore::DatabaseContext::canSuspend):
1236         * Modules/webdatabase/DatabaseContext.h:
1237         * history/PageCache.cpp:
1238         (WebCore::logCanCacheFrameDecision):
1239         (WebCore::PageCache::canCachePageContainingThisFrame):
1240         * page/DiagnosticLoggingKeys.cpp:
1241         (WebCore::DiagnosticLoggingKeys::hasOpenDatabasesKey): Deleted.
1242         * page/DiagnosticLoggingKeys.h:
1243
1244 2015-02-27  Alex Christensen  <achristensen@webkit.org>
1245
1246         Compile DFA to bytecode.
1247         https://bugs.webkit.org/show_bug.cgi?id=142031
1248
1249         Reviewed by Benjamin Poulain.
1250
1251         * WebCore.xcodeproj/project.pbxproj:
1252         * contentextensions/ContentExtensionsBackend.cpp:
1253         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
1254         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
1255         * contentextensions/ContentExtensionsBackend.h:
1256         * contentextensions/DFA.cpp:
1257         (WebCore::ContentExtensions::DFA::nextState): Deleted.
1258         (WebCore::ContentExtensions::DFA::actions): Deleted.
1259         * contentextensions/DFA.h:
1260         (WebCore::ContentExtensions::DFA::size):
1261         (WebCore::ContentExtensions::DFA::nodeAt):
1262         * contentextensions/DFABytecode.h: Added.
1263         (WebCore::ContentExtensions::instructionSizeWithArguments):
1264         * contentextensions/DFABytecodeCompiler.cpp: Added.
1265         (WebCore::ContentExtensions::append):
1266         (WebCore::ContentExtensions::set32Bits):
1267         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
1268         (WebCore::ContentExtensions::DFABytecodeCompiler::emitJump):
1269         (WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
1270         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTerminate):
1271         (WebCore::ContentExtensions::DFABytecodeCompiler::reserveBufferCapacity):
1272         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1273         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
1274         * contentextensions/DFABytecodeCompiler.h: Added.
1275         (WebCore::ContentExtensions::DFABytecodeCompiler::DFABytecodeCompiler):
1276         * contentextensions/DFABytecodeInterpreter.cpp: Added.
1277         (WebCore::ContentExtensions::getBits):
1278         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1279         * contentextensions/DFABytecodeInterpreter.h: Added.
1280         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
1281
1282 2015-02-27  Zalan Bujtas  <zalan@apple.com>
1283
1284         Use after free in WebCore::RenderNamedFlowFragment::restoreRegionObjectsOriginalStyle
1285         https://bugs.webkit.org/show_bug.cgi?id=138366
1286
1287         Reviewed by Dave Hyatt.
1288
1289         This patch ensures that we clean up RenderNamedFlowFragment::m_renderObjectRegionStyle when embedded flow content is getting destroyed.
1290
1291         In m_renderObjectRegionStyle hash map, we store style information about the named flow's descendant children.
1292         When a child is being detached from the tree, it removes itself from this hashmap.
1293         We do it by traversing up on the ancestor chain and call removeFlowChildInfo() on the parent flow.
1294         However in case of embedded flows (for example multicolumn content inside a region), we need to check whether the parent flow
1295         is inside a flow too and continue the cleanup accordingly.
1296
1297         Test: fast/regions/region-with-multicolumn-embedded-crash.html
1298
1299         * rendering/RenderObject.cpp:
1300         (WebCore::RenderObject::removeFromRenderFlowThreadIncludingDescendants):
1301
1302 2015-02-27  Brady Eidson  <beidson@apple.com>
1303
1304         Add API to remove a single content filter.
1305         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
1306
1307         Reviewed by Sam Weinig.
1308
1309         * page/UserContentController.cpp:
1310         (WebCore::UserContentController::removeUserContentFilter):
1311         * page/UserContentController.h:
1312
1313 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
1314
1315         [Win] Remove remaining SafariTheme cruft
1316         https://bugs.webkit.org/show_bug.cgi?id=142075
1317
1318         Reviewed by Anders Carlsson.
1319
1320         Remove reference to SafariTheme-switching preference.
1321
1322         Tested by existing layout tests.
1323
1324         * WebCore.vcxproj/WebCore.vcxproj:
1325         * WebCore.vcxproj/WebCore.vcxproj.filters:
1326         * config.h:
1327         * page/Settings.cpp:
1328         (WebCore::Settings::fontRenderingMode):
1329         (WebCore::Settings::setShouldPaintNativeControls): Deleted.
1330         * page/Settings.h:
1331         (WebCore::Settings::shouldPaintNativeControls): Deleted.
1332         * platform/win/ScrollbarThemeWin.cpp:
1333         (WebCore::ScrollbarTheme::nativeTheme):
1334         * rendering/RenderThemeWin.cpp:
1335         (WebCore::RenderTheme::themeForPage):
1336
1337 2015-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1338
1339         Add comment about CSS value name mangling
1340
1341         Unreviewed
1342
1343         * css/CSSParser.cpp:
1344         (WebCore::cssValueKeywordID):
1345
1346 2015-02-27  Antti Koivisto  <antti@apple.com>
1347
1348         Cache glyph widths to GlyphPages
1349         https://bugs.webkit.org/show_bug.cgi?id=142028
1350
1351         Reviewed by Andreas Kling.
1352
1353         Currently we have a separate cache in Font for glyph widths. In practice we always need
1354         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
1355         a per-character hash lookup from WidthIterator.
1356
1357         * platform/graphics/Font.cpp:
1358         (WebCore::Font::Font):
1359         (WebCore::Font::initCharWidths):
1360         (WebCore::Font::platformGlyphInit):
1361         (WebCore::createAndFillGlyphPage):
1362         (WebCore::Font::computeWidthForGlyph):
1363
1364             Rename to make it clear this doesn't cache.
1365
1366         (WebCore::GlyphPage::setGlyphDataForIndex):
1367
1368             Initialize the width.
1369             This could go to GlyphPage.cpp if we had one.
1370
1371         * platform/graphics/Font.h:
1372         (WebCore::Font::glyphZeroWidth):
1373         (WebCore::Font::isZeroWidthSpaceGlyph):
1374         (WebCore::Font::zeroGlyph): Deleted.
1375         (WebCore::Font::setZeroGlyph): Deleted.
1376         (WebCore::Font::widthForGlyph): Deleted.
1377         * platform/graphics/FontCascade.cpp:
1378         (WebCore::offsetToMiddleOfGlyph):
1379         * platform/graphics/FontCascadeFonts.cpp:
1380         (WebCore::FontCascadeFonts::glyphDataForCharacter):
1381         * platform/graphics/GlyphPage.h:
1382         (WebCore::GlyphData::GlyphData):
1383
1384             Return width too as part of GlyphData.
1385
1386         (WebCore::GlyphPage::glyphDataForIndex):
1387         (WebCore::GlyphPage::setGlyphDataForCharacter):
1388         (WebCore::GlyphPage::setGlyphDataForIndex):
1389         (WebCore::GlyphPage::GlyphPage):
1390         * platform/graphics/WidthIterator.cpp:
1391         (WebCore::WidthIterator::advanceInternal):
1392
1393             No need to lookup width separately now.
1394
1395         * platform/graphics/mac/ComplexTextController.cpp:
1396         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1397         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1398         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
1399         * rendering/mathml/RenderMathMLOperator.cpp:
1400         (WebCore::RenderMathMLOperator::advanceForGlyph):
1401         * rendering/svg/SVGTextRunRenderingContext.cpp:
1402         (WebCore::missingGlyphForFont):
1403         * svg/SVGFontData.cpp:
1404         (WebCore::SVGFontData::initializeFont):
1405
1406 2015-02-26  Alexey Proskuryakov  <ap@apple.com>
1407
1408         iOS build fix after r180717.
1409
1410         * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseUnpauseTask::doPerformTask):
1411
1412 2015-02-26  Ryosuke Niwa  <rniwa@webkit.org>
1413
1414         isEditablePosition and related functions shouldn't move position out of table
1415         https://bugs.webkit.org/show_bug.cgi?id=129200
1416
1417         Reviewed by Darin Adler.
1418
1419         This patch removes the legacy editing position for elements display: table in its computed style.
1420         Previously, we used (table, 0) and (table, !0) to denote positions immediately before and after
1421         such an element for historical reasons. This forced us to update the style tree before computing
1422         the editability of a position because we have to check the editability of the position outside
1423         the element with display: table if the position was using such a legacy editing position.
1424         e.g. if a table was not editable (contenteditable=false), the position before the table (table, 0)
1425         should still be considered editable if the parent node of the table was editable.
1426
1427         This patch replaces such a legacy editing position by using modern position types:
1428         PositionIsBeforeAnchor and PositionIsAfterAnchor.
1429
1430         No new tests since there should be no change in the user perceived editing operations.
1431
1432         * dom/Position.cpp:
1433         (WebCore::Position::previous): Setup the node and the offset correctly when the original position's
1434         type is PositionIsBeforeAnchor. Also return a position before or after node when the node we found
1435         is "atomic" (e.g. input, img, br, etc...) or it's a table. This avoids creating a legacy editing
1436         position inside a table.
1437         (WebCore::Position::next): Ditto.
1438         (WebCore::Position::atStartOfTree): Use atFirstEditingPositionForNode, which takes care of all types
1439         of positions.
1440         (WebCore::Position::atEndOfTree): Ditto.
1441         (WebCore::Position::downstream): Return a position before a node instead of a legacy editing position
1442         for an atomic element or a table element as done in the equivalent code in Position::upstream.
1443         (WebCore::Position::isCandidate): Don't treat a position inside a table to be a candidate. e.g.
1444         (table, 1) when there are more than two children of the table.
1445
1446         * dom/PositionIterator.cpp:
1447         (WebCore::PositionIterator::operator Position): PositionIterator internally uses legacy editing
1448         positions. So convert it to a modern position by returning a position before or after a table here.
1449         * editing/ApplyBlockElementCommand.cpp:
1450         (WebCore::ApplyBlockElementCommand::formatSelection): Check that the unsplittable element we found
1451         is actually empty before executing the simple code path for an empty unsplittable element. Without
1452         this check, block formatting a table element will fail.
1453
1454         * editing/htmlediting.cpp:
1455         (WebCore::isEditablePosition): Use containerNode instead of deprecatedNode because the editability
1456         of a position before or after an element is determined by its parent, not the element itself.
1457         (WebCore::isAtUnsplittableElement): Ditto.
1458         (WebCore::isRichlyEditablePosition): Ditto. Removed the code that moved the starting node out of
1459         an element with display: table. This is the code removal for which this patch was made.
1460         (WebCore::editableRootForPosition): Ditto.
1461
1462 2015-02-26  Timothy Horton  <timothy_horton@apple.com>
1463
1464         Implement <attachment> element appearance on Mac
1465         https://bugs.webkit.org/show_bug.cgi?id=142023
1466
1467         Reviewed by Dean Jackson.
1468
1469         * css/CSSParser.cpp:
1470         (WebCore::isValidKeywordPropertyAndValue):
1471         * css/CSSPrimitiveValueMappings.h:
1472         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1473         * css/CSSValueKeywords.in:
1474         * css/html.css:
1475         (attachment):
1476         * platform/ThemeTypes.h:
1477         Add a new -webkit-appearance value, attachment.
1478
1479         * WebCore.xcodeproj/project.pbxproj:
1480         * html/HTMLAttachmentElement.cpp:
1481         (WebCore::HTMLAttachmentElement::setFile):
1482         Let the renderer know when the file changes (so it can relayout and repaint).
1483
1484         (WebCore::HTMLAttachmentElement::filePath):
1485         (WebCore::HTMLAttachmentElement::fileName):
1486         * html/HTMLAttachmentElement.h:
1487         Handy acccessors for the full path and the name of the file.
1488
1489         * platform/spi/mac/IconServicesSPI.h: Added.
1490         * platform/spi/mac/LaunchServicesSPI.h: Added.
1491         Add some IconServices and LaunchServices SPI headers.
1492
1493         * rendering/RenderAttachment.cpp:
1494         (WebCore::RenderAttachment::RenderAttachment):
1495         Don't have a default intrinsic size; we'll adjust in layout().
1496
1497         (WebCore::RenderAttachment::isSelected):
1498         (WebCore::RenderAttachment::isFocused):
1499         (WebCore::RenderAttachment::isSelectedOrFocused):
1500         Factor out from paintReplaced().
1501
1502         (WebCore::RenderAttachment::layout):
1503         Use RenderTheme to compute the intrinsic size of this attachment.
1504
1505         (WebCore::RenderAttachment::paintReplaced):
1506         Use RenderTheme to paint the attachment.
1507
1508         (WebCore::RenderAttachment::representedFileChanged):
1509         When the represented file changes, we need to recompute the intrinsic size and repaint.
1510
1511         * rendering/RenderTheme.cpp:
1512         (WebCore::RenderTheme::adjustStyle):
1513         (WebCore::RenderTheme::paint):
1514         (WebCore::RenderTheme::adjustAttachmentStyle):
1515         (WebCore::RenderTheme::paintAttachment):
1516         Plumb through the attachment appearance.
1517
1518         * rendering/RenderAttachment.h:
1519         * rendering/RenderTheme.h:
1520         (WebCore::RenderTheme::paintAttachment):
1521         (WebCore::RenderTheme::attachmentIntrinsicSize):
1522         * rendering/RenderThemeMac.h:
1523         * rendering/RenderThemeMac.mm:
1524         (WebCore::attachmentIconBackgroundColor):
1525         (WebCore::attachmentIconBorderColor):
1526         (WebCore::AttachmentLayout):
1527         AttachmentLayout lays out the innards of the RenderThemeMac attachment
1528         presentation: an icon with an optional bordered background, with a label
1529         underneath it with an optional background.
1530
1531         (WebCore::RenderThemeMac::attachmentIntrinsicSize):
1532         (WebCore::paintAttachmentIconBackground):
1533         (WebCore::paintAttachmentIcon):
1534         (WebCore::RenderThemeMac::paintAttachmentLabelBackground):
1535         (WebCore::RenderThemeMac::paintAttachmentLabel):
1536         (WebCore::RenderThemeMac::paintAttachment):
1537         Paint the attachment element. Paint the optional backgrounds (and swap
1538         out the text color) if the element is selected/focused.
1539
1540 2015-02-26  Doug Russell  <d_russell@apple.com>
1541
1542         AX: Expose caret browsing preference to accessibility API
1543         https://bugs.webkit.org/show_bug.cgi?id=141862
1544
1545         Reviewed by Chris Fleizach.
1546
1547         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).
1548         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.
1549
1550         Tests: platform/mac/accessibility/caret-browsing-arrow-nav.html
1551                platform/mac/accessibility/caret-browsing-attribute.html
1552                platform/mac/accessibility/caret-browsing-tab-selection.html
1553
1554         * accessibility/AccessibilityObject.h:
1555         * accessibility/mac/AccessibilityObjectMac.mm:
1556         (WebCore::AccessibilityObject::caretBrowsingEnabled):
1557         (WebCore::AccessibilityObject::setCaretBrowsingEnabled):
1558         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1559         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1560         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1561         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
1562         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
1563         (-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]):
1564
1565 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1566
1567         Remove unnecessary create() factory functions
1568         https://bugs.webkit.org/show_bug.cgi?id=142039
1569
1570         Reviewed by Chris Dumez.
1571
1572         Clean up remaining JSCryptoKeySerializationJWK::create, HTMLMediaSession::create,
1573         and DatabaseUnpauseTask::create.
1574
1575         * Modules/webdatabase/DatabaseThread.cpp:
1576         (WebCore::DatabaseUnpauseTask::DatabaseUnpauseTask):
1577         (WebCore::DatabaseThread::setPaused):
1578         (WebCore::DatabaseUnpauseTask::create): Deleted.
1579         * bindings/js/JSCryptoKeySerializationJWK.h:
1580         * bindings/js/JSSubtleCryptoCustom.cpp:
1581         (WebCore::importKey):
1582         * html/HTMLMediaElement.cpp:
1583         (WebCore::HTMLMediaElement::HTMLMediaElement):
1584         * html/HTMLMediaSession.cpp:
1585         (WebCore::HTMLMediaSession::create): Deleted.
1586         * html/HTMLMediaSession.h:
1587
1588 2015-02-26  Joseph Pecoraro  <pecoraro@apple.com>
1589
1590         Web Inspector: Save Console Evaluations into Command Line variables $1-$99 ($n)
1591         https://bugs.webkit.org/show_bug.cgi?id=142061
1592
1593         Reviewed by Timothy Hatcher.
1594
1595         * inspector/CommandLineAPIModuleSource.js:
1596         Replace $1-$4 "inspected objects" with $1-$99 "saved results".
1597
1598         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1599         (WebCore::JSCommandLineAPIHost::inspectedObject):
1600         * inspector/CommandLineAPIHost.cpp:
1601         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
1602         (WebCore::CommandLineAPIHost::InspectableObject::get):
1603         (WebCore::CommandLineAPIHost::addInspectedObject):
1604         (WebCore::CommandLineAPIHost::inspectedObject):
1605         (WebCore::CommandLineAPIHost::clearInspectedObjects): Deleted.
1606         * inspector/CommandLineAPIHost.h:
1607         * inspector/CommandLineAPIHost.idl:
1608         Since we now just save the single $0 inspected object, eliminate
1609         keeping track of a list of 5 values.
1610
1611 2015-02-26  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1612
1613         Remove unnecessary create() factory functions in CDMFoo, NamedNodeMap
1614         https://bugs.webkit.org/show_bug.cgi?id=141902
1615
1616         Reviewed by Darin Adler.
1617
1618         Create instance using std::make_unique<> in CDMFactory directly. To do that,
1619         CDMFactory uses lambdas. Additionally this patch removes NamedNodeMap::create() as well.
1620
1621         No new tests, no behavior changes.
1622
1623         * Modules/encryptedmedia/CDM.cpp:
1624         (WebCore::installedCDMFactories):
1625         * Modules/encryptedmedia/CDM.h:
1626         * Modules/encryptedmedia/CDMPrivateClearKey.h:
1627         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
1628         (WebCore::CDMPrivateClearKey::create): Deleted.
1629         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
1630         (WebCore::CDMPrivateMediaPlayer::create): Deleted.
1631         * dom/Element.cpp:
1632         (WebCore::Element::attributes):
1633         * dom/NamedNodeMap.h:
1634         (WebCore::NamedNodeMap::NamedNodeMap):
1635         (WebCore::NamedNodeMap::create): Deleted.
1636         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1637         (WebCore::CDMPrivateMediaSourceAVFObjC::create): Deleted.
1638
1639 2015-02-26  Andy Estes  <aestes@apple.com>
1640
1641         [Content Filtering] Move WebFilterEvaluator and NEFilterSource declarations to SPI headers
1642         https://bugs.webkit.org/show_bug.cgi?id=142062
1643
1644         Reviewed by Daniel Bates.
1645
1646         * WebCore.xcodeproj/project.pbxproj:
1647         * platform/mac/ContentFilterMac.mm:
1648         * platform/spi/cocoa/NEFilterSourceSPI.h: Added.
1649         * platform/spi/cocoa/WebFilterEvaluatorSPI.h: Added.
1650
1651 2015-02-26  Anders Carlsson  <andersca@apple.com>
1652
1653         Add API to remove all website data for the given data records
1654         https://bugs.webkit.org/show_bug.cgi?id=142060
1655
1656         Reviewed by Beth Dakin.
1657
1658         * loader/cache/MemoryCache.cpp:
1659         (WebCore::MemoryCache::removeResourcesWithOrigins):
1660         New function that removes all resources that match the set of origins in a given session.
1661
1662 2015-02-26  Chris Dumez  <cdumez@apple.com>
1663
1664         Rename DatabaseManager::manager() to DatabaseManager::singleton()
1665         https://bugs.webkit.org/show_bug.cgi?id=142054
1666
1667         Reviewed by Ryosuke Niwa.
1668
1669         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
1670         per coding style and use WTF::NeverDestroyed.
1671
1672         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1673         (WebCore::DOMWindowWebDatabase::openDatabase):
1674         * Modules/webdatabase/DatabaseBackendBase.cpp:
1675         (WebCore::DatabaseBackendBase::DatabaseBackendBase):
1676         * Modules/webdatabase/DatabaseContext.cpp:
1677         (WebCore::DatabaseContext::DatabaseContext):
1678         (WebCore::DatabaseContext::~DatabaseContext):
1679         (WebCore::DatabaseContext::stopDatabases):
1680         (WebCore::DatabaseContext::databaseExceededQuota):
1681         * Modules/webdatabase/DatabaseManager.cpp:
1682         (WebCore::DatabaseManager::singleton):
1683         (WebCore::DatabaseManager::manager): Deleted.
1684         * Modules/webdatabase/DatabaseManager.h:
1685         (WebCore::DatabaseManager::~DatabaseManager): Deleted.
1686         * Modules/webdatabase/SQLTransactionClient.cpp:
1687         (WebCore::SQLTransactionClient::didExceedQuota):
1688         * history/PageCache.cpp:
1689         (WebCore::logCanCacheFrameDecision):
1690         (WebCore::PageCache::canCachePageContainingThisFrame):
1691         * loader/FrameLoader.cpp:
1692         (WebCore::FrameLoader::stopLoading):
1693
1694 2015-02-26  Csaba Osztrogonác  <ossy@webkit.org>
1695
1696         Fix the !ENABLE(GEOLOCATION) build after r180533
1697         https://bugs.webkit.org/show_bug.cgi?id=142053
1698
1699         Reviewed by Chris Dumez.
1700
1701         * Modules/geolocation/GeoNotifier.cpp:
1702         * Modules/geolocation/GeoNotifier.h:
1703
1704 2015-02-26  Dean Jackson  <dino@apple.com>
1705
1706         [iOS Media] incorrect front padding on time values
1707         https://bugs.webkit.org/show_bug.cgi?id=142027
1708         <rdar://problem/19960790>
1709
1710         Reviewed by Brent Fulgham.
1711
1712         My last commit was updating the OS X file,
1713         not the iOS file.
1714
1715         We don't want to prefix times with a "0".
1716
1717         * Modules/mediacontrols/mediaControlsApple.js:
1718         (Controller.prototype.formatTime):
1719         * Modules/mediacontrols/mediaControlsiOS.js:
1720         (ControllerIOS.prototype.formatTime):
1721
1722 2015-02-26  Mark Lam  <mark.lam@apple.com>
1723
1724         Rolling out r180602, r180608, r180613, r180617, r180671.
1725         <https://webkit.org/b/141990>
1726
1727         Not reviewed.
1728
1729         The r180602 solution does result in more work for GC when worker
1730         threads are in use.  Filip is uncomfortable with that.
1731         The EFL and GTK ports also seem to be unhappy with this change.
1732         Rolling out while we investigate.
1733
1734         * bindings/js/JSDOMWindowBase.cpp:
1735         (WebCore::JSDOMWindowBase::commonVM):
1736
1737 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
1738
1739         [Mac] [iOS] Parsing support for -apple-trailing-word
1740         https://bugs.webkit.org/show_bug.cgi?id=141939
1741
1742         Reviewed by Andreas Kling.
1743
1744         This patch implements initial parsing support for the -apple-trailing-word CSS property.
1745         This property has two possible (mutually exclusive) values: auto and
1746         -apple-partially-balanced. This property is inherited.
1747
1748         The work for this property is behind the ENABLE(CSS_TRAILING_WORD) preprocessor define.
1749
1750         This is an internal property that will allow us to control line breaking behavior for
1751         short paragraphs.
1752
1753         Note that, because of the implementation of cssValueKeywordID() in CSSParser.cpp,
1754         the new value must be implemented as -webkit-partially-balanced. Using the -apple-
1755         prefix will work, but if you getComputedStyle(), it will return the -webkit- prefixed
1756         version.
1757
1758         Test: platform/mac/fast/text/trailing-word-parse.html
1759
1760         * Configurations/FeatureDefines.xcconfig:
1761         * css/CSSComputedStyleDeclaration.cpp:
1762         (WebCore::ComputedStyleExtractor::propertyValue): Turn internal representation into a
1763         CSS value.
1764         * css/CSSParser.cpp:
1765         (WebCore::isValidKeywordPropertyAndValue): Updated for new keyword property / value
1766         pair.
1767         (WebCore::isKeywordPropertyID): New property is a keyword property.
1768         (WebCore::CSSParser::parseValue): Use the keyword property codepath.
1769         * css/CSSPrimitiveValueMappings.h:
1770         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Convert to and from the internal
1771         representation and CSS values.
1772         (WebCore::CSSPrimitiveValue::operator TrailingWord):
1773         * css/CSSPropertyNames.in: New property.
1774         * css/CSSValueKeywords.in: New value.
1775         * rendering/SimpleLineLayout.cpp:
1776         (WebCore::SimpleLineLayout::canUseFor): Can't use SimpleLineLayout for this.
1777         * rendering/style/RenderStyle.h: Getter, setter and initial value.
1778         * rendering/style/RenderStyleConstants.h: Internal data type.
1779         * rendering/style/StyleRareInheritedData.h: One bit to control this style property.
1780         * rendering/style/StyleRareInheritedData.cpp: Update constructors and operators.
1781
1782 2015-02-26  Roger Fong  <roger_fong@apple.com>
1783
1784         Unreviewed. Fix a accidental deletion from r178674.
1785
1786         * html/canvas/WebGLRenderingContextBase.cpp:
1787         (WebCore::WebGLRenderingContextBase::create):
1788         Return the fake WebGL context.
1789
1790 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1791
1792         Cleanup RenderSVGResourceClipper class.
1793         https://bugs.webkit.org/show_bug.cgi?id=142032.
1794
1795         Reviewed by Darin Adler.
1796         
1797         This is a follow up for r180643: <http://trac.webkit.org/changeset/180643>.
1798         It includes cleanup for RenderSVGResourceClipper class.
1799
1800         * rendering/svg/RenderSVGResourceClipper.cpp:
1801         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
1802         (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
1803         * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
1804         typedef instead of a class and rename it to ClipperMaskImage. The purpose
1805         of having it a class even though it includes only one member was because
1806         we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
1807         as a separate object on the heap anymore.
1808         
1809         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
1810         double hash table lookups by calling HashMap::contains() and then HashMap::get(),
1811         we can use HashMap::add() instead.
1812
1813 2015-02-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1814
1815         Setting any of the <object> element plugin controlling attributes does not have any affect.
1816         https://bugs.webkit.org/show_bug.cgi?id=141936.
1817
1818         Reviewed by Zalan Bujtas.
1819
1820         When setting any of the <object> element plugin controlling attributes
1821         dynamically we need to mark the the element to be dirty by calling
1822         setNeedsStyleRecalc(), so it has to recreate its renderer when needed.
1823         
1824         Test: svg/as-object/svg-in-object-dynamic-attribute-change.html
1825
1826         * dom/Element.h: Delete unimplemented function.
1827         
1828         * html/HTMLObjectElement.cpp:
1829         (WebCore::HTMLObjectElement::parseAttribute): Dirty the element by calling
1830         setNeedsStyleRecalc() when one of the plugin controlling attributes gets
1831         changed. We have to clear the m_useFallbackContent because the attribute's
1832         new value might fix the object rendering.
1833         
1834         * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent.
1835         
1836         * html/HTMLPlugInImageElement.cpp:
1837         (WebCore::HTMLPlugInImageElement::willRecalcStyle): We might need to 
1838         reconstruct the object renderer in the image case. This can happen if the
1839         image was rendering fallback content and the attribute's new value fixes
1840         the object rendering.
1841
1842 2015-02-26  Brent Fulgham  <bfulgham@apple.com>
1843
1844         [Win] Make build logs more legible by reducing noise
1845         https://bugs.webkit.org/show_bug.cgi?id=142034
1846
1847         Reviewed by Alexey Proskuryakov.
1848
1849         Modify batch files, makefiles, and DOS commands to remove
1850         uninteresting/unhelpful output.
1851
1852         * WebCore.vcxproj/WebCoreGenerated.make:
1853         * WebCore.vcxproj/WebCorePreBuild.cmd:
1854         * WebCore.vcxproj/copyForwardingHeaders.cmd:
1855         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
1856
1857 2015-02-26  Michael Catanzaro  <mcatanzaro@igalia.com>
1858
1859         [FreeType] REGRESSION(r180563): Introduced crashes
1860         https://bugs.webkit.org/show_bug.cgi?id=142044
1861
1862         Reviewed by Martin Robinson.
1863
1864         No new tests, should be caught by any woff font test.
1865
1866         Use optionsPattern, not m_pattern, when m_pattern may be null.
1867
1868         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1869         (WebCore::FontPlatformData::initializeWithFontFace):
1870
1871 2015-02-26  Sergio Villar Senin  <svillar@igalia.com>
1872
1873         ASSERTION FAILED: !length.isUndefined() in WebCore::GridLength::GridLength
1874         https://bugs.webkit.org/show_bug.cgi?id=141645
1875
1876         Reviewed by Chris Dumez.
1877
1878         This bug has been here since r110484 but was uncovered by
1879         r180140. The problem r110484 was trying to fix was that
1880         CSSPrimitiveValue::convertToLength<Length> ended up calling
1881         CSSPrimitiveValue::computeLengthDouble() which was apparently
1882         dereferencing conversionData.style() and
1883         conversionData.rootStyle() pointers without checking them. That's
1884         why that fix added this condition to convertToLength():
1885
1886         isFontRelativeLength() && (!conversionData.style() || !conversionData.rootStyle())
1887
1888         which is not correct, because for the 4 possible font relative
1889         length types, 3 of them just use the style() pointer and the other
1890         one just uses rootStyle() which BTW could be NULL. This erroneous
1891         condition makes that function to return Length(Undefined) more
1892         often than it should.
1893
1894         From now on it only returns Length(Undefined) if the style()
1895         pointer is NULL and the font relative length type is one in the
1896         set (CSS_EMS, CSS_EXS, CSS_CHS);
1897
1898         Test: fast/css-grid-layout/grid-with-relative-font-length-crash.html
1899
1900         * css/CSSPrimitiveValue.h:
1901         * css/CSSPrimitiveValueMappings.h:
1902         (WebCore::CSSPrimitiveValue::convertingToLengthRequiresNonNullStyle):
1903         (WebCore::CSSPrimitiveValue::convertToLength):
1904
1905
1906 2015-02-26  Andreas Kling  <akling@apple.com>
1907
1908         [Cocoa] Prod libcache to drop caches in memory pressure relief handler.
1909         <https://webkit.org/b/142024>
1910         <rdar://problem/19966096>
1911
1912         Reviewed by Antti Koivisto.
1913
1914         libcache already listens to the OS memory pressure notifications, but we still
1915         need to manually request a cleanup when doing an iOS process suspension, or when
1916         simulating memory pressure.
1917
1918         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1919         (WebCore::MemoryPressureHandler::platformReleaseMemory): Call out to libcache's
1920         cache_simulate_memory_warning_event() to make sure that nonessential objects
1921         being kept alive by NSCaches get dropped when we need the memory.
1922
1923 2015-02-25  Zalan Bujtas  <zalan@apple.com>
1924
1925         Black line across screen on Adobe Illustrator detail page (non-retina only)
1926         https://bugs.webkit.org/show_bug.cgi?id=141866
1927
1928         Reviewed by Simon Fraser.
1929
1930         Phase is relative to the destination origin. We need to take location information into account
1931         while snapping so that the result is inline with the snapped destination rect.
1932         (location affects the snapped size.)
1933
1934         Test: fast/backgrounds/gradient-background-on-subpixel-position.html
1935
1936         * rendering/RenderBoxModelObject.cpp:
1937         (WebCore::pixelSnapBackgroundImageGeometryForPainting):
1938         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1939
1940 2015-02-25  Brent Fulgham  <bfulgham@apple.com>
1941
1942         [Win] Use WEBCORE_EXPORT instead of Definition file
1943         https://bugs.webkit.org/show_bug.cgi?id=141734
1944
1945         Reviewed by Alex Christensen.
1946
1947         No change in functionality.
1948
1949         * WebCore.vcxproj/WebCore.vcxproj: Correct bad Precompiled header
1950         settings on certain files.
1951         * WebCore.vcxproj/WebCore.vcxproj.filters: Automatically updated
1952         by Visual Studio.
1953         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Ditto.
1954         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Ditto.
1955         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Added.
1956         * WebCore.vcxproj/WebCoreTestSupportDebug.props: Added.
1957         * WebCore.vcxproj/WebCoreTestSupportDebugWinCairo.props: Added.
1958         * WebCore.vcxproj/WebCoreTestSupportProduction.props: Added.
1959         * WebCore.vcxproj/WebCoreTestSupportRelease.props: Added.
1960         * WebCore.vcxproj/WebCoreTestSupportReleaseWinCairo.props: Added.
1961         * WebCorePrefix.h: Provide proper export definitions for Windows.
1962         * bindings/js/JSCustomXPathNSResolver.cpp: Add missing #include
1963         needed by the new export style.
1964         * bindings/js/JSDOMWindowBase.h: Export class since DRT needs
1965         access to parts of it.
1966         * bindings/js/ScriptCachedFrameData.cpp: Add missing #include
1967         needed by the new export style.
1968         * bindings/scripts/CodeGeneratorJS.pm: Use different export macro
1969         when generating WebCoreTestSupport files, so that we don't confuse
1970         the linker when WebCore.lib and WebCoreTestSupport.lib try to
1971         both export WEBCORE_EXPORT symbols.
1972         (ExportLabelForClass):
1973         (GenerateHeader):
1974         * bridge/jsc/BridgeJSC.cpp: Add missing #include needed by the new
1975         export style.
1976         * css/CSSParser.cpp: Ditto.
1977         * dom/Document.cpp: Ditto.
1978         * html/HTMLImageLoader.cpp: Ditto.
1979         * inspector/CommandLineAPIModule.cpp: Ditto.
1980         * inspector/PageDebuggerAgent.cpp: Ditto.
1981         * inspector/PageRuntimeAgent.cpp: Ditto.
1982         * inspector/WorkerRuntimeAgent.cpp: Ditto.
1983         * page/DOMWindow.cpp: Ditto.
1984         * page/DOMWindow.h: Export the destructor, as it is needed by
1985         DumpRenderTree (on Windows).
1986         * page/Page.cpp: Add missing #include needed by the new export style.
1987         * platform/Logging.h: Remove conflicting export declaration.
1988         * platform/PlatformExportMacros.h: Update for Windows use.
1989         * testing/Internals.cpp: Add missing #include needed by the new export style.
1990         * testing/Internals.h: Use WEBCORE_TESTSUPPORT_EXPORT for things that
1991         are supposed to be exported by WebCoreTestSupport, not WebCore.
1992         * testing/js/WebCoreTestSupport.cpp: Add missing #include needed by
1993         new export style.
1994         * testing/js/WebCoreTestSupportPrefix.cpp: Added.
1995         * testing/js/WebCoreTestSupportPrefix.h: Added.
1996         * xml/XMLHttpRequest.h: Export the destructor.
1997         * xml/XSLStyleSheetLibxslt.cpp: Add missing #include needed by the new
1998         export style.
1999         * xml/XSLTProcessorLibxslt.cpp: Ditto.
2000
2001 2015-02-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2002
2003         Remove unnecessary DatabaseFooTask::create
2004         https://bugs.webkit.org/show_bug.cgi?id=142002
2005
2006         Reviewed by Darin Adler.
2007
2008         DatabaseFooTask::create can be replaced with std::make_unique<>.
2009
2010         No new tests, no behavior changes.
2011
2012         * Modules/webdatabase/Database.cpp:
2013         (WebCore::Database::scheduleTransaction):
2014         (WebCore::Database::scheduleTransactionStep):
2015         (WebCore::Database::markAsDeletedAndClose):
2016         (WebCore::Database::closeImmediately):
2017         (WebCore::Database::tableNames):
2018         * Modules/webdatabase/DatabaseTask.h:
2019         (WebCore::DatabaseBackend::DatabaseCloseTask::create): Deleted.
2020         (WebCore::DatabaseBackend::DatabaseTransactionTask::create): Deleted.
2021         (WebCore::DatabaseBackend::DatabaseTableNamesTask::create): Deleted.
2022
2023 2015-02-25  Dean Jackson  <dino@apple.com>
2024
2025         [iOS Media] incorrect front padding on time values
2026         https://bugs.webkit.org/show_bug.cgi?id=142027
2027         <rdar://problem/19960790>
2028
2029         Reviewed by Brent Fulgham.
2030
2031         We don't want to prefix times with a "0".
2032
2033         * Modules/mediacontrols/mediaControlsApple.js:
2034         (Controller.prototype.formatTime):
2035
2036 2015-02-25  Chris Dumez  <cdumez@apple.com>
2037
2038         Make PublicURLManager suspendable
2039         https://bugs.webkit.org/show_bug.cgi?id=141977
2040         <rdar://problem/19923085>
2041
2042         Reviewed by Andreas Kling.
2043
2044         Make PublicURLManager suspendable by overriding ActiveDOMObject::canSuspend()
2045         and returning true. Nothing prevents suspending the PublicURLManager as its
2046         implementation never causes JS to be executed. No implementation for
2047         suspend() / resume() needs to be provided for the same reason.
2048
2049         The fact that PublicURLManager wasn't suspendable was preventing pages using
2050         URL.createObjectURL() from entering the PageCache. Baidu.com search results
2051         pages are using the API for example.
2052
2053         Test: fast/history/page-cache-createObjectURL.html
2054
2055         * html/PublicURLManager.cpp:
2056         (WebCore::PublicURLManager::canSuspend):
2057         * html/PublicURLManager.h:
2058
2059 2015-02-25  Zalan Bujtas  <zalan@apple.com>
2060
2061         Cleanup BackgroundImageGeometry class.
2062         https://bugs.webkit.org/show_bug.cgi?id=141997
2063
2064         Reviewed by Simon Fraser.
2065
2066         This patch attempts to improve RenderBoxModelObject::calculateBackgroundImageGeometry() readability by
2067         removing redundant code and making image geometry operations explicit. BackgroundImageGeometry
2068         becomes a read only class (with the exception of the clip() method).
2069
2070         No change in functionality.
2071
2072         * rendering/RenderBoxModelObject.cpp:
2073         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry):
2074         (WebCore::BackgroundImageGeometry::pixelSnapBackgroundImageGeometryForPainting):
2075         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2076         (WebCore::BackgroundImageGeometry::setNoRepeatX): Deleted.
2077         (WebCore::BackgroundImageGeometry::setNoRepeatY): Deleted.
2078         (WebCore::BackgroundImageGeometry::useFixedAttachment): Deleted.
2079         (WebCore::BackgroundImageGeometry::clip): Deleted.
2080         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting): Deleted.
2081         * rendering/RenderBoxModelObject.h:
2082         (WebCore::BackgroundImageGeometry::clip):
2083         (WebCore::BackgroundImageGeometry::BackgroundImageGeometry): Deleted.
2084         (WebCore::BackgroundImageGeometry::setDestRect): Deleted.
2085         (WebCore::BackgroundImageGeometry::setPhase): Deleted.
2086         (WebCore::BackgroundImageGeometry::setPhaseX): Deleted.
2087         (WebCore::BackgroundImageGeometry::setPhaseY): Deleted.
2088         (WebCore::BackgroundImageGeometry::setTileSize): Deleted.
2089         (WebCore::BackgroundImageGeometry::setSpaceSize): Deleted.
2090         (WebCore::BackgroundImageGeometry::setHasNonLocalGeometry): Deleted.
2091
2092 2015-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2093
2094         Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
2095         https://bugs.webkit.org/show_bug.cgi?id=141776.
2096
2097         Reviewed by Dean Jackson.
2098
2099         Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg
2100                svg/clip-path/clip-path-line-use-before-defined.svg
2101
2102         * rendering/svg/RenderSVGResourceClipper.cpp:
2103         (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer
2104         is added to m_clipper if it does not exist. The same renderer might have been 
2105         added to m_clipper in resourceBoundingBox().
2106         
2107         (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to
2108         m_clipper if it does not exist. Return the associated ClipperData.
2109         
2110         (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is
2111         referenced before it is defined, add the renderer to m_clipper. While doing the
2112         layout() for the clipper, we can check if m_clipper has values or not. If it does
2113         have, we are going to mark the clipper for client invalidation which is done by
2114         the SVG root.
2115         
2116         * rendering/svg/RenderSVGResourceClipper.h:
2117         * rendering/svg/RenderSVGResourceContainer.h:
2118         (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a 
2119         new function selfNeedsClientInvalidation() which controls marking the clipper 
2120         for client invalidation. In RenderSVGResourceClipper, override it so it checks
2121         m_clipper to force clients validation even if it the first time we do layout
2122         for this clipper.
2123
2124         * rendering/svg/RenderSVGResourceContainer.cpp:
2125         (WebCore::RenderSVGResourceContainer::layout): Call the virtual function
2126         selfNeedsClientInvalidation() to check whether we need to mark the clipper for
2127         client invalidation.
2128         
2129         * svg/SVGElement.cpp: Delete unneeded header file.
2130
2131 2015-02-25  peavo@outlook.com  <peavo@outlook.com>
2132
2133         [WinCairo] WinLauncher is not starting on Vista.
2134         https://bugs.webkit.org/show_bug.cgi?id=141905
2135
2136         Reviewed by Alex Christensen.
2137
2138         We have to soft link with Media Foundation functions to be able
2139         to start on Vista and WinXP.
2140
2141         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2142         (WebCore::MediaPlayerPrivateMediaFoundation::createSession):
2143         (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
2144         (WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
2145         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
2146         (WebCore::MediaPlayerPrivateMediaFoundation::createTopologyFromSource):
2147         (WebCore::MediaPlayerPrivateMediaFoundation::createOutputNode):
2148         (WebCore::MediaPlayerPrivateMediaFoundation::createSourceStreamNode):
2149         (WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
2150
2151 2015-02-25  Beth Dakin  <bdakin@apple.com>
2152
2153         REGRESSION (r180018 ): Holding a rubber-band in place can get stuck
2154         https://bugs.webkit.org/show_bug.cgi?id=142020
2155         -and corresponding-
2156         rdar://problem/19945216
2157
2158         Reviewed by Tom Horton.
2159
2160         It was a mistaken assumption that it was necessary to return false in the zero-
2161         delta case. That is clearly conceptually wrong since false represents the DOM 
2162         doing something special with the event, which is clearly not the case if we never 
2163         even send the event to the DOM. Returning true will allow the rest of the 
2164         scrolling machinery the ability to handle the event.
2165         * dom/Element.cpp:
2166         (WebCore::Element::dispatchWheelEvent):
2167
2168 2015-02-25  Ryosuke Niwa  <rniwa@webkit.org>
2169
2170         HTMLElement::collectStyleForPresentationAttribute duplicates a lot of code for contentEditableAttr
2171         https://bugs.webkit.org/show_bug.cgi?id=142003
2172
2173         Reviewed by Sam Weinig.
2174
2175         Utilized contentEditableType to reduce the code duplication.
2176
2177         * html/HTMLElement.cpp:
2178         (WebCore::contentEditableType): Moved and added a version that takes AtomicString.
2179         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
2180
2181 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
2182
2183         [CSS Grid Layout] Tracks growing beyond limits when they should not
2184         https://bugs.webkit.org/show_bug.cgi?id=140883
2185
2186         Reviewed by Darin Adler.
2187
2188         Our track sizing algorithm implementation incorrectly grew some
2189         tracks beyond limits when handling min-content and max-content
2190         base sizes. In those cases we should only grow "any affected track
2191         that happens to also have an intrinsic max track sizing function"
2192         or all of them if there are none.
2193
2194         The problem was that we're using a vector of indexes pointing to
2195         the vector with the list of affected tracks. Those indexes become
2196         easily incorrect because the first thing we do in
2197         distributeSpaceToTracks() is to sort the vector with the affected
2198         tracks by growth potential.
2199
2200         Instead of that we now pass a vector with pointers to the list of
2201         tracks allowed to grow over the limits. The size changes are now
2202         directly stored in the GridTracks (it's called plannedSize)
2203         instead of in a separate vector, so we don't need to worry about
2204         tracks being rearranged (and we also get rid of the ugly vector of
2205         indexes pointing to another vector).
2206
2207         * rendering/RenderGrid.cpp:
2208         (WebCore::GridTrack::plannedSize): New member with getter/setter.
2209         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2210         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2211         Pass a setXXX() function instead of a growXXX() one to ForItems().
2212         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2213         Renamed additionalBreadthSpace to extraSpace which is the term
2214         used by specs.
2215         (WebCore::RenderGrid::distributeSpaceToTracks): Use GridTrack's
2216         plannedSize instead of the old distribution vector.
2217         (WebCore::GridTrack::growBaseSize): Deleted.
2218         (WebCore::GridTrack::growGrowthLimit): Deleted.
2219         * rendering/RenderGrid.h:
2220
2221 2015-02-25  Joanmarie Diggs  <jdiggs@igalia.com>
2222
2223         AX: Implement support for ARIA 1.1 'searchbox' role
2224         https://bugs.webkit.org/show_bug.cgi?id=142004
2225
2226         Reviewed by Chris Fleizach.
2227
2228         Add a new accessible SearchFieldRole to handle both the ARIA role
2229         and the "search" input type.
2230
2231         No new tests. Instead, added a new test case to roles-exposed.html
2232         for the mapping, and updated roles-computedRoleString.html because
2233         there is now a one-to-one mapping between the "search" input type
2234         and an ARIA role.
2235
2236         * accessibility/AccessibilityNodeObject.cpp:
2237         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
2238         (WebCore::AccessibilityNodeObject::isSearchField):
2239         * accessibility/AccessibilityObject.cpp:
2240         (WebCore::AccessibilityObject::isARIATextControl):
2241         (WebCore::AccessibilityObject::isARIAInput):
2242         (WebCore::initializeRoleMap):
2243         * accessibility/AccessibilityObject.h:
2244         * accessibility/AccessibilityRenderObject.cpp:
2245         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2246         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2247         (atkRole):
2248         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2249         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
2250         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
2251         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2252         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2253         (createAccessibilityRoleMap):
2254
2255 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
2256
2257         Clarify some resizing terminology in ScrollView/FrameView
2258         https://bugs.webkit.org/show_bug.cgi?id=141996
2259
2260         Reviewed by Zalan Bujtas.
2261
2262         ScrollableArea/ScrollView/FrameView had some confusing terminology around
2263         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
2264         
2265         Clarify this by distinguishing between:
2266         1. Available size changes because of
2267             i) non-overlay scrollbar presence
2268            ii) ScrollableArea frame change
2269         2. Removing fixedLayoutSizeChanged() and just treating it like an
2270            available size change.
2271            
2272         contentsResized() is relegated to simply being a hook that allows Mac to
2273         flash overlay scrollbars.
2274         
2275         The confusingly named visibleContentsResized() is now updateContentsSize(),
2276         and is the way that a ScrollableArea tells its subclasss that it should recompute
2277         the size of the contents (i.e. do a layout).
2278
2279         * page/FrameView.cpp:
2280         (WebCore::FrameView::setContentsSize): No longer mysteriously skip the
2281         FrameView implementation of contentsResized(), which used to do a setNeedsLayout()
2282         which we didn't want to do from setContentsSize(), which itself happens as a result of layout.
2283         (WebCore::FrameView::adjustViewSize): Whitespace.
2284         (WebCore::FrameView::layout): Ditto.
2285         (WebCore::FrameView::availableContentSizeChanged): Called on frame size change, or scrollbar
2286         change.
2287         (WebCore::FrameView::updateContentsSize): This actually does the layout.
2288         (WebCore::FrameView::scrollbarStyleChanged): Always call the base class;  ScrollView::scrollbarStyleChanged
2289         will bail if not a forced update.
2290         (WebCore::FrameView::setCustomFixedPositionLayoutRect): Forces a layout via updateContentsSize() now.
2291         (WebCore::FrameView::contentsResized): Deleted.
2292         (WebCore::FrameView::fixedLayoutSizeChanged): Deleted.
2293         (WebCore::FrameView::visibleContentsResized): Deleted.
2294         * page/FrameView.h:
2295         * platform/ScrollView.cpp:
2296         (WebCore::ScrollView::setFixedLayoutSize): Calls availableContentSizeChanged() now.
2297         (WebCore::ScrollView::setUseFixedLayout): Ditto.
2298         (WebCore::ScrollView::availableContentSizeChanged): Update scrollbars if that's not
2299         the reason we are being called.
2300         (WebCore::ScrollView::updateScrollbars): contentsResized() was the thing that caused setNeedsLayout();
2301         replace it with availableContentSizeChanged(). visibleContentsResized() did the layout, and
2302         replace with updateContentsSize().
2303         (WebCore::ScrollView::setFrameRect): Call availableContentSizeChanged() now. This takes care of
2304         updating scrollbars, so no need to explicitly do that.
2305         (WebCore::ScrollView::scrollbarStyleChanged): Call the base class.
2306         (WebCore::ScrollView::fixedLayoutSizeChanged): Deleted.
2307         * platform/ScrollView.h:
2308         * platform/ScrollableArea.cpp:
2309         (WebCore::ScrollableArea::availableContentSizeChanged): Call scrollAnimator->contentsResized()
2310         to flash the scrollbars.
2311         (WebCore::ScrollableArea::scrolledToRight):
2312         (WebCore::ScrollableArea::scrollbarStyleChanged): Call availableContentSizeChanged() since
2313         scrollbar style affects available space.
2314         * platform/ScrollableArea.h:
2315         (WebCore::ScrollableArea::updateContentsSize):
2316         (WebCore::ScrollableArea::scrollbarStyleChanged): Deleted.
2317
2318 2015-02-24  Ryosuke Niwa  <rniwa@webkit.org>
2319
2320         Unreviewed Mavericks build attempt fix after r180609.
2321
2322         * platform/graphics/mac/GraphicsContext3DMac.mm:
2323         (WebCore::GraphicsContext3D::GraphicsContext3D):
2324         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary):
2325
2326 2015-02-19  Roger Fong  <roger_fong@apple.com>
2327
2328         WebGL: Destroy the GLContext if a GPU restart has been detected.
2329         https://bugs.webkit.org/show_bug.cgi?id=141567.
2330         <rdar://problem/18507496>
2331
2332         Reviewed by Dean Jackson.
2333
2334         * html/canvas/WebGLRenderingContextBase.cpp:
2335         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2336         * platform/graphics/GraphicsContext3D.h:
2337         (WebCore::GraphicsContext3D::setWebGLContext): 
2338         Keep track of which WebGLRenderingContext is associated with the current GraphicsContext3D.
2339         * platform/graphics/mac/GraphicsContext3DMac.mm:
2340         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Helper method to check GPU status.
2341         (WebCore::GraphicsContext3D::GraphicsContext3D): 
2342         Don’t immediately abort the GPU process when the restart status is kCGLCPGPURestartStatusBlacklisted.
2343         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2344         (WebCore::GraphicsContext3D::forceContextLost): 
2345         Force the WebGLRenderingContext to be lost.
2346         (WebCore::GraphicsContext3D::drawArrays): Check GPU status after calling drawArrays.
2347         (WebCore::GraphicsContext3D::drawElements): Check GPU status after calling drawElements.
2348         * WebCore.xcodeproj/project.pbxproj: Add SPI header for iOS.
2349         * platform/spi/ios/OpenGLESSPI.h: Added.
2350
2351 2015-02-24  Stephanie Lewis  <slewis@apple.com>
2352
2353         Unreviewed ios build fix after http://trac.webkit.org/changeset/180602.
2354
2355         * bindings/js/JSDOMWindowBase.cpp:
2356         (WebCore::JSDOMWindowBase::commonVM):
2357
2358 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
2359
2360         Use an enum for scrollbar style
2361         https://bugs.webkit.org/show_bug.cgi?id=141985
2362
2363         Reviewed by Beth Dakin.
2364
2365         Switch to an enum class for the scrollbar style (normal or overlay).
2366
2367         * page/ChromeClient.h:
2368         * page/FrameView.cpp:
2369         (WebCore::FrameView::scrollbarStyleChanged):
2370         * page/FrameView.h:
2371         * platform/ScrollTypes.h:
2372         * platform/ScrollView.cpp:
2373         (WebCore::ScrollView::scrollbarStyleChanged):
2374         * platform/ScrollView.h:
2375         * platform/ScrollableArea.h:
2376         (WebCore::ScrollableArea::scrollbarStyleChanged):
2377         * platform/mac/ScrollAnimatorMac.mm:
2378         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
2379
2380 2015-02-24  Commit Queue  <commit-queue@webkit.org>
2381
2382         Unreviewed, rolling out r180599.
2383         https://bugs.webkit.org/show_bug.cgi?id=141998
2384
2385         Lots of new test failures (Requested by smfr on #webkit).
2386
2387         Reverted changeset:
2388
2389         "Parsing support for -webkit-trailing-word"
2390         https://bugs.webkit.org/show_bug.cgi?id=141939
2391         http://trac.webkit.org/changeset/180599
2392
2393 2015-02-24  Sam Weinig  <sam@webkit.org>
2394
2395         [Attachment] Give <attachment> elements an underlying File
2396         https://bugs.webkit.org/show_bug.cgi?id=141993
2397
2398         Reviewed by Tim Horton.
2399
2400         - Add a JS subclass for attachments so that <attachment>s are
2401           instances of HTMLAttachmentElement rather than HTMLElement.
2402         - Give HTMLAttachmentElements an underlying File that they
2403           are the representation of. Expose it via a new 'file' property.
2404         - Expose a new Internals function called window.internals.createFile(url)
2405           that allows creating File objects for testing.
2406
2407         * CMakeLists.txt:
2408         * DerivedSources.cpp:
2409         * DerivedSources.make:
2410         * WebCore.vcxproj/WebCore.vcxproj:
2411         * WebCore.vcxproj/WebCore.vcxproj.filters:
2412         * WebCore.xcodeproj/project.pbxproj:
2413         * fileapi/File.h:
2414         * html/HTMLAttachmentElement.cpp:
2415         (WebCore::HTMLAttachmentElement::~HTMLAttachmentElement):
2416         (WebCore::HTMLAttachmentElement::file):
2417         (WebCore::HTMLAttachmentElement::setFile):
2418         * html/HTMLAttachmentElement.h:
2419         * html/HTMLAttachmentElement.idl: Added.
2420         * html/HTMLTagNames.in:
2421         * testing/Internals.cpp:
2422         (WebCore::Internals::createFile):
2423         * testing/Internals.h:
2424         * testing/Internals.idl:
2425
2426 2015-02-24  Joanmarie Diggs  <jdiggs@igalia.com>
2427
2428         AX: Implement support for ARIA 1.1 'switch' role
2429         https://bugs.webkit.org/show_bug.cgi?id=141986
2430
2431         Reviewed by Chris Fleizach.
2432
2433         Map the role to ATK_ROLE_TOGGLE_BUTTON for Gtk and Efl; on the Mac, to
2434         AXCheckBox with a subrole of AXSwitch. Ensure it looks and acts like a
2435         widget to accessibility APIs (supports and emits notifications when
2436         toggled, doesn't have children, exposes a name and description when
2437         provided).
2438
2439         Tests: accessibility/aria-switch-checked.html
2440                accessibility/aria-switch-sends-notification.html
2441                accessibility/aria-switch-text.html
2442
2443         * accessibility/AccessibilityNodeObject.cpp:
2444         (WebCore::AccessibilityNodeObject::canHaveChildren):
2445         (WebCore::AccessibilityNodeObject::isChecked):
2446         (WebCore::AccessibilityNodeObject::visibleText):
2447         (WebCore::AccessibilityNodeObject::title):
2448         * accessibility/AccessibilityObject.cpp:
2449         (WebCore::AccessibilityObject::isARIAInput):
2450         (WebCore::AccessibilityObject::actionVerb):
2451         (WebCore::initializeRoleMap):
2452         (WebCore::AccessibilityObject::supportsChecked):
2453         (WebCore::AccessibilityObject::checkboxOrRadioValue):
2454         * accessibility/AccessibilityObject.h:
2455         (WebCore::AccessibilityObject::isSwitch):
2456         * accessibility/atk/AXObjectCacheAtk.cpp:
2457         (WebCore::AXObjectCache::postPlatformNotification):
2458         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2459         (atkRole):
2460         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2461         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
2462         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
2463         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2464         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2465         (createAccessibilityRoleMap):
2466         (-[WebAccessibilityObjectWrapper subrole]):
2467         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2468
2469 2015-02-24  Myles C. Maxfield  <mmaxfield@apple.com>
2470
2471         [Mac] [iOS] Parsing support for -apple-trailing-word
2472         https://bugs.webkit.org/show_bug.cgi?id=141939
2473
2474         Reviewed by Andreas Kling.
2475
2476         This patch implements initial parsing support for the -apple-trailing-word CSS property.
2477         This property has two possible (mutually exclusive) values: auto and
2478         -apple-partially-balanced. This property is inherited.
2479
2480         The work for this property is behind the ENABLE(CSS_TRAILING_WORD) preprocessor define.
2481
2482         This is an internal property that will allow us to control line breaking behavior for
2483         short paragraphs.
2484
2485         Note that, because of the implementation of cssValueKeywordID() in CSSParser.cpp,
2486         the new value must be implemented as -webkit-partially-balanced. Using the -apple-
2487         prefix will work, but if you getComputedStyle(), it will return the -webkit- prefixed
2488         version.
2489
2490         Test: platform/mac/fast/text/trailing-word-parse.html
2491
2492         * Configurations/FeatureDefines.xcconfig:
2493         * css/CSSComputedStyleDeclaration.cpp:
2494         (WebCore::ComputedStyleExtractor::propertyValue): Turn internal representation into a
2495         CSS value.
2496         * css/CSSParser.cpp:
2497         (WebCore::isValidKeywordPropertyAndValue): Updated for new keyword property / value
2498         pair.
2499         (WebCore::isKeywordPropertyID): New property is a keyword property.
2500         (WebCore::CSSParser::parseValue): Use the keyword property codepath.
2501         * css/CSSPrimitiveValueMappings.h:
2502         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Convert to and from the internal
2503         representation and CSS values.
2504         (WebCore::CSSPrimitiveValue::operator TrailingWord):
2505         * css/CSSPropertyNames.in: New property.
2506         * css/CSSValueKeywords.in: New value.
2507         * rendering/SimpleLineLayout.cpp:
2508         (WebCore::SimpleLineLayout::canUseFor): Can't use SimpleLineLayout for this.
2509         * rendering/style/RenderStyle.h: Getter, setter and initial value.
2510         * rendering/style/RenderStyleConstants.h: Internal data type.
2511         * rendering/style/StyleRareInheritedData.h: One bit to control this style property.
2512
2513 2015-02-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2514
2515         Remove DecodingTask::create and DatabaseOpenTask::create
2516         https://bugs.webkit.org/show_bug.cgi?id=141966
2517
2518         Reviewed by Anders Carlsson.
2519
2520         These create() factory functions are redundant. We can use std::make_unique<> directly.
2521
2522         No new tests, no behavior changes.
2523
2524         * Modules/webaudio/AsyncAudioDecoder.cpp:
2525         (WebCore::AsyncAudioDecoder::decodeAsync):
2526         (WebCore::AsyncAudioDecoder::DecodingTask::create): Deleted.
2527         * Modules/webaudio/AsyncAudioDecoder.h:
2528         * Modules/webdatabase/Database.cpp:
2529         (WebCore::Database::openAndVerifyVersion):
2530         * Modules/webdatabase/DatabaseTask.h:
2531         (WebCore::DatabaseBackend::DatabaseOpenTask::create): Deleted.
2532
2533 2015-02-24  Commit Queue  <commit-queue@webkit.org>
2534
2535         Unreviewed, rolling out r180578.
2536         https://bugs.webkit.org/show_bug.cgi?id=141992
2537
2538         Broke scrolling in Inspector Console. (Requested by JoePeck on
2539         #webkit).
2540
2541         Reverted changeset:
2542
2543         "[Mac] WebKit abandons overlay scrollbar CALayers."
2544         https://bugs.webkit.org/show_bug.cgi?id=141943
2545         http://trac.webkit.org/changeset/180578
2546
2547 2015-02-24  Dean Jackson  <dino@apple.com>
2548
2549         [ios Media] the inline controls are visible after pressing Done on iPhone
2550         https://bugs.webkit.org/show_bug.cgi?id=141987
2551         <rdar://problem/19944110>
2552
2553         Reviewed by Beth Dakin.
2554
2555         When exiting out of a playing video, we should show the
2556         start playback button if we don't allow inline media
2557         (such as on iPhone).
2558
2559         * Modules/mediacontrols/mediaControlsiOS.js:
2560         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): Test for
2561         allowsInline as well.
2562
2563 2015-02-24  Zalan Bujtas  <zalan@apple.com>
2564
2565         Pass FillLayer reference instead of pointer to RenderBoxModelObject::calculateBackgroundImageGeometry.
2566         https://bugs.webkit.org/show_bug.cgi?id=141982
2567
2568         Reviewed by Simon Fraser.
2569
2570         There should always be a valid FillLayer.
2571
2572         No change in functionality.
2573
2574         * rendering/RenderBox.cpp:
2575         (WebCore::RenderBox::getBackgroundPaintedExtent):
2576         (WebCore::RenderBox::maskClipRect):
2577         (WebCore::RenderBox::repaintLayerRectsForImage):
2578         * rendering/RenderBoxModelObject.cpp:
2579         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2580         (WebCore::RenderBoxModelObject::calculateFillTileSize):
2581         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2582         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
2583         * rendering/RenderBoxModelObject.h:
2584
2585 2015-02-24  Dean Jackson  <dino@apple.com>
2586
2587         [iOS Media] Be specific about which document to use for the timeline background canvas
2588         https://bugs.webkit.org/show_bug.cgi?id=141981
2589
2590         Reviewed by Eric Carlson.
2591
2592         In some cases, especially with nested iframes, the document
2593         reference for the shadow DOM might not be the one used
2594         to create a -webkit-canvas context for rendering via CSS.
2595         Explicitly get the context from the video's owner
2596         document.
2597
2598         There is still a bug here:
2599         https://bugs.webkit.org/show_bug.cgi?id=141983
2600
2601         * Modules/mediacontrols/mediaControlsiOS.js:
2602         (ControllerIOS.prototype.drawTimelineBackground):
2603
2604 2015-02-24  Zalan Bujtas  <zalan@apple.com>
2605
2606         Remove unused BackgroundImageGeometry::m_destOrigin
2607         https://bugs.webkit.org/show_bug.cgi?id=141980
2608
2609         Reviewed by Simon Fraser.
2610
2611         Remove BackgroundImageGeometry::m_destOrigin and its dependencies.
2612         They are not used at all.
2613
2614         No change in functionality.
2615
2616         * rendering/RenderBoxModelObject.cpp:
2617         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2618         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting):
2619         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2620         (WebCore::BackgroundImageGeometry::relativePhase): Deleted.
2621         * rendering/RenderBoxModelObject.h:
2622         (WebCore::BackgroundImageGeometry::destOrigin): Deleted.
2623         (WebCore::BackgroundImageGeometry::setDestOrigin): Deleted.
2624         * rendering/svg/RenderSVGResourceMasker.cpp:
2625         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
2626
2627 2015-02-24  Zalan Bujtas  <zalan@apple.com>
2628
2629         RenderBoxModelObject::calculateBackgroundImageGeometry should return BackgroundImageGeometry.
2630         https://bugs.webkit.org/show_bug.cgi?id=141979
2631
2632         Reviewed by Simon Fraser.
2633
2634         No change in functionality.
2635
2636         * rendering/RenderBox.cpp:
2637         (WebCore::RenderBox::getBackgroundPaintedExtent):
2638         (WebCore::RenderBox::maskClipRect):
2639         (WebCore::RenderBox::repaintLayerRectsForImage):
2640         * rendering/RenderBoxModelObject.cpp:
2641         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2642         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2643         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
2644         * rendering/RenderBoxModelObject.h:
2645
2646 2015-02-24  Zalan Bujtas  <zalan@apple.com>
2647
2648         Switch BackgroundImageGeometry's m_phase from LayoutPoint to LayoutSize.
2649         https://bugs.webkit.org/show_bug.cgi?id=141972
2650
2651         Reviewed by Simon Fraser.
2652
2653         Image geometry's phase represents distance.
2654
2655         No change in functionality.
2656
2657         * WebCore.order:
2658         * platform/graphics/GraphicsLayer.h:
2659         (WebCore::GraphicsLayer::setContentsTilePhase):
2660         (WebCore::GraphicsLayer::contentsTilePhase):
2661         * platform/graphics/texmap/TextureMapperLayer.cpp:
2662         (WebCore::TextureMapperLayer::computePatternTransformIfNeeded):
2663         (WebCore::TextureMapperLayer::setContentsTilePhase):
2664         * platform/graphics/texmap/TextureMapperLayer.h:
2665         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2666         (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
2667         * rendering/RenderBoxModelObject.cpp:
2668         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2669         (WebCore::BackgroundImageGeometry::setNoRepeatX):
2670         (WebCore::BackgroundImageGeometry::setNoRepeatY):
2671         (WebCore::BackgroundImageGeometry::useFixedAttachment):
2672         (WebCore::BackgroundImageGeometry::relativePhase):
2673         (WebCore::RenderBoxModelObject::pixelSnapBackgroundImageGeometryForPainting):
2674         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
2675         * rendering/RenderBoxModelObject.h:
2676         (WebCore::BackgroundImageGeometry::phase):
2677         (WebCore::BackgroundImageGeometry::setPhase):
2678         (WebCore::BackgroundImageGeometry::setPhaseX):
2679         (WebCore::BackgroundImageGeometry::setPhaseY):
2680         * rendering/RenderLayerBacking.cpp:
2681         (WebCore::RenderLayerBacking::resetContentsRect):
2682         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
2683         * rendering/svg/RenderSVGResourceMasker.cpp:
2684         (WebCore::RenderSVGResourceMasker::drawMaskForRenderer):
2685
2686 2015-02-24  Andreas Kling  <akling@apple.com>
2687
2688         [Mac] WebKit abandons overlay scrollbar CALayers.
2689         <https://webkit.org/b/141943>
2690         <rdar://problem/19932199>
2691
2692         Reviewed by Beth Dakin.
2693
2694         * platform/mac/ScrollAnimatorMac.mm:
2695         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
2696         Use NSAnimationNonblockingThreaded to ensure that NSAnimations get cleaned up after they finish.
2697         The animation was indirectly retaining the overlay scrollbar's CALayer, causing significant
2698         amounts of abandoned memory to accumulate over time.
2699
2700 2015-02-24  Anders Carlsson  <andersca@apple.com>
2701
2702         Implement more of the data fetching API
2703         https://bugs.webkit.org/show_bug.cgi?id=141975
2704
2705         Reviewed by Andreas Kling.
2706
2707         Add API for getting origins in a given session that has cached data.
2708
2709         * loader/cache/MemoryCache.cpp:
2710         (WebCore::MemoryCache::originsWithCache):
2711
2712 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
2713
2714         Use nullptr in more places in FrameView, RenderView, RenderObject
2715         https://bugs.webkit.org/show_bug.cgi?id=141974
2716
2717         Reviewed by Zalan Bujtas.
2718
2719         0 -> nullptr in FrameView.h/cpp, RenderView.h/cpp, RenderObject.h/cpp.
2720         
2721         Rename FrameView::m_deferSetNeedsLayouts to FrameView::m_deferSetNeedsLayoutCount
2722         to make it more clear that it's a count.
2723
2724         * page/FrameView.cpp:
2725         (WebCore::FrameView::FrameView):
2726         (WebCore::FrameView::reset):
2727         (WebCore::FrameView::setContentsSize):
2728         (WebCore::FrameView::calculateScrollbarModesForLayout):
2729         (WebCore::FrameView::layerForScrolling):
2730         (WebCore::FrameView::layerForHorizontalScrollbar):
2731         (WebCore::FrameView::layerForVerticalScrollbar):
2732         (WebCore::FrameView::layerForScrollCorner):
2733         (WebCore::FrameView::tiledBacking):
2734         (WebCore::FrameView::scrollLayerID):
2735         (WebCore::FrameView::layerForOverhangAreas):
2736         (WebCore::FrameView::setWantsLayerForTopOverHangArea):
2737         (WebCore::FrameView::setWantsLayerForBottomOverHangArea):
2738         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
2739         (WebCore::FrameView::layoutRoot):
2740         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
2741         (WebCore::FrameView::layout):
2742         (WebCore::FrameView::hostWindow):
2743         (WebCore::FrameView::scheduleRelayout):
2744         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2745         (WebCore::FrameView::needsLayout):
2746         (WebCore::FrameView::setNeedsLayout):
2747         (WebCore::FrameView::enclosingScrollableArea):
2748         (WebCore::FrameView::parentFrameView):
2749         (WebCore::FrameView::paintControlTints):
2750         (WebCore::FrameView::adjustPageHeightDeprecated):
2751         (WebCore::FrameView::axObjectCache):
2752         * page/FrameView.h:
2753         * rendering/RenderObject.cpp:
2754         (WebCore::RenderObject::RenderObject):
2755         (WebCore::RenderObject::nextInPreOrderAfterChildren):
2756         (WebCore::RenderObject::previousInPreOrder):
2757         (WebCore::RenderObject::firstLeafChild):
2758         (WebCore::RenderObject::lastLeafChild):
2759         (WebCore::RenderObject::traverseNext):
2760         (WebCore::RenderObject::firstLineBlock):
2761         (WebCore::RenderObject::containerForRepaint):
2762         (WebCore::RenderObject::showRenderSubTreeAndMark):
2763         (WebCore::RenderObject::localToAbsolute):
2764         (WebCore::RenderObject::container):
2765         * rendering/RenderObject.h:
2766         (WebCore::RenderObject::virtualContinuation):
2767         (WebCore::RenderObject::node):
2768         (WebCore::RenderObject::nonPseudoNode):
2769         (WebCore::RenderObject::localToAbsoluteQuad):
2770         (WebCore::RenderObject::absoluteQuads):
2771         (WebCore::RenderObject::absoluteClippedOverflowRect):
2772         (WebCore::RenderObject::outlineBoundsForRepaint):
2773         (WebCore::RenderObject::computeAbsoluteRepaintRect):
2774         (WebCore::RenderObject::selectionRect):
2775         (WebCore::RenderObject::imageChanged):
2776         (WebCore::RenderObject::addFocusRingRects):
2777         (WebCore::RenderObject::absoluteOutlineBounds):
2778         * rendering/RenderView.cpp:
2779         (WebCore::SelectionIterator::next):
2780         (WebCore::RenderView::RenderView):
2781         (WebCore::RenderView::mapLocalToContainer):
2782         (WebCore::RenderView::pushMappingToContainer):
2783         (WebCore::RenderView::computeRectForRepaint):
2784         (WebCore::rendererAfterPosition):
2785         (WebCore::RenderView::splitSelectionBetweenSubtrees):
2786         (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
2787         * rendering/RenderView.h:
2788
2789 2015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2790
2791         REGRESSION(r179429): Can't type comments in Facebook
2792         https://bugs.webkit.org/show_bug.cgi?id=141859
2793
2794         Reviewed by Brent Fulgham.
2795
2796         Enable SymbolEnabled runtime flag in inspector context.
2797
2798         * ForwardingHeaders/runtime/RuntimeFlags.h: Added.
2799         * WebCore.order:
2800         * WebCore.vcxproj/WebCore.vcxproj:
2801         * WebCore.vcxproj/WebCore.vcxproj.filters:
2802         * bindings/js/JSDOMWindowBase.cpp:
2803         (WebCore::JSDOMWindowBase::javaScriptRuntimeFlags):
2804         (WebCore::JSDOMWindowBase::javaScriptExperimentsEnabled): Deleted.
2805         * bindings/js/JSDOMWindowBase.h:
2806         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2807         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
2808         (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled): Deleted.
2809         * bindings/js/JSWorkerGlobalScopeBase.h:
2810         * inspector/InspectorFrontendClientLocal.cpp:
2811         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
2812         * page/Settings.h:
2813         * page/Settings.in:
2814
2815 2015-02-24  Manuel Rego Casasnovas  <rego@igalia.com>
2816
2817         [CSS Grid Layout] Support "sparse" in auto-placed items locked to a row/column
2818         https://bugs.webkit.org/show_bug.cgi?id=141748
2819
2820         Reviewed by Sergio Villar Senin.
2821
2822         The first step of grid item placement algorithm has been updated in
2823         order to support both "sparse" and "dense" modes. Current code is always
2824         doing a "dense" packing in this case.
2825
2826         See: http://dev.w3.org/csswg/css-grid/#auto-placement-algo
2827
2828         Test: fast/css-grid-layout/grid-item-auto-placement-fixed-row-column.html
2829
2830         * rendering/RenderGrid.cpp:
2831         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Add a cursor
2832         for each row/column and use it to place items in the right position.
2833
2834 2015-02-24  Joanmarie Diggs  <jdiggs@igalia.com>
2835
2836         [GTK] Layout Test accessibility/roles-exposed.html is failing
2837         https://bugs.webkit.org/show_bug.cgi?id=141960
2838
2839         Reviewed by Martin Robinson.
2840
2841         The test was failing because Gtk now uses GtkColorChooserDialog for the
2842         color input, making the input field a button which results in the color
2843         chooser dialog appearing. As a side effect of this change, the input now
2844         has an accessible role of ColorWell, which is currently mapped to
2845         ATK_ROLE_COLOR_CHOOSER (which is by definition the dialog which results
2846         upon activating the button input field). Changed the Gtk platform mapping
2847         to ATK_ROLE_BUTTON, leaving the Efl mapping as-is.
2848
2849         No new tests. Instead, updated and unskipped failing test.
2850
2851         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2852         (atkRole):
2853
2854 2015-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2855
2856         [GTK] Fonts loaded via @font-face look bad
2857         https://bugs.webkit.org/show_bug.cgi?id=140994
2858
2859         Reviewed by Martin Robinson.
2860
2861         We've had several complaints that woff fonts look bad on some websites. This seems to be a
2862         combination of multiple issues. For one, we don't look at Fontconfig settings at all when
2863         creating a web font. This commit changes FontPlatformData::initializeWithFontFace to instead
2864         use sane default settings from Fontconfig when loading a web font, rather than accepting the
2865         default settings from GTK+, which are normally overridden by Fontconfig when loading system
2866         fonts. However, we will hardcode the hinting setting for web fonts to always force use of
2867         the light autohinter, so that we do not use a font's native hints. This avoids compatibility
2868         issues when fonts with poor native hinting are only tested in browsers that do not use the
2869         native hints. It also allows us to sidestep future security vulnerabilities in FreeType's
2870         bytecode interpreter.
2871
2872         The net result of this is that there should be little noticable difference if you have GTK+
2873         set to use slight hinting (which forces use of the autohinter) unless you have customized
2874         Fontconfig configuration, but a dramatic improvement with particular fonts if you use medium
2875         or full hinting. This should reduce complaints about our font rendering on "fancy sites."
2876
2877         No new tests, since the affected fonts we've found are not freely redistributable.
2878
2879         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
2880         (WebCore::FontCustomPlatformData::FontCustomPlatformData): Force web fonts to be autohinted.
2881         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2882         (WebCore::getDefaultCairoFontOptions): Renamed to disambiguate.
2883         (WebCore::getDefaultFontconfigOptions): Added.
2884         (WebCore::FontPlatformData::initializeWithFontFace): Always call
2885         FontPlatformData::setCairoOptionsFromFontConfigPattern. If the FontPlatformData was not
2886         created with an FcPattern (e.g. because this is a web font), call
2887         getDefaultFontconfigOptions to get a sane default FcPattern.
2888         (WebCore::FontPlatformData::setOrientation): Renamed call to getDefaultCairoFontOptions.
2889         (WebCore::getDefaultFontOptions): Deleted.
2890
2891 2015-02-24  Andreas Kling  <akling@apple.com>
2892
2893         [Cocoa] Break internal reference cycle in WebCore::Font.
2894         <https://webkit.org/b/141941>
2895         <rdar://problem/19650570>
2896
2897         Reviewed by Antti Koivisto.
2898
2899         The Cocoa implementation of Font::platformCreateScaledFont() tried to be smart and use the FontCache.
2900         This didn't work out well when scaling a 0pt Font, since scaling 0pt by any factor will return 0pt.
2901
2902         We'd have a 0pt font, scale it by 0.7 to get a small-caps variant, and then cache that small-caps
2903         variant (really "this") in Font::m_derivedData->smallCaps.
2904
2905         Fix this by having Cocoa Font scaling do exactly what other platforms do: create a new Font every time.
2906         This stops us from accumulating tons of abandoned Font objects over time.
2907
2908         * platform/graphics/Font.cpp:
2909         (WebCore::Font::verticalRightOrientationFont):
2910         (WebCore::Font::uprightOrientationFont):
2911         (WebCore::Font::smallCapsFont):
2912         (WebCore::Font::emphasisMarkFont):
2913         (WebCore::Font::brokenIdeographFont):
2914         (WebCore::Font::nonSyntheticItalicFont): Add assertions to guard against reference cycles inside a Font.
2915
2916         * platform/graphics/cocoa/FontCocoa.mm:
2917         (WebCore::Font::platformCreateScaledFont): Always create a new Font when scaling an existing Font to a different size.
2918
2919 2015-02-24  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2920
2921         [Streams API] Reading ReadableStream ready and closed attributes should not always create a new promise
2922         https://bugs.webkit.org/show_bug.cgi?id=141650
2923
2924         Reviewed by Benjamin Poulain.
2925
2926         The JSPromiseDeferred objects returned by JSReadableStream::ready and JSReadableStream::closed should be stored somewhere.
2927         This patch stores them as private slots in JSReadableStream.
2928         This is close to the description in https://streams.spec.whatwg.org/#rs-internal-slots.
2929
2930         An alternative would be to have these objects as JSReadableStream class members, thus modifying the binding generator.
2931         That may be the cleanest solution, especially if other APIs express the same need.
2932         Another alternative is to store DeferredWrapper in ReadableStream objects.
2933         But it is currently preferred to keep DeferredWrapper in bindings/js code.
2934
2935         Added new constructor for DeferredWrapper to use these stored values.
2936         Updated ready and closed methods to use that new constructor.
2937         Changes are covered by new test in streams/readablestream-constructor.html.
2938
2939         * bindings/js/JSDOMPromise.cpp:
2940         (WebCore::DeferredWrapper::DeferredWrapper):
2941         * bindings/js/JSDOMPromise.h:
2942         * bindings/js/JSReadableStreamCustom.cpp:
2943         (WebCore::closedPromiseSlotName):
2944         (WebCore::getOrCreatePromiseDeferredFromObject):
2945         (WebCore::readyPromiseSlotName):
2946         (WebCore::JSReadableStream::ready):
2947         (WebCore::JSReadableStream::closed):
2948         * bindings/js/ReadableStreamJSSource.cpp:
2949         (WebCore::setInternalSlotToObject):
2950         (WebCore::getInternalSlotFromObject):
2951         * bindings/js/ReadableStreamJSSource.h:
2952
2953 2015-02-24  Dhi Aurrahman  <diorahman@rockybars.com>
2954
2955         Always serialize :lang()'s arguments to strings
2956         https://bugs.webkit.org/show_bug.cgi?id=141944
2957
2958         Reviewed by Benjamin Poulain.
2959
2960         As specified in [1] :lang()'s arguments are always serialized to strings.
2961
2962         [1] http://dev.w3.org/csswg/cssom/#serializing-selectors
2963
2964         Related tests are updated.
2965
2966         * css/CSSGrammar.y.in:
2967         * css/CSSParserValues.cpp:
2968         (WebCore::CSSParserSelector::setLangArgumentList):
2969         * css/CSSParserValues.h:
2970         (WebCore::CSSParserString::init):
2971         (WebCore::CSSParserString::clear):
2972         (WebCore::CSSParserString::tokenType): Deleted.
2973         (WebCore::CSSParserString::setTokenType): Deleted.
2974         * css/CSSSelector.cpp:
2975         (WebCore::appendLangArgumentList):
2976         (WebCore::CSSSelector::setLangArgumentList):
2977         * css/CSSSelector.h:
2978         (WebCore::CSSSelector::langArgumentList):
2979         * css/SelectorCheckerTestFunctions.h:
2980         (WebCore::matchesLangPseudoClass):
2981         * cssjit/SelectorCompiler.cpp:
2982         (WebCore::SelectorCompiler::addPseudoClassType):
2983         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
2984
2985 2015-02-24  Antti Koivisto  <antti@apple.com>
2986
2987        Give TemporaryChange for m_inLoadPendingImages assertion a name so it actually does something.
2988
2989         * css/StyleResolver.cpp:
2990         (WebCore::StyleResolver::loadPendingImages):
2991
2992 2015-02-23  Commit Queue  <commit-queue@webkit.org>
2993
2994         Unreviewed, rolling out r180547 and r180550.
2995         https://bugs.webkit.org/show_bug.cgi?id=141957
2996
2997         Broke 10 Windows tests. (Requested by bfulgham_ on #webkit).
2998
2999         Reverted changesets:
3000
3001         "REGRESSION(r179429): Can't type comments in Facebook"
3002         https://bugs.webkit.org/show_bug.cgi?id=141859
3003         http://trac.webkit.org/changeset/180547
3004
3005         "Constructor returning null should construct an object instead
3006         of null"
3007         https://bugs.webkit.org/show_bug.cgi?id=141640
3008         http://trac.webkit.org/changeset/180550
3009
3010 2015-02-23  Ryosuke Niwa  <rniwa@webkit.org>
3011
3012         Disable font loading events until our implementation gets updated to match the latest spec
3013         https://bugs.webkit.org/show_bug.cgi?id=141938
3014
3015         Reviewed by Andreas Kling.
3016
3017         Revert r173531 for now since our implementation is outdated.
3018
3019         * Configurations/FeatureDefines.xcconfig:
3020
3021 2015-02-23  Brent Fulgham  <bfulgham@apple.com>
3022
3023         EventHandler references deleted Scrollbar
3024         https://bugs.webkit.org/show_bug.cgi?id=141931
3025         <rdar://problem/19915210>
3026
3027         Reviewed by Tim Horton.
3028
3029         Tested by scrollbars/overflow-custom-scrollbar-crash.html
3030
3031         Update the EventHandler class to use a WeakPtr to reference the
3032         last used Scrollbar, rather than retaining the Scrollbar and
3033         artificially extending its life. This keeps the EventHandler
3034         state in proper sync with the state of the render tree, and
3035         avoids cases where we have destroyed a ScrollableArea (and
3036         Scrollbar) but are still sending messages to a fake zombie
3037         version of the element.
3038
3039         * page/EventHandler.cpp:
3040         (WebCore::EventHandler::clear):
3041         (WebCore::EventHandler::handleMousePressEvent):
3042         (WebCore::EventHandler::updateMouseEventTargetNode):
3043         (WebCore::EventHandler::updateLastScrollbarUnderMouse):
3044         * page/EventHandler.h:
3045         * platform/Scrollbar.cpp:
3046         (WebCore::Scrollbar::Scrollbar): Initialize WeakPtrFactory.
3047         * platform/Scrollbar.h:
3048         (WebCore::Scrollbar::createWeakPtr): Added,
3049
3050 2015-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3051
3052         REGRESSION(r179429): Can't type comments in Facebook
3053         https://bugs.webkit.org/show_bug.cgi?id=141859
3054
3055         Reviewed by Geoffrey Garen.
3056
3057         Enable SymbolEnabled runtime flag in inspector context.
3058
3059         * ForwardingHeaders/runtime/RuntimeFlags.h: Added.
3060         * WebCore.order:
3061         * WebCore.vcxproj/WebCore.vcxproj:
3062         * WebCore.vcxproj/WebCore.vcxproj.filters:
3063         * bindings/js/JSDOMWindowBase.cpp:
3064         (WebCore::JSDOMWindowBase::javaScriptRuntimeFlags):
3065         (WebCore::JSDOMWindowBase::javaScriptExperimentsEnabled): Deleted.
3066         * bindings/js/JSDOMWindowBase.h:
3067         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3068         (WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
3069         (WebCore::JSWorkerGlobalScopeBase::javaScriptExperimentsEnabled): Deleted.
3070         * bindings/js/JSWorkerGlobalScopeBase.h:
3071         * inspector/InspectorFrontendClientLocal.cpp:
3072         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3073         * page/Settings.h:
3074         * page/Settings.in:
3075
3076 2015-02-23  Benjamin Poulain  <benjamin@webkit.org>
3077
3078         CSS JIT: add support for case-insensitive attribute matching
3079         https://bugs.webkit.org/show_bug.cgi?id=141880
3080
3081         Reviewed by Andreas Kling.
3082
3083         The value matching now has 3 cases:
3084         1) Case-sensitive.
3085         2) Case-insensitive.
3086         3) Legacy HTML Case-insensitive.
3087
3088         The information to determine the case is split over 2 source:
3089         -To know if explicit case-insensitive is needed, we need to ask the selector
3090          for attributeValueMatchingIsCaseInsensitive().
3091         -To know if the legacy HTML behavior is needed, we need to test the attribute
3092          name filter with HTMLDocument::isCaseSensitiveAttribute().
3093
3094         I decided to perform all those checks at the fragment creation step.
3095         This makes the register requirements and code generation more explicit.
3096
3097         From there, everything is easy: switch() on the type of matching needed,
3098         and generate the code. The new case-insensitive case is a simplified version
3099         of the legacy HTML behavior without runtime check for the element type.
3100
3101         Tests: fast/css/implicitly-case-insensitive-attribute-with-svg.html
3102                fast/selectors/case-insensitive-attribute-register-requirement-1.html
3103                fast/selectors/case-insensitive-attribute-register-requirement-2.html
3104                fast/selectors/querySelector-explicit-case-insensitive-attribute-match-with-svg.html
3105
3106         * cssjit/SelectorCompiler.cpp:
3107         (WebCore::SelectorCompiler::attributeSelectorCaseSensitivity):
3108         (WebCore::SelectorCompiler::AttributeMatchingInfo::AttributeMatchingInfo):
3109         (WebCore::SelectorCompiler::AttributeMatchingInfo::attributeCaseSensitivity):
3110         (WebCore::SelectorCompiler::AttributeMatchingInfo::canDefaultToCaseSensitiveValueMatch): Deleted.
3111         (WebCore::SelectorCompiler::constructFragmentsInternal):
3112         Compute the type of value matching and store it on the AttributeMatchingInfo
3113         when creating the fragment.
3114
3115         (WebCore::SelectorCompiler::minimumRegisterRequirements):
3116         (WebCore::SelectorCompiler::attributeValueTestingRequiresExtraRegister):
3117         (WebCore::SelectorCompiler::attributeValueTestingRequiresCaseFoldingRegister): Deleted.
3118         In general, AttributeCaseSensitivity::CaseInsensitive does not require an extra
3119         register. I have made an exception for generateElementAttributeValueExactMatching()
3120         for simplicity. I use that register to load the StringImpl of the attribute
3121         being tested, that way I can use WTF::equalIgnoringCaseNonNull() directly.
3122
3123         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueMatching):
3124         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
3125         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
3126         Matching itself is just function calls. Unlike AttributeCaseSensitivity::HTMLLegacyCaseInsensitive,
3127         the behavior is consistent between XML and HTML.
3128
3129 2015-02-23  Alex Christensen  <achristensen@webkit.org>
3130
3131         [WinCairo] Unreviewed build fix after r180532
3132
3133         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3134         (WebCore::MediaPlayerPrivateMediaFoundation::buffered):
3135         Fixed typo.
3136
3137 2015-02-23  Chris Dumez  <cdumez@apple.com>
3138
3139         Log using diagnostic logging which ActiveDOMObjects prevent using the PageCache
3140         https://bugs.webkit.org/show_bug.cgi?id=141922
3141         <rdar://problem/19923085>
3142
3143         Reviewed by Andreas Kling.
3144
3145         Log using diagnostic logging which ActiveDOMObjects prevent using the
3146         PageCache.
3147
3148         * history/PageCache.cpp:
3149         (WebCore::logCanCacheFrameDecision):
3150         * page/DiagnosticLoggingKeys.cpp:
3151         (WebCore::DiagnosticLoggingKeys::unsuspendableDOMObjectKey):
3152         * page/DiagnosticLoggingKeys.h:
3153
3154 2015-02-23  Chris Dumez  <cdumez@apple.com>
3155
3156         Move GeoNotifier class to its own file
3157         https://bugs.webkit.org/show_bug.cgi?id=141918
3158
3159         Reviewed by Andreas Kling.
3160
3161         Move GeoNotifier class to its own file to make Geolocation class less
3162         crowded.
3163
3164 2015-02-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3165
3166         Remove unnecessary PlatformTimeRanges::create()
3167         https://bugs.webkit.org/show_bug.cgi?id=141901
3168
3169         Reviewed by Filip Pizlo.
3170
3171         PlatformTimeRanges::create() functions have just created an instance of PlatformTimeRanges.
3172         This functionality can be replaced with std::make_unique<> use directly.
3173
3174         No new tests, no behavior changes.
3175
3176         * Modules/mediasource/MediaSource.cpp:
3177         (WebCore::MediaSource::buffered):
3178         * Modules/mediasource/SourceBuffer.cpp:
3179         (WebCore::SourceBuffer::bufferedAccountingForEndOfStream):
3180         * platform/graphics/MediaPlayer.cpp:
3181         (WebCore::NullMediaPlayerPrivate::buffered):
3182         * platform/graphics/MediaPlayerPrivate.h:
3183         (WebCore::MediaPlayerPrivateInterface::seekable):
3184         * platform/graphics/PlatformTimeRanges.cpp:
3185         (WebCore::PlatformTimeRanges::create): Deleted.
3186         * platform/graphics/PlatformTimeRanges.h:
3187         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3188         (WebCore::MediaPlayerPrivateAVFoundation::buffered):
3189         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3190         (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges):
3191         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3192         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
3193         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3194         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekable):
3195         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::buffered):
3196         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3197         (WebCore::MediaPlayerPrivateGStreamer::buffered):
3198         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3199         (WebCore::MediaPlayerPrivateQTKit::buffered):
3200         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3201         (WebCore::MediaPlayerPrivateMediaFoundation::buffered):
3202         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3203         (WebCore::MockMediaPlayerMediaSource::buffered):
3204
3205 2015-02-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3206
3207         Partial clean up OwnPtr and PassOwnPtr in WebCore/platform
3208         https://bugs.webkit.org/show_bug.cgi?id=141888
3209
3210         Reviewed by Filip Pizlo.
3211
3212         Use std::unique_ptr<> and std::make_unique<>. Besides this patch removes
3213         unnecessary OwnPtr.h|PasSOwnPtr.h includes.
3214
3215         No new tests, no behavior changes.
3216
3217         * platform/SharedBuffer.h:
3218         * platform/Supplementable.h:
3219         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
3220         (WebCore::AudioSourceProviderGStreamer::create): Deleted.
3221         * platform/graphics/ImageBuffer.h:
3222         * platform/graphics/TiledBackingStoreBackend.h:
3223         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3224         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
3225         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3226         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3227         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3228         * platform/gtk/GamepadsGtk.cpp:
3229
3230 2015-02-23  Shivakumar JM  <shiva.jm@samsung.com>
3231
3232         Default value of HTMLSelectElement size IDL attribute should be 0.
3233         https://bugs.webkit.org/show_bug.cgi?id=141795
3234
3235         Reviewed by Andreas Kling.
3236
3237         Default value of HTMLSelectElement size IDL attribute should be 0. 
3238         As in spec: http://www.w3.org/html/wg/drafts/html/master/forms.html#the-select-element, also this matches the behavior of Chrome, IE and
3239         Gecko.
3240
3241         Test: fast/dom/select-size.html
3242
3243         * html/HTMLSelectElement.cpp:
3244         (WebCore::HTMLSelectElement::parseAttribute):
3245
3246 2015-02-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
3247
3248         Drawing an SVG image into a canvas using drawImage() ignores globalAlpha.
3249         https://bugs.webkit.org/show_bug.cgi?id=141729.
3250
3251         Reviewed by Daniel Bates.
3252
3253         Fix a build break which is caused by http://trac.webkit.org/changeset/180511/trunk.
3254         Two functions of GraphicsContext were made inline but they were kept WEBCORE_EXPORT.
3255
3256         * platform/graphics/GraphicsContext.h:
3257         (WebCore::GraphicsContext::paintingDisabled):
3258         (WebCore::GraphicsContext::updatingControlTints):
3259
3260 2015-02-22  Dean Jackson  <dino@apple.com>
3261
3262         [iOS] Max canvas size is lower than expected
3263         https://bugs.webkit.org/show_bug.cgi?id=141886
3264         <rdar://problem/19729246>
3265
3266         Reviewed by Tim Horton.
3267
3268         Use the same maximum canvas area for all ports,
3269         which bumps the iOS limit up from 4580 * 1145
3270         to 16k * 16k.
3271
3272         * html/HTMLCanvasElement.cpp: Update MaxCanvasArea.
3273
3274 2015-02-23  Chris Dumez  <cdumez@apple.com>
3275
3276         Add support for diagnostic logging messages sampling
3277         https://bugs.webkit.org/show_bug.cgi?id=141823
3278         <rdar://problem/19899030>
3279
3280         Reviewed by Andreas Kling.
3281
3282         Add support for diagnostic logging messages sampling to decrease the
3283         impact of diagnostic logging on CPU usage, while still getting useful
3284         overall results. This patch adds a ShouldSample argument to
3285         logDiagnosticMessage*() functions and logs 5% of the messages when
3286         sampling. Sampling is turned on for keys that are known to be verbose
3287         (e.g. per resource load logging).
3288
3289         On the page load test I am tracking, CPU usage caused by diagnostic
3290         logging went down to 0.3% of UIProcess from 2.8% with this change.
3291
3292         * history/PageCache.cpp:
3293         (WebCore::logPageCacheFailureDiagnosticMessage):
3294         (WebCore::logCanCachePageDecision):
3295         * html/HTMLMediaElement.cpp:
3296         (WebCore::HTMLMediaElement::parseAttribute):
3297         * loader/EmptyClients.h:
3298         * loader/FrameLoader.cpp:
3299         (WebCore::logNavigation):
3300         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
3301         * loader/ResourceLoader.cpp:
3302         (WebCore::logResourceResponseSource):
3303         * loader/SubframeLoader.cpp:
3304         (WebCore::logPluginRequest):
3305         * loader/SubresourceLoader.cpp:
3306         (WebCore::SubresourceLoader::willSendRequest):
3307         (WebCore::SubresourceLoader::didReceiveResponse):
3308         (WebCore::logResourceLoaded):
3309         * loader/cache/CachedResource.cpp:
3310         (WebCore::logResourceRevalidationReason):
3311         * loader/cache/CachedResourceLoader.cpp:
3312         (WebCore::logMemoryCacheResourceRequest):
3313         * page/DiagnosticLoggingClient.h:
3314
3315 2015-02-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
3316
3317         Drawing an SVG image into a canvas using drawImage() ignores globalAlpha.
3318         https://bugs.webkit.org/show_bug.cgi?id=141729.
3319
3320         Reviewed by Simon Fraser.
3321
3322         When drawing an SVG image and the drawing context is set to be transparent,
3323         make sure this transparency is applied to the compositing layer.
3324
3325         Test: svg/canvas/canvas-global-alpha-svg.html
3326
3327         * platform/graphics/GraphicsContext.cpp:
3328         (WebCore::GraphicsContext::setAlpha): Make setAlpha() calls the platform
3329         function and sets 'm_state.alpha' to the input value.
3330
3331         (WebCore::GraphicsContext::alpha): Add a new function 'alpha()' which
3332         returns the value of the global alpha.
3333         
3334         * platform/graphics/GraphicsContext.h:
3335         (WebCore::GraphicsContextState::GraphicsContextState): Add a new member
3336         'alpha' to the context state since the getter function CGContextGetAlpha
3337         is defined only in a private header file. Also move single line functions
3338         from the source file to the header file.
3339     
3340         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3341         (WebCore::GraphicsContext::setPlatformAlpha):
3342         (WebCore::GraphicsContext::setAlpha): Deleted.
3343         * platform/graphics/cg/GraphicsContextCG.cpp:
3344         (WebCore::GraphicsContext::setPlatformAlpha):
3345         (WebCore::GraphicsContext::setAlpha): Deleted.
3346         Rename setAlpha() to setPlatformAlpha() in the platform files. Add setAlpha()
3347         to the core file. setAlpha() will set the value of 'm_state.alpha' and call
3348         setPlatformAlpha().
3349     
3350         * svg/graphics/SVGImage.cpp:
3351         (WebCore::SVGImage::draw): If the drawing context is transparent, apply its
3352         global alpha value to the compositing layer.
3353         
3354 2015-02-23  Eric Carlson  <eric.carlson@apple.com>
3355
3356         Occasional crash in MediaPlayer::setPrivateBrowsingMode
3357         https://bugs.webkit.org/show_bug.cgi?id=141910
3358
3359         Reviewed by Jer Noble.
3360
3361         No new tests, I was unable to reproduce the crash.
3362
3363         * html/HTMLMediaElement.cpp:
3364         (WebCore::HTMLMediaElement::stopPeriodicTimers): Use EveryDelayedAction instead of -1.
3365         (WebCore::HTMLMediaElement::stop): Call clearMediaPlayer instead of just setting m_player
3366             to NULL.
3367         * html/HTMLMediaElement.h: Define EveryDelayedAction.
3368
3369 2015-02-23  Philippe Normand  <pnormand@igalia.com>
3370
3371         [GStreamer] Redundant track language notifications
3372         https://bugs.webkit.org/show_bug.cgi?id=141908
3373
3374         Reviewed by Žan Doberšek.
3375
3376         Invoke languageChanged only if the language code actually
3377         changed.
3378
3379         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
3380         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfTagsChanged):
3381
3382 2015-02-23  peavo@outlook.com  <peavo@outlook.com>
3383
3384         [WinCairo] Crash when media player is destroyed.
3385         https://bugs.webkit.org/show_bug.cgi?id=141248
3386
3387         Reviewed by Darin Adler.
3388
3389         A COM smart pointer is both released, and set to null.
3390         This means that the COM Release method is called twice, causing a crash.
3391
3392         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3393         (WebCore::MediaPlayerPrivateMediaFoundation::endSession):
3394
3395 2015-02-23  Manuel Rego Casasnovas  <rego@igalia.com>
3396
3397         [CSS Grid Layout] Remove old FIXME in RenderGrid::placeItemsOnGrid()
3398         https://bugs.webkit.org/show_bug.cgi?id=141899
3399
3400         Reviewed by Sergio Villar Senin.
3401
3402         There was a FIXME about not re-resolving positions if the grid is grown during
3403         auto-placement. But as the spec has changed [1] and you can only refer to the
3404         explicit grid (even if you use for example grid-column: 1 / -1). It seems that
3405         we can get rid of this FIXME as it's not a causing a problem anymore.
3406
3407         [1] http://dev.w3.org/csswg/css-grid/#grid-placement-int
3408
3409         No new tests (no change in behavior).
3410
3411         * rendering/RenderGrid.cpp:
3412         (WebCore::RenderGrid::placeItemsOnGrid): Remove FIXME.
3413
3414 2015-02-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3415
3416         Move std::unique_ptr<>|make_unique<> to WebCore/page/scrolling
3417         https://bugs.webkit.org/show_bug.cgi?id=137877
3418
3419         Reviewed by Sam Weinig.
3420
3421         Clean up unnecessary OwnPtr.h|PassOwnPtr.h includes as well as
3422         change OwnPtr with std::unique_ptr<>|make_unique<>.
3423
3424         No new tests, no behavior changes.
3425
3426         * page/scrolling/AsyncScrollingCoordinator.h:
3427         * page/scrolling/ScrollingStateFixedNode.cpp:
3428         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3429         * page/scrolling/ScrollingStateNode.cpp:
3430         (WebCore::ScrollingStateNode::appendChild):
3431         * page/scrolling/ScrollingStateNode.h:
3432         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
3433         * page/scrolling/ScrollingStateScrollingNode.cpp:
3434         * page/scrolling/ScrollingStateStickyNode.cpp:
3435         * page/scrolling/ScrollingTree.h:
3436         * page/scrolling/ScrollingTreeNode.cpp:
3437         (WebCore::ScrollingTreeNode::appendChild):
3438         * page/scrolling/ScrollingTreeNode.h:
3439         * page/scrolling/ScrollingTreeScrollingNode.h:
3440
3441 2015-02-22  Dean Jackson  <dino@apple.com>
3442
3443         Print a console warning when HTMLCanvasElement exceeds the maximum size
3444         https://bugs.webkit.org/show_bug.cgi?id=141861
3445         <rdar://problem/19729145>
3446
3447         Reviewed by Simon Fraser.
3448
3449         Add a warning if we ever try to create a canvas that is
3450         too big.
3451
3452         No test because:
3453         1. We can't ref-test against console messages.
3454         2. The output is platform specific.
3455
3456         * html/HTMLCanvasElement.cpp:
3457         (WebCore::HTMLCanvasElement::createImageBuffer):
3458
3459 2015-02-21  Sam Weinig  <sam@webkit.org>
3460
3461         Convert the caps lock indicator to be implemented using the shadow DOM
3462         https://bugs.webkit.org/show_bug.cgi?id=141868
3463
3464         Reviewed by Dan Bernstein.
3465
3466         - Re-adds 'caps-lock-indicator' as a valid -webkit-appearance value. It was removed
3467           in r74099 to work around a site bug, that should not be a problem anymore.
3468         - Converts the caps lock indicator to be implemented as part of the shadow DOM rather
3469           than a paint time effect. This gives the proper overflow behavior (it now clips) and
3470           behaves correctly in RTL.
3471
3472         * css/CSSParser.cpp:
3473         (WebCore::isValidKeywordPropertyAndValue):
3474         Make 'caps-lock-indicator' a valid -webkit-appearance value.
3475
3476         * css/CSSValueKeywords.in:
3477         Remove comment that indicated that caps-lock-indicator was not a valid
3478         -webkit-appearance value.
3479
3480         * css/html.css:
3481         (input::-webkit-caps-lock-indicator):
3482         Add new default style for the new -webkit-caps-lock-indicator pseudo-element. The
3483         trick employed here is to use a content: image to both implement the painting of
3484         the caps lock indicator, and to get the sizing right (shrink-to-fit, height: 100%).
3485
3486         * html/HTMLInputElement.cpp:
3487         (WebCore::HTMLInputElement::capsLockIndicatorElement):
3488         (WebCore::HTMLInputElement::capsLockStateMayHaveChanged):
3489         * html/HTMLInputElement.h:
3490         * html/InputType.cpp:
3491         (WebCore::InputType::capsLockStateMayHaveChanged):
3492         * html/InputType.h:
3493         (WebCore::InputType::capsLockIndicatorElement):
3494         Pipe notification of changes in the caps locks state to the <input> element
3495         rather than the RenderTextControlSingleLine. Also add an accessor for the caps
3496         lock indicator element in the shadow DOM.
3497
3498         * html/TextFieldInputType.cpp:
3499         (WebCore::TextFieldInputType::forwardEvent):
3500         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
3501         (WebCore::TextFieldInputType::createShadowSubtree):
3502         (WebCore::TextFieldInputType::capsLockIndicatorElement):
3503         (WebCore::TextFieldInputType::destroyShadowSubtree):
3504         (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator):
3505         (WebCore::TextFieldInputType::capsLockStateMayHaveChanged):
3506         * html/TextFieldInputType.h:
3507         Add a new element to the text field shadow DOM to act as the caps lock indicator.
3508         Give it a pseudo-element ID of -webkit-caps-lock-indicator so it can be referenced
3509         from CSS. The element is always in the DOM for a password field. It toggles between
3510         display: none and display: block depending on the state of the caps lock key.
3511
3512         * page/EventHandler.cpp:
3513         (WebCore::EventHandler::capsLockStateMayHaveChanged):
3514         Pipe notification of changes in the caps locks state to the <input> element
3515         rather than the RenderTextControlSingleLine.
3516
3517         * rendering/RenderTextControlSingleLine.cpp:
3518         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
3519         (WebCore::RenderTextControlSingleLine::paint): Deleted.
3520         (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged): Deleted.
3521         * rendering/RenderTextControlSingleLine.h:
3522         Remove logic for drawing the caps lock indicator.
3523
3524         * rendering/RenderTheme.cpp:
3525         (WebCore::RenderTheme::adjustStyle):
3526         (WebCore::RenderTheme::paint):
3527         (WebCore::RenderTheme::paintMeter):
3528         (WebCore::RenderTheme::adjustCapsLockIndicatorStyle):
3529         (WebCore::RenderTheme::paintCapsLockIndicator):
3530         (WebCore::RenderTheme::shouldHaveCapsLockIndicator):
3531         * rendering/RenderTheme.h:
3532         (WebCore::RenderTheme::paintCapsLockIndicator): Deleted.
3533         * rendering/RenderThemeIOS.h:
3534         * rendering/RenderThemeIOS.mm:
3535         (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator):
3536         * rendering/RenderThemeMac.h:
3537         * rendering/RenderThemeMac.mm:
3538         (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator):
3539         (WebCore::RenderThemeMac::paintCapsLockIndicator): Deleted.
3540         Now that the caps lock indicator is implemented like other aspects of form controls,
3541         the theme code can be converted to be similar as well.
3542
3543 2015-02-21  David Kilzer  <ddkilzer@apple.com>
3544
3545         [iOS] Fix build failure after including CoreMediaSoftLink.h in WebVideoFullscreenInterfaceAVKit.mm
3546         <http://webkit.org/b/141816>
3547
3548         Attempt to fix the following build failure:
3549
3550             WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:68:1: error: call to 'CoreMediaLibrary' is ambiguous
3551             SOFT_LINK(CoreMedia, CMTimeRangeContainsTime, Boolean, (CMTimeRange range, CMTime time), (range, time))
3552             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3553             In file included from WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:34:
3554             In file included from WebCore/platform/cf/CoreMediaSoftLink.h:32:
3555             WebCore/platform/mac/SoftLinking.h:107:79: note: expanded from macro 'SOFT_LINK'
3556             <scratch space>:58:1: note: expanded from here
3557             CoreMediaLibrary
3558             ^~~~~~~~~~~~~~~~
3559             In file included from WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:34:
3560             WebCore/platform/cf/CoreMediaSoftLink.h:35:1: note: candidate function
3561             SOFT_LINK_FRAMEWORK_HEADER(WebCore, CoreMedia)
3562             ^
3563             In file included from WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:34:
3564             In file included from WebCore/platform/cf/CoreMediaSoftLink.h:32:
3565             WebCore/platform/mac/SoftLinking.h:298:18: note: expanded from macro 'SOFT_LINK_FRAMEWORK_HEADER'
3566             <scratch space>:42:1: note: expanded from here
3567             CoreMediaLibrary
3568             ^
3569             WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:67:1: note: candidate function
3570             SOFT_LINK_FRAMEWORK(CoreMedia)
3571             ^
3572             In file included from WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm:34:
3573             In file included from WebCore/platform/cf/CoreMediaSoftLink.h:32:
3574             WebCore/platform/mac/SoftLinking.h:46:18: note: expanded from macro 'SOFT_LINK_FRAMEWORK'
3575             <scratch space>:51:1: note: expanded from here
3576             CoreMediaLibrary
3577             ^
3578
3579         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Remove the
3580         SOFT_LINK_FRAMEWORK(CoreMedia) macro since the remaining
3581         SOFT_LINK() and SOFT_LINK_CONSTANT() macros can use the
3582         CoreMediaLibrary() method exposed by CoreMediaSoftLink.h.
3583
3584 2015-02-21  David Kilzer  <ddkilzer@apple.com>
3585
3586         Add SOFT_LINK_CONSTANT_SOURCE() cross-platform macro and start using it
3587         <http://webkit.org/b/141816>
3588
3589         Reviewed by Alexey Proskuryakov.
3590
3591         * WebCore.vcxproj/WebCore.vcxproj:
3592         * WebCore.vcxproj/WebCore.vcxproj.filters:
3593         - Remove CoreMediaSoftLinking.h.
3594
3595         * platform/cf/CoreMediaSoftLink.cpp:
3596         - Add kCMTimeZero constant.
3597         * platform/cf/CoreMediaSoftLink.h:
3598         - Add SOFT_LINK_FRAMEWORK_HEADER() macro for CoreMedia.
3599         - Add kCMTimeZero constant.
3600
3601         * platform/graphics/avfoundation/cf/CoreMediaSoftLinking.h: Remove.
3602
3603         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3604         - Remove reference to CoreMediaSoftLinking.h and update comment.
3605         (WebCore::MediaPlayerPrivateAVFoundationCF::isAvailable):
3606         - Switch to using new method to check if a framework is
3607           available.
3608
3609         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3610         - Remove all local soft-linking macros for CoreMedia.
3611           CoreMediaSoftLink.h handles everything now.
3612         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
3613         - Switch to using new method to check if a framework is
3614           available.
3615
3616         * platform/mac/SoftLinking.h:
3617         (SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
3618         is_Name_FrameworkAvailable() macro.
3619         (SOFT_LINK_FRAMEWORK_SOURCE): Update to make it work with
3620         optional framework checks without a separate macro.
3621         (SOFT_LINK_CONSTANT_HEADER): Add.
3622         (SOFT_LINK_CONSTANT_SOURCE): Add.
3623         - Support soft-links to constants.
3624
3625         * platform/win/SoftLinking.h:
3626         (SOFT_LINK_FRAMEWORK_HELPER): Add.  Copied from
3627         SOFT_LINK_LIBRARY_HELPER, with addition of namespace and
3628         non-static function.
3629         (SOFT_LINK_FRAMEWORK): Add.  Copied from SOFT_LINK_LIBRARY.
3630         (SOFT_LINK_DEBUG_FRAMEWORK): Add.  Copied from
3631         SOFT_LINK_DEBUG_LIBRARY.
3632         (SOFT_LINK_FRAMEWORK_HEADER): Add.  Defines
3633         is_Name_FrameworkAvailable() macro.
3634         (SOFT_LINK_FRAMEWORK_SOURCE): Redefine in terms of
3635         SOFT_LINK_FRAMEWORK/SOFT_LINK_DEBUG_FRAMEWORK.
3636         (SOFT_LINK_CONSTANT_HEADER): Add.
3637         (SOFT_LINK_CONSTANT_SOURCE): Add.
3638         - Support soft-links to constants.
3639
3640 2015-02-20  David Kilzer  <ddkilzer@apple.com>
3641
3642         Make namespace configurable for SOFT_LINK_*_{HEADER,SOURCE}() macros
3643         <http://webkit.org/b/141849>
3644
3645         Reviewed by Brent Fulgham.
3646
3647         This patch does the following:
3648         - Add namespace argument to the SOFT_LINK_*_{HEADER,SOURCE}()
3649           macros for reuse in other projects.
3650         - Adds SOFT_LINK_FRAMEWORK_SOURCE() macro in preparation for Bug
3651           141816.
3652         - Adds back framework argument to SOFT_LINK_FUNCTION_HEADER()
3653           and includes framework name in generated function names.  This
3654           adds more entropy to the names in case there are two functions
3655           with the same name in different frameworks.
3656
3657         * platform/cf/CoreMediaSoftLink.cpp:
3658         - Add FIXME about USE(COREMEDIA).
3659         - Switch from SOFT_LINK_FRAMEWORK() to
3660           SOFT_LINK_FRAMEWORK_SOURCE().
3661         * platform/cf/CoreMediaSoftLink.h:
3662         - Add FIXME about USE(COREMEDIA).
3663         - Add back framework argument to SOFT_LINK_FUNCTION_HEADER()
3664           macros.
3665
3666         * platform/mac/SoftLinking.h:
3667         - Add missing header guards.
3668         - Add pragmas for different macro groups.
3669         (SOFT_LINK_FRAMEWORK_SOURCE): Add.
3670         (SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
3671         (SOFT_LINK_FUNCTION_SOURCE): Move.
3672         - Add framework name to generated function names.
3673         - Incorporates namespace so that it doesn't have to be listed in
3674           the *SoftLink.{cpp,h} file.
3675
3676         * platform/win/SoftLinking.h:
3677         - Add pragmas for different macro groups.
3678         (SOFT_LINK_FRAMEWORK_SOURCE): Add.
3679         (SOFT_LINK_FUNCTION_HEADER): Move. Add back framework argument.
3680         (SOFT_LINK_FUNCTION_SOURCE): Move.
3681         - Add framework name to generated function names.
3682         - Incorporates namespace so that it doesn't have to be listed in
3683           the *SoftLink.{cpp,h} file.
3684
3685 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
3686
3687         [Gtk] Unreviewed build fix.
3688
3689         * platform/ScrollAnimatorNone.cpp:
3690         (WebCore::ScrollAnimatorNone::ScrollAnimatorNone): Forget to update two
3691         uses of ScrollableArea.
3692
3693 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
3694
3695         Scrollbars and ScrollAnimators must always have a ScrollableArea
3696         https://bugs.webkit.org/show_bug.cgi?id=141855
3697
3698         Reviewed by Simon Fraser.
3699
3700         No change in functionality.
3701         
3702         Change users of the scrollAnimator() method to expect a reference instead of a pointer. Also get rid of
3703         a number of unnecessary nullptr checks.
3704
3705         * accessibility/AccessibilityScrollbar.cpp:
3706         (WebCore::AccessibilityScrollbar::setValue):
3707         * css/SelectorCheckerTestFunctions.h:
3708         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
3709         * page/FrameView.cpp:
3710         (WebCore::FrameView::createScrollbar):
3711         (WebCore::FrameView::setFixedVisibleContentRect):
3712         * page/scrolling/ScrollingCoordinator.cpp:
3713         (WebCore::ScrollingCoordinator::handleWheelEventPhase):
3714         * platform/PopupMenuClient.h:
3715         * platform/ScrollAnimator.cpp:
3716         (WebCore::ScrollAnimator::ScrollAnimator):
3717         (WebCore::ScrollAnimator::scroll):
3718         (WebCore::ScrollAnimator::handleWheelEvent):
3719         (WebCore::ScrollAnimator::notifyPositionChanged):
3720         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers):
3721         * platform/ScrollAnimator.h:
3722         (WebCore::ScrollAnimator::ScrollAnimator::scrollableArea):
3723         * platform/ScrollAnimatorNone.cpp:
3724         * platform/ScrollAnimatorNone.h:
3725         * platform/ScrollView.cpp:
3726         (WebCore::ScrollView::createScrollbar):
3727         * platform/ScrollableArea.cpp:
3728         (WebCore::ScrollableArea::scrollAnimator):
3729         (WebCore::ScrollableArea::scroll):
3730         (WebCore::ScrollableArea::scrollToOffsetWithoutAnimation):
3731         (WebCore::ScrollableArea::notifyScrollPositionChanged):
3732         (WebCore::ScrollableArea::scrollPositionChanged):
3733         (WebCore::ScrollableArea::handleWheelEvent):
3734         (WebCore::ScrollableArea::handleTouchEvent):
3735         (WebCore::ScrollableArea::mouseEnteredScrollbar):
3736         (WebCore::ScrollableArea::mouseExitedScrollbar):
3737         (WebCore::ScrollableArea::didAddScrollbar):
3738         (WebCore::ScrollableArea::willRemoveScrollbar):
3739         (WebCore::ScrollableArea::verticalScrollbarLayerDidChange):
3740         (WebCore::ScrollableArea::horizontalScrollbarLayerDidChange):
3741         * platform/ScrollableArea.h:
3742         * platform/Scrollbar.cpp:
3743         (WebCore::Scrollbar::createNativeScrollbar):
3744         (WebCore::Scrollbar::Scrollbar):
3745         (WebCore::Scrollbar::scrollbarOverlayStyle):
3746         (WebCore::Scrollbar::isScrollableAreaActive):
3747         (WebCore::Scrollbar::offsetDidChange):
3748         (WebCore::Scrollbar::autoscrollPressedPart):
3749         (WebCore::Scrollbar::moveThumb):
3750         (WebCore::Scrollbar::mouseMoved):
3751         (WebCore::Scrollbar::mouseEntered):
3752         (WebCore::Scrollbar::mouseExited):
3753         (WebCore::Scrollbar::mouseUp):
3754         (WebCore::Scrollbar::shouldParticipateInHitTesting):
3755         (WebCore::Scrollbar::isWindowActive):
3756         (WebCore::Scrollbar::invalidateRect):
3757         (WebCore::Scrollbar::convertToContainingView):
3758         (WebCore::Scrollbar::convertFromContainingView):
3759         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
3760         * platform/Scrollbar.h:
3761         (WebCore::Scrollbar::scrollableArea):
3762         (WebCore::Scrollbar::disconnectFromScrollableArea): Deleted.
3763         * platform/ios/ScrollAnimatorIOS.mm:
3764         (WebCore::ScrollAnimatorIOS::handleTouchEvent):
3765         (WebCore::ScrollAnimatorIOS::determineScrollableAreaForTouchSequence):
3766         * platform/mac/ScrollAnimatorMac.h:
3767         * platform/mac/ScrollAnimatorMac.mm:
3768         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:setContentAreaNeedsDisplayInRect:]):
3769         (-[WebScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
3770         (-[WebScrollbarPainterDelegate scrollAnimator]):
3771         (-[WebScrollbarPainterDelegate layer]):
3772         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]):
3773         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
3774         (WebCore::ScrollAnimator::create):
3775         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
3776         (WebCore::ScrollAnimatorMac::scroll):
3777         (WebCore::ScrollAnimatorMac::adjustScrollPositionIfNecessary):
3778         (WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
3779         (WebCore::ScrollAnimatorMac::immediateScrollTo):
3780         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
3781         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
3782         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
3783         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
3784         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
3785         (WebCore::ScrollAnimatorMac::pinnedInDirection):
3786         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture):
3787         (WebCore::ScrollAnimatorMac::allowsVerticalStretching):
3788         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching):
3789         (WebCore::ScrollAnimatorMac::stretchAmount):
3790         (WebCore::ScrollAnimatorMac::canScrollHorizontally):
3791         (WebCore::ScrollAnimatorMac::canScrollVertically):
3792         (WebCore::ScrollAnimatorMac::absoluteScrollPosition):
3793         (WebCore::ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints):
3794         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
3795         (WebCore::ScrollAnimatorMac::setVisibleScrollerThumbRect):
3796         * rendering/RenderLayer.cpp:
3797         (WebCore::RenderLayer::RenderLayer):
3798         (WebCore::RenderLayer::createScrollbar):
3799         (WebCore::RenderLayer::destroyScrollbar):
3800         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
3801         * rendering/RenderListBox.cpp:
3802         (WebCore::RenderListBox::createScrollbar):
3803         (WebCore::RenderListBox::destroyScrollbar):
3804         * rendering/RenderMenuList.cpp:
3805         (RenderMenuList::createScrollbar):
3806         * rendering/RenderMenuList.h:
3807         * rendering/RenderScrollbar.cpp:
3808         (WebCore::RenderScrollbar::createCustomScrollbar):
3809         (WebCore::RenderScrollbar::RenderScrollbar):
3810         * rendering/RenderScrollbar.h:
3811         * rendering/RenderSearchField.cpp:
3812         (WebCore::RenderSearchField::createScrollbar):
3813         * rendering/RenderSearchField.h:
3814
3815 2015-02-20  Enrica Casucci  <enrica@apple.com>
3816
3817         [WK2] Add support for font panel on OS X.
3818         https://bugs.webkit.org/show_bug.cgi?id=141777
3819
3820         Reviewed by Tim Horton.
3821
3822         This patch adds the necessary hooks to the Editor class to support
3823         the font panel.
3824
3825         * editing/Editor.h:
3826         * editing/mac/EditorMac.mm:
3827         (WebCore::Editor::applyFontStyles):
3828
3829 2015-02-20  Zalan Bujtas  <zalan@apple.com>
3830
3831         Invalid assert in CompositeEditCommand::insertNodeAfter/insertNodeBefore
3832         https://bugs.webkit.org/show_bug.cgi?id=141854
3833
3834         Reviewed by Ryosuke Niwa.
3835
3836         Inserting content before/after the body as the result of editing is a valid operation.
3837         This assert was originally introduced to cover cases where edited content would get moved
3838         out of body. However, asserting such operation properly is not possible atm.
3839
3840         Test: editing/inserting/insert-as-body-sibling.html
3841
3842         * editing/CompositeEditCommand.cpp:
3843         (WebCore::CompositeEditCommand::insertNodeBefore):
3844         (WebCore::CompositeEditCommand::insertNodeAfter):
3845
3846 2015-02-20  Chris Dumez  <cdumez@apple.com>
3847
3848         [WK2] Add more detailed diagnostic logging for measuring network cache efficacy
3849         https://bugs.webkit.org/show_bug.cgi?id=141803
3850         <rdar://problem/19632080>
3851
3852         Reviewed by Antti Koivisto.
3853
3854         Add more diagnostic logging keys for the network cache.
3855
3856         * page/DiagnosticLoggingKeys.cpp:
3857         (WebCore::DiagnosticLoggingKeys::missingValidatorFieldsKey):
3858         (WebCore::DiagnosticLoggingKeys::noLongerInCacheKey):
3859         (WebCore::DiagnosticLoggingKeys::isReloadIgnoringCacheDataKey):
3860         (WebCore::DiagnosticLoggingKeys::isAttachmentKey):
3861         (WebCore::DiagnosticLoggingKeys::isConditionalRequestKey):
3862         (WebCore::DiagnosticLoggingKeys::cacheControlNoStoreKey):
3863         (WebCore::DiagnosticLoggingKeys::uncacheableStatusCodeKey):
3864         (WebCore::DiagnosticLoggingKeys::unsupportedHTTPMethodKey):
3865         (WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey):
3866         (WebCore::DiagnosticLoggingKeys::varyingHeaderMismatchKey):
3867         (WebCore::WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey):
3868         (WebCore::DiagnosticLoggingKeys::notInCacheKey):
3869         (WebCore::DiagnosticLoggingKeys::noLongerInCacheFailureKey): Deleted.
3870         (WebCore::DiagnosticLoggingKeys::unhandledRequestFailureKey): Deleted.
3871         (WebCore::DiagnosticLoggingKeys::unusableCachedEntryFailureKey): Deleted.
3872         * page/DiagnosticLoggingKeys.h:
3873
3874 2015-02-20  Tim Horton  <timothy_horton@apple.com>
3875
3876         <attachment> turns the wrong blue when you highlight it
3877         https://bugs.webkit.org/show_bug.cgi?id=141853
3878
3879         Reviewed by Simon Fraser.
3880
3881         * rendering/RenderAttachment.h:
3882         * rendering/RenderReplaced.cpp:
3883         (WebCore::RenderReplaced::shouldDrawSelectionTint):
3884         (WebCore::RenderReplaced::paint):
3885         * rendering/RenderReplaced.h:
3886         Don't draw the selection tint for RenderAttachment.
3887
3888 2015-02-20  Tim Horton  <timothy_horton@apple.com>
3889
3890         Allow <attachment> elements to be focused
3891         https://bugs.webkit.org/show_bug.cgi?id=141847
3892
3893         Reviewed by Enrica Casucci.
3894
3895         * css/html.css:
3896         (attachment:focus):
3897         Disable focus rings for <attachment>.
3898
3899         * html/HTMLAttachmentElement.cpp:
3900         (WebCore::HTMLAttachmentElement::setFocus):
3901         * html/HTMLAttachmentElement.h:
3902         Allow HTMLAttachmentElement to get editing focus.
3903         Let RenderAttachment know when focus changes.
3904
3905         * rendering/RenderAttachment.cpp:
3906         (WebCore::RenderAttachment::paintReplaced):
3907         Paint the background in cyan when we are inside the selection or have focus.
3908         Otherwise, it will be gray.
3909
3910         (WebCore::RenderAttachment::focusChanged):
3911         When focus changes, repaint.
3912
3913         * rendering/RenderAttachment.h:
3914
3915 2015-02-20  Brent Fulgham  <bfulgham@apple.com>
3916
3917         Rename ScrollElasticityController to ScrollController
3918         https://bugs.webkit.org/show_bug.cgi?id=141842
3919
3920         Reviewed by Simon Fraser.
3921
3922         No change in functionality.
3923
3924         * PlatformMac.cmake:
3925         * WebCore.order:
3926         * WebCore.xcodeproj/project.pbxproj:
3927         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3928         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3929         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
3930         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
3931         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer):
3932         * platform/mac/ScrollAnimatorMac.h:
3933         * platform/mac/ScrollAnimatorMac.mm:
3934         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
3935         (WebCore::ScrollAnimatorMac::isRubberBandInProgress):
3936         (WebCore::ScrollAnimatorMac::handleWheelEvent):
3937         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
3938         * platform/mac/ScrollController.h: Copied from WebCore/platform/mac/ScrollElasticityController.h.
3939         (WebCore::ScrollControllerClient::~ScrollControllerClient):
3940         (WebCore::ScrollElasticityControllerClient::~ScrollElasticityControllerClient): Deleted.
3941         * platform/mac/ScrollController.mm: Copied from WebCore/platform/mac/ScrollElasticityController.mm.
3942         (WebCore::ScrollController::ScrollController):
3943         (WebCore::ScrollController::handleWheelEvent):
3944         (WebCore::ScrollController::snapRubberBandTimerFired):
3945         (WebCore::ScrollController::isRubberBandInProgress):
3946         (WebCore::ScrollController::stopSnapRubberbandTimer):
3947         (WebCore::ScrollController::snapRubberBand):
3948         (WebCore::ScrollController::shouldRubberBandInHorizontalDirection):
3949         (WebCore::ScrollElasticityController::ScrollElasticityController): Deleted.
3950         (WebCore::ScrollElasticityController::handleWheelEvent): Deleted.
3951         (WebCore::ScrollElasticityController::snapRubberBandTimerFired): Deleted.
3952         (WebCore::ScrollElasticityController::isRubberBandInProgress): Deleted.
3953         (WebCore::ScrollElasticityController::stopSnapRubberbandTimer): Deleted.
3954         (WebCore::ScrollElasticityController::snapRubberBand): Deleted.
3955         (WebCore::ScrollElasticityController::shouldRubberBandInHorizontalDirection): Deleted.
3956         * platform/mac/ScrollElasticityController.h: Removed.
3957         * platform/mac/ScrollElasticityController.mm: Removed.
3958
3959 2015-02-20  Alexey Proskuryakov  <ap@apple.com>
3960
3961         Remove svn:keywords property.
3962
3963         As far as I can tell, the property had no effect on any of these files, but also,
3964         when it has effect it's likely harmful.
3965
3966         * Modules/mediacontrols/assets-apple-iOS.svg: Removed property svn:keywords.
3967         * Modules/mediacontrols/mediaControlsBase.css: Removed property svn:keywords.
3968         * Modules/mediacontrols/mediaControlsBase.js: Removed property svn:keywords.
3969         * bindings/js/JSDeviceMotionEventCustom.cpp: Removed property svn:keywords.
3970         * css/CSSKeyframeRule.cpp: Removed property svn:keywords.
3971         * css/CSSKeyframeRule.h: Removed property svn:keywords.
3972         *&nbs