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