b3f2467f6d426b7cfdf405a6ede2c6af6f54ee04
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-03-15  Benjamin Poulain  <bpoulain@apple.com>
2
3         Change the exact attribute matching to be ASCII case-insensitive
4         https://bugs.webkit.org/show_bug.cgi?id=142609
5
6         Reviewed by Darin Adler.
7
8         In CSS, testing attribute values should be ASCII case-insensitive,
9         previously we were using full unicode case conversion.
10
11         Test: fast/selectors/attribute-exact-value-match-is-ascii-case-insensitive.html
12
13         * css/CSSParser.cpp:
14         (WebCore::CSSParser::parseKeyframeSelector):
15         The CSS parser has its own fast version for ASCII case insensitive.
16         This code was using the general equalIgnoringASCIICase() which was causing name conflicts,
17         change that to the normal CSS parser version.
18
19         * css/SelectorCheckerTestFunctions.h:
20         (WebCore::equalIgnoringASCIICase): Deleted.
21         * cssjit/SelectorCompiler.cpp:
22         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
23
24 2015-03-15  Brent Fulgham  <bfulgham@apple.com>
25
26         scroll snap points do not properly account for zoomed pages
27         https://bugs.webkit.org/show_bug.cgi?id=142706
28         <rdar://problem/20165771>
29
30         Reviewed by Anders Carlsson.
31
32         When a WebView is zoomed (such that it has a non-unity pageScaleFactor), we need to account for this
33         scaling value when selecting our correct scroll snap point target, as well as when specifying the
34         pixel location for our animation to target.
35
36         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
37         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
38         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor): Added new delegate method.
39         * platform/cocoa/ScrollController.h:
40         (WebCore::ScrollControllerClient::pageScaleFactor): Added new default delegate.
41         * platform/cocoa/ScrollController.mm:
42         (WebCore::ScrollController::beginScrollSnapAnimation): Calculate the correct scroll target
43         based on the page scale factor.
44
45 2015-03-15  Csaba Osztrogonác  <ossy@webkit.org>
46
47         Fix run-bindings-tests on the WinCairo bot
48         https://bugs.webkit.org/show_bug.cgi?id=142588
49
50         Reviewed by Alex Christensen.
51
52         * bindings/scripts/test/JS/JSFloat64Array.cpp: Added property svn:eol-style.
53         * bindings/scripts/test/JS/JSFloat64Array.h: Added property svn:eol-style.
54         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added property svn:eol-style.
55         * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Modified property svn:eol-style.
56         * bindings/scripts/test/JS/JSTestCallback.cpp: Modified property svn:eol-style.
57         * bindings/scripts/test/JS/JSTestCallback.h: Modified property svn:eol-style.
58         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Added property svn:eol-style.
59         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h: Modified property svn:eol-style.
60         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Added property svn:eol-style.
61         * bindings/scripts/test/JS/JSTestEventConstructor.h: Added property svn:eol-style.
62         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added property svn:eol-style.
63         * bindings/scripts/test/JS/JSTestEventTarget.h: Modified property svn:eol-style.
64         * bindings/scripts/test/JS/JSTestException.cpp: Added property svn:eol-style.
65         * bindings/scripts/test/JS/JSTestException.h: Added property svn:eol-style.
66         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Added property svn:eol-style.
67         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h: Added property svn:eol-style.
68         * bindings/scripts/test/JS/JSTestImplements.cpp: Added property svn:eol-style.
69         * bindings/scripts/test/JS/JSTestImplements.h: Added property svn:eol-style.
70         * bindings/scripts/test/JS/JSTestInterface.cpp: Modified property svn:eol-style.
71         * bindings/scripts/test/JS/JSTestInterface.h: Modified property svn:eol-style.
72         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Modified property svn:eol-style.
73         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Modified property svn:eol-style.
74         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Added property svn:eol-style.
75         * bindings/scripts/test/JS/JSTestNamedConstructor.h: Added property svn:eol-style.
76         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added property svn:eol-style.
77         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added property svn:eol-style.
78         * bindings/scripts/test/JS/JSTestObj.cpp: Modified property svn:eol-style.
79         * bindings/scripts/test/JS/JSTestObj.h: Modified property svn:eol-style.
80         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Added property svn:eol-style.
81         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h: Added property svn:eol-style.
82         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Modified property svn:eol-style.
83         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Modified property svn:eol-style.
84         * bindings/scripts/test/JS/JSTestSupplemental.cpp: Added property svn:eol-style.
85         * bindings/scripts/test/JS/JSTestSupplemental.h: Added property svn:eol-style.
86         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added property svn:eol-style.
87         * bindings/scripts/test/JS/JSTestTypedefs.h: Added property svn:eol-style.
88         * bindings/scripts/test/JS/JSattribute.cpp: Added property svn:eol-style.
89         * bindings/scripts/test/JS/JSattribute.h: Added property svn:eol-style.
90         * bindings/scripts/test/JS/JSreadonly.cpp: Added property svn:eol-style.
91         * bindings/scripts/test/JS/JSreadonly.h: Added property svn:eol-style.
92
93 2015-03-14  Darin Adler  <darin@apple.com>
94
95         More event handler improvements
96         https://bugs.webkit.org/show_bug.cgi?id=142701
97
98         Reviewed by Anders Carlsson.
99
100         These are the improvements:
101
102         - Use EventHandler rather than EventListener as the the type for event handler
103           attributes. This matches the HTML specification, and also makes sense, since
104           EventListener means something else (and we use it to mean that!). Also renamed
105           JSWindowEventListener to WindowEventHandler. Even though this only affects the
106           JavaScript code generated, it's not really a JavaScript-specific flag.
107
108         - Tweak formatting on addEventListener/removeEventListener/dispatchEvent in
109           all the IDL files where the appear. This includes changing the spelling from
110           "evt" to "event". Some day we should fix this so these functions only need to
111           appear in EventTarget.idl.
112
113         - Tweak formatting a bit on the IDL files we had to modify anyway.
114
115         - Use [Conditional] more often and #if less often in IDL files.
116
117         - Added a new [DocumentEventHandler] attribute for the selectionchange event.
118           This involved adding new event handler attribute functions to JSEventListener.h
119           for use by the JavaScript bindings.
120
121         - Removed a little unused code from the JavaScript code bindings generator.
122
123         - Improved the mechanism used by HTMLElement and SVGElement to share the list of
124           content attributes that are event handlers so there is only one map rather than
125           two. Made a similar mechanism so that HTMLBodyElement and HTMLFrameSetElement
126           can share the list of window event handlers.
127
128         - Followed the HTML specification by putting all the event handler support in
129           the HTMLElement class rather than having event handlers apply only a the
130           particular element that uses those events. We already did this for most of
131           our event handlers, but we are now doing it for all of them.
132
133         * Modules/battery/BatteryManager.idl: Use EventHandler instead of EventListener
134         as appropriate. Also reformatted addEventListener/removeEventListener/dispatchEvent.
135         * Modules/encryptedmedia/MediaKeySession.idl: Ditto.
136         * Modules/indexeddb/IDBDatabase.idl: Ditto.
137         * Modules/indexeddb/IDBOpenDBRequest.idl: Ditto.
138         * Modules/indexeddb/IDBRequest.idl: Ditto.
139         * Modules/indexeddb/IDBTransaction.idl: Ditto.
140         * Modules/mediastream/MediaStream.idl: Ditto.
141         * Modules/mediastream/MediaStreamTrack.idl: Ditto.
142         * Modules/mediastream/RTCDTMFSender.idl: Ditto.
143         * Modules/mediastream/RTCDataChannel.idl: Ditto.
144         * Modules/mediastream/RTCPeerConnection.idl: Ditto.
145         * Modules/speech/SpeechSynthesisUtterance.idl: Ditto.
146         * Modules/webaudio/AudioBufferSourceNode.idl: Ditto.
147         * Modules/webaudio/AudioContext.idl: Ditto.
148         * Modules/webaudio/OscillatorNode.idl: Ditto.
149         * Modules/webaudio/ScriptProcessorNode.idl: Ditto.
150         * Modules/websockets/WebSocket.idl: Ditto.
151         * css/FontLoader.idl: Ditto.
152         * dom/EventListener.idl: Ditto.
153         * dom/EventTarget.idl: Ditto.
154         * dom/MessagePort.idl: Ditto.
155         * dom/Node.idl: Ditto.
156         * dom/WebKitNamedFlow.idl: Ditto.
157         * fileapi/FileReader.idl: Ditto.
158         * html/MediaController.idl: Ditto.
159         * html/track/AudioTrackList.idl: Ditto.
160         * html/track/TextTrackCue.idl: Ditto.
161         * html/track/TextTrackList.idl: Ditto.
162         * html/track/VideoTrackList.idl: Ditto.
163         * loader/appcache/DOMApplicationCache.idl: Ditto.
164         * page/EventSource.idl: Ditto.
165         * page/Performance.idl: Ditto.
166         * workers/AbstractWorker.idl: Ditto.
167         * workers/DedicatedWorkerGlobalScope.idl: Ditto.
168         * workers/Worker.idl: Ditto.
169         * workers/WorkerGlobalScope.idl: Ditto.
170         * xml/XMLHttpRequest.idl: Ditto.
171         * xml/XMLHttpRequestUpload.idl: Ditto.
172
173         * Modules/notifications/Notification.idl: Did the above, but also used
174         [Conditional] instead of #if throughout.
175         * html/track/TextTrack.idl: Ditto.
176
177         * Modules/webaudio/AudioNode.idl: Tweaked paragraphing of this file.
178
179         * bindings/js/JSEventListener.cpp:
180         (WebCore::windowEventHandlerAttribute): Renamed to take the word "forwarded"
181         out of this. More closely matches the terminology used in IDL files and the
182         HTML specification.
183         (WebCore::setWindowEventHandlerAttribute): Ditto.
184         (WebCore::documentEventHandlerAttribute): Added.
185         (WebCore::setDocumentEventHandlerAttribute): Added.
186         * bindings/js/JSEventListener.h: Updated for above changes.
187
188         * bindings/objc/PublicDOMInterfaces.h: Renamed argument from "evt" to "event".
189
190         * bindings/scripts/CodeGeneratorGObject.pm:
191         (SkipAttribute): Skip attributes of type "EventHandler" rather than attributes
192         of type "EventListener".
193         * bindings/scripts/CodeGeneratorObjC.pm:
194         (SkipAttribute): Ditto.
195
196         * bindings/scripts/CodeGeneratorJS.pm:
197         (GenerateImplementation): Look for the type EventHandler instead of the type
198         EventListener for event handler attributes. Also added code to handle the new
199         DocumentEventHandler, and use the name WindowEventHandler instead of the name
200         JSWindowEventListener. Removed unneeded preflight check to see if we have
201         writable attributes; it was not doing us any good. (That caused a lot of code
202         to be un-indented and makes the diff hard to read.)
203
204         * bindings/scripts/IDLAttributes.txt: Removed JSWindowEventListener, and added
205         WindowEventHandler and DocumentEventHandler.
206
207         * bindings/scripts/test/TestObj.idl: Use the type EventHandler instead of the
208         type EventListener. The test output is unchanged, though.
209
210         * dom/Document.idl: Got rid of the conditionals and merged all the event handler
211         attributes into a single sorted, unconditional list. Added some that were missing,
212         as detected by the event-handler-attributes.html test.
213
214         * dom/Element.idl: Ditto. This includes moving attributes here that were formerly
215         only in certain element classes. Note that the script event handler attribute
216         support is still here, even though it should be in HTMLElement and SVGElement
217         instead. There's a FIXME about that, but no real urgency in fixing it.
218
219         * html/HTMLAttributeNames.in: Added onmessage. Previously, the support for this
220         was from the script attribute only, not the content attribute.
221
222         * html/HTMLBodyElement.cpp:
223         (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap): Added. This
224         contains the list of all the window event handlers that can be set on a body
225         or frameset element and which are triggered by events on the window.
226         (WebCore::HTMLBodyElement::eventNameForWindowEventHandlerAttribute): Added.
227         This is the function to call to use the map above. Given an attribute, it
228         returns either null if it is not a window event handler attribute, or the
229         event type if it is one.
230         (WebCore::HTMLBodyElement::parseAttribute): Updated to use the new
231         functions above. Handling of these attributes is now unconditional, but
232         also we don't have to keep the nested if statements here up to date, just
233         the list of event handler attributes names in the map create function above.
234
235         * html/HTMLBodyElement.h: Added public eventNameForWindowEventHandlerAttribute
236         and private createWindowEventHandlerNameMap functions.
237
238         * html/HTMLBodyElement.idl: Updated to use WindowEventHandler, DocumentEventHandler,
239         and EventHandler. Also made everything unconditional. Also filled out the list here
240         to match the list handled as content attributes. All covered by the test.
241
242         * html/HTMLElement.cpp:
243         (WebCore::HTMLElement::createEventHandlerNameMap): Added. Replaces the old
244         populate function. Changed the list of event handler attributes to be a bit more
245         complete, and to be entirely unconditional. Also refactored this function to use
246         a new populateEventHandlerNameMap helper, shared with HTMLBodyElement.
247         (WebCore::HTMLElement::populateEventHandlerNameMap): Added. Factors out the code
248         that both this class and HTMLBodyElement use to build event handler name maps.
249         (WebCore::HTMLElement::eventNameForEventHandlerAttribute): Added. This is the
250         function that call to use the map above. Given an attribute it returns either
251         null if it is not an event handler attribute, or the event type if it is one.
252         This is actually two functions. One is a protected function for use by both this
253         class and HTMLBodyElement so they can share things like the optimization to look
254         for the "on" prefix. The other is the public function that we actually use in
255         HTMLElement and SVGElement.
256         (WebCore::HTMLElement::editabilityFromContentEditableAttr): Tweaked and refactored
257         to use lineageOfType. Would have been even simpler if this took an element instead
258         of a node. Unrelated to the event handler changes.
259         (WebCore::HTMLElement::parseAttribute): Removed long-obsolete code that decided
260         whether to call through to the base class. The base class function is empty and
261         never needs to be called, and in any case there is no value in doing work to
262         decide whether to call through to an empty function. Changed the style of the
263         function to use early return instead of else. Worth considering whether we want
264         to return early or call through to base class in this family of functions. It's
265         more efficient to return early, but doesn't work well if both the derived class
266         and base class want to respond to changes to the same attribute. The new logic
267         for event handler attributes is more straightforward than the old, since the
268         eventNameForEventHandlerAttribute has the logic.
269         (WebCore::HTMLElement::textToFragment): Tweaked and refactored a bit, and also
270         changed to return a Ref since this never fails and needs to return null.
271
272         * html/HTMLElement.h: Updated for above changes. This includes a template version
273         of populateEventHandlerNameMap that extracts the array size at compile time and
274         passes it to the non-template function that does the work.
275
276         * html/HTMLFrameElementBase.cpp:
277         (WebCore::HTMLFrameElementBase::parseAttribute): Removed unneeded code to handle
278         event handler attributes handled by HTMLElement.
279         * html/HTMLImageElement.cpp:
280         (WebCore::HTMLImageElement::parseAttribute): Ditto.
281         * html/HTMLLinkElement.cpp:
282         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
283         * html/HTMLObjectElement.cpp:
284         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
285         * html/HTMLScriptElement.cpp:
286         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
287
288         * html/HTMLFrameSetElement.cpp:
289         (WebCore::HTMLFrameSetElement::parseAttribute): Changed function to early return
290         style, and added FIXMEs about the many problems in the attribute handling code.
291         Replaced all the code to handle window event handlers with a new bit of code that
292         calls HTMLBodyElement::eventNameForWindowEventHandlerAttribute.
293
294         * html/HTMLFrameSetElement.idl: Changed to match the list of window event handlers
295         in HTMLBodyElement.idl, although I did not add the document event handler here.
296         As in the various other cases, having some extra event handlers does not seem to
297         do harm and this is covered by the event-handler-attributes.html test.
298
299         * html/HTMLMarqueeElement.idl: Renamed EventListener to EventHandler in comment.
300
301         * page/DOMWindow.idl: As with Element and Document, removed conditionals, and
302         filled out the list of event handlers so all the tests in
303         event-handler-attributes.html will pass.
304
305         * svg/SVGElement.cpp:
306         (WebCore::SVGElement::parseAttribute): Changed code to the early return style,
307         and replaced the event handler attribute code with new much simpler code that
308         uses the new HTMLElement::eventNameForEventHandlerAttribute. Also changed the
309         way we call through to base classes. Just call through to the
310         SVGLangSpace::parseAttribute function unconditionally, and don't try to use
311         early return style to arbitrate among base classes. We should make this
312         simplification throughout the SVG code; there's no need for the complexity
313         that was there before just to cut down slightly on calls through to base
314         class parseAttribute functions.
315
316         * svg/SVGSVGElement.cpp:
317         (WebCore::SVGSVGElement::parseAttribute): Changed some of this code to the
318         early return style and corrected some comments about the window event handler
319         attributes here. These could use some further testing and might later need to be
320         properly supported when the attributes are set in script, not just in content.
321
322         * svg/SVGScriptElement.cpp:
323         (WebCore::SVGScriptElement::isSupportedAttribute): Deleted.
324         (WebCore::SVGScriptElement::parseAttribute): Changed this function to use the
325         early return style and also to call through to all three base classes. This is
326         a pattern we should follow elsewhere in SVG to simplify the code. There is no
327         need for the supportedAttributes sets like the one in this calass, and the code
328         is unnecessarily complex, perhaps in an attempt to optimize performance. I'm
329         pretty sure the old code was slower than this new code will be. No need for the
330         extra hash table lookup every time. Also removed handling of event handler
331         attribute which is taken care of by SVGElement now.
332         (WebCore::SVGScriptElement::svgAttributeChanged): Made similar changes for
333         the same reason as in parseAttribute. This function really needs a new name:
334         It's the same as parseAttribute, except it's also used when implementing
335         changes due to SVG animation.
336
337         * svg/SVGScriptElement.h: Removed isSupportedAttribute.
338
339 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
340
341         Clean up use of flags in localToContainer-type functions
342         https://bugs.webkit.org/show_bug.cgi?id=142704
343
344         Reviewed by Alexey Proskuryakov.
345         
346         RenderObject::localToContainerQuad() had the questionable behavior of always
347         enforcing UseTransforms in the flags. However, a future patch will need to call
348         localToContainerQuad() without this flag.
349         
350         Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
351         and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.
352         
353         The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
354         a lower-level function, is removed.
355         
356         Sprinkle a few more nullptrs around.
357         
358         No behavior change.
359
360         * rendering/RenderBlock.cpp:
361         (WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
362         instead of mapLocalToContainer().
363         (WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
364         * rendering/RenderBox.cpp:
365         (WebCore::RenderBox::absoluteQuads): Ditto.
366         * rendering/RenderBox.h:
367         * rendering/RenderFlowThread.h:
368         * rendering/RenderGeometryMap.h:
369         (WebCore::RenderGeometryMap::absolutePoint):
370         (WebCore::RenderGeometryMap::absoluteRect):
371         * rendering/RenderImage.cpp:
372         (WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
373         'false' as flags. Pass UseTransforms instead (but no behavior change since
374         UseTransforms was forced on lower down).
375         * rendering/RenderInline.h:
376         * rendering/RenderLayer.cpp:
377         (WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
378         * rendering/RenderLineBreak.cpp:
379         (WebCore::RenderLineBreak::absoluteQuads):
380         (WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
381         * rendering/RenderNamedFlowFragment.cpp:
382         (WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
383         * rendering/RenderObject.cpp:
384         (WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
385         the UseTransforms bit.
386         (WebCore::RenderObject::localToContainerPoint): Also here.
387         * rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
388         (WebCore::RenderObject::localToAbsoluteQuad):
389         * rendering/RenderText.cpp:
390         (WebCore::RenderText::collectSelectionRects): Another bad 'false'.
391         * rendering/RenderTextLineBoxes.cpp:
392         (WebCore::RenderTextLineBoxes::absoluteRectsForRange):
393         (WebCore::RenderTextLineBoxes::absoluteQuads):
394         (WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
395         * rendering/RenderView.h:
396         * rendering/SimpleLineLayoutFunctions.cpp:
397         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
398         * rendering/svg/RenderSVGForeignObject.h:
399         * rendering/svg/RenderSVGInline.cpp:
400         (WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
401         * rendering/svg/RenderSVGInline.h:
402         * rendering/svg/RenderSVGModelObject.cpp:
403         (WebCore::RenderSVGModelObject::absoluteQuads):
404         * rendering/svg/RenderSVGModelObject.h:
405         * rendering/svg/RenderSVGRoot.h:
406         * rendering/svg/RenderSVGText.cpp:
407         (WebCore::RenderSVGText::absoluteQuads):
408         * rendering/svg/RenderSVGText.h:
409         * rendering/svg/SVGRenderSupport.h:
410
411 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
412
413         [iOS] scroll snap points are animating to the wrong positions...
414         https://bugs.webkit.org/show_bug.cgi?id=142705
415         <rdar://problem/20136946>
416
417         Reviewed by Simon Fraser.
418
419         Avoid adding an extra '0' snap point to our set. We always start with one zero; this
420         extra append just forces us to do more steps in our search for nearest snap point.
421
422         * page/scrolling/AxisScrollSnapOffsets.cpp:
423         (WebCore::updateFromStyle): Remove extra '0' appended to offsets.
424
425 2015-03-14  Dean Jackson  <dino@apple.com>
426
427         Feature flag for Animations Level 2
428         https://bugs.webkit.org/show_bug.cgi?id=142699
429         <rdar://problem/20165097>
430
431         Reviewed by Brent Fulgham.
432
433         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
434
435         * Configurations/FeatureDefines.xcconfig:
436         * bindings/generic/RuntimeEnabledFeatures.cpp:
437         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
438         * bindings/generic/RuntimeEnabledFeatures.h:
439         (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled):
440         (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled):
441
442 2015-03-14  Adenilson Cavalcanti  <cavalcantii@gmail.com>
443
444         RenderBlock::imageChange() calling const methods on exit
445         https://bugs.webkit.org/show_bug.cgi?id=142648
446
447         Reviewed by Brent Fulgham.
448
449         No new tests, no change on behavior.
450
451         * rendering/RenderBlock.cpp:
452         (WebCore::RenderBlock::imageChanged): Deleted.
453         * rendering/RenderBlock.h:
454
455 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
456
457         [GStreamer] share GL context in pipeline
458         https://bugs.webkit.org/show_bug.cgi?id=142693
459
460         Reviewed by Philippe Normand.
461
462         GstGL elements in a pipeline need to be aware of the application's
463         display and its GL context. This information is shared through context
464         messages between the pipeline and the browser.
465
466         This patch shares this context through a GStreamer's synchronous
467         message, using the GL information held in the web process.
468
469         This patch is based on the work of Philippe Normand for Bug 138562.
470
471         No new tests because this is platform specific and it depends in the
472         run-time availability and configurations of GstGL elements.
473
474         * PlatformGTK.cmake: appends the GstGL header files in the include
475         directories. Also its library directory is appended.
476         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
477         (WebCore::mediaPlayerPrivateSyncMessageCallback): New callback function.
478         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
479         Initialize the new class attributes.
480         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): New method
481         for handling synchronous messages from the pipeline. This method
482         currently only handles the GL context sharing.
483         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Configures
484         the pipeline's bus to handle the synchronous messages.
485         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add new
486         class methods and attributes.
487
488 2015-03-13  Alex Christensen  <achristensen@webkit.org>
489
490         Progress towards CMake on Mac.
491         https://bugs.webkit.org/show_bug.cgi?id=142680
492
493         Reviewed by Gyuyoung Kim.
494
495         * PlatformMac.cmake:
496         Added new include directories and removed old source files.
497
498 2015-03-13  Commit Queue  <commit-queue@webkit.org>
499
500         Unreviewed, rolling out r181483.
501         https://bugs.webkit.org/show_bug.cgi?id=142688
502
503         Caused use-after-free on many tests (Requested by ap on
504         #webkit).
505
506         Reverted changeset:
507
508         "Allow clients to selectively disable plug-ins"
509         https://bugs.webkit.org/show_bug.cgi?id=142506
510         http://trac.webkit.org/changeset/181483
511
512 2015-03-13  Antti Koivisto  <antti@apple.com>
513
514         Cache glyph widths to GlyphPages
515         https://bugs.webkit.org/show_bug.cgi?id=142028
516
517         Reviewed by Andreas Kling.
518
519         Currently we have a separate cache in Font for glyph widths. In practice we always need
520         the widths so we can just cache them in GlyphPages. This simplifies the code and removes
521         a per-character hash lookup from WidthIterator.
522
523         * platform/graphics/Font.cpp:
524         (WebCore::Font::Font):
525         (WebCore::Font::initCharWidths):
526         (WebCore::Font::platformGlyphInit):
527         (WebCore::createAndFillGlyphPage):
528         (WebCore::Font::computeWidthForGlyph):
529
530             Rename to make it clear this doesn't cache.
531
532         (WebCore::GlyphPage::setGlyphDataForIndex):
533
534             Initialize the width.
535             This could go to GlyphPage.cpp if we had one.
536
537         * platform/graphics/Font.h:
538         (WebCore::Font::glyphZeroWidth):
539         (WebCore::Font::isZeroWidthSpaceGlyph):
540         (WebCore::Font::zeroGlyph): Deleted.
541         (WebCore::Font::setZeroGlyph): Deleted.
542         (WebCore::Font::widthForGlyph): Deleted.
543         * platform/graphics/FontCascade.cpp:
544         (WebCore::offsetToMiddleOfGlyph):
545         * platform/graphics/FontCascadeFonts.cpp:
546         (WebCore::FontCascadeFonts::glyphDataForCharacter):
547         * platform/graphics/GlyphPage.h:
548         (WebCore::GlyphData::GlyphData):
549
550             Return width too as part of GlyphData.
551
552         (WebCore::GlyphPage::glyphDataForIndex):
553         (WebCore::GlyphPage::setGlyphDataForCharacter):
554         (WebCore::GlyphPage::setGlyphDataForIndex):
555         (WebCore::GlyphPage::GlyphPage):
556         * platform/graphics/WidthIterator.cpp:
557         (WebCore::WidthIterator::advanceInternal):
558
559             No need to lookup width separately now.
560
561         * platform/graphics/mac/ComplexTextController.cpp:
562         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
563         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
564         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
565         * rendering/mathml/RenderMathMLOperator.cpp:
566         (WebCore::RenderMathMLOperator::advanceForGlyph):
567         * rendering/svg/SVGTextRunRenderingContext.cpp:
568         (WebCore::missingGlyphForFont):
569         * svg/SVGFontData.cpp:
570         (WebCore::SVGFontData::initializeFont):
571
572 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
573
574         [Mac] Enable WIRELESS_PLAYBACK_TARGET
575         https://bugs.webkit.org/show_bug.cgi?id=142635
576
577         Reviewed by Darin Adler.
578
579         * Configurations/FeatureDefines.xcconfig:
580
581 2015-03-13  Jeremy Jones  <jeremyj@apple.com>
582
583         Fix typo restoreUserInterfaceForOptimizedFullscreeStopWithCompletionHandler.
584         https://bugs.webkit.org/show_bug.cgi?id=142678
585
586         Reviewed by Eric Carlson.
587
588         Add the missing 'n' in "fullscreen".
589
590         * platform/spi/ios/AVKitSPI.h:
591
592 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
593
594         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
595         https://bugs.webkit.org/show_bug.cgi?id=142664
596         <rdar://problem/18859470>
597
598         Reviewed by Benjamin Poulain.
599
600         * page/ViewportConfiguration.cpp:
601         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints):
602         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
603         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
604         Split shouldIgnoreScalingConstraints into one for each dimension.
605
606         (WebCore::ViewportConfiguration::initialScale):
607         (WebCore::ViewportConfiguration::minimumScale):
608         Don't force the initial and minimum scales to cover the whole view if the
609         page claims to want to lay out to device width but then lays out too big.
610         This will allow pages that misbehave in this way to scale down further
611         than they previously could, but will result in a region of empty background
612         color being exposed at the initial/minimum scale.
613
614         (WebCore::ViewportConfiguration::description):
615         Update the logging to show each dimension separately.
616
617         * page/ViewportConfiguration.h:
618
619 2015-03-13  Mark Lam  <mark.lam@apple.com>
620
621         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
622         <https://webkit.org/b/142674>
623
624         Reviewed by Filip Pizlo.
625
626         No new tests because there is no new functionality. This is a refactoring effort.
627
628         * bindings/objc/WebScriptObject.mm:
629         * platform/ios/wak/WAKWindow.mm:
630         (-[WAKWindow initWithLayer:]):
631         (-[WAKWindow initWithFrame:]):
632
633 2015-03-13  Doug Russell  <d_russell@apple.com>
634
635         AX: Provide API for assistive tech to ignore DOM key event handlers
636         https://bugs.webkit.org/show_bug.cgi?id=142059
637
638         Reviewed by Beth Dakin.
639
640         Assistive technology applications on the desktop are heavily dependent on keyboard navigation being reliable. This is greatly hindered by sites that handle key events without updating keyboard selection and then consume the event. It is important for assistive technology apps to allow users to decide to ignore these handlers that are incorrect for their purposes.
641
642         This can be fixed by exposing, via a new accessibility attribute, a way to decide, for a given WebCore::Frame, to pre-empt DOM dispatch and instead let accessibility caret browsing take place.
643
644         Test: platform/mac/accessibility/prevent-keyboard-event-dispatch.html
645
646         * accessibility/AccessibilityObject.cpp:
647         (WebCore::AccessibilityObject::preventKeyboardDOMEventDispatch):
648         (WebCore::AccessibilityObject::setPreventKeyboardDOMEventDispatch):
649         * accessibility/AccessibilityObject.h:
650         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
651         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
652         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
653         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
654         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
655         * dom/Element.cpp:
656         (WebCore::Element::dispatchKeyEvent):
657         * page/EventHandler.cpp:
658         (WebCore::EventHandler::keyEvent):
659         (WebCore::handleKeyboardSelectionMovement):
660         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
661         * page/EventHandler.h:
662         * page/Settings.in:
663
664 2015-03-09  Conrad Shultz  <conrad_shultz@apple.com>
665
666         Allow clients to selectively disable plug-ins
667         https://bugs.webkit.org/show_bug.cgi?id=142506
668
669         Reviewed by Anders Carlsson.
670
671         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
672         from the page). As part of this:
673
674         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
675            set of plug-ins.
676
677         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
678            down the stack.
679
680         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
681            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
682
683         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
684
685         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
686         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
687
688         * dom/DOMImplementation.cpp:
689         (WebCore::DOMImplementation::createDocument):
690         Update to reflect function rename.
691
692         * loader/SubframeLoader.cpp:
693         (WebCore::findPluginMIMETypeFromURL):
694         Adopt getWebVisibleMimesAndPluginIndices().
695         (WebCore::logPluginRequest):
696         Update to reflect function rename.
697         (WebCore::SubframeLoader::shouldUsePlugin):
698         Ditto.
699
700         * platform/PlatformStrategies.h:
701         Export platformStrategies(), since it is now used in WebProcess.cpp.
702
703         * plugins/DOMMimeType.cpp:
704         (WebCore::DOMMimeType::type):
705         (WebCore::DOMMimeType::description):
706         (WebCore::DOMMimeType::mimeClassInfo):
707         Adopt getWebVisibleMimesAndPluginIndices().
708         (WebCore::DOMMimeType::enabledPlugin):
709         Ditto.
710
711         * plugins/DOMMimeType.h:
712         Don't return references in a few places where it is no longer safe to do so.
713         (WebCore::DOMMimeType::mimeClassInfo): Deleted.
714
715         * plugins/DOMMimeTypeArray.cpp:
716         (WebCore::DOMMimeTypeArray::length):
717         Adopt getWebVisibleMimesAndPluginIndices().
718         (WebCore::DOMMimeTypeArray::item):
719         Ditto.
720         (WebCore::DOMMimeTypeArray::canGetItemsForName):
721         Ditto.
722         (WebCore::DOMMimeTypeArray::namedItem):
723         Ditto.
724
725         * plugins/DOMPlugin.cpp:
726         (WebCore::DOMPlugin::pluginInfo):
727         Adopt getWebVisiblePlugins().
728         (WebCore::DOMPlugin::item):
729         Adopt getWebVisibleMimesAndPluginIndices().
730         (WebCore::DOMPlugin::canGetItemsForName):
731         Ditto.
732         (WebCore::DOMPlugin::namedItem):
733         Ditto.
734
735         * plugins/DOMPlugin.h:
736         (WebCore::DOMPlugin::pluginInfo): Deleted.
737
738         * plugins/DOMPluginArray.cpp:
739         (WebCore::DOMPluginArray::length):
740         Adopt getWebVisiblePlugins().
741         (WebCore::DOMPluginArray::item):
742         Ditto.
743         (WebCore::DOMPluginArray::canGetItemsForName):
744         Ditto.
745         (WebCore::DOMPluginArray::namedItem):
746         Ditto.
747
748         * plugins/PluginData.cpp:
749         (WebCore::PluginData::PluginData):
750         Stash the passed-in Page and call initPlugins().
751         (WebCore::PluginData::getWebVisiblePlugins):
752         New member function; call through to PluginStrategy::getWebVisiblePluginInfo().
753         (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
754         New member function; build up the mimes and mimePluginIndices vectors in the same manner as before, but
755         limited to the web-visible plug-ins.
756         (WebCore::PluginData::supportsWebVisibleMimeType):
757         Renamed from supportsMimeType(); update to work in terms of web-visible plug-ins.
758         (WebCore::PluginData::pluginInfoForWebVisibleMimeType):
759         Renamed from pluginInfoForMimeType(); ditto.
760         (WebCore::PluginData::pluginNameForWebVisibleMimeType):
761         Renamed from pluginNameForMimeType(); ditto.
762         (WebCore::PluginData::pluginFileForWebVisibleMimeType):
763         Renamed from pluginFileForMimeType(); ditto.
764         (WebCore::PluginData::initPlugins):
765         (WebCore::PluginData::supportsMimeType): Deleted.
766         (WebCore::PluginData::pluginInfoForMimeType): Deleted.
767         (WebCore::PluginData::pluginNameForMimeType): Deleted.
768         (WebCore::PluginData::pluginFileForMimeType): Deleted.
769
770         * plugins/PluginData.h:
771         Add a member variable for the associate Page; declare the PluginLoadClientPolicy enumeration; add
772         new members to PluginInfo for the clientLoadPolicy and bundle information.
773         (WebCore::PluginData::PluginData):
774         Replace some member functions with new ones that will hide plug-ins upon request from the client;
775         (WebCore::PluginData::mimes): Deleted.
776         (WebCore::PluginData::mimePluginIndices): Deleted.
777
778         * plugins/PluginStrategy.h:
779         Declare new member functions for retrieving web-visible plug-ins and setting/clearing plug-in policies.
780
781         * replay/SerializationMethods.cpp:
782         (JSC::EncodingTraits<PluginData>::encodeValue):
783         Remove now-obsolete code for handling MIME types and add a FIXME.
784         (JSC::DeserializedPluginData::DeserializedPluginData):
785         (JSC::EncodingTraits<PluginData>::decodeValue):
786         Ditto.
787         (JSC::EncodingTraits<PluginInfo>::encodeValue):
788         Handle the new members in PluginInfo.
789         (JSC::EncodingTraits<PluginInfo>::decodeValue):
790         Ditto.
791
792         * replay/WebInputs.json:
793         Teach Replay about PluginLoadClientPolicy.
794
795 2015-03-13  Chris Dumez  <cdumez@apple.com>
796
797         XMLHttpRequests should not prevent a page from entering PageCache
798         https://bugs.webkit.org/show_bug.cgi?id=142612
799         <rdar://problem/19923085>
800
801         Reviewed by Alexey Proskuryakov.
802
803         Make XMLHttpRequest ActiveDOMObjects suspendable in most cases to
804         drastically improve the likelihood of pages using them to enter
805         PageCache. XMLHttpRequest used to be only suspendable when not
806         loading. After this patch, if the XMLHttpRequest is loading when
807         navigating away from the page, it will be aborted and the page
808         will enter the PageCache. Upon restoring the page from PageCache,
809         the XMLHttpRequests' error handlers will be executed to give them
810         a chance to reload if they want to.
811
812         Test: http/tests/navigation/page-cache-xhr.html
813
814         * history/PageCache.cpp:
815         (WebCore::logCanCacheFrameDecision):
816         (WebCore::PageCache::canCachePageContainingThisFrame):
817         Do not prevent a page to enter the page cache ff the main document has
818         an error that is a cancellation and all remaining subresource loaders
819         are for XHR. We extend the pre-existing mechanism used on iOS, which
820         allowed PageCaching if the remaining resource loads are for images.
821
822         * loader/DocumentLoader.cpp:
823         (WebCore::areAllLoadersPageCacheAcceptable):
824         Mark XHR loaders as PageCache acceptable.
825
826         * loader/DocumentThreadableLoader.cpp:
827         (WebCore::DocumentThreadableLoader::isXMLHttpRequest):
828         * loader/DocumentThreadableLoader.h:
829         * loader/ThreadableLoader.h:
830         * loader/cache/CachedResource.cpp:
831         (WebCore::CachedResource::areAllClientsXMLHttpRequests):
832         * loader/cache/CachedResource.h:
833         * loader/cache/CachedResourceClient.h:
834         (WebCore::CachedResourceClient::isXMLHttpRequest):
835         * xml/XMLHttpRequest.cpp:
836         (WebCore::XMLHttpRequest::XMLHttpRequest):
837         (WebCore::XMLHttpRequest::createRequest):
838         (WebCore::XMLHttpRequest::canSuspend):
839         Report that we can suspend XMLHttpRequests as long as the window load
840         event has already fired. If the window load event has not fired yet,
841         it would be unsafe to cancel the load in suspend() as it would
842         potentially cause arbitrary JS execution while suspending.
843
844         (WebCore::XMLHttpRequest::suspend):
845         If suspending for PageCache and the request is currently loading, abort
846         the load and mark that we should fire the error event upon restoring
847         from PageCache.
848
849         (WebCore::XMLHttpRequest::resume):
850         (WebCore::XMLHttpRequest::resumeTimerFired):
851         Upon resuming, fire the error event in a timer if the load was aborted
852         for suspending. We need to do this in a timer because we are not allowed
853         to execute arbitrary JS inside resume().
854
855         (WebCore::XMLHttpRequest::stop):
856         Add a assertion to make sure we are not firing event inside stop() as
857         this would potentially cause arbitrary JS execution and it would be
858         unsafe. It seems to me that our code is currently unsafe but the
859         assertion does not seem to be hit by our current layout tests. I am
860         adding the assertion as it would make it clear we have a bug and we
861         need to fix it.
862
863         * xml/XMLHttpRequest.h:
864
865 2015-03-13  Joonghun Park  <jh718.park@samsung.com>
866
867         Fix Debug build error 'comparison is always true due to limited range of data type [-Werror=type-limits]'
868         https://bugs.webkit.org/show_bug.cgi?id=142652
869
870         Reviewed by Csaba Osztrogonác.
871
872         No new tests, no behavior changes.
873
874         Now CSSPropertyID type is uint16_t, so propertyID >= 0 check is needed no more.
875
876         * css/CSSPrimitiveValue.cpp:
877         (WebCore::propertyName):
878         * css/makeprop.pl:
879
880 2015-03-12  Zan Dobersek  <zdobersek@igalia.com>
881
882         Remove DrawingBuffer
883         https://bugs.webkit.org/show_bug.cgi?id=142641
884
885         Reviewed by Darin Adler.
886
887         Remove the DrawingBuffer class. Objects of this type were only held in the
888         WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the
889         Chromium port, with the relevant code removed in r147888. Since then, the
890         m_drawingBuffer member variable has always been null.
891
892         * CMakeLists.txt:
893         * PlatformEfl.cmake:
894         * PlatformGTK.cmake:
895         * WebCore.vcxproj/WebCore.vcxproj:
896         * WebCore.vcxproj/WebCore.vcxproj.filters:
897         * WebCore.xcodeproj/project.pbxproj:
898         * html/canvas/WebGL2RenderingContext.cpp:
899         (WebCore::WebGL2RenderingContext::copyTexImage2D):
900         * html/canvas/WebGLRenderingContext.cpp:
901         (WebCore::WebGLRenderingContext::copyTexImage2D):
902         * html/canvas/WebGLRenderingContextBase.cpp:
903         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
904         (WebCore::WebGLRenderingContextBase::initializeNewContext):
905         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
906         (WebCore::WebGLRenderingContextBase::markContextChanged):
907         (WebCore::WebGLRenderingContextBase::clearIfComposited):
908         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
909         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
910         (WebCore::WebGLRenderingContextBase::reshape):
911         (WebCore::WebGLRenderingContextBase::drawingBufferWidth):
912         (WebCore::WebGLRenderingContextBase::drawingBufferHeight):
913         (WebCore::WebGLRenderingContextBase::activeTexture):
914         (WebCore::WebGLRenderingContextBase::bindFramebuffer):
915         (WebCore::WebGLRenderingContextBase::bindTexture):
916         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
917         (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
918         (WebCore::WebGLRenderingContextBase::disable):
919         (WebCore::WebGLRenderingContextBase::enable):
920         (WebCore::WebGLRenderingContextBase::getContextAttributes):
921         (WebCore::WebGLRenderingContextBase::readPixels):
922         (WebCore::WebGLRenderingContextBase::loseContextImpl):
923         (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth):
924         (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight):
925         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
926         * html/canvas/WebGLRenderingContextBase.h:
927         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted.
928         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted.
929         * platform/graphics/GraphicsContext.h:
930         * platform/graphics/GraphicsContext3D.h:
931         * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed.
932         * platform/graphics/gpu/DrawingBuffer.cpp: Removed.
933         * platform/graphics/gpu/DrawingBuffer.h: Removed.
934         * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed.
935         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
936         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
937         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData):
938
939 2015-03-12  Ryosuke Niwa  <rniwa@webkit.org>
940
941         REGRESSION(r180726): Removing an empty line at the end of textarea clears the entire texture
942         https://bugs.webkit.org/show_bug.cgi?id=142646
943
944         Reviewed by Darin Adler.
945
946         The bug was caused by TypingCommand::deleteKeyPressed erroneously determining the editable root to be empty because
947         Position::atStartOfTree returns true when it's anchored at a BR that is immediately below the root editable element.
948
949         Fixed the bug by replacing the use of the deprecated atFirstEditingPositionForNode by a code that understands modern
950         position types such as PositionIsBeforeAnchor in atStartOfTree and atEndOfTree. These two functions will no longer
951         return true when anchored before or after BR after this patch.
952
953         Test: editing/deleting/delete-empty-line-breaks-at-end-of-textarea.html
954
955         * dom/Position.cpp:
956         (WebCore::Position::atStartOfTree):
957         (WebCore::Position::atEndOfTree):
958
959 2015-03-12  Yusuke Suzuki  <utatane.tea@gmail.com>
960
961         Integrate MapData into JSMap and JSSet
962         https://bugs.webkit.org/show_bug.cgi?id=142556
963
964         Reviewed by Filip Pizlo.
965
966         Now Set has SetData and it's different from MapData.
967         And MapData/SetData are completely integrated into JSSet and JSMap.
968         Structured-cloning algorithm need to be aware of these changes.
969         And in the case of JSSet, since JSSet doesn't need dummy value for construction,
970         Structured-cloning only serialize the keys in JSSet.
971
972         * ForwardingHeaders/runtime/MapDataInlines.h: Added.
973         * bindings/js/SerializedScriptValue.cpp:
974         (WebCore::CloneSerializer::serialize):
975         (WebCore::CloneDeserializer::consumeCollectionDataTerminationIfPossible):
976         (WebCore::CloneDeserializer::deserialize):
977         (WebCore::CloneDeserializer::consumeMapDataTerminationIfPossible): Deleted.
978
979 2015-03-12  Dan Bernstein  <mitz@apple.com>
980
981         Finish up <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
982
983         Added back OS X bits that I couldn’t land initially in r181317 or had to remove in r181327.
984
985         * platform/network/mac/CertificateInfoMac.mm:
986         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
987         * platform/spi/cocoa/SecuritySPI.h:
988
989 2015-03-12  Geoffrey Garen  <ggaren@apple.com>
990
991         REGRESSION: Crash under Heap::reportExtraMemoryAllocatedSlowCase for media element
992         https://bugs.webkit.org/show_bug.cgi?id=142636
993
994         Reviewed by Mark Hahnenberg.
995
996         This was a pre-existing bug that I made a lot worse in
997         <https://trac.webkit.org/changeset/181411>.
998
999         * html/HTMLMediaElement.cpp:
1000         (WebCore::HTMLMediaElement::parseAttribute): Compare size before
1001         subtracting rather than subtracting and then comparing to zero. The
1002         latter technique is not valid for unsigned integers, which will happily
1003         underflow into giant numbers.
1004
1005         * Modules/mediasource/SourceBuffer.cpp:
1006         (WebCore::SourceBuffer::reportExtraMemoryAllocated): This code was
1007          technically correct, but I took the opportunity to clean it up a bit.
1008          There's no need to do two checks here, and it smells bad to check for
1009          a negative unsigned integer.
1010
1011 2015-03-12  Sebastian Dröge  <sebastian@centricular.com>
1012
1013         Stop using single-include headers that are only available since GStreamer >= 1.2.
1014
1015         https://bugs.webkit.org/show_bug.cgi?id=142537
1016
1017         Reviewed by Philippe Normand.
1018
1019         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1020         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1021         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1022         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1023         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1024         * platform/graphics/gstreamer/GStreamerUtilities.h:
1025         * platform/graphics/gstreamer/ImageGStreamer.h:
1026         Instead of using single-include headers for the GStreamer libraries,
1027         directly include the headers we need. The single-include headers were
1028         only added in 1.2, and this would be the only reason why we would
1029         depend on 1.2.
1030
1031 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
1032
1033         [Mac] Update AirPlay handling
1034         https://bugs.webkit.org/show_bug.cgi?id=142541
1035
1036         Unreviewed, respond to post-review comments.
1037
1038         * dom/Document.cpp:
1039         (WebCore::Document::didChoosePlaybackTarget):
1040         * page/ChromeClient.h:
1041         * page/Page.cpp:
1042         (WebCore::Page::showPlaybackTargetPicker):
1043         (WebCore::Page::didChoosePlaybackTarget):
1044         (WebCore::Page::configurePlaybackTargetMonitoring):
1045
1046 2015-03-12  Csaba Osztrogonác  <ossy@webkit.org>
1047
1048         Fix the !ENABLE(PICTURE_SIZES) build
1049         https://bugs.webkit.org/show_bug.cgi?id=142617
1050
1051         Reviewed by Darin Adler.
1052
1053         * html/parser/HTMLPreloadScanner.cpp:
1054         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1055
1056 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
1057
1058         Unreviewed follow-up fix to r181426. Initialize TextPosition with zeros in case it gets used.
1059
1060         Address ASSERT in LayoutTests/printing/page-format-data.html.
1061
1062         * dom/InlineStyleSheetOwner.cpp:
1063         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
1064         In case the TextPosition gets used because it wasn't created by a parser,
1065         zeros are more realistic values then beforeFirst.
1066
1067 2015-03-11  Roger Fong  <roger_fong@apple.com>
1068
1069         Media element time no longer updates while scrubbing following r181279.
1070         https://bugs.webkit.org/show_bug.cgi?id=142606.
1071         <rdar://problem/20131014>
1072
1073         Reviewed by Eric Carlson.
1074
1075         * Modules/mediacontrols/mediaControlsApple.js:
1076         (Controller.prototype.handleWrapperMouseMove):
1077         Update time as a result of a mouse move if we are scrubbing.
1078
1079 2015-03-11  Joseph Pecoraro  <pecoraro@apple.com>
1080
1081         Web Inspector: CSS parser errors in the console should include column numbers
1082         https://bugs.webkit.org/show_bug.cgi?id=114313
1083
1084         Reviewed by Darin Adler.
1085
1086         Test: inspector-protocol/console/warnings-errors.html
1087
1088         * css/CSSParser.h:
1089         (WebCore::CSSParser::currentCharacterOffset):
1090         Get the current character offset depending on the source type.
1091         Add instance variables to track column position and start
1092         line / column for inline stylesheets.
1093
1094         * css/CSSParser.cpp:
1095         (WebCore::CSSParser::CSSParser):
1096         (WebCore::CSSParser::parseSheet):
1097         Initialize new instance variables.
1098
1099         (WebCore::CSSParser::currentLocation):
1100         Update to include column information for the token. Also, if we are on the
1101         first line we may need to take into account a start column offset as well.
1102
1103         (WebCore::CSSParser::realLex):
1104         Set the token's start column.
1105         When bumping the line number, reset the column offset for the next
1106         line with the next character.
1107
1108         (WebCore::CSSParser::syntaxError):
1109         (WebCore::CSSParser::logError):
1110         Include column information.
1111
1112         * css/StyleSheetContents.cpp:
1113         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1114         (WebCore::StyleSheetContents::parseString):
1115         (WebCore::StyleSheetContents::parseStringAtPosition):
1116         Include column information.
1117
1118         * css/StyleSheetContents.h:
1119         * dom/InlineStyleSheetOwner.cpp:
1120         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
1121         (WebCore::InlineStyleSheetOwner::createSheet):
1122         Save and use column information later on.
1123
1124         * dom/InlineStyleSheetOwner.h:
1125         * inspector/InspectorStyleSheet.cpp:
1126         (WebCore::InspectorStyleSheet::ensureSourceData):
1127         Updated parser signature needs starting column and no longer has optional parameters.
1128
1129 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
1130
1131         [Mac] Update AirPlay handling
1132         https://bugs.webkit.org/show_bug.cgi?id=142541
1133
1134         Reviewed by Sam Weinig.
1135
1136         * WebCore.xcodeproj/project.pbxproj:
1137         * dom/Document.cpp:
1138         (WebCore::Document::showPlaybackTargetPicker):
1139         (WebCore::Document::addPlaybackTargetPickerClient):
1140         (WebCore::Document::removePlaybackTargetPickerClient):
1141         (WebCore::Document::configurePlaybackTargetMonitoring):
1142         (WebCore::Document::requiresPlaybackTargetRouteMonitoring):
1143         (WebCore::Document::playbackTargetAvailabilityDidChange):
1144         (WebCore::Document::didChoosePlaybackTarget):
1145         * dom/Document.h:
1146         * html/HTMLMediaElement.cpp:
1147         (WebCore::HTMLMediaElement::registerWithDocument):
1148         (WebCore::HTMLMediaElement::unregisterWithDocument):
1149         (WebCore::HTMLMediaElement::parseAttribute):
1150         * html/HTMLMediaElement.h:
1151         * html/HTMLMediaSession.cpp:
1152         (WebCore::HTMLMediaSession::HTMLMediaSession):
1153         (WebCore::HTMLMediaSession::registerWithDocument):
1154         (WebCore::HTMLMediaSession::unregisterWithDocument):
1155         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
1156         (WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
1157         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
1158         (WebCore::HTMLMediaSession::didChoosePlaybackTarget):
1159         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
1160         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring):
1161         * html/HTMLMediaSession.h:
1162         * page/ChromeClient.h:
1163         * page/Page.cpp:
1164         (WebCore::Page::didChoosePlaybackTarget):
1165         (WebCore::Page::playbackTargetAvailabilityDidChange):
1166         (WebCore::Page::configurePlaybackTargetMonitoring):
1167         * page/Page.h:
1168         (WebCore::Page::hasWirelessPlaybackTarget):
1169         (WebCore::Page::playbackTarget):
1170         * platform/audio/MediaSession.cpp:
1171         (WebCore::MediaSession::clientDataBufferingTimerFired):
1172         (WebCore::MediaSession::wirelessRoutesAvailableDidChange): Deleted.
1173         * platform/audio/MediaSession.h:
1174         (WebCore::MediaSession::didChoosePlaybackTarget):
1175         (WebCore::MediaSession::externalOutputDeviceAvailableDidChange):
1176         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
1177         (WebCore::MediaSessionClient::setWirelessPlaybackTarget):
1178         * platform/audio/MediaSessionManager.cpp:
1179         (WebCore::MediaSessionManager::wirelessRoutesAvailableChanged): Deleted.
1180         * platform/audio/MediaSessionManager.h:
1181         (WebCore::MediaSessionManager::configureWireLessTargetMonitoring):
1182         * platform/audio/ios/MediaSessionManagerIOS.h:
1183         * platform/audio/ios/MediaSessionManagerIOS.mm:
1184         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1185         (-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
1186         * platform/graphics/AVPlaybackTarget.h: Added.
1187         (WebCore::AVPlaybackTarget::~AVPlaybackTarget):
1188         (WebCore::AVPlaybackTarget::AVPlaybackTarget):
1189         (WebCore::AVPlaybackTarget::setDevicePickerContext):
1190         (WebCore::AVPlaybackTarget::devicePickerContext):
1191         * platform/graphics/AVPlaybackTargetPickerClient.h: Added.
1192         (WebCore::AVPlaybackTargetPickerClient::~AVPlaybackTargetPickerClient):
1193         * platform/graphics/MediaPlayer.cpp:
1194         (WebCore::MediaPlayer::setWirelessPlaybackTarget):
1195         * platform/graphics/MediaPlayer.h:
1196         * platform/graphics/MediaPlayerPrivate.h:
1197         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
1198         * platform/graphics/avfoundation/AVPlaybackTargetMac.mm: Added.
1199         (WebCore::AVPlaybackTarget::encode):
1200         (WebCore::AVPlaybackTarget::decode):
1201         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1203         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1204         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1205         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1206         (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless):
1207         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType):
1208         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
1209         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
1210         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
1211         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
1212         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1213
1214 2015-03-11  Alex Christensen  <achristensen@webkit.org>
1215
1216         [Content Extensions] Add resource type and load type triggers.
1217         https://bugs.webkit.org/show_bug.cgi?id=142422
1218
1219         Reviewed by Benjamin Poulain.
1220
1221         New API tests.
1222
1223         * WebCore.xcodeproj/project.pbxproj:
1224         * contentextensions/ContentExtensionCompiler.cpp:
1225         (WebCore::ContentExtensions::compileRuleList):
1226         * contentextensions/ContentExtensionParser.cpp:
1227         (WebCore::ContentExtensions::getTypeFlags):
1228         (WebCore::ContentExtensions::loadTrigger):
1229         * contentextensions/ContentExtensionRule.h:
1230         * contentextensions/ContentExtensionsBackend.cpp:
1231         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1232         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL): Deleted.
1233         * contentextensions/ContentExtensionsBackend.h:
1234         * contentextensions/DFABytecode.h:
1235         (WebCore::ContentExtensions::instructionSizeWithArguments):
1236         * contentextensions/DFABytecodeCompiler.cpp:
1237         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendConditionalAction):
1238         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1239         * contentextensions/DFABytecodeCompiler.h:
1240         * contentextensions/DFABytecodeInterpreter.cpp:
1241         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1242         * contentextensions/DFABytecodeInterpreter.h:
1243         * loader/ResourceLoadInfo.cpp: Added.
1244         (WebCore::toResourceType):
1245         (WebCore::readResourceType):
1246         (WebCore::readLoadType):
1247         (WebCore::ResourceLoadInfo::isThirdParty):
1248         (WebCore::ResourceLoadInfo::getResourceFlags):
1249         * loader/ResourceLoadInfo.h: Added.
1250         * loader/cache/CachedResourceLoader.cpp:
1251         (WebCore::CachedResourceLoader::requestResource):
1252         * page/UserContentController.cpp:
1253         (WebCore::UserContentController::actionsForResourceLoad):
1254         (WebCore::UserContentController::actionsForURL): Deleted.
1255         * page/UserContentController.h:
1256
1257 2015-03-11  Tim Horton  <timothy_horton@apple.com>
1258
1259         Fix the build.
1260
1261         * page/EventHandler.cpp:
1262         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1263         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
1264         (WebCore::EventHandler::handleMousePressEventTripleClick):
1265         (WebCore::EventHandler::handleMousePressEventSingleClick):
1266
1267 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
1268
1269         <attachment> shouldn't use "user-select: all"
1270         https://bugs.webkit.org/show_bug.cgi?id=142453
1271
1272         Reviewed by Darin Adler.
1273
1274         It turns out that "user-select: all" is rife with bugs; in lieu of fixing them
1275         all (at least for now), let's not use "user-select: all" in the default stylesheet
1276         for <attachment>. It's really overkill anyway, since <attachment> can't have children.
1277         The only "user-select: all" behavior we actually want is select-on-click.
1278         So, we'll implement that in a slightly different way.
1279
1280         Tests: fast/attachment/attachment-select-on-click-inside-user-select-all.html
1281                fast/attachment/attachment-select-on-click.html
1282
1283         * css/html.css:
1284         (attachment):
1285         No more "user-select: all".
1286
1287         (attachment:focus): Deleted.
1288         We stopped using attachment focus a while back and forgot to remove this.
1289
1290         * dom/Node.h:
1291         (WebCore::Node::shouldSelectOnMouseDown):
1292         Add a virtual function that Node subclasses can override to indicate they
1293         should be selected on mouse down.
1294
1295         * html/HTMLAttachmentElement.h:
1296         Override the aforementioned virtual function; <attachment> should always
1297         be selected on mouse down.
1298
1299         * page/EventHandler.cpp:
1300         (WebCore::nodeToSelectOnMouseDownForNode):
1301         Determine which node should be selected when a mousedown hits the given node.
1302         If there's any "user-select: all", we go with the outermost "user-select: all".
1303         Otherwise, we give the node a chance to say that it wants to be selected itself.
1304
1305         (WebCore::expandSelectionToRespectSelectOnMouseDown):
1306         Rename this function, it's not just about "user-select: all" anymore.
1307         Make use of nodeToSelectOnMouseDownForNode.
1308
1309         (WebCore::EventHandler::selectClosestWordFromHitTestResult):
1310         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent):
1311         (WebCore::EventHandler::handleMousePressEventTripleClick):
1312         (WebCore::EventHandler::handleMousePressEventSingleClick):
1313         (WebCore::expandSelectionToRespectUserSelectAll): Deleted.
1314         Adjust to the new names.
1315
1316 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
1317
1318         Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
1319         https://bugs.webkit.org/show_bug.cgi?id=142595
1320
1321         Reviewed by Andreas Kling.
1322
1323         Fixed this bug for canvas.
1324
1325         * html/HTMLCanvasElement.cpp:
1326         (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
1327         required by our IDL generator.
1328
1329         (WebCore::HTMLCanvasElement::createImageBuffer): Use
1330         reportExtraMemoryAllocated.
1331
1332         * html/HTMLCanvasElement.h:
1333
1334         * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
1335         right way during GC. This will match our reportExtraMemoryAllocated
1336         with a reportExtraMemoryVisited during GC.
1337
1338 2015-03-11  Roger Fong  <roger_fong@apple.com>
1339
1340         A number of minor edits to the media controls on OSX.
1341         https://bugs.webkit.org/show_bug.cgi?id=142551.
1342         <rdar://problem/20114707>
1343
1344         Reviewed by Darin Adler.
1345
1346         This covers a slew of minor edits to the new media controls. They are as follows.
1347         Small vertical placements adjustments to inline control elements.
1348         Make sure buttons have no focus outlines.
1349         Expand height of mute box that triggers the volume panel appearing.
1350         Turn all button colors into an slightly transparent white.
1351         Center status display text in fullscreen mode.
1352         Lower position of captions container in fullscreen mode.
1353         Show the controls on when done loading of the video an status display is hidden.
1354
1355         * Modules/mediacontrols/mediaControlsApple.css:
1356         (audio::-webkit-media-controls-panel):
1357         (audio::-webkit-media-controls-panel button:focus):
1358         (audio::-webkit-media-controls-rewind-button):
1359         (audio::-webkit-media-controls-play-button):
1360         (audio::-webkit-media-controls-play-button.paused):
1361         (audio::-webkit-media-controls-panel .mute-box):
1362         (video::-webkit-media-controls-volume-max-button):
1363         (audio::-webkit-media-controls-panel .volume-box):
1364         (video::-webkit-media-controls-volume-min-button):
1365         (audio::-webkit-media-controls-wireless-playback-picker-button):
1366         (audio::-webkit-media-controls-toggle-closed-captions-button):
1367         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
1368         (audio::-webkit-media-controls-fullscreen-button):
1369         (audio::-webkit-media-controls-fullscreen-button.exit):
1370         (audio::-webkit-media-controls-status-display):
1371         (audio::-webkit-media-controls-time-remaining-display):
1372         (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
1373         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
1374         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
1375         (video:-webkit-full-screen::-webkit-media-controls-play-button):
1376         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
1377         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
1378         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
1379         (video:-webkit-full-screen::-webkit-media-controls-status-display):
1380         (video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
1381         (audio::-webkit-media-controls-panel button:active): Deleted.
1382         * Modules/mediacontrols/mediaControlsApple.js:
1383         (Controller.prototype.setStatusHidden):
1384
1385 2015-03-11  Commit Queue  <commit-queue@webkit.org>
1386
1387         Unreviewed, rolling out r179340 and r179344.
1388         https://bugs.webkit.org/show_bug.cgi?id=142598
1389
1390         Caused images to stay alive forever when navigating away from
1391         the page before they finish loading. (Requested by kling on
1392         #webkit).
1393
1394         Reverted changesets:
1395
1396         "CachedImage: ensure clients overrides imageChanged instead of
1397         notifyFinished"
1398         https://bugs.webkit.org/show_bug.cgi?id=140722
1399         http://trac.webkit.org/changeset/179340
1400
1401         "HTMLImageLoader: fix build failure on assert condition after
1402         r179340"
1403         https://bugs.webkit.org/show_bug.cgi?id=140722
1404         http://trac.webkit.org/changeset/179344
1405
1406 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
1407
1408         Many users of Heap::reportExtraMemory* are wrong, causing lots of memory growth
1409         https://bugs.webkit.org/show_bug.cgi?id=142593
1410
1411         Reviewed by Andreas Kling.
1412
1413         Adopt deprecatedReportExtraMemory as a short-term fix for runaway
1414         memory growth in these cases where we have not adopted
1415         reportExtraMemoryVisited.
1416
1417         Long-term, we should use reportExtraMemoryAllocated+reportExtraMemoryVisited.
1418         That's tracked by https://bugs.webkit.org/show_bug.cgi?id=142595.
1419
1420         Using IOSDebug, I can see that the canvas stress test @ http://jsfiddle.net/fvyw4ba0/,
1421         which used to keep > 1000 1MB NonVolatile GPU allocations live, now keeps about 10 live.
1422
1423         * Modules/mediasource/SourceBuffer.cpp:
1424         (WebCore::SourceBuffer::reportExtraMemoryAllocated):
1425         * bindings/js/JSDocumentCustom.cpp:
1426         (WebCore::toJS):
1427         * bindings/js/JSImageDataCustom.cpp:
1428         (WebCore::toJS):
1429         * bindings/js/JSNodeListCustom.cpp:
1430         (WebCore::createWrapper):
1431         * dom/CollectionIndexCache.cpp:
1432         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
1433         * html/HTMLCanvasElement.cpp:
1434         (WebCore::HTMLCanvasElement::createImageBuffer):
1435         * html/HTMLImageLoader.cpp:
1436         (WebCore::HTMLImageLoader::imageChanged):
1437         * html/HTMLMediaElement.cpp:
1438         (WebCore::HTMLMediaElement::parseAttribute):
1439         * xml/XMLHttpRequest.cpp:
1440         (WebCore::XMLHttpRequest::dropProtection):
1441
1442 2015-03-10  Andy Estes  <aestes@apple.com>
1443
1444         REGRESSION (r180985): contentfiltering/block-after-add-data.html crashes with GuardMalloc
1445         https://bugs.webkit.org/show_bug.cgi?id=142526
1446
1447         Reviewed by Darin Adler.
1448
1449         * loader/DocumentLoader.cpp:
1450         (WebCore::DocumentLoader::dataReceived): Don't delete m_contentFilter until after we're done using its replacement data.
1451
1452 2015-03-10  Sam Weinig  <sam@webkit.org>
1453
1454         Allow adding a button in input elements for auto fill related functionality
1455         <rdar://problem/19782066>
1456         https://bugs.webkit.org/show_bug.cgi?id=142564
1457
1458         Reviewed by Anders Carlsson.
1459
1460         Test: fast/forms/input-auto-fill-button.html
1461
1462         - Adds a new button that can be shown in <input> elements - AutoFillButtonElement.
1463         - Makes the spelling of AutoFill consistent throughout WebCore and WebKit (except
1464           where not feasible due to exported API/SPI).
1465
1466         * CMakeLists.txt:
1467         * WebCore.vcxproj/WebCore.vcxproj:
1468         * WebCore.vcxproj/WebCore.vcxproj.filters:
1469         * WebCore.xcodeproj/project.pbxproj:
1470         Add new files.
1471
1472         * css/html.css:
1473         (input::-webkit-auto-fill-button):
1474         (input::-webkit-auto-fill-button:hover):
1475         (input::-webkit-auto-fill-button:active):
1476         Add default style rules for the AutoFill button based on the ones
1477         used for caps lock indicator.
1478
1479         * html/HTMLInputElement.cpp:
1480         (WebCore::HTMLInputElement::HTMLInputElement):
1481         (WebCore::HTMLInputElement::autoFillButtonElement):
1482         (WebCore::HTMLInputElement::reset):
1483         (WebCore::HTMLInputElement::setValueFromRenderer):
1484         (WebCore::HTMLInputElement::setAutoFilled):
1485         (WebCore::HTMLInputElement::setShowAutoFillButton):
1486         (WebCore::HTMLInputElement::setAutofilled): Deleted.
1487         * html/HTMLInputElement.h:
1488         (WebCore::HTMLInputElement::isAutoFilled):
1489         (WebCore::HTMLInputElement::showAutoFillButton):
1490         (WebCore::HTMLInputElement::isAutofilled): Deleted.
1491         Add new bit to represent whether the AutoFill button should be shown
1492         or not. By default it is not shown, and the client must enable it.
1493
1494         * html/InputType.cpp:
1495         (WebCore::InputType::updateAutoFillButton):
1496         * html/InputType.h:
1497         (WebCore::InputType::autoFillButtonElement):
1498         Add new virtual methods for updating and accessing the AutoFill button.
1499
1500         * html/TextFieldInputType.cpp:
1501         (WebCore::TextFieldInputType::createShadowSubtree):
1502         (WebCore::TextFieldInputType::autoFillButtonElement):
1503         (WebCore::TextFieldInputType::destroyShadowSubtree):
1504         (WebCore::TextFieldInputType::updatePlaceholderText):
1505         (WebCore::TextFieldInputType::shouldDrawAutoFillButton):
1506         (WebCore::TextFieldInputType::autoFillButtonElementWasClicked):
1507         (WebCore::TextFieldInputType::createContainer):
1508         (WebCore::TextFieldInputType::createAutoFillButton):
1509         (WebCore::TextFieldInputType::updateAutoFillButton):
1510         * html/TextFieldInputType.h:
1511         Add support for adding the AutoFill to the shadow DOM of textfields. The implementation
1512         is slightly different than for the caps lock indicator, because I didn't want to force
1513         the creation of a container for all <input> elements just in case an AutoFill button was
1514         added. Instead, if an AutoFill button is added, the container is created on the fly and
1515         the existing DOM is updated to move into it. Once a container is created, it is never
1516         removed.
1517
1518         * html/shadow/AutoFillButtonElement.cpp: Added.
1519         (WebCore::AutoFillButtonElement::create):
1520         (WebCore::AutoFillButtonElement::AutoFillButtonElement):
1521         (WebCore::AutoFillButtonElement::defaultEventHandler):
1522         * html/shadow/AutoFillButtonElement.h: Added.
1523         Add div subclass that swallows the click event and forwards it to the ChromeClient.
1524
1525         * page/ChromeClient.h:
1526         Add handleAutoFillButtonClick client function to inform WebKit that the AutoFill
1527         button was clicked.
1528
1529         * testing/Internals.cpp:
1530         (WebCore::Internals::setAutofilled):
1531         (WebCore::Internals::setShowAutoFillButton):
1532         * testing/Internals.h:
1533         * testing/Internals.idl:
1534         Expose a new internals.setShowAutoFillButton() function to allow testing
1535         of the AutoFill button from layout tests.
1536
1537         * accessibility/AccessibilityObject.cpp:
1538         (WebCore::AccessibilityObject::isValueAutofilled):
1539         * css/SelectorCheckerTestFunctions.h:
1540         (WebCore::isAutofilled):
1541         * css/StyleResolver.cpp:
1542         (WebCore::StyleResolver::canShareStyleWithControl):
1543         Update for new spelling of AutoFill.
1544
1545 2015-03-11  Geoffrey Garen  <ggaren@apple.com>
1546
1547         Refactored the JSC::Heap extra cost API for clarity and to make some known bugs more obvious
1548         https://bugs.webkit.org/show_bug.cgi?id=142589
1549
1550         Reviewed by Andreas Kling.
1551
1552         Updated for renames to JSC extra cost APIs.
1553
1554         Added FIXMEs to our 10 use cases that are currently wrong, including
1555         canvas, which is the cause of https://bugs.webkit.org/show_bug.cgi?id=142457.
1556
1557         * Modules/mediasource/SourceBuffer.cpp:
1558         (WebCore::SourceBuffer::appendBufferInternal):
1559         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
1560         (WebCore::SourceBuffer::reportExtraMemoryAllocated):
1561         (WebCore::SourceBuffer::reportExtraMemoryCost): Deleted.
1562         * Modules/mediasource/SourceBuffer.h:
1563         * bindings/js/JSDocumentCustom.cpp:
1564         (WebCore::toJS):
1565         * bindings/js/JSImageDataCustom.cpp:
1566         (WebCore::toJS):
1567         * bindings/js/JSNodeListCustom.cpp:
1568         (WebCore::createWrapper):
1569         * bindings/scripts/CodeGeneratorJS.pm:
1570         (GenerateImplementation):
1571         * dom/CollectionIndexCache.cpp:
1572         (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
1573         (WebCore::reportExtraMemoryCostForCollectionIndexCache): Deleted.
1574         * dom/CollectionIndexCache.h:
1575         (WebCore::Iterator>::computeNodeCountUpdatingListCache):
1576         * html/HTMLCanvasElement.cpp:
1577         (WebCore::HTMLCanvasElement::createImageBuffer):
1578         * html/HTMLCollection.h:
1579         (WebCore::CollectionNamedElementCache::didPopulate):
1580         * html/HTMLImageLoader.cpp:
1581         (WebCore::HTMLImageLoader::imageChanged):
1582         * html/HTMLMediaElement.cpp:
1583         (WebCore::HTMLMediaElement::parseAttribute):
1584         * xml/XMLHttpRequest.cpp:
1585         (WebCore::XMLHttpRequest::dropProtection):
1586
1587 2015-03-11  Benjamin Poulain  <bpoulain@apple.com>
1588
1589         Add basic support for BOL and EOL assertions to the URL Filter parser
1590         https://bugs.webkit.org/show_bug.cgi?id=142568
1591
1592         Reviewed by Alex Christensen.
1593
1594         This patch adds heavily restricted support for BOL and EOL to the URL filter parser.
1595
1596         Both assertions must be the first/last term of their pattern. Any advanced combination
1597         results in a parsing error.
1598
1599         The BOL assertion is easy to represent: currently, any pattern starts at the beginning
1600         of a line and the NFA are generated accordingly.
1601
1602         I had two options to represent the EOL assertion:
1603         1) Add a new special transition on EOL.
1604         2) Add a new vector of actions to the states, conditional to the EOL input.
1605
1606         I picked the first option to avoid growing every state by a vector
1607         that would be empty in the vast majority of cases.
1608
1609
1610         On the matching side, the interpreter was modified to support transitions on '\0'.
1611         DFABytecodeInstruction::CheckValue now stops when running on a character after
1612         the end of the string.
1613
1614         DFABytecodeInstruction::Jump gets two fixes: First we now account for the index
1615         to avoid going past the end of the input. Second, stop on '\0' too... the reason
1616         is that the unconditional jump is only used for fallback edges of the DFA, fallback
1617         edge are not supposed to accept '\0'.
1618
1619         * contentextensions/DFA.cpp:
1620         (WebCore::ContentExtensions::printTransitions):
1621         * contentextensions/DFABytecodeInterpreter.cpp:
1622         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1623         * contentextensions/DFANode.h:
1624         * contentextensions/NFA.cpp:
1625         (WebCore::ContentExtensions::NFA::addTransition):
1626         (WebCore::ContentExtensions::NFA::addEpsilonTransition):
1627         (WebCore::ContentExtensions::printTransitions):
1628         * contentextensions/NFANode.h:
1629         * contentextensions/NFAToDFA.cpp:
1630         (WebCore::ContentExtensions::populateTransitions):
1631         (WebCore::ContentExtensions::NFAToDFA::convert):
1632         * contentextensions/URLFilterParser.cpp:
1633         (WebCore::ContentExtensions::Term::Term):
1634         (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
1635         (WebCore::ContentExtensions::GraphBuilder::assertionBOL):
1636         (WebCore::ContentExtensions::GraphBuilder::assertionEOL):
1637         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
1638
1639 2015-03-11  Jer Noble  <jer.noble@apple.com>
1640
1641         [Mac] Update fullscreen placeholder UI to use Vibrancy.
1642         https://bugs.webkit.org/show_bug.cgi?id=142586
1643
1644         Reviewed by Eric Carlson.
1645
1646         Update the fullscreen placeholder with a translucent vibrant appearance
1647         using NSVisualEffectView. Since NSVisuaEffectView is only available for
1648         OS X 10.10 and above, wrap the new implementation in a version check and
1649         retain the old implementation.
1650
1651         Drive-by: Update the strings for the placeholder view with new HI guidance
1652         as well.
1653
1654         * English.lproj/Localizable.strings:
1655         * platform/LocalizedStrings.cpp:
1656         (WebCore::clickToExitFullScreenText):
1657         * platform/mac/WebCoreFullScreenPlaceholderView.h:
1658         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1659         (-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]):
1660
1661 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
1662
1663         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
1664         https://bugs.webkit.org/show_bug.cgi?id=142549
1665
1666         Reviewed by Simon Fraser.
1667
1668         * page/ViewportConfiguration.cpp:
1669         (WebCore::ViewportConfiguration::ViewportConfiguration):
1670         Rename m_ignoreScalingConstraints to m_canIgnoreScalingConstraints,
1671         because it being true does not guarantee that we will ignore scaling constraints,
1672         but it being false does guarantee that we won't.
1673
1674         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraints):
1675         Ignore scaling constraints if the page:
1676             a) claimed to want to lay out to device-width and then laid out too wide
1677             b) claimed to want to lay out to device-height and then laid out too tall
1678             c) claimed to want to lay out with initialScale=1 and then laid out too wide
1679
1680         (WebCore::ViewportConfiguration::initialScale):
1681         (WebCore::ViewportConfiguration::minimumScale):
1682         (WebCore::ViewportConfiguration::allowsUserScaling):
1683         Call shouldIgnoreScalingConstraints() instead of looking at the local, so we can
1684         have some more logic here (as above).
1685
1686         (WebCore::ViewportConfiguration::description):
1687         Dump whether we're ignoring scaling constraints.
1688
1689         (WebCore::ViewportConfiguration::dump):
1690         Use WTFLogAlways so that the output goes to various other logging mechanisms
1691         instead of just stderr.
1692
1693         * page/ViewportConfiguration.h:
1694         (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints):
1695         (WebCore::ViewportConfiguration::setIgnoreScalingConstraints): Deleted.
1696
1697 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
1698
1699         Use out-of-band messaging for RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline()
1700         https://bugs.webkit.org/show_bug.cgi?id=142569
1701
1702         Reviewed by David Hyatt.
1703
1704         Currently, RenderBox::firstLineBaseline() and RenderBox::inlineBlockBaseline() return -1 to mean
1705         that its baseline should be skipped. Instead of using this sentinel value, this patch changes the
1706         return type from int to Optional<int>.
1707
1708         No new tests because there is no behavior change.
1709
1710         * rendering/RenderBlock.cpp:
1711         (WebCore::RenderBlock::baselinePosition):
1712         (WebCore::RenderBlock::firstLineBaseline):
1713         (WebCore::RenderBlock::inlineBlockBaseline):
1714         * rendering/RenderBlock.h:
1715         * rendering/RenderBlockFlow.cpp:
1716         (WebCore::RenderBlockFlow::firstLineBaseline):
1717         (WebCore::RenderBlockFlow::inlineBlockBaseline):
1718         * rendering/RenderBlockFlow.h:
1719         * rendering/RenderBox.h:
1720         (WebCore::RenderBox::firstLineBaseline):
1721         (WebCore::RenderBox::inlineBlockBaseline):
1722         * rendering/RenderDeprecatedFlexibleBox.cpp:
1723         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1724         * rendering/RenderFlexibleBox.cpp:
1725         (WebCore::RenderFlexibleBox::baselinePosition):
1726         (WebCore::RenderFlexibleBox::firstLineBaseline):
1727         (WebCore::RenderFlexibleBox::inlineBlockBaseline):
1728         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
1729         * rendering/RenderFlexibleBox.h:
1730         * rendering/RenderMenuList.h:
1731         * rendering/RenderTable.cpp:
1732         (WebCore::RenderTable::cellAbove):
1733         (WebCore::RenderTable::cellBelow):
1734         (WebCore::RenderTable::cellBefore):
1735         (WebCore::RenderTable::cellAfter):
1736         (WebCore::RenderTable::firstLineBlock):
1737         (WebCore::RenderTable::baselinePosition):
1738         (WebCore::RenderTable::inlineBlockBaseline):
1739         (WebCore::RenderTable::firstLineBaseline):
1740         * rendering/RenderTable.h:
1741         * rendering/RenderTableCell.cpp:
1742         (WebCore::RenderTableCell::cellBaselinePosition):
1743         * rendering/RenderTableSection.cpp:
1744         (WebCore::RenderTableSection::firstLineBaseline):
1745         * rendering/RenderTableSection.h:
1746         * rendering/RenderTextControl.h:
1747         * rendering/mathml/RenderMathMLBlock.cpp:
1748         (WebCore::RenderMathMLBlock::baselinePosition):
1749         (WebCore::RenderMathMLTable::firstLineBaseline):
1750         * rendering/mathml/RenderMathMLBlock.h:
1751         * rendering/mathml/RenderMathMLFraction.cpp:
1752         (WebCore::RenderMathMLFraction::firstLineBaseline):
1753         * rendering/mathml/RenderMathMLFraction.h:
1754         * rendering/mathml/RenderMathMLOperator.cpp:
1755         (WebCore::RenderMathMLOperator::firstLineBaseline):
1756         * rendering/mathml/RenderMathMLOperator.h:
1757         * rendering/mathml/RenderMathMLRoot.cpp:
1758         (WebCore::RenderMathMLRoot::firstLineBaseline):
1759         (WebCore::RenderMathMLRoot::layout):
1760         * rendering/mathml/RenderMathMLRoot.h:
1761         * rendering/mathml/RenderMathMLRow.cpp:
1762         (WebCore::RenderMathMLRow::layout):
1763         * rendering/mathml/RenderMathMLScripts.cpp:
1764         (WebCore::RenderMathMLScripts::layout):
1765         (WebCore::RenderMathMLScripts::firstLineBaseline):
1766         * rendering/mathml/RenderMathMLScripts.h:
1767         * rendering/mathml/RenderMathMLSpace.cpp:
1768         (WebCore::RenderMathMLSpace::firstLineBaseline):
1769         * rendering/mathml/RenderMathMLSpace.h:
1770         * rendering/mathml/RenderMathMLUnderOver.cpp:
1771         (WebCore::RenderMathMLUnderOver::firstLineBaseline):
1772         * rendering/mathml/RenderMathMLUnderOver.h:
1773
1774 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
1775
1776         <attachment>s should be created when dropping files onto contentEditable areas
1777         https://bugs.webkit.org/show_bug.cgi?id=142494
1778         <rdar://problem/19982553>
1779
1780         Reviewed by Anders Carlsson.
1781
1782         Covered by existing tests.
1783
1784         * editing/mac/EditorMac.mm:
1785         (WebCore::Editor::WebContentReader::readFilenames):
1786         Instead of inserting the dropped URLs as strings, make an <attachment>
1787         for each.
1788
1789 2015-03-11  David Hyatt  <hyatt@apple.com>
1790
1791         Optimize offsetWidth and offsetHeight to avoid doing layouts.
1792         https://bugs.webkit.org/show_bug.cgi?id=142544
1793
1794         Reviewed by Beth Dakin.
1795
1796         * dom/Document.cpp:
1797         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1798         * dom/Document.h:
1799         Added a new method that only updates layout if it determines that the desired dimensions are out
1800         of date.
1801
1802         * dom/Element.cpp:
1803         (WebCore::Element::offsetWidth):
1804         (WebCore::Element::offsetHeight):
1805         Patch offsetWidth and offsetHeight to call the new method rather than updateLayoutIgnorePendingStylesheets.
1806
1807 2015-03-11  Commit Queue  <commit-queue@webkit.org>
1808
1809         Unreviewed, rolling out r181367.
1810         https://bugs.webkit.org/show_bug.cgi?id=142581
1811
1812         Caused crashes on the debug bots (Requested by cdumez on
1813         #webkit).
1814
1815         Reverted changeset:
1816
1817         "Web Inspector: CSS parser errors in the console should
1818         include column numbers"
1819         https://bugs.webkit.org/show_bug.cgi?id=114313
1820         http://trac.webkit.org/changeset/181367
1821
1822 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
1823
1824         Inline block children do not have correct baselines if their children are also block elements
1825         https://bugs.webkit.org/show_bug.cgi?id=142559
1826
1827         Reviewed by Darin Adler.
1828
1829         Perform the same computation on child block elements as child inline elements.
1830
1831         Test: fast/text/baseline-inline-block-block-children.html
1832
1833         * rendering/RenderBlockFlow.cpp:
1834         (WebCore::RenderBlockFlow::inlineBlockBaseline):
1835
1836 2015-03-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1837
1838         [CMake][GStreamer] Building EFL or GTK with ENABLE_VIDEO and without ENABLE_WEB_AUDIO is broken.
1839         https://bugs.webkit.org/show_bug.cgi?id=142577
1840
1841         Reviewed by Carlos Garcia Campos.
1842
1843         No new tests, this is a build fix.
1844
1845         * PlatformEfl.cmake: Include GSTREAMER_AUDIO_LIBRARIES on the link step both for ENABLE_VIDEO and ENABLE_WEB_AUDIO.
1846         * PlatformGTK.cmake: Idem.
1847
1848 2015-03-10  Philippe Normand  <pnormand@igalia.com>
1849
1850         Rename MediaStreamCenter to RealtimeMediaSourceCenter
1851         https://bugs.webkit.org/show_bug.cgi?id=142535
1852
1853         Reviewed by Eric Carlson.
1854
1855         As per bug title, rename MediaStreamCenter to
1856         RealtimeMediaSourceCenter, this class manages
1857         RealtimeMediaSources, not MediaStreams. Some un-needed includes of
1858         the header were also removed.
1859
1860 2015-03-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1861
1862         Remove unnecessary create() factory functions
1863         https://bugs.webkit.org/show_bug.cgi?id=142558
1864
1865         Reviewed by Darin Adler.
1866
1867         create() function which just returns new instance can be replaced with std::make_unique<>.
1868
1869         No new tests, no behavior changes.
1870
1871         * bindings/js/JSCryptoKeySerializationJWK.cpp:
1872         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
1873         * crypto/keys/CryptoKeyAES.cpp:
1874         (WebCore::CryptoKeyAES::exportData):
1875         * crypto/keys/CryptoKeyDataOctetSequence.h:
1876         * crypto/keys/CryptoKeyHMAC.cpp:
1877         (WebCore::CryptoKeyHMAC::exportData):
1878         * crypto/keys/CryptoKeySerializationRaw.cpp:
1879         (WebCore::CryptoKeySerializationRaw::keyData):
1880         * platform/audio/mac/CARingBuffer.cpp:
1881         (WebCore::CARingBuffer::create): Deleted.
1882         * platform/audio/mac/CARingBuffer.h:
1883         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1884         (WebCore::AudioSourceProviderAVFObjC::prepare):
1885         * testing/Internals.cpp:
1886         (WebCore::Internals::queueMicroTask):
1887         * testing/MicroTaskTest.cpp:
1888         (WebCore::MicroTaskTest::create): Deleted.
1889         * testing/MicroTaskTest.h:
1890         (WebCore::MicroTaskTest::MicroTaskTest):
1891
1892 2015-03-10  Joseph Pecoraro  <pecoraro@apple.com>
1893
1894         Web Inspector: CSS parser errors in the console should include column numbers
1895         https://bugs.webkit.org/show_bug.cgi?id=114313
1896
1897         Reviewed by Benjamin Poulain.
1898
1899         Test: inspector-protocol/console/warnings-errors.html
1900
1901         * css/CSSParser.h:
1902         (WebCore::CSSParser::currentCharacterOffset):
1903         Get the current character offset depending on the source type.
1904         Add instance variables to track column position and start
1905         line / column for inline stylesheets.
1906
1907         * css/CSSParser.cpp:
1908         (WebCore::CSSParser::CSSParser):
1909         (WebCore::CSSParser::parseSheet):
1910         Initialize new instance variables.
1911
1912         (WebCore::CSSParser::currentLocation):
1913         Update to include column information. Also, if we are on the first line
1914         we may need to take into account a start column offset as well.
1915
1916         (WebCore::CSSParser::realLex):
1917         When bumping the line number, reset the column offset for the next
1918         line with the next character.
1919
1920         (WebCore::CSSParser::syntaxError):
1921         (WebCore::CSSParser::logError):
1922         Include column information.
1923
1924         * css/StyleSheetContents.cpp:
1925         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1926         (WebCore::StyleSheetContents::parseString):
1927         (WebCore::StyleSheetContents::parseStringAtLineAndColumn):
1928         Include column information.
1929
1930         * css/StyleSheetContents.h:
1931         * dom/InlineStyleSheetOwner.cpp:
1932         (WebCore::InlineStyleSheetOwner::InlineStyleSheetOwner):
1933         (WebCore::InlineStyleSheetOwner::createSheet):
1934         Save and use column information later on.
1935
1936         * dom/InlineStyleSheetOwner.h:
1937         * inspector/InspectorStyleSheet.cpp:
1938         (WebCore::InspectorStyleSheet::ensureSourceData):
1939         Updated parser signature needs starting column and no longer has optional parameters.
1940
1941 2015-03-10  Darin Adler  <darin@apple.com>
1942
1943         Try to fix the GTK build.
1944
1945         * html/HTMLVideoElement.idl: Work around gobject bindings generator limitation
1946         by putting in a LANGUAGE_GOBJECT conditional.
1947
1948 2015-03-10  Darin Adler  <darin@apple.com>
1949
1950         Some event handler fixes
1951         https://bugs.webkit.org/show_bug.cgi?id=142474
1952
1953         Reviewed by Anders Carlsson.
1954
1955         * bindings/scripts/CodeGenerator.pm:
1956         (GenerateConditionalStringFromAttributeValue): Improved the algorithm here to
1957         handle combinations of & and | in conditional expressions; that's coming up when
1958         combining conditionals for includes in NavigatorContentUtils.idl.
1959
1960         * bindings/scripts/CodeGeneratorJS.pm:
1961         (AddToImplIncludes): Removed the rudimentary attempt to split and merge
1962         conditionals involving | here; instead we rely on the rules in the
1963         GenerateConditionalStringFromAttributeValue to handle this.
1964         (GenerateImplementation): Passed new "conditional" argument to JSValueToNative.
1965         (GenerateParametersCheck): Pass "conditional" argument to AddToImplIncludes and
1966         JSValueToNative.
1967         (JSValueToNative): Changed to take "conditional" as an argument, since getting
1968         it from the signature won't work for a method parameter.
1969         (WriteData): Merge duplicates based on the result of the
1970         GenerateConditionalStringFromAttributeValue function rather than on the values
1971         passed into that function, since that function converts conditionals into a
1972         canonical form and can make two strings equal that don't start out that way.
1973
1974         * bindings/scripts/CodeGeneratorObjC.pm:
1975         (SkipAttribute): Added code to guarantee we won't make Objective-C bindings
1976         for event handlers. We will rename EventListener to EventHandler in a
1977         subsequent patch.
1978
1979         * bindings/scripts/test/JS/JSTestInterface.cpp: Updated for a progression caused
1980         by the better logic for conditional includes.
1981
1982         * bindings/scripts/test/JS/JSTestObj.cpp: Updated for change to the test below.
1983         * bindings/scripts/test/TestObj.idl: Added test of an event handler attribute.
1984
1985         * dom/Document.idl: Removed unneeded language #if around event handler
1986         attributes. Removed all the commented out event handler attributes.
1987         Sorted event handler attributes into a single section rather than separating
1988         "standard" from "extensions". Sorted the conditional event handler attributes
1989         into paragraphs at the bottom. We will probably make them all unconditional
1990         in a subsequent patch.
1991
1992         * dom/Element.idl: Removed unneeded language #if around event handler
1993         attributes. Removed all the commented out event handler attributes.
1994         Moved event handler attributes here from all derived element classes to
1995         match the approach from the HTML standard. Also resorted the attributes
1996         as in Document above.
1997
1998         * html/HTMLBodyElement.idl: Removed unneeded language #if around event handler
1999         attributes. Removed all the commented out event handler attributes.
2000         Sorted event handler attributes into a single section rather than separating
2001         "standard" from "overrides".
2002
2003         * html/HTMLElement.cpp:
2004         (WebCore::HTMLElement::populateEventNameForAttributeLocalNameMap):
2005         Added a few missing attribute names, and re-sorted a bit. Moved any from
2006         element subclasses here.
2007
2008         * html/HTMLFormElement.cpp:
2009         (WebCore::HTMLFormElement::parseAttribute): Moved code to handle
2010         oncomplete and oncompleteerror to Element and HTMLElement.
2011         * html/HTMLFormElement.idl: Ditto.
2012
2013         * html/HTMLFrameSetElement.idl: Removed #if and resorted as above.
2014
2015         * html/HTMLInputElement.cpp:
2016         (WebCore::HTMLInputElement::parseAttribute): Moved code to handle
2017         onsearch to HTMLElement.
2018
2019         * html/HTMLMediaElement.cpp:
2020         (WebCore::HTMLMediaElement::parseAttribute): Moved code to handle
2021         all the event handler attributes to HTMLElement.
2022         (WebCore::HTMLMediaElement::updateCaptionContainer): Removed a redundant
2023         if statement I noticed while auditing all calls to JSC::call.
2024         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Added clearException.
2025         I noticed this was missing because a flawed earlier version of my patch was
2026         causing the script to fail, leaving an exception behind that caused an
2027         assertion later. So I audited all calls to JSC::call looking for this mistake.
2028
2029         * html/HTMLMediaElement.idl: Moved all the event handlers from here to
2030         Element. Also changed everything possible to use Conditional instead of #if.
2031
2032         * html/HTMLPlugInImageElement.cpp:
2033         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Added
2034         clearException. Noticed it was missing while auditing all calls to JSC::call.
2035
2036         * html/HTMLVideoElement.cpp:
2037         (WebCore::HTMLVideoElement::parseAttribute): Moved event handler code to
2038         HTMLElement.
2039
2040         * html/HTMLVideoElement.idl: Moved event handler to Element.idl and use
2041         Conditional instead of #if.
2042
2043         * page/DOMWindow.idl: Use Conditional instead of #if and tidy up the event
2044         handlers section.
2045
2046         * svg/svgattrs.in: Remove six unused attribute names. Presumably used in
2047         some older scheme to implement event handlers but no longer used at all.
2048
2049 2015-03-10  Brent Fulgham  <bfulgham@apple.com>
2050
2051         CSS scroll-snap-destination and scroll-snap-coordinate are not honoring position values
2052         https://bugs.webkit.org/show_bug.cgi?id=142411
2053
2054         Reviewed by Simon Fraser.
2055
2056         Tested by css3/scroll-snap/scroll-snap-position-values.html.
2057
2058         Revise the CSSParser to recognize that scroll-snap-coordinates and scroll-snap-destination
2059         may be specified as positions, therefore allowing 'top', 'bottom', and 'center' for the Y axis,
2060         and 'left', 'right', and 'center' for the X axis.
2061
2062         Correct implementation to support calculated values for Scroll Snap Point markup. This required the
2063         Scroll Snap Point-specific LengthRepeat class to change its internal representation from a CSSPrimitiveValue
2064         to a regular CSSValue.
2065
2066         Add tests that these position labels, as well as combinations with percentages and pixel offsets
2067         are parsed properly.
2068
2069         * css/CSSComputedStyleDeclaration.cpp:
2070         (WebCore::scrollSnapDestination): Switch from 'percentageOrZoomAdjustedValue' to 'zoomAdjustedPixelValueForLength'
2071         when working with Length values. This is necessary to allow calculated results to be based on the proper default
2072         page dimensions.
2073         (WebCore::scrollSnapPoints): Ditto.
2074         (WebCore::scrollSnapCoordinates): Ditto.
2075         * css/CSSParser.cpp:
2076         (WebCore::CSSParser::parseScrollSnapPositions): Consolidated code for dealing with snap point
2077         positions.
2078         (WebCore::CSSParser::parseScrollSnapDestination): Revise to call new helper function.
2079         (WebCore::CSSParser::parseScrollSnapCoordinate): Ditto.
2080         (WebCore::CSSParser::parseFillPositionX): Rename as parsePositionX.
2081         (WebCore::CSSParser::parseFillPositionY): Rename as parsePositionY.
2082         (WebCore::CSSParser::parseFillProperty): Update to call renamed parsePosition{X|Y} methods.
2083         (WebCore::CSSParser::parseTransformOrigin): Ditto.
2084         (WebCore::CSSParser::parsePerspectiveOrigin): Ditto.
2085         * css/CSSParser.h:
2086         * css/LengthRepeat.h: Revise class to use a CSSValue, rather than a CSSPrimitiveValue, so that we can represent
2087         repeat values as calculations.
2088
2089 2015-03-10  Enrica Casucci  <enrica@apple.com>
2090
2091         Add support for more emoji with variation.
2092         https://bugs.webkit.org/show_bug.cgi?id=142548
2093         rdar://problem/20105008
2094
2095         Reviewed by Tim Horton.
2096
2097         Update ICU rules to support new emoji with variation.
2098
2099         Test: editing/selection/extend-by-character-007.html
2100
2101         * platform/text/TextBreakIterator.cpp:
2102         (WebCore::cursorMovementIterator):
2103
2104 2015-03-10  Alex Christensen  <achristensen@webkit.org>
2105
2106         Use unsigned for HashSet size.
2107         https://bugs.webkit.org/show_bug.cgi?id=142518
2108
2109         Reviewed by Benjamin Poulain.
2110
2111         * Modules/websockets/WebSocketDeflateFramer.cpp:
2112         (WebCore::WebSocketExtensionDeflateFrame::processResponse):
2113         * bindings/js/SerializedScriptValue.cpp:
2114         (WebCore::CloneSerializer::checkForDuplicate):
2115         (WebCore::CloneSerializer::writeConstantPoolIndex):
2116         * dom/ScriptRunner.cpp:
2117         (WebCore::ScriptRunner::~ScriptRunner):
2118         * loader/ResourceLoadScheduler.h:
2119         * platform/graphics/Font.cpp:
2120         (WebCore::Font::systemFallbackFontForCharacter):
2121         * platform/graphics/FontCache.cpp:
2122         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
2123         (WebCore::FontCache::purgeInactiveFontData):
2124         * platform/graphics/FontCache.h:
2125         * platform/graphics/freetype/FontCacheFreeType.cpp:
2126         (WebCore::FontCache::systemFallbackForCharacters):
2127         * platform/graphics/ios/FontCacheIOS.mm:
2128         (WebCore::FontCache::getSystemFontFallbackForCharacters):
2129         (WebCore::FontCache::systemFallbackForCharacters):
2130         (WebCore::FontCache::similarFont):
2131         * platform/graphics/mac/FontCacheMac.mm:
2132         (WebCore::shouldAutoActivateFontIfNeeded):
2133         (WebCore::FontCache::systemFallbackForCharacters):
2134         (WebCore::FontCache::similarFont):
2135         * platform/graphics/win/FontCacheWin.cpp:
2136         (WebCore::FontCache::systemFallbackForCharacters):
2137         * rendering/RenderDeprecatedFlexibleBox.cpp:
2138         (WebCore::FlexBoxIterator::next):
2139         * rendering/RenderTableSection.cpp:
2140         (WebCore::RenderTableSection::computeOverflowFromCells):
2141
2142 2015-03-10  Eric Carlson  <eric.carlson@apple.com>
2143
2144         [Mac] Refactor media controls code
2145         https://bugs.webkit.org/show_bug.cgi?id=142455
2146
2147         Reviewed by Dean Jackson.
2148
2149         No new tests, updated tests/media/hls/video-controls-live-stream-expected.txt.
2150
2151         * Modules/mediacontrols/mediaControlsApple.js:
2152         (Controller):
2153         (Controller.prototype.addVideoListeners):
2154         (Controller.prototype.removeVideoListeners):
2155         (Controller.prototype.createControls):
2156         (Controller.prototype.setControlsType):
2157         (Controller.prototype.configureInlineControls):
2158         (Controller.prototype.updateStatusDisplay):
2159         (Controller.prototype.handlePanelMouseDown):
2160         (Controller.prototype.showControls):
2161         (Controller.prototype.hideControls):
2162         (Controller.prototype.handleOptimizedFullscreenButtonClicked):
2163         (Controller.prototype.currentPlaybackTargetIsWireless):
2164         (Controller.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
2165         (Controller.prototype.updateWirelessPlaybackStatus):
2166         (Controller.prototype.updateWirelessTargetAvailable):
2167         (Controller.prototype.handleWirelessPickerButtonClicked):
2168         (Controller.prototype.handleWirelessPlaybackChange):
2169         (Controller.prototype.handleWirelessTargetAvailableChange):
2170         (Controller.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
2171         * Modules/mediacontrols/mediaControlsiOS.js:
2172         (ControllerIOS):
2173         (ControllerIOS.prototype.addVideoListeners):
2174         (ControllerIOS.prototype.removeVideoListeners):
2175         (ControllerIOS.prototype.createControls):
2176         (ControllerIOS.prototype.setControlsType):
2177         (ControllerIOS.prototype.configureInlineControls):
2178         (ControllerIOS.prototype.showControls):
2179         (ControllerIOS.prototype.handleWirelessPickerButtonTouchEnd):
2180         (ControllerIOS.prototype.updateShouldListenForPlaybackTargetAvailabilityEvent):
2181         (ControllerIOS.prototype.updateStatusDisplay):
2182         (ControllerIOS.prototype.setShouldListenForPlaybackTargetAvailabilityEvent):
2183         (ControllerIOS.prototype.currentPlaybackTargetIsWireless): Deleted.
2184         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Deleted.
2185         (ControllerIOS.prototype.updateWirelessTargetAvailable): Deleted.
2186         (ControllerIOS.prototype.hideControls): Deleted.
2187         (ControllerIOS.prototype.handleWirelessPlaybackChange): Deleted.
2188         (ControllerIOS.prototype.handleWirelessTargetAvailableChange): Deleted.
2189
2190 2015-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2191
2192         Remove PassRefPtr from svg/properties classes.
2193         https://bugs.webkit.org/show_bug.cgi?id=142063.
2194
2195         Reviewed by Darin Adler.
2196         
2197         Remove PassRefPtr from svg/properties classes. All the return types and
2198         the local variables should be RefPtr. If we are sure the pointer can't
2199         be null, we use Ref instead.
2200
2201         * svg/SVGMarkerElement.cpp:
2202         (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper):
2203         (WebCore::SVGMarkerElement::orientTypeAnimated):
2204         * svg/SVGMarkerElement.h:
2205         * svg/SVGPathElement.cpp:
2206         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
2207         (WebCore::SVGPathElement::pathSegList):
2208         (WebCore::SVGPathElement::animatedPathSegList):
2209         * svg/SVGPathElement.h:
2210         * svg/SVGPolyElement.cpp:
2211         (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
2212         (WebCore::SVGPolyElement::points):
2213         (WebCore::SVGPolyElement::animatedPoints):
2214         * svg/SVGPolyElement.h:
2215         * svg/SVGTextContentElement.cpp:
2216         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
2217         (WebCore::SVGTextContentElement::textLengthAnimated):
2218         * svg/SVGTextContentElement.h:
2219         * svg/SVGViewSpec.cpp:
2220         (WebCore::SVGViewSpec::transform):
2221         (WebCore::SVGViewSpec::viewBoxAnimated):
2222         (WebCore::SVGViewSpec::preserveAspectRatioAnimated):
2223         (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper):
2224         (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper):
2225         (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
2226         * svg/SVGViewSpec.h:
2227         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
2228         (WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
2229         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2230         (WebCore::SVGAnimatedListPropertyTearOff::create):
2231         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2232         (WebCore::SVGAnimatedPathSegListPropertyTearOff::create):
2233         * svg/properties/SVGAnimatedProperty.h:
2234         (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper):
2235         * svg/properties/SVGAnimatedPropertyMacros.h:
2236         * svg/properties/SVGAnimatedPropertyTearOff.h:
2237         (WebCore::SVGAnimatedPropertyTearOff::create):
2238         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
2239         (WebCore::SVGAnimatedStaticPropertyTearOff::create):
2240         * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
2241         (WebCore::SVGAnimatedTransformListPropertyTearOff::create):
2242         * svg/properties/SVGListProperty.h:
2243         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2244         (WebCore::SVGListProperty::getItemValuesAndWrappers):
2245         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2246         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2247         (WebCore::SVGListProperty::removeItemValuesAndWrappers):
2248         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2249         * svg/properties/SVGListPropertyTearOff.h:
2250         (WebCore::SVGListPropertyTearOff::create):
2251         (WebCore::SVGListPropertyTearOff::initialize):
2252         (WebCore::SVGListPropertyTearOff::getItem):
2253         (WebCore::SVGListPropertyTearOff::insertItemBefore):
2254         (WebCore::SVGListPropertyTearOff::replaceItem):
2255         (WebCore::SVGListPropertyTearOff::removeItem):
2256         (WebCore::SVGListPropertyTearOff::appendItem):
2257         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
2258         (WebCore::SVGPathSegListPropertyTearOff::getItem):
2259         (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
2260         (WebCore::SVGPathSegListPropertyTearOff::removeItem):
2261         * svg/properties/SVGPathSegListPropertyTearOff.h:
2262         (WebCore::SVGPathSegListPropertyTearOff::create):
2263         (WebCore::SVGPathSegListPropertyTearOff::initialize):
2264         (WebCore::SVGPathSegListPropertyTearOff::insertItemBefore):
2265         (WebCore::SVGPathSegListPropertyTearOff::appendItem):
2266         * svg/properties/SVGPropertyInfo.h:
2267         * svg/properties/SVGStaticListPropertyTearOff.h:
2268         (WebCore::SVGStaticListPropertyTearOff::create):
2269         * svg/properties/SVGStaticPropertyTearOff.h:
2270         (WebCore::SVGStaticPropertyTearOff::create):
2271         * svg/properties/SVGTransformListPropertyTearOff.h:
2272         (WebCore::SVGTransformListPropertyTearOff::create):
2273         (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
2274         (WebCore::SVGTransformListPropertyTearOff::consolidate):
2275
2276 2015-03-10  Timothy Horton  <timothy_horton@apple.com>
2277
2278         Fix the build
2279
2280         * platform/network/cf/ResourceHandleCFNet.cpp:
2281         (WebCore::ResourceHandle::createCFURLConnection):
2282
2283 2015-03-10  Benjamin Poulain  <bpoulain@apple.com>
2284
2285         Extend URL filter's Term definition to support groups/subpatterns
2286         https://bugs.webkit.org/show_bug.cgi?id=142519
2287
2288         Reviewed by Alex Christensen.
2289
2290         Pretty simple extension: Term is extended to support holding
2291         a Vector of Term. The quantifier of the Term applies to its
2292         Vector of term as a whole.
2293
2294         To avoid exposing too much internal in the API of Term, I moved
2295         graph generation from GraphBuilder to Term.
2296
2297         Sinking a CharacterSet works as usual. Sinking a Group is done
2298         by sinking each of its Terms one by one and then apply the quantifier
2299         on the whole subgraph. This is done by recursively calling into
2300         Term::generateGraph().
2301
2302         Since groups could be nested, the groups make a stack with the latest
2303         open group on top.
2304         When sinking a floating Term, it is sunk to the latest open group. If there is no open
2305         group, we use the prefix tree and sink the whole subpattern to the graph.
2306
2307         * contentextensions/URLFilterParser.cpp:
2308         (WebCore::ContentExtensions::Term::Term):
2309         (WebCore::ContentExtensions::Term::extendGroupSubpattern):
2310         (WebCore::ContentExtensions::Term::generateGraph):
2311         (WebCore::ContentExtensions::Term::operator==):
2312         (WebCore::ContentExtensions::Term::hash):
2313         (WebCore::ContentExtensions::Term::isUniversalTransition):
2314         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2315         (WebCore::ContentExtensions::Term::destroy):
2316         (WebCore::ContentExtensions::Term::Group::operator==):
2317         (WebCore::ContentExtensions::Term::Group::hash):
2318         (WebCore::ContentExtensions::GraphBuilder::finalize):
2319         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesSubpatternBegin):
2320         (WebCore::ContentExtensions::GraphBuilder::atomParenthesesEnd):
2321         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
2322         (WebCore::ContentExtensions::Term::quantifier): Deleted.
2323         (WebCore::ContentExtensions::Term::visitSimpleTransitions): Deleted.
2324         (WebCore::ContentExtensions::GraphBuilder::addTransitions): Deleted.
2325         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm): Deleted.
2326
2327 2015-03-10  Roger Fong  <roger_fong@apple.com>
2328
2329         Adjustments to media control fonts.
2330         https://bugs.webkit.org/show_bug.cgi?id=142509.
2331         <rdar://problem/20085228>
2332
2333         Reviewed by Darin Adler.
2334
2335         Use system font for controls. Adjust surrounding divs accordingly.
2336         Apply subpixel antialiasing to all media control text.
2337         * Modules/mediacontrols/mediaControlsApple.css:
2338         (::-webkit-media-controls):
2339         (audio::-webkit-media-controls-closed-captions-container .list):
2340         (audio::-webkit-media-controls-status-display):
2341         (audio::-webkit-media-controls-time-remaining-display):
2342         (audio::-webkit-media-controls-current-time-display):
2343         (audio::-webkit-media-controls-time-remaining-display.five-digit-time):
2344         (audio::-webkit-media-controls-current-time-display.five-digit-time):
2345         (audio::-webkit-media-controls-time-remaining-display.six-digit-time):
2346         (audio::-webkit-media-controls-current-time-display.six-digit-time):
2347
2348 2015-03-10  Dan Bernstein  <mitz@apple.com>
2349
2350         Fixed a crash in CertificateInfo::containsNonRootSHA1SignedCertificate when loading a non-HTTPS webapge.
2351
2352         Reviewed by Anders Carlsson.
2353
2354         * platform/network/mac/CertificateInfoMac.mm:
2355         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Null-check the certificate chain.
2356
2357 2015-03-10  Dan Bernstein  <mitz@apple.com>
2358
2359         Fixed the build.
2360
2361         * platform/spi/cocoa/SecuritySPI.h:
2362
2363 2015-03-10  Zalan Bujtas  <zalan@apple.com>
2364
2365         Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
2366         https://bugs.webkit.org/show_bug.cgi?id=142344
2367
2368         Reviewed by Antti Koivisto.
2369
2370         This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
2371         the segment looping and position handling logic are no longer duplicated. It also unifies
2372         the static next*() functions' signature.
2373
2374         No change in functionality.
2375
2376         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2377         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
2378         (WebCore::SimpleLineLayout::nextBreakablePosition):
2379         (WebCore::SimpleLineLayout::nextNonWhitespacePosition):
2380         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2381         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
2382         (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
2383         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
2384         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2385
2386 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2387
2388         [GTK] GL_MAX_VARYING_FLOATS is not defined in OpenGL ES 2
2389         https://bugs.webkit.org/show_bug.cgi?id=142529
2390
2391         Reviewed by Žan Doberšek.
2392
2393         Do not use GL_MAX_VARYING_FLOATS when platform is GTK+ and using
2394         OpenGL ES 2.
2395
2396         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2397         (WebCore::GraphicsContext3D::checkVaryingsPacking):
2398
2399 2015-03-10  José Dapena Paz  <jdapena@igalia.com>
2400
2401         Unreviewed. Fix GTK+ build with OpenGL ES 2 enabled.
2402
2403         Remove USE(OPENGL) ifdef from GLContext.cpp, since there's nothing
2404         specific to OpenGL in that file, and everything depending on
2405         configure options is already protected by USE(GLX) and USE(EGL)
2406         ifdefs. This is causing linking issues when building with OpenGL
2407         ES 2, because the header doesn't have the ifdef, and the cpp file
2408         is not compiled leaving all the interface undefined.
2409
2410         Rubber-stamped by Carlos Garcia Campos.
2411
2412         * platform/graphics/GLContext.cpp:
2413
2414 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com> and José Dapena Paz  <jdapena@igalia.com>
2415
2416         [GTK] Add a configure option to build with OpenGL ES 2
2417         https://bugs.webkit.org/show_bug.cgi?id=142498
2418
2419         Reviewed by Martin Robinson.
2420
2421         Build GLES or GL specific files depending on the build options.
2422
2423         * PlatformGTK.cmake:
2424
2425 2015-03-10  Zan Dobersek  <zdobersek@igalia.com>
2426
2427         Shrink the CSSPropertyID enum type
2428         https://bugs.webkit.org/show_bug.cgi?id=142456
2429
2430         Reviewed by Sam Weinig.
2431
2432         Specify uint16_t as the base type for the CSSPropertyID enum.
2433         This is enough to cover all of the CSS properties (429 at this moment,
2434         with static_assert covering future changes). It halves the enum type size,
2435         from 4 bytes to 2, reducing the size of various CSSPropertyID containers.
2436
2437         No new tests -- no change in behavior.
2438
2439         * css/CSSPrimitiveValue.cpp:
2440         (WebCore::propertyName): Remove the unnecessary propertyID < 0 check.
2441         * css/makeprop.pl:
2442
2443 2015-03-10  Dan Bernstein  <mitz@apple.com>
2444
2445         WebCore part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
2446         https://bugs.webkit.org/show_bug.cgi?id=142461
2447
2448         Reviewed by Sam Weinig.
2449
2450         * WebCore.xcodeproj/project.pbxproj: Added reference to SecuritySPI.h and sorted the
2451         spi/cocoa group.
2452
2453         * platform/network/cf/CertificateInfo.h: Declared new member function
2454         containsNonRootSHA1SignedCertificate.
2455
2456         * platform/network/mac/CertificateInfoMac.mm:
2457         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added. Checks if any but
2458         the last certificate in the chain uses SHA-1 as its signature hash algorithm.
2459
2460         * platform/network/curl/CertificateInfo.h:
2461         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Added notImplemented
2462         implementation.
2463
2464         * platform/network/soup/CertificateInfo.h:
2465         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): Ditto.
2466
2467         * platform/spi/cocoa/SecuritySPI.h: Added.
2468
2469 2015-03-09  Chris Dumez  <cdumez@apple.com>
2470
2471         [iOS] Sweep all collected objects on critical memory pressure
2472         https://bugs.webkit.org/show_bug.cgi?id=142457
2473         <rdar://problem/20044440>
2474
2475         Reviewed by Geoffrey Garen.
2476
2477         Do a full sweep of objects marked for destruction on critical memory
2478         pressure to free up memory.
2479
2480         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2481         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2482
2483 2015-03-09  Andy Estes  <aestes@apple.com>
2484
2485         [Content Filtering] Give ContentFilter subclasses private constructors, and make them fast-allocated and non-copyable
2486         https://bugs.webkit.org/show_bug.cgi?id=142515
2487
2488         Reviewed by Andreas Kling.
2489
2490         * platform/cocoa/NetworkExtensionContentFilter.h:
2491         * platform/cocoa/ParentalControlsContentFilter.h:
2492         * testing/MockContentFilter.h:
2493
2494 2015-03-09  Chris Dumez  <cdumez@apple.com>
2495
2496         [CG] Have Canvas use the IOSurfacePool
2497         https://bugs.webkit.org/show_bug.cgi?id=142417
2498         <rdar://problem/20044440>
2499
2500         Reviewed by Darin Adler.
2501
2502         Have ImageBufferDataCG use the IOSurfacePool so that Canvas can
2503         benefit from it. I see a ~75% progression on Canvas/reuse.html
2504         performance test on my Macbook Pro with 1000 different canvas
2505         sizes and ~110% progression with 100 different canvas sizes.
2506
2507         I also see a ~65% cache hit rate on the mobile version of
2508         cnn.com.
2509
2510         Note that ImageData calls CGContextClearRect() after calling
2511         IOSurface::create() so recycling IOSurfaces in this case should
2512         be safe.
2513
2514         Performance test: Canvas/reuse.html
2515
2516         * platform/graphics/ImageBuffer.h:
2517         (WebCore::ImageBuffer::baseTransform):
2518         * platform/graphics/cg/ImageBufferCG.cpp:
2519         (WebCore::ImageBuffer::ImageBuffer):
2520         (WebCore::ImageBuffer::context):
2521         (WebCore::ImageBuffer::copyImage):
2522         (WebCore::ImageBuffer::copyNativeImage):
2523         (WebCore::ImageBuffer::draw):
2524         (WebCore::ImageBuffer::clip):
2525         (WebCore::ImageBuffer::putByteArray):
2526         (WebCore::ImageBuffer::toDataURL):
2527         * platform/graphics/cg/ImageBufferDataCG.cpp:
2528         (WebCore::ImageBufferData::~ImageBufferData):
2529         (WebCore::ImageBufferData::getData):
2530         (WebCore::ImageBufferData::putData):
2531         (WebCore::ImageBufferData::ImageBufferData): Deleted.
2532         * platform/graphics/cg/ImageBufferDataCG.h:
2533         * platform/graphics/cocoa/IOSurface.h:
2534         * platform/graphics/cocoa/IOSurface.mm:
2535         (IOSurface::surfaceFromPool):
2536         (IOSurface::create):
2537         (IOSurface::createFromSendRight):
2538         (IOSurface::createFromImage):
2539         (IOSurface::setContextSize):
2540
2541 2015-03-09  Brent Fulgham  <bfulgham@apple.com>
2542
2543         Assertion in ScrollController::processWheelEventForScrollSnapOnAxis when scrolling with mechanical wheel mouse
2544         https://bugs.webkit.org/show_bug.cgi?id=142517
2545
2546         Reviewed by Simon Fraser.
2547
2548         * platform/cocoa/ScrollController.mm:
2549         (WebCore::toWheelEventStatus): Recognize stateless mechanical wheel events.
2550         (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): If a mechanical wheel event is processed while
2551         considering scroll snap logic, end any snap animations and clean up.
2552         (WebCore::ScrollController::updateScrollSnapPoints): Don't begin tracking scroll snap state if there is not
2553         scroll snap point defined in the markup.
2554
2555 2015-03-09  Myles C. Maxfield  <mmaxfield@apple.com>
2556
2557         REGRESSION(r176978): Inline-blocks with overflowing contents have ascents that are too large
2558         https://bugs.webkit.org/show_bug.cgi?id=141783
2559
2560         Reviewed by David Hyatt.
2561
2562         When we have an inline-block element, and we want to find its baseline (to lay out other
2563         elements on the same line) we loop through the element's children and ask them what their
2564         baselines are. The children use the location of the top of their last line to compute this
2565         value. However, if the child has overflow-y, this might not be the correct calculation.
2566
2567         This behavior is in the spec: "The baseline of an 'inline-block' is the baseline of its last
2568         line box in the normal flow, unless it has either no in-flow line boxes or if its 'overflow'
2569         property has a computed value other than 'visible', in which case the baseline is the bottom
2570         margin edge."
2571             -- http://www.w3.org/TR/CSS21/visudet.html#leading
2572
2573         However, we believe that a better policy is, when overflow is not "visible," to place the
2574         baseline at the bottom of the block if the contents overflowed in the Y direction, and to place
2575         it at the bottom of the last line if the contents did not overflow in the Y direction. This is
2576         partially consistent with previous behavior, and isn't too far from the spec to cause too many
2577         breakages.
2578
2579         Test: fast/css/inline-block-tricky-baselines.html
2580               fast/text/baseline-inline-block.html
2581
2582         * rendering/RenderBlockFlow.cpp:
2583         (WebCore::RenderBlockFlow::inlineBlockBaseline):
2584
2585 2015-03-09  Andy Estes  <aestes@apple.com>
2586
2587         [Content Filtering] Add tests
2588         https://bugs.webkit.org/show_bug.cgi?id=142475
2589
2590         Reviewed by Andreas Kling.
2591
2592         Added a mock content filter that can be configured by window.internals. A test can control whether the filter
2593         is enabled, what to display when a page is blocked, at what point the allow/block decision is made, and what
2594         decision to make.
2595
2596         Added tests to cover allowing and blocking content at each decision point.
2597
2598         Tests: contentfiltering/allow-after-add-data.html
2599                contentfiltering/allow-after-finished-adding-data.html
2600                contentfiltering/allow-after-response.html
2601                contentfiltering/block-after-add-data.html
2602                contentfiltering/block-after-finished-adding-data.html
2603                contentfiltering/block-after-response.html
2604
2605         * DerivedSources.make: Added MockContentFilterSettings.idl.
2606         * WebCore.xcodeproj/project.pbxproj:
2607         * bindings/js/JSMockContentFilterSettingsCustom.cpp: Added.
2608         (WebCore::JSMockContentFilterSettings::decisionPoint): Returned the decision point's JSValue.
2609         (WebCore::JSMockContentFilterSettings::setDecisionPoint): Set the decision point; threw an exception for invalid values.
2610         (WebCore::JSMockContentFilterSettings::decision): Returned the decision's JSValue.
2611         (WebCore::JSMockContentFilterSettings::setDecision): Set the decision; threw an exception for invalid values.
2612         * platform/ContentFilter.cpp:
2613         (WebCore::ContentFilter::types): Renamed from contentFilterTypes.
2614         (WebCore::ContentFilter::createIfNeeded):
2615         (WebCore::contentFilterType): Deleted.
2616         (WebCore::contentFilterTypes): Deleted.
2617         * platform/ContentFilter.h:
2618         (WebCore::ContentFilter::addType): Used to register a new content filter type.
2619         (WebCore::ContentFilter::type): Renamed from contentFilterType.
2620         * platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NE_FILTER_SOURCE to here.
2621         * testing/Internals.cpp:
2622         (WebCore::Internals::resetToConsistentState): Called MockContentFilterSettings::reset().
2623         (WebCore::Internals::Internals): Called MockContentFilter::ensureInstalled().
2624         (WebCore::Internals::mockContentFilterSettings): Returned a reference to MockContentFilterSettings::singleton().
2625         * testing/Internals.h:
2626         * testing/Internals.idl: Added attribute mockContentFilterSettings.
2627         * testing/MockContentFilter.cpp: Added.
2628         (WebCore::MockContentFilter::ensureInstalled): Called MockContentFilter::addType().
2629         (WebCore::MockContentFilter::canHandleResponse): Returned whether MockContentFilterSettings is enabled.
2630         (WebCore::MockContentFilter::create): Returned a new MockContentFilter.
2631         (WebCore::MockContentFilter::MockContentFilter): Called maybeDetermineStatus().
2632         (WebCore::MockContentFilter::addData): Copied data into m_replacementData and called maybeDetermineStatus().
2633         (WebCore::MockContentFilter::finishedAddingData): Called maybeDetermineStatus().
2634         (WebCore::MockContentFilter::needsMoreData): Returned whether m_status equals NeedsMoreData.
2635         (WebCore::MockContentFilter::didBlockData): Returned whether m_status equals Blocked.
2636         (WebCore::MockContentFilter::getReplacementData): Returned a pointer to the start of m_replacementData.
2637         (WebCore::MockContentFilter::unblockHandler): Returned an empty ContentFilterUnblockHandler.
2638         (WebCore::MockContentFilter::maybeDetermineStatus): If m_status is NeedsMoreData and the current decision point
2639         equals MockContentFilterSettings's decision point, set m_status according to MockContentFilterSettings's
2640         decision. If m_status becomes Blocked, clear the original page data from m_replacementData and copy
2641         MockContentFilterSettings's blocked string instead.
2642         * testing/MockContentFilter.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
2643         * testing/MockContentFilterSettings.cpp: Copied from Source/WebCore/platform/ContentFilter.h.
2644         (WebCore::MockContentFilterSettings::singleton):
2645         (WebCore::MockContentFilterSettings::reset): Reset settings to their initial values.
2646         (WebCore::MockContentFilterSettings::MockContentFilterSettings):
2647         * testing/MockContentFilterSettings.h: Copied from Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h.
2648         (WebCore::MockContentFilterSettings::ref): Added an empty implementation to make the bindings think this is RefCounted.
2649         (WebCore::MockContentFilterSettings::deref): Ditto.
2650         (WebCore::MockContentFilterSettings::enabled):
2651         (WebCore::MockContentFilterSettings::setEnabled):
2652         (WebCore::MockContentFilterSettings::blockedString):
2653         (WebCore::MockContentFilterSettings::setBlockedString):
2654         (WebCore::MockContentFilterSettings::decisionPoint):
2655         (WebCore::MockContentFilterSettings::setDecisionPoint):
2656         (WebCore::MockContentFilterSettings::decision):
2657         (WebCore::MockContentFilterSettings::setDecision):
2658         * testing/MockContentFilterSettings.idl: Copied from Source/WebCore/platform/ContentFilter.h.
2659
2660 2015-03-09  Zalan Bujtas  <zalan@apple.com>
2661
2662         Simple line layout should not be limited to RenderText.
2663         https://bugs.webkit.org/show_bug.cgi?id=142504
2664
2665         Reviewed by Antti Koivisto.
2666
2667         This is in transition to support br element.
2668
2669         No change in functionality.
2670
2671         * rendering/RenderText.cpp:
2672         (WebCore::RenderText::absoluteRects):
2673         (WebCore::RenderText::absoluteQuadsClippedToEllipsis):
2674         (WebCore::RenderText::absoluteQuads):
2675         (WebCore::RenderText::firstRunLocation):
2676         (WebCore::RenderText::linesBoundingBox):
2677         (WebCore::RenderText::caretMinOffset):
2678         (WebCore::RenderText::caretMaxOffset):
2679         (WebCore::RenderText::containsCaretOffset):
2680         * rendering/SimpleLineLayoutFlowContents.cpp:
2681         (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer):
2682         * rendering/SimpleLineLayoutFlowContents.h:
2683         * rendering/SimpleLineLayoutFunctions.cpp:
2684         (WebCore::SimpleLineLayout::computeBoundingBox):
2685         (WebCore::SimpleLineLayout::computeFirstRunLocation):
2686         (WebCore::SimpleLineLayout::collectAbsoluteRects):
2687         (WebCore::SimpleLineLayout::collectAbsoluteQuads):
2688         (WebCore::SimpleLineLayout::computeTextBoundingBox): Deleted.
2689         (WebCore::SimpleLineLayout::computeTextFirstRunLocation): Deleted.
2690         (WebCore::SimpleLineLayout::collectTextAbsoluteRects): Deleted.
2691         (WebCore::SimpleLineLayout::collectTextAbsoluteQuads): Deleted.
2692         * rendering/SimpleLineLayoutFunctions.h:
2693         (WebCore::SimpleLineLayout::findCaretMinimumOffset):
2694         (WebCore::SimpleLineLayout::findCaretMaximumOffset):
2695         (WebCore::SimpleLineLayout::containsCaretOffset):
2696         (WebCore::SimpleLineLayout::findTextCaretMinimumOffset): Deleted.
2697         (WebCore::SimpleLineLayout::findTextCaretMaximumOffset): Deleted.
2698         (WebCore::SimpleLineLayout::containsTextCaretOffset): Deleted.
2699         * rendering/SimpleLineLayoutResolver.cpp:
2700         (WebCore::SimpleLineLayout::RunResolver::Run::text):
2701         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
2702         * rendering/SimpleLineLayoutResolver.h:
2703         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2704         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2705
2706 2015-03-09  Myles C. Maxfield  <mmaxfield@apple.com>
2707
2708         svg/custom/svg-fonts-without-missing-glyph.xhtml fails after fonts/font-fallback-prefers-pictographs.html
2709         https://bugs.webkit.org/show_bug.cgi?id=142470
2710
2711         Reviewed by Anders Carlsson.
2712
2713         After each test, reset all internal settings.
2714
2715         Covered by svg/custom/svg-fonts-without-missing-glyph.xhtml
2716
2717         * testing/InternalSettings.cpp:
2718         (WebCore::InternalSettings::Backup::Backup):
2719         (WebCore::InternalSettings::Backup::restoreTo):
2720         * testing/InternalSettings.h:
2721
2722 2015-03-09  Commit Queue  <commit-queue@webkit.org>
2723
2724         Unreviewed, rolling out r181268.
2725         https://bugs.webkit.org/show_bug.cgi?id=142508
2726
2727         Broke tests (Requested by ap on #webkit).
2728
2729         Reverted changeset:
2730
2731         "Simple line layout: Merge
2732         TextFragmentIterator::findNextBreakablePosition() and
2733         TextFragmentIterator::findNextNonWhitespacePosition()."
2734         https://bugs.webkit.org/show_bug.cgi?id=142344
2735         http://trac.webkit.org/changeset/181268
2736
2737 2015-03-09  Benjamin Poulain  <benjamin@webkit.org>
2738
2739         CSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last-child
2740         https://bugs.webkit.org/show_bug.cgi?id=142472
2741
2742         Reviewed by Andreas Kling.
2743
2744         The pseudo class :first-child has weaker tree marking than :nth-child(1).
2745         This patch aliases :nth-child(1) to :first-child in the CSS JIT to take
2746         advantage of that.
2747
2748         The strength of :last-child and :nth-last-child(1) are pretty much identical
2749         but :last-child is a bit simpler so I changed it too. It is also easier
2750         to handle both the same.
2751
2752         Tests: fast/selectors/nth-child-matching-first-on-root.html
2753                fast/selectors/nth-child-matching-first.html
2754                fast/selectors/nth-last-child-matching-first-on-root.html
2755                fast/selectors/nth-last-child-matching-first.html
2756
2757         * cssjit/SelectorCompiler.cpp:
2758         (WebCore::SelectorCompiler::addNthChildType):
2759         (WebCore::SelectorCompiler::addPseudoClassType):
2760
2761 2015-03-09  Benjamin Poulain  <bpoulain@apple.com>
2762
2763         Merge TrivialAtom and CharacterSet into a Term abstraction, prepare Term for composition
2764         https://bugs.webkit.org/show_bug.cgi?id=142429
2765
2766         Reviewed by Darin Adler.
2767
2768         This patch merges CharacterSet and Trivial atom into a new class: Term. A Term is
2769         a combination of an Atom and one Quantifier.
2770
2771         With term being the basic block, we can use the PrefixTree for any construct,
2772         greatly reducing the size of the NFA graph.
2773
2774         Term is built on top of an union holding the Atom storage. This is done in preparation
2775         for more complicated Atoms like a disjunction.
2776
2777         Everything else is pretty much the same. BuildMode is gone since we use the prefix
2778         tree for everything. FloatingAtomType is gone, a TrivialAtom is now represented
2779         by a single character CharacterSet (or two for case insensitive).
2780
2781         * contentextensions/ContentExtensionParser.cpp:
2782         (WebCore::ContentExtensions::parseRuleList):
2783         * contentextensions/NFA.cpp:
2784         (WebCore::ContentExtensions::NFA::addRuleId):
2785         * contentextensions/URLFilterParser.cpp:
2786         (WebCore::ContentExtensions::Term::Term):
2787         (WebCore::ContentExtensions::Term::~Term):
2788         (WebCore::ContentExtensions::Term::isValid):
2789         (WebCore::ContentExtensions::Term::addCharacter):
2790         (WebCore::ContentExtensions::Term::quantify):
2791         (WebCore::ContentExtensions::Term::quantifier):
2792         (WebCore::ContentExtensions::Term::isUniversalTransition):
2793         (WebCore::ContentExtensions::Term::visitSimpleTransitions):
2794         (WebCore::ContentExtensions::Term::operator=):
2795         (WebCore::ContentExtensions::Term::operator==):
2796         (WebCore::ContentExtensions::Term::hash):
2797         (WebCore::ContentExtensions::Term::isEmptyValue):
2798         (WebCore::ContentExtensions::Term::isDeletedValue):
2799         (WebCore::ContentExtensions::Term::destroy):
2800         (WebCore::ContentExtensions::Term::CharacterSet::operator==):
2801         (WebCore::ContentExtensions::Term::CharacterSet::hash):
2802         (WebCore::ContentExtensions::TermHash::hash):
2803         (WebCore::ContentExtensions::TermHash::equal):
2804         (WebCore::ContentExtensions::GraphBuilder::GraphBuilder):
2805         (WebCore::ContentExtensions::GraphBuilder::finalize):
2806         (WebCore::ContentExtensions::GraphBuilder::atomPatternCharacter):
2807         (WebCore::ContentExtensions::GraphBuilder::atomBuiltInCharacterClass):
2808         (WebCore::ContentExtensions::GraphBuilder::quantifyAtom):
2809         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassBegin):
2810         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassAtom):
2811         (WebCore::ContentExtensions::GraphBuilder::atomCharacterClassRange):
2812         (WebCore::ContentExtensions::GraphBuilder::addTransitions):
2813         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTerm):
2814         (WebCore::ContentExtensions::GraphBuilder::sinkFloatingTermIfNecessary):
2815         (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
2816         (WebCore::ContentExtensions::URLFilterParser::~URLFilterParser):
2817         (WebCore::ContentExtensions::URLFilterParser::addPattern):
2818         (WebCore::ContentExtensions::trivialAtomFromASCIICharacter): Deleted.
2819         (WebCore::ContentExtensions::quantifyTrivialAtom): Deleted.
2820         (WebCore::ContentExtensions::trivialAtomQuantifier): Deleted.
2821         (WebCore::ContentExtensions::trivialAtomForNewlineClassIDBuiltin): Deleted.
2822         (WebCore::ContentExtensions::GraphBuilder::sinkAtom): Deleted.
2823         (WebCore::ContentExtensions::GraphBuilder::generateTransition): Deleted.
2824         (WebCore::ContentExtensions::GraphBuilder::sinkTrivialAtom): Deleted.
2825         (WebCore::ContentExtensions::GraphBuilder::sinkCharacterSet): Deleted.
2826         (WebCore::ContentExtensions::GraphBuilder::sinkPendingAtomIfNecessary): Deleted.
2827         * contentextensions/URLFilterParser.h:
2828
2829 2015-03-09  Csaba Osztrogonác  <ossy@webkit.org>
2830
2831         Fix the !ENABLE(WEBGL) build after r180609
2832         https://bugs.webkit.org/show_bug.cgi?id=142057
2833
2834         Reviewed by Darin Adler.
2835
2836         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2837         (WebCore::GraphicsContext3D::forceContextLost):
2838
2839 2015-03-09  Myles C. Maxfield  <mmaxfield@apple.com>
2840
2841         Work around a Cocoa font parsing bug
2842         https://bugs.webkit.org/show_bug.cgi?id=142446
2843         <rdar://problem/20086223>
2844
2845         Reviewed by Simon Fraser.
2846
2847         Work around a bug in Cocoa regarding font parsing.
2848
2849         * svg/SVGToOTFFontConversion.cpp:
2850
2851 2015-03-09  Csaba Osztrogonác  <ossy@webkit.org>
2852
2853         Fix the build after r181153
2854         https://bugs.webkit.org/show_bug.cgi?id=142497
2855
2856         Reviewed by Philippe Normand.
2857
2858         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2859         (WebCore::MediaPlayerPrivateGStreamer::load):
2860
2861 2015-03-09  Roger Fong  <roger_fong@apple.com>
2862
2863         Only call showControls if controls are hidden.
2864         https://bugs.webkit.org/show_bug.cgi?id=142496.
2865         <rdar://problem/20083732>
2866
2867         Reviewed by Dean Jackson.
2868
2869         * Modules/mediacontrols/mediaControlsApple.js:
2870         (Controller.prototype.handleWrapperMouseMove):
2871         (Controller.prototype.controlsAreHidden):
2872         Controls are hidden if the ‘show’ class name is not present,
2873         not if the ‘hidden’ class name is.
2874
2875 2015-03-09  Roger Fong  <roger_fong@apple.com>
2876
2877         Unreviewed. Re-add CSS property that was unintentionally removed in r180893
2878         <rdar://problem/20083715>
2879
2880         * Modules/mediacontrols/mediaControlsApple.css:
2881         (audio::-webkit-media-controls-panel):
2882
2883 2015-03-09  Zalan Bujtas  <zalan@apple.com>
2884
2885         Simple line layout: Merge TextFragmentIterator::findNextBreakablePosition() and TextFragmentIterator::findNextNonWhitespacePosition().
2886         https://bugs.webkit.org/show_bug.cgi?id=142344
2887
2888         Reviewed by Antti Koivisto.
2889
2890         This patch merges findNextBreakablePosition() and findNextNonWhitespacePosition() so that
2891         the segment looping and position handling logic are no longer duplicated. It also unifies
2892         the static next*() functions' signature.
2893
2894         No change in functionality.
2895
2896         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2897         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
2898         (WebCore::SimpleLineLayout::nextBreakablePosition):
2899         (WebCore::SimpleLineLayout::nextNonWhitespacePosition):
2900         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2901         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition): Deleted.
2902         (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
2903         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition): Deleted.
2904         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2905
2906 2015-03-09  Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2907
2908         ReadableStreamJSSource should use JSC::Strong UnspecifiedBoolType operator
2909         https://bugs.webkit.org/show_bug.cgi?id=142397
2910
2911         Reviewed by Benjamin Poulain.
2912
2913         No behavior change. Current tests cover the changes.
2914
2915         * bindings/js/ReadableStreamJSSource.cpp:
2916         * bindings/js/ReadableStreamJSSource.h:
2917
2918 2015-03-09  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2919
2920         ReadableStream does not not need to pass itself as callback parameter
2921         https://bugs.webkit.org/show_bug.cgi?id=142399
2922
2923         Reviewed by Darin Adler.
2924
2925         No change in behavior.
2926
2927         * Modules/streams/ReadableStream.h: Remove ReadableStream parameter from SuccessCallback definition.
2928         * bindings/js/JSReadableStreamCustom.cpp:
2929         (WebCore::JSReadableStream::ready): Capture JSReadableStream instance instead.
2930         (WebCore::JSReadableStream::closed): Capture JSReadableStream instance instead.
2931
2932 2015-03-08  Dean Jackson  <dino@apple.com>
2933
2934         [iOS Media] Video buffer progress missing on iPhones
2935         https://bugs.webkit.org/show_bug.cgi?id=142462
2936
2937         Reviewed by Eric Carlson.
2938
2939         The fullscreen controller on the iPhone idiom was using
2940         the media duration as its maximum loaded time, meaning the
2941         download progress was missing (it looked like everything
2942         was already downloaded). The fix is to calculate
2943         what the maximum buffered time is from the HTMLMediaElement,
2944         and send that to the fullscreen controller.
2945
2946         * Modules/mediacontrols/mediaControlsiOS.js:
2947         (ControllerIOS.prototype.drawTimelineBackground): While implementing
2948         the native function I noticed that the JS controls forgot that
2949         the buffered time ranges are ordered, and thus they don't need
2950         to search through the array. The last range will be the highest.
2951
2952         * html/HTMLMediaElement.cpp:
2953         (WebCore::HTMLMediaElement::maxBufferedTime): New helper function
2954         to calculate the highest buffered time in the media source.
2955         * html/HTMLMediaElement.h:
2956
2957         * platform/ios/WebVideoFullscreenInterface.h: New setBufferedTime method.
2958         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2959
2960         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2961         (WebVideoFullscreenInterfaceAVKit::setDuration): No longer set
2962         the loadedTimeRanges.
2963         (WebVideoFullscreenInterfaceAVKit::setBufferedTime): Calculate a normalized
2964         value of the maximum loaded/buffered time, and tell the platform controller
2965         to show that range.
2966
2967         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
2968         (WebVideoFullscreenModelVideoElement::updateForEventName): Send the maximum
2969         buffered time.
2970
2971 2015-03-08  Chris Dumez  <cdumez@apple.com>
2972
2973         Crash in WebCore::NotificationCenter::stop()
2974         https://bugs.webkit.org/show_bug.cgi?id=142444
2975         <rdar://problem/20082520>
2976
2977         Reviewed by Darin Adler.
2978
2979         Rework the patch in r181219 so that we do not need a Ref<NotificationCenter> protector
2980         in NotificationCenter::stop(). Instead, we put the client in a local variable and null
2981         out m_client *before* calling NotificationClient::clearNotifications().
2982
2983         No new tests, already covered by:
2984         http/tests/notifications/event-listener-crash.html
2985
2986         * Modules/notifications/NotificationCenter.cpp:
2987         (WebCore::NotificationCenter::stop):
2988
2989 2015-03-08  Simon Fraser  <simon.fraser@apple.com>
2990
2991         Don't call RenderLayerCompositor::needsToBeComposited() so many times
2992         https://bugs.webkit.org/show_bug.cgi?id=142441
2993
2994         Reviewed by Brent Fulgham.
2995
2996         Save one call to needsToBeComposited() per RenderLayer while rebuilding compositing
2997         layers, and a call to isRunningAcceleratedTransformAnimation() in some cases.
2998         
2999         computeCompositingRequirements() already knows if the layer will be composited, so
3000         pass that to updateBacking() in the form of a "yes/no/don't" know enum. However,
3001         since updateBacking() no longer calls needsToBeComposited(), we need to call 
3002         requiresCompositingForPosition() to get the viewportConstrainedNotCompositedReason flags.
3003         
3004         isRunningAcceleratedTransformAnimation() will only be true for a layer which has a
3005         direct compositing reason, so only call isRunningAcceleratedTransformAnimation()
3006         in that case.
3007         
3008         * rendering/RenderLayerCompositor.cpp:
3009         (WebCore::rendererForCompositingTests):
3010         (WebCore::RenderLayerCompositor::updateBacking):
3011         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3012         (WebCore::RenderLayerCompositor::requiresCompositingLayer): Use references.
3013         (WebCore::RenderLayerCompositor::reasonsForCompositing): Use references.
3014         * rendering/RenderLayerCompositor.h:
3015
3016 2015-03-08  Simon Fraser  <simon.fraser@apple.com>
3017
3018         In RenderLayerCompositor, track layer bounds and the haveComputedBounds flag together in a struct
3019         https://bugs.webkit.org/show_bug.cgi?id=142449
3020
3021         Reviewed by Brent Fulgham.
3022         
3023         Rather than tracking 'layerBounds' and 'haveComputedBounds' separately, group them together
3024         in an OverlapExtent struct and add a function to compute the bounds, which removes
3025         a copy of this code. OverlapExtent will be extended in a future patch.
3026
3027         No behavior change.
3028
3029         * rendering/RenderLayerCompositor.cpp:
3030         (WebCore::RenderLayerCompositor::OverlapMap::geometryMap): Allow const access to
3031         the geometryMap, used by computeExtent().
3032         (WebCore::RenderLayerCompositor::computeExtent):
3033         (WebCore::RenderLayerCompositor::addToOverlapMap):
3034         (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
3035         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3036         * rendering/RenderLayerCompositor.h:
3037
3038 2015-03-07  Chris Dumez  <cdumez@apple.com>
3039
3040         Crash in WebCore::NotificationCenter::stop()
3041         https://bugs.webkit.org/show_bug.cgi?id=142444
3042         <rdar://problem/20082520>
3043
3044         Reviewed by Andreas Kling.
3045
3046         A use-after-free would sometimes cause us to crash in NotificationCenter::stop().
3047         After investigation, it turns out that NotificationCenter::stop() calls
3048         NotificationClient::clearNotifications() which will destroy the Notification
3049         objects, all of which hold a strong reference to the NotificationCenter. If at
3050         this point, only Notifications are ref'ing the NotificationCenter, this means
3051         that the NotificationCenter will get destroyed right after the call to
3052         NotificationClient::clearNotifications(). However, we reset m_client to null
3053         after calling clearNotifications() and it causes us to crash in this case.
3054
3055         The issue is addressed by adding a Ref<NotificationCenter> protector in
3056         NotificationCenter::stop() so that we make sure the NotificationCenter lives
3057         at least until the end of the method execution.
3058
3059         I was able to consistently reproduce the crash by doing:
3060         Tools/Scripts/run-webkit-tests -1 --debug --repeat-each=30 -g http/tests/notifications/event-listener-crash.html
3061
3062         No new tests, already covered by:
3063         http/tests/notifications/event-listener-crash.html
3064
3065         * Modules/notifications/NotificationCenter.cpp:
3066         (WebCore::NotificationCenter::stop):
3067
3068 2015-03-07  Simon Fraser  <simon.fraser@apple.com>
3069
3070         Tidy up RenderLayerCompositor's CompositingState
3071         https://bugs.webkit.org/show_bug.cgi?id=142445
3072
3073         Reviewed by Dan Bernstein.
3074         
3075         Make CompositingState a private struct in RenderLayerCompositor.
3076         Since it's a struct, remove the m_ prefix from its data members.
3077
3078         No behavior change.
3079
3080         * rendering/RenderLayerCompositor.cpp:
3081         (WebCore::RenderLayerCompositor::CompositingState::CompositingState):
3082         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3083         (WebCore::CompositingState::CompositingState): Deleted.
3084         * rendering/RenderLayerCompositor.h:
3085
3086 2015-03-07  Darin Adler  <darin@apple.com>
3087
3088         Unindent EventTarget, EventListener, JSEventLister.h files
3089         https://bugs.webkit.org/show_bug.cgi?id=142440
3090
3091         Reviewed by Alexey Proskuryakov.
3092
3093         * bindings/js/JSEventListener.h:
3094         * dom/EventListener.h:
3095         * dom/EventTarget.h:
3096         Change indentation to match coding style rules.
3097
3098 2015-03-07  Geoffrey Garen  <ggaren@apple.com>
3099
3100         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
3101         https://bugs.webkit.org/show_bug.cgi?id=140900
3102
3103         Reviewed by Mark Hahnenberg.
3104
3105         Re-landing just the removal of BlockAllocator, which is now unused.
3106
3107         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3108         (WebCore::MemoryPressureHandler::install):
3109
3110 2015-03-07  Commit Queue  <commit-queue@webkit.org>
3111
3112         Unreviewed, rolling out r181010.
3113         https://bugs.webkit.org/show_bug.cgi?id=142442
3114
3115         Broke media/video-src-invalid-poster.html (Requested by kling
3116         on #webkit).
3117
3118         Reverted changeset:
3119
3120         "Stale entries in WeakGCMaps are keeping tons of WeakBlocks
3121         alive unnecessarily."
3122         https://bugs.webkit.org/show_bug.cgi?id=142115
3123         http://trac.webkit.org/changeset/181010
3124
3125 2015-03-07  Darin Adler  <darin@apple.com>
3126
3127         Do a bit of EventNames tidying
3128         https://bugs.webkit.org/show_bug.cgi?id=142438
3129
3130         Reviewed by Anders Carlsson.
3131
3132         * dom/EventNames.h: Sorted the event names into a single list instead of
3133         the rudimentary attempts at organizing the list that simply made it hard
3134         to see what is and is not in the list. Removed two unused event names.
3135         I'm sure there are more. Reorganized the EventName class, now a struct,
3136         into a more conventional "public first" order. Got the function bodies
3137         out of the struct so we can see more clearly what is in the struct.
3138         Made more things const.
3139         (WebCore::EventNames::touchEventNames): Changed the return value to a
3140         std::array of reference wrappers rather than a vector of atomic strings.
3141         This should eliminate unnecessary memory allocation and reference count churn.
3142
3143         * dom/EventNames.cpp: Changed initialization based on the above.
3144
3145         * dom/EventTarget.cpp:
3146         (WebCore::EventTarget::getEventListeners): Use NeverDestroyed instead of
3147         DEPRECATED_DEFINE_LOCAL and also just tightened up the function a bit.
3148
3149         * dom/Node.cpp:
3150         (WebCore::Node::didMoveToNewDocument): Streamlined this function with
3151         modern for loops, auto, and also tried to make what it does a bit clearer,
3152         by making loops that are just based on numbers of event listeners look a
3153         bit less like code that actually iterates a vector of listeners. Also used
3154         the type unsigned instead of size_t.
3155
3156         * platform/ThreadGlobalData.h: Updated since it's a struct instead of class now.
3157         (Why is this file in platform!?)
3158
3159 2015-03-07  Brent Fulgham  <bfulgham@apple.com>
3160
3161         [Win] Increase TestWebKitAPI Test Coverage
3162         https://bugs.webkit.org/show_bug.cgi?id=142433
3163
3164         Reviewed by Darin Adler.
3165
3166         Correct some build deficiencies that prevent TestWebKitAPI
3167         from executing certain tests on Windows.
3168
3169         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy the interpreter
3170         headers.
3171         * css/CSSParser.h: Export necessary symbols
3172         * css/CSSParserMode.h: Ditto.
3173         * css/StyleProperties.h: Ditto.
3174
3175 2015-03-07  David Kilzer  <ddkilzer@apple.com>
3176
3177         Rename SOFT_LINK_FRAMEWORK_{HEADER,SOURCE} to SOFT_LINK_FRAMEWORK_FOR_{HEADER,SOURCE}
3178         <http://webkit.org/b/142434>
3179
3180         Reviewed by Darin Adler.
3181
3182         * platform/cf/CoreMediaSoftLink.cpp:
3183         * platform/cf/CoreMediaSoftLink.h:
3184         * platform/cf/MediaAccessibilitySoftLink.cpp:
3185         * platform/cf/MediaAccessibilitySoftLink.h:
3186         * platform/mac/SoftLinking.h:
3187         * platform/win/SoftLinking.h:
3188         - Do the rename.
3189
3190 2015-03-06  Sam Weinig  <sam@webkit.org>
3191
3192         [Content Extensions] Move compiling of content extensions to the UIProcess
3193         https://bugs.webkit.org/show_bug.cgi?id=142402
3194
3195         Reviewed by Benjamin Poulain.
3196
3197         * contentextensions/CompiledContentExtension.cpp:
3198         (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
3199         (WebCore::ContentExtensions::CompiledContentExtension::create): Deleted.
3200         (WebCore::ContentExtensions::CompiledContentExtension::CompiledContentExtension): Deleted.
3201         * contentextensions/CompiledContentExtension.h:
3202         (WebCore::ContentExtensions::CompiledContentExtension::bytecode): Deleted.
3203         (WebCore::ContentExtensions::CompiledContentExtension::actions): Deleted.
3204         Convert CompiledContentExtension to be an abstract base class so that we can back it however
3205         we like at the WebKit level. Since it doesn't necessarily use Vectors for its backing store
3206         any more, change the interface to use pointer/length.
3207
3208         * contentextensions/ContentExtensionCompiler.cpp:
3209         (WebCore::ContentExtensions::compileRuleList):
3210         * contentextensions/ContentExtensionCompiler.h:
3211         Change compileRuleList to return compiled result as the raw Vectors rather than as
3212         a CompiledContentExtension, since that class is now abstract. It is up to the caller
3213         to copy the data into its final home.
3214
3215         * contentextensions/ContentExtensionRule.cpp:
3216         (WebCore::ContentExtensions::Action::deserialize):
3217         * contentextensions/ContentExtensionRule.h:
3218         Switch Action::deserialize to take pointer/length rather than a Vector.
3219
3220         * contentextensions/ContentExtensionsBackend.cpp:
3221         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
3222         Pull getting the serialized actions from the compiled extension out of the loop
3223         to avoid calling the virtual function multiple times. Pass the bytecode and actions
3224         as pointer/length pairs rather than Vectors.
3225
3226         * contentextensions/DFABytecodeInterpreter.cpp:
3227         (WebCore::ContentExtensions::getBits):
3228         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
3229         * contentextensions/DFABytecodeInterpreter.h:
3230         (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
3231         Switch the interpreter to take pointer/length rather than a Vector.
3232
3233         * page/UserContentController.cpp:
3234         (WebCore::UserContentController::addUserContentExtension):
3235         (WebCore::UserContentController::removeUserContentExtension):
3236         (WebCore::UserContentController::removeAllUserContentExtensions):
3237         (WebCore::UserContentController::addUserContentFilter): Deleted.
3238         (WebCore::UserContentController::removeUserContentFilter): Deleted.
3239         (WebCore::UserContentController::removeAllUserContentFilters): Deleted.
3240         * page/UserContentController.h:
3241         Unify terminology to use the term UserContentExtension rather than UserContentFilter.
3242
3243 2015-03-06  Roger Fong  <roger_fong@apple.com>
3244
3245         Create new buttons for media controls on OSX.
3246         https://bugs.webkit.org/show_bug.cgi?id=142415.
3247         <rdar://problem/20019441>
3248
3249         Reviewed by Eric Carlson.
3250
3251         * Modules/mediacontrols/mediaControlsApple.css:
3252         (audio::-webkit-media-controls-wireless-playback-picker-button):
3253         (audio::-webkit-media-controls-wireless-playback-picker-button.playing):
3254         (audio:-webkit-full-screen::-webkit-media-controls-wireless-playback-picker-button):
3255
3256 2015-03-06  Roger Fong  <roger_fong@apple.com>
3257
3258         Redraw timeline background when updating media time.
3259         https://bugs.webkit.org/show_bug.cgi?id=142421.
3260         <rdar://problem/20065104>
3261
3262         Reviewed by Brent Fulgham.
3263
3264         * Modules/mediacontrols/mediaControlsApple.js:
3265         (Controller.prototype.handleTimeUpdate):
3266
3267 2015-03-06  Dhi Aurrahman  <diorahman@rockybars.com>
3268
3269         Enable selectors level 4's :lang() by default
3270         https://bugs.webkit.org/show_bug.cgi?id=142302
3271
3272         Reviewed by Benjamin Poulain.
3273
3274         No behavior change.
3275
3276         * css/CSSGrammar.y.in:
3277         * css/CSSParser.cpp:
3278         (WebCore::CSSParser::detectFunctionTypeToken):
3279         * css/CSSParserValues.cpp:
3280         (WebCore::CSSParserSelector::setLangArgumentList):
3281         * css/CSSParserValues.h:
3282         * css/CSSSelector.cpp:
3283         (WebCore::appendLangArgumentList):
3284         (WebCore::CSSSelector::selectorText):
3285         (WebCore::CSSSelector::setLangArgumentList):
3286         * css/CSSSelector.h:
3287         * css/SelectorChecker.cpp:
3288         (WebCore::SelectorChecker::checkOne):
3289         * css/SelectorCheckerTestFunctions.h:
3290         (WebCore::matchesLangPseudoClass):
3291         (WebCore::matchesLangPseudoClassDeprecated): Deleted.
3292         * cssjit/SelectorCompiler.cpp:
3293         (WebCore::SelectorCompiler::addPseudoClassType):
3294         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
3295         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
3296
3297 2015-03-06  Brent Fulgham  <bfulgham@apple.com>
3298
3299         Setting scroll-snap-desination to (100% 100%) locks up WebKit
3300         https://bugs.webkit.org/show_bug.cgi?id=142414
3301         <rdar://problem/20077275>
3302
3303         Reviewed by Dean Jackson.
3304
3305         Tested by css3/scroll-snap/scroll-snap-desination-lock-up.html.
3306
3307         Correct an infinite loop that is triggered when you combine a repeating (100%)
3308         scroll-snap-point-{x,y} along with a 100% scroll-snap-destination value.
3309
3310         * page/scrolling/AxisScrollSnapOffsets.cpp:
3311         (WebCore::updateFromStyle): Make sure we break out of the loop properly when
3312         the scroll-snap-point-{x,y} step is the same as the scroll-snap-destination.
3313
3314 2015-03-06  Dean Jackson  <dino@apple.com>
3315
3316         https://bugs.webkit.org/show_bug.cgi?id=142416
3317
3318         Unreviewed build fix.
3319
3320         * platform/spi/cocoa/QuartzCoreSPI.h: Add kCAFilterPlusL.
3321
3322 2015-03-06  Dean Jackson  <dino@apple.com>
3323
3324         Support "plus-lighter" in mix-blend mode
3325         https://bugs.webkit.org/show_bug.cgi?id=142416
3326         <rdar://problem/19993979>
3327
3328         Reviewed by Darin Adler and Sam Weinig.
3329
3330         Support the "plus-lighter" blending mode to CSS.
3331         See my reply to: https://lists.w3.org/Archives/Public/public-fx/2015JanMar/0021.html
3332
3333         Test: css3/blending/svg-blend-plus-lighter.html
3334
3335         * css/CSSParser.cpp:
3336         (WebCore::isValidKeywordPropertyAndValue): mix-blend-mode can now accept the
3337         new keyword.
3338         * css/CSSPrimitiveValueMappings.h: Add the mappings to/from the GraphicsType.
3339         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3340         (WebCore::CSSPrimitiveValue::operator BlendMode):
3341         * css/CSSValueKeywords.in: Add comment to show plus-darker and plus-lighter
3342         are available.
3343         * platform/graphics/GraphicsTypes.cpp: New GraphicsType for PlusLighter.
3344         * platform/graphics/GraphicsTypes.h:
3345         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm: Map to the CA filter.
3346         (PlatformCAFilters::setBlendingFiltersOnLayer):
3347         * platform/graphics/cg/GraphicsContextCG.cpp:
3348         (WebCore::GraphicsContext::setPlatformCompositeOperation): Map to the CG
3349         blending flag.
3350
3351 2015-03-06  Alex Christensen  <achristensen@webkit.org>
3352
3353         Soft link MediaAccessibility using new macros.
3354         https://bugs.webkit.org/show_bug.cgi?id=142406
3355
3356         Reviewed by David Kilzer.
3357
3358         * Configurations/WebCore.unexp:
3359         * WebCore.vcxproj/WebCore.vcxproj:
3360         * WebCore.vcxproj/WebCore.vcxproj.filters:
3361         * WebCore.xcodeproj/project.pbxproj:
3362         * page/CaptionUserPreferencesMediaAF.cpp:
3363         * platform/cf/MediaAccessibilitySoftLink.cpp: Added.
3364         * platform/cf/MediaAccessibilitySoftLink.h: Added.
3365
3366 2015-03-06  Brent Fulgham  <bfulgham@apple.com>
3367
3368         Add 'initial' keyword support for scroll snap CSS properties
3369         https://bugs.webkit.org/show_bug.cgi?id=136345
3370         <rdar://problem/18162325>
3371
3372         Reviewed by Dean Jackson.
3373
3374         Tested by css3/scroll-snap/scroll-snap-initial.html
3375
3376         The existing implementation already had 'initial' keyword support, but did not fully follow
3377         the CSS specification. In particular, the 'initial' state for the scroll-snap-points-x and
3378         scroll-snap-points-y properties was not handled correctly.
3379
3380         Revise implementation to represent ScrollSnapPoints as a pointer, so that 'none' is a valid
3381         state.
3382
3383         * css/CSSComputedStyleDeclaration.cpp:
3384         (WebCore::scrollSnapPoints): If 'points' is null, return CSSValueNone.
3385         * css/CSSPropertyNames.in: Provide custom initial/inherit handles for snap point x/y sets.
3386         * css/StyleBuilderConverter.h:
3387         (WebCore::StyleBuilderConverter::convertScrollSnapPoints): Update to represent ScrollSnapPoints
3388         as a pointer.
3389         * css/StyleBuilderCustom.h:
3390         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsX): Provide custom pointer-based
3391         implementation for ScrollSnapPoints.
3392         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsX): Ditto.
3393         (WebCore::StyleBuilderCustom::applyInitialWebkitScrollSnapPointsY): Ditto.
3394         (WebCore::StyleBuilderCustom::applyInheritWebkitScrollSnapPointsY): Ditto."
3395         * page/scrolling/AxisScrollSnapOffsets.cpp:
3396         (WebCore::updateFromStyle): Handle ScrollSnapPoints as pointers.
3397         (WebCore::updateSnapOffsetsForScrollableArea): Ditto.
3398         * rendering/style/RenderStyle.cpp:
3399         (WebCore::RenderStyle::scrollSnapPointsX): Update to use pointer-based representation of ScrollSnapPoints.
3400         (WebCore::RenderStyle::scrollSnapPointsY): Ditto.
3401         (WebCore::RenderStyle::setScrollSnapPointsX): Ditto.
3402         (WebCore::RenderStyle::setScrollSnapPointsY): Ditto.
3403         (WebCore::RenderStyle::initialScrollSnapPointsX): Deleted.
3404         (WebCore::RenderStyle::initialScrollSnapPointsY): Deleted.
3405         * rendering/style/RenderStyle.h:
3406         * rendering/style/StyleScrollSnapPoints.cpp:
3407         (WebCore::StyleScrollSnapPoints::StyleScrollSnapPoints): Revise constructor to handle pointer argument.
3408         * rendering/style/StyleScrollSnapPoints.h:
3409
3410 2015-03-05  Roger Fong  <roger_fong@apple.com>
3411
3412         Reskin Captions button and container on OSX.
3413         https://bugs.webkit.org/show_bug.cgi?id=142383.
3414         <rdar://problem/20061466>
3415
3416         Reviewed by Eric Carlson.
3417
3418         * Modules/mediacontrols/mediaControlsApple.css:
3419         (audio::-webkit-media-controls-toggle-closed-captions-button): Create new captions button icon.
3420         Update caption container to match rest of media controls better.
3421         (audio::-webkit-media-controls-closed-captions-container):
3422         (audio::-webkit-media-controls-closed-captions-container .list):
3423         (audio::-webkit-media-controls-closed-captions-container h3):
3424         (audio::-webkit-media-controls-closed-captions-container ul):
3425         (audio::-webkit-media-controls-closed-captions-container li):
3426         (audio::-webkit-media-controls-closed-captions-container li:focus):
3427         (audio::-webkit-media-controls-closed-captions-container li:hover):
3428         Fix up some fonts to make fonts between captions, status display and time displays consistent.
3429         (audio::-webkit-media-controls-status-display):
3430         (audio::-webkit-media-controls-time-remaining-display):
3431
3432 2015-03-06  Jer Noble  <jer.noble@apple.com>
3433
3434         [Web Audio] Decoding specific .m4a file crashes tab
3435         https://bugs.webkit.org/show_bug.cgi?id=139545
3436
3437         Reviewed by Eric Carlson.
3438
3439         Test: webaudio/decode-audio-data-too-short.html
3440
3441         Bail out early if CoreAudio reports the number of frames in the file to be negative.
3442
3443         * platform/audio/mac/AudioFileReaderMac.cpp:
3444         (WebCore::AudioFileReader::createBus):
3445
3446 2015-03-06  Jeremy Jones  <jeremyj@apple.com>
3447
3448         Scroll to make the video element visible when exiting fullscreen.
3449         https://bugs.webkit.org/show_bug.cgi?id=141439
3450
3451         Reviewed by Simon Fraser.
3452
3453         This patch will scroll the element so it is visible when exiting fullscreen,
3454         but only if the element is completely scrolled off screen.
3455         Also update the element screen rect so exit animation goes to the correct location.
3456
3457         * dom/Element.cpp:
3458         (WebCore::Element::scrollIntoViewIfNotVisible): Added.
3459         * dom/Element.h: Add declaration for scrollIntoViewIfNotVisible.
3460         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3461         (-[WebVideoFullscreenController fullscreenMayReturnToInline]):
3462         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3463         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3464         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]):
3465         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]):
3466         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
3467         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
3468         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3469         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
3470         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
3471         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline):
3472         * rendering/ScrollBehavior.cpp:
3473         * rendering/ScrollBehavior.h:
3474
3475 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3476
3477         Crash in -[WebCascadeList objectAtIndex:] + 195
3478         https://bugs.webkit.org/show_bug.cgi?id=141274
3479
3480         Reviewed by David Kilzer.
3481
3482         CTFontDescriptorRefs can live forever in caches inside CoreText, which means our
3483         WebCascadeList can too.
3484
3485         Test: platform/mac/fast/text/crash-complextextcontroller-custom-cascade-list.html
3486
3487         * platform/graphics/FontCascade.cpp:
3488         (WebCore::FontCascade::FontCascade): Initialize WeakPtrFactory.
3489         * platform/graphics/FontCascade.h:
3490         (WebCore::FontCascade::createWeakPtr):
3491         * platform/graphics/mac/ComplexTextControllerCoreText.mm: Migrate the raw pointer
3492         to WeakPtr.
3493         (-[WebCascadeList initWithFont:character:]):
3494         (-[WebCascadeList count]):
3495         (-[WebCascadeList objectAtIndex:]):
3496
3497 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3498
3499         Rename BreakingContextInlineHeaders.h to BreakingContext.h
3500         https://bugs.webkit.org/show_bug.cgi?id=142404
3501
3502         Reviewed by Simon Fraser.
3503
3504         No point naming it "InlineHeaders" when there are no non-inline-headers files.
3505
3506         No new tests because this is just a rename of a file.
3507
3508         * WebCore.vcxproj/WebCore.vcxproj:
3509         * WebCore.vcxproj/WebCore.vcxproj.filters:
3510         * WebCore.xcodeproj/project.pbxproj:
3511         * rendering/RenderBlockLineLayout.cpp:
3512         * rendering/line/BreakingContext.h: Renamed from Source/WebCore/rendering/line/BreakingContextInlineHeaders.h.
3513         (WebCore::WordMeasurement::WordMeasurement):
3514         (WebCore::BreakingContext::BreakingContext):
3515         (WebCore::BreakingContext::currentObject):
3516         (WebCore::BreakingContext::lineBreak):
3517         (WebCore::BreakingContext::lineWidth):
3518         (WebCore::BreakingContext::atEnd):
3519         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
3520         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
3521         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory):
3522         (WebCore::BreakingContext::InlineIteratorHistory::push):
3523         (WebCore::BreakingContext::InlineIteratorHistory::update):
3524         (WebCore::BreakingContext::InlineIteratorHistory::renderer):
3525         (WebCore::BreakingContext::InlineIteratorHistory::offset):
3526         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator):
3527         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode):
3528         (WebCore::BreakingContext::InlineIteratorHistory::get):
3529         (WebCore::BreakingContext::InlineIteratorHistory::current):
3530         (WebCore::BreakingContext::InlineIteratorHistory::historyLength):
3531         (WebCore::BreakingContext::InlineIteratorHistory::moveTo):
3532         (WebCore::BreakingContext::InlineIteratorHistory::increment):
3533         (WebCore::BreakingContext::InlineIteratorHistory::clear):
3534         (WebCore::BreakingContext::initializeForCurrentObject):
3535         (WebCore::BreakingContext::increment):
3536         (WebCore::BreakingContext::handleBR):
3537         (WebCore::borderPaddingMarginStart):
3538         (WebCore::borderPaddingMarginEnd):
3539         (WebCore::shouldAddBorderPaddingMargin):
3540         (WebCore::previousInFlowSibling):
3541         (WebCore::inlineLogicalWidth):
3542         (WebCore::BreakingContext::handleOutOfFlowPositioned):
3543         (WebCore::BreakingContext::handleFloat):
3544         (WebCore::shouldSkipWhitespaceAfterStartObject):
3545         (WebCore::BreakingContext::handleEmptyInline):
3546         (WebCore::BreakingContext::handleReplaced):
3547         (WebCore::firstPositiveWidth):
3548         (WebCore::iteratorIsBeyondEndOfRenderCombineText):
3549         (WebCore::nextCharacter):
3550         (WebCore::updateCounterIfNeeded):
3551         (WebCore::measureHyphenWidth):
3552         (WebCore::textWidth):
3553         (WebCore::ensureCharacterGetsLineBox):
3554         (WebCore::tryHyphenating):
3555         (WebCore::BreakingContext::handleText):
3556         (WebCore::textBeginsWithBreakablePosition):
3557         (WebCore::BreakingContext::canBreakAtThisPosition):
3558         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
3559         (WebCore::checkMidpoints):
3560         (WebCore::BreakingContext::handleEndOfLine):
3561         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
3562         * rendering/line/LineBreaker.cpp:
3563
3564 2015-03-06  Dan Bernstein  <mitz@apple.com>
3565
3566         Expose some of the functionality of extract-localizable-strings.pl as a module
3567         https://bugs.webkit.org/show_bug.cgi?id=142038
3568
3569         Reviewed by Sam Weinig.
3570
3571         * LocalizableStrings.pm: Copied from Source/WebCore/extract-localizable-strings.pl.
3572         (setTreatWarningsAsErrors): Added this setter for the variable moved here.
3573         (sawError): Added a getter.
3574         (emitError): Added. Emits the error message and sets $sawError.
3575         (unescapeHexSequence): Moved from extract-localizable-strings.pl and renamed to start with
3576         a lowercase letter.
3577         (keyCollisionCount): Added this getter.
3578         (localizedCount): Added this getter.
3579         (HandleUIString): Moved from extract-localizable-strings.pl and made it increment the
3580         localized string count.
3581         (writeStringsFile): Moved code from extract-localizable-strings.pl into this new subroutine.
3582         (verifyStringsFile): Ditto.
3583
3584         * WebCore.xcodeproj/project.pbxproj: Added LocalizableStrings.pm to the Copy Scripts build
3585         phase.
3586
3587         * extract-localizable-strings.pl:
3588         (emitWarning): Moved to the module.
3589         (UnescapeHexSequence): Ditto.
3590         (HandleUIString): Ditto.
3591
3592 2015-03-06  Darin Adler  <darin@apple.com>
3593
3594         Remove unused C++ DOM event handler attribute functions
3595         https://bugs.webkit.org/show_bug.cgi?id=142398
3596
3597         Reviewed by Anders Carlsson.
3598
3599         * dom/EventTarget.h: Removed now-unneeded macros: DEFINE_ATTRIBUTE_EVENT_LISTENER,
3600         DECLARE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER, DEFINE_VIRTUAL_ATTRIBUTE_EVENT_LISTENER,
3601         DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER, DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER,
3602         DECLARE_FORWARDING_ATTRIBUTE_EVENT_LISTENER, DEFINE_FORWARDING_ATTRIBUTE_EVENT_LISTENER.
3603
3604         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3605         (WebCore::AudioScheduledSourceNode::setOnended): Deleted.
3606         (WebCore::AudioScheduledSourceNode::finish): Rewrote this to use dispatchEvent
3607         instead of one-off event-sending code. Also use a lambda to avoid needing two
3608         additional member functions to implement this.
3609         (WebCore::AudioScheduledSourceNode::notifyEndedDispatch): Deleted.
3610         (WebCore::AudioScheduledSourceNode::notifyEnded): Deleted.
3611         * Modules/webaudio/AudioScheduledSourceNode.h: Updated for above.
3612
3613         * Modules/battery/BatteryManager.h: Removed onxxx and setOnxxx functions,
3614         including ones created with macros from EventTarget.h.
3615         * Modules/encryptedmedia/MediaKeySession.h: Ditto.
3616         * Modules/indexeddb/IDBDatabase.h: Ditto.
3617         * Modules/indexeddb/IDBOpenDBRequest.h: Ditto.
3618         * Modules/indexeddb/IDBRequest.h: Ditto.
3619         * Modules/indexeddb/IDBTransaction.h: Ditto.
3620         * Modules/mediastream/MediaStream.h: Ditto.
3621         * Modules/mediastream/MediaStreamTrack.h: Ditto.
3622         * Modules/mediastream/RTCDTMFSender.h: Ditto.
3623         * Modules/mediastream/RTCDataChannel.h: Ditto.
3624         * Modules/mediastream/RTCPeerConnection.h: Ditto.
3625         * Modules/notifications/Notification.h: Ditto.
3626         * Modules/speech/SpeechSynthesisUtterance.h: Ditto.
3627         * Modules/webaudio/AudioContext.h: Ditto.
3628         * Modules/webaudio/ScriptProcessorNode.cpp: Ditto.
3629         * Modules/webaudio/ScriptProcessorNode.h: Ditto.
3630         * Modules/websockets/WebSocket.h: Ditto.
3631         * css/FontLoader.h: Ditto.
3632         * dom/Document.h: Ditto.
3633         * dom/Element.cpp: Ditto.
3634         * dom/Element.h: Ditto.
3635         * dom/MessagePort.h: Ditto.
3636         * fileapi/FileReader.h: Ditto.
3637         * html/HTMLBodyElement.h: Ditto.
3638         * html/HTMLFormElement.h: Ditto.
3639         * html/HTMLFrameSetElement.h: Ditto.
3640         * html/HTMLInputElement.h: Ditto.
3641         * html/HTMLMediaElement.h: Ditto.
3642         * html/HTMLVideoElement.h: Ditto.
3643         * html/track/TextTrack.h: Ditto.
3644         * html/track/TextTrackCue.h: Ditto.
3645         * html/track/TrackListBase.h: Ditto.
3646         * loader/appcache/DOMApplicationCache.h: Ditto.
3647         * page/DOMWindow.h: Ditto.
3648         * page/EventSource.h: Ditto.
3649         * page/Performance.h: Ditto.
3650         * workers/AbstractWorker.h: Ditto.
3651         * workers/DedicatedWorkerGlobalScope.h: Ditto.
3652         * workers/Worker.h: Ditto.
3653         * workers/WorkerGlobalScope.h: Ditto.
3654         * xml/XMLHttpRequest.h: Ditto.
3655         * xml/XMLHttpRequestUpload.h: Ditto.
3656
3657 2015-03-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
3658
3659         Setting any of the <object> element plugin controlling attributes does not have any affect.
3660         https://bugs.webkit.org/show_bug.cgi?id=141936.
3661
3662         Reviewed by Simon Fraser.
3663         
3664         When setting any of the <object> element plugin controlling attributes
3665         dynamically we need to mark the the element to be dirty by calling
3666         setNeedsStyleRecalc(), so it has to recreate its renderer when needed.
3667
3668         Tests: fast/css/image-object-hover-inherit.html
3669                svg/as-object/svg-in-object-dynamic-attribute-change.html
3670
3671         * dom/Element.h: Delete unimplemented function.
3672         
3673         * html/HTMLObjectElement.cpp:
3674         (WebCore::HTMLObjectElement::parseAttribute): Mark the element dirty by
3675         calling setNeedsStyleRecalc() when one of the plugin controlling attributes
3676         gets changed. We have to clear m_useFallbackContent because the attribute's
3677         new value might fix the object rendering.
3678         
3679         * html/HTMLObjectElement.h: Add a function to clear m_useFallbackContent.
3680
3681 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3682
3683         Test horiz-origin-x and horiz-origin-y in SVG fonts
3684         https://bugs.webkit.org/show_bug.cgi?id=142403
3685
3686         Reviewed by Simon Fraser.
3687
3688         Remove incorrect comment.
3689
3690         Test: svg/fonts/svg-font-horiz-origin.html
3691
3692         * svg/SVGToOTFFontConversion.cpp:
3693         (WebCore::CFFBuilder::CFFBuilder):
3694
3695 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
3696
3697         Allow tree dumping functions to be used in release builds by switching a flag
3698         https://bugs.webkit.org/show_bug.cgi?id=142379
3699
3700         Reviewed by Zalan Bujtas.
3701
3702         There are various tree dumping functions that are useful for debugging, and sometimes
3703         you want to be able to use them in release builds. Currently they are surrounded by
3704         #ifndef NDEBUG. Change this to #if ENABLE(TREE_DEBUGGING), which is defined to 0 or 1
3705         in wtf/Platform.h
3706
3707         * dom/DocumentMarkerController.cpp:
3708         * dom/DocumentMarkerController.h:
3709         * dom/Element.cpp:
3710         * dom/Element.h:
3711         * dom/Node.cpp:
3712         * dom/Node.h:
3713         * dom/Position.cpp:
3714         * dom/Position.h:
3715         * dom/Range.cpp:
3716         * dom/Range.h:
3717         * dom/Text.cpp:
3718         * dom/Text.h:
3719         * editing/FrameSelection.cpp:
3720         * editing/FrameSelection.h:
3721         * editing/VisiblePosition.cpp:
3722         * editing/VisiblePosition.h:
3723         * editing/VisibleSelection.cpp:
3724         * editing/VisibleSelection.h:
3725         * html/parser/HTMLElementStack.cpp:
3726         * html/parser/HTMLFormattingElementList.cpp:
3727         * rendering/CounterNode.cpp:
3728         * rendering/CounterNode.h:
3729         * rendering/InlineBox.cpp:
3730         * rendering/InlineBox.h:
3731         * rendering/InlineFlowBox.cpp:
3732         * rendering/InlineFlowBox.h:
3733         * rendering/InlineTextBox.cpp:
3734         * rendering/InlineTextBox.h:
3735         * rendering/RenderBlockFlow.cpp:
3736         * rendering/RenderBlockFlow.h:
3737         * rendering/RenderCounter.cpp:
3738         * rendering/RenderCounter.h:
3739         * rendering/RenderLayer.cpp:
3740         * rendering/RenderLayer.h:
3741         * rendering/RenderLayerBacking.cpp:
3742         (WebCore::RenderLayerBacking::createGraphicsLayer):
3743         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
3744         (WebCore::RenderLayerBacking::updateForegroundLayer):
3745         (WebCore::RenderLayerBacking::updateBackgroundLayer):
3746         * rendering/RenderLayerCompositor.cpp:
3747         (WebCore::CompositingState::CompositingState):
3748         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
3749         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3750         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3751         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3752         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3753         (WebCore::RenderLayerCompositor::ensureRootLayer):
3754         * rendering/RenderObject.cpp:
3755         * rendering/RenderObject.h:
3756         * rendering/RootInlineBox.cpp:
3757         * rendering/RootInlineBox.h:
3758         * rendering/SimpleLineLayoutFunctions.cpp:
3759         * rendering/SimpleLineLayoutFunctions.h:
3760         * rendering/svg/SVGResources.cpp:
3761         * rendering/svg/SVGResources.h:
3762
3763 2015-03-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
3764
3765         An SVG element without intrinsic size inherits the container size as its viewport instead of inheriting the container viewport.
3766         https://bugs.webkit.org/show_bug.cgi?id=141725.
3767
3768         Reviewed by Darin Adler.
3769
3770         The current viewport of the <svg> element should be retrieved from its
3771         renderer if the renderer is available. If the renderer is not created yet,
3772         this means the viewport is needed to calculate the size of the renderer.
3773         In this case, we should return the element size if it is intrinsic size.
3774         
3775         Test: svg/css/svg-css-different-intrinsic-sizes.html
3776
3777         * svg/SVGSVGElement.cpp:
3778         (WebCore::SVGSVGElement::currentViewportSize): Change the order for
3779         returning the viewport of the <svg> element. We should consider the case
3780         of a valid renderer before considering the case of an intrinsic size.
3781
3782 2015-03-06  Simon Fraser  <simon.fraser@apple.com>
3783
3784         Allow composited clip-path to be updated without a layer repaint
3785         https://bugs.webkit.org/show_bug.cgi?id=142384
3786
3787         Reviewed by Zalan Bujtas.
3788         
3789         When clip-path is mapped to a compositing shape layer mask, we can just
3790         push a new shape to the GraphicsLayer to update the clip path, without
3791         needing to repaint.
3792         
3793         Achieve this by adding ContextSensitivePropertyClipPath. When set, and the
3794         stars are aligned, issue a StyleDifferenceRecompositeLayer rather than
3795         a StyleDifferenceRepaint.
3796         
3797         We ask RenderLayerCompositor whether the clip path can be composited
3798         to hide platform differences related to whether GraphicsLayer supports
3799         shape masks.
3800
3801         Test: compositing/masks/compositing-clip-path-change-no-repaint.html
3802
3803         * rendering/RenderElement.cpp:
3804         (WebCore::RenderElement::adjustStyleDifference): Remove obvious comment
3805         about opacity. Handle ContextSensitivePropertyClipPath.
3806         * rendering/RenderLayerCompositor.cpp:
3807         (WebCore::RenderLayerCompositor::canCompositeClipPath): If we have a mask
3808         we have to paint the mask + clip path into the mask layer (mirrors code in
3809         RenderLayerBacking::updateMaskingLayer but isn't quite similar enough to share).
3810         * rendering/RenderLayerCompositor.h:
3811         * rendering/style/RenderStyle.cpp:
3812         (WebCore::RenderStyle::changeRequiresRepaint): Set ContextSensitivePropertyClipPath
3813         and don't return, as is normal for context-sensitive property handling.
3814         * rendering/style/RenderStyleConstants.h: Line things up to avoid future bit
3815         fumbles, and remove unnecessary braces.
3816
3817 2015-03-06  Alex Christensen  <achristensen@webkit.org>
3818
3819         [Content Extensions] Process all actions when blocking a URL.
3820         https://bugs.webkit.org/show_bug.cgi?id=142363
3821
3822         Reviewed by Darin Adler.
3823
3824         This can only be tested once we implement css selectors.
3825
3826         * contentextensions/ContentExtensionsBackend.cpp:
3827         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForURL):
3828         Do not return early when adding a block action.
3829         * loader/cache/CachedResourceLoader.cpp:
3830         (WebCore::CachedResourceLoader::requestResource):
3831         Process all actions before returning.
3832
3833 2015-03-05  Darin Adler  <darin@apple.com>
3834
3835         Make JavaScript binding get and set legacy event listener attributes directly
3836         https://bugs.webkit.org/show_bug.cgi?id=142282
3837
3838         Reviewed by Antti Koivisto.
3839
3840         Test: fast/dom/legacy-event-handler-attributes.html
3841
3842         This patch changes the JavaScript getters and setters for these attributes
3843         to work directly without requiring any functions in the C++ DOM implementation.
3844         A subsequent patch will remove the now-unused C++ DOM implementation.
3845
3846         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3847         (WebCore::AudioScheduledSourceNode::setOnended): Remove code to set
3848         m_hasEndedListener; this was incorrect since it only detected event listeners
3849         set up with the event handler attribute, not with addEventListener.
3850         (WebCore::AudioScheduledSourceNode::addEventListener): Added code to update
3851         m_hasEndedListener after making changes to the event listeners.
3852         (WebCore::AudioScheduledSourceNode::removeEventListener): Ditto.
3853         (WebCore::AudioScheduledSourceNode::removeAllEventListeners): Ditto.
3854         * Modules/webaudio/AudioScheduledSourceNode.h: Added above overrides.
3855
3856         * Modules/webaudio/ScriptProcessorNode.cpp:
3857         (WebCore::ScriptProcessorNode::setOnaudioprocess): Remove code to set
3858         m_hasAudioProcessListener; this was incorrect since it only detected event listeners
3859         set up with the event handler attribute, not with addEventListener.
3860         (WebCore::ScriptProcessorNode::addEventListener): Added code to update
3861         m_hasAudioProcessListener after making changes to the event listeners.
3862         (WebCore::ScriptProcessorNode::removeEventListener): Ditto.
3863         (WebCore::ScriptProcessorNode::removeAllEventListeners): Ditto.
3864         * Modules/webaudio/ScriptProcessorNode.h: Added above overrides.
3865
3866         * bindings/js/JSEventListener.cpp:
3867         (WebCore::legacyEventListenerAttribute): Added.
3868         (WebCore::createEventListenerForLegacyAttribute): Added.
3869         (WebCore::setLegacyEventListenerAttribute): Added.
3870         (WebCore::legacyWindowEventListenerAttribute): Added.
3871         (WebCore::setLegacyWindowEventListenerAttribute): Added.
3872
3873         * bindings/js/JSEventListener.h:
3874         (WebCore::createJSEventListenerForAttribute): Deleted.
3875
3876         * bindings/scripts/CodeGeneratorJS.pm:
3877         (GenerateAttributeEventListenerCall): Deleted.
3878         (LegacyEventListenerAttributeEventName): Added.
3879         (LegacyEventListenerAttributePrefix): Added.
3880         (GenerateImplementation): Use "auto" in lots of places to simplify the code
3881         generation. Replaced the old inlined code to deal with legacy event listener
3882         attributes with code that simply calls the new functions from JSEventLister.h.
3883         (GenerateCallWith): Use "auto".
3884         (GenerateConstructorDefinition): Ditto.
3885
3886         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Updated expected
3887         results since these now use auto.
3888         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: Ditto.
3889         * bindings/scripts/test/JS/JSTestEventConstructor.cpp: Ditto.
3890         * bindings/scripts/test/JS/JSTestEventTarget.cpp: Ditto.
3891         * bindings/scripts/test/JS/JSTestException.cpp: Ditto.
3892         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: Ditto.
3893         * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
3894         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
3895         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: Ditto.
3896         * bindings/scripts/test/JS/JSTestNode.cpp: Ditto.
3897         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Ditto.
3898         * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
3899         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
3900         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
3901         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
3902         * bindings/scripts/test/JS/JSattribute.cpp: Ditto.
3903         * bindings/scripts/test/JS/JSreadonly.cpp: Ditto.
3904
3905         * dom/MessagePort.cpp:
3906         (WebCore::MessagePort::addEventListener): Moved logic that calls the start
3907         function in here from setOnmessage, since the latter will no longer be called.
3908         * dom/MessagePort.h: Ditto.
3909
3910 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
3911
3912         [iOS] SVG fonts are garbled
3913         https://bugs.webkit.org/show_bug.cgi?id=142377
3914
3915         Reviewed by Simon Fraser.
3916
3917         The C++ spec says that casting a negative floating point number to
3918         an unsigned integer is undefined. Instead, use clamping.
3919
3920         Covered by existing SVG font tests.
3921
3922         * Configurations/FeatureDefines.xcconfig:
3923         * svg/SVGToOTFFontConversion.cpp:
3924         (WebCore::writeCFFEncodedNumber):
3925
3926 2015-03-06  Commit Queue  <commit-queue@webkit.org>
3927
3928         Unreviewed, rolling out r181139.
3929         https://bugs.webkit.org/show_bug.cgi?id=142394
3930
3931         "Caused many crashes in API tests and layout tests in Debug
3932         builds on bots." (Requested by ddkilzer on #webkit).
3933
3934         Reverted changeset:
3935
3936         "Allow tree dumping functions to be used in release builds by
3937         switching a flag"
3938         https://bugs.webkit.org/show_bug.cgi?id=142379
3939         http://trac.webkit.org/changeset/181139
3940
3941 2015-03-05  Philippe Normand  <pnormand@igalia.com>
3942
3943         [MediaStream] new load method for MediaStreamPrivate objects
3944         https://bugs.webkit.org/show_bug.cgi?id=142346
3945
3946         Reviewed by Eric Carlson.
3947
3948         No new tests, existing mediastream tests cover this use-case.
3949
3950         * html/HTMLMediaElement.cpp:
3951         (WebCore::HTMLMediaElement::loadResource): Use new load method for MediaStreams.
3952         * platform/graphics/MediaPlayer.cpp:
3953         (WebCore::NullMediaPlayerPrivate::load): New stub.
3954         (WebCore::MediaPlayer::load): New load method for
3955         MediaStreamPrivate.
3956         (WebCore::MediaPlayer::nextBestMediaEngine): Set a new boolean on
3957         the MediaEngineSupportParameters to differenciate with MSE and
3958         normal video resources.
3959         (WebCore::MediaPlayer::loadWithNextMediaEngine): Defer loading of
3960         the MediaStream to the MediaPlayerPrivate backend.
3961         * platform/graphics/MediaPlayer.h:
3962         (WebCore::MediaEngineSupportParameters::MediaEngineSupportParameters):
3963         * platform/graphics/MediaPlayerPrivate.h:
3964         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3965         (WebCore::MediaPlayerPrivateAVFoundation::load): New empty load
3966         method for MediaStreamPrivate objects.
3967         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3968         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto.
3969         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
<