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