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