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