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