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