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