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