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