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