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