Support "plus-lighter" in mix-blend mode
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-06  Dean Jackson  <dino@apple.com>
2
3         Support "plus-lighter" in mix-blend mode
4         https://bugs.webkit.org/show_bug.cgi?id=142416
5         <rdar://problem/19993979>
6
7         Reviewed by Darin Adler and Sam Weinig.
8
9         Support the "plus-lighter" blending mode to CSS.
10         See my reply to: https://lists.w3.org/Archives/Public/public-fx/2015JanMar/0021.html
11
12         Test: css3/blending/svg-blend-plus-lighter.html
13
14         * css/CSSParser.cpp:
15         (WebCore::isValidKeywordPropertyAndValue): mix-blend-mode can now accept the
16         new keyword.
17         * css/CSSPrimitiveValueMappings.h: Add the mappings to/from the GraphicsType.
18         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
19         (WebCore::CSSPrimitiveValue::operator BlendMode):
20         * css/CSSValueKeywords.in: Add comment to show plus-darker and plus-lighter
21         are available.
22         * platform/graphics/GraphicsTypes.cpp: New GraphicsType for PlusLighter.
23         * platform/graphics/GraphicsTypes.h:
24         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Map to the CA filter.
25         (PlatformCAFilters::setBlendingFiltersOnLayer):
26         * platform/graphics/cg/GraphicsContextCG.cpp:
27         (WebCore::GraphicsContext::setPlatformCompositeOperation): Map to the CG
28         blending flag.
29
30 2015-03-06  Alex Christensen  <achristensen@webkit.org>
31
32         Soft link MediaAccessibility using new macros.
33         https://bugs.webkit.org/show_bug.cgi?id=142406
34
35         Reviewed by David Kilzer.
36
37         * Configurations/WebCore.unexp:
38         * WebCore.vcxproj/WebCore.vcxproj:
39         * WebCore.vcxproj/WebCore.vcxproj.filters:
40         * WebCore.xcodeproj/project.pbxproj:
41         * page/CaptionUserPreferencesMediaAF.cpp:
42         * platform/cf/MediaAccessibilitySoftLink.cpp: Added.
43         * platform/cf/MediaAccessibilitySoftLink.h: Added.
44
45 2015-03-06  Brent Fulgham  <bfulgham@apple.com>
46
47         Add 'initial' keyword support for scroll snap CSS properties
48         https://bugs.webkit.org/show_bug.cgi?id=136345
49         <rdar://problem/18162325>
50
51         Reviewed by Dean Jackson.
52
53         Tested by css3/scroll-snap/scroll-snap-initial.html
54
55         The existing implementation already had 'initial' keyword support, but did not fully follow
56         the CSS specification. In particular, the 'initial' state for the scroll-snap-points-x and
57         scroll-snap-points-y properties was not handled correctly.
58
59         Revise implementation to represent ScrollSnapPoints as a pointer, so that 'none' is a valid
60         state.
61
62         * css/CSSComputedStyleDeclaration.cpp:
63         (WebCore::scrollSnapPoints): If 'points' is null, return CSSValueNone.
64         * css/CSSPropertyNames.in: Provide custom initial/inherit handles for snap point x/y sets.
65         * css/StyleBuilderConverter.h:
66         (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Update to represent ScrollSnapPoints
67         as a pointer.
68         * css/StyleBuilderCustom.h:
69         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX): Provide custom pointer-based
70         implementation for ScrollSnapPoints.
71         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX): Ditto.
72         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY): Ditto.
73         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY): Ditto."
74         * page/scrolling/AxisScrollSnapOffsets.cpp:
75         (WebCore::updateFromStyle): Handle ScrollSnapPoints as pointers.
76         (WebCore::updateSnapOffsetsForScrollableArea): Ditto.
77         * rendering/style/RenderStyle.cpp:
78         (WebCore::RenderStyle::scrollSnapPointsX): Update to use pointer-based representation of ScrollSnapPoints.
79         (WebCore::RenderStyle::scrollSnapPointsY): Ditto.
80         (WebCore::RenderStyle::setScrollSnapPointsX): Ditto.
81         (WebCore::RenderStyle::setScrollSnapPointsY): Ditto.
82         (WebCore::RenderStyle::initialScrollSnapPointsX): Deleted.
83         (WebCore::RenderStyle::initialScrollSnapPointsY): Deleted.
84         * rendering/style/RenderStyle.h:
85         * rendering/style/StyleScrollSnapPoints.cpp:
86         (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Revise constructor to handle pointer argument.
87         * rendering/style/StyleScrollSnapPoints.h:
88
89 2015-03-05  Roger Fong  <roger_fong@apple.com>
90
91         Reskin Captions button and container on OSX.
92         https://bugs.webkit.org/show_bug.cgi?id=142383.
93         <rdar://problem/20061466>
94
95         Reviewed by Eric Carlson.
96
97         * Modules/mediacontrols/mediaControlsApple.css:
98         (audio::-webkit-media-controls-toggle-closed-captions-button): Create new captions button icon.
99         Update caption container to match rest of media controls better.
100         (audio::-webkit-media-controls-closed-captions-container):
101         (audio::-webkit-media-controls-closed-captions-container .list):
102         (audio::-webkit-media-controls-closed-captions-container h3):
103         (audio::-webkit-media-controls-closed-captions-container ul):
104         (audio::-webkit-media-controls-closed-captions-container li):
105         (audio::-webkit-media-controls-closed-captions-container li:focus):
106         (audio::-webkit-media-controls-closed-captions-container li:hover):
107         Fix up some fonts to make fonts between captions, status display and time displays consistent.
108         (audio::-webkit-media-controls-status-display):
109         (audio::-webkit-media-controls-time-remaining-display):
110
111 2015-03-06  Jer Noble  <jer.noble@apple.com>
112
113         [Web Audio] Decoding specific .m4a file crashes tab
114         https://bugs.webkit.org/show_bug.cgi?id=139545
115
116         Reviewed by Eric Carlson.
117
118         Test: webaudio/decode-audio-data-too-short.html
119
120         Bail out early if CoreAudio reports the number of frames in the file to be negative.
121
122         * platform/audio/mac/AudioFileReaderMac.cpp:
123         (WebCore::AudioFileReader::createBus):
124
125 2015-03-06  Jeremy Jones  <jeremyj@apple.com>
126
127         Scroll to make the video element visible when exiting fullscreen.
128         https://bugs.webkit.org/show_bug.cgi?id=141439
129
130         Reviewed by Simon Fraser.
131
132         This patch will scroll the element so it is visible when exiting fullscreen,
133         but only if the element is completely scrolled off screen.
134         Also update the element screen rect so exit animation goes to the correct location.
135
136         * dom/Element.cpp:
137         (WebCore::Element::scrollIntoViewIfNotVisible): Added.
138         * dom/Element.h: Add declaration for scrollIntoViewIfNotVisible.
139         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
140         (-[WebVideoFullscreenController fullscreenMayReturnToInline]):
141         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
142         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
143         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]):
144         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]):
145         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
146         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
147         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
148         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
149         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
150         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline):
151         * rendering/ScrollBehavior.cpp:
152         * rendering/ScrollBehavior.h:
153
154 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
155
156         Crash in -[WebCascadeList objectAtIndex:] + 195
157         https://bugs.webkit.org/show_bug.cgi?id=141274
158
159         Reviewed by David Kilzer.
160
161         CTFontDescriptorRefs can live forever in caches inside CoreText, which means our
162         WebCascadeList can too.
163
164         Test: platform/mac/fast/text/crash-complextextcontroller-custom-cascade-list.html
165
166         * platform/graphics/FontCascade.cpp:
167         (WebCore::FontCascade::FontCascade): Initialize WeakPtrFactory.
168         * platform/graphics/FontCascade.h:
169         (WebCore::FontCascade::createWeakPtr):
170         * platform/graphics/mac/ComplexTextControllerCoreText.mm: Migrate the raw pointer
171         to WeakPtr.
172         (-[WebCascadeList initWithFont:character:]):
173         (-[WebCascadeList count]):
174         (-[WebCascadeList objectAtIndex:]):
175
176 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
177
178         Rename BreakingContextInlineHeaders.h to BreakingContext.h
179         https://bugs.webkit.org/show_bug.cgi?id=142404
180
181         Reviewed by Simon Fraser.
182
183         No point naming it "InlineHeaders" when there are no non-inline-headers files.
184
185         No new tests because this is just a rename of a file.
186
187         * WebCore.vcxproj/WebCore.vcxproj:
188         * WebCore.vcxproj/WebCore.vcxproj.filters:
189         * WebCore.xcodeproj/project.pbxproj:
190         * rendering/RenderBlockLineLayout.cpp:
191         * rendering/line/BreakingContext.h: Renamed from Source/WebCore/rendering/line/BreakingContextInlineHeaders.h.
192         (WebCore::WordMeasurement::WordMeasurement):
193         (WebCore::BreakingContext::BreakingContext):
194         (WebCore::BreakingContext::currentObject):
195         (WebCore::BreakingContext::lineBreak):
196         (WebCore::BreakingContext::lineWidth):
197         (WebCore::BreakingContext::atEnd):
198         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
199         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
200         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory):
201         (WebCore::BreakingContext::InlineIteratorHistory::push):
202         (WebCore::BreakingContext::InlineIteratorHistory::update):
203         (WebCore::BreakingContext::InlineIteratorHistory::renderer):
204         (WebCore::BreakingContext::InlineIteratorHistory::offset):
205         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):
206         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode):
207         (WebCore::BreakingContext::InlineIteratorHistory::get):
208         (WebCore::BreakingContext::InlineIteratorHistory::current):
209         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
210         (WebCore::BreakingContext::InlineIteratorHistory::moveTo):
211         (WebCore::BreakingContext::InlineIteratorHistory::increment):
212         (WebCore::BreakingContext::InlineIteratorHistory::clear):
213         (WebCore::BreakingContext::initializeForCurrentObject):
214         (WebCore::BreakingContext::increment):
215         (WebCore::BreakingContext::handleBR):
216         (WebCore::borderPaddingMarginStart):
217         (WebCore::borderPaddingMarginEnd):
218         (WebCore::shouldAddBorderPaddingMargin):
219         (WebCore::previousInFlowSibling):
220         (WebCore::inlineLogicalWidth):
221         (WebCore::BreakingContext::handleOutOfFlowPositioned):
222         (WebCore::BreakingContext::handleFloat):
223         (WebCore::shouldSkipWhitespaceAfterStartObject):
224         (WebCore::BreakingContext::handleEmptyInline):
225         (WebCore::BreakingContext::handleReplaced):
226         (WebCore::firstPositiveWidth):
227         (WebCore::iteratorIsBeyondEndOfRenderCombineText):
228         (WebCore::nextCharacter):
229         (WebCore::updateCounterIfNeeded):
230         (WebCore::measureHyphenWidth):
231         (WebCore::textWidth):
232         (WebCore::ensureCharacterGetsLineBox):
233         (WebCore::tryHyphenating):
234         (WebCore::BreakingContext::handleText):
235         (WebCore::textBeginsWithBreakablePosition):
236         (WebCore::BreakingContext::canBreakAtThisPosition):
237         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
238         (WebCore::checkMidpoints):
239         (WebCore::BreakingContext::handleEndOfLine):
240         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
241         * rendering/line/LineBreaker.cpp:
242
243 2015-03-06  Dan Bernstein  <mitz@apple.com>
244
245         Expose some of the functionality of extract-localizable-strings.pl as a module
246         https://bugs.webkit.org/show_bug.cgi?id=142038
247
248         Reviewed by Sam Weinig.
249
250         * LocalizableStrings.pm: Copied from Source/WebCore/extract-localizable-strings.pl.
251         (setTreatWarningsAsErrors): Added this setter for the variable moved here.
252         (sawError): Added a getter.
253         (emitError): Added. Emits the error message and sets $sawError.
254         (unescapeHexSequence): Moved from extract-localizable-strings.pl and renamed to start with
255         a lowercase letter.
256         (keyCollisionCount): Added this getter.
257         (localizedCount): Added this getter.
258         (HandleUIString): Moved from extract-localizable-strings.pl and made it increment the
259         localized string count.
260         (writeStringsFile): Moved code from extract-localizable-strings.pl into this new subroutine.
261         (verifyStringsFile): Ditto.
262
263         * WebCore.xcodeproj/project.pbxproj: Added LocalizableStrings.pm to the Copy Scripts build
264         phase.
265
266         * extract-localizable-strings.pl:
267         (emitWarning): Moved to the module.
268         (UnescapeHexSequence): Ditto.
269         (HandleUIString): Ditto.
270
271 2015-03-06  Darin Adler  <darin@apple.com>
272
273         Remove unused C++ DOM event handler attribute functions
274         https://bugs.webkit.org/show_bug.cgi?id=142398
275
276         Reviewed by Anders Carlsson.
277
278         * dom/EventTarget.h: Removed now-unneeded macros: DEFINE_ATTRIBUTE_EVENT_LISTENER,
279         DECLARE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER, DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER,
280         DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER, DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER,
281         DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER, DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER.
282
283         * Modules/webaudio/AudioScheduledSourceNode.cpp:
284         (WebCore::AudioScheduledSourceNode::setOnended): Deleted.
285         (WebCore::AudioScheduledSourceNode::finish): Rewrote this to use dispatchEvent
286         instead of one-off event-sending code. Also use a lambda to avoid needing two
287         additional member functions to implement this.
288         (WebCore::AudioScheduledSourceNode::notifyEndedDispatch): Deleted.
289         (WebCore::AudioScheduledSourceNode::notifyEnded): Deleted.
290         * Modules/webaudio/AudioScheduledSourceNode.h: Updated for above.
291
292         * Modules/battery/BatteryManager.h: Removed onxxx and setOnxxx functions,
293         including ones created with macros from EventTarget.h.
294         * Modules/encryptedmedia/MediaKeySession.h: Ditto.
295         * Modules/indexeddb/IDBDatabase.h: Ditto.
296         * Modules/indexeddb/IDBOpenDBRequest.h: Ditto.
297         * Modules/indexeddb/IDBRequest.h: Ditto.
298         * Modules/indexeddb/IDBTransaction.h: Ditto.
299         * Modules/mediastream/MediaStream.h: Ditto.
300         * Modules/mediastream/MediaStreamTrack.h: Ditto.
301         * Modules/mediastream/RTCDTMFSender.h: Ditto.
302         * Modules/mediastream/RTCDataChannel.h: Ditto.
303         * Modules/mediastream/RTCPeerConnection.h: Ditto.
304         * Modules/notifications/Notification.h: Ditto.
305         * Modules/speech/SpeechSynthesisUtterance.h: Ditto.
306         * Modules/webaudio/AudioContext.h: Ditto.
307         * Modules/webaudio/ScriptProcessorNode.cpp: Ditto.
308         * Modules/webaudio/ScriptProcessorNode.h: Ditto.
309         * Modules/websockets/WebSocket.h: Ditto.
310         * css/FontLoader.h: Ditto.
311         * dom/Document.h: Ditto.
312         * dom/Element.cpp: Ditto.
313         * dom/Element.h: Ditto.
314         * dom/MessagePort.h: Ditto.
315         * fileapi/FileReader.h: Ditto.
316         * html/HTMLBodyElement.h: Ditto.
317         * html/HTMLFormElement.h: Ditto.
318         * html/HTMLFrameSetElement.h: Ditto.
319         * html/HTMLInputElement.h: Ditto.
320         * html/HTMLMediaElement.h: Ditto.
321         * html/HTMLVideoElement.h: Ditto.
322         * html/track/TextTrack.h: Ditto.
323         * html/track/TextTrackCue.h: Ditto.
324         * html/track/TrackListBase.h: Ditto.
325         * loader/appcache/DOMApplicationCache.h: Ditto.
326         * page/DOMWindow.h: Ditto.
327         * page/EventSource.h: Ditto.
328         * page/Performance.h: Ditto.
329         * workers/AbstractWorker.h: Ditto.
330         * workers/DedicatedWorkerGlobalScope.h: Ditto.
331         * workers/Worker.h: Ditto.
332         * workers/WorkerGlobalScope.h: Ditto.
333         * xml/XMLHttpRequest.h: Ditto.
334         * xml/XMLHttpRequestUpload.h: Ditto.
335
336 2015-03-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
337
338         Setting any of the <object> element plugin controlling attributes does not have any affect.
339         https://bugs.webkit.org/show_bug.cgi?id=141936.
340
341         Reviewed by Simon Fraser.
342         
343         When setting any of the <object> element plugin controlling attributes
344         dynamically we need to mark the the element to be dirty by calling
345         setNeedsStyleRecalc(), so it has to recreate its renderer when needed.
346
347         Tests: fast/css/image-object-hover-inherit.html
348                svg/as-object/svg-in-object-dynamic-attribute-change.html
349
350         * dom/Element.h: Delete unimplemented function.
351         
352         * html/HTMLObjectElement.cpp:
353         (WebCore::HTMLObjectElement::parseAttribute): Mark the element dirty by
354         calling setNeedsStyleRecalc() when one of the plugin controlling attributes
355         gets changed. We have to clear m_useFallbackContent because the attribute's
356         new value might fix the object rendering.
357         
358         * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent.
359
360 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
361
362         Test horiz-origin-x and horiz-origin-y in SVG fonts
363         https://bugs.webkit.org/show_bug.cgi?id=142403
364
365         Reviewed by Simon Fraser.
366
367         Remove incorrect comment.
368
369         Test: svg/fonts/svg-font-horiz-origin.html
370
371         * svg/SVGToOTFFontConversion.cpp:
372         (WebCore::CFFBuilder::CFFBuilder):
373
374 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
375
376         Allow tree dumping functions to be used in release builds by switching a flag
377         https://bugs.webkit.org/show_bug.cgi?id=142379
378
379         Reviewed by Zalan Bujtas.
380
381         There are various tree dumping functions that are useful for debugging, and sometimes
382         you want to be able to use them in release builds. Currently they are surrounded by
383         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
384         in wtf/Platform.h
385
386         * dom/DocumentMarkerController.cpp:
387         * dom/DocumentMarkerController.h:
388         * dom/Element.cpp:
389         * dom/Element.h:
390         * dom/Node.cpp:
391         * dom/Node.h:
392         * dom/Position.cpp:
393         * dom/Position.h:
394         * dom/Range.cpp:
395         * dom/Range.h:
396         * dom/Text.cpp:
397         * dom/Text.h:
398         * editing/FrameSelection.cpp:
399         * editing/FrameSelection.h:
400         * editing/VisiblePosition.cpp:
401         * editing/VisiblePosition.h:
402         * editing/VisibleSelection.cpp:
403         * editing/VisibleSelection.h:
404         * html/parser/HTMLElementStack.cpp:
405         * html/parser/HTMLFormattingElementList.cpp:
406         * rendering/CounterNode.cpp:
407         * rendering/CounterNode.h:
408         * rendering/InlineBox.cpp:
409         * rendering/InlineBox.h:
410         * rendering/InlineFlowBox.cpp:
411         * rendering/InlineFlowBox.h:
412         * rendering/InlineTextBox.cpp:
413         * rendering/InlineTextBox.h:
414         * rendering/RenderBlockFlow.cpp:
415         * rendering/RenderBlockFlow.h:
416         * rendering/RenderCounter.cpp:
417         * rendering/RenderCounter.h:
418         * rendering/RenderLayer.cpp:
419         * rendering/RenderLayer.h:
420         * rendering/RenderLayerBacking.cpp:
421         (WebCore::RenderLayerBacking::createGraphicsLayer):
422         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
423         (WebCore::RenderLayerBacking::updateForegroundLayer):
424         (WebCore::RenderLayerBacking::updateBackgroundLayer):
425         * rendering/RenderLayerCompositor.cpp:
426         (WebCore::CompositingState::CompositingState):
427         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
428         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
429         (WebCore::RenderLayerCompositor::updateLayerForHeader):
430         (WebCore::RenderLayerCompositor::updateLayerForFooter):
431         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
432         (WebCore::RenderLayerCompositor::ensureRootLayer):
433         * rendering/RenderObject.cpp:
434         * rendering/RenderObject.h:
435         * rendering/RootInlineBox.cpp:
436         * rendering/RootInlineBox.h:
437         * rendering/SimpleLineLayoutFunctions.cpp:
438         * rendering/SimpleLineLayoutFunctions.h:
439         * rendering/svg/SVGResources.cpp:
440         * rendering/svg/SVGResources.h:
441
442 2015-03-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
443
444         An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport.
445         https://bugs.webkit.org/show_bug.cgi?id=141725.
446
447         Reviewed by Darin Adler.
448
449         The current viewport of the <svg> element should be retrieved from its
450         renderer if the renderer is available. If the renderer is not created yet,
451         this means the viewport is needed to calculate the size of the renderer.
452         In this case, we should return the element size if it is intrinsic size.
453         
454         Test: svg/css/svg-css-different-intrinsic-sizes.html
455
456         * svg/SVGSVGElement.cpp:
457         (WebCore::SVGSVGElement::currentViewportSize): Change the order for
458         returning the viewport of the <svg> element. We should consider the case
459         of a valid renderer before considering the case of an intrinsic size.
460
461 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
462
463         Allow composited clip-path to be updated without a layer repaint
464         https://bugs.webkit.org/show_bug.cgi?id=142384
465
466         Reviewed by Zalan Bujtas.
467         
468         When clip-path is mapped to a compositing shape layer mask, we can just
469         push a new shape to the GraphicsLayer to update the clip path, without
470         needing to repaint.
471         
472         Achieve this by adding ContextSensitivePropertyClipPath. When set, and the
473         stars are aligned, issue a StyleDifferenceRecompositeLayer rather than
474         a StyleDifferenceRepaint.
475         
476         We ask RenderLayerCompositor whether the clip path can be composited
477         to hide platform differences related to whether GraphicsLayer supports
478         shape masks.
479
480         Test: compositing/masks/compositing-clip-path-change-no-repaint.html
481
482         * rendering/RenderElement.cpp:
483         (WebCore::RenderElement::adjustStyleDifference): Remove obvious comment
484         about opacity. Handle ContextSensitivePropertyClipPath.
485         * rendering/RenderLayerCompositor.cpp:
486         (WebCore::RenderLayerCompositor::canCompositeClipPath): If we have a mask
487         we have to paint the mask + clip path into the mask layer (mirrors code in
488         RenderLayerBacking::updateMaskingLayer but isn't quite similar enough to share).
489         * rendering/RenderLayerCompositor.h:
490         * rendering/style/RenderStyle.cpp:
491         (WebCore::RenderStyle::changeRequiresRepaint): Set ContextSensitivePropertyClipPath
492         and don't return, as is normal for context-sensitive property handling.
493         * rendering/style/RenderStyleConstants.h: Line things up to avoid future bit
494         fumbles, and remove unnecessary braces.
495
496 2015-03-06  Alex Christensen  <achristensen@webkit.org>
497
498         [Content Extensions] Process all actions when blocking a URL.
499         https://bugs.webkit.org/show_bug.cgi?id=142363
500
501         Reviewed by Darin Adler.
502
503         This can only be tested once we implement css selectors.
504
505         * contentextensions/ContentExtensionsBackend.cpp:
506         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
507         Do not return early when adding a block action.
508         * loader/cache/CachedResourceLoader.cpp:
509         (WebCore::CachedResourceLoader::requestResource):
510         Process all actions before returning.
511
512 2015-03-05  Darin Adler  <darin@apple.com>
513
514         Make JavaScript binding get and set legacy event listener attributes directly
515         https://bugs.webkit.org/show_bug.cgi?id=142282
516
517         Reviewed by Antti Koivisto.
518
519         Test: fast/dom/legacy-event-handler-attributes.html
520
521         This patch changes the JavaScript getters and setters for these attributes
522         to work directly without requiring any functions in the C++ DOM implementation.
523         A subsequent patch will remove the now-unused C++ DOM implementation.
524
525         * Modules/webaudio/AudioScheduledSourceNode.cpp:
526         (WebCore::AudioScheduledSourceNode::setOnended): Remove code to set
527         m_hasEndedListener; this was incorrect since it only detected event listeners
528         set up with the event handler attribute, not with addEventListener.
529         (WebCore::AudioScheduledSourceNode::addEventListener): Added code to update
530         m_hasEndedListener after making changes to the event listeners.
531         (WebCore::AudioScheduledSourceNode::removeEventListener): Ditto.
532         (WebCore::AudioScheduledSourceNode::removeAllEventListeners): Ditto.
533         * Modules/webaudio/AudioScheduledSourceNode.h: Added above overrides.
534
535         * Modules/webaudio/ScriptProcessorNode.cpp:
536         (WebCore::ScriptProcessorNode::setOnaudioprocess): Remove code to set
537         m_hasAudioProcessListener; this was incorrect since it only detected event listeners
538         set up with the event handler attribute, not with addEventListener.
539         (WebCore::ScriptProcessorNode::addEventListener): Added code to update
540         m_hasAudioProcessListener after making changes to the event listeners.
541         (WebCore::ScriptProcessorNode::removeEventListener): Ditto.
542         (WebCore::ScriptProcessorNode::removeAllEventListeners): Ditto.
543         * Modules/webaudio/ScriptProcessorNode.h: Added above overrides.
544
545         * bindings/js/JSEventListener.cpp:
546         (WebCore::legacyEventListenerAttribute): Added.
547         (WebCore::createEventListenerForLegacyAttribute): Added.
548         (WebCore::setLegacyEventListenerAttribute): Added.
549         (WebCore::legacyWindowEventListenerAttribute): Added.
550         (WebCore::setLegacyWindowEventListenerAttribute): Added.
551
552         * bindings/js/JSEventListener.h:
553         (WebCore::createJSEventListenerForAttribute): Deleted.
554
555         * bindings/scripts/CodeGeneratorJS.pm:
556         (GenerateAttributeEventListenerCall): Deleted.
557         (LegacyEventListenerAttributeEventName): Added.
558         (LegacyEventListenerAttributePrefix): Added.
559         (GenerateImplementation): Use "auto" in lots of places to simplify the code
560         generation. Replaced the old inlined code to deal with legacy event listener
561         attributes with code that simply calls the new functions from JSEventLister.h.
562         (GenerateCallWith): Use "auto".
563         (GenerateConstructorDefinition): Ditto.
564
565         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated expected
566         results since these now use auto.
567         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
568         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Ditto.
569         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
570         * bindings/scripts/test/JS/JSTestException.cpp: Ditto.
571         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Ditto.
572         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
573         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
574         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
575         * bindings/scripts/test/JS/JSTestNode.cpp: Ditto.
576         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
577         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
578         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
579         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
580         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
581         * bindings/scripts/test/JS/JSattribute.cpp: Ditto.
582         * bindings/scripts/test/JS/JSreadonly.cpp: Ditto.
583
584         * dom/MessagePort.cpp:
585         (WebCore::MessagePort::addEventListener): Moved logic that calls the start
586         function in here from setOnmessage, since the latter will no longer be called.
587         * dom/MessagePort.h: Ditto.
588
589 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
590
591         [iOS] SVG fonts are garbled
592         https://bugs.webkit.org/show_bug.cgi?id=142377
593
594         Reviewed by Simon Fraser.
595
596         The C++ spec says that casting a negative floating point number to
597         an unsigned integer is undefined. Instead, use clamping.
598
599         Covered by existing SVG font tests.
600
601         * Configurations/FeatureDefines.xcconfig:
602         * svg/SVGToOTFFontConversion.cpp:
603         (WebCore::writeCFFEncodedNumber):
604
605 2015-03-06  Commit Queue  <commit-queue@webkit.org>
606
607         Unreviewed, rolling out r181139.
608         https://bugs.webkit.org/show_bug.cgi?id=142394
609
610         "Caused many crashes in API tests and layout tests in Debug
611         builds on bots." (Requested by ddkilzer on #webkit).
612
613         Reverted changeset:
614
615         "Allow tree dumping functions to be used in release builds by
616         switching a flag"
617         https://bugs.webkit.org/show_bug.cgi?id=142379
618         http://trac.webkit.org/changeset/181139
619
620 2015-03-05  Philippe Normand  <pnormand@igalia.com>
621
622         [MediaStream] new load method for MediaStreamPrivate objects
623         https://bugs.webkit.org/show_bug.cgi?id=142346
624
625         Reviewed by Eric Carlson.
626
627         No new tests, existing mediastream tests cover this use-case.
628
629         * html/HTMLMediaElement.cpp:
630         (WebCore::HTMLMediaElement::loadResource): Use new load method for MediaStreams.
631         * platform/graphics/MediaPlayer.cpp:
632         (WebCore::NullMediaPlayerPrivate::load): New stub.
633         (WebCore::MediaPlayer::load): New load method for
634         MediaStreamPrivate.
635         (WebCore::MediaPlayer::nextBestMediaEngine): Set a new boolean on
636         the MediaEngineSupportParameters to differenciate with MSE and
637         normal video resources.
638         (WebCore::MediaPlayer::loadWithNextMediaEngine): Defer loading of
639         the MediaStream to the MediaPlayerPrivate backend.
640         * platform/graphics/MediaPlayer.h:
641         (WebCore::MediaEngineSupportParameters::MediaEngineSupportParameters):
642         * platform/graphics/MediaPlayerPrivate.h:
643         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
644         (WebCore::MediaPlayerPrivateAVFoundation::load): New empty load
645         method for MediaStreamPrivate objects.
646         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
647         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto.
648         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
649         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
650         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
651         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
652         (WebCore::MediaPlayerPrivateQTKit::load): Ditto.
653         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
654
655 2015-03-05  Philippe Normand  <pnormand@igalia.com>
656
657         Rename MediaStreamSource to RealtimeMediaSource
658         https://bugs.webkit.org/show_bug.cgi?id=142330
659
660         Reviewed by Eric Carlson.
661
662         MediaStreamSource is a misleading name, it's not the source of a
663         MediaStream.
664
665         The chain from high level to low level is: MediaStream -
666         MediaStreamTrack - MediaStreamTrackPrivate - RealTimeMediaSource
667         and a MediaStream can contains several MediaStreamTrack objects of
668         different types.
669
670         MediaStreamSourceStates was also renamed to
671         RealtimeMediaSourceStates, and MediaStreamSourceCapabilities to
672         RealtimeMediaSourceCapabilities, for consistency.
673
674 2015-03-06  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
675
676         Unreviewed WinCairo port build fix since r181136.
677
678         * platform/network/curl/ResourceRequest.h:
679         (WebCore::ResourceRequest::doPlatformAdopt): Missing ":" in std::unique_ptr.
680
681 2015-03-06  David Kilzer  <ddkilzer@apple.com>
682
683         Rename SOFT_LINK_{CONSTANT,FUNCTION}_{HEADER,SOURCE} to SOFT_LINK_{CONSTANT,FUNCTION}_FOR_{HEADER,SOURCE}
684         <http://webkit.org/b/142177>
685
686         Reviewed by Alex Christensen.
687
688         * platform/cf/CoreMediaSoftLink.cpp:
689         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_SOURCE() to
690           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_SOURCE().
691         * platform/cf/CoreMediaSoftLink.h:
692         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_HEADER() to
693           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_HEADER().
694
695         * platform/mac/SoftLinking.h:
696         * platform/win/SoftLinking.h:
697         - Rename SOFT_LINK_{CONSTANT,FUNCTION}_{HEADER,SOURCE}() to
698           SOFT_LINK_{CONSTANT,FUNCTION}_FOR_{HEADER,SOURCE}().
699
700 2015-03-06  Sergio Villar Senin  <svillar@igalia.com>
701
702         [CSS Grid Layout] ASSERTION FAILED !track.growthLimitIsInfinite() in RenderGrid::computeUsedBreadthOfGridTracks
703         https://bugs.webkit.org/show_bug.cgi?id=142265
704
705         Reviewed by Darin Adler.
706
707          The problem is that computeUsedBreadthOfGridTracks() could return
708         -1 for rows because we're calling computeContentLogicalHeight()
709         which can indeed return -1. In those cases we should clamp the
710         value to 0 the same as Flexbox does otherwise we could end up with
711         a negative value in the min track sizing function.
712
713         Test: fast/css-grid-layout/grid-indefinite-calculated-height-crash.html
714
715         * rendering/RenderGrid.cpp:
716         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
717
718 2015-03-05  Simon Fraser  <simon.fraser@apple.com>
719
720         Allow tree dumping functions to be used in release builds by switching a flag
721         https://bugs.webkit.org/show_bug.cgi?id=142379
722
723         Reviewed by Zalan Bujtas.
724
725         There are various tree dumping functions that are useful for debugging, and sometimes
726         you want to be able to use them in release builds. Currently they are surrounded by
727         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
728         in config.h
729
730         * config.h:
731         * dom/DocumentMarkerController.cpp:
732         * dom/DocumentMarkerController.h:
733         * dom/Element.cpp:
734         * dom/Element.h:
735         * dom/Node.cpp:
736         * dom/Node.h:
737         * dom/Position.cpp: Position::debugPosition(const char* msg) was available in release builds, but this changes
738         is to respect ENABLE_TREE_DEBUGGING, which I think is correct.
739         * dom/Position.h:
740         * dom/Range.cpp:
741         * dom/Range.h:
742         * dom/Text.cpp:
743         * dom/Text.h:
744         * rendering/CounterNode.cpp:
745         * rendering/CounterNode.h:
746         * rendering/InlineBox.cpp:
747         * rendering/InlineBox.h:
748         * rendering/InlineFlowBox.cpp:
749         * rendering/InlineFlowBox.h:
750         * rendering/InlineTextBox.cpp:
751         * rendering/InlineTextBox.h:
752         * rendering/RenderBlockFlow.cpp:
753         * rendering/RenderBlockFlow.h:
754         * rendering/RenderCounter.cpp:
755         * rendering/RenderCounter.h:
756         * rendering/RenderLayer.cpp:
757         * rendering/RenderLayer.h:
758         * rendering/RenderLayerBacking.cpp:
759         (WebCore::RenderLayerBacking::createGraphicsLayer):
760         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
761         (WebCore::RenderLayerBacking::updateForegroundLayer):
762         (WebCore::RenderLayerBacking::updateBackgroundLayer):
763         * rendering/RenderLayerCompositor.cpp:
764         (WebCore::CompositingState::CompositingState):
765         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
766         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
767         (WebCore::RenderLayerCompositor::updateLayerForHeader):
768         (WebCore::RenderLayerCompositor::updateLayerForFooter):
769         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
770         (WebCore::RenderLayerCompositor::ensureRootLayer):
771         * rendering/RenderObject.cpp:
772         * rendering/RenderObject.h: showTreeCharacterOffset was unused.
773         * rendering/RootInlineBox.cpp:
774         * rendering/RootInlineBox.h:
775         * rendering/SimpleLineLayoutFunctions.cpp:
776         * rendering/SimpleLineLayoutFunctions.h:
777         * rendering/svg/SVGResources.cpp:
778         * rendering/svg/SVGResources.h:
779
780 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
781
782         [Mac] 'Gliding' phase of scroll snap points is incorrect on desktop
783         https://bugs.webkit.org/show_bug.cgi?id=142351
784         <rdar://problem/20058023>
785
786         Reviewed by Dean Jackson.
787
788         This problem was caused by incorrectly starting a new snapping animation timer when the
789         "end momentum" phase event had been received. This caused WebKit to recalculate the
790         animation curve for the remaining distance, resulting in the bad animation behavior.
791
792         Removing this incorrect start animation command when entering the momentum ended state
793         resolves the problem.
794
795         * platform/cocoa/ScrollController.mm:
796         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Remove the command to
797         start a new snap animation when entering the "end momentum" state.
798
799 2015-03-05  Joonghun Park  <jh718.park@samsung.com>
800
801         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceRequest
802         https://bugs.webkit.org/show_bug.cgi?id=142349
803
804         Reviewed by Darin Adler.
805
806         No new tests, no behavior changes.
807
808         * loader/WorkerThreadableLoader.cpp:
809         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
810         * loader/cache/MemoryCache.cpp:
811         (WebCore::MemoryCache::removeRequestFromSessionCaches):
812         * platform/CrossThreadCopier.h:
813         * platform/network/ResourceRequestBase.cpp:
814         (WebCore::ResourceRequestBase::adopt):
815         (WebCore::ResourceRequestBase::copyData):
816         * platform/network/ResourceRequestBase.h:
817         * platform/network/cf/ResourceRequest.h:
818         * platform/network/cf/ResourceRequestCFNet.cpp:
819         (WebCore::ResourceRequest::doPlatformCopyData):
820         (WebCore::ResourceRequest::doPlatformAdopt):
821         * platform/network/curl/ResourceRequest.h:
822         (WebCore::ResourceRequest::doPlatformCopyData):
823         (WebCore::ResourceRequest::doPlatformAdopt):
824         * platform/network/soup/ResourceRequest.h:
825         (WebCore::ResourceRequest::doPlatformCopyData):
826         (WebCore::ResourceRequest::doPlatformAdopt):
827
828 2015-03-05  Oliver Hunt  <oliver@apple.com>
829
830         Block mixed mode content
831         https://bugs.webkit.org/show_bug.cgi?id=142378
832
833         Reviewed by Darin Adler.
834
835         Switched to blocking mixed mode content by default,
836         and modify the blocking rules to allow us to match
837         the behaviours of other browsers.
838
839         * loader/DocumentLoader.cpp:
840         (WebCore::DocumentLoader::willSendRequest):
841         * loader/MixedContentChecker.cpp:
842         (WebCore::MixedContentChecker::canDisplayInsecureContent):
843         (WebCore::MixedContentChecker::canRunInsecureContent):
844         (WebCore::MixedContentChecker::logWarning):
845         * loader/MixedContentChecker.h:
846         * loader/cache/CachedResourceLoader.cpp:
847         (WebCore::contentTypeFromResourceType):
848         (WebCore::CachedResourceLoader::checkInsecureContent):
849         * page/Settings.in:
850
851 2015-03-05  Chris Dumez  <cdumez@apple.com>
852
853         Document::recalcStyle() shouldn't call viewportContentsChanged() if there is a pending layout
854         https://bugs.webkit.org/show_bug.cgi?id=142140
855
856         Reviewed by Darin Adler.
857
858         Stop calling FrameView::viewportContentsChanged() in Document::recalcStyle()
859         if there is a layout pending to avoid doing unncessary work. If there is a
860         layout pending, we don't need to do anything because viewportContentsChanged()
861         will be called after layout.
862
863         We only need to call FrameView::viewportContentsChanged() in
864         Document::recalcStyle() if a style recalc does not cause a layout. For e.g.
865         a '-webkit-transform' could make an animated GIF visible without causing a
866         layout, in which case we need to resume the animated GIF after style recalc.
867
868         No new tests, already covered by:
869         fast/images/animated-gif-webkit-transform.html
870
871         * dom/Document.cpp:
872         (WebCore::Document::recalcStyle):
873
874 2015-03-05  Dean Jackson  <dino@apple.com>
875
876         [iOS Media] Web video on iPad appears black and missing the AirPlay placard when connected to an AirPlay route
877         https://bugs.webkit.org/show_bug.cgi?id=142373
878         <rdar://problem/19866072>
879
880         Reviewed by Brent Fulgham.
881
882         There was no style for the placard, which meant it had
883         zero height (and thus was invisible).
884
885         * Modules/mediacontrols/mediaControlsiOS.css:
886         (audio::-webkit-media-controls-wireless-playback-status): Added.
887         (audio::-webkit-media-controls-wireless-playback-status.hidden):
888
889 2015-03-05  Roger Fong  <roger_fong@apple.com>
890
891         Adjust volume box to not intersect with rest of inline media controls on OSX.
892         https://bugs.webkit.org/show_bug.cgi?id=142372.
893         <rdar://problem/20064327>
894
895         Reviewed by Brent Fulgham.
896
897         * Modules/mediacontrols/mediaControlsApple.css:
898         (audio::-webkit-media-controls-panel .volume-box):
899         (audio::-webkit-media-controls-panel .volume-box:active):
900
901 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
902
903         <attachment> should allow the title property to override its title
904         https://bugs.webkit.org/show_bug.cgi?id=142369
905
906         Reviewed by Anders Carlsson.
907
908         Test: fast/attachment/attachment-title.html
909
910         * html/HTMLAttachmentElement.cpp:
911         (WebCore::HTMLAttachmentElement::parseAttribute):
912         Invalidate the attachment if the title changes.
913
914         (WebCore::HTMLAttachmentElement::attachmentTitle):
915         Use the title attribute for the title, unless it's empty, in which
916         case we'll use the file's name.
917
918         * html/HTMLAttachmentElement.h:
919         * rendering/RenderThemeMac.mm:
920         (WebCore::AttachmentLayout::layOutTitle):
921         Use attachmentTitle() instead of reaching into the file. Also rename
922         some things from filename to title.
923
924 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
925
926         Two text carets result when dragging a file into a contentEditable area that preventDefault()s the "drop" event
927         https://bugs.webkit.org/show_bug.cgi?id=142362
928         <rdar://problem/20046434>
929
930         Reviewed by Simon Fraser.
931
932         * page/DragController.h:
933         * page/DragController.cpp:
934         (WebCore::DragController::clearDragCaret):
935         Rename cancelDrag to clearDragCaret, since that's really what it does.
936
937         (WebCore::DragController::tryDocumentDrag):
938         When updating the drag position, if we're now over a <input type="file">,
939         clear the drag caret. This avoids leaving a caret behind when dragging
940         over a <input type="file"> inside a contentEditable area.
941
942         (WebCore::DragController::performDragOperation):
943         When the content preventDefault()s while finishing a drag, we should still
944         clear the drag caret, because it's possible that the client did not
945         preventDefault() on dragover/etc., so we would have set a cursor, and
946         now need to clear it so that it doesn't get left behind.
947
948         (WebCore::DragController::mouseMovedIntoDocument):
949         (WebCore::DragController::dragEnteredOrUpdated):
950         (WebCore::DragController::concludeEditDrag):
951         Adjust to renamed clearDragCaret.
952
953         (WebCore::DragController::dragEnded):
954         Make use of clearDragCaret (which is equivalent to this line).
955
956 2015-03-05  Timothy Horton  <timothy_horton@apple.com>
957
958         <attachment> should support indication of download progress
959         https://bugs.webkit.org/show_bug.cgi?id=142336
960         <rdar://problem/19982504>
961
962         Reviewed by Anders Carlsson.
963
964         * html/HTMLAttachmentElement.cpp:
965         (WebCore::HTMLAttachmentElement::parseAttribute):
966         Invalidate the attachment if the progress attribute changes.
967
968         * platform/graphics/FloatRoundedRect.h:
969         (WebCore::FloatRoundedRect::Radii::Radii):
970         Add a Radii constructor that takes a single argument that is used
971         as the radius for all corners, for convenience.
972
973         * rendering/RenderThemeMac.mm:
974         (WebCore::attachmentProgressBarBackgroundColor):
975         (WebCore::attachmentProgressBarFillColor):
976         (WebCore::attachmentProgressBarBorderColor):
977         Add a bunch of constants for the progress bar.
978
979         (WebCore::paintAttachmentIconBackground):
980         Make use of fillRoundedRect instead of creating a path.
981
982         (WebCore::paintAttachmentProgress):
983         (WebCore::RenderThemeMac::paintAttachment):
984         Paint a progress bar if the progress attribute exists and
985         is a valid floating point number.
986
987 2015-03-05  Commit Queue  <commit-queue@webkit.org>
988
989         Unreviewed, rolling out r180846.
990         https://bugs.webkit.org/show_bug.cgi?id=142368
991
992         Caused missing image banners in iTunes store pages (Requested
993         by smfr on #webkit).
994
995         Reverted changeset:
996
997         "FrameView::layoutTimerFired() should update style if needed
998         before doing layout"
999         https://bugs.webkit.org/show_bug.cgi?id=141688
1000         http://trac.webkit.org/changeset/180846
1001
1002 2015-03-05  Sandy Perez  <sperez@indaba.es>
1003
1004         Fix the build when NEON_INTRINSICS is enabled
1005         https://bugs.webkit.org/show_bug.cgi?id=142361
1006
1007         Reviewed by Csaba Osztrogonác.
1008
1009         * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
1010         (WebCore::FEBlend::platformApplySoftware):
1011         * platform/graphics/filters/FEGaussianBlur.cpp:
1012         (WebCore::standardBoxBlur):
1013
1014 2015-03-05  Benjamin Poulain  <bpoulain@apple.com>
1015
1016         Add basic support for character sets to the URL Filter parser
1017         https://bugs.webkit.org/show_bug.cgi?id=142257
1018
1019         Reviewed by Alex Christensen.
1020
1021         This patch is a first step toward making the URL filter parser a bit
1022         more powerful: it adds support for character set atom.
1023
1024         I did not attempt to integrate that into the prefix tree in this patch,
1025         instead, the GraphBuilder gets a two modes of generating the NFA:
1026         PrefixTree and DirectGeneration.
1027
1028         As long as we only see trivial atoms, we use the PrefixTree generation
1029         to minimize the number of nodes we need. As soon as we start a character
1030         class, we switch to DirectGeneration and we generate the NFA from the input
1031         without merging with previously seen patterns.
1032
1033         To differentiate between Trivial atoms and CharacterSet, we also gain
1034         an AtomType state.
1035
1036         The character set themself are very simple: each character is represented by
1037         a bit in a 16bytes bit vector.
1038
1039         * contentextensions/URLFilterParser.cpp:
1040         (WebCore::ContentExtensions::quantifyTrivialAtom):
1041         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
1042         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
1043         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
1044         (WebCore::ContentExtensions::GraphBuilder::atomBackReference):
1045         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
1046         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
1047         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
1048         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassEnd):
1049         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBuiltIn):
1050         (WebCore::ContentExtensions::GraphBuilder::sinkAtom):
1051         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
1052         (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom):
1053         (WebCore::ContentExtensions::GraphBuilder::sinkCharacterSet):
1054         (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary):
1055
1056 2015-03-05  Roger Fong  <roger_fong@apple.com>
1057
1058         Implement new fullscreen media controls on Mac.
1059         https://bugs.webkit.org/show_bug.cgi?id=142355.
1060         <rdar://problem/16175787>
1061
1062         Reviewed by Dean Jackson.
1063
1064         Adjust sizes and positioning of all fullscreen media control elements.
1065         * Modules/mediacontrols/mediaControlsApple.css:
1066         (audio::-webkit-media-controls-fullscreen-button.exit): Update to match entering fullscreen button.
1067         (video:-webkit-full-screen::-webkit-media-controls-panel):
1068         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
1069         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
1070         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
1071         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
1072         (video:-webkit-full-screen::-webkit-media-controls-play-button):
1073         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
1074         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1075         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1076         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
1077         (video:-webkit-full-screen::-webkit-media-controls-current-time-display):
1078         (video:-webkit-full-screen::-webkit-media-controls-time-remaining-display):
1079         (audio:-webkit-full-screen::-webkit-media-controls-toggle-closed-captions-button):
1080         (video:-webkit-full-screen::-webkit-media-controls-volume-slider::-webkit-slider-thumb): Deleted.
1081         (video:-webkit-full-screen::-webkit-media-controls-rewind-button): Deleted. Not used in full screen.
1082
1083 2015-03-05  Roger Fong  <roger_fong@apple.com>
1084
1085         Minor touchups to inline media control icons.
1086         https://bugs.webkit.org/show_bug.cgi?id=142354.
1087         <rdar://problem/20058854>.
1088
1089         Reviewed by Brent Fulgham.
1090
1091         Increase sizes of play/pause and fullscreen buttons slightly.
1092         * Modules/mediacontrols/mediaControlsApple.css:
1093         (audio::-webkit-media-controls-play-button):
1094         (audio::-webkit-media-controls-play-button.paused):
1095         (audio::-webkit-media-controls-fullscreen-button):
1096
1097 2015-03-05  Roger Fong  <roger_fong@apple.com>
1098
1099         Update inline media control icons for OSX.
1100         https://bugs.webkit.org/show_bug.cgi?id=142305.
1101         <rdar://problem/19997484>
1102
1103         Reviewed by Dean Jackson.
1104
1105         Changes include: new volume button, new full screen button, new play/pause button.
1106         Repositioning of 30 second and play buttons.
1107         * Modules/mediacontrols/mediaControlsApple.css:
1108         (audio::-webkit-media-controls-panel button):
1109         (audio::-webkit-media-controls-rewind-button):
1110         (audio::-webkit-media-controls-play-button):
1111         (audio::-webkit-media-controls-play-button.paused):
1112         (audio::-webkit-media-controls-panel .mute-box):
1113         (video::-webkit-media-controls-volume-max-button):
1114         (video::-webkit-media-controls-volume-min-button):
1115         (audio::-webkit-media-controls-toggle-closed-captions-button):
1116         (audio::-webkit-media-controls-fullscreen-button):
1117         (audio::-webkit-media-controls-current-time-display):
1118         * Modules/mediacontrols/mediaControlsApple.js:
1119         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
1120         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
1121         (Controller.prototype.updateVolume): Ditto
1122
1123 2015-03-05  David Hyatt  <hyatt@apple.com>
1124
1125         Caps lock indicator in text fields is laying out in the wrong place.
1126         https://bugs.webkit.org/show_bug.cgi?id=142352
1127
1128         Reviewed by Dean Jackson.
1129
1130         * css/html.css:
1131         (input::-webkit-caps-lock-indicator):
1132         Change the CSS to give the SVG image an intrinsic size, and to use align-self:stretch so that
1133         the image always stretches to fill the height of the text box. Get rid of height:100%, as that
1134         just resolves to auto in strict mode and was not ever going to work there.
1135
1136 2015-03-04  Dean Jackson  <dino@apple.com>
1137
1138         [iOS Media] Use a blurry background for media controls
1139         https://bugs.webkit.org/show_bug.cgi?id=142316
1140         <rdar://problem/14911098>
1141
1142         Reviewed by Eric Carlson.
1143
1144         Start using the -webkit-appearance media-controls-light-bar-background
1145         in order to get the blurry background of media controls.
1146
1147         * Modules/mediacontrols/mediaControlsApple.js: Keep the panel and the
1148         panel background in sync when it comes to hiding and showing. It would
1149         be better if this could be done on a container element in the future.
1150         (Controller.prototype.handlePanelTransitionEnd):
1151         (Controller.prototype.setPlaying):
1152         (Controller.prototype.showControls):
1153         (Controller.prototype.hideControls):
1154
1155         * Modules/mediacontrols/mediaControlsiOS.css: New background container
1156         with the special appearance. I also renamed "composited-parent" to
1157         "container", which makes more sense.
1158         (video::-webkit-media-controls-panel-container):
1159         (audio::-webkit-media-controls-panel-container):
1160         (video::-webkit-media-controls-panel-background):
1161         (audio::-webkit-media-controls-panel-background):
1162         (video::-webkit-media-controls-panel-background.paused):
1163         (video::-webkit-media-controls-panel):
1164         (audio::-webkit-media-controls-panel):
1165         (video::-webkit-media-controls-panel.paused):
1166         (audio::-webkit-media-controls-optimized-fullscreen-button):
1167         (audio::-webkit-media-controls-timeline):
1168         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
1169         (video::-webkit-media-controls-panel-composited-parent): Deleted.
1170         (video::-webkit-media-controls-panel:hover): Deleted.
1171
1172         * Modules/mediacontrols/mediaControlsiOS.js:
1173         (ControllerIOS.prototype.createControls): Create the new background element.
1174         (ControllerIOS.prototype.addControls):
1175         (ControllerIOS.prototype.set pageScaleFactor): Temporarily disable
1176         this because the background disappears when the zoom factor
1177         is too high - we start tiling the background. This will be addressed
1178         by https://bugs.webkit.org/show_bug.cgi?id=142317.
1179
1180 2015-03-05  Myles C. Maxfield  <mmaxfield@apple.com>
1181
1182         Mechanical text-related cleanup
1183         https://bugs.webkit.org/show_bug.cgi?id=142326
1184
1185         Reviewed by Andreas Kling.
1186
1187         Use nullptr instead of 0.
1188         Use references instead of pointers.
1189
1190         No new tests because there is no behavior change.
1191
1192         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1193         (WebCore::FontCascade::adjustSelectionRectForComplexText):
1194         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
1195         (WebCore::FontCascade::floatWidthForComplexText):
1196         (WebCore::FontCascade::offsetForPositionForComplexText):
1197         * platform/graphics/mac/ComplexTextController.cpp:
1198         (WebCore::TextLayout::TextLayout):
1199         (WebCore::ComplexTextController::ComplexTextController):
1200         * platform/graphics/mac/ComplexTextController.h:
1201         * rendering/InlineIterator.h:
1202         (WebCore::InlineIterator::InlineIterator):
1203         (WebCore::InlineIterator::clear):
1204         (WebCore::bidiNextShared):
1205         (WebCore::bidiNextSkippingEmptyInlines):
1206         (WebCore::bidiNextIncludingEmptyInlines):
1207         (WebCore::InlineWalker::InlineWalker):
1208         (WebCore::InlineIterator::increment):
1209         * rendering/RenderBlockLineLayout.cpp:
1210         (WebCore::setLogicalWidthForTextRun):
1211         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1212         * rendering/line/BreakingContextInlineHeaders.h:
1213         (WebCore::measureHyphenWidth):
1214         (WebCore::textWidth):
1215         (WebCore::tryHyphenating):
1216         (WebCore::BreakingContext::handleText):
1217         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
1218
1219 2015-03-05  Brent Fulgham  <bfulgham@apple.com>
1220
1221         Move AxisScrollSnapAnimator logic to ScrollController
1222         https://bugs.webkit.org/show_bug.cgi?id=142293
1223         <rdar://problem/20039867>
1224
1225         Reviewed by Dean Jackson.
1226
1227         No change in function.
1228
1229         Move the animation logic out of 'AxisScrollSnapAnimator' into 'ScrollController'. Rename the remaining
1230         bits of 'AxisScrollSnapAnimator' as 'ScrollSnapAnimatorState'. Remove a number of delegate methods required
1231         by 'AxisScrollSnapAnimatorClient' that are no longer needed.
1232
1233         Also, break up some of the Scroll Snap Point math to be a little easier to understand.
1234
1235         * WebCore.xcodeproj/project.pbxproj: Rename 'platform/mac/AxisScrollSnapAnimator.{h,mm}' -> 'platform/cocoa/ScrollSnapAnimatorState.h'
1236         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Mark 'scrollOffsetOnAxis' as const.
1237         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1238         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Make 'const'
1239         * platform/ScrollAnimator.cpp:
1240         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Make 'const'
1241         * platform/ScrollAnimator.h:
1242         * platform/cocoa/ScrollController.h: No longer subclass from AxisScrollSnapAnimatorClient.
1243         * platform/cocoa/ScrollController.mm:
1244         (WebCore::ScrollController::scrollSnapPointState): Added accessors (const and non-const) for the individual
1245         Scroll Snap State of each axis.
1246         (WebCore::toWheelEventStatus): Moved from AxisScrollSnapAnimator.
1247         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Added helper function containing the snap wheel handler code
1248         from AxisScrollSnapAnimator.
1249         (WebCore::ScrollController::shouldOverrideWheelEvent): Moved from AxisScrollSnapAnimator.
1250         (WebCore::ScrollController::processWheelEventForScrollSnap): Update to use new methods moved from AxisScrollSnapAnimator.
1251         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Update for new ScrollSnapAnimatorState class.
1252         (WebCore::ScrollController::updateScrollSnapPoints): Ditto.
1253         (WebCore::ScrollController::startScrollSnapTimer): Call client (delegate) method.
1254         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1255         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Call new 'scrollSnapAnimationUpdate' method passing the
1256         correct axis to animate.
1257         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
1258         (WebCore::ScrollController::scrollSnapAnimationUpdate): Moved from AxisScrollSnapAnimator.
1259         (WebCore::projectedInertialScrollDistance): Moved from AxisScrollSnapAnimator.
1260         (WebCore::ScrollController::initializeGlideParameters): Ditto.
1261         (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
1262         (WebCore::ScrollController::endScrollSnapAnimation): Ditto.
1263         (WebCore::snapProgress): Created a new function for this calculation to make reasoning about the 'computeSnapDelta' and
1264         'computeGlideDelta' easier.
1265         (WebCore::clampedSnapMagnitude): Ditto.
1266         (WebCore::ScrollController::computeSnapDelta): Moved from AxisScrollSnapAnimator.
1267         (WebCore::snapGlide): Created a new function for this calculation to make reasoning about the 'computeGlideDelta' easier.
1268         (WebCore::ScrollController::computeGlideDelta): Moved from AxisScrollSnapAnimator.
1269         (WebCore::ScrollController::scrollOffsetOnAxis): Deleted.
1270         (WebCore::ScrollController::immediateScrollOnAxis): Deleted.
1271         * platform/cocoa/ScrollSnapAnimatorState.h: Copied from platform/mac/AxisScrollSnapAnimator.h.
1272         (WebCore::AxisScrollSnapAnimatorClient::~AxisScrollSnapAnimatorClient): Deleted.
1273         * platform/cocoa/ScrollSnapAnimatorState.mm: Copied from platform/mac/AxisScrollSnapAnimator.mm.
1274         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState):
1275         (WebCore::ScrollSnapAnimatorState::pushInitialWheelDelta):
1276         (WebCore::ScrollSnapAnimatorState::averageInitialWheelDelta):
1277         (WebCore::ScrollSnapAnimatorState::clearInitialWheelDeltaWindow):
1278         (WebCore::toWheelEventStatus): Deleted.
1279         (WebCore::projectedInertialScrollDistance): Deleted.
1280         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Deleted.
1281         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Deleted.
1282         (WebCore::AxisScrollSnapAnimator::shouldOverrideWheelEvent): Deleted.
1283         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Deleted.
1284         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Deleted.
1285         (WebCore::AxisScrollSnapAnimator::endScrollSnapAnimation): Deleted.
1286         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Deleted.
1287         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Deleted.
1288         (WebCore::AxisScrollSnapAnimator::initializeGlideParameters): Deleted.
1289         (WebCore::AxisScrollSnapAnimator::pushInitialWheelDelta): Deleted.
1290         (WebCore::AxisScrollSnapAnimator::averageInitialWheelDelta): Deleted.
1291         (WebCore::AxisScrollSnapAnimator::clearInitialWheelDeltaWindow): Deleted.
1292         * platform/mac/AxisScrollSnapAnimator.h: Removed.
1293         * platform/mac/AxisScrollSnapAnimator.mm: Removed.
1294         * platform/mac/ScrollAnimatorMac.h:
1295         * platform/mac/ScrollAnimatorMac.mm:
1296         (WebCore::ScrollAnimatorMac::pinnedInDirection): Removed.
1297
1298 2015-03-04  Dean Jackson  <dino@apple.com>
1299
1300         [iOS Media] Small inline controls can clip the time widgets
1301         https://bugs.webkit.org/show_bug.cgi?id=142319
1302
1303         Reviewed by Eric Carlson.
1304
1305         Start counting the number of digits in a duration so that
1306         we can assign classes to the time widgets that specify
1307         a minimum width.
1308
1309         * Modules/mediacontrols/mediaControlsApple.css: Replace the hour-long and ten-hour-long
1310         classes with number of digits.
1311         (audio::-webkit-media-controls-time-remaining-display.five-digit-time):
1312         (audio::-webkit-media-controls-current-time-display.five-digit-time):
1313         (audio::-webkit-media-controls-time-remaining-display.six-digit-time):
1314         (audio::-webkit-media-controls-current-time-display.six-digit-time):
1315         (audio::-webkit-media-controls-time-remaining-display.hour-long-time): Deleted.
1316         (audio::-webkit-media-controls-current-time-display.hour-long-time): Deleted.
1317         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time): Deleted.
1318         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time): Deleted.
1319
1320         * Modules/mediacontrols/mediaControlsApple.js: Add some new class names.
1321         (Controller.prototype.updateDuration): Set the class of the time
1322         widgets when we know how long the media runs.
1323
1324         * Modules/mediacontrols/mediaControlsiOS.css: Values for iOS that
1325         are big enough to avoid clipping.
1326         (video::-webkit-media-controls-current-time-display):
1327         (video::-webkit-media-controls-time-remaining-display):
1328         (video::-webkit-media-controls-current-time-display.three-digit-time):
1329         (video::-webkit-media-controls-time-remaining-display.three-digit-time):
1330         (video::-webkit-media-controls-current-time-display.four-digit-time):
1331         (video::-webkit-media-controls-time-remaining-display.four-digit-time):
1332         (video::-webkit-media-controls-current-time-display.five-digit-time):
1333         (video::-webkit-media-controls-time-remaining-display.five-digit-time):
1334         (video::-webkit-media-controls-current-time-display.six-digit-time):
1335         (video::-webkit-media-controls-time-remaining-display.six-digit-time):
1336         (audio::-webkit-media-controls-timeline-container): Deleted.
1337         (video::-webkit-media-text-track-container): Deleted.
1338
1339 2015-03-05  Csaba Osztrogonác  <ossy@webkit.org>
1340
1341         [cmake] Fix the web replay build
1342         https://bugs.webkit.org/show_bug.cgi?id=142331
1343
1344         Reviewed by Gyuyoung Kim.
1345
1346         * CMakeLists.txt:
1347         * inspector/InspectorReplayAgent.cpp:
1348         (WebCore::buildInspectorObjectForSessionState):
1349         (WebCore::buildInspectorObjectForSegmentState):
1350
1351 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1352
1353         [SOUP] Check TLS errors as soon as they are set in the SoupMessage
1354         https://bugs.webkit.org/show_bug.cgi?id=142244
1355
1356         Reviewed by Sergio Villar Senin.
1357
1358         Connect to the notify::tls-errors signal of SoupMessage to cancel
1359         the load earlier in case of TLS failure, preventing any private
1360         data from being sent to the server before the TLS errors are checked.
1361
1362         * platform/network/soup/ResourceHandleSoup.cpp:
1363         (WebCore::tlsErrorsChangedCallback):
1364         (WebCore::gotHeadersCallback):
1365         (WebCore::createSoupMessageForHandleAndRequest):
1366
1367 2015-03-05  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1368
1369         TextCheckingParagraph::isEmpty() is sufficient to check whether paragraph is empty
1370         https://bugs.webkit.org/show_bug.cgi?id=142276
1371
1372         Reviewed by Darin Adler.
1373
1374         TextCheckingParagraph::isEmpty() already calls TextCheckingParagraph::isRangeEmpty().
1375         There is no need to call them both at the caller site.
1376
1377         No new tests. No behavior change.
1378
1379         * editing/Editor.cpp:
1380         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
1381         Update caller site.
1382
1383         * editing/TextCheckingHelper.cpp:
1384         (WebCore::TextCheckingParagraph::isEmpty):
1385         Avoid using helepers here to get rid of them as they are
1386         no longer needed outside TextCheckingParagraph.
1387
1388         * editing/TextCheckingHelper.h:
1389         (WebCore::TextCheckingParagraph::isTextEmpty): Deleted.
1390         (WebCore::TextCheckingParagraph::isRangeEmpty): Deleted.
1391         Do not expose isTextEmpty() and isRangeEmpty().
1392
1393 2015-03-04  Simon Fraser  <simon.fraser@apple.com>
1394
1395         Clarify RenderElement::adjustStyleDifference()
1396         https://bugs.webkit.org/show_bug.cgi?id=142256
1397
1398         Reviewed by David Hyatt.
1399
1400         Make RenderElement::adjustStyleDifference() clearer in two ways.
1401         
1402         First, replace lots of if (diff < X) diff = X with
1403         diff = std::max(diff, X). I did this even in cases where diff was
1404         being set unconditionally, because it's never correct to change the diff
1405         to a lesser value.
1406         
1407         Second the "set at least SimplifiedLayout, but if we have PositionedMovementOnly
1408         set it to SimplifiedLayoutAndPositionedMovement" was confusingly written.
1409
1410         * rendering/RenderElement.cpp:
1411         (WebCore::RenderElement::adjustStyleDifference):
1412
1413 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1414
1415         Switch new soft-linking debug asserts to release asserts
1416         <http://webkit.org/b/142176>
1417
1418         Reviewed by Alex Christensen.
1419
1420         * platform/mac/SoftLinking.h:
1421         (SOFT_LINK_CONSTANT_SOURCE): Switch to release assert.
1422         (SOFT_LINK_FUNCTION_SOURCE): Ditto.
1423         * platform/win/SoftLinking.h:
1424         (SOFT_LINK_CONSTANT_SOURCE): Ditto.
1425         (SOFT_LINK_FUNCTION_SOURCE): Ditto.  Note that this method is
1426         effectively only called once because the function pointer is
1427         replaced after the first time it's called.
1428
1429 2015-03-04  Alex Christensen  <achristensen@webkit.org>
1430
1431         Optimize content extensions.
1432         https://bugs.webkit.org/show_bug.cgi?id=142295
1433
1434         Reviewed by Benjamin Poulain.
1435
1436         * contentextensions/ContentExtensionCompiler.cpp:
1437         (WebCore::ContentExtensions::serializeActions):
1438         There is no need to add duplicate sequential actions.
1439         * contentextensions/ContentExtensionRule.h:
1440         (WebCore::ContentExtensions::Action::operator==):
1441         Added to compare actions.
1442         * contentextensions/ContentExtensionsBackend.cpp:
1443         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
1444         Return early if a block action is found instead of moving to the next extension.
1445
1446 2015-03-04  Commit Queue  <commit-queue@webkit.org>
1447
1448         Unreviewed, rolling out r181046.
1449         https://bugs.webkit.org/show_bug.cgi?id=142318
1450
1451         Broke two layout tests (Requested by sundiamonde on #webkit).
1452
1453         Reverted changeset:
1454
1455         "Update inline media control icons for OSX."
1456         https://bugs.webkit.org/show_bug.cgi?id=142305
1457         http://trac.webkit.org/changeset/181046
1458
1459 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1460
1461         <attachment> icons are low-resolution when transformed or under page scale
1462         https://bugs.webkit.org/show_bug.cgi?id=142262
1463         <rdar://problem/20035480>
1464
1465         Reviewed by Dean Jackson.
1466
1467         We should use Icon::createIconForFiles, just like <input type="file"> does,
1468         instead of directly talking to IconServices. This results both in less code
1469         and in NSImage's multiresolution magic making the icons sharp even under
1470         the influence of transforms and page scale.
1471
1472         * WebCore.xcodeproj/project.pbxproj:
1473         * platform/spi/mac/IconServicesSPI.h: Removed.
1474         * platform/spi/mac/LaunchServicesSPI.h: Removed.
1475         Get rid of IconServicesSPI.h and LaunchServicesSPI.h.
1476
1477         * platform/graphics/Icon.h:
1478         Include RetainPtr just once.
1479         paint() should take a GraphicsContext reference (null is not an option)
1480         and a FloatRect (after all, it just turns around and converts to NSRect).
1481
1482         * platform/graphics/ios/IconIOS.mm:
1483         (WebCore::Icon::paint):
1484         * platform/graphics/mac/IconMac.mm:
1485         (WebCore::Icon::createIconForFiles):
1486         (WebCore::Icon::paint):
1487         * platform/graphics/efl/IconEfl.cpp:
1488         (WebCore::Icon::paint):
1489         * platform/graphics/gtk/IconGtk.cpp:
1490         (WebCore::Icon::paint):
1491         * platform/graphics/win/IconWin.cpp:
1492         (WebCore::Icon::paint):
1493         Adapt to the paint() signature changes, fix some style, etc.
1494
1495         * rendering/RenderFileUploadControl.cpp:
1496         (WebCore::RenderFileUploadControl::paintObject):
1497         * rendering/RenderThemeIOS.mm:
1498         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
1499         Adapt to the paint() signature changes.
1500
1501         * rendering/RenderThemeMac.mm:
1502         (WebCore::paintAttachmentIcon):
1503         Use Icon::createIconForFiles instead of IconServices.
1504
1505 2015-03-04  Tim Horton  <timothy_horton@apple.com>
1506
1507         <attachment> should not appear selected when the cursor is adjacent to it
1508         https://bugs.webkit.org/show_bug.cgi?id=142311
1509         <rdar://problem/20045862>
1510
1511         Reviewed by Dean Jackson.
1512
1513         * rendering/RenderAttachment.cpp:
1514         (WebCore::RenderAttachment::isSelected): Deleted.
1515         * rendering/RenderAttachment.h:
1516         * rendering/RenderThemeMac.mm:
1517         (WebCore::titleTextColorForAttachment):
1518         (WebCore::RenderThemeMac::paintAttachment):
1519         (WebCore::labelTextColorForAttachment): Deleted.
1520         We were using the wrong (and far too complicated) mechanism to determine
1521         if the attachment is selected (to decide which highlight color to use).
1522         Instead, just check selectionState().
1523
1524 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1525
1526         <attachment> should show the file size as detail text below the icon
1527         https://bugs.webkit.org/show_bug.cgi?id=142261
1528         <rdar://problem/20009570>
1529
1530         Reviewed by Dean Jackson.
1531
1532         Test: fast/attachment/attachment-subtitle.html
1533
1534         * html/HTMLAttachmentElement.cpp:
1535         (WebCore::HTMLAttachmentElement::setFile):
1536         (WebCore::HTMLAttachmentElement::parseAttribute):
1537         * html/HTMLAttachmentElement.h:
1538         Let RenderAttachment know when the subtitle attribute changes.
1539
1540         * html/HTMLAttributeNames.in:
1541         Add a subtitle attribute.
1542
1543         * rendering/RenderAttachment.cpp:
1544         (WebCore::RenderAttachment::invalidate):
1545         (WebCore::RenderAttachment::representedFileChanged): Deleted.
1546         * rendering/RenderAttachment.h:
1547         Rename representedFileChanged to invalidate; it will cause layout and
1548         repaint of the attachment. Mostly for use from HTMLAttachmentElement,
1549         when properties that affect the display and/or intrinsic size change.
1550
1551         * rendering/RenderThemeMac.mm:
1552         (WebCore::attachmentTitleInactiveBackgroundColor):
1553         (WebCore::attachmentTitleInactiveTextColor):
1554         (WebCore::attachmentSubtitleTextColor):
1555         (WebCore::titleTextColorForAttachment):
1556         (WebCore::AttachmentLayout::addTitleLine):
1557         (WebCore::AttachmentLayout::layOutTitle):
1558         (WebCore::AttachmentLayout::layOutSubtitle):
1559         (WebCore::AttachmentLayout::AttachmentLayout):
1560         (WebCore::addAttachmentTitleBackgroundRightCorner):
1561         (WebCore::addAttachmentTitleBackgroundLeftCorner):
1562         (WebCore::paintAttachmentTitleBackground):
1563         (WebCore::paintAttachmentTitle):
1564         (WebCore::paintAttachmentSubtitle):
1565         (WebCore::RenderThemeMac::paintAttachment):
1566         (WebCore::attachmentLabelInactiveBackgroundColor): Deleted.
1567         (WebCore::attachmentLabelInactiveTextColor): Deleted.
1568         (WebCore::labelTextColorForAttachment): Deleted.
1569         (WebCore::AttachmentLayout::addLine): Deleted.
1570         (WebCore::AttachmentLayout::layOutLabel): Deleted.
1571         (WebCore::addAttachmentLabelBackgroundRightCorner): Deleted.
1572         (WebCore::addAttachmentLabelBackgroundLeftCorner): Deleted.
1573         (WebCore::paintAttachmentLabelBackground): Deleted.
1574         (WebCore::paintAttachmentLabel): Deleted.
1575         Rename everything "label" to "title" (except LabelLine, which is not
1576         specifically about the title). We're going to use "title" for the
1577         main text below the icon, and "subtitle" for the secondary text below that.
1578
1579         Avoid keeping the CTFonts on the AttachmentLayout; there's no need for it.
1580
1581         Add layOutSubtitle and paintAttachmentSubtitle, which orient and paint
1582         the subtitle (below the title, in blue, smaller than the label).
1583
1584 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1585
1586         [Windows] Build fix: Make sure to include <CoreMedia/CoreMedia.h> before redefining CMSampleBuffer
1587
1588         More fallout from:
1589
1590         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1591         <http://webkit.org/b/141870>
1592
1593         * platform/cf/CoreMediaSoftLink.cpp:
1594         * platform/cf/CoreMediaSoftLink.h:
1595         - Remove include of <CoreMedia/CoreMedia.h> here.  These already
1596           include CoreMediaSPI.h.
1597         * platform/spi/cf/CoreMediaSPI.h:
1598         - Add include of <CoreMedia/CoreMedia.h> here.
1599         - Remove redundant include of <CoreMedia/CMTime.h> for Windows.
1600
1601 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1602
1603         [iOS] Fix build with newer clang due to duplicate macro definition
1604
1605         Fallout from:
1606
1607         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1608         <http://webkit.org/b/141870>
1609
1610         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1611         Remove duplicate kCMTimeIndefinite macro.
1612
1613 2015-03-04  Roger Fong  <roger_fong@apple.com>
1614
1615         Update inline media control icons for OSX.
1616         https://bugs.webkit.org/show_bug.cgi?id=142305.
1617         <rdar://problem/19997484>
1618
1619         Reviewed by Dean Jackson.
1620
1621         Changes include: new volume button, new full screen button, new play/pause button.
1622         Repositioning of 30 second and play buttons.
1623         * Modules/mediacontrols/mediaControlsApple.css:
1624         (audio::-webkit-media-controls-panel button):
1625         (audio::-webkit-media-controls-rewind-button):
1626         (audio::-webkit-media-controls-play-button):
1627         (audio::-webkit-media-controls-play-button.paused):
1628         (audio::-webkit-media-controls-panel .mute-box):
1629         (video::-webkit-media-controls-volume-max-button):
1630         (video::-webkit-media-controls-volume-min-button):
1631         (audio::-webkit-media-controls-toggle-closed-captions-button):
1632         (audio::-webkit-media-controls-fullscreen-button):
1633         (audio::-webkit-media-controls-current-time-display):
1634         * Modules/mediacontrols/mediaControlsApple.js:
1635         (Controller.prototype.configureInlineControls): Swap positions of rewind and play buttons.
1636         (Controller.prototype.handleMuteButtonClicked): Remember to update volume slider when necessary.
1637         (Controller.prototype.updateVolume): Ditto
1638
1639 2015-03-04  Andy Estes  <aestes@apple.com>
1640
1641         [Content Filtering] Rename ContentFilterMac.mm to ContentFilter.cpp
1642         https://bugs.webkit.org/show_bug.cgi?id=142313
1643
1644         Reviewed by Anders Carlsson.
1645
1646         ContentFilterMac.mm no longer contains any Objective-C code, so rename it to ContentFilter.cpp. It is also no longer Mac-specific, so move it up to platform/.
1647
1648         * WebCore.xcodeproj/project.pbxproj:
1649         * platform/ContentFilter.cpp: Renamed from Source/WebCore/platform/mac/ContentFilterMac.mm.
1650         * platform/cocoa/NetworkExtensionContentFilter.h: Replaced NSInteger with long.
1651
1652 2015-03-04  Dean Jackson  <dino@apple.com>
1653
1654         REGRESSION (r179597): Can't see power saver banner for plugins
1655         https://bugs.webkit.org/show_bug.cgi?id=142312
1656         <rdar://problem/20040517>
1657
1658         Reviewed by Brent Fulgham.
1659
1660         We were being a bit too restrictive when deciding a child
1661         should not create a renderer. All shadow root children
1662         of the snapshotted plugin need one.
1663
1664         * html/HTMLPlugInImageElement.cpp:
1665         (WebCore::HTMLPlugInImageElement::childShouldCreateRenderer):
1666         Test if we're part of the shadow tree.
1667
1668 2015-03-03  Andy Estes  <aestes@apple.com>
1669
1670         [Content Filtering] Make it easier to add new content filters
1671         https://bugs.webkit.org/show_bug.cgi?id=142255
1672
1673         Reviewed by Sam Weinig.
1674
1675         ContentFilter was becoming a bit of a mess, with both the WebFilterEvaluator and NEFilterSource implementations
1676         awkwardly living side-by-side. This patch cleans things up by moving these implementations into two separate
1677         classes and turning ContentFilter itself into an abstract interface that each implements. A new class called
1678         ContentFilterCollection, which also inherits from ContentFilter, manages the collection of individual content
1679         filters and is vended to the rest of the system by ContentFilter::createIfNeeded().
1680
1681         This refactoring will make it easier to add a third type of content filter in a follow-on patch, namely a mock
1682         content filter for testing purposes.
1683
1684         * WebCore.xcodeproj/project.pbxproj:
1685         * loader/DocumentLoader.cpp:
1686         (WebCore::DocumentLoader::responseReceived): Called ContentFilter::createIfNeeded() instead of instantiating a ContentFilter directly.
1687         * platform/ContentFilter.h:
1688         (WebCore::ContentFilter::~ContentFilter):
1689         * platform/cocoa/NetworkExtensionContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
1690         * platform/cocoa/NetworkExtensionContentFilter.mm: Added.
1691         (WebCore::NetworkExtensionContentFilter::canHandleResponse): Moved NEFilterSource code from ContentFilterMac.mm to here.
1692         (WebCore::NetworkExtensionContentFilter::create): Ditto.
1693         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Ditto.
1694         (WebCore::NetworkExtensionContentFilter::~NetworkExtensionContentFilter): Ditto.
1695         (WebCore::NetworkExtensionContentFilter::addData): Ditto.
1696         (WebCore::NetworkExtensionContentFilter::finishedAddingData): Ditto.
1697         (WebCore::NetworkExtensionContentFilter::needsMoreData): Ditto.
1698         (WebCore::NetworkExtensionContentFilter::didBlockData): Ditto.
1699         (WebCore::NetworkExtensionContentFilter::getReplacementData): Ditto.
1700         (WebCore::NetworkExtensionContentFilter::unblockHandler): Ditto.
1701         * platform/cocoa/ParentalControlsContentFilter.h: Copied from Source/WebCore/platform/ContentFilter.h.
1702         * platform/cocoa/ParentalControlsContentFilter.mm: Added.
1703         (WebCore::ParentalControlsContentFilter::canHandleResponse): Moved WebFilterEvaluator code from ContentFilterMac.mm to here.
1704         (WebCore::ParentalControlsContentFilter::create): Ditto.
1705         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Ditto.
1706         (WebCore::ParentalControlsContentFilter::addData): Ditto.
1707         (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
1708         (WebCore::ParentalControlsContentFilter::needsMoreData): Ditto.
1709         (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
1710         (WebCore::ParentalControlsContentFilter::getReplacementData): Ditto.
1711         (WebCore::ParentalControlsContentFilter::unblockHandler): Ditto.
1712         * platform/mac/ContentFilterMac.mm:
1713         (WebCore::contentFilterType): Added a helper function template that creates a new ContentFilterType.
1714         (WebCore::contentFilterTypes): Registered a ContentFilterType for each type of content filter.
1715         (WebCore::ContentFilter::createIfNeeded): Created a ContentFilterCollection containing each content filter that can handle the given response.
1716         (WebCore::ContentFilterCollection::ContentFilterCollection): Constructs a ContentFilterCollection given a Vector of content filters.
1717         (WebCore::ContentFilterCollection::addData): Forwarded the call to each content filter in m_contentFilters.
1718         (WebCore::ContentFilterCollection::finishedAddingData): Ditto.
1719         (WebCore::ContentFilterCollection::needsMoreData): Ditto.
1720         (WebCore::ContentFilterCollection::didBlockData): Ditto.
1721         (WebCore::ContentFilterCollection::getReplacementData): Returned replacement data for the first filter that blocked the load.
1722         If no filter blocked the load, returned the first filter's replacement data.
1723         (WebCore::ContentFilterCollection::unblockHandler): Returned the unblock handler for the first filter that blocked the load.
1724         (WebCore::ContentFilter::ContentFilter): Deleted.
1725         (WebCore::ContentFilter::~ContentFilter): Deleted.
1726         (WebCore::ContentFilter::canHandleResponse): Deleted.
1727         (WebCore::ContentFilter::addData): Deleted.
1728         (WebCore::ContentFilter::finishedAddingData): Deleted.
1729         (WebCore::ContentFilter::needsMoreData): Deleted.
1730         (WebCore::ContentFilter::didBlockData): Deleted.
1731         (WebCore::ContentFilter::getReplacementData): Deleted.
1732         (WebCore::ContentFilter::unblockHandler): Deleted.
1733
1734 2015-03-04  David Kilzer  <ddkilzer@apple.com>
1735
1736         Switch remaining CoreMedia soft-linking in WebCore over to CoreMediaSoftLink.{cpp,h}
1737         <http://webkit.org/b/141870>
1738
1739         Reviewed by Alex Christensen.
1740
1741         * Configurations/WebCore.unexp:
1742         - Remove all weak symbols for CoreMedia.framework as they should
1743           no longer appear.
1744
1745         * Modules/plugins/QuickTimePluginReplacement.mm:
1746         * platform/graphics/avfoundation/MediaTimeAVFoundation.cpp:
1747         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1748         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1749         - Clean up headers.
1750
1751         * platform/cf/CoreMediaSoftLink.cpp:
1752         * platform/cf/CoreMediaSoftLink.h:
1753         - Add soft-link functions and constants from remaining source
1754           files.
1755
1756         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1757         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1758         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1759         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1760         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1761         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1762         * platform/mac/PlatformClockCM.mm:
1763         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1764         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1765         - Switch to using CoreMediaSoftLink.h.
1766
1767         * platform/mac/SoftLinking.h:
1768         * platform/win/SoftLinking.h:
1769         - Remove 'const' from SOFT_LINK_CONSTANT_{HEADER,SOURCE}()
1770           macros since it won't work with const structs.
1771
1772         * platform/spi/cf/CoreMediaSPI.h:
1773         - Add SPI declarations for Windows originally from
1774           InbandTextTrackPrivateAVF.cpp.
1775
1776 2015-03-04  Commit Queue  <commit-queue@webkit.org>
1777
1778         Unreviewed, rolling out r181001 and r181003.
1779         https://bugs.webkit.org/show_bug.cgi?id=142307
1780
1781         Broke many tests (Requested by ap on #webkit).
1782
1783         Reverted changesets:
1784
1785         "Make JavaScript binding get and set legacy event listener
1786         attributes directly"
1787         https://bugs.webkit.org/show_bug.cgi?id=142282
1788         http://trac.webkit.org/changeset/181001
1789
1790         "Update bindings tests after r181001."
1791         http://trac.webkit.org/changeset/181003
1792
1793 2015-03-04  Roger Fong  <roger_fong@apple.com>
1794
1795         Update elapsed/remaining time displays on media inline controls on OSX.
1796         https://bugs.webkit.org/show_bug.cgi?id=142264.
1797         <rdar://problem/19997487>
1798
1799         Reviewed by Dean Jackson.
1800
1801         Div surrounding times are set widths. A larger width is used for times that are
1802         an hour or longer. Time elapsed is right justified. Time remaining is left justified.
1803         Times are displayed in 11pt Helvetica Neue.
1804         * Modules/mediacontrols/mediaControlsApple.css:
1805         (audio::-webkit-media-controls-time-remaining-display):
1806         (audio::-webkit-media-controls-current-time-display):
1807         (audio::-webkit-media-controls-time-remaining-display.hour-long-time):
1808         (audio::-webkit-media-controls-current-time-display.hour-long-time):
1809         (audio::-webkit-media-controls-time-remaining-display.ten-hour-long-time):
1810         (audio::-webkit-media-controls-current-time-display.ten-hour-long-time):
1811         * Modules/mediacontrols/mediaControlsApple.js:
1812         (Controller.prototype.updateDuration):
1813
1814 2015-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
1815
1816         Implement -apple-trailing-word: -apple-partially-balanced
1817         https://bugs.webkit.org/show_bug.cgi?id=142253
1818
1819         Reviewed by David Hyatt.
1820
1821         This patch implements a history mechanism for line breaking. In particular, this patch partitions
1822         the updates to the current line breaking location into two kinds: conceptually new breaking locations,
1823         and fixups to existing locations. Then, this patch remembers all the fixed up breaking locations, up
1824         to a maximum number of remembered locations.
1825
1826         The patch then uses this memory to change the line-breaking selection based on the rules of
1827         -apple-trailing-word.
1828
1829         Test: fast/text/trailing-word.html
1830
1831         * rendering/line/BreakingContextInlineHeaders.h:
1832         Use InlineIteratorHistory as a proxy for the current breaking location. Note that all these functions
1833         are inlined, so the overhead should be next to nothing when -apple-trailing-word is not in use.
1834         (WebCore::BreakingContext::BreakingContext): Use InlineIteratorHistory instead of InlineIterator
1835         (WebCore::BreakingContext::lineBreak): Ditto.
1836         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine): Ditto
1837         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Ditto
1838         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Keeps track of historical
1839         breaking locations
1840         (WebCore::BreakingContext::InlineIteratorHistory::push): Remember a new breaking location
1841         (WebCore::BreakingContext::InlineIteratorHistory::update): Update an existing breaking location
1842         (WebCore::BreakingContext::InlineIteratorHistory::renderer): Forwarded to the current breaking location
1843         (WebCore::BreakingContext::InlineIteratorHistory::offset): Ditto
1844         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):  Ditto
1845         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode): Ditto
1846         (WebCore::BreakingContext::InlineIteratorHistory::get): Get one of the remembered breaking locations
1847         (WebCore::BreakingContext::InlineIteratorHistory::current): Get the current breaking location
1848         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
1849         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Forwarded to the current breaking location.
1850         (WebCore::BreakingContext::InlineIteratorHistory::increment): Ditto
1851         (WebCore::BreakingContext::InlineIteratorHistory::clear): Ditto
1852         (WebCore::BreakingContext::handleBR): Use InlineIteratorHistory instead of InlineIterator
1853         (WebCore::BreakingContext::handleFloat): Ditto
1854         (WebCore::BreakingContext::handleText): Use InlineIteratorHistory instead of InlineIterator
1855         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Style
1856         (WebCore::checkMidpoints): Use InlineIteratorHistory instead of InlineIterator
1857         (WebCore::BreakingContext::handleEndOfLine): If -apple-trailing-word is in effect, use
1858         optimalLineBreakLocationForTrailingWord().
1859         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Use the remembered breaking
1860         locations and choose the optimal one.
1861         (WebCore::BreakingContext::lineBreakRef): Deleted.
1862
1863 2015-03-04  Timothy Horton  <timothy_horton@apple.com>
1864
1865         <attachment> title text disappears when dragging
1866         https://bugs.webkit.org/show_bug.cgi?id=142263
1867         <rdar://problem/20035515>
1868
1869         Reviewed by Sam Weinig.
1870
1871         * rendering/RenderThemeMac.mm:
1872         (WebCore::RenderThemeMac::paintAttachment):
1873         We use NSColors with CoreText, which requires that Cocoa knows the current
1874         CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
1875         Otherwise, sometimes (especially when dragging), it will try to apply the
1876         text foreground color to a null context, complain to the system log, and fail
1877         to render the text.
1878
1879 2015-03-04  Jer Noble  <jer.noble@apple.com>
1880
1881         [Mac] YouTube playback at 1.5x speed has audible distortion
1882         https://bugs.webkit.org/show_bug.cgi?id=142280
1883
1884         Reviewed by Eric Carlson.
1885
1886         Use the high-quality AVAudioTimePitchAlgorithmSpectral algorithm for the 
1887         AVSampleBufferAudioRenderer rather than its default value of 
1888         AVAudioTimePitchAlgorithmTimeDomain.
1889
1890         Drive-by fix:
1891
1892         Might as well add support for MediaPlayer::setPreservesPitch() while we're
1893         changing the audio pitch algorithm. If preservesPitch() is false use the
1894         AVAudioTimePitchAlgorithmVarispeed algorithm in both AVFObjC-based media players
1895         (MediaPlayerPrivateAVFoundationObjC & MediaPlayerPrivateMediaSourceAVFObjC).
1896
1897         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1898         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1899         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1900         (WebCore::MediaPlayerPrivateAVFoundationObjC::setPreservesPitch):
1901         (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): Deleted.
1902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1903         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1904         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
1905         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer):
1906
1907 2015-03-04  Jer Noble  <jer.noble@apple.com>
1908
1909         [MSE][EME][Mac] Calling close on a MediaKeysSession will cause many decoding errors to be emitted
1910         https://bugs.webkit.org/show_bug.cgi?id=142285
1911
1912         Reviewed by Eric Carlson.
1913
1914         When a MediaKeySession (backed by CDMSessionMediaSourceAVFObjC) is closed and the
1915         underlying AVStreamSession is invalidated, the decryption context for in-flight
1916         CMSampleBuffers is also invalidated, and the AVSampleBufferDisplayLayer will issue
1917         one error for each enqueued and un-displayed sample in its image-queue. -flush-ing
1918         the AVSampleBufferDisplayLayer is not enough, as the flush only takes effect
1919         asynchronously the next time the layer needs new samples.
1920
1921         Add a workaround until framework-level support lands to fully flush enqueued and
1922         encrypted frames.
1923
1924         When the CDMSessionMediaSOurceAVFObjC object recieves an error from the layer,
1925         check to see if the session has been stopped. If so, and if the error in question is
1926         one that indicates that the samples decryption context has been invalidated, suppress
1927         the error and instruct the sender to suppress the error as well. This workaround will
1928         be removed once real support for synchronous flushing lands in <rdar://problem/20027434.>
1929
1930         Still, we'll make our best effort to flush undisplayed frames when our CDM session is
1931         invalidated. Move away from std::map and instead use HashMap to store the set of 
1932         AVSampleBufferAudioRenderers. This allows us to use C++11 style loops against just
1933         the HashMap's set of values.
1934
1935         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1936         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1937         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys): Flush and set m_stopped.
1938         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError): Check m_stopped and the
1939             error code and bail before issuing the error.
1940         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError): Ditto.
1941         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1942         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1943         (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): Drive-by fix. Check whether
1944             the layer is in the set of listened-to layers only back in the main thread; the
1945             listnener may have been unregistered by the time the main thread was called.
1946         (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): std::map -> HashMap.
1947         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): Ditto.
1948         (WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples): Ditto.
1949         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
1950         (WebCore::SourceBufferPrivateAVFObjC::isReadyForMoreSamples): Ditto.
1951         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples): Ditto.
1952         (WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples): Ditto.
1953         (WebCore::SourceBufferPrivateAVFObjC::flush): Added; call -flush on all the display
1954             layers and audio renderers.
1955         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError): Check if any clients
1956             asked to ignore the error, and if so, bail.
1957         (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Ditto.
1958
1959 2015-03-04  Alex Christensen  <achristensen@webkit.org>
1960
1961         Update bindings tests after r181001.
1962
1963         * bindings/scripts/test/JS/*.cpp:
1964         Class names changed to auto.
1965
1966 2015-03-04  Brent Fulgham  <bfulgham@apple.com>
1967
1968         [Win] Missing dependency checking in DerivedSources.make for FeatureDefines.props
1969         https://bugs.webkit.org/show_bug.cgi?id=142284
1970
1971         Reviewed by David Kilzer.
1972
1973         Make DerivedSources.make understand its build dependency on FeatureDefines.props
1974         when building on Windows:
1975         1. Modify DerivedSources.make to declare a default dependency (on Windows)
1976            to $(WEBKIT_LIBRARIES)/tools/vsprops/FeatureDefines.props.
1977         2. Update the Windows script 'build-generated-files.pl' to specify the correct
1978            FeatureDefines{Cairo}.props value to use, depending on build environment.
1979
1980         * DerivedSources.make:
1981         * WebCore.vcxproj/build-generated-files.pl:
1982
1983 2015-03-04  Darin Adler  <darin@apple.com>
1984
1985         Make JavaScript binding get and set legacy event listener attributes directly
1986         https://bugs.webkit.org/show_bug.cgi?id=142282
1987
1988         Reviewed by Sam Weinig.
1989
1990         Test: fast/dom/legacy-event-handler-attributes.html
1991
1992         This patch changes the JavaScript getters and setters for these attributes
1993         to work directly without requiring any functions in the C++ DOM implementation.
1994         A subsequent patch will remove the now-unused C++ DOM implementation.
1995
1996         * bindings/js/JSEventListener.cpp:
1997         (WebCore::legacyEventListenerAttribute): Added.
1998         (WebCore::createEventListenerForLegacyAttribute): Added.
1999         (WebCore::setLegacyEventListenerAttribute): Added.
2000         (WebCore::legacyWindowEventListenerAttribute): Added.
2001         (WebCore::setLegacyWindowEventListenerAttribute): Added.
2002
2003         * bindings/js/JSEventListener.h:
2004         (WebCore::createJSEventListenerForAttribute): Deleted.
2005
2006         * bindings/scripts/CodeGeneratorJS.pm:
2007         (GenerateAttributeEventListenerCall): Deleted.
2008         (LegacyEventListenerAttributeEventName): Added.
2009         (LegacyEventListenerAttributePrefix): Added.
2010         (GenerateImplementation): Use "auto" in lots of places to simplify the code
2011         generation. Replaced the old inlined code to deal with legacy event listener
2012         attributes with code that simply calls the new functions from JSEventLister.h.
2013         (GenerateCallWith): Use "auto".
2014         (GenerateConstructorDefinition): Ditto.
2015
2016 2015-03-03  Sam Weinig  <sam@webkit.org>
2017
2018         [Content Extensions] Split parsing and compiling of content extensions into their own files
2019         https://bugs.webkit.org/show_bug.cgi?id=142259
2020
2021         Reviewed by Anders Carlsson.
2022
2023         Added new unit test:
2024             ContentFilterTest.Basic
2025
2026         * WebCore.xcodeproj/project.pbxproj:
2027         Add new files (CompiledContentExtension.h/cpp, ContentExtensionCompiler.h/cpp, and ContentExtensionParser.h/cpp)
2028
2029         * contentextensions/CompiledContentExtension.cpp: Added.
2030         * contentextensions/CompiledContentExtension.h: Added.
2031         Add new class for holding onto the compiled content extension itself. Make it ThreadSafeRefCounted so it is easy
2032         to move between threads which will be important in a subsequent patch where we enable compilation on a background
2033         thread.
2034
2035         * contentextensions/ContentExtensionCompiler.cpp: Added.
2036         (WebCore::ContentExtensions::serializeActions):
2037         (WebCore::ContentExtensions::compileRuleList):
2038         * contentextensions/ContentExtensionCompiler.h: Added.
2039         Moving compilation to its own file. Was previously in ContentExtensionsBackend. This is necessary because
2040         we will want to be able to compile without the need of a backend.
2041
2042         * contentextensions/ContentExtensionParser.cpp: Copied from contentextensions/ContentExtensionsManager.cpp.
2043         * contentextensions/ContentExtensionParser.h: Copied from contentextensions/ContentExtensionsManager.h.
2044         Renamed ContentExtensionsManager to ContentExtensionParser, since that is all it is doing.
2045
2046         * contentextensions/ContentExtensionsBackend.cpp:
2047         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
2048         (WebCore::ContentExtensions::ContentExtensionsBackend::removeContentExtension):
2049         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllContentExtensions):
2050         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
2051         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions): Deleted.
2052         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList): Deleted.
2053         (WebCore::ContentExtensions::ContentExtensionsBackend::removeRuleList): Deleted.
2054         (WebCore::ContentExtensions::ContentExtensionsBackend::removeAllRuleLists): Deleted.
2055         * contentextensions/ContentExtensionsBackend.h:
2056         Change the backend to use the new CompiledContentExtension and change the terminology to
2057         reference content extensions, rather than rule lists.
2058
2059         * page/UserContentController.cpp:
2060         (WebCore::UserContentController::addUserContentFilter):
2061         (WebCore::UserContentController::removeUserContentFilter):
2062         (WebCore::UserContentController::removeAllUserContentFilters):
2063         Update for new names and change addUserContentFilter to explicitly compile the JSON
2064         rule list before handing it to the backend. In subsequent changes, addUserContentFilter
2065         should be changed to take the compiled content extension, and it should become the responsibility
2066         of the called (WebKit) to create them.
2067
2068 2015-03-04  Philippe Normand  <pnormand@igalia.com>
2069
2070         [GStreamer] the GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED should be wrapped by a ifdef
2071         https://bugs.webkit.org/show_bug.cgi?id=142274
2072
2073         Reviewed by Carlos Garcia Campos.
2074
2075         Don't handle scheduling queries if building against versions of
2076         GStreamer older than 1.2.0.
2077
2078         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2079         (webKitWebSrcQueryWithParent):
2080
2081 2015-03-03  Yoav Weiss  <yoav@yoav.ws>
2082
2083         Add a microtask abstraction
2084         https://bugs.webkit.org/show_bug.cgi?id=137496
2085
2086         Reviewed by Sam Weinig.
2087
2088         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
2089         That abstraction is required in order to enable async loading of images,
2090         which is in turn required to enable support for the picture element, as well as
2091         to make sure that the order of properties set on HTMLImageElement has no implications.
2092
2093         A similar patch was rolled back in r180914. This patch is an improved version.
2094
2095         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
2096         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
2097         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
2098         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
2099         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
2100         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
2101         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
2102         (WebCore::MicroTask::~MicroTask):
2103         (WebCore::MicroTask::run): Run the microtask.
2104         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
2105         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
2106         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
2107         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
2108         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
2109         (WebCore::ScriptRunner::timerFired):
2110         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
2111         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2112         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
2113         (WebCore::HTMLScriptRunner::runScript):
2114         * testing/Internals.cpp: Add a method to queue a test microtask.
2115         (WebCore::Internals::queueMicroTask):
2116         * testing/Internals.h: Add a method to queue a test microtask.
2117         (WebCore::Internals::queueMicroTask):
2118         * testing/Internals.idl: Expose test microtask queueing to test JS.
2119         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
2120         (WebCore::MicroTaskTest::run): Run the microtask
2121         (WebCore::MicroTaskTest::create): Create a test microtask.
2122         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
2123         (WebCore::MicroTaskTest::run):
2124         (WebCore::MicroTaskTest::create):
2125
2126 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
2127
2128         Scroll snap points are not supported on the main frame
2129         https://bugs.webkit.org/show_bug.cgi?id=141973
2130         <rdar://problem/19938393>
2131
2132         Reviewed by Simon Fraser.
2133
2134         No new tests. Tests will be added when the animation behavior is finalized. Manual tests are attached to the bug.
2135
2136         Update the ScrollingTreeFrameScrollingNodeMac class to implement the delegate interface needed by the
2137         ScrollController. This involves the following:
2138         1. Implement scrollOffsetOnAxis: Used by the AxisScrollAnimator to determine the current position of the ScrollableArea.
2139         2. Implement immediateScrollOnAxis: Used by the AxisScrollAnimator to scroll the ScrollableArea
2140
2141         We also need to hold a copy of the snap points vector to send to the scrolling thread.
2142
2143         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2144         (WebCore::convertToLayoutUnits): Added helper function to match Scroll Snap Points API.
2145         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): Recognize and react to changes to
2146         Scroll Snap Points on top-level frames.
2147         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Implement delegate method needed by the ScrollController.
2148         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
2149         * platform/cocoa/ScrollController.h:
2150         * platform/cocoa/ScrollController.mm:
2151         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Pass snap offsets to AxisScrollSnapAnimator constructor as references.
2152         (WebCore::ScrollController::updateScrollSnapPoints): Added. Used by ScrollingTreeFrameScrollingNodeMac to update scroll snap point
2153         settings in the scrolling thread.
2154         * platform/mac/AxisScrollSnapAnimator.h:
2155         * platform/mac/AxisScrollSnapAnimator.mm:
2156         (WebCore::toWheelEventStatus): Don't ignore the "MayBegin" or "Cancelled" event phases.
2157         (WebCore::AxisScrollSnapAnimator::AxisScrollSnapAnimator): Revise signature to take a reference to the layout units.
2158         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Handle the case where this method gets called from a thread
2159         when the scrollable area has already reached its final destination.
2160         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Handle the possibility that the snap offset point vector might be
2161         empty. Update method to account for m_snapOffsets being a value, instead of a pointer.
2162
2163 2015-03-03  Andy Estes  <aestes@apple.com>
2164
2165         [Content Filtering] Separate unblock handling into its own class
2166         https://bugs.webkit.org/show_bug.cgi?id=142251
2167
2168         Reviewed by Andreas Kling.
2169
2170         Unblock handling is currently supported only for one type of content filter (WebFilterEvaluator) on one
2171         platform (iOS). Having its implementation in ContentFilter is making it difficult to support other filters and
2172         platforms, so let's separate unblock handling into its own class called ContentFilterUnblockHandler.
2173
2174         * WebCore.xcodeproj/project.pbxproj:
2175         * loader/DocumentLoader.cpp:
2176         (WebCore::DocumentLoader::finishedLoading): Passed a ContentFilterUnblockHandler to FrameLoaderClient::contentFilterDidBlockLoad.
2177         (WebCore::DocumentLoader::dataReceived): Ditto.
2178         * loader/FrameLoaderClient.h:
2179         * platform/ContentFilter.h:
2180         * platform/ContentFilterUnblockHandler.h: Copied from Source/WebCore/platform/ios/ContentFilterIOS.mm.
2181         (WebCore::ContentFilterUnblockHandler::clear):
2182         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: Renamed from Source/WebCore/platform/ios/ContentFilterIOS.mm.
2183         (WebCore::ContentFilterUnblockHandler::ContentFilterUnblockHandler):
2184         (WebCore::ContentFilterUnblockHandler::encode):
2185         (WebCore::ContentFilterUnblockHandler::decode):
2186         (WebCore::scheme):
2187         (WebCore::ContentFilterUnblockHandler::handleUnblockRequestAndDispatchIfSuccessful):
2188         * platform/mac/ContentFilterMac.mm:
2189         (WebCore::ContentFilter::unblockHandler):
2190         (WebCore::ContentFilter::ContentFilter): Deleted.
2191         (WebCore::ContentFilter::encode): Deleted.
2192         (WebCore::ContentFilter::decode): Deleted.
2193
2194 2015-03-03  Alexey Proskuryakov  <ap@apple.com>
2195
2196         [Mac] Track localized name follows locale instead of primary language
2197         https://bugs.webkit.org/show_bug.cgi?id=142242
2198         rdar://problem/20000365
2199
2200         Reviewed by Eric Carlson.
2201
2202         * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::trackDisplayName): Use the
2203         language for localization, as CFBundle does.
2204
2205 2015-03-03  Alex Christensen  <achristensen@webkit.org>
2206
2207         [Win] Unreviewed build fix.
2208
2209         * WebCore.vcxproj/WebCoreIncludeCommon.props:
2210         Include contentextensions subdirectory.
2211
2212 2015-03-03  Alex Christensen  <achristensen@webkit.org>
2213
2214         Prepare to use CSS selectors in content extensions.
2215         https://bugs.webkit.org/show_bug.cgi?id=142227
2216
2217         Reviewed by Benjamin Poulain.
2218
2219         Test: http/tests/usercontentfilter/css-display-none.html
2220
2221         * CMakeLists.txt:
2222         * WebCore.xcodeproj/project.pbxproj:
2223         * contentextensions/ContentExtensionActions.h: Added.
2224         * contentextensions/ContentExtensionRule.cpp:
2225         (WebCore::ContentExtensions::Action::deserialize):
2226         * contentextensions/ContentExtensionRule.h:
2227         (WebCore::ContentExtensions::Action::Action):
2228         (WebCore::ContentExtensions::Action::type):
2229         (WebCore::ContentExtensions::Action::cssSelector):
2230         * contentextensions/ContentExtensionsBackend.cpp:
2231         (WebCore::ContentExtensions::ContentExtensionsBackend::serializeActions):
2232         Put action descriptions into a compact format in a Vector 
2233         to be able to be put into one block of shared read-only memory.
2234         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
2235         Put an index of the beginning of the description into the NFA instead of the index of the rule
2236         because we will be sharing the descriptions of the actions and not the rules.
2237         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
2238         (WebCore::ContentExtensions::ContentExtensionsBackend::actionForURL): Deleted.
2239         Return a vector of actions to be able to do multiple actions for one URL.
2240         * contentextensions/ContentExtensionsBackend.h:
2241         * contentextensions/ContentExtensionsManager.cpp:
2242         (WebCore::ContentExtensions::ExtensionsManager::loadTrigger):
2243         (WebCore::ContentExtensions::ExtensionsManager::loadAction):
2244         Added the css-display-none action type, which requires a selector.
2245         (WebCore::ContentExtensions::ExtensionsManager::loadRule):
2246         * loader/cache/CachedResourceLoader.cpp:
2247         (WebCore::CachedResourceLoader::requestResource):
2248         * page/UserContentController.cpp:
2249         (WebCore::UserContentController::actionsForURL):
2250         (WebCore::UserContentController::actionForURL): Deleted.
2251         * page/UserContentController.h:
2252
2253 2015-03-03  Brent Fulgham  <bfulgham@apple.com>
2254
2255         Move scroll animating functions from ScrollAnimator to ScrollController
2256         https://bugs.webkit.org/show_bug.cgi?id=142102
2257         <rdar://problem/20007161>
2258
2259         Reviewed by Simon Fraser.
2260
2261         Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html.
2262
2263         Do some refactoring of the various scrolling classes:
2264         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
2265            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
2266         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
2267         3. Move code from ScrollAnimator{Mac} -> ScrollController.
2268         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
2269         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
2270
2271         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
2272         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
2273         events, just as is done for the "event not handled" case in EventHandler.cpp. 
2274         (WebCore::EventHandler::platformCompleteWheelEvent):
2275         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
2276         methods, now that ScrollController is controlling this state.
2277         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2278         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
2279         need to clean up the CFRunLoopTimer.
2280         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Make sure scroll
2281         state is updated after rubber band snap.
2282         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
2283         until Bug1973 is completed.).
2284         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
2285         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
2286         * platform/ScrollAnimator.cpp:
2287         (WebCore::ScrollAnimator::ScrollAnimator):
2288         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
2289         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
2290         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
2291         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
2292         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
2293         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
2294         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
2295         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
2296         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
2297         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
2298         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
2299         * platform/ScrollAnimator.h:
2300         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
2301         (WebCore::ScrollControllerClient::startSnapRubberbandTimer):
2302         (WebCore::ScrollControllerClient::stopSnapRubberbandTimer):
2303         (WebCore::ScrollControllerClient::startScrollSnapTimer):
2304         (WebCore::ScrollControllerClient::stopScrollSnapTimer):
2305         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
2306         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
2307         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
2308         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
2309         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
2310         require client to maintain timers.
2311         (WebCore::ScrollController::snapRubberBand): Ditto.
2312         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
2313         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
2314         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
2315         (WebCore::ScrollController::stopScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
2316         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
2317         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
2318         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
2319         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
2320         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
2321         * platform/mac/AxisScrollSnapAnimator.mm:
2322         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): Update for 'InAxis' to 'OnAxis' renaming.
2323         (WebCore::AxisScrollSnapAnimator::scrollSnapAnimationUpdate): Ditto.
2324         (WebCore::AxisScrollSnapAnimator::beginScrollSnapAnimation): Ditto.
2325         (WebCore::AxisScrollSnapAnimator::computeSnapDelta): Ditto.
2326         (WebCore::AxisScrollSnapAnimator::computeGlideDelta): Ditto.
2327         * platform/mac/ScrollAnimatorMac.h:
2328         * platform/mac/ScrollAnimatorMac.mm:
2329         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
2330         controlled in the ScrollController)
2331         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
2332         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
2333         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
2334         * platform/mac/ScrollController.h: Removed.
2335         * platform/mac/ScrollController.mm: Removed.
2336
2337 2015-03-03  Commit Queue  <commit-queue@webkit.org>
2338
2339         Unreviewed, rolling out r180683.
2340         https://bugs.webkit.org/show_bug.cgi?id=142249
2341
2342         Broke fast/css/acid2-pixel.html (Requested by ap on #webkit).
2343
2344         Reverted changeset:
2345
2346         "Setting any of the <object> element plugin controlling
2347         attributes does not have any affect."
2348         https://bugs.webkit.org/show_bug.cgi?id=141936
2349         http://trac.webkit.org/changeset/180683
2350
2351 2015-03-03  Dean Jackson  <dino@apple.com>
2352
2353         Controls panel should have system blurry background
2354         https://bugs.webkit.org/show_bug.cgi?id=142154
2355         <rdar://problem/20000964>
2356
2357         Reviewed by Simon Fraser.
2358
2359         In order to replicate the system style of media controls
2360         on OS X and iOS, we need to expose a special -webkit-appearance.
2361         This patch adds the new property value, and implements
2362         the iOS part of the appearance, which is a blurry shaded
2363         background.
2364
2365         Test: compositing/media-controls-bar-appearance.html
2366
2367         * css/CSSPrimitiveValueMappings.h:
2368         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Map the new
2369         keywords from ControlParts.
2370
2371         * css/CSSValueKeywords.in: Add media-controls-light-bar-background
2372         and media-controls-dark-bar-background. Darin suggested they
2373         be sorted, so I did this at the same time.
2374         * platform/ThemeTypes.h: New ControlParts for the values, and
2375         sort the values since they need to be in sync with
2376         CSSValueKeywords.in.
2377
2378         * platform/graphics/GraphicsLayer.h: Expose two new custom appearance
2379         values.
2380         * platform/graphics/ca/GraphicsLayerCA.cpp:
2381         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2382         (WebCore::layerTypeForCustomBackdropAppearance): Helper function.
2383         (WebCore::isCustomBackdropLayerType): Ditto.
2384         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Merge setting
2385         a system backdrop layer in with the code that swaps to/from tiled layers.
2386         (WebCore::GraphicsLayerCA::changeLayerTypeTo): New method that does what
2387         swapFromOrToTiledLayer implemented, but also allows us to change to a
2388         system backdrop layer.
2389         (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): Deleted.
2390         * platform/graphics/ca/GraphicsLayerCA.h:
2391
2392         * platform/graphics/ca/PlatformCALayer.h: New layer types.
2393         * platform/graphics/ca/mac/PlatformCALayerMac.mm: For now expose these
2394         as regular backdrop layers.
2395         (PlatformCALayerMac::PlatformCALayerMac):
2396         (PlatformCALayerMac::updateCustomAppearance):
2397
2398         * rendering/RenderLayerBacking.cpp:
2399         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): Make sure to update
2400         custom appearance,
2401         (WebCore::RenderLayerBacking::updateCustomAppearance): New method.
2402         * rendering/RenderLayerBacking.h:
2403
2404 2015-03-03  Chris Dumez  <cdumez@apple.com>
2405
2406         Access ApplicationCacheStorage global instance via singleton() static member function
2407         https://bugs.webkit.org/show_bug.cgi?id=142239
2408
2409         Reviewed by Anders Carlsson.
2410
2411         Access ApplicationCacheStorage global instance via singleton() static
2412         member function as per WebKit coding style.
2413
2414 2015-03-03  Anders Carlsson  <andersca@apple.com>
2415
2416         Try to fix the build.
2417
2418         * platform/spi/cf/CFNetworkSPI.h:
2419
2420 2015-03-03  Timothy Horton  <timothy_horton@apple.com>
2421
2422         <attachment> label can get very wide, doesn't wrap/truncate
2423         https://bugs.webkit.org/show_bug.cgi?id=142214
2424         <rdar://problem/19982499>
2425
2426         Reviewed by Simon Fraser.
2427
2428         Test: fast/attachment/attachment-label-highlight.html
2429
2430         * rendering/RenderThemeMac.h:
2431         * rendering/RenderThemeMac.mm:
2432         (WebCore::labelTextColorForAttachment):
2433         (WebCore::AttachmentLayout::addLine):
2434         (WebCore::AttachmentLayout::layOutText):
2435         (WebCore::AttachmentLayout::AttachmentLayout):
2436         Make it possible to lay out multiple lines of label text.
2437         We lay out the whole string normally, but then only draw N (where N=1 for now,
2438         but is adjustable) of the lines. The remainder of the string is then
2439         merged into a single line, which is middle-truncated with an ellipsis
2440         and drawn in place of the N+1 line.
2441
2442         (WebCore::addAttachmentLabelBackgroundRightCorner):
2443         (WebCore::addAttachmentLabelBackgroundLeftCorner):
2444         (WebCore::paintAttachmentLabelBackground):
2445         Wrap the label background around the multiple lines of text with curved edges.
2446         We run first down the right side of the label, determining whether to use
2447         concave or convex arcs based on the relative widths of adjacent lines.
2448         Then, we run back up the left side of the label doing the same thing.
2449
2450         If the background rects of two lines are very similar (within the rounded rect radius),
2451         they will be expanded to the larger of the two, because otherwise the arcs
2452         look quite wrong.
2453
2454         (WebCore::paintAttachmentLabel):
2455         Draw the label with CoreText directly instead of bothering with WebCore
2456         text layout primitives. There's no need, and it makes wrapping much more complicated.
2457
2458         (WebCore::RenderThemeMac::paintAttachment):
2459         (WebCore::RenderThemeMac::paintAttachmentLabelBackground): Deleted.
2460         (WebCore::RenderThemeMac::paintAttachmentLabel): Deleted.
2461
2462 2015-03-03  Simon Fraser  <simon.fraser@apple.com>
2463
2464         Avoid applying the clip-path when painting, if a layer also has a shape layer mask
2465         https://bugs.webkit.org/show_bug.cgi?id=142212
2466
2467         Reviewed by Zalan Bujtas.
2468
2469         After r180882 we translate clip-path into a composited shape mask when the layer
2470         is composited. However, we were also still applying the clip-path when painting
2471         the layer contents.
2472         
2473         Now, we set the GraphicsLayer bits GraphicsLayerPaintClipPath and GraphicsLayerPaintMask
2474         only for the m_maskLayer's painting. This translate into setting PaintLayerPaintingCompositingMaskPhase
2475         and PaintLayerPaintingCompositingClipPathPhase only when painting that same mask layer,
2476         rather than always. To ensure that masks and clip-path get applied for software paints,
2477         add shouldPaintMask() and shouldApplyClipPath() that return true for non-composited layers,
2478         and when doing a flattening paint.
2479
2480         * rendering/RenderLayer.cpp:
2481         (WebCore::RenderLayer::paintLayerContents): Use shouldApplyClipPath().
2482         Pull three chunks of code under a single "if (shouldPaintContent && !selectionOnly)" condition.
2483         The condition for paintChildClippingMaskForFragments() is changed slightly; we need to call this
2484         only when painting the clip-path/mask layer contents, but also only when there is no mask to fill
2485         the clipped area for us.
2486         (WebCore::RenderLayer::calculateClipRects):
2487         (WebCore::RenderLayer::paintsWithClipPath): Deleted.
2488         * rendering/RenderLayer.h:
2489         * rendering/RenderLayerBacking.cpp:
2490         (WebCore::RenderLayerBacking::updateMaskingLayer): Be sure to set the GraphicsLayerPaintClipPath bit
2491         when having a mask forces us onto the painting path.
2492
2493 2015-03-03  Anders Carlsson  <andersca@apple.com>
2494
2495         Use the correct display name for website data for local files
2496         https://bugs.webkit.org/show_bug.cgi?id=142228
2497
2498         Reviewed by Dan Bernstein.
2499
2500         * English.lproj/Localizable.strings:
2501         Add local file display name.
2502
2503         * platform/spi/cf/CFNetworkSPI.h:
2504         Add kCFHTTPCookieLocalFileDomain declaration.
2505
2506 2015-03-03  Myles C. Maxfield  <mmaxfield@apple.com>
2507
2508         BreakingContext cleanup
2509         https://bugs.webkit.org/show_bug.cgi?id=142146
2510
2511         Reviewed by Dean Jackson.
2512
2513         1. Use commitLineBreakAtCurrentWidth() instead of directly
2514         updating m_width and m_lineBreak, because the name makes the
2515         intent clearer.
2516         2. Remove duplicate function LineBreaker::nextSegmentBreak().
2517         3. lineStyle() takes care of inspecting RenderText's parent's
2518         style.
2519         4. Add FIXME to BreakingContext::initializeForCurrentObject()
2520         because it seems like we are ignoring first-line style for
2521         some properties.
2522
2523         No new tests because there is no behavior change.
2524
2525         * rendering/line/BreakingContextInlineHeaders.h:
2526         (WebCore::BreakingContext::BreakingContext):
2527         (WebCore::BreakingContext::initializeForCurrentObject):
2528         (WebCore::BreakingContext::handleReplaced):
2529         (WebCore::BreakingContext::handleText):
2530         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2531         (WebCore::BreakingContext::handleEndOfLine):
2532         * rendering/line/LineBreaker.cpp:
2533         (WebCore::LineBreaker::nextLineBreak): Deleted.
2534         (WebCore::LineBreaker::nextSegmentBreak): Deleted.
2535         * rendering/line/LineBreaker.h:
2536         * rendering/line/LineInlineHeaders.h:
2537         (WebCore::lineStyle):
2538
2539 2015-03-03  Chris Dumez  <cdumez@apple.com>
2540
2541         Make AudioContext suspendable when it is not rendering
2542         https://bugs.webkit.org/show_bug.cgi?id=142210
2543         <rdar://problem/19923085>
2544
2545         Reviewed by Eric Carlson.
2546
2547         Make AudioContext suspendable when it is not rendering to increase the
2548         likelihood of entering the PageCache for pages using WebAudio.
2549
2550         This patch adds a state member to AudioContext with 3 possible states:
2551         Suspended / Running / Closed, as defined in the specification:
2552         http://webaudio.github.io/web-audio-api/#widl-AudioContext-state
2553
2554         This state is used to decide if we can suspend the page or not. We
2555         can safely suspend if the AudioContext's state is suspended (did not
2556         start rendering) or closed (Stopped rendering).
2557
2558         Note that this patch does not expose the AudioContext's state to the
2559         Web yet, even though it is exposed in the latest specification.
2560
2561         Tests: fast/history/page-cache-closed-audiocontext.html
2562                fast/history/page-cache-running-audiocontext.html
2563                fast/history/page-cache-suspended-audiocontext.html
2564
2565         * Modules/webaudio/AudioContext.cpp:
2566         (WebCore::AudioContext::AudioContext):
2567         (WebCore::AudioContext::uninitialize):
2568         (WebCore::AudioContext::canSuspend):
2569         (WebCore::AudioContext::startRendering):
2570         (WebCore::AudioContext::fireCompletionEvent):
2571         * Modules/webaudio/AudioContext.h:
2572
2573 2015-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2574
2575         [SOUP] Use SoupMessage::starting instead of SoupSession::request-started
2576         https://bugs.webkit.org/show_bug.cgi?id=142164
2577
2578         Reviewed by Sergio Villar Senin.
2579
2580         SoupSession::request-started is deprecated in libsoup 2.50. Both
2581         signals are equivalent, but SoupMessage::starting is also emitted
2582         for resources loaded from the disk cache. This fixes web timing
2583         calculations for cached resources, since we were not initializing
2584         m_requestStart.
2585
2586         * platform/network/soup/ResourceHandleSoup.cpp:
2587         (WebCore::startingCallback):
2588         (WebCore::createSoupMessageForHandleAndRequest):
2589         * platform/network/soup/SoupNetworkSession.cpp:
2590         (WebCore::SoupNetworkSession::SoupNetworkSession):
2591
2592 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2593
2594         [SOUP] Synchronous XMLHttpRequests can time out when we reach the max connections limit
2595         https://bugs.webkit.org/show_bug.cgi?id=141508
2596
2597         Reviewed by Sergio Villar Senin.
2598
2599         Use SOUP_MESSAGE_IGNORE_CONNECTION_LIMITS flag when loading a
2600         synchronous message instead of increasing the maximum number of
2601         connections allowed if the soup version is recent enough.
2602         The current solution of increasing/decreasing the limits doesn't
2603         always work, because connections are not marked as IDLE in libsoup
2604         until the message is unqueued, but we don't wait for the message
2605         to be unqueued to finish our loads in WebKit, we finish them as
2606         soon as we have finished reading the stream. This causes that
2607         synchronous loads keep blocked in the nested main loop until the
2608         timeout of 10 seconds is fired and the load fails.
2609         Also marked WebCoreSynchronousLoader class as final, the virtual
2610         methods as override and removed the unsused method isSynchronousClient.
2611
2612         * platform/network/soup/ResourceHandleSoup.cpp:
2613         (WebCore::createSoupMessageForHandleAndRequest):
2614         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
2615         (WebCore::WebCoreSynchronousLoader::isSynchronousClient): Deleted.
2616         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
2617         (WebCore::WebCoreSynchronousLoader::didReceiveData):
2618         (WebCore::WebCoreSynchronousLoader::didReceiveBuffer):
2619         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
2620         (WebCore::WebCoreSynchronousLoader::didFail):
2621         (WebCore::WebCoreSynchronousLoader::didReceiveAuthenticationChallenge):
2622         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage):
2623
2624 2015-03-02  David Kilzer  <ddkilzer@apple.com>
2625
2626         [iOS] Disable -Wdeprecated-declaration warnings in WebVideoFullscreenInterfaceAVKit.mm
2627
2628         Fixing the deprecations is tracked by: <rdar://problem/20018692>
2629
2630         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2631         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized):
2632         Ignore -Wdeprecated-declaration warnings via clang pragmas.
2633
2634 2015-03-02  Commit Queue  <commit-queue@webkit.org>
2635
2636         Unreviewed, rolling out r180902.
2637         https://bugs.webkit.org/show_bug.cgi?id=142205
2638
2639         It broke scrolling in some cases. See bug 142202 for details.
2640         (Requested by bdash on #webkit).
2641
2642         Reverted changeset:
2643
2644         "Move scroll animating functions from ScrollAnimator to
2645         ScrollController"
2646         https://bugs.webkit.org/show_bug.cgi?id=142102
2647         http://trac.webkit.org/changeset/180902
2648
2649 2015-03-02  Commit Queue  <commit-queue@webkit.org>
2650
2651         Unreviewed, rolling out r180911.
2652         https://bugs.webkit.org/show_bug.cgi?id=142204
2653
2654         The tests it added are crashing (Requested by bdash on
2655         #webkit).
2656
2657         Reverted changeset:
2658
2659         "Add a microtask abstraction"
2660         https://bugs.webkit.org/show_bug.cgi?id=137496
2661         http://trac.webkit.org/changeset/180911
2662
2663 2015-03-02  Yoav Weiss  <yoav@yoav.ws>
2664
2665         Add a microtask abstraction
2666         https://bugs.webkit.org/show_bug.cgi?id=137496
2667
2668         Reviewed by Sam Weinig.
2669
2670         This patch adds a microtask abstraction: https://html.spec.whatwg.org/multipage/webappapis.html#microtask
2671         That abstraction is required in order to enable async loading of images,
2672         which is in turn required to enable support for the picture element, as well as
2673         to make sure that the order of properties set on HTMLImageElement has no implications.
2674
2675         * WebCore.vcxproj/WebCore.vcxproj: Add MicroTask.{h,cpp} to the project.
2676         * WebCore.vcxproj/WebCoreTestSupport.vcxproj: Add MicroTaskTest.{h,cpp} to the project.
2677         * WebCore.vcxproj/WebCore.vcxproj.filters: Add MicroTask.{h,cpp} to the project.
2678         * WebCore.vcxproj/WebCoreTestSupport.vcxproj.filters: Add MicroTaskTest.{h,cpp} to the project.
2679         * WebCore.xcodeproj/project.pbxproj: Add MicroTask{,Test}.{h,cpp} to the project.
2680         * dom/Document.h: Add WEBCORE_EXPORT to addConsoleMessage, so it can be used in MicroTaskTest that's in WebCoreTestSupport..
2681         * dom/MicroTask.h: Add a MicroTask interface class. Add a MicroTaskQueue singleton.
2682         (WebCore::MicroTask::~MicroTask):
2683         (WebCore::MicroTask::run): Run the microtask.
2684         * dom/MicroTask.cpp: Implement the MicroTaskQueue singleton.
2685         (WebCore::MicroTaskQueue::singleton): Get a singleton instance of MicroTaskQueue.
2686         (WebCore::MicroTaskQueue::queueMicroTask): Add a microtask to the queue.
2687         (WebCore::MicroTaskQueue::runMicroTasks): Run all the microtasks in the queue and clear it.
2688         * dom/ScriptRunner.cpp: Trigger running of all microtasks in queue.
2689         (WebCore::ScriptRunner::timerFired):
2690         * html/parser/HTMLScriptRunner.cpp: Trigger running of all microtasks in queue.
2691         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2692         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
2693         (WebCore::HTMLScriptRunner::runScript):
2694         * testing/Internals.cpp: Add a method to queue a test microtask.
2695         (WebCore::Internals::queueMicroTask):
2696         * testing/Internals.h: Add a method to queue a test microtask.
2697         (WebCore::Internals::queueMicroTask):
2698         * testing/Internals.idl: Expose test microtask queueing to test JS.
2699         * testing/MicroTaskTest.cpp: Add a test class that implements a microtask and prints to the console when it runs.
2700         (WebCore::MicroTaskTest::run): Run the microtask
2701         (WebCore::MicroTaskTest::create): Create a test microtask.
2702         * testing/MicroTaskTest.h: Add a test class that implements a microtask.
2703         (WebCore::MicroTaskTest::run):
2704         (WebCore::MicroTaskTest::create):
2705
2706 2015-03-02  Jeremy Jones  <jeremyj@apple.com>
2707
2708         RenderVideo should not paint the video frame when video is fullscreen.
2709         https://bugs.webkit.org/show_bug.cgi?id=142097
2710
2711         Reviewed by Eric Carlson.
2712
2713         For performance and correctness, RenderVideo should not paint the current video frame
2714         inline when video is fullscreen. This happens when snapshots are taken and can have a
2715         negative performance impact.
2716
2717         * rendering/RenderVideo.cpp:
2718         (WebCore::RenderVideo::paintReplaced):
2719
2720 2015-03-02  Dean Jackson  <dino@apple.com>
2721
2722         [iOS Media] Airplay button should be blue when active
2723         https://bugs.webkit.org/show_bug.cgi?id=142193
2724
2725         Reviewed by Brent Fulgham.
2726
2727         Add a blue form of the Airplay button that is used
2728         when we are actively displaying on another screen.
2729
2730         * Modules/mediacontrols/mediaControlsiOS.css:
2731         (video::-webkit-media-controls-wireless-playback-picker-button):
2732         (video::-webkit-media-controls-wireless-playback-picker-button:active):
2733         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
2734         * Modules/mediacontrols/mediaControlsiOS.js:
2735         (ControllerIOS.prototype.updateWirelessPlaybackStatus):
2736
2737 2015-03-02  Brent Fulgham  <bfulgham@apple.com>
2738
2739         Move scroll animating functions from ScrollAnimator to ScrollController
2740         https://bugs.webkit.org/show_bug.cgi?id=142102
2741         <rdar://problem/20007161>
2742
2743         Reviewed by Simon Fraser.
2744
2745         No change in functionality.
2746         
2747         Do some refactoring of the various scrolling classes:
2748         1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
2749            and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
2750         2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
2751         3. Move code from ScrollAnimator{Mac} -> ScrollController.
2752         4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
2753         5. Rename immediateScrollInAxis -> immediateScrollOnAxis
2754
2755         * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
2756         * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
2757         events, just as is done for the "event not handled" case in EventHandler.cpp. 
2758         (WebCore::EventHandler::platformCompleteWheelEvent):
2759         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
2760         methods, now that ScrollController is controlling this state.
2761         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2762         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
2763         need to clean up the CFRunLoopTimer.
2764         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
2765         until Bug 141973 is completed.).
2766         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
2767         (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
2768         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
2769         * platform/ScrollAnimator.cpp:
2770         (WebCore::ScrollAnimator::ScrollAnimator):
2771         (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
2772         (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
2773         (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
2774         (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
2775         (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
2776         (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
2777         (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
2778         (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
2779         (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
2780         (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
2781         (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
2782         * platform/ScrollAnimator.h:
2783         * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
2784         * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
2785         (WebCore::ScrollController::ScrollController): Update to initialize new timers.
2786         (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
2787         (WebCore::ScrollController::startSnapRubberbandTimer): Added.
2788         (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
2789         require client to maintain timers.
2790         (WebCore::ScrollController::snapRubberBand): Ditto.
2791         (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
2792         (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
2793         (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
2794         (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
2795         (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
2796         (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
2797         (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
2798         (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
2799         * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
2800         * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
2801         * platform/mac/ScrollAnimatorMac.h:
2802         * platform/mac/ScrollAnimatorMac.mm:
2803         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
2804         controlled in the ScrollController)
2805         (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
2806         (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
2807         (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
2808         * platform/mac/ScrollController.h: Removed.
2809         * platform/mac/ScrollController.mm: Removed.
2810
2811 2015-03-02  Mark Lam  <mark.lam@apple.com>
2812
2813         The InspectorTimelineAgent should gracefully handle attempts to start more than once.
2814         <https://webkit.org/b/142189>
2815
2816         Reviewed by Joseph Pecoraro.
2817
2818         No new tests.  Unskipped an existing test that already asserts this.
2819
2820         InspectorTimelineAgent::internalStop() already checks for redundant calls to it in
2821         case the InspectorTimelineAgent is already disabled. Similarly,
2822         InspectorTimelineAgent::internalStart() should check if the InspectorTimelineAgent
2823         is already enabled before proceeding to do work to enable it. Though wasteful,
2824         it is legal for clients of the InspectorTimelineAgent to invoke start on it more
2825         than once. Hence, this check is needed.
2826
2827         This check fixes the debug assertion failure when running the
2828         inspector/timeline/debugger-paused-while-recording.html test. The test can now
2829         be unskipped.
2830
2831         * inspector/InspectorTimelineAgent.cpp:
2832         (WebCore::InspectorTimelineAgent::internalStart):
2833
2834 2015-03-02  Roger Fong  <roger_fong@apple.com>
2835
2836         Update backgrounds of sliders for inline media controls on OS X.
2837         https://bugs.webkit.org/show_bug.cgi?id=142188.
2838         <rdar://problem/20012413>
2839
2840         Reviewed by Dean Jackson.
2841
2842         Don’t use CSS to draw volume and timeline slider backgrounds.
2843         * Modules/mediacontrols/mediaControlsApple.css:
2844         (video::-webkit-media-controls-volume-slider):
2845         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb):
2846         (audio::-webkit-media-controls-timeline):
2847         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
2848         (audio::-webkit-media-controls-panel .thumbnail-track):
2849         (audio::-webkit-media-controls-volume-slider::-webkit-slider-thumb:active::-webkit-slider-thumb): Deleted.
2850         (audio::-webkit-media-controls-timeline:active::-webkit-slider-thumb,): Deleted.
2851
2852         Draw volume and timeline slider backgrounds using 2d canvases.
2853         * Modules/mediacontrols/mediaControlsApple.js:
2854         (Controller.prototype.createControls):
2855         (Controller.prototype.handleVolumeSliderInput):
2856         (Controller.prototype.addRoundedRect):
2857         (Controller.prototype.drawTimelineBackground):
2858         (Controller.prototype.drawVolumeBackground):
2859         (Controller.prototype.showControls):
2860         * Modules/mediacontrols/mediaControlsiOS.js:
2861         (ControllerIOS.prototype.addRoundedRect): Deleted.
2862
2863 2015-03-01  Roger Fong  <roger_fong@apple.com>
2864
2865         Update inline media element controls appearance Part 1.
2866         https://bugs.webkit.org/show_bug.cgi?id=142138.
2867         <rdar://problem/19997384>
2868
2869         Reviewed by Dean Jackson.
2870
2871         Update positioning, sizes, and background colors media control elements.
2872         Volume and timeline sliders will be drawn in a separate patch via 2d canvases.
2873
2874         * Modules/mediacontrols/mediaControlsApple.css:
2875         (audio::-webkit-media-controls-panel):
2876         (video::-webkit-media-controls-panel):
2877         (audio::-webkit-media-controls-rewind-button):
2878         (audio::-webkit-media-controls-play-button):
2879         (audio::-webkit-media-controls-panel .mute-box):
2880         (video::-webkit-media-controls-volume-max-button):
2881         (audio::-webkit-media-controls-panel .volume-box):
2882         (audio::-webkit-media-controls-panel .volume-box:active):
2883         (video::-webkit-media-controls-volume-slider):
2884         (audio::-webkit-media-controls-toggle-closed-captions-button):
2885         (audio::-webkit-media-controls-fullscreen-button):
2886         (audio::-webkit-media-controls-current-time-display):
2887         (audio::-webkit-media-controls-time-remaining-display):
2888         (audio::-webkit-media-controls-timeline-container .hour-long-time): Deleted.
2889
2890 2015-03-02  David Kilzer  <ddkilzer@apple.com>
2891
2892         REGRESSION (r180882): Build failure: Methods not marked override in GraphicsLayerCA.h
2893         <http://webkit.org/b/138684>
2894
2895         Fixes the following build failures:
2896
2897             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
2898             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
2899             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
2900             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:123:33: error: 'setShapeLayerPath' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2901                 WEBCORE_EXPORT virtual void setShapeLayerPath(const Path&);
2902                                             ^
2903             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
2904             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
2905             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
2906             WebCore.framework/PrivateHeaders/GraphicsLayer.h:390:18: note: overridden virtual function is here
2907                 virtual void setShapeLayerPath(const Path&);
2908                              ^
2909             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:39:
2910             In file included from WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:30:
2911             In file included from WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h:29:
2912             WebCore.framework/PrivateHeaders/GraphicsLayerCA.h:124:33: error: 'setShapeLayerWindRule' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
2913                 WEBCORE_EXPORT virtual void setShapeLayerWindRule(WindRule);
2914                                             ^
2915             In file included from WebKit2/WebProcess/WebPage/DrawingArea.cpp:30:
2916             In file included from WebKit2/WebProcess/WebPage/WebPage.h:46:
2917             In file included from WebKit2/WebProcess/Plugins/Plugin.h:31:
2918             WebCore.framework/PrivateHeaders/GraphicsLayer.h:393:18: note: overridden virtual function is here
2919                 virtual void setShapeLayerWindRule(WindRule);
2920                              ^
2921             2 errors generated.
2922
2923         * platform/graphics/ca/GraphicsLayerCA.h:
2924         (WebCore::GraphicsLayer::setShapeLayerPath): Mark as override.
2925         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
2926
2927 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
2928
2929         Make clip-path work on <video>, <canvas> etc.
2930         https://bugs.webkit.org/show_bug.cgi?id=138684
2931
2932         Reviewed by Darin Adler.
2933         
2934         clip-path only worked in compositing layers on the painted contents of the layer,
2935         and failed to clip children. Fix this by translating the clip path into a Path
2936         which is set on a CA shape layer (for Mac and iOS), or painted into the
2937         RenderLayerBacking's mask layer. There are two code paths:
2938
2939         1. clip-path which is a <basic-shape> or <geometry-box>, and no mask.
2940             Here we can use the optimal code path of converting the clip into a path
2941             that is put onto a CAShapeLayer, which is then used as a mask. There is no
2942             additional backing store.
2943         2. clip-path with an SVG reference, or clip-path combined with -webkit-mask:
2944             Here we have to allocate backing store for the mask layer, and paint the
2945             clip path (possibly with the mask).
2946         
2947         We add GraphicsLayer::Type::Shape, and add a getter for the layer type.
2948
2949         Tests: compositing/masks/compositing-clip-path-and-mask.html
2950                compositing/masks/compositing-clip-path-mask-change.html
2951                compositing/masks/compositing-clip-path.html
2952                compositing/masks/reference-clip-path-on-composited.html
2953
2954         * platform/graphics/GraphicsLayer.cpp:
2955         (WebCore::GraphicsLayer::GraphicsLayer): Store the type in the layer so the getter can return it.
2956         (WebCore::GraphicsLayer::shapeLayerPath): Get and set the shape layer path.
2957         (WebCore::GraphicsLayer::setShapeLayerPath): Ditto.
2958         (WebCore::GraphicsLayer::shapeLayerWindRule): Get and set the shape layer wind rule.
2959         (WebCore::GraphicsLayer::setShapeLayerWindRule): Ditto.
2960         * platform/graphics/GraphicsLayer.h:
2961         (WebCore::GraphicsLayer::type): Expose the type.
2962         (WebCore::GraphicsLayer::supportsLayerType): Allow the cross-platform code to use
2963         shape layers when it knows they are available.
2964         (WebCore::GraphicsLayer::needsClippingMaskLayer): Deleted. This was never used.
2965         * platform/graphics/GraphicsLayerClient.h: Align the bits (helps avoid typos). Add a
2966         GraphicsLayerPaintClipPath phase.
2967         * platform/graphics/Path.h: Some exports since WK2 needs to encode Paths now.
2968         * platform/graphics/ca/GraphicsLayerCA.cpp:
2969         (WebCore::GraphicsLayerCA::initialize): Make shape layers.
2970         (WebCore::GraphicsLayerCA::setShapeLayerPath): Setter for the shape path. Sadly we
2971         can't early return on unchanged paths yet.
2972         (WebCore::GraphicsLayerCA::setShapeLayerWindRule):
2973         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Updates for shape path
2974         and wind rule.
2975         (WebCore::GraphicsLayerCA::updateShape):
2976         (WebCore::GraphicsLayerCA::updateWindRule):
2977         * platform/graphics/ca/GraphicsLayerCA.h: Some new dirty bits for shape path and wind rule.
2978         * platform/graphics/ca/PlatformCALayer.h:
2979         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2980         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Got rid of lots of m_layer.get().
2981         (PlatformCALayerMac::~PlatformCALayerMac):
2982         (PlatformCALayerMac::setNeedsDisplay):
2983         (PlatformCALayerMac::setNeedsDisplayInRect):
2984         (PlatformCALayerMac::removeFromSuperlayer):
2985         (PlatformCALayerMac::setSublayers):
2986         (PlatformCALayerMac::removeAllSublayers):
2987         (PlatformCALayerMac::appendSublayer):
2988         (PlatformCALayerMac::insertSublayer):
2989         (PlatformCALayerMac::replaceSublayer):
2990         (PlatformCALayerMac::adoptSublayers):
2991         (PlatformCALayerMac::addAnimationForKey):
2992         (PlatformCALayerMac::removeAnimationForKey):
2993         (PlatformCALayerMac::animationForKey):
2994         (PlatformCALayerMac::setMask):
2995         (PlatformCALayerMac::isOpaque):
2996         (PlatformCALayerMac::setOpaque):
2997         (PlatformCALayerMac::bounds):
2998         (PlatformCALayerMac::setBounds):
2999         (PlatformCALayerMac::position):
3000         (PlatformCALayerMac::setPosition):
3001         (PlatformCALayerMac::anchorPoint):
3002         (PlatformCALayerMac::setAnchorPoint):
3003         (PlatformCALayerMac::transform):
3004         (PlatformCALayerMac::setTransform):
3005         (PlatformCALayerMac::sublayerTransform):
3006         (PlatformCALayerMac::setSublayerTransform):
3007         (PlatformCALayerMac::setHidden):
3008         (PlatformCALayerMac::setGeometryFlipped):
3009         (PlatformCALayerMac::isDoubleSided):
3010         (PlatformCALayerMac::setDoubleSided):
3011         (PlatformCALayerMac::masksToBounds):
3012         (PlatformCALayerMac::setMasksToBounds):
3013         (PlatformCALayerMac::acceleratesDrawing):
3014         (PlatformCALayerMac::setAcceleratesDrawing):
3015         (PlatformCALayerMac::contents):
3016         (PlatformCALayerMac::setContents):
3017         (PlatformCALayerMac::setContentsRect):
3018         (PlatformCALayerMac::setMinificationFilter):
3019         (PlatformCALayerMac::setMagnificationFilter):
3020         (PlatformCALayerMac::backgroundColor):
3021         (PlatformCALayerMac::setBackgroundColor):
3022         (PlatformCALayerMac::setBorderWidth):
3023         (PlatformCALayerMac::setBorderColor):
3024         (PlatformCALayerMac::opacity):
3025         (PlatformCALayerMac::setOpacity):
3026         (PlatformCALayerMac::copyFiltersFrom):
3027         (PlatformCALayerMac::setName):
3028         (PlatformCALayerMac::setSpeed):
3029         (PlatformCALayerMac::setTimeOffset):
3030         (PlatformCALayerMac::contentsScale):
3031         (PlatformCALayerMac::setContentsScale):
3032         (PlatformCALayerMac::cornerRadius):
3033         (PlatformCALayerMac::setCornerRadius):
3034         (PlatformCALayerMac::setEdgeAntialiasingMask):
3035         (PlatformCALayerMac::shapeWindRule): New function.
3036         (PlatformCALayerMac::setShapeWindRule): Ditto.
3037         (PlatformCALayerMac::shapePath): Ditto.
3038         (PlatformCALayerMac::setShapePath): Ditto.
3039         (PlatformCALayer::isWebLayer):
3040         * platform/graphics/cg/PathCG.cpp:
3041         (WebCore::Path::Path): nullptr.
3042         * rendering/RenderLayer.cpp:
3043         (WebCore::RenderLayer::paintsWithClipPath): Return true if the clip path is painted.
3044         (WebCore::RenderLayer::computeClipPath): Factor code that computes the clip path into this
3045         function, so we can call it from RenderLayerBacking too.
3046         (WebCore::RenderLayer::setupClipPath):
3047         (WebCore::RenderLayer::paintLayerContents): We only want to apply the clip path
3048         for painting when we're either painting a non-composited layer, or we're painting the
3049         mask layer of a composited layer. We in the latter case, we just want to fill the clip
3050         path with black, so re-use the paintChildClippingMaskForFragments() which does this.
3051         * rendering/RenderLayer.h: Align the bits, add PaintLayerPaintingCompositingClipPathPhase.
3052         * rendering/RenderLayerBacking.cpp:
3053         (WebCore::RenderLayerBacking::~RenderLayerBacking):
3054         (WebCore::RenderLayerBacking::updateConfiguration):
3055         (WebCore::RenderLayerBacking::updateGeometry): Move mask updating into its own function.
3056         (WebCore::RenderLayerBacking::updateMaskingLayerGeometry): If we're using the shape layer
3057         code path, compute the Path and set it and the wind rule on the mask layer.
3058         (WebCore::RenderLayerBacking::updateMaskingLayer): This is now more complex, as it has
3059         to deal with combinations of clip-path and mask, some of which allow for the shape layer
3060         mask, and we handle dynamic changes between these and painted masks.
3061         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer): Include the GraphicsLayerPaintClipPath phase.
3062         (WebCore::RenderLayerBacking::paintIntoLayer): Map GraphicsLayerPaintClipPath to PaintLayerPaintingCompositingClipPathPhase.
3063         (WebCore::RenderLayerBacking::updateMaskLayer): Deleted.
3064         * rendering/RenderLayerBacking.h:
3065
3066 2015-03-01  Hunseop Jeong  <hs85.jeong@samsung.com>
3067
3068         [Cairo] Implement Path::addEllipse 
3069         https://bugs.webkit.org/show_bug.cgi?id=142144
3070
3071         Reviewed by Gyuyoung Kim.
3072
3073         Add support for addEllipse method for platforms using cairo.
3074
3075         * platform/graphics/cairo/PathCairo.cpp:
3076         (WebCore::Path::addEllipse):
3077
3078 2015-03-01  Joonghun Park  <jh718.park@samsung.com>
3079
3080         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ScrollAnimator
3081         https://bugs.webkit.org/show_bug.cgi?id=142143
3082
3083         Reviewed by Darin Adler.
3084
3085         No new tests, no behavior changes.
3086
3087         * platform/ScrollAnimator.cpp:
3088         (WebCore::ScrollAnimator::create):
3089         * platform/ScrollAnimator.h:
3090         * platform/ScrollAnimatorNone.cpp:
3091         (WebCore::ScrollAnimator::create):
3092         * platform/ScrollableArea.h:
3093         * platform/ios/ScrollAnimatorIOS.mm:
3094         (WebCore::ScrollAnimator::create):
3095         * platform/mac/ScrollAnimatorMac.mm:
3096         (WebCore::ScrollAnimator::create):
3097
3098 2015-02-26  Andy Estes  <aestes@apple.com>
3099
3100         [Content Filtering] Move another declaration to WebFilterEvaluatorSPI.h
3101         https://bugs.webkit.org/show_bug.cgi?id=142066
3102
3103         Reviewed by Andreas Kling.
3104
3105         * platform/ios/ContentFilterIOS.mm:
3106         * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
3107
3108 2015-03-01  Chris Dumez  <cdumez@apple.com>
3109
3110         Make NotificationCenter / Notification suspendable
3111         https://bugs.webkit.org/show_bug.cgi?id=142117
3112         <rdar://problem/19923085>
3113
3114         Reviewed by Andreas Kling.
3115
3116         Make NotificationCenter / Notification suspendable so that pages using
3117         them can enter the PageCache.
3118
3119         NotificationCenter can safely be suspended if there are no pending
3120         permission requests. This required adding an
3121         "hasPendingPermissionRequests()" callback to the NotificationClient.
3122
3123         Notification can safely be suspended if it is either idle (not showing
3124         yet) or closed.
3125
3126         Tests: fast/history/page-cache-notification-non-suspendable.html
3127                fast/history/page-cache-notification-suspendable.html
3128
3129         * Modules/notifications/Notification.cpp:
3130         (WebCore::Notification::canSuspend):
3131         * Modules/notifications/NotificationCenter.cpp:
3132         (WebCore::NotificationCenter::canSuspend):
3133         * Modules/notifications/NotificationClient.h:
3134
3135 2015-03-01  Ryosuke Niwa  <rniwa@webkit.org>
3136
3137         isContentEditable shouldn't trigger synchronous style recalc in most cases
3138         https://bugs.webkit.org/show_bug.cgi?id=129034
3139
3140         Reviewed by Antti Koivisto.
3141
3142         Avoid style recalc inside isContentEditable when the document doesn't contain -webkit-user-modify or
3143         -webkit-user-select: all. Instead, compute the value from contenteditable attributes in ancestors.
3144         However, still compute the editability from the style tree when it's up-to-date in order to avoid
3145         repeatedly walking up the DOM tree in a hot code path inside editing.
3146
3147         Test: fast/dom/HTMLElement/dynamic-editability-change.html
3148
3149         * css/CSSGrammar.y.in: No need to pass in "true" as we never call this function with false.
3150         * css/CSSParser.cpp:
3151         (WebCore::isValidKeywordPropertyAndValue): Calls parserSetUsesStyleBasedEditability as needed.
3152         (WebCore::parseKeywordValue): Passes around StyleSheetContents*.
3153         (WebCore::CSSParser::parseValue): Ditto.
3154         (WebCore::CSSParser::parseFont): Ditto.
3155
3156         * css/StyleSheetContents.cpp:
3157         (WebCore::StyleSheetContents::StyleSheetContents): Initializes and copies m_usesStyleBasedEditability.
3158
3159         * css/StyleSheetContents.h:
3160         (WebCore::StyleSheetContents::parserSetUsesRemUnits): Removed the argument since it was always true.
3161         (WebCore::StyleSheetContents::parserSetUsesStyleBasedEditability): Added.
3162         (WebCore::StyleSheetContents::usesStyleBasedEditability): Added.
3163
3164         * dom/Document.cpp:
3165         (WebCore::Document::recalcStyle): Added a FIXME as well as a comment explaining why we don't call
3166         setUsesStyleBasedEditability. Since Node::computeEditability triggers style recalc only when the flag
3167         is set to true, it's too late to update the flag here.
3168         (WebCore::Document::updateStyleIfNeeded): Uses a newly extracted needsStyleRecalc.
3169         (WebCore::Document::updateBaseURL): Preserves m_usesStyleBasedEditability as well as m_usesRemUnit.
3170         (WebCore::Document::usesStyleBasedEditability): Added. Returns true when inline style declarations or
3171         any active stylesheet uses -webkit-user-modify or -webkit-user-select: all. Flushing pending stylesheet
3172         changes here is fine because the alternative is to trigger a full blown style recalc.
3173
3174         * dom/Document.h:
3175         (WebCore::Document::needsStyleRecalc): Added. Extracted from updateStyleIfNeeded.
3176
3177         * dom/DocumentStyleSheetCollection.cpp:
3178         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
3179         (WebCore::styleSheetsUseRemUnits): Deleted.
3180         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Updates m_usesStyleBasedEditability
3181         as well as m_usesRemUnit.
3182
3183         * dom/DocumentStyleSheetCollection.h:
3184         (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Added.
3185         (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Added.
3186
3187         * dom/Node.cpp:
3188         (WebCore::computeEditabilityFromComputedStyle): Extracted from computeEditability.
3189         (WebCore::Node::computeEditability): When the style recalc is requested and the render tree is dirty,
3190         check if the document uses any CSS property that can affect the editability of elements. If it doesn't,
3191         compute the editability from contenteditable attributes in the anchors via matchesReadWritePseudoClass.
3192         Continue to use the style-based computation when the render tree isn't dirty to avoid the tree walk.
3193
3194         * html/HTMLElement.cpp:
3195         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Extracted from matchesReadWritePseudoClass
3196         to be called in Node::computeEditability. Also made it return Editability instead of boolean.
3197         (WebCore::HTMLElement::matchesReadWritePseudoClass):
3198         * html/HTMLElement.h:
3199
3200 2015-03-01  Brent Fulgham  <bfulgham@apple.com>
3201
3202         [Win] Unreviewed build fix.
3203
3204         * WebCorePrefix.h: Provide some default definitions to help build on Windows
3205         machines with different application support libraries.
3206
3207 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
3208
3209         Viewport units should not dirty style just before we do layout
3210         https://bugs.webkit.org/show_bug.cgi?id=141682
3211
3212         Reviewed by Zalan Bujtas.
3213         
3214         In documents using viewport units, we dirtied style every time layout changed
3215         the size of the document. This is nonsensical, because viewport units depend on the
3216         viewport size, not the document size.
3217         
3218         Move the style dirtying from layout() into availableContentSizeChanged(). Hook
3219         this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and,
3220         since that causes availableContentSizeChanged() to be called for WK1 for the first
3221         time, protect the call to updateScrollbars() with a !platformWidget check.
3222
3223         Covered by existing viewport unit tests.
3224
3225         * page/FrameView.cpp:
3226         (WebCore::FrameView::layout):
3227         (WebCore::FrameView::availableContentSizeChanged):
3228         (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether
3229         scrollbars are ignored depends on the value of the overflow property on the root element.
3230         * page/FrameView.h:
3231         * platform/ScrollView.cpp:
3232         (WebCore::ScrollView::availableContentSizeChanged):
3233
3234 2015-02-28  Andreas Kling  <akling@apple.com>
3235
3236         [Cocoa] Purge SQLite page cache when under memory pressure.
3237         <https://webkit.org/b/142139>
3238         <rdar://problem/19997739>
3239
3240         Reviewed by Pratik Solanki.
3241
3242         Call out to sqlite3 cache purging SPI on Cocoa platforms when
3243         we need to free up some extra memory.
3244
3245         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3246         (WebCore::MemoryPressureHandler::platformReleaseMemory):
3247
3248 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
3249
3250         FrameView::layoutTimerFired() should update style if needed before doing layout
3251         https://bugs.webkit.org/show_bug.cgi?id=141688
3252
3253         Reviewed by Andreas Kling.
3254
3255         If the style recalc timer has been scheduled to fire after the layout timer,
3256         when the layout timer fires, we might as well just do the style recalc
3257         too. The call to updateStyleIfNeeded() will cancel the pending style
3258         recalc timer.
3259         
3260         This doesn't have much impact on the number of layouts (measured via PLT)
3261         but seems like a reasonable thing to do.
3262
3263         * page/FrameView.cpp:
3264         (WebCore::FrameView::layoutTimerFired):
3265
3266 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
3267
3268         Fullscreen video layers are off by one sometimes
3269         https://bugs.webkit.org/show_bug.cgi?id=142122
3270         rdar://problem/19878821
3271
3272         Reviewed by Eric Carlson.
3273
3274         Convert MediaPlayer::naturalSize() to return a FloatSize, since the natural size
3275         isn't always integral (because of preserving pixel aspect ratio etc). Fix all the media
3276         backends to use FloatSizes for natural size. Convert the video image drawing code
3277         paths to FloatSize, since naturalSize is used on the destination rect computation,
3278         and painting should be floating point anyway.
3279         
3280         Give the layer created by SourceBufferPrivateAVFObjC a name in debug builds.
3281
3282         * html/HTMLVideoElement.cpp:
3283         (WebCore::HTMLVideoElement::videoWidth):
3284         (WebCore::HTMLVideoElement::videoHeight):
3285         (WebCore::HTMLVideoElement::paintCurrentFrameInContext):
3286         * html/HTMLVideoElement.h:
3287         * html/canvas/CanvasRenderingContext2D.cpp:
3288         (WebCore::size):
3289         (WebCore::CanvasRenderingContext2D::drawImage):
3290         * html/canvas/WebGLRenderingContextBase.cpp:
3291         (WebCore::WebGLRenderingContextBase::videoFrameToImage):
3292         * platform/graphics/MediaPlayer.cpp:
3293         (WebCore::NullMediaPlayerPrivate::naturalSize):
3294         (WebCore::MediaPlayer::naturalSize):
3295         (WebCore::MediaPlayer::paint):
3296         (WebCore::MediaPlayer::paintCurrentFrameInContext):
3297         (WebCore::NullMediaPlayerPrivate::paint): Deleted.
3298         * platform/graphics/MediaPlayer.h:
3299         * platform/graphics/MediaPlayerPrivate.h:
3300         (WebCore::MediaPlayerPrivateInterface::paintCurrentFrameInContext):
3301         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3302         (WebCore::MediaPlayerPrivateAVFoundation::naturalSize):
3303         (WebCore::MediaPlayerPrivateAVFoundation::setNaturalSize):
3304         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3305         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3306         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3307         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintCurrentFrameInContext):
3308         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint):
3309         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator):
3310         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
3311         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
3312         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
3313         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3314         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3315         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3316         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::naturalSize):
3317         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paint):
3318         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::paintCurrentFrameInContext):
3319         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
3320         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
3321         (WebCore::MediaSourcePrivateAVFObjC::naturalSize):
3322         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3323         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3324         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
3325         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
3326         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
3327         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:
3328         (WebCore::VideoTrackPrivateMediaSourceAVFObjC::naturalSize):
3329         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3330         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3331         (WebCore::MediaPlayerPrivateQTKit::naturalSize):
3332         (WebCore::MediaPlayerPrivateQTKit::paintCurrentFrameInContext):
3333         (WebCore::MediaPlayerPrivateQTKit::paint):
3334         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3335         (WebCore::MockMediaPlayerMediaSource::naturalSize):
3336         (WebCore::MockMediaPlayerMediaSource::paint):
3337         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
3338         * rendering/RenderVideo.cpp:
3339         (WebCore::RenderVideo::calculateIntrinsicSize):
3340         (WebCore::RenderVideo::paintReplaced):
3341
3342 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
3343
3344         [EFL][GTK] Fix build break after r180790,180798
3345         https://bugs.webkit.org/show_bug.cgi?id=142127
3346
3347         Reviewed by Gyuyoung Kim.
3348
3349         * platform/graphics/cairo/PathCairo.cpp:
3350         (WebCore::Path::addEllipse):
3351
3352 2015-02-27  Zalan Bujtas  <zalan@apple.com>
3353