Favicons are not always loaded.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-20  Per Arne Vollan  <peavo@outlook.com>
2
3         Favicons are not always loaded.
4         https://bugs.webkit.org/show_bug.cgi?id=143880
5
6         Reviewed by Darin Adler.
7
8         If the favicon link element(s) in the document does not have a mime type,
9         the favicon is loaded from the domain root (/favicon.ico). If no favicon
10         exists at this location, the favicon loading will fail. This can be solved
11         by not demanding that the link element has a mime type.
12
13         Test: fast/dom/icon-url-without-mimetype.html
14
15         * loader/icon/IconController.cpp:
16         (WebCore::iconFromLinkElements): Return the chosen icon URL instead of a vector of URLs.
17         (WebCore::IconController::url):
18         (WebCore::iconsFromLinkElements): Deleted.
19
20 2015-04-20  Martin Robinson  <mrobinson@igalia.com>
21
22         [CMake] Include ICU unconditionally on the source lists
23         https://bugs.webkit.org/show_bug.cgi?id=143900
24
25         Reviewed by Darin Adler.
26
27         No new tests. This is just a build file change.
28
29         * CMakeLists.txt: Integrate ICU source files, includes, and libraries into the main
30         sections. They are shared by all platforms.
31         * PlatformGTK.cmake: Eliminate build rules that are duplicated from the main CMakeLists.txt.
32
33 2015-04-20  Chris Fleizach  <cfleizach@apple.com>
34
35         AX: iOS: Text input field ignores value of read-only and aria-readonly attributes
36         https://bugs.webkit.org/show_bug.cgi?id=143946
37
38         Reviewed by Mario Sanchez Prada.
39
40         Expose an existing method for determining whether the value can be set to the iOS accessibility platform.
41
42         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
43         (-[WebAccessibilityObjectWrapper accessibilityCanSetValue]):
44
45 2015-04-20  Andreas Kling  <akling@apple.com>
46
47         Merge TreeShared into Node.
48         <https://webkit.org/b/143942>
49
50         Reviewed by Darin Adler.
51
52         Node was the only remaining user of TreeShared, so just fold the class into Node.
53
54         * WebCore.vcxproj/WebCore.vcxproj:
55         * WebCore.vcxproj/WebCore.vcxproj.filters:
56         * WebCore.xcodeproj/project.pbxproj:
57         * dom/Node.cpp:
58         (WebCore::Node::Node):
59         (WebCore::Node::~Node):
60         * dom/Node.h:
61         (WebCore::Node::ref):
62         (WebCore::Node::deref):
63         (WebCore::Node::hasOneRef):
64         (WebCore::Node::refCount):
65         (WebCore::adopted):
66         (WebCore::Node::hasTreeSharedParent): Deleted.
67         * platform/TreeShared.h: Removed.
68
69 2015-04-19  Benjamin Poulain  <benjamin@webkit.org>
70
71         Improve the feature.json files
72
73         * features.json:
74
75 2015-04-18  Jon Lee  <jonlee@apple.com>
76
77         [Mac] Time elapsed should be right-aligned
78         https://bugs.webkit.org/show_bug.cgi?id=143927
79
80         Reviewed by Eric Carlson.
81
82         Current time is left-aligned, which is visually jarring when going from < 1 hour to > 1 hour.
83
84         * Modules/mediacontrols/mediaControlsApple.css:
85         (audio::-webkit-media-controls-current-time-display): Set justify-content to flex-end.
86         (audio::-webkit-media-controls-time-remaining-display): Explicitly set justify-content to flex-start.
87
88 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
89
90         REGRESSION (r181656): Animated tiled layers are missing content
91         https://bugs.webkit.org/show_bug.cgi?id=143911
92         rdar://problem/20596328
93
94         Reviewed by Darin Adler.
95
96         After r181656, all requestAnimationFrame was falling back to timers, and not
97         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
98         fumble. As a result, GraphicsLayerUpdater (which updates tiled layers during
99         animations) was failing to do any updates.
100         
101         Replace this confusing Optional<> code with simpler code that just forces the
102         clients to make a DisplayRefreshMonitor if they can, first asking
103         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
104         
105         Make lots of things into references, and use C++11 initialization in some places.
106         
107         Add Internals API to allow a test to get the number of layer flushes that have
108         occurred.
109         
110         * dom/ScriptedAnimationController.cpp:
111         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
112         (WebCore::ScriptedAnimationController::windowScreenDidChange):
113         (WebCore::ScriptedAnimationController::scheduleAnimation):
114         (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor):
115         * dom/ScriptedAnimationController.h:
116         * page/ChromeClient.h:
117         * platform/graphics/DisplayRefreshMonitor.cpp:
118         (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
119         (WebCore::DisplayRefreshMonitor::create):
120         (WebCore::DisplayRefreshMonitor::addClient):
121         (WebCore::DisplayRefreshMonitor::removeClient):
122         (WebCore::DisplayRefreshMonitor::displayDidRefresh):
123         * platform/graphics/DisplayRefreshMonitor.h:
124         * platform/graphics/DisplayRefreshMonitorClient.cpp:
125         (WebCore::DisplayRefreshMonitorClient::~DisplayRefreshMonitorClient):
126         * platform/graphics/DisplayRefreshMonitorClient.h:
127         * platform/graphics/DisplayRefreshMonitorManager.cpp:
128         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
129         (WebCore::DisplayRefreshMonitorManager::registerClient):
130         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
131         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
132         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
133         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
134         * platform/graphics/DisplayRefreshMonitorManager.h:
135         * platform/graphics/GraphicsLayerUpdater.cpp:
136         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
137         (WebCore::GraphicsLayerUpdater::scheduleUpdate):
138         (WebCore::GraphicsLayerUpdater::screenDidChange):
139         (WebCore::GraphicsLayerUpdater::displayRefreshFired):
140         (WebCore::GraphicsLayerUpdater::createDisplayRefreshMonitor):
141         * platform/graphics/GraphicsLayerUpdater.h:
142         * rendering/RenderLayerCompositor.cpp:
143         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
144         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
145         (WebCore::RenderLayerCompositor::notifyFlushBeforeDisplayRefresh):
146         (WebCore::RenderLayerCompositor::flushLayersSoon):
147         (WebCore::RenderLayerCompositor::createDisplayRefreshMonitor):
148         (WebCore::RenderLayerCompositor::startTrackingLayerFlushes):
149         (WebCore::RenderLayerCompositor::layerFlushCount):
150         * rendering/RenderLayerCompositor.h:
151         * testing/Internals.cpp:
152         (WebCore::Internals::startTrackingLayerFlushes):
153         (WebCore::Internals::layerFlushCount):
154         * testing/Internals.h:
155         * testing/Internals.idl:
156
157 2015-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
158
159         Large values for line-height cause integer overflow in RenderStyle::computedLineHeight
160         https://bugs.webkit.org/show_bug.cgi?id=143863
161
162         Reviewed by Rob Buis.
163
164         When we compute huge values for line-height through percentage or CSS
165         calc, we'll overflow the integer and later on
166         ShapeOutsideInfo::computeDeltasForContainingBlockLine will ASSERT
167         because it expects non-negative line height.  So for the computed
168         line-height, clamp to an integer range to avoid overflow. Note that
169         the code path for percentages here is safe because LayoutUnit clamps
170         to an int on conversion.
171
172         This is based on a Blink patch by Rob Buis.
173
174         Test: fast/shapes/shape-outside-floats/shape-outside-negative-line-height-crash.html
175
176         * rendering/style/RenderStyle.cpp:
177         (WebCore::RenderStyle::computedLineHeight): Clamp line-height to an
178             int to avoid overflow.
179
180 2015-04-17  Beth Dakin  <bdakin@apple.com>
181
182         Force mouse events should go through normal mouse event handling code paths
183         https://bugs.webkit.org/show_bug.cgi?id=143749
184         -and corresponding-
185         rdar://problem/20472895
186
187         Reviewed by Dean Jackson.
188
189         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
190         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
191         behind the cancel and click events because we plan to remove those, and it also 
192         leaves mouseforcewillbegin because that is necessarily a very different event more 
193         tied to the NSImmediateActionGestureRecognizer than these other events which are 
194         tied to NSResponder’s pressureChangeWithEvent.
195
196         New helper functions.
197         * dom/Document.cpp:
198         (WebCore::Document::hasListenerTypeForEventType):
199         * dom/Document.h:
200         * dom/Element.cpp:
201         (WebCore::isForceEvent):
202
203         Move the code to ensure the force events have listeners in order to fire to 
204         dispatchMouseEvent, and delete the old implementations.
205         (WebCore::Element::dispatchMouseEvent):
206         (WebCore::Element::dispatchMouseForceChanged): Deleted.
207         (WebCore::Element::dispatchMouseForceDown): Deleted.
208         (WebCore::Element::dispatchMouseForceUp): Deleted.
209         * dom/Element.h:
210
211         Perform a hit test and pipe the events through dispatchMouseEvent(). 
212         * page/EventHandler.cpp:
213         (WebCore::EventHandler::handleMouseForceEvent):
214         * page/EventHandler.h:
215
216         New types for the new events.
217         * platform/PlatformEvent.h:
218
219         Forward to EventHandler. 
220         * replay/UserInputBridge.cpp:
221         (WebCore::UserInputBridge::handleMouseForceEvent):
222         * replay/UserInputBridge.h:
223
224 2015-04-17  Zalan Bujtas  <zalan@apple.com>
225
226         RenderTableCell::computeCollapsed*Border() should check if the cell is still attached to the render tree.
227         https://bugs.webkit.org/show_bug.cgi?id=143887
228         rdar://problem/20568989
229
230         Reviewed by Simon Fraser.
231
232         Detached table cell has no access to its parent table. This is a speculative fix to
233         avoid dereferencing the invalid table pointer.
234
235         * rendering/RenderTableCell.cpp:
236         (WebCore::RenderTableCell::computeCollapsedStartBorder):
237         (WebCore::RenderTableCell::computeCollapsedEndBorder):
238         (WebCore::RenderTableCell::computeCollapsedBeforeBorder):
239         (WebCore::RenderTableCell::computeCollapsedAfterBorder):
240
241 2015-04-16  Roger Fong  <roger_fong@apple.com>
242
243         Update fullscreen button visibility on fullscreen change.
244         https://bugs.webkit.org/show_bug.cgi?id=143861.
245         <rdar://problem/20143218>
246
247         Reviewed by Eric Carlson.
248
249         * Modules/mediacontrols/mediaControlsApple.js:
250         (Controller): There is no need for hasVisualMedia to be a class variable.
251         (Controller.prototype.handleReadyStateChange):
252         (Controller.prototype.handleFullscreenChange):
253         (Controller.prototype.updateFullscreenButtons):
254
255 2015-04-17  Daniel Bates  <dabates@apple.com>
256
257         REGRESSION: SVG does not support link dragging
258         https://bugs.webkit.org/show_bug.cgi?id=141597
259
260         Reviewed by Darin Adler.
261
262         Fixes an issue where a SVG hyperlink cannot be dragged. We should support
263         dragging an SVG A element just as we support dragging an HTML A element.
264
265         Test: fast/events/drag-and-drop-link.html
266
267         * page/DragController.cpp: Removed explicit include of header Element.h as it will
268         be ultimately included by HTMLAnchorElement.h, among other headers.
269         (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
270         (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
271         determine whether a element is a hyperlink that can be dragged.
272         * page/DragController.h:
273         * page/EventHandler.cpp:
274         (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
275          WebCore::isDraggableLink().
276         * rendering/HitTestResult.cpp:
277         (WebCore::HitTestResult::isLiveLink): Deleted.
278         * rendering/HitTestResult.h:
279
280 2015-04-17  Commit Queue  <commit-queue@webkit.org>
281
282         Unreviewed, rolling out r182912 and r182920.
283         https://bugs.webkit.org/show_bug.cgi?id=143881
284
285         Build breakage in some configurations (Requested by ap on
286         #webkit).
287
288         Reverted changesets:
289
290         "Force mouse events should go through normal mouse event
291         handling code paths"
292         https://bugs.webkit.org/show_bug.cgi?id=143749
293         http://trac.webkit.org/changeset/182912
294
295         http://trac.webkit.org/changeset/182920
296
297 2015-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
298
299         Fix review comments for https://bugs.webkit.org/show_bug.cgi?id=143590
300         following http://trac.webkit.org/changeset/182876.
301
302         Reviewed by Daniel Bates.
303
304         * ChangeLog:
305         Fixed typo.
306         
307         * style/StyleFontSizeFunctions.cpp:
308         (WebCore::Style::computedFontSizeFromSpecifiedSize):
309         Fixed a typo in an enum definition and changed the name of an argument.
310
311 2015-04-17  Philippe Normand  <pnormand@igalia.com>
312
313         [GStreamer] Silent WebAudio buffers support
314         https://bugs.webkit.org/show_bug.cgi?id=143869
315
316         Reviewed by Carlos Garcia Campos.
317
318         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
319         (webKitWebAudioSrcLoop): Set gap flag on silent buffers. The audio
320         sink can then drop them and avoid un-necessary buffer processing.
321
322 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
323
324         [SOUP] Redirect to non HTTP destination is broken
325         https://bugs.webkit.org/show_bug.cgi?id=143866
326
327         Reviewed by Sergio Villar Senin.
328
329         This is because we are passing true unconditionally as
330         isHTTPFamilyRequest parameter of
331         createSoupRequestAndMessageForHandle in continueAfterWillSendRequest.
332         We don't actually need to pass isHTTPFamilyRequest parameter to
333         createSoupRequestAndMessageForHandle, since it can simply check
334         that from the given request.
335
336         Covered by unit tets and also cache/disk-cache/disk-cache-redirect-to-data.html.
337
338         * platform/network/soup/ResourceHandleSoup.cpp:
339         (WebCore::continueAfterWillSendRequest):
340         (WebCore::createSoupRequestAndMessageForHandle):
341         (WebCore::ResourceHandle::start):
342
343 2015-04-16  Alex Christensen  <achristensen@webkit.org>
344
345         Use less memory when compiling content extensions
346         https://bugs.webkit.org/show_bug.cgi?id=143857
347
348         Reviewed by Benjamin Poulain.
349
350         When compiling a content extension, we convert the rule list into several intermediate forms:
351
352         1) A String.
353         2) A JSValue from JSONParse in loadEncodedRules.
354         3) A Vector of ContentExtensionRules.
355         4) A CombinedURLFilters object representing the pieces of the regular expressions from the triggers.
356         5) A Vector of NFAs.
357         6) A DFA for each NFA.
358         7) A Vector of DFABytecode.
359         
360         Each one of these contains all the information contained in the content extension,
361         so we do not need to keep them all in memory at the same time like we are doing now.
362         When we are done with one, we can free that memory to greatly reduce the maximum memory usage while compiling.
363         The next step will be to reduce the copies of the original JSON String and to generate NFAs one at a time.
364
365         * contentextensions/CombinedURLFilters.cpp:
366         (WebCore::ContentExtensions::CombinedURLFilters::clear):
367         * contentextensions/CombinedURLFilters.h:
368         * contentextensions/ContentExtensionCompiler.cpp:
369         (WebCore::ContentExtensions::compileRuleList):
370         Clear structures when finished using them.
371
372 2015-04-16  Brady Eidson  <beidson@apple.com>
373
374         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
375         https://bugs.webkit.org/show_bug.cgi?id=143834
376
377         Reviewed by Anders Carlsson.
378
379         - Add moveFile() for a WK2 call site to use.
380         - Remove renameFile() as it is now dead code.
381
382         * platform/FileSystem.h:
383
384         * platform/gtk/FileSystemGtk.cpp:
385         (WebCore::renameFile): Deleted.
386
387         * platform/mac/FileSystemMac.mm:
388         (WebCore::moveFile):
389
390         * platform/posix/FileSystemPOSIX.cpp:
391         (WebCore::renameFile): Deleted.
392
393         * platform/win/FileSystemWin.cpp:
394         (WebCore::renameFile): Deleted.
395
396 2015-04-16  Roger Fong  <roger_fong@apple.com>
397
398         Media element time displays shouldn't wrap.
399         https://bugs.webkit.org/show_bug.cgi?id=143854.
400         <rdar://problem/20284766>
401
402         Reviewed by Brent Fulgham.
403
404         * Modules/mediacontrols/mediaControlsApple.css:
405         (::-webkit-media-controls): Don't wrap any text.
406         (audio::-webkit-media-controls-time-remaining-display): Also increase remaining time display width by 1.
407         (audio::-webkit-media-controls-time-remaining-display.five-digit-time): Ditto.
408         (audio::-webkit-media-controls-time-remaining-display.six-digit-time): Ditto.
409
410 2015-04-16  Chris Dumez  <cdumez@apple.com>
411
412         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides don't fire events
413         https://bugs.webkit.org/show_bug.cgi?id=143850
414
415         Reviewed by Alexey Proskuryakov.
416
417         Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop()
418         overrides don't fire events as this is not allowed. This would cause
419         arbitrary JS execution which would be very dangerous in these stages.
420
421         Firing JS events from these functions is a common source of crashes.
422
423         * Modules/websockets/WebSocket.cpp:
424         (WebCore::WebSocket::suspend):
425         (WebCore::WebSocket::resume):
426         * dom/ScriptExecutionContext.cpp:
427         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
428         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
429         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
430         * xml/XMLHttpRequest.cpp:
431         (WebCore::XMLHttpRequest::suspend):
432         (WebCore::XMLHttpRequest::resume):
433         (WebCore::XMLHttpRequest::stop):
434
435 2015-04-16  Brady Eidson  <beidson@apple.com>
436
437         Media element can manipulate DOM during Document destruction.
438         rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780
439
440         Reviewed by Jer Noble.
441
442         * html/HTMLMediaElement.cpp:
443         (WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document.
444
445 2015-04-13  Jer Noble  <jer.noble@apple.com>
446
447         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
448         https://bugs.webkit.org/show_bug.cgi?id=143680
449
450         Reviewed by Simon Fraser.
451
452         Add getters for the video's fullscreen layer, and be more tolerant about the order in which setVideoElement() and 
453         setWebVideoFullscreenInterface are called.
454
455         * html/HTMLMediaElement.h:
456         (WebCore::HTMLMediaElement::videoFullscreenLayer): Added simple getter.
457         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
458         * platform/ios/WebVideoFullscreenModelVideoElement.h:
459         (WebCore::WebVideoFullscreenModelVideoElement::videoElement): Added simple getter.
460         (WebCore::WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted. Moved to .mm file.
461         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
462         (WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement): Initialize ivars in the .h file.
463         (WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Call those methods skipped in setVideoElement()
464             if m_videoFullscreenInterface had not yet been set.
465         (WebVideoFullscreenModelVideoElement::setVideoElement): Null-check m_videoFullscreenInterface.
466
467 2015-04-16  Beth Dakin  <bdakin@apple.com>
468
469         Force mouse events should go through normal mouse event handling code paths
470         https://bugs.webkit.org/show_bug.cgi?id=143749
471         -and corresponding-
472         rdar://problem/20472895
473
474         Reviewed by Dean Jackson.
475
476         This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and 
477         mouseforcechanged into normal mouse event dispatching code. This patch leaves 
478         behind the cancel and click events because we plan to remove those, and it also 
479         leaves mouseforcewillbegin because that is necessarily a very different event more 
480         tied to the NSImmediateActionGestureRecognizer than these other events which are 
481         tied to NSResponder’s pressureChangeWithEvent.
482
483         New helper functions.
484         * dom/Document.cpp:
485         (WebCore::Document::hasListenerTypeForEventType):
486         * dom/Document.h:
487         * dom/Element.cpp:
488         (WebCore::isForceEvent):
489
490         Move the code to ensure the force events have listeners in order to fire to 
491         dispatchMouseEvent, and delete the old implementations.
492         (WebCore::Element::dispatchMouseEvent):
493         (WebCore::Element::dispatchMouseForceChanged): Deleted.
494         (WebCore::Element::dispatchMouseForceDown): Deleted.
495         (WebCore::Element::dispatchMouseForceUp): Deleted.
496         * dom/Element.h:
497
498         Perform a hit test and pipe the events through dispatchMouseEvent(). 
499         * page/EventHandler.cpp:
500         (WebCore::EventHandler::handleMouseForceEvent):
501         * page/EventHandler.h:
502
503         New types for the new events.
504         * platform/PlatformEvent.h:
505
506         Forward to EventHandler. 
507         * replay/UserInputBridge.cpp:
508         (WebCore::UserInputBridge::handleMouseForceEvent):
509         * replay/UserInputBridge.h:
510
511 2015-04-16  Tim Horton  <timothy_horton@apple.com>
512
513         Sites with both width=device-width and height=device-height load zoomed out
514         https://bugs.webkit.org/show_bug.cgi?id=143795
515         <rdar://problem/20369671>
516
517         Reviewed by Ben Poulain.
518
519         * page/ViewportConfiguration.cpp:
520         (WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
521         Some sites specify both width=device-width and height=device-height, and
522         then lay out to device width but with a large amount of vertically scrollable content
523         (so, height=device-height was a lie).
524
525         In all other cases where we use device-width and device-height, we prefer
526         width=device-width over height=device-height, but in the code to ignore scaling constraints,
527         the two paths were completely separate. On sites that specify both, this
528         resulted in us attempting to zoom out to fit the entire height of the very tall page,
529         which isn't at all what we wanted. So, ignore height=device-height if a width is specified.
530
531 2015-04-16  Chris Dumez  <cdumez@apple.com>
532
533         Regression(r182517): WebSocket::suspend() causes error event to be fired
534         https://bugs.webkit.org/show_bug.cgi?id=143806
535         <rdar://problem/20559812>
536
537         Reviewed by Alexey Proskuryakov.
538
539         WebSocket::suspend() causes an error event to be fired after r182517.
540         This is not allowed as firing the event could trigger arbitrary JS
541         execution, which is no longer allowed at this point.
542
543         This patch delays the error event firing until after
544         WebSocket::resume() is called, similarly to what we already do for
545         the close event.
546
547         Also add assertions in WebSocket::suspend() / WebSocket::resume()
548         that will be hit if JS events are fired from within these functions.
549         The pre-existing closed-when-entering-page-cache.html test is hitting
550         one of these assertions without the fix above.
551
552         Tests:
553           - http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
554           - http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html
555
556         * Modules/websockets/WebSocket.cpp:
557         (WebCore::WebSocket::suspend):
558         (WebCore::WebSocket::resume):
559         (WebCore::WebSocket::resumeTimerFired):
560         (WebCore::WebSocket::stop):
561         (WebCore::WebSocket::didReceiveMessageError):
562         (WebCore::WebSocket::didClose):
563         (WebCore::WebSocket::dispatchOrQueueEvent):
564         * Modules/websockets/WebSocket.h:
565
566 2015-04-15  Roger Fong  <roger_fong@apple.com>
567
568         Adjustments to button graphics for media controls.
569         https://bugs.webkit.org/show_bug.cgi?id=143797.
570         <rdar://problem/20083708>
571
572         Reviewed by Dean Jackson.
573
574         These changes are visual in nature and mainly affect the buttons.
575         I've gotten rid of the text-shadow for all the buttons,
576         used plus-lighter blending mode and changed the button opacity to reflect the specs,
577         and made all the buttons turn opaque white when active.
578
579         * Modules/mediacontrols/mediaControlsApple.css:
580         (audio::-webkit-media-controls-panel button):
581         (audio::-webkit-media-controls-rewind-button):
582         (audio::-webkit-media-controls-play-button):
583         (audio::-webkit-media-controls-play-button.paused):
584         (video::-webkit-media-controls-volume-max-button):
585         (video::-webkit-media-controls-volume-slider):
586         (video::-webkit-media-controls-volume-min-button):
587         (audio::-webkit-media-controls-wireless-playback-picker-button):
588         (audio::-webkit-media-controls-toggle-closed-captions-button):
589         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
590         (audio::-webkit-media-controls-fullscreen-button):
591         (audio::-webkit-media-controls-fullscreen-button.exit):
592         (audio::-webkit-media-controls-status-display):
593         (audio::-webkit-media-controls-timeline):
594         (audio::-webkit-media-controls-time-remaining-display):
595         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
596         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
597         (video:-webkit-full-screen::-webkit-media-controls-play-button):
598         (video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
599         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
600         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
601         (video::-webkit-media-controls-volume-max-button:active):
602         (video::-webkit-media-controls-volume-min-button:active):
603         (audio::-webkit-media-controls-toggle-closed-captions-button:active):
604         (audio::-webkit-media-controls-rewind-button:active):
605         (audio::-webkit-media-controls-play-button:active):
606         (video:-webkit-full-screen::-webkit-media-controls-volume-max-button:active):
607         (video:-webkit-full-screen::-webkit-media-controls-volume-min-button:active):
608         (video:-webkit-full-screen::-webkit-media-controls-play-button:active):
609         (video:-webkit-full-screen::-webkit-media-controls-seek-back-button:active):
610         (video:-webkit-full-screen::-webkit-media-controls-seek-forward-button:active):
611         (audio::-webkit-media-controls-fullscreen-button:active):
612
613         Using the pseudo id itself here currently does not work, which is why we rely on the button.* selector for these.
614         (video:-webkit-full-screen::-webkit-media-controls-panel button.paused:active):
615         (audio::-webkit-media-controls-panel button.paused:active):
616         (audio::-webkit-media-controls-panel button.exit:active):
617  
618         Draw volume slider knob as opaque white when active.
619         Adjust colors of timeline and volume sliders now that we are using plus-lighter blending.
620         * Modules/mediacontrols/mediaControlsApple.js:
621         (Controller):
622         (Controller.prototype.createControls):
623         (Controller.prototype.handleVolumeSliderMouseDown):
624         (Controller.prototype.handleVolumeSliderMouseUp):
625         (Controller.prototype.drawTimelineBackground):
626         (Controller.prototype.drawVolumeBackground):
627
628 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
629
630         Pull emoji-position adjustment code into its own function
631         https://bugs.webkit.org/show_bug.cgi?id=143592
632
633         Reviewed by Myles C. Maxfield.
634
635         First step to cleaning up FontCascade::drawGlyphs(). Pull iOS-only code related to
636         emoji positioning into its own function.
637
638         * platform/graphics/cocoa/FontCascadeCocoa.mm:
639         (WebCore::pointAdjustedForEmoji):
640         (WebCore::FontCascade::drawGlyphs):
641
642 2015-04-16  Myles C. Maxfield  <mmaxfield@apple.com>
643
644         [iOS] Delete hardcoded font fallback tables
645         https://bugs.webkit.org/show_bug.cgi?id=143583
646
647         Reviewed by Darin Adler
648
649         Instead of hardcoding which font to use for a particular character, use
650         CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage().
651
652         Updated test expected results:
653             editing/selection/vertical-rl-rtl-extend-line-backward-br.html
654             editing/selection/vertical-rl-rtl-extend-line-backward-p.html
655             editing/selection/vertical-rl-rtl-extend-line-forward-br.html
656             editing/selection/vertical-rl-rtl-extend-line-forward-p.html
657             fast/text/international/danda-space.html
658             fast/text/international/thai-baht-space.html
659
660         * platform/graphics/ios/FontCacheIOS.mm:
661         (WebCore::FontCache::getSystemFontFallbackForCharacters):
662         (WebCore::FontCache::systemFallbackForCharacters):
663         * platform/spi/cocoa/CoreTextSPI.h:
664
665 2015-04-16  Per Arne Vollan  <peavo@outlook.com>
666
667         [WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
668         https://bugs.webkit.org/show_bug.cgi?id=143828
669
670         Reviewed by Brent Fulgham.
671
672         Python throws an exception when calling os.environ['WEBKITLIBRARIESDIR'] and
673         WEBKITLIBRARIESDIR is not defined. WEBKITLIBRARIESDIR is obsolete, we can remove it.
674
675         * AVFoundationSupport.py:
676         (lookFor):
677
678 2015-04-16  Alexey Proskuryakov  <ap@apple.com>
679
680         Minor AudioContext cleanup
681         https://bugs.webkit.org/show_bug.cgi?id=143816
682
683         Reviewed by Jer Noble.
684
685         * Modules/webaudio/AudioContext.cpp:
686         (WebCore::AudioContext::~AudioContext):
687         (WebCore::AudioContext::lazyInitialize):
688         (WebCore::AudioContext::stop):
689         (WebCore::AudioContext::derefNode):
690         (WebCore::AudioContext::scheduleNodeDeletion):
691         (WebCore::AudioContext::deleteMarkedNodes):
692         (WebCore::AudioContext::stopDispatch): Deleted.
693         (WebCore::AudioContext::deleteMarkedNodesDispatch): Deleted.
694         * Modules/webaudio/AudioContext.h:
695
696         * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::~AudioNode):
697
698 2015-04-16  Chris Dumez  <cdumez@apple.com>
699
700         Unreviewed attempt to fix Windows build after r182881.
701
702         Add missing header include.
703
704         * page/PageConsoleClient.h:
705
706 2015-04-16  Chris Dumez  <cdumez@apple.com>
707
708         Tests introduced in r182877 are flaky
709         https://bugs.webkit.org/show_bug.cgi?id=143784
710
711         Reviewed by Alexey Proskuryakov.
712
713         Tests introduced in r182877 are flaky as the line number sometimes
714         appears in the console messages. This patch updates the console
715         logging code so that no Document is provided when logging. Therefore,
716         no line number will ever be displayed. In this case, I don't think
717         having the line number is terribly useful anyway.
718
719         * css/StyleSheetContents.cpp:
720         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
721
722 2015-04-15  Simon Fraser  <simon.fraser@apple.com>
723
724         We should dump GraphicsLayer's anchorPoint z component
725         https://bugs.webkit.org/show_bug.cgi?id=143815
726
727         Reviewed by Tim Horton.
728
729         We didn't include the z component of a layer's anchor point when dumping.
730         Dump if it's non-zero (to avoid having to change lots of test output).
731         No test with non-zero z appears to dump layers.
732
733         * platform/graphics/GraphicsLayer.cpp:
734         (WebCore::GraphicsLayer::dumpProperties):
735         * rendering/style/RenderStyle.cpp:
736         (WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration,
737         is wrong.
738
739 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
740
741         [Mac] Disable "Save to Downloads" option for local files
742         https://bugs.webkit.org/show_bug.cgi?id=143794
743
744         Reviewed by Tim Horton.
745
746         Disable the Image and Media download options if the download
747         target is a local file. We can only download web resources;
748         anything else is actually a no-op.
749
750         * page/ContextMenuController.cpp:
751         (WebCore::ContextMenuController::checkOrEnableIfNeeded): Disable
752         menu item if appropriate.
753
754 2015-04-15  Chris Dumez  <cdumez@apple.com>
755
756         Add a console message when a stylesheet is not parsed due to invalid MIME type
757         https://bugs.webkit.org/show_bug.cgi?id=143784
758
759         Reviewed by Joseph Pecoraro.
760
761         After r180020, we no longer have a quirks mode exception for CSS MIME
762         types. This means that we'll start rejecting stylesheets that were
763         previously accepted due to this quirk. In this case we log a console
764         message to help Web developers understand why their stylesheet is being
765         rejected.
766
767         * css/StyleRuleImport.cpp:
768         (WebCore::StyleRuleImport::setCSSStyleSheet):
769
770         * css/StyleSheetContents.cpp:
771         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
772         - Initialize hasValidMIMEType to true so that it ends up being false
773           only when canUseSheet(hasValidMIMEType) is called and we've determined
774           the MIME type is indeed invalid. Otherwise, hasValidMIMEType would
775           also be false when m_data is null or empty in
776           CachedCSSStyleSheet::sheetText() and we don't want to display the MIME
777           type error in this case.
778         - If hasValidMIMEType is false, display the console message and abort
779           early. We don't need to execute the rest of the function in this case
780           as sheetText is a null String and there is no point in trying to parse
781           it.
782         - Drop handling of !hasValidMIMEType && !hasSyntacticallyValidCSSHeader()
783           as this can no longer be reached. This handling no longer makes sense
784           after r180020 as sheetText() will now always return a null String if
785           the MIME type is invalid (as we no longer support the CSS MIME type
786           quirks mode).
787
788         * css/StyleSheetContents.h:
789         * html/HTMLLinkElement.cpp:
790         (WebCore::HTMLLinkElement::setCSSStyleSheet):
791
792 2015-04-15  Said Abou-Hallawa  <said@apple.com>
793
794         Minimum font size pref breaks SVG text very badly.
795         https://bugs.webkit.org/show_bug.cgi?id=143590.
796
797         Reviewed by Simon Fraser.
798
799         When enabling the minimum font size perf, the computed font size is set
800         to the minimum font size if the computed value is smaller than the minimum.
801         The bug happens because the SVG text element applies its scaling on the
802         computed value after applying the minimum font size rule. This means the
803         final computed value for the font size will be the scaling of the minimum
804         font size and not minimum font size itself. What we need is to postpone
805         applying the minimum font size rules, till the SVG scaling is applied.
806
807         Tests: svg/text/font-small-enlarged-minimum-larger.svg
808                svg/text/font-small-enlarged-minimum-smaller.svg
809
810         * rendering/svg/RenderSVGInlineText.cpp:
811         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): Call
812         computedFontSizeFromSpecifiedSizeForSVGInlineText() even if scalingFactor
813         is 1. We need to make sure the minimum font size rules are applied. This
814         function was assuming the mininum font size rule was applied when resolving
815         the style. This is not true anymore for the SVG text.
816
817         * style/StyleFontSizeFunctions.cpp:
818         (WebCore::Style::computedFontSizeFromSpecifiedSize): Do not apply the
819         minimum size rules for the SVG element until it applies its scaling to
820         the font size.
821
822 2015-04-15  Mark Lam  <mark.lam@apple.com>
823
824         Remove obsolete VMInspector debugging tool.
825         https://bugs.webkit.org/show_bug.cgi?id=143798
826
827         Reviewed by Michael Saboff.
828
829         No new tests needed.  Just removing obsolete code.
830
831         * ForwardingHeaders/interpreter/VMInspector.h: Removed.
832
833 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
834
835         Custom CSS cursors do not use -webkit-image-set on retina displays
836         https://bugs.webkit.org/show_bug.cgi?id=120783
837         <rdar://problem/14921432>
838
839         Reviewed by Beth Dakin.
840         Patch by Evan Wallace <evan.exe@gmail.com>.
841
842         Scale NSCursor images correctly so custom CSS cursors work with
843         -webkit-image-set on retina displays.
844
845         * WebCore.exp.in:
846         * page/EventHandler.cpp:
847         (WebCore::EventHandler::selectCursor):
848         * platform/mac/CursorMac.mm:
849         (WebCore::createCustomCursor):
850         (WebCore::Cursor::ensurePlatformCursor):
851
852 2015-04-15  Alexey Proskuryakov  <ap@apple.com>
853
854         No thread safety when passing ThreadableLoaderOptions from a worker thread
855         https://bugs.webkit.org/show_bug.cgi?id=143790
856
857         Reviewed by Geoffrey Garen.
858
859         * loader/ThreadableLoader.h:
860         * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added.
861
862         * loader/WorkerThreadableLoader.cpp:
863         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send
864         a structure with strings to a different thread, that's bad.
865
866         * platform/CrossThreadCopier.h: I think that this is dead code, but for this bug,
867         just removing a clearly wrong specialization.
868
869 2015-04-15  Alex Christensen  <achristensen@webkit.org>
870
871         Progress towards CMake on Mac.
872         https://bugs.webkit.org/show_bug.cgi?id=143785
873
874         Reviewed by Csaba Osztrogonác.
875
876         * CMakeLists.txt:
877         * PlatformMac.cmake:
878
879 2015-04-15  Daniel Bates  <dabates@apple.com>
880
881         Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
882         RenderSVGTextPath instead of a pointer
883         https://bugs.webkit.org/show_bug.cgi?id=143787
884
885         Reviewed by Andreas Kling.
886
887         SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
888         non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
889         reference to a RenderSVGTextPath object to help callers catch bad usage and better document
890         the expectation of a valid RenderSVGTextPath object.
891
892         * rendering/svg/SVGRootInlineBox.cpp:
893         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
894         inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
895         We ensured that this cast is safe earlier in this function.
896         SVGTextLayoutEngine::beginTextPathLayout().
897         * rendering/svg/SVGTextLayoutEngine.cpp:
898         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
899         RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
900         RenderObject pointer since we are passing the renderer by reference and a well-formed
901         reference must refer to a valid object.
902         * rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.
903
904 2015-04-13  Jer Noble  <jer.noble@apple.com>
905
906         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
907         https://bugs.webkit.org/show_bug.cgi?id=143674
908
909         Reviewed by Darin Adler.
910
911         * html/HTMLMediaElement.cpp:
912         (WebCore::HTMLMediaElement::enterFullscreen): Pass a reference.
913         (WebCore::HTMLMediaElement::exitFullscreen): exitVideoFullscreen() -> exitVideoFullscreenForVideoElement(...).
914         * page/ChromeClient.h:
915
916 2015-04-14  Anders Carlsson  <andersca@apple.com>
917
918         Make creating send rights from shared memory more robust
919         https://bugs.webkit.org/show_bug.cgi?id=143730
920         rdar://problem/16595870
921
922         Reviewed by Darin Adler.
923
924         Add a bool conversion operator to MachSendRight and tidy up the default constructor.
925
926         * platform/cocoa/MachSendRight.h:
927         (WebCore::MachSendRight::operator bool):
928         (WebCore::MachSendRight::MachSendRight): Deleted.
929
930 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
931
932         Generalize "isPlayingAudio" to include other media characteristics
933         https://bugs.webkit.org/show_bug.cgi?id=143713
934
935         Reviewed by Jer Noble.
936
937         No new functionality.
938
939         * Modules/webaudio/AudioContext.cpp:
940         (WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
941         (WebCore::AudioContext::isPlayingAudioDidChange): Ditto.
942
943         * dom/Document.cpp:
944         (WebCore::Document::addAudioProducer): Ditto.
945         (WebCore::Document::removeAudioProducer): Ditto.
946         (WebCore::Document::updateIsPlayingMedia): Renamed.
947         (WebCore::Document::updateIsPlayingAudio): Deleted.
948         * dom/Document.h:
949
950         * html/HTMLMediaElement.cpp:
951         (WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
952         (WebCore::HTMLMediaElement::setPlaying): Ditto.
953
954         * page/ChromeClient.h:
955         * page/Page.cpp:
956         (WebCore::Page::updateIsPlayingMedia): Renamed.
957         (WebCore::Page::updateIsPlayingAudio): Deleted.
958         * page/Page.h:
959
960 2015-04-15  Joonghun Park  <jh718.park@samsung.com>
961
962         Fix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror=type-limits]'
963         https://bugs.webkit.org/show_bug.cgi?id=143751
964
965         Reviewed by Csaba Osztrogonác.
966
967         No new tests, no new behaviors.
968
969         * rendering/svg/SVGTextChunk.cpp:
970         (WebCore::SVGTextChunk::SVGTextChunk):
971
972 2015-04-14  Zalan Bujtas  <zalan@apple.com>
973
974         Make inline continuation style change logic consistent.
975         https://bugs.webkit.org/show_bug.cgi?id=143737
976         rdar://problem/20486596
977
978         Reviewed by Simon Fraser.
979
980         Do not force RenderBlock type-casting on the first sibling of the continuation's container.
981         The first sibling of the container of a continuation should be handled as the rest of the siblings.
982
983         Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html
984
985         * rendering/RenderInline.cpp:
986         (WebCore::updateStyleOfAnonymousBlockContinuations):
987         (WebCore::RenderInline::styleDidChange):
988
989 2015-04-14  Chris Dumez  <cdumez@apple.com>
990
991         Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
992         https://bugs.webkit.org/show_bug.cgi?id=143745
993         <rdar://problem/20243916>
994
995         Reviewed by Joseph Pecoraro.
996
997         After r180020, we are stricter and no longer accept CSS resources that
998         are not served with a CSS MIME type. Showing Web inspector on a page
999         with such bad resource would crash because
1000         InspectorPageAgent::cachedResourceContent() would return true but
1001         the result String would be null. This null String would then later
1002         be passed to the Yarr interpreter and crash on a String::is8Bit()
1003         call.
1004
1005         cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
1006         r180020, it would return the text, even if the MIME type was incorrect.
1007         However, this is no longer the case and we now need to make sure that
1008         cachedResourceContent() returns false if sheetText() returns a null
1009         String.
1010
1011         Test: http/tests/inspector/css/bad-mime-type.html
1012
1013         * inspector/InspectorPageAgent.cpp:
1014         (WebCore::InspectorPageAgent::cachedResourceContent):
1015
1016 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1017
1018         textPath layout performance improvement.
1019         https://bugs.webkit.org/show_bug.cgi?id=141570.
1020
1021         Reviewed by Darin Adler.
1022
1023         The bottleneck of the text-on-path performance is the position and angle
1024         calculations for every single character. If the number of characters is
1025         'n' and the number of path elements is 'm', the total number of processing
1026         the path elements is O(2 x n x m). What makes it really worse is, for every
1027         curve we keep splitting the curve till the split curve is almost a straight
1028         line. The changes we need to do are:
1029         1. Merge the position and the angle traversals in one pass since they are
1030            returning info for the same length on the path. There is a degenerate
1031            case for the starting point when calculating the angle. The original
1032            code was solving this problem by passing an epsilon instead of zero but
1033            because traversing the path for position and angle are now merged, we
1034            will pass zero for the starting point as is. All we need is to move one
1035            step ahead without moving the position. We need the extra step forward
1036            to calculate the slope of the path at the starting point.
1037         2. We need to add a new mode to traversing a path. The new mode will take
1038            a vector of lengths and returns a vector of arrow vectors. Every arrow
1039            vector represents a position and an angle on the path at a certain length.
1040            This requires changing the SVGTextLayoutEngine to calculate the lengths
1041            of the characters on the curve first and then passing all of them to the
1042            path traversal function. Instead of traversing the path for every length,
1043            we are going to get the required point and angle from the vector of arrow
1044            vectors.
1045
1046         This patch is addressing the first fix only. The second one will require
1047         refactoring the SVGTextLayoutEngine so I am going to address it in a
1048         different patch.
1049
1050         * platform/graphics/Path.cpp:
1051         (WebCore::pathLengthApplierFunction): It is cleaner to move the function
1052         of this method to PathTraversalState::processPathElement().
1053         
1054         (WebCore::Path::length): Use new enum Action value and access methods.
1055         
1056         (WebCore::Path::traversalStateAtLength): New function which returns the
1057         traversalState at a certain length on a path.
1058         
1059         (WebCore::Path::pointAtLength):
1060         (WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
1061         the traversalState and from it return either the position or the angle.
1062         
1063         * platform/graphics/Path.h: Define traversalStateAtLength().
1064         
1065         * platform/graphics/PathTraversalState.cpp:
1066         (WebCore::distanceLine): Code clean up.
1067         
1068         (WebCore::curveLength): Make the setting of m_previous and m_current happens
1069         only in this function.
1070         
1071         (WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
1072         for the desired length and move the initialization of the other members to
1073         the class definition.
1074         
1075         (WebCore::PathTraversalState::closeSubpath):
1076         (WebCore::PathTraversalState::moveTo):
1077         (WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
1078         instead of returning it since this is what all the callers were doing.
1079         
1080         (WebCore::PathTraversalState::quadraticBezierTo):
1081         (WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
1082         m_totalLength. Move the setting of m_previous and m_current to curveLength().
1083         Remove unused members m_control1 and m_control2.
1084
1085         (WebCore::PathTraversalState::processSegment): Deleted.        
1086         (WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
1087         name for the function. Handle the case of the angle at the starting point
1088         where m_desiredLength is set to zero. The new flag m_isZeroVector will be
1089         set to notify the caller that the  next iteration will be the last one and
1090         it is only needed for the calculating the angle of a zero vector. m_current
1091         should not change by this last iteration.
1092         
1093         (WebCore::PathTraversalState::appendPathElement): This code is moved from
1094         pathLengthApplierFunction().
1095         
1096         (WebCore::PathTraversalState::processPathElement): This function is used
1097         by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
1098         is set we append the new element to a copy for the PathTraversalState just
1099         to get the angle for the zero vector.
1100
1101         * platform/graphics/PathTraversalState.h: Change the enum values to not
1102         not include the class or the enum class. Make the data members private and
1103         expose the needed ones through access methods. Make all the internal methods
1104         to be private.
1105         
1106         (WebCore::PathTraversalState::processPathElement):  Another wrapper for
1107         appendPathElement() which is used by SVGPathTraversalStateBuilder.
1108         
1109         (WebCore::PathTraversalState::action):
1110         (WebCore::PathTraversalState::setAction):
1111         (WebCore::PathTraversalState::desiredLength):
1112         (WebCore::PathTraversalState::setDesiredLength):
1113         (WebCore::PathTraversalState::success):
1114         (WebCore::PathTraversalState::totalLength):
1115         (WebCore::PathTraversalState::current):
1116         (WebCore::PathTraversalState::normalAngle): New access methods which are now
1117         needed after making the data members private.
1118         
1119         * rendering/svg/SVGRootInlineBox.cpp:
1120         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
1121         of the renderer on the caller side.
1122         
1123         * rendering/svg/SVGTextChunk.cpp:
1124         (WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
1125         elements of m_boxes instead of making this from outside the class.
1126         
1127         (WebCore::SVGTextChunk::totalCharacters):
1128         (WebCore::SVGTextChunk::totalLength):
1129         (WebCore::SVGTextChunk::calculateLength): Deleted.
1130         Replace calculateLength() by totalCharacters() and totalLength() to make
1131         the interface cleaner.
1132         
1133         (WebCore::SVGTextChunk::totalAnchorShift):
1134         (WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
1135         Rename the function name.
1136         
1137         (WebCore::SVGTextChunk::layout):
1138         (WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
1139         (WebCore::SVGTextChunk::buildBoxTransformations):
1140         (WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
1141         (WebCore::SVGTextChunk::processTextAnchorCorrection):
1142         Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
1143         to the SVGTextChunk::layout(). Move all the helper functions as well.
1144         
1145         * rendering/svg/SVGTextChunk.h:
1146         (WebCore::SVGTextChunk::hasTextAnchor):
1147         (WebCore::SVGTextChunk::boxes): Deleted.
1148         Add the new methods and change most of the public methods to be private.
1149         
1150         * rendering/svg/SVGTextChunkBuilder.cpp:
1151         (WebCore::SVGTextChunkBuilder::totalCharacters):
1152         (WebCore::SVGTextChunkBuilder::totalLength):
1153         (WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
1154         SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
1155         and sums up the total values.
1156         
1157         (WebCore::SVGTextChunkBuilder::transformationForTextBox):
1158         (WebCore::SVGTextChunkBuilder::buildTextChunks):
1159         (WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.
1160         
1161         (WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
1162         (WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
1163         (WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
1164         (WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
1165         (WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
1166         This code now lives in SVGTextChunk.
1167         
1168         * rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
1169         moved from SVGTextLayoutEngine and remove methods for code which was removed
1170         to SVGTextChunk.
1171         
1172         * rendering/svg/SVGTextLayoutEngine.cpp:
1173         (WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
1174         from SVGTextChunkBuilder instead of looping through the chunks. Also get a
1175         clean order for defining variables and doing the calculations.
1176         
1177         (WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.
1178         
1179         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
1180         traversal to get the position and the angle for a length on a path.
1181         
1182         * svg/SVGAnimateMotionElement.cpp:
1183         (WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
1184         path traversal to get the position and the angle at a length on a path.
1185         
1186         * svg/SVGPathTraversalStateBuilder.cpp:
1187         (WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
1188         (WebCore::SVGPathTraversalStateBuilder::moveTo):
1189         (WebCore::SVGPathTraversalStateBuilder::lineTo):
1190         (WebCore::SVGPathTraversalStateBuilder::curveToCubic):
1191         (WebCore::SVGPathTraversalStateBuilder::closePath):
1192         (WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
1193         (WebCore::SVGPathTraversalStateBuilder::continueConsuming):
1194         (WebCore::SVGPathTraversalStateBuilder::totalLength):
1195         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
1196         (WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
1197         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
1198         * svg/SVGPathTraversalStateBuilder.h:
1199         (WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
1200         Code clean up.
1201         
1202         * svg/SVGPathUtilities.cpp:
1203         (WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
1204         (WebCore::getTotalLengthOfSVGPathByteStream):
1205         (WebCore::getPointAtLengthOfSVGPathByteStream): Use new TraversalState::Action
1206         enum values.
1207
1208 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
1209
1210         Re-enable custom dilation for antialiased fonts
1211         https://bugs.webkit.org/show_bug.cgi?id=143738
1212
1213         Reviewed by Tim Horton.
1214         
1215         Enabling custom dilation for antialised fonts broke layout tests, so re-land it,
1216         but disable in WebKitTestRunner and DumpRenderTree. The latter requires adding
1217         a private WebKit pref. This pref defaults to YES, enabling the feature by default
1218         in WK1 as we do for WK2.
1219
1220         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1221         (WebCore::dilationSizeForTextColor):
1222         (WebCore::FontCascade::drawGlyphs):
1223
1224 2015-04-14  Andy Estes  <aestes@apple.com>
1225
1226         [Content Filtering] Use ASSERT_WITH_SECURITY_IMPLICATION for verifying types from NEFilterSource
1227         https://bugs.webkit.org/show_bug.cgi?id=143742
1228
1229         Reviewed by David Kilzer.
1230
1231         * platform/cocoa/NetworkExtensionContentFilter.mm:
1232         (replacementDataFromDecisionInfo): ASSERT_WITH_SECURITY_IMPLICATION that decisionInfo is really a NSDictionary.
1233         (WebCore::NetworkExtensionContentFilter::handleDecision): ASSERT_WITH_SECURITY_IMPLICATION that replacementData is really a NSData.
1234
1235 2015-04-14  Brent Fulgham  <bfulgham@apple.com>
1236
1237         Correct layering violation in DumpRenderTree Build
1238         https://bugs.webkit.org/show_bug.cgi?id=143732
1239
1240         Reviewed by Simon Fraser.
1241
1242         * testing/js/WebCoreTestSupport.cpp:
1243         (WebCoreTestSupport::monitorWheelEvents): Added. Provides a wrapper around
1244         the internal WebCore objects needed to implement this function.
1245         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
1246         * testing/js/WebCoreTestSupport.h:
1247
1248 2015-04-14  Brady Eidson  <beidson@apple.com>
1249
1250         Make sure media element loads hit content filter extensions.
1251         <rdar://problem/20014012> and https://bugs.webkit.org/show_bug.cgi?id=143731
1252
1253         Reviewed by Jer Noble.
1254
1255         Tests: http/tests/contentextensions/media-filtered.html
1256                http/tests/contentextensions/text-track-blocked.html
1257
1258         * html/HTMLMediaElement.cpp:
1259         (WebCore::HTMLMediaElement::parseAttribute): Skip loads that are filtered.
1260
1261 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
1262
1263         Add SPI to clear HSTS hosts added since a date.
1264         https://bugs.webkit.org/show_bug.cgi?id=143726
1265         and
1266         rdar://problem/16664597
1267
1268         Declare _CFNetworkResetHSTSHostsSinceDate in CFNetworkSPI.h.
1269
1270         Reviewed by Anders Carlsson.
1271
1272         * platform/spi/cf/CFNetworkSPI.h:
1273
1274 2015-04-14  Roger Fong  <roger_fong@apple.com>
1275
1276         Unreviewed. Time numbers on media controls move as they update on OSX.
1277         <rdar://problem/20141790>.
1278
1279         * Modules/mediacontrols/mediaControlsApple.css:
1280         (audio::-webkit-media-controls-current-time-display):
1281         (audio::-webkit-media-controls-time-remaining-display):
1282         Don't bother justifying content to end. We size the box to fit the time displays exactly anyways.
1283
1284 2015-04-14  Roger Fong  <roger_fong@apple.com>
1285
1286         Insert volume control in correct place after exiting wireless play.
1287         https://bugs.webkit.org/show_bug.cgi?id=143721.
1288         <rdar://problem/20526106>
1289
1290         Reviewed by Darin Adler.
1291
1292         * Modules/mediacontrols/mediaControlsApple.js:
1293         (Controller.prototype.updateWirelessPlaybackStatus):
1294
1295 2015-04-14  Brady Eidson  <beidson@apple.com>
1296
1297         Media elements not in a page shouldn't load.
1298         https://bugs.webkit.org/show_bug.cgi?id=143720
1299
1300         Reviewed by Jer Noble.
1301
1302         No new tests (Theoretical problem noticed in code review).
1303
1304         * html/HTMLMediaElement.cpp:
1305         (WebCore::HTMLMediaElement::loadResource): Make sure the frame is in a page.
1306
1307 2015-04-14  Simon Fraser  <simon.fraser@apple.com>
1308
1309         [iOS] Clean up registration of layers with the ScrollingCoordinator
1310         https://bugs.webkit.org/show_bug.cgi?id=143725
1311
1312         Reviewed by Tim Horton.
1313
1314         Simplify a couple of bits of code related to the registration of layers with
1315         the ScrollingCoordinator in RenderLayerCompositor.
1316
1317         First, RenderLayerBacking was using ScrollingNodeTypes to choose which scrolling
1318         roles a layer has, which let to ambiguous code where we hardcoded a ScrollingNodeType
1319         with knowledge of what RenderLayerBacking did with it. Clean up by using LayerScrollCoordinationRole,
1320         which is moved to RenderLayer.h so that RenderLayerCompositor.h and RenderLayerBacking.h
1321         both see it.
1322
1323         Secondly, avoid having both detachFromScrollingCoordinator() and detachFromScrollingCoordinatorForRole()
1324         by passing in the bitmask of roles.
1325
1326         * page/FrameView.cpp:
1327         (WebCore::FrameView::scrollLayerID):
1328         * rendering/RenderLayer.h:
1329         * rendering/RenderLayerBacking.cpp:
1330         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1331         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1332         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole): Deleted.
1333         * rendering/RenderLayerBacking.h:
1334         * rendering/RenderLayerCompositor.cpp:
1335         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1336         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1337         (WebCore::scrollCoordinationRoleForNodeType):
1338         (WebCore::RenderLayerCompositor::attachScrollingNode):
1339         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1340         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1341         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1342         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole): Deleted.
1343         * rendering/RenderLayerCompositor.h:
1344
1345 2015-04-14  Benjamin Poulain  <benjamin@webkit.org>
1346
1347         Add a conservative DFA minimizer for the content extension matcher
1348         https://bugs.webkit.org/show_bug.cgi?id=143501
1349
1350         Reviewed by Alex Christensen.
1351
1352         This patch adds a simple minimizer for DFA graphs. It is not a perfect minimizer:
1353         some indistinguishable are not merged, but no two distinguishable are merged.
1354
1355         The general idea of the algorithm is to put all the state into a single set
1356         and partition iteratively until it is impossible to split any subset by using
1357         a transition to distinguish two states.
1358
1359         Let's ignore fallback transition for now, and I'll explain later how they fit in
1360         the big picture.
1361
1362
1363         The first thing we do is create a partition of the transition by grouping every
1364         transition by the same character in the same subset. This partition of transitions
1365         is the base by which we will partition the states.
1366
1367         Each subset in the transition partition is a "distinguisher" by which we can
1368         separate the state partition.
1369
1370         We also create a second partition, the state partition. This is where we keep
1371         all the subsets of states that have been split so far.
1372
1373         Let say we have the following graph.
1374
1375             1 --a--> 2
1376             1 --b--> 3
1377             2 --c--> 4 (final)
1378             3 --c--> 4 (final)
1379
1380         The partition of transition would start with:
1381         Set 0:
1382             1 --a--> 2
1383         Set 1:
1384             1 --b--> 3
1385         Set 2:
1386             2 --c--> 4
1387             3 --c--> 4
1388
1389         The state partition would have a single set with { 1, 2, 3, 4 }.
1390
1391
1392         Next, we split the state partition by distinguishable final states. In this case,
1393         we would split it into { 1, 2, 3 }, { 4 }.
1394
1395         We then refine the transition partition by splitting it by the states that have
1396         been distinguished. Here, the only transitions to 4 are both is the same set (set 2),
1397         so the transition partition remains the same.
1398
1399
1400         We can now execute the main loop of the algorithm:
1401         1) Split the states by the transitions.
1402         2) Split the transitions that are now reaching two different sets of the state partition.
1403         3) Add any newly discovered "distinguisher" (the ones we split) to the list of "distinguisher"
1404            to process.
1405
1406         In this case, we just iterate over the partition set in order, and add newly split transitions
1407         to the end of the list.
1408
1409         In the example, we would first visit set 0. We have that state 1 is distinguishable
1410         by "a", and the state partition would become { 1 }, { 2, 3 }, { 4 }.
1411
1412         We then visit transition set 1, it distinguishes state 1 which is already alone -> nothing to do.
1413
1414         Finally, we process the transition set 2, it distinguishes 2 and 3, they are already in the same
1415         set -> nothing to do.
1416
1417         There is no more transition to process, we have 3 unique subsets and we should merge 2 and 3.
1418
1419         ---
1420
1421         Okay, now how to we fit fallback transition in this model. In this patch, I take the conservative
1422         approach: we split everything assuming fallback transition do not exist, then we refine
1423         by the fallback transitions.
1424
1425         Let's take the following example:
1426             1 --a--> 3
1427             2 --a--> 3
1428             1 -[f]-> 4
1429             2 -[f]-> 5
1430
1431         and at this stage in the algorithm, we have the sets { 1, 2 }, { 3 }, { 4 }, { 5 }.
1432         The states 1 and 2 are together because they cannot be distinguished by 'a', but
1433         the fallback transition distinguishes them.
1434
1435         Since we have done every other split, we have one useful property: we know that every
1436         state in every set transition with the exact set of characters within that set.
1437         If that was not true, there would be one "distinguisher" 'x' that could spit the set
1438         into two subsets: the one with the transition 'x' and the ones without.
1439
1440         Since all the transitions are the same, there is no overlap between the defined transition
1441         and the fallback transition. Consequently, we can use the fallback transition as a whole
1442         transition and use it to distinguish the states.
1443
1444         The fallback transitions are handled like any other transition, we have a partition of such
1445         transitions and split by each of them. BUT, we can only use them after every unique transition
1446         has been covered.
1447
1448         This trick is also what makes the minimization imperfect: it should be possible to merge
1449         states with overlap in their fallback transitions but we would split them.
1450
1451         ---
1452
1453         Antti Valmari, Petri Lehtinen, Marie-Pierre Béal and Maxime Crochemore deserve credit for their indirect
1454         work on this patch. Thanks for your wonderful papers about DFA minimization.
1455
1456         * WebCore.xcodeproj/project.pbxproj:
1457         * contentextensions/ContentExtensionCompiler.cpp:
1458         (WebCore::ContentExtensions::compileRuleList):
1459         * contentextensions/DFA.cpp:
1460         (WebCore::ContentExtensions::DFA::minimize):
1461         (WebCore::ContentExtensions::DFA::debugPrintDot):
1462         * contentextensions/DFA.h:
1463         * contentextensions/DFABytecodeCompiler.cpp:
1464         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1465         * contentextensions/DFAMinimizer.cpp: Added.
1466         (WebCore::ContentExtensions::DFAMinimizer::simplifyTransitions):
1467         (WebCore::ContentExtensions::DFAMinimizer::Partition::initialize):
1468         (WebCore::ContentExtensions::DFAMinimizer::Partition::markElementInCurrentGeneration):
1469         (WebCore::ContentExtensions::DFAMinimizer::Partition::refineGeneration):
1470         (WebCore::ContentExtensions::DFAMinimizer::Partition::iterateSet):
1471         (WebCore::ContentExtensions::DFAMinimizer::Partition::setIndex):
1472         (WebCore::ContentExtensions::DFAMinimizer::Partition::firstElementInSet):
1473         (WebCore::ContentExtensions::DFAMinimizer::Partition::size):
1474         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::indexAfterMarkedElements):
1475         (WebCore::ContentExtensions::DFAMinimizer::Partition::SetDescriptor::end):
1476         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::FullGraphPartition):
1477         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::markNode):
1478         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::refinePartitions):
1479         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByUniqueTransitions):
1480         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::splitByFallbackTransitions):
1481         (WebCore::ContentExtensions::DFAMinimizer::FullGraphPartition::nodeReplacement):
1482         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::ActionKey):
1483         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isEmptyValue):
1484         (WebCore::ContentExtensions::DFAMinimizer::ActionKey::isDeletedValue):
1485         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::hash):
1486         (WebCore::ContentExtensions::DFAMinimizer::ActionKeyHash::equal):
1487         (WebCore::ContentExtensions::DFAMinimizer::minimize):
1488         * contentextensions/DFAMinimizer.h: Copied from Source/WebCore/contentextensions/DFA.h.
1489         * contentextensions/DFANode.h:
1490         * contentextensions/NFAToDFA.cpp:
1491         (WebCore::ContentExtensions::NFAToDFA::convert):
1492         (WebCore::ContentExtensions::simplifyTransitions): Deleted.
1493
1494 2015-04-14  Chris Dumez  <cdumez@apple.com>
1495
1496         ASSERT(frame().view() == this) assertion hit in FrameView::windowClipRect() on Windows bots
1497         https://bugs.webkit.org/show_bug.cgi?id=143723
1498
1499         Reviewed by Brent Fulgham.
1500
1501         ASSERT(frame().view() == this) in FrameView::windowClipRect() can be hit
1502         if the post layout timer timer fires after the page has entered page
1503         cache. Upon entering page cache, we call FrameView::unscheduleRelayout()
1504         to stop the layout timer if it is active, however, we don't stop the
1505         post-layout timer. Therefore, there was nothing preventing the
1506         post-layout timer from firing after entering page cache.
1507
1508         In this patch, we unschedule the post-layout timer in
1509         FrameView::unscheduleRelayout() to protect ourselves against this.
1510
1511         I think we were only seeing the assertion hit on Windows because this
1512         timer probably gets scheduled more frequently on Windows. On Mac, I
1513         rarely see it getting scheduled.
1514
1515         No new tests, should fix crashing tests on the bots.
1516
1517         * page/FrameView.cpp:
1518         (WebCore::FrameView::unscheduleRelayout):
1519
1520 2015-04-14  Chris Dumez  <cdumez@apple.com>
1521
1522         FrameView::m_frame should be a Ref<Frame>
1523         https://bugs.webkit.org/show_bug.cgi?id=143716
1524
1525         Reviewed by Andreas Kling.
1526
1527         FrameView::m_frame should be a Ref<Frame> instead of a RefPtr<Frame> as
1528         it can never be null.
1529
1530         * page/FrameView.cpp:
1531         (WebCore::FrameView::FrameView):
1532         (WebCore::FrameView::flushCompositingStateForThisFrame):
1533         (WebCore::FrameView::hasCompositedContentIncludingDescendants):
1534         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
1535         (WebCore::FrameView::updateCanBlitOnScrollRecursively):
1536         (WebCore::FrameView::setIsOverlapped):
1537         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
1538         (WebCore::FrameView::renderedCharactersExceed):
1539         (WebCore::FrameView::updateLayerFlushThrottling):
1540         (WebCore::FrameView::serviceScriptedAnimations):
1541         (WebCore::FrameView::updateBackgroundRecursively):
1542         (WebCore::FrameView::adjustScrollStepForFixedContent):
1543         (WebCore::FrameView::paintContentsForSnapshot):
1544         (WebCore::FrameView::notifyWidgetsInAllFrames):
1545         (WebCore::FrameView::setExposedRect):
1546         (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
1547         * page/FrameView.h:
1548
1549 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
1550
1551         [iOS WK2] Interactive elements of developer.apple.com are broken
1552         https://bugs.webkit.org/show_bug.cgi?id=143692
1553         rdar://problem/19320087
1554
1555         Reviewed by Sam Weinig.
1556         
1557         When a composited RenderLayer had nodes in the scrolling tree by virtue of
1558         both position and overflow:scroll, and one of those reasons disappeared,
1559         we'd fail to remove the corresponding node from the scrolling tree. This
1560         could leave an overflow:scroll element behaving as if it were position:fixed.
1561         
1562         Fix by having RenderLayerCompositor::updateScrollCoordinationForThisFrame()
1563         detach the layer on a per-role basis.
1564
1565         Test: platform/ios-simulator-wk2/scrolling/remove-scrolling-role.html
1566
1567         * rendering/RenderLayerBacking.cpp:
1568         (WebCore::RenderLayerBacking::detachFromScrollingCoordinatorForRole):
1569         * rendering/RenderLayerBacking.h:
1570         * rendering/RenderLayerCompositor.cpp:
1571         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerForRole):
1572         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Just moved.
1573         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Call detachScrollCoordinatedLayerForRole()
1574         if the layer doesn't have the relevant scrolling reasons.
1575         * rendering/RenderLayerCompositor.h:
1576
1577 2015-04-14  Commit Queue  <commit-queue@webkit.org>
1578
1579         Unreviewed, rolling out r182794.
1580         https://bugs.webkit.org/show_bug.cgi?id=143714
1581
1582         readable-stream-templated.html fails on Debug bots (Requested
1583         by youenn on #webkit).
1584
1585         Reverted changeset:
1586
1587         "[Streams API] ReadableStream constructor start function
1588         should be able to close the stream"
1589         https://bugs.webkit.org/show_bug.cgi?id=143363
1590         http://trac.webkit.org/changeset/182794
1591
1592 2015-04-14  Per Arne Vollan  <peavo@outlook.com>
1593
1594         [WinCairo] Unreviewed build fix after r182707.
1595
1596         * platform/network/curl/MultipartHandle.cpp:
1597         (WebCore::MultipartHandle::didReceiveResponse):
1598
1599 2015-04-14  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1600
1601         [Streams API] ReadableStream constructor start function should be able to close the stream
1602         https://bugs.webkit.org/show_bug.cgi?id=143363
1603
1604         Reviewed by Benjamin Poulain.
1605
1606         Implements https://streams.spec.whatwg.org/#close-readable-stream.
1607         When the "close" JS function is called, the stream is getting closed.
1608         The stream state is changed to close and if it has a reader, the reader gets closed as well:
1609         The reader resolves the closed promise and release the stream.
1610
1611         Enabled the possibility to resolve a promise with any JS value.
1612         This is used to resolve closed promise with jsUndefined and will be used for read promises.
1613
1614         Covered by reference tests that are now passing.
1615
1616         * Modules/streams/ReadableStream.cpp:
1617         (WebCore::ReadableStream::changeStateToClosed): Called by the JS function 'close'.
1618         * Modules/streams/ReadableStream.h:
1619         * Modules/streams/ReadableStreamReader.cpp:
1620         (WebCore::ReadableStreamReader::ReadableStreamReader):
1621         (WebCore::ReadableStreamReader::initialize): Added to handle state change at constructor time (in particular closed/errored state).
1622         (WebCore::ReadableStreamReader::releaseStream):
1623         (WebCore::ReadableStreamReader::closed): Storing the closed promise callbacks.
1624         (WebCore::ReadableStreamReader::changeStateToClosed): Resolution of closed promise.
1625         * Modules/streams/ReadableStreamReader.h:
1626         * bindings/js/JSDOMPromise.h:
1627         (WebCore::DeferredWrapper::resolve<JSC::JSValue>):
1628         * bindings/js/JSReadableStreamReaderCustom.cpp:
1629         (WebCore::JSReadableStreamReader::closed):
1630         * bindings/js/ReadableStreamJSSource.cpp:
1631         (WebCore::readableStreamSlotName):
1632         (WebCore::getReadableJSStream): Helper function to retrieve the stream from the exec state.
1633         (WebCore::closeReadableStreamFunction):
1634         (WebCore::createReadableStreamCloseFunction):
1635         (WebCore::createReadableStreamController):
1636         (WebCore::ReadableStreamJSSource::start):
1637         (WebCore::ReadableJSStreamReader::ReadableJSStreamReader): Deleted.
1638
1639 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
1640
1641         Use modern for-loops in Document
1642         https://bugs.webkit.org/show_bug.cgi?id=143600
1643
1644         Reviewed by Darin Adler.
1645
1646         No new tests, no behavior changes.
1647
1648         * dom/Document.cpp:
1649         (WebCore::Document::visibilityStateChanged):
1650         (WebCore::Document::processBaseElement):
1651         (WebCore::Document::moveNodeIteratorsToNewDocument):
1652         (WebCore::Document::updateRangesAfterChildrenChanged):
1653         (WebCore::Document::nodeChildrenWillBeRemoved):
1654         (WebCore::Document::nodeWillBeRemoved):
1655         (WebCore::Document::textInserted):
1656         (WebCore::Document::textRemoved):
1657         (WebCore::Document::textNodesMerged):
1658         (WebCore::Document::textNodeSplit):
1659         (WebCore::Document::documentWillSuspendForPageCache):
1660         (WebCore::Document::documentDidResumeFromPageCache):
1661         (WebCore::Document::mediaVolumeDidChange):
1662         (WebCore::Document::privateBrowsingStateDidChange):
1663         (WebCore::Document::captionPreferencesChanged):
1664         (WebCore::Document::validateAutoSizingNodes):
1665         (WebCore::Document::resetAutoSizingNodes):
1666         (WebCore::Document::webkitExitFullscreen):
1667         (WebCore::Document::absoluteRegionForEventTargets):
1668
1669 2015-04-13  Manuel Rego Casasnovas  <rego@igalia.com>
1670
1671         [CSS Grid Layout] Columns set in percentages collapse to auto width
1672         https://bugs.webkit.org/show_bug.cgi?id=141435
1673
1674         Reviewed by David Hyatt.
1675
1676         Based on a patch by Sergio Villar Senin  <svillar@igalia.com>.
1677
1678         This patch adds 2 new new methods in RenderBox to determine if the grid
1679         has a definite size or not.
1680
1681         RenderGrid::gridTrackSize() was not checking properly if the grid has or
1682         not an indefinite size.
1683         The condition was including auto which is not indefinite per se. For
1684         example, auto is definite if the containing block is definite.
1685         As the new method is more expensive, we just call it when it's really
1686         needed to avoid performance regressions.
1687
1688         Finally we were setting the override logical width/height to -1 (no
1689         possible resolution) for all the items regardless if they've a relative
1690         width/height or a fixed one.
1691         Added the condition, including not only items with percentage logical
1692         width/height but also relative, to avoid overriding the value for items
1693         with fixed width/height as it's not needed.
1694
1695         Tests: fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
1696                fast/css-grid-layout/percent-intrinsic-track-breadth.html
1697                fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
1698
1699         * rendering/RenderBox.cpp:
1700         (WebCore::logicalWidthIsResolvable):
1701         (WebCore::RenderBox::hasDefiniteLogicalWidth):
1702         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
1703         (WebCore::RenderBox::hasRelativeLogicalWidth):
1704         * rendering/RenderBox.h:
1705         * rendering/RenderGrid.cpp:
1706         (WebCore::RenderGrid::hasDefiniteLogicalSize):
1707         (WebCore::RenderGrid::gridTrackSize):
1708         (WebCore::RenderGrid::logicalContentHeightForChild):
1709         (WebCore::RenderGrid::minContentForChild):
1710         (WebCore::RenderGrid::maxContentForChild):
1711         * rendering/RenderGrid.h:
1712
1713 2015-04-13  Chris Dumez  <cdumez@apple.com>
1714
1715         Regression: Scrolling on popsci.com spends too much time in FrameView::viewportsContentsChanged()
1716         https://bugs.webkit.org/show_bug.cgi?id=143675
1717
1718         Reviewed by Simon Fraser.
1719
1720         Optimize resumeVisibleImageAnimationsIncludingSubframes() so that the FrameViews'
1721         windowClipRect gets computed less often:
1722         - Cache the FrameView's windowClipRect before resuming image animations in subframes
1723           as calling windowClipRect() on those subframes' view is going to call windowClipRect()
1724           on their ancestors. This avoids a lot of unnecessary windowClipRect recomputations
1725           in deep frame trees.
1726         - Stop traversing the Frame tree if the current frame does not have a content
1727           renderer, as this means the subframes won't have one either.
1728         - Stop traversing the Frame tree if the current frame's view has an empty
1729           windowClipRect() as this means the windowClipRect will be empty for those
1730           subframes as well.
1731
1732         On popsci.com, this cuts down the number of uncached windowClipRect() calls by
1733         approximately half. I see viewportsContentsChanged() at ~0.4% when scrolling
1734         on popsci.com after this change.
1735
1736         * page/FrameView.cpp:
1737         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
1738         (WebCore::FrameView::windowClipRect):
1739         * page/FrameView.h:
1740         * rendering/RenderView.cpp:
1741         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
1742         * rendering/RenderView.h:
1743
1744 2015-04-13  Roger Fong  <roger_fong@apple.com>
1745
1746         Unreviewed. Set the title text of the placard added in r182631.
1747         https://bugs.webkit.org/show_bug.cgi?id=143585.
1748         <rdar://problem/12067439>
1749
1750         * Modules/mediacontrols/mediaControlsApple.js:
1751         (Controller.prototype.updateWirelessPlaybackStatus):
1752
1753 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
1754
1755         Expand test infrastructure to support scrolling tests
1756         https://bugs.webkit.org/show_bug.cgi?id=143286
1757         <rdar://problem/20375516>
1758
1759         Reviewed by Simon Fraser.
1760
1761         No new functionality.
1762
1763         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
1764         function object to be fired when scroll events are finished. The object also keeps track of reasons
1765         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
1766         check rendering state in the middle of an animation.
1767
1768         This code is not yet hooked up to the rendering system, and so does not have any effect on behavior.
1769
1770         * CMakeLists.txt: Add new WheelEventTestTrigger files.
1771         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1772         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1773         * WebCore.xcodeproj/project.pbxproj: Ditto.
1774         * page/MainFrame.cpp:
1775         (WebCore::MainFrame::MainFrame): Add new member to constructor.
1776         (WebCore::MainFrame::testTrigger): Added.
1777         (WebCore::MainFrame::ensureTestTrigger): Added.
1778         (WebCore::MainFrame::clearTrigger): Added.
1779         * page/MainFrame.h:
1780         * page/WheelEventTestTrigger.cpp: Added.
1781         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger):
1782         (WebCore::WheelEventTestTrigger::createWeakPtr):
1783         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
1784         (WebCore::WheelEventTestTrigger::setTestNotificationCallback):
1785         (WebCore::WheelEventTestTrigger::deferTestsForReason):
1786         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
1787         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
1788         * page/WheelEventTestTrigger.h: Added.
1789
1790 2015-04-13  Jer Noble  <jer.noble@apple.com>
1791
1792         [iOS] When entering optimized fullscreen, standard fullscreen view should exit.
1793         https://bugs.webkit.org/show_bug.cgi?id=143615
1794
1795         Reviewed by Simon Fraser.
1796
1797         When entering optimized fullscreen from standard fullscreen, the original fullscreen
1798         view should animate out.
1799
1800         The original method for entering optimized fullscreen is deprecated, so replace it with
1801         the new method (which doesn't take completion blocks) and use delegate methods to detect
1802         when the animation transition completes.
1803
1804         * platform/Logging.h:
1805         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1806         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1807         (boolString): Added; use for logging boolean parameters.
1808         (-[WebAVPlayerController playerViewControllerWillStartOptimizedFullscreen:]): Pass to WebVideoFullscreenInterfaceAVKit.
1809         (-[WebAVPlayerController playerViewControllerDidStartOptimizedFullscreen:]): Ditto.
1810         (-[WebAVPlayerController playerViewControllerWillStopOptimizedFullscreen:]): Ditto.
1811         (-[WebAVPlayerController playerViewControllerDidStopOptimizedFullscreen:]): Ditto.
1812         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Ditto.
1813         (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Ditto.
1814         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Ditto.
1815         (-[WebAVVideoLayer setPlayerViewController:]): Remove the KVO registration; now handled by above delegate methods.
1816         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Add logging.
1817         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto.
1818         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Use new -startOptimizedFullscreen method.
1819         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Add logging.
1820         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto.
1821         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Use hasMode() & isMode() rather than checking m_mode directly.
1822         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Ditto.
1823         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline): Callback now stored on this object rather than the WebAVPlayerController.
1824         (WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoOptimized): Moved.
1825         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added; store the passed callback.
1826         (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen): Exit out of standard fullscreen mode if necessary.
1827         (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Moved from the start lambda in enterFullscreenOptimized().
1828         (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen): Call the model's requestExitFullscreen() method.
1829         (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
1830         (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Call the model's requestExitFullscreen() method.
1831         (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Moved from the stop lambda in enterFullscreenOptimized().
1832         (WebVideoFullscreenInterfaceAVKit::prepareForOptimizedFullscreenStopWithCompletionHandler): Moved from -playerViewController:shouldExitFullScreenWithReason:.
1833         (WebVideoFullscreenInterfaceAVKit::setMode): Added; Call fullscreenModeChanged() if necessary.
1834         (WebVideoFullscreenInterfaceAVKit::clearMode): Ditto.
1835         (-[WebAVVideoLayer observeValueForKeyPath:ofObject:change:context:]): Deleted.
1836         (WebVideoFullscreenInterfaceAVKit::setIsOptimized): Deleted.
1837
1838 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
1839
1840         [Win] Unreviewed fix after r182757.
1841
1842         * platform/win/FileSystemWin.cpp:
1843         (WebCore::renameFile): Checked in wrong version.
1844
1845 2015-04-13  Brent Fulgham  <bfulgham@apple.com>
1846
1847         [Win] Unreviewed fix after r182161.
1848
1849         The change caused Windows to lose Media UI, since the new 'getFileSize'
1850         signature was being improperly used for a 'UInt8'-based string.
1851
1852         Fix was to provide implementations for the two new methods, and to make
1853         sure RenderThemeWin was using the proper signature.
1854
1855         This should actually be a little more efficient, since we have the file
1856         handle when we call this new method. Previously, a Windows 'find file' was
1857         being done with the requested path, which was unnecessary work.
1858
1859         * platform/win/FileSystemWin.cpp:
1860         (WebCore::getFileSizeFromByHandleFileInformationStructure): Added helper function.
1861         (WebCore::getFileSize): Provide implementation.
1862         (WebCore::renameFile):
1863         * rendering/RenderThemeWin.cpp:
1864         (WebCore::RenderThemeWin::stringWithContentsOfFile): Use the file handle to
1865         get the file size, rather than using the path-based size lookup (which involves
1866         performing an unnecessary file search.
1867
1868 2015-04-13  Brady Eidson  <beidson@apple.com>
1869
1870         Share sheets from Share menus appear outside the browser window.
1871         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
1872
1873         Reviewed by Darin Adler.
1874
1875         * page/ContextMenuController.h:
1876         (WebCore::ContextMenuController::client):
1877
1878 2015-04-13  Andreas Kling  <akling@apple.com>
1879
1880         Rebaseline bindings tests.
1881
1882         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1883         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1884         * bindings/scripts/test/JS/JSTestEventTarget.h:
1885         * bindings/scripts/test/JS/JSTestException.h:
1886         * bindings/scripts/test/JS/JSTestInterface.h:
1887         * bindings/scripts/test/JS/JSTestObj.h:
1888         * bindings/scripts/test/JS/JSTestTypedefs.h:
1889
1890 2015-04-13  Jer Noble  <jer.noble@apple.com>
1891
1892         [iOS] Treat a 'not found' media option index as the 'off' track.
1893         https://bugs.webkit.org/show_bug.cgi?id=143672
1894
1895         Reviewed by Eric Carlson.
1896
1897         The UIProcess will pass in UINT64_MAX for the index of the legible option to select. Treat this
1898         as if the captionOffMenuItem() had been selected to avoid a null dereference.
1899
1900         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1901         (WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
1902
1903 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1904
1905         list-style-image with SVG image renders at incorrect size.
1906         https://bugs.webkit.org/show_bug.cgi?id=141367.
1907
1908         Reviewed by Darin Adler.
1909         
1910         This patch imports https://codereview.chromium.org/197203003.
1911
1912         When using an SVG as list marker image, don't unconditionally set the
1913         dimensions to a square with the dimensions of ascent / 2, but rather
1914         determine a suitable size using intrinsic dimensions (and ratio).
1915
1916         Test: svg/as-list-image/svg-list-image-intrinsic-size-1.html
1917
1918         * rendering/RenderListMarker.cpp:
1919         (WebCore::RenderListMarker::updateContent):
1920
1921 2015-04-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1922
1923         Canvas drawImage() has a security hole when the image isn't yet fully loaded.
1924         https://bugs.webkit.org/show_bug.cgi?id=58681.
1925
1926         Reviewed by Darin Adler.
1927
1928         There is a race condition which may happen if an image from a different
1929         origin is drawn on a canvas before it finishes loading. The check to taint
1930         the canvas comes before drawing it. This check returns false if the image
1931         is not completely loaded because we check the URL of the resource response.
1932         If after this check and before the drawing, the image finishes loading, the
1933         canvas will not be tainted but the image will be drawn.
1934         
1935         The fix is to move the check to taint the canvas after drawing the image.
1936         The only problem with this solution is basically the opposite of this bug:
1937         we will become stricter than before with images which are from a different
1938         origin and before they finish loading. The image has not finished loading,
1939         so we do not draw it. Before we check for tainting, the image finishes
1940         loading. So we decide to taint the canvas even the image is not drawn.
1941         
1942         But this should not be a security issue anymore. I personally do not know
1943         if it is even a correctness issue or not.
1944
1945         Test: http/tests/canvas/canvas-tainted-after-draw-image.html
1946
1947         * html/canvas/CanvasRenderingContext2D.cpp:
1948         (WebCore::CanvasRenderingContext2D::drawImage):
1949
1950 2015-04-13  Beth Dakin  <bdakin@apple.com>
1951
1952         Add force property to MouseEvents
1953         https://bugs.webkit.org/show_bug.cgi?id=143569
1954         -and corresponding-
1955         rdar://problem/20472954
1956
1957         Reviewed by Darin Adler.
1958
1959         This patch removes WebKitMouseForceEvent and uses a MouseEvent everywhere that it 
1960         was used. That’s possible because this patch also adds a force property to all 
1961         MouseEvents and to PlatformMouseEvent.
1962
1963         Remove WebKitMouseForceEvent.
1964         * CMakeLists.txt:
1965         * DerivedSources.cpp:
1966         * DerivedSources.make:
1967         * WebCore.vcxproj/WebCore.vcxproj:
1968         * WebCore.vcxproj/WebCore.vcxproj.filters:
1969         * WebCore.xcodeproj/project.pbxproj:
1970         * dom/DOMAllInOne.cpp:
1971
1972         Create MouseEvents with the appropriate force instead of WebKitMouseForceEvents. 
1973         This patch also gets rid of the PlatformMouseEvent parameter for these events. 
1974         They were re-using the cached mousedown event before, which they never should have 
1975         done. Instead, we create PlatformMouseEvents inside these functions and then use 
1976         that to make MouseEvents.
1977         * dom/Element.cpp:
1978         (WebCore::Element::dispatchMouseForceWillBegin):
1979         (WebCore::Element::dispatchMouseForceChanged):
1980         (WebCore::Element::dispatchMouseForceDown):
1981         (WebCore::Element::dispatchMouseForceUp):
1982         (WebCore::Element::dispatchMouseForceClick):
1983         (WebCore::Element::dispatchMouseForceCancelled):
1984         * dom/Element.h:
1985
1986         No More WebKitMouseForceEvent.
1987         * dom/EventNames.in:
1988
1989         Add force to MouseEvent.
1990         * dom/MouseEvent.cpp:
1991         (WebCore::MouseEvent::create):
1992         (WebCore::MouseEvent::MouseEvent):
1993         (WebCore::MouseEvent::cloneFor):
1994         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
1995         * dom/MouseEvent.h:
1996         (WebCore::MouseEvent::force):
1997         (WebCore::MouseEvent::setForce):
1998         * dom/MouseEvent.idl:
1999
2000         No More WebKitMouseForceEvent.
2001         * dom/WebKitMouseForceEvent.cpp: Removed.
2002         * dom/WebKitMouseForceEvent.h: Removed.
2003         * dom/WebKitMouseForceEvent.idl: Removed.
2004
2005         PlatformMouseEvent now takes a force parameter.
2006         * dom/WheelEvent.cpp:
2007         (WebCore::WheelEvent::WheelEvent):
2008         * page/ContextMenuController.cpp:
2009         (WebCore::ContextMenuController::showContextMenuAt):
2010         * page/DragController.cpp:
2011         (WebCore::createMouseEvent):
2012         * page/EventHandler.cpp:
2013         (WebCore::EventHandler::dispatchDragEvent):
2014         (WebCore::EventHandler::sendContextMenuEventForKey):
2015         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
2016
2017         We don’t need lastMouseDownEvent() anymore. We were using it to avoid creating new 
2018         PlatformMouseEvents for the force events, but we fix that in this patch.
2019         (WebCore::EventHandler::lastMouseDownEvent): Deleted.
2020         * page/EventHandler.h:
2021
2022         At force to PlatformMouseEvent.
2023         * platform/PlatformMouseEvent.h:
2024         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2025         (WebCore::PlatformMouseEvent::force):
2026         * replay/SerializationMethods.cpp:
2027         (JSC::EncodingTraits<PlatformMouseEvent>::encodeValue):
2028         (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
2029
2030 2015-04-13  Andreas Kling  <akling@apple.com>
2031
2032         Don't segregate heap objects based on Structure immortality.
2033         <https://webkit.org/b/143638>
2034
2035         Reviewed by Darin Adler.
2036
2037         * bindings/js/JSDOMBinding.h:
2038         * bindings/scripts/CodeGeneratorJS.pm:
2039         (GenerateHeader):
2040         (GeneratePrototypeDeclaration):
2041         * bridge/objc/objc_runtime.h:
2042         * bridge/runtime_array.h:
2043         * bridge/runtime_method.h:
2044         * bridge/runtime_object.h:
2045
2046 2015-04-13  Simon Fraser  <simon.fraser@apple.com>
2047
2048         Fixed position element is truncated if moved onscreen by a transform
2049         https://bugs.webkit.org/show_bug.cgi?id=143655
2050         rdar://problem/15020044
2051
2052         Reviewed by Darin Adler.
2053         
2054         Our "don't do layout if transform changes" code was too aggressive.
2055         If an element changes between having a transform and not having one, we
2056         really need to do a layout since so much else depends on transforms. In
2057         this particular case, we clip position:fixed elements to the viewport if
2058         they are not transformed, and were failing to re-evaluate this when a
2059         transform was added. Doing a layout fixes this.
2060
2061         Test: compositing/geometry/fixed-transformed.html
2062
2063         * rendering/style/RenderStyle.cpp:
2064         (WebCore::RenderStyle::changeRequiresLayout):
2065         * rendering/style/StyleTransformData.h:
2066         (WebCore::StyleTransformData::hasTransform):
2067
2068 2015-04-12  Darin Adler  <darin@apple.com>
2069
2070         [Cocoa] Localizable strings are inconsistent and need to be regenerated
2071         https://bugs.webkit.org/show_bug.cgi?id=143661
2072         rdar://problem/19634388
2073
2074         Reviewed by Dan Bernstein.
2075
2076         * English.lproj/Localizable.strings: Updated by running the
2077         update-webkit-localizable-strings script.
2078
2079 2015-04-13  Darin Adler  <darin@apple.com>
2080
2081         Remove needless recreation of URL in NavigationScheduler::scheduleLocationChange
2082         https://bugs.webkit.org/show_bug.cgi?id=143662
2083
2084         Reviewed by Sam Weinig.
2085
2086         * loader/NavigationScheduler.cpp:
2087         (WebCore::NavigationScheduler::scheduleLocationChange): Removed unnecessary code
2088         to convert a URL to a String and then back into a URL.
2089
2090 2015-04-13  Csaba Osztrogonác  <ossy@webkit.org>
2091
2092         [cmake] Add ENABLE(ATTACHMENT_ELEMENT) to the build system
2093         https://bugs.webkit.org/show_bug.cgi?id=143664
2094
2095         Reviewed by Gyuyoung Kim.
2096
2097         * page/efl/DragControllerEfl.cpp:
2098         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
2099         * page/gtk/DragControllerGtk.cpp:
2100         (WebCore::DragController::declareAndWriteAttachment): Added stub implementation to fix the build.
2101
2102 2015-04-13  Sungmann Cho  <sungmann.cho@navercorp.com>
2103
2104         [Curl] Small improvements to CurlCacheEntry::parseResponseHeaders()
2105         https://bugs.webkit.org/show_bug.cgi?id=143597
2106
2107         Reviewed by Csaba Osztrogonác.
2108
2109         Most lines of code in CurlCacheEntry::parseResponseHeaders() don't need to be
2110         executed if the response has "no-cache" or "no-store" directive, but we are
2111         checking these conditions in the middle of the method. We can move this to the
2112         beginning of the method for efficiency.
2113
2114         No new tests, no behavior change.
2115
2116         * platform/network/curl/CurlCacheEntry.cpp:
2117         (WebCore::CurlCacheEntry::parseResponseHeaders):
2118
2119 2015-04-13  Sergio Villar Senin  <svillar@igalia.com>
2120
2121         Unreviewed, build fix after r182704.
2122
2123         * rendering/RenderGrid.cpp:
2124         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2125
2126 2015-04-13  Joonghun Park  <jh718.park@samsung.com>
2127
2128         Use std::unique_ptr instead of PassOwnPtr|OwnPtr for ResourceResponse
2129         https://bugs.webkit.org/show_bug.cgi?id=143056
2130
2131         Reviewed by Gyuyoung Kim.
2132
2133         No new tests, no behavior changes.
2134
2135         * loader/WorkerThreadableLoader.cpp:
2136         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2137         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse):
2138         * platform/CrossThreadCopier.h:
2139         * platform/network/ResourceResponseBase.cpp:
2140         (WebCore::ResourceResponseBase::adopt):
2141         (WebCore::ResourceResponseBase::copyData):
2142         * platform/network/ResourceResponseBase.h:
2143         * platform/network/cf/ResourceResponse.h:
2144         (WebCore::ResourceResponse::doPlatformCopyData):
2145         (WebCore::ResourceResponse::doPlatformAdopt):
2146         * platform/network/curl/ResourceResponse.h:
2147         (WebCore::ResourceResponse::doPlatformCopyData):
2148         (WebCore::ResourceResponse::doPlatformAdopt):
2149         * platform/network/soup/ResourceResponse.h:
2150         (WebCore::ResourceResponse::doPlatformCopyData):
2151         (WebCore::ResourceResponse::doPlatformAdopt):
2152
2153 2015-04-10  Sergio Villar Senin  <svillar@igalia.com>
2154
2155         [CSS Grid Layout] Support marking/unmarking tracks as infinitely growable
2156         https://bugs.webkit.org/show_bug.cgi?id=141431
2157
2158         Reviewed by Darin Adler.
2159
2160         As explained here
2161         http://lists.w3.org/Archives/Public/www-style/2014Mar/0512.html we
2162         sometimes need to consider that some tracks are infinitely
2163         growable even when they are really not, in order to produce more
2164         "natural" results.
2165
2166         For example the following case:
2167           grid-template-columns: auto auto;
2168           item 1 in column 1 with min-content = max-content = 10px;
2169           item 2 in columns 1-2 with min-content = 30, max-content = 100px;
2170
2171         will produce (45px, 55px) without this patch. But considering the
2172         second column as infinitely growable the result is (10px, 90px), a
2173         more "natural" result because column 1 just needs to be 10px to
2174         accommodate item 1. From now on we can flag GridTracks so that
2175         they can infinitely grow even when the growth limit is finite.
2176
2177         Apart from that distributeSpaceToTracks() is now unconditionally
2178         called even though the extra space is 0. That's because it
2179         computes the plannedSize value.
2180
2181         Test: fast/css-grid-layout/mark-as-infinitely-growable.html
2182
2183         * rendering/RenderGrid.cpp:
2184         (WebCore::GridTrack::infiniteGrowthPotential):
2185         (WebCore::GridTrack::infinitelyGrowable):
2186         (WebCore::GridTrack::setInfinitelyGrowable):
2187         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2188         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Updated with new phase.
2189         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
2190         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
2191         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
2192         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
2193         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
2194         New helper method which does the mark/unmark just for growth limits.
2195         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2196         (WebCore::sortByGridTrackGrowthPotential): Use
2197         infiniteGrowthPotential() for sorting.
2198         (WebCore::RenderGrid::distributeSpaceToTracks):
2199         * rendering/RenderGrid.h:
2200
2201 2015-04-12  Benjamin Poulain  <benjamin@webkit.org>
2202
2203         Legacy scroll behavior on HTMLBodyElement should only apply to the first body element of a document
2204         https://bugs.webkit.org/show_bug.cgi?id=143651
2205
2206         Reviewed by Sam Weinig.
2207
2208         WebKit has some very weird behaviors for the scroll methods on body. This patch
2209         address the first bug: only the first body element should have the legacy behavior.
2210
2211         The relevant text in spec:
2212         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollleft
2213         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrolltop
2214         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollwidth
2215         -http://dev.w3.org/csswg/cssom-view/#dom-element-scrollheight
2216
2217         Tests: fast/dom/Element/body-scrollHeight-basics-quirks.html
2218                fast/dom/Element/body-scrollLeft-basics-quirks.html
2219                fast/dom/Element/body-scrollTop-basics-quirks.html
2220                fast/dom/Element/body-scrollWidth-basics-quirks.html
2221                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollLeft.html
2222                fast/dom/Element/detached-body-element-does-not-scroll-main-frame-with-scrollTop.html
2223
2224         * html/HTMLBodyElement.cpp:
2225         (WebCore::HTMLBodyElement::isFirstBodyElementOfDocument):
2226         (WebCore::HTMLBodyElement::scrollLeft):
2227         (WebCore::HTMLBodyElement::setScrollLeft):
2228         (WebCore::HTMLBodyElement::scrollTop):
2229         (WebCore::HTMLBodyElement::setScrollTop):
2230         (WebCore::HTMLBodyElement::scrollHeight):
2231         (WebCore::HTMLBodyElement::scrollWidth):
2232         * html/HTMLBodyElement.h:
2233
2234 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
2235
2236         Fix trival typos related to the word "coordinate".
2237         https://bugs.webkit.org/show_bug.cgi?id=143644
2238
2239         Reviewed by Alexey Proskuryakov.
2240
2241         No new tests, no behavior change.
2242
2243         * rendering/RenderBox.cpp:
2244         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2245
2246 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2247
2248         Scrollbars in composited overflow and iframes fail to render on Mac
2249         https://bugs.webkit.org/show_bug.cgi?id=143647
2250         rdar://problem/20340544
2251
2252         Reviewed by Darin Adler.
2253
2254         When adding support for drawing scrollbars on the scrolling thread, we inadvertently
2255         disabled scrollbar drawing in other composited, main-thread scrolling configurations.
2256         
2257         Fix by having Scrollbar::supportsUpdateOnSecondaryThread() only return true if
2258         the scrollable area is using async scrolling.
2259         
2260         Sadly, we can't layout-test this.
2261
2262         * platform/Scrollbar.cpp:
2263         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
2264
2265 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2266
2267         Selects don't scroll at some aspect ratios
2268         https://bugs.webkit.org/show_bug.cgi?id=143649
2269         rdar://problem/19365694
2270
2271         Reviewed by Darin Adler.
2272         
2273         Fix width/height flip in RenderListBox which caused us to fail to scroll when
2274         the list was wider than the scroll height.
2275         
2276         We're generally confused about RenderListBox scroll offsets (webkit.org/b/143648)
2277         but this fixes the immediate problem.
2278
2279         Test: fast/forms/listbox-visible-size.html
2280
2281         * rendering/RenderListBox.h:
2282
2283 2015-04-12  Simon Fraser  <simon.fraser@apple.com>
2284
2285         Too much repainting on scrolling with fixed backgrounds
2286         https://bugs.webkit.org/show_bug.cgi?id=143637
2287         rdar://problem/20245243
2288
2289         Reviewed by Darin Adler.
2290         
2291         FrameView::scrollContentsSlowPath() would repaint the entire viewport if there were
2292         any slow-repaint objects (those with background-attachment: fixed) and the contents
2293         were using compositing for scrolling.
2294         
2295         This is wrong; we only need to issue repaint for the slow-repaint renderers,
2296         and, if the frame is hosted in a compositing layer and not using compositing for scrolling,
2297         repaint that hosting layer.
2298
2299         Tests: compositing/repaint/iframes/composited-iframe-with-fixed-background-doc-repaint.html
2300                compositing/repaint/iframes/compositing-iframe-scroll-repaint.html
2301                compositing/repaint/iframes/compositing-iframe-with-fixed-background-doc-repaint.html
2302                platform/mac-wk2/tiled-drawing/fixed-background-scroll-repaint.html
2303
2304         * page/FrameView.cpp:
2305         (WebCore::FrameView::scrollContentsSlowPath):
2306
2307 2015-04-11  Matt Baker  <mattbaker@apple.com>
2308
2309         Web Inspector: create content view and details sidebar for Frames timeline
2310         https://bugs.webkit.org/show_bug.cgi?id=143533
2311
2312         Reviewed by Timothy Hatcher.
2313
2314         Refactoring: RunLoop prefix changed to RenderingFrame.
2315
2316         * inspector/InspectorTimelineAgent.cpp:
2317         (WebCore::InspectorTimelineAgent::internalStart):
2318         (WebCore::toProtocol):
2319         * inspector/InspectorTimelineAgent.h:
2320
2321 2015-04-11  Chris Dumez  <cdumez@apple.com>
2322
2323         Stop referring to outdated RFC2616 in CacheValidation.cpp
2324         https://bugs.webkit.org/show_bug.cgi?id=143619
2325
2326         Reviewed by Darin Adler.
2327
2328         Stop referring to outdated RFC2616 in CacheValidation.cpp and refer to
2329         the newer RFC7230 & RFC7234. Also update some variables to match the
2330         naming in the RFC for clarity.
2331
2332         No behavior change.
2333
2334         * platform/network/CacheValidation.cpp:
2335         (WebCore::updateResponseHeadersAfterRevalidation):
2336         (WebCore::computeCurrentAge):
2337         (WebCore::computeFreshnessLifetimeForHTTPFamily):
2338         (WebCore::isCacheHeaderSeparator):
2339         (WebCore::parseCacheControlDirectives):
2340
2341 2015-04-11  Ryosuke Niwa  <rniwa@webkit.org>
2342
2343         WebKit places caret in front of pasted Numbers cells instead of behind
2344         https://bugs.webkit.org/show_bug.cgi?id=143627
2345
2346         Reviewed by Darin Adler.
2347
2348         The bug was caused by Position::downstream not respecting modern position types inside a table.
2349         Fixed it by using Position::atStartOfNode which respects before/after positions.
2350
2351         This bug doesn't reproduce when there is no whitespace after td element in the pasted content
2352         because positionAtEndOfInsertedContent() will be inside the last pasted cell inside
2353         ReplaceSelectionCommand::completeHTMLReplacement in those cases. This related but separate bug
2354         is tracked in https://webkit.org/b/143628.
2355
2356         Tests: editing/pasteboard/paste-table-with-unrendered-text-nodes.html
2357
2358         * dom/Position.cpp:
2359         (WebCore::Position::downstream):
2360
2361 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2362
2363         [ES6] Enable Symbol in web pages
2364         https://bugs.webkit.org/show_bug.cgi?id=143375
2365
2366         Reviewed by Ryosuke Niwa.
2367
2368         * inspector/InspectorFrontendClientLocal.cpp:
2369         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
2370
2371 2015-04-10  Roger Fong  <roger_fong@apple.com>
2372
2373         Hide volume controls when playing wirelessly.
2374         https://bugs.webkit.org/show_bug.cgi?id=143621.
2375         <rdar://problem/20490673>
2376
2377         Reviewed by Darin Adler.
2378
2379         * Modules/mediacontrols/mediaControlsApple.js:
2380         (Controller.prototype.updateWirelessPlaybackStatus):
2381
2382 2015-04-10  Alexey Proskuryakov  <ap@apple.com>
2383
2384         Build fix.
2385
2386         * WebCore.xcodeproj/project.pbxproj: Make LaunchServicesSPI.h a private header
2387         instead of project, as it's used in WebKit.
2388
2389 2015-04-08  Sam Weinig  <sam@webkit.org>
2390
2391         Allow LaunchServices to handle URLs on link navigations
2392         <rdar://problem/19446826>
2393         https://bugs.webkit.org/show_bug.cgi?id=143544
2394
2395         Reviewed by Anders Carlsson.
2396
2397         * WebCore.xcodeproj/project.pbxproj:
2398         * platform/spi/ios/LaunchServicesSPI.h: Added.
2399         Add new SPI header.
2400
2401 2015-04-10  Bem Jones-Bey  <bjonesbe@adobe.com>
2402
2403         Unreviewed, added CSS Shapes to features.json file.
2404
2405         * features.json:
2406
2407 2015-04-10  Andy Estes  <aestes@apple.com>
2408
2409         [Content Filtering] Support modifying request URLs
2410         https://bugs.webkit.org/show_bug.cgi?id=143599
2411         rdar://problem/20442560
2412
2413         Reviewed by Darin Adler.
2414
2415         Tests: contentfiltering/modify-request-url.html
2416                http/tests/contentfiltering/modify-redirect-request-url.html
2417
2418         Allow NEFilterSource to modifiy request URLs. Also teach MockContentFilter to do the same for testing.
2419
2420         * platform/cocoa/NetworkExtensionContentFilter.mm:
2421         (WebCore::NetworkExtensionContentFilter::willSendRequest): If NEFilterSource provided a string representing a
2422         valid URL in decisionInfo[NEFilterSourceOptionsRedirectURL], then used that as the request URL.
2423         * platform/spi/cocoa/NEFilterSourceSPI.h: Temporarily defined NEFilterSourceOptionsRedirectURL.
2424         * testing/MockContentFilter.cpp:
2425         (WebCore::MockContentFilter::willSendRequest): If settings() has a valid modifiedRequestURL, use it as the
2426         request URL. Only do so once MockContentFilter has reached its decision point so that both initial requests and
2427         redirect requests can be tested.
2428         * testing/MockContentFilterSettings.h: Added modifiedRequestURL.
2429         (WebCore::MockContentFilterSettings::modifiedRequestURL): Ditto.
2430         (WebCore::MockContentFilterSettings::setModifiedRequestURL): Ditto.
2431         * testing/MockContentFilterSettings.idl: Ditto.
2432
2433 2015-04-10  Zalan Bujtas  <zalan@apple.com>
2434
2435         showRenderTree: Include the render object to the inlinebox output.
2436         https://bugs.webkit.org/show_bug.cgi?id=143610
2437
2438         This helps to match the inlinebox and its renderer.
2439
2440         Reviewed by Antti Koivisto.
2441
2442         * rendering/InlineBox.cpp:
2443         (WebCore::InlineBox::showLineBox):
2444
2445 2015-04-09  Roger Fong  <roger_fong@apple.com>
2446
2447         Update wireless player placard for OSX.
2448         https://bugs.webkit.org/show_bug.cgi?id=143585.
2449         <rdar://problem/12067439>
2450
2451         Reviewed by Eric Carlson.
2452
2453         * Modules/mediacontrols/mediaControlsApple.css:
2454         Adjust button positioning and svg.
2455         (audio::-webkit-media-controls-wireless-playback-picker-button):
2456         (audio::-webkit-media-controls-wireless-playback-picker-button.playing):
2457         Style the wireless playback status placard, small and big versions.
2458         (audio::-webkit-media-controls-wireless-playback-status):
2459         (audio::-webkit-media-controls-wireless-playback-text):
2460         (audio::-webkit-media-controls-wireless-playback-text-top):
2461         (audio::-webkit-media-controls-wireless-playback-text-bottom):
2462         (audio::-webkit-media-controls-wireless-playback-status.small):
2463         (audio::-webkit-media-controls-wireless-playback-text-top.small):
2464         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
2465         * Modules/mediacontrols/mediaControlsApple.js:
2466         Add new wireless player placard elements.
2467         (Controller.prototype.createControls):
2468         (Controller.prototype.configureInlineControls):
2469         Make sure to switch between small and big placards when switching between fullscreen and small videos.
2470         (Controller.prototype.configureFullScreenControls):
2471         (Controller.prototype.handleFullscreenChange):
2472         (Controller.prototype.updateWirelessPlaybackStatus):
2473
2474 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
2475
2476         [Mac] Refactor MediaPlaybackTarget
2477         https://bugs.webkit.org/show_bug.cgi?id=143571
2478
2479         Reviewed by Jer Noble.
2480
2481         * WebCore.xcodeproj/project.pbxproj:
2482         * dom/Document.cpp:
2483         (WebCore::Document::addPlaybackTargetPickerClient): Don't call client if page playback target
2484             is NULL.
2485         (WebCore::Document::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
2486         * dom/Document.h:
2487
2488         * html/HTMLMediaElement.cpp:
2489         (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
2490         * html/HTMLMediaElement.h:
2491
2492         * html/HTMLMediaSession.cpp:
2493         (WebCore::HTMLMediaSession::HTMLMediaSession): Don't initialize m_playbackTarget.
2494         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): MediaPlaybackTarget is passed as a Ref<>
2495         * html/HTMLMediaSession.h:
2496
2497         * page/Page.cpp:
2498         (WebCore::Page::Page):
2499         (WebCore::Page::playbackTarget): m_playbackTarget is a RefPtr<MediaPlaybackTarget>
2500         (WebCore::Page::didChoosePlaybackTarget): Ditto.
2501         * page/Page.h:
2502
2503         * platform/audio/MediaSession.h:
2504         (WebCore::MediaSessionClient::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
2505
2506         Make MediaPlaybackTarget RefCounted, and don't require it to be serializable so it can be
2507         subclassed to keep port-specific iformation out of the base class.
2508         * platform/graphics/MediaPlaybackTarget.h: 
2509         (WebCore::MediaPlaybackTarget::targetType):
2510         (WebCore::MediaPlaybackTarget::targetContext):
2511         (WebCore::MediaPlaybackTarget::hasActiveRoute):
2512         (WebCore::MediaPlaybackTarget::MediaPlaybackTarget):
2513         (WebCore::MediaPlaybackTarget::setDevicePickerContext): Deleted.
2514         (WebCore::MediaPlaybackTarget::devicePickerContext): Deleted.
2515
2516         MediaPlaybackTargetContext is the struct that is serialized to pass across the process boudary.
2517         It has union to hold port-specific data.
2518         * platform/graphics/MediaPlaybackTargetContext.h: Added.
2519
2520         * platform/graphics/MediaPlaybackTargetPicker.h: didChoosePlaybackTarget takes a Ref<MediaPlaybackTarget>&&
2521         * platform/graphics/MediaPlaybackTargetPickerClient.h: Ditto.
2522         * platform/graphics/MediaPlayer.cpp:
2523         (WebCore::MediaPlayer::setWirelessPlaybackTarget): Ditto.
2524         * platform/graphics/MediaPlayer.h:
2525
2526         * platform/graphics/MediaPlayerPrivate.h:
2527         (WebCore::MediaPlayerPrivateInterface::setWirelessPlaybackTarget):
2528
2529         * platform/graphics/avfoundation/MediaPlaybackTargetMac.h: Added.
2530         (WebCore::MediaPlaybackTargetMac::targetType):
2531         (WebCore::MediaPlaybackTargetMac::outputContext):
2532         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2533         (WebCore::MediaPlaybackTargetMac::create):
2534         (WebCore::MediaPlaybackTargetMac::MediaPlaybackTargetMac):
2535         (WebCore::MediaPlaybackTargetMac::~MediaPlaybackTargetMac):
2536         (WebCore::MediaPlaybackTargetMac::targetContext):
2537         (WebCore::MediaPlaybackTargetMac::hasActiveRoute):
2538         (WebCore::toMediaPlaybackTargetMac):
2539         (WebCore::MediaPlaybackTarget::encode): Deleted.
2540         (WebCore::MediaPlaybackTarget::decode): Deleted.
2541         (WebCore::MediaPlaybackTarget::hasActiveRoute): Deleted.
2542
2543         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2544         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Allocate and pass a MediaPlaybackTargetMac
2545         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2546
2547         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2548         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Take a Ref<MediaPlaybackTarget&&
2549
2550         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2551         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2552         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
2553
2554         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2555         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2556         (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
2557
2558 2015-04-09  Sergio Villar Senin  <svillar@igalia.com>
2559
2560         [CSS Grid Layout] Fix raw function pointer usages
2561         https://bugs.webkit.org/show_bug.cgi?id=143481
2562
2563         Reviewed by Antti Koivisto.
2564
2565         The argument list of
2566         resolveContentBasedTrackSizingFunctionsForItems() became too long
2567         and rather incomprehensible as it included up to 6 function
2568         pointers. This replaces all of them by an enum which describes the
2569         phase of the algorithm that is currently running. With that phase
2570         we have enough information to select the right function to call.
2571
2572         In order not to tangle up too much the method, the new explicit
2573         switch statements where moved to static helper functions.
2574
2575         No new tests as this is just a code refactoring.
2576
2577         * rendering/RenderGrid.cpp:
2578         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
2579         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2580         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): New helper function.
2581         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Ditto.
2582         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Ditto.
2583         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Ditto.
2584         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Ditto.
2585         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2586         (WebCore::RenderGrid::distributeSpaceToTracks):
2587         * rendering/RenderGrid.h:
2588
2589 2015-04-10  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2590
2591         WebRTC: Remove AudioStreamTrack and VideoStreamTrack (removed in spec)
2592         https://bugs.webkit.org/show_bug.cgi?id=143336
2593
2594         Reviewed by Philippe Normand.
2595
2596         The specific MediaStreamTrakc types (AudioStreamTrack and VideoStreamTrack) have been
2597         removed from the Media Capture and Streams [1] specification.
2598
2599         [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html
2600
2601         There are no test for this feature to remove.
2602
2603         * CMakeLists.txt:
2604         * DerivedSources.make:
2605         * Modules/mediastream/AudioStreamTrack.cpp: Removed.
2606         * Modules/mediastream/AudioStreamTrack.h: Removed.
2607         * Modules/mediastream/AudioStreamTrack.idl: Removed.
2608         * Modules/mediastream/MediaStream.cpp:
2609         (WebCore::MediaStream::MediaStream):
2610         (WebCore::MediaStream::addRemoteTrack):
2611         (WebCore::MediaStream::active): Deleted.
2612         * Modules/mediastream/MediaStreamTrack.cpp:
2613         (WebCore::MediaStreamTrack::create):
2614         (WebCore::MediaStreamTrack::MediaStreamTrack):
2615         (WebCore::MediaStreamTrack::kind):
2616         (WebCore::MediaStreamTrack::clone):
2617         (WebCore::MediaStreamTrack::trackEnded): Deleted.
2618         * Modules/mediastream/MediaStreamTrack.h:
2619         * Modules/mediastream/VideoStreamTrack.cpp: Removed.
2620         * Modules/mediastream/VideoStreamTrack.h: Removed.
2621         * Modules/mediastream/VideoStreamTrack.idl: Removed.
2622         * WebCore.xcodeproj/project.pbxproj:
2623
2624 2015-04-09  Andy Estes  <aestes@apple.com>
2625
2626         [Cocoa] Add a HAVE(AVKIT) and use it
2627         https://bugs.webkit.org/show_bug.cgi?id=143593
2628
2629         Reviewed by David Kilzer.
2630
2631         * page/Settings.h: Only defined setAVKitEnabled() if HAVE(AVKIT).
2632         * platform/ios/WebVideoFullscreenControllerAVKit.mm: Only compiled if HAVE(AVKIT).
2633         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
2634
2635 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
2636
2637         Some CSS3 filters tests crash under iOS testing
2638         https://bugs.webkit.org/show_bug.cgi?id=143594
2639         rdar://problem/20491140
2640
2641         Reviewed by David Kilzer.
2642
2643         Some tests disable accelerated compositing via testRunner.overridePreference(). In this case,
2644         we'd not create a root scrolling tree node, so null-check it in AsyncScrollingCoordinator::updateNonFastScrollableRegion().
2645
2646         * page/scrolling/AsyncScrollingCoordinator.cpp:
2647         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
2648
2649 2015-04-09  Zalan Bujtas  <zalan@apple.com>
2650
2651         Simple line layout: Add <br> support.
2652         https://bugs.webkit.org/show_bug.cgi?id=139012
2653
2654         This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
2655         Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
2656         and speeds up layout for such content.
2657
2658         PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
2659         With <br> support enabled:
2660           mean: 70.02391461289068 runs/s
2661           median: 70.47986488932318 runs/s
2662
2663         While with <br> support disabled:
2664           mean: 30.417295049468184 runs/s
2665           median: 30.36517778760357 runs/s
2666
2667         Reviewed by Antti Koivisto.
2668
2669         Test: fast/text/simple-line-with-br.html
2670
2671         * editing/TextIterator.cpp:
2672         (WebCore::TextIterator::handleTextNode):
2673         * rendering/RenderBlock.h:
2674         * rendering/RenderBlockFlow.cpp:
2675         (WebCore::RenderBlockFlow::setSelectionState):
2676         (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
2677         * rendering/RenderBlockFlow.h:
2678         * rendering/RenderLineBreak.cpp:
2679         (WebCore::simpleLineLayout):
2680         (WebCore::ensureLineBoxes):
2681         (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
2682         (WebCore::RenderLineBreak::positionForPoint):
2683         (WebCore::RenderLineBreak::setSelectionState):
2684         (WebCore::RenderLineBreak::linesBoundingBox):
2685         (WebCore::RenderLineBreak::absoluteRects):
2686         (WebCore::RenderLineBreak::absoluteQuads):
2687         (WebCore::RenderLineBreak::collectSelectionRects):
2688         * rendering/RenderLineBreak.h:
2689         * rendering/RenderText.cpp:
2690         (WebCore::RenderText::absoluteRects):
2691         (WebCore::RenderText::absoluteQuadsClippedToEllipsis):
2692         (WebCore::RenderText::absoluteQuads):
2693         (WebCore::RenderText::linesBoundingBox):
2694         (WebCore::RenderText::caretMinOffset):
2695         (WebCore::RenderText::caretMaxOffset):
2696         (WebCore::RenderText::containsCaretOffset):
2697         (WebCore::RenderText::hasRenderedText):
2698         * rendering/SimpleLineLayout.cpp:
2699         (WebCore::SimpleLineLayout::canUseFor):
2700         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
2701         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
2702         (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
2703         (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
2704         (WebCore::SimpleLineLayout::firstFragment):
2705         (WebCore::SimpleLineLayout::forceFragmentToLine):
2706         (WebCore::SimpleLineLayout::createLineRuns):
2707         (WebCore::SimpleLineLayout::create):
2708         * rendering/SimpleLineLayoutFlowContents.cpp:
2709         (WebCore::SimpleLineLayout::initializeSegments):
2710         (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
2711         * rendering/SimpleLineLayoutFlowContents.h:
2712         * rendering/SimpleLineLayoutFunctions.cpp:
2713         (WebCore::SimpleLineLayout::paintFlow):
2714         (WebCore::SimpleLineLayout::hitTestFlow):
2715         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
2716         * rendering/SimpleLineLayoutResolver.cpp:
2717         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
2718         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
2719         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
2720         * rendering/SimpleLineLayoutResolver.h:
2721         (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
2722         (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
2723         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2724         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
2725         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
2726         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
2727         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2728         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2729         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
2730         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
2731         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
2732         (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
2733         (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
2734         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
2735
2736 2015-04-09  Chris Dumez  <cdumez@apple.com>
2737
2738         Regression(r182603): editing/selection/selection-invalid-offset.html is crashing
2739         https://bugs.webkit.org/show_bug.cgi?id=143591
2740
2741         Reviewed by Ryosuke Niwa.
2742
2743         Add missing null-check for m_frame->editor().client() in
2744         FrameSelection::updateAndRevealSelection().
2745
2746         * editing/FrameSelection.cpp:
2747         (WebCore::FrameSelection::updateAndRevealSelection):
2748
2749 2015-04-09  Sungmann Cho  <sungmann.cho@navercorp.com>
2750
2751         Minor cleanups to WebCore/plugins
2752         https://bugs.webkit.org/show_bug.cgi?id=143509
2753
2754         Reviewed by Anders Carlsson.
2755
2756         1. Remove unnecessary #includes.
2757         2. Fix some wrong namespace comments for consistency.
2758
2759         No new tests, no behavior change.
2760
2761         * plugins/DOMMimeType.cpp:
2762         * plugins/DOMMimeType.h:
2763         * plugins/DOMMimeTypeArray.h:
2764         * plugins/DOMPlugin.h:
2765         * plugins/DOMPluginArray.h:
2766         * plugins/PluginData.cpp:
2767         * plugins/PluginData.h:
2768         * plugins/PluginMainThreadScheduler.cpp:
2769         * plugins/PluginViewBase.h:
2770
2771 2015-04-09  Javier Fernandez  <jfernandez@igalia.com>
2772
2773         [CSS Grid Layout] Implement justify-self and justify-item css properties.
2774         https://bugs.webkit.org/show_bug.cgi?id=133281
2775
2776         Reviewed by David Hyatt.
2777
2778         Implement the new property 'justify-items', defined in the CSS Box Alignment
2779         specification to describe the container's alignment behavior, in the same way
2780         the 'align-items' property does. The 'justify-self' 'auto' value of any relative
2781         positioned element will be resolved to its container's 'justify-items' value.
2782
2783         Test: fast/css/parse-justify-items.html
2784
2785         * css/CSSComputedStyleDeclaration.cpp:
2786         (WebCore::resolveContainerAlignmentAuto): Function to resolve 'auto' values for 'align-items' or 'justify-items'.
2787         (WebCore::resolveSelfAlignmentAuto): Function to resolve 'auto' values for 'align-self' or 'justify-self'.
2788         (WebCore::valueForItemPositionWithOverflowAlignment): Take into account the 'legacy' keyword.
2789         (WebCore::ComputedStyleExtractor::propertyValue):
2790         (WebCore::resolveAlignmentAuto): Deleted (renamed to resolveContainerAlignmentAuto).
2791         * css/CSSParser.cpp:
2792         (WebCore::CSSParser::parseValue): Refactoring to share logic between justify-xxx and align-xxx properties.
2793         (WebCore::CSSParser::parseLegacyPosition): Parsing logic of 'legacy' keyword,
2794         (WebCore::CSSParser::parseItemPositionOverflowPosition): Take into account the 'legacy' keyword.
2795         * css/CSSParser.h:
2796         * css/CSSPropertyNames.in:
2797         * css/CSSValueKeywords.in:
2798         * css/StyleBuilderCustom.h:
2799         (WebCore::StyleBuilderCustom::applyInheritJustifyItems): Added.
2800         (WebCore::StyleBuilderCustom::applyInitialJustifyItems): Added.
2801         (WebCore::StyleBuilderCustom::applyValueJustifyItems): Added.
2802         * css/StyleResolver.cpp:
2803         (WebCore::StyleResolver::adjustRenderStyle): Resolve 'auto' values for justify-items when parents have the 'legacy' keyword.
2804         * rendering/style/RenderStyle.h: Managing the new ItemPositionType fields.
2805         * rendering/style/RenderStyleConstants.h: Added the ItemPositionType enumeration for handling the 'legacy' keyword.
2806         * rendering/style/StyleRareNonInheritedData.cpp: Managing the new ItemPositionType fields.
2807         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2808         (WebCore::StyleRareNonInheritedData::operator==):
2809         * rendering/style/StyleRareNonInheritedData.h:
2810
2811 2015-04-09  Anders Carlsson  <andersca@apple.com>
2812
2813         Make it possible to create an application cache storage with custom directories
2814         https://bugs.webkit.org/show_bug.cgi?id=143588
2815
2816         Reviewed by Sam Weinig.
2817
2818         Add cache directory and flat file directory name parameters to ApplicationCacheStorage::create.
2819
2820         * loader/appcache/ApplicationCacheStorage.cpp:
2821         (WebCore::ApplicationCacheStorage::store):
2822         (WebCore::ApplicationCacheStorage::loadCache):
2823         (WebCore::ApplicationCacheStorage::checkForDeletedResources):
2824         (WebCore::ApplicationCacheStorage::flatFileAreaSize):
2825         (WebCore::ApplicationCacheStorage::ApplicationCacheStorage):
2826         (WebCore::ApplicationCacheStorage::create):
2827         (WebCore::ApplicationCacheStorage::singleton):
2828         * loader/appcache/ApplicationCacheStorage.h:
2829
2830 2015-04-09  Myles C. Maxfield  <mmaxfield@apple.com>
2831
2832         Text-combine erroneously draws vertically after non-layout-causing style change
2833         https://bugs.webkit.org/show_bug.cgi?id=143461
2834         <rdar://problem/19285490>
2835
2836         Reviewed by Darin Adler.
2837
2838         RenderCombineText::styleDidChange() unconditionally uncombines its text. Layout then
2839         recombines it. However, if there is a style change that does not cause layout, the
2840         RenderCombineText will be left uncombined until the next layout.
2841
2842         Test: fast/text/text-combine-style-change-no-layout.html
2843
2844         * rendering/RenderCombineText.cpp:
2845         (WebCore::RenderCombineText::styleDidChange):
2846
2847 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
2848
2849         Revert part of 182516: it broke tests
2850         https://bugs.webkit.org/show_bug.cgi?id=143568
2851         rdar://problem/20484578
2852
2853         Reviewed by Myles Maxfield.
2854
2855         Revert the FontCascadeCocoa parts of r182516, since it broke some CSS shapes tests.
2856
2857         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2858         (WebCore::FontCascade::drawGlyphs):
2859         (WebCore::dilationSizeForTextColor): Deleted.
2860
2861 2015-04-09  Zalan Bujtas  <zalan@apple.com>
2862
2863         Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
2864         https://bugs.webkit.org/show_bug.cgi?id=143554
2865
2866         Reviewed by Antti Koivisto.
2867
2868         Initialize render flow's segments only when the render flow changes in TextIterator.
2869         The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
2870
2871         Test: PerformanceTests/Layout/simple-line-layout-innertext.html.
2872
2873         * editing/TextIterator.cpp:
2874         (WebCore::TextIterator::handleTextNode):
2875         * editing/TextIterator.h:
2876         * rendering/SimpleLineLayoutFlowContents.cpp: Instruments log shows that vector's expandCapacity could be expensive when flow has large amount of children.
2877         (WebCore::SimpleLineLayout::initializeSegments):
2878
2879 2015-04-09  Chris Dumez  <cdumez@apple.com>
2880
2881         [WK2][iOS] editorState() should not cause a synchronous layout
2882         https://bugs.webkit.org/show_bug.cgi?id=142536
2883         <rdar://problem/20041506>
2884
2885         Reviewed by Enrica Casucci.
2886
2887         Add didChangeSelectionAndUpdateLayout() callback to EditorClient
2888         that is called at the end of FrameSelection::updateAndRevealSelection().
2889
2890         * editing/FrameSelection.cpp:
2891         (WebCore::FrameSelection::updateAndRevealSelection):
2892         * loader/EmptyClients.h:
2893         * page/EditorClient.h:
2894
2895 2015-04-08  Anders Carlsson  <andersca@apple.com>
2896
2897         Give each cache group a storage and use it in place of the singleton
2898         https://bugs.webkit.org/show_bug.cgi?id=143540
2899
2900         Reviewed by Sam Weinig.
2901
2902         This is another step towards making the cache storage be per page.
2903
2904         * loader/appcache/ApplicationCacheGroup.cpp:
2905         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
2906         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
2907         (WebCore::ApplicationCacheGroup::cacheForMainRequest):
2908         (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest):
2909         (WebCore::ApplicationCacheGroup::selectCache):
2910         (WebCore::ApplicationCacheGroup::makeObsolete):
2911         (WebCore::ApplicationCacheGroup::didReachMaxAppCacheSize):
2912         (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota):
2913         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
2914         * loader/appcache/ApplicationCacheGroup.h:
2915         * loader/appcache/ApplicationCacheStorage.cpp:
2916         (WebCore::ApplicationCacheStorage::loadCacheGroup):
2917         (WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
2918         (WebCore::ApplicationCacheStorage::cacheGroupForURL):
2919         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
2920
2921 2015-04-09  Andy Estes  <aestes@apple.com>
2922
2923         Try to fix the Mac build after r182596.
2924
2925         I was wrong to replace PLATFORM(IOS) with HAVE(PARENTAL_CONTROLS) in ContentFilterUnblockHandler.
2926         The conditional should be HAVE(PARENTAL_CONTROLS) && PLATFORM(IOS).
2927
2928         * platform/ContentFilterUnblockHandler.h:
2929         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2930         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
2931         (WebCore::ContentFilterUnblockHandler::needsUIProcess):
2932         (WebCore::ContentFilterUnblockHandler::encode):
2933         (WebCore::ContentFilterUnblockHandler::decode):
2934         (WebCore::ContentFilterUnblockHandler::canHandleRequest):
2935         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
2936
2937 2015-04-09  Andy Estes  <aestes@apple.com>
2938
2939         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
2940         https://bugs.webkit.org/show_bug.cgi?id=143559
2941
2942         Reviewed by David Kilzer.
2943
2944         * loader/ContentFilter.cpp:
2945         (WebCore::ContentFilter::types): Only registered ParentalControlsContentFilter if HAVE(PARENTAL_CONTROLS).
2946         * platform/ContentFilterUnblockHandler.h: Changed PLATFORM(IOS) to HAVE(PARENTAL_CONTROLS).
2947         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2948         (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Ditto.
2949         (WebCore::ContentFilterUnblockHandler::needsUIProcess): Ditto.
2950         (WebCore::ContentFilterUnblockHandler::encode): Ditto.
2951         (WebCore::ContentFilterUnblockHandler::decode): Ditto.
2952         (WebCore::ContentFilterUnblockHandler::canHandleRequest): Ditto.
2953         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync): Ditto.
2954         * platform/cocoa/ParentalControlsContentFilter.mm: Wrapped the file with HAVE(PARENTAL_CONTROLS)
2955
2956 2015-04-09  Sergio Villar Senin  <svillar@igalia.com>
2957
2958         Unreviewed, added CSS Grid Layout to features.json file.
2959
2960         * features.json:
2961
2962 2015-04-08  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2963
2964         [Streams API] Support the start function parameter in ReadableStream constructor
2965         https://bugs.webkit.org/show_bug.cgi?id=141160
2966
2967         Reviewed by Benjamin Poulain.
2968
2969         Stores the JS source object in ReadableStreamJSSource and calls its "start" function.
2970         This function takes a controller object that has three JS functions as members: close, enqueue and error.
2971         This controller is stored in ReadableStreamJSSource as it will be reused as "pull" parameter.
2972         All three JS functions do not currently do anything.
2973
2974         Test: streams/readablestream-start.html
2975
2976         * Modules/streams/ReadableStream.cpp:
2977         (WebCore::ReadableStream::start): Place holder for step 11 of https://streams.spec.whatwg.org/#rs-constructor.
2978         * Modules/streams/ReadableStream.h:
2979         * bindings/js/JSReadableStreamCustom.cpp:
2980         (WebCore::constructJSReadableStream):
2981         * bindings/js/ReadableStreamJSSource.cpp:
2982         (WebCore::getPropertyFromObject): Helper function to get a public property from an object.
2983         (WebCore::setPropertyToObject): Helper function to set a public property to an object.
2984         (WebCore::callFunction): Helper function to call a JS function from C++.
2985         (WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
2986         (WebCore::notImplementedFunction):
2987         (WebCore::createReadableStreamEnqueueFunction): Creates the JS function for enqueue.
2988         (WebCore::createReadableStreamCloseFunction): Creates the JS function for close.
2989         (WebCore::createReadableStreamErrorFunction): Creates the JS function for error.
2990         (WebCore::startReadableStreamAsync): Equivalent of promise resolution for start.
2991         (WebCore::ReadableStreamJSSource::start): Calls the "start" function of the JS source with all three JS functions (enqueue, close, error) as parameters.
2992         * bindings/js/ReadableStreamJSSource.h:
2993
2994 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
2995
2996         [Mac] Unreviewed test fix after r182584
2997         https://bugs.webkit.org/show_bug.cgi?id=143452
2998
2999         Correct bit comparison to use the correct value for the Control-key
3000
3001         * platform/mac/PlatformEventFactoryMac.mm:
3002         (WebCore::typeForEvent):
3003
3004 2015-04-08  Simon Fraser  <simon.fraser@apple.com>
3005
3006         Add a debug assertion that will fire if we try to paint layer contents on a background thread
3007         https://bugs.webkit.org/show_bug.cgi?id=143547
3008
3009         Reviewed by Alexey Proskuryakov.
3010
3011         New assertion to catch cases where other frameworks erroneously trigger painting
3012         on a non-main (or non-Web) thread.
3013
3014         * platform/graphics/mac/WebLayer.mm:
3015         (-[WebSimpleLayer display]):
3016         (-[WebSimpleLayer drawInContext:]):
3017
3018 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
3019
3020         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
3021         https://bugs.webkit.org/show_bug.cgi?id=143452
3022         <rdar://problem/20437483>
3023
3024         Reviewed by Tim Horton.
3025
3026         We cannot rely on the event's button number to decide behavior. The OS settings might have
3027         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
3028         the proper button press behavior is.
3029
3030         * platform/mac/PlatformEventFactoryMac.mm:
3031         (WebCore::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
3032
3033 2015-04-08  Michael Catanzaro  <mcatanzaro@igalia.com>
3034
3035         Fix -Wformat in AnimationBase.cpp
3036         https://bugs.webkit.org/show_bug.cgi?id=143541
3037
3038         Reviewed by Simon Fraser.
3039
3040         * page/animation/AnimationBase.cpp:
3041         (WebCore::nameForStateInput): Added. Converts an AnimationBase::AnimationStateInput to a
3042         string.
3043         (WebCore::AnimationBase::updateStateMachine): Print AnimationBase::AnimationStateInput as a
3044         string, instead of passing it to %d and assuming that works, to silence GCC's -Wformat.
3045
3046 2015-04-08  Brady Eidson  <beidson@apple.com>
3047
3048         Expose the "Share" menu for links, images, and media.
3049         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
3050
3051         Reviewed by Tim Horton.
3052
3053         * loader/EmptyClients.h:
3054         * page/ContextMenuClient.h:
3055         (WebCore::ContextMenuClient::shareSelectedTextMenuItem): Deleted.
3056
3057         * page/ContextMenuController.cpp:
3058         (WebCore::ContextMenuController::populate):
3059         (WebCore::selectionContainsPossibleWord): Deleted.
3060         * page/ContextMenuController.h:
3061         (WebCore::ContextMenuController::page):
3062
3063         * platform/ContextMenuItem.cpp:
3064         (WebCore::ContextMenuItem::ContextMenuItem):
3065         (WebCore::ContextMenuItem::isNull):
3066         (WebCore::ContextMenuItem::shareMenuItem):
3067         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3068         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3069         * platform/ContextMenuItem.h:
3070
3071         * platform/gtk/ContextMenuItemGtk.cpp:
3072         (WebCore::ContextMenuItem::shareMenuItem): Return a null item.
3073         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3074         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3075
3076         * platform/mac/ContextMenuItemMac.mm:
3077         (WebCore::ContextMenuItem::shareMenuItem): Create a full-featured Share menu item instead of just for selected text.
3078         (WebCore::ContextMenuItem::supportsShareMenu): Deleted.
3079         (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Deleted.
3080
3081         * rendering/HitTestResult.cpp:
3082         (WebCore::HitTestResult::selectedText): Instead of calculating selected text outside the HitTestResult, let the
3083           HitTestResult do what it does best: Calculate things!
3084         * rendering/HitTestResult.h:
3085
3086 2015-04-08  Per Arne Vollan  <peavo@outlook.com>
3087
3088         [Curl] Compile error in CurlCacheEntry::parseResponseHeaders method.
3089         https://bugs.webkit.org/show_bug.cgi?id=143531
3090
3091         Reviewed by Alex Christensen.
3092
3093         Cache related methods in ResourceResponse have changed return type.
3094
3095         * platform/network/curl/CurlCacheEntry.cpp:
3096         (WebCore::CurlCacheEntry::parseResponseHeaders):
3097
3098 2015-04-08  Anders Carlsson  <andersca@apple.com>
3099
3100         Remove ApplicationCacheGroup::m_isCopy
3101         https://bugs.webkit.org/show_bug.cgi?id=143536
3102
3103         Reviewed by Tim Horton.
3104
3105         Code that used to set m_isCopy to true is long gone.
3106
3107         * loader/appcache/ApplicationCache.cpp:
3108         (WebCore::ApplicationCache::~ApplicationCache):
3109         * loader/appcache/ApplicationCacheGroup.cpp:
3110         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup):
3111         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup):
3112         * loader/appcache/ApplicationCacheGroup.h:
3113         (WebCore::ApplicationCacheGroup::isCopy): Deleted.
3114
3115 2015-04-08  Anders Carlsson  <andersca@apple.com>
3116
3117         Delete ApplicationCache static member functions
3118         https://bugs.webkit.org/show_bug.cgi?id=143534
3119
3120         Reviewed by Tim Horton.
3121
3122         * loader/appcache/ApplicationCache.cpp:
3123         (WebCore::ApplicationCache::deleteCacheForOrigin): Deleted.
3124         (WebCore::ApplicationCache::deleteAllCaches): Deleted.
3125         (WebCore::ApplicationCache::diskUsageForOrigin): Deleted.
3126         * loader/appcache/ApplicationCache.h:
3127
3128 2015-04-08  Alex Christensen  <achristensen@webkit.org>
3129
3130         Block popups from content extensions.
3131         https://bugs.webkit.org/show_bug.cgi?id=143497
3132
3133         Reviewed by Brady Eidson.
3134
3135         Test: http/tests/contentextensions/popups.html
3136
3137         * loader/ResourceLoadInfo.cpp:
3138         (WebCore::readResourceType):
3139         * loader/ResourceLoadInfo.h:
3140         * page/DOMWindow.cpp:
3141         (WebCore::DOMWindow::open):
3142         * page/UserContentController.cpp:
3143         (WebCore::UserContentController::actionsForResourceLoad):
3144         * page/UserContentController.h:
3145         Check content extensions before opening a window.
3146
3147 2015-04-08  Bem Jones-Bey  <bjonesbe@adobe.com>
3148
3149         [CSS Shapes] Properly handle negative reference box widths and center coordinates
3150         https://bugs.webkit.org/show_bug.cgi?id=142610
3151
3152         Reviewed by Rob Buis.
3153
3154         Fix a few cases where values that should not be negative end up that
3155         way.
3156
3157         This patch is based on a couple of Blink patches by Rob Buis.
3158
3159         Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html
3160                fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html
3161
3162         * rendering/shapes/ShapeOutsideInfo.cpp:
3163         (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A
3164             negative margin box width means that the shape has no extent, so
3165             clamp to zero.
3166         * rendering/style/BasicShapes.cpp:
3167         (WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing
3168             the radii, take the absolute value, since the radii is based on
3169             the distance, which is always positive.
3170         (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto.
3171
3172 2015-04-08  Commit Queue  <commit-queue@webkit.org>
3173
3174         Unreviewed, rolling out r182522.
3175         https://bugs.webkit.org/show_bug.cgi?id=143529
3176
3177         Not needed any more (Requested by ap on #webkit).
3178
3179         Reverted changeset:
3180
3181         "Fix the build."
3182         http://trac.webkit.org/changeset/182522
3183
3184 2015-04-08  Beth Dakin  <bdakin@apple.com>
3185
3186         Force events should not require preventDefault in order to fire
3187         https://bugs.webkit.org/show_bug.cgi?id=143503
3188         -and corresponding-
3189         rdar://problem/20458916
3190
3191         Reviewed by Tim Horton.
3192
3193         Since these events will fire whether or not preventDefault was set on the 
3194         willBegin event, we should make sure we only send them when there are registered 
3195         event listeners. These are new events, so we don’t want to spam the vast majority 
3196         of web content that doesn’t use them yet.
3197         * dom/Document.cpp:
3198         (WebCore::Document::addListenerTypeIfNeeded):
3199         * dom/Document.h:
3200         * dom/Element.cpp:
3201         (WebCore::Element::dispatchMouseForceWillBegin):
3202         (WebCore::Element::dispatchMouseForceChanged):
3203         (WebCore::Element::dispatchMouseForceDown):
3204         (WebCore::Element::dispatchMouseForceUp):
3205         (WebCore::Element::dispatchMouseForceClick):
3206         (WebCore::Element::dispatchMouseForceCancelled):
3207
3208 2015-04-08  Jer Noble  <jer.noble@apple.com>
3209
3210         [Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the list of enabled audio tracks change.
3211         https://bugs.webkit.org/show_bug.cgi?id=143332
3212
3213         Reviewed by Eric Carlson.
3214
3215         Some media assets (notably, mp3s) will not have an enabled audio track when the AVAsset is
3216         first loaded, so the AVAudioMix will have no trackID in it's parameters. Whenever the list
3217         of enabled tracks change, recreate the AVAudioMix with the new first enabled audio trackID.
3218
3219         To facilitate this, add a new setter to AudioSourceProviderAVFObjC taking an AVAssetTrack to
3220         use with the AVAudioMix. Whenever this parameter changes, the AVAudioMix is destroyed and
3221         recreated.
3222
3223         * html/HTMLMediaElement.cpp:
3224         (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Drive-by fix: when the media
3225             player switches engines, re-associate the audio source node with its provider.
3226         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
3227         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3228         (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Only create the mix if there is a valid AVPlayerItem and AVAssetTrack
3229         (WebCore::AudioSourceProviderAVFObjC::setAudioTrack): Ditto.
3230         (WebCore::AudioSourceProviderAVFObjC::createMix): Don't iterate over the AVPlayerItem's tracks,
3231             just use the one passed in through setAudioTrack().
3232         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3233         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear the provider's track.
3234         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Set the provider's track.
3235         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
3236         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
3237
3238 2015-04-08  Anders Carlsson  <andersca@apple.com>
3239
3240         Move some ApplicationCache static member functions to ApplicationCacheStorage
3241         https://bugs.webkit.org/show_bug.cgi?id=143524
3242
3243         Reviewed by Antti Koivisto.
3244
3245         This is yet another step towards eliminating ApplicationCacheStorage::singleton() and making the storage be per page instead.
3246
3247         * loader/appcache/ApplicationCache.cpp:
3248         (WebCore::ApplicationCache::deleteCacheForOrigin):
3249         (WebCore::ApplicationCache::deleteAllCaches):
3250         (WebCore::ApplicationCache::diskUsageForOrigin):
3251         * loader/appcache/ApplicationCacheStorage.cpp:
3252         (WebCore::ApplicationCacheStorage::deleteAllCaches):
3253         (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
3254         (WebCore::ApplicationCacheStorage::diskUsageForOrigin):
3255         * loader/appcache/ApplicationCacheStorage.h:
3256
3257 2015-04-08  ChangSeok Oh  <changseok.oh@collabora.com>
3258
3259         Fill list style background with same color with that of list background.
3260         https://bugs.webkit.org/show_bug.cgi?id=143483
3261
3262         Reviewed by Simon Fraser.
3263
3264         LayoutListMarker does not have a node so its selectionBackgroundColor alway returns
3265         the default theme color for selection. We can make it more natural by filling
3266         the same color with that of LayoutListItem into it.
3267
3268         Tests: fast/backgrounds/selection-background-color-of-image-list-style.html
3269                fast/backgrounds/selection-background-color-of-list-style.html
3270
3271         * rendering/RenderListMarker.cpp:
3272         (WebCore::RenderListMarker::paint):
3273
3274 2015-04-08  Alex Christensen  <achristensen@webkit.org> and Patrick Gansterer  <paroga@webkit.org>
3275
3276         Add CMake build system for WinCairo port.
3277         https://bugs.webkit.org/show_bug.cgi?id=115944
3278
3279         Reviewed by Chris Dumez.
3280
3281         * CMakeLists.txt:
3282         * PlatformWin.cmake:
3283         * PlatformWinCairo.cmake:
3284         * platform/graphics/texmap/TextureMapperGL.cpp:
3285         (WebCore::TextureMapperGL::TextureMapperGL):
3286
3287 2015-04-08  Chris Dumez  <cdumez@apple.com>
3288
3289         Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
3290         https://bugs.webkit.org/show_bug.cgi?id=143513
3291
3292         Reviewed by Andreas Kling.
3293
3294         Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for
3295         clarity as it is only used for the page cache. Also rename the
3296         'DocumentWillBecomeInactive' value of the ReasonForSuspension enum to
3297         'PageCache' as it is only used by CachedFrame for the page cache and it
3298         is a lot more understandable.
3299
3300 2015-04-08  Commit Queue  <commit-queue@webkit.org>
3301
3302         Unreviewed, rolling out r182536.
3303         https://bugs.webkit.org/show_bug.cgi?id=143523
3304
3305         Made accessibility/table-sections.html time out on debug bots
3306         (Requested by ap on #webkit).
3307
3308         Reverted changeset:
3309
3310         "Simple line layout: Add <br> support."
3311         https://bugs.webkit.org/show_bug.cgi?id=139012
3312         http://trac.webkit.org/changeset/182536
3313
3314 2015-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
3315
3316         [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user
3317         https://bugs.webkit.org/show_bug.cgi?id=143521
3318
3319         Reviewed by Martin Robinson.
3320
3321         This is a case we claim to support, but it only works if the
3322         object has only one reference. In that case, when the user unrefs
3323         it, the weak ref notify callback removes the object from the
3324         cache. However, if the object has more than one ref, the cache
3325         doesn't know the user unreffed it, and when clearing the cache we
3326         try to remove more references than what the object actually has,
3327         causing a crash in g_object_unref.
3328
3329         * bindings/gobject/DOMObjectCache.cpp:
3330         (WebKit::DOMObjectCacheData::clearObject):
3331
3332 2015-04-08  Zalan Bujtas  <zalan@apple.com>
3333
3334         Simple line layout: Add <br> support.
3335         https://bugs.webkit.org/show_bug.cgi?id=139012
3336
3337         This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
3338         Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
3339         and speeds up layout for such content.
3340
3341         PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
3342         With <br> support enabled:
3343           mean: 70.02391461289068 runs/s
3344           median: 70.47986488932318 runs/s
3345     
3346         While with <br> support disabled: 
3347           mean: 30.417295049468184 runs/s
3348           median: 30.36517778760357 runs/s
3349
3350         Reviewed by Antti Koivisto.
3351
3352         Test: fast/text/simple-line-with-br.html
3353
3354         * editing/TextIterator.cpp:
3355         (WebCore::TextIterator::handleTextNode):
3356         * rendering/RenderBlock.h:
3357         * rendering/RenderBlockFlow.cpp:
3358         (WebCore::RenderBlockFlow::setSelectionState):
3359         (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
3360         * rendering/RenderBlockFlow.h:
3361         * rendering/RenderLineBreak.cpp:
3362         (WebCore::simpleLineLayout):
3363         (WebCore::ensureLineBoxes):
3364         (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
3365         (WebCore::RenderLineBreak::positionForPoint):
3366         (WebCore::RenderLineBreak::setSelectionState):
3367         (WebCore::RenderLineBreak::linesBoundingBox):
3368         (WebCore::RenderLineBreak::absoluteRects):
3369         (WebCore::RenderLineBreak::absoluteQuads):
3370         (WebCore::RenderLineBreak::collectSelectionRects):
3371         * rendering/RenderLineBreak.h:
3372         * rendering/SimpleLineLayout.cpp:
3373         (WebCore::SimpleLineLayout::canUseFor):
3374         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3375         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
3376         (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
3377         (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
3378         (WebCore::SimpleLineLayout::firstFragment):
3379         (WebCore::SimpleLineLayout::forceFragmentToLine):
3380         (WebCore::SimpleLineLayout::createLineRuns):
3381         (WebCore::SimpleLineLayout::create):
3382         * rendering/SimpleLineLayoutFlowContents.cpp:
3383         (WebCore::SimpleLineLayout::initializeSegments):
3384         (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
3385         * rendering/SimpleLineLayoutFlowContents.h:
3386         * rendering/SimpleLineLayoutFunctions.cpp:
3387         (WebCore::SimpleLineLayout::paintFlow):
3388         (WebCore::SimpleLineLayout::hitTestFlow):
3389         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
3390         * rendering/SimpleLineLayoutResolver.cpp:
3391         (WebCore::SimpleLineLayout::RunResolver::Run::rect):
3392         (WebCore::SimpleLineLayout::RunResolver::RunResolver):
3393         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
3394         * rendering/SimpleLineLayoutResolver.h:
3395         (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
3396         (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
3397         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3398         (WebCore::SimpleLineLayout::EndOfSegmentSetter::EndOfSegmentSetter):
3399         (WebCore::SimpleLineLayout::EndOfSegmentSetter::~EndOfSegmentSetter):
3400         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
3401         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
3402         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
3403         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3404         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
3405         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
3406         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
3407         (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
3408         (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
3409         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
3410
3411 2015-04-08  Philippe Normand  <pnormand@igalia.com>
3412
3413         [GStreamer] compress property for the HTTP source element
3414         https://bugs.webkit.org/show_bug.cgi?id=143518
3415
3416         Reviewed by Carlos Garcia Campos.
3417
3418         Added a compress property so the default behavior or not
3419         requesting content encoded to the server can be overridden if
3420         needed. This is useful for adaptive streaming playback.
3421
3422         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3423         (webKitWebSrcSetProperty):
3424         (webKitWebSrcGetProperty):
3425         (webKitWebSrcStart):
3426
3427 2015-04-08  Joonghun Park  <jh718.park@samsung.com>
3428
3429         Remove CSS functions min() and max() which had been dropped from specification
3430         https://bugs.webkit.org/show_bug.cgi?id=143440
3431
3432         Reviewed by Darin Adler.
3433
3434         No new tests, No Behavior changes.
3435
3436         * css/CSSCalculationValue.cpp:
3437         (WebCore::CSSCalcValue::create):
3438         * css/CSSParser.cpp:
3439         (WebCore::CSSParser::isCalculation):
3440
3441 2015-04-07  Philippe Normand  <pnormand@igalia.com>
3442
3443         [GStreamer] extra-headers and keep-alive properties for HTTP source element
3444         https://bugs.webkit.org/show_bug.cgi?id=143480
3445
3446         Reviewed by Carlos Garcia Campos.
3447
3448         Keep the resource loader around when persistent HTTP connection
3449         support is enabled. The keep-alive property is set to false by
3450         default. Also before sending the HTTP request we now check the
3451         contents of the extra-headers GstStructure and set additional
3452         headers based on the structure contents.
3453
3454         Patch inspired by GStreamer's souphttpsrc element.
3455
3456         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3457         (webkit_web_src_init):
3458         (webKitWebSrcFinalize):
3459         (webKitWebSrcSetProperty):
3460         (webKitWebSrcGetProperty):
3461         (webKitWebSrcStop): Clear resource loader only for non-persistent connections.
3462         (webKitWebSrcSetExtraHeader): Utility function to append headers
3463         to an existing request based on a GValue contents.
3464         (webKitWebSrcProcessExtraHeaders): Parse a GValue and set headers
3465         based on its contents.
3466         (webKitWebSrcStart): Extra headers and persistent connection
3467         support. The resource loader is now lazily initialized here.
3468
3469 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
3470
3471         Fix the build.
3472
3473         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3474         (WebCore::FontCascade::drawGlyphs):
3475         * platform/spi/cg/CoreGraphicsSPI.h:
3476
3477 2015-04-07  Chris Dumez  <cdumez@apple.com>
3478
3479         Unreviewed, another iOS build fix after r182516.
3480
3481         I missed another use of __MAC_OS_X_VERSION_MIN_REQUIRED without a
3482         PLATFORM(MAC) check.
3483
3484         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3485
3486 2015-04-07  Michael Peechatt  <mpeechatt@gmail.com>
3487
3488         Bug 142887 - role progress bar does not support indeterminate state
3489         https://bugs.webkit.org/show_bug.cgi?id=142887
3490
3491         Reviewed by Chris Fleizach.
3492
3493         Test: platform/mac/accessibility/progressbar-indeterminate.html
3494
3495         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3496         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3497         When getting min or max value of an indeterminate progress indicator, return 0.
3498         This is so VoiceOver will recognize it as indeterminate.
3499
3500 2015-04-07  Chris Dumez  <cdumez@apple.com>
3501
3502         Unreviewed, speculative iOS build fix after r182516.
3503
3504         Add #if PLATFORM(MAC) checks.
3505
3506         * platform/spi/cg/CoreGraphicsSPI.h:
3507
3508 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
3509
3510         Try to fix incremental builds by forcing *InternalSettings* to get
3511         regenerated.
3512
3513         * testing/InternalSettings.idl:
3514
3515 2015-04-07  Chris Dumez  <cdumez@apple.com>
3516
3517         Open WebSockets should not prevent a page from entering PageCache
3518         https://bugs.webkit.org/show_bug.cgi?id=143505
3519         <rdar://problem/19923085>
3520
3521         Reviewed by Alexey Proskuryakov.
3522
3523         Open WebSockets should not prevent a page from entering PageCache. This
3524         is currently causing mobile.nytimes.com to not be page-cacheable.
3525
3526         In this patch, We close open WebSockets when entering the page cache
3527         and fire the "close" events after resuming, similarly to what we did
3528         for XMLHttpRequest in r181480. This gives a chance for the content to
3529         handle the 'close' event (with wasClean being false and code being
3530         1006) in order to reopen the connection if necessary.
3531
3532         Test: http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
3533
3534         * Modules/websockets/WebSocket.cpp:
3535         (WebCore::WebSocket::WebSocket):
3536         (WebCore::WebSocket::canSuspend):
3537         (WebCore::WebSocket::suspend):
3538         (WebCore::WebSocket::resume):
3539         (WebCore::WebSocket::resumeTimerFired):
3540         (WebCore::WebSocket::didClose):
3541         * Modules/websockets/WebSocket.h:
3542
3543 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
3544
3545         Add experimental code to use custom font dilation when rendering into non-opaque contexts
3546         https://bugs.webkit.org/show_bug.cgi?id=143508
3547
3548         Reviewed by Sam Weinig.
3549
3550         Add GraphicsContext::setAntialiasedFontDilationEnabled(), and set it to true
3551         when rendering into a compositing layer which is not opaque (at the same location
3552         where we disable font smoothing).
3553
3554         If Settings::antialiasedFontDilationEnabled() is true, when rendering non-smoothed
3555         text (and if CSS hasn't opted into antialiased mode), use custom font dilation
3556         parameters, chosen using a light/medium/dark heuristic, to make this text
3557         match more closely with LCD-smoothed text.
3558
3559         * page/Settings.cpp:
3560         (WebCore::Settings::Settings):
3561         (WebCore::Settings::setAntialiasedFontDilationEnabled): Set global state
3562         in FontCascade (which can't easily get at Settings). This it not ideal,
3563         but is temporary.
3564         * page/Settings.h:
3565         (WebCore::Settings::antialiasedFontDilationEnabled):
3566         * page/Settings.in: Can't autogenerate this setting any more.
3567         * platform/graphics/FontCascade.cpp:
3568         (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Set the global.
3569         (WebCore::FontCascade::antialiasedFontDilationEnabled):
3570         * platform/graphics/FontCascade.h:
3571         * platform/graphics/GraphicsContext.cpp:
3572         (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Set graphics state
3573         to say that we should do dilation of antialiased text.
3574         * platform/graphics/GraphicsContext.h:
3575         (WebCore::GraphicsContextState::GraphicsContextState):
3576         (WebCore::GraphicsContext::antialiasedFontDilationEnabled):
3577         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3578         (PlatformCALayer::drawLayerContents): If the layer is not opaque, enable the
3579         dilated text code path.
3580         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3581         (WebCore::dilationSizeForTextColor): Heuristic (values chosen empirically) to
3582         computed custom dilation based on foreground color.
3583         (WebCore::FontCascade::drawGlyphs): Set the custom dilation parameters, and the
3584         antialiasing state if we're not doing smoothing, and CSS hasn't opted into the
3585         antialiased path.
3586         * platform/spi/cg/CoreGraphicsSPI.h: New SPI.
3587
3588 2015-04-07  Commit Queue  <commit-queue@webkit.org>
3589
3590         Unreviewed, rolling out r182511.
3591         https://bugs.webkit.org/show_bug.cgi?id=143507
3592
3593         caused debug test failures (Requested by alexchristensen on
3594         #webkit).
3595
3596         Reverted changeset:
3597
3598         "Block popups from content extensions."
3599         https://bugs.webkit.org/show_bug.cgi?id=143497
3600         http://trac.webkit.org/changeset/182511
3601
3602 2015-04-07  Myles C. Maxfield  <mmaxfield@apple.com>
3603
3604         [Cocoa] System fonts do not get correct tracking
3605         https://bugs.webkit.org/show_bug.cgi?id=143395
3606
3607         Reviewed by Ryosuke Niwa.
3608
3609         Inside FontPlatformData, we have two CTFonts. If the user has specified
3610         -webkit-system-font, we will pass in a CTFont, and the FontPlatformData
3611         will wrap it. However, we will then roundtrip through CGFont in order
3612         to create a second CTFont. We were basing our tracking and system
3613         font knowledge off of this round-tripped font instead of the original font.
3614
3615         Note that this design is terrible and needs to be overhauled.
3616         FontPlatformData should only have a single platform font inside it.
3617
3618         This patch also caches whether or not a font is a system font.
3619
3620         No new tests because it is impossible to test the tracking of the
3621         system font in a robust way.
3622
3623         * platform/graphics/Font.cpp:
3624         (WebCore::Font::Font): Rearrange member variables.
3625         * platform/graphics/Font.h: Move member variables around for better
3626         packing, and cache whether or not the font is a system font.
3627         * platform/graphics/FontData.h: Add comment
3628         * platform/graphics/cocoa/FontCocoa.mm:
3629         (WebCore::Font::platformInit): Cache whether or not the font is a system
3630         font.
3631         (WebCore::hasCustomTracking): Use cached value.
3632         (WebCore::canUseFastGlyphAdvanceGetter):
3633         (WebCore::Font::platformWidthForGlyph):
3634
3635 2015-04-07  Alex Christensen  <achristensen@webkit.org>
3636
3637         Block popups from content extensions.
3638         https://bugs.webkit.org/show_bug.cgi?id=143497
3639
3640         Reviewed by Brady Eidson.
3641
3642         Test: http/tests/contentextensions/popups.html
3643
3644         * loader/ResourceLoadInfo.cpp:
3645         (WebCore::readResourceType):
3646         * loader/ResourceLoadInfo.h:
3647         * page/DOMWindow.cpp:
3648         (WebCore::DOMWindow::open):
3649         * page/UserContentController.cpp:
3650         (WebCore::UserContentController::actionsForResourceLoad):
3651         * page/UserContentController.h:
3652         Check content extensions before opening a window.
3653
3654 2015-04-07  Benjamin Poulain  <benjamin@webkit.org>
3655
3656         Get the features.json files ready for open contributions
3657         https://bugs.webkit.org/show_bug.cgi?id=143436
3658
3659         Reviewed by Darin Adler.
3660
3661         * features.json:
3662
3663 2015-04-07  Alex Christensen  <achristensen@webkit.org>
3664
3665         More unreviewed fixing API tests.
3666
3667         * contentextensions/ContentExtensionsBackend.cpp:
3668         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3669         Don't check for javascript protocol.
3670
3671 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
3672
3673         [Mac] never update caption user style sheet during parsing
3674         https://bugs.webkit.org/show_bug.cgi?id=143499
3675
3676         Reviewed by Jer Noble.
3677
3678         * page/CaptionUserPreferencesMediaAF.cpp:
3679         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
3680         (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):  Ignore a
3681             "preferences changed" notification fired while registering for said notification, we 
3682             already create and insert the style sheet after a brief delay anyway.
3683         * page/CaptionUserPreferencesMediaAF.h:
3684
3685 2015-04-07  Alex Christensen  <achristensen@webkit.org>
3686
3687         [Win] Unreviewed build fix after r182494.
3688
3689         * platform/win/ContextMenuItemWin.cpp:
3690         (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
3691
3692 2015-04-07  Alex Christensen  <achristensen@webkit.org>
3693
3694         Unreviewed fixing API tests.
3695
3696         * contentextensions/ContentExtensionsBackend.cpp:
3697         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3698         * platform/URL.cpp:
3699         (WebCore::URL::init):
3700         * platform/URL.h:
3701         (WebCore::URL::protocolIsData):
3702         (WebCore::URL::protocolIsJavaScript): Deleted.
3703         Revert part of r182492 that changed URL.h.
3704
3705 2015-04-07  Anders Carlsson  <andersca@apple.com>
3706
3707         More work on making the application cache storage be per page
3708         https://bugs.webkit.org/show_bug.cgi?id=143498
3709
3710         Reviewed by Andreas Kling.
3711
3712         * loader/appcache/ApplicationCacheStorage.cpp:
3713         (WebCore::ApplicationCacheStorage::create):
3714         (WebCore::ApplicationCacheStorage::singleton):
3715         * loader/appcache/ApplicationCacheStorage.h:
3716         * page/Page.cpp:
3717         (WebCore::Page::Page):
3718         * page/Page.h:
3719         (WebCore::Page::applicationCacheStorage):
3720         * page/PageConfiguration.cpp:
3721         (WebCore::PageConfiguration::PageConfiguration): Deleted.
3722         * page/PageConfiguration.h:
3723
3724 2015-04-07  Matthew Mirman  <mmirman@apple.com>
3725
3726         Source and stack information should get appended only to native errors
3727         and should be added directly after construction rather than when thrown.
3728         This fixes frozen objects being unfrozen when thrown while conforming to 
3729         ecma script standard and other browser behavior.
3730         rdar://problem/19927293
3731         https://bugs.webkit.org/show_bug.cgi?id=141871
3732         
3733         Reviewed by Geoffrey Garen.
3734
3735         Covered by existing tests.
3736         
3737         Sets line, column, source and stack information for DOMExceptions as 
3738         expected by the webinspector for native errors.
3739         
3740         * bindings/js/JSDOMBinding.cpp:
3741         (WebCore::setDOMException):
3742
3743 2015-04-07  Brady Eidson  <beidson@apple.com>
3744
3745         ContextMenuItem refactoring
3746         https://bugs.webkit.org/show_bug.cgi?id=143485
3747
3748         Reviewed by Beth Dakin.
3749
3750         * platform/ContextMenuItem.h:
3751         (WebCore::ContextMenuItem::isNull):
3752
3753         * platform/gtk/ContextMenuItemGtk.cpp:
3754         (WebCore::ContextMenuItem::ContextMenuItem):
3755
3756         * platform/mac/ContextMenuItemMac.mm:
3757         (WebCore::ContextMenuItem::ContextMenuItem):
3758         (WebCore::ContextMenuItem::platformDescription):
3759         (WebCore::ContextMenuItem::setSubMenu):
3760         (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
3761         (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
3762
3763         * platform/mac/ContextMenuMac.mm:
3764         (WebCore::ContextMenu::appendItem):
3765         (WebCore::ContextMenu::insertItem):
3766         (WebCore::platformMenuDescription):
3767
3768         * platform/win/ContextMenuItemWin.cpp:
3769         (WebCore::ContextMenuItem::ContextMenuItem):
3770
3771 2015-04-07  Alex Christensen  <achristensen@webkit.org>
3772
3773         Optimize content extensions interpreting speed.
3774         https://bugs.webkit.org/show_bug.cgi?id=143490
3775
3776         Reviewed by Brady Eidson.
3777
3778         * contentextensions/ContentExtensionCompiler.cpp:
3779         (WebCore::ContentExtensions::compileRuleList):
3780         * contentextensions/ContentExtensionsBackend.cpp:
3781         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
3782         Measure total time added by content extensions.
3783         * contentextensions/DFABytecodeCompiler.cpp:
3784         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
3785         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
3786         When jumping to the root, don't re-add all the actions.
3787         * contentextensions/DFABytecodeCompiler.h:
3788         * platform/URL.cpp:
3789         (WebCore::URL::init):
3790         * platform/URL.h:
3791         (WebCore::URL::protocolIsJavaScript): Added.
3792
3793 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
3794
3795         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
3796         https://bugs.webkit.org/show_bug.cgi?id=143495
3797
3798         Reviewed by Tim Horton.
3799
3800         Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This 
3801         will be used in an upcoming patch.
3802
3803         * page/Settings.in:
3804
3805 2015-04-07  Andy Estes  <aestes@apple.com>
3806
3807         [Content Filtering] Add logging
3808         https://bugs.webkit.org/show_bug.cgi?id=143470
3809
3810         Reviewed by Daniel Bates.
3811
3812         Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
3813
3814         * loader/ContentFilter.cpp:
3815         (WebCore::ContentFilter::~ContentFilter):
3816         (WebCore::ContentFilter::willSendRequest):
3817         (WebCore::ContentFilter::startFilteringMainResource):
3818         (WebCore::ContentFilter::responseReceived):
3819         (WebCore::ContentFilter::dataReceived):
3820         (WebCore::ContentFilter::notifyFinished):
3821         (WebCore::ContentFilter::didDecide):
3822         * platform/Logging.h:
3823         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3824         (WebCore::ContentFilterUnblockHandler::canHandleRequest):
3825         (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
3826         * platform/cocoa/NetworkExtensionContentFilter.mm:
3827         (WebCore::NetworkExtensionContentFilter::enabled):
3828         (WebCore::NetworkExtensionContentFilter::unblockHandler):
3829         (WebCore::NetworkExtensionContentFilter::handleDecision):
3830         * platform/cocoa/ParentalControlsContentFilter.mm:
3831         (WebCore::ParentalControlsContentFilter::enabled):
3832         (WebCore::ParentalControlsContentFilter::updateFilterState):
3833         * testing/MockContentFilter.cpp:
3834         (WebCore::MockContentFilter::enabled):
3835         (WebCore::MockContentFilter::unblockHandler):
3836         (WebCore::MockContentFilter::maybeDetermineStatus):
3837
3838 2015-04-07  Eric Carlson  <eric.carlson@apple.com>
3839
3840         [Mac] video playing to external device should not be interrupted
3841         https://bugs.webkit.org/show_bug.cgi?id=143492
3842
3843         Reviewed by Jer Noble.
3844
3845         * Modules/mediacontrols/mediaControlsApple.js:
3846         (Controller.prototype.handlePanelTransitionEnd):  Drive-by fix to make sure the controls are 
3847             not hidden if the opacity timer is primed before they go into a state where they should
3848             never be hidden.
3849
3850         * html/HTMLMediaElement.cpp:
3851         (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
3852         (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
3853         * html/HTMLMediaElement.h:
3854
3855         * html/HTMLMediaSession.cpp:
3856         (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
3857             client when we already know the answer.
3858         (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
3859         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
3860         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
3861         * html/HTMLMediaSession.h:
3862
3863         * platform/audio/MediaSession.cpp:
3864         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
3865             because only HTMLMediaSession needs to use them.
3866         (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
3867         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
3868         * platform/audio/MediaSession.h:
3869         (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
3870         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
3871         (WebCore::MediaSession::startPlayingToPlaybackTarget):
3872         (WebCore::MediaSession::stopPlayingToPlaybackTarget):
3873         (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
3874         (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
3875
3876         * platform/audio/MediaSessionManager.cpp:
3877         (WebCore::MediaSessionManager::MediaSessionManager):
3878         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
3879         (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
3880             playing to a target device.
3881         * platform/audio/MediaSessionManager.h:
3882
3883         * platform/graphics/MediaPlayer.cpp:
3884         (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
3885         * platform/graphics/MediaPlayer.h:
3886         * platform/graphics/MediaPlayerPrivate.h:
3887         (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
3888
3889         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3890         (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
3891         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3892         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call 
3893             when passed a nil or inactive target context.
3894         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
3895         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
3896         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
3897             true when playing with an active context.
3898         (WebCore::playerKVOProperties): "outputContext" is not observable.
3899
3900 2015-04-07  Sam Weinig  <sam@webkit.org>
3901
3902         Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
3903         make Xcode happy.
3904
3905         * WebCore.xcodeproj/project.pbxproj:
3906
3907 2015-02-25  Sergio Villar Senin  <svillar@igalia.com>
3908
3909         [CSS Grid Layout] Update track sizes after distributing extra space
3910         https://bugs.webkit.org/show_bug.cgi?id=141422
3911
3912         Reviewed by Antti Koivisto.
3913
3914         Both old and new tracks sizing algorithms instruct us to update
3915         the sizes of the content sized tracks only after distributing the
3916         extra space for all the items in the same span group. So far we
3917         were doing it inside distributeSpaceToTracks(), i.e., once for
3918         every single item. That is wrong because it makes the algorithm
3919         order dependent.
3920
3921         Our old implementation looked something like this (pseudocode):
3922
3923         resolveContentBasedTrackSizingFunctions()
3924           foreach item
3925             resolveContentBasedTrackSizingFunctionsForItems() (x4)
3926               distributeSpaceToTracks()
3927                 updateTrackSizes()
3928
3929         Now it's done this way (pseudocode):
3930
3931         resolveContentBasedTrackSizingFunctions()
3932           foreach spanGroup
3933             resolveContentBasedTrackSizingFunctionsForItems() (x4)
3934               foreach item in spanGroup
3935                 distributeSpaceToTracks()
3936               updateTrackSizes()
3937
3938         As it can be seen the update of track sizes only happens after
3939         processing all the items of a given span group. In order to
3940         accomplish this a new field was added to GridTrack called
3941         tempIncrease which stores per-track increases while distributing
3942         the extra space among the items in the same span group. That
3943         temporal increase could eventually be used to update the
3944         plannedIncrease which is the one we use to finally set the new
3945         size of the track.
3946
3947         This change makes our implementation closer to the spec, removes
3948         the order dependency and ensures that every track satisfies their
3949         min track sizing functions before starting to consider the max
3950         track sizing functions.
3951
3952         Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
3953
3954         * rendering/RenderGrid.cpp:
3955         (WebCore::GridTrack::plannedSize):
3956         (WebCore::GridTrack::setPlannedSize): New setter.
3957         (WebCore::GridTrack::tempSize): New attribute.
3958         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3959         RenderGrid::distributeSpaceToTracks() no longer updates the track
3960         sizes so we have to do it after the call returns.
3961         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3962         Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
3963         passing a span group instead of a single item.
3964         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
3965         It now receives a span group instead of a single item. Apart from
3966         that we need an extra function to get the unaltered track size (as
3967         the current one returns the base size whenever the growth limit is
3968         infinity).
3969         (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
3970         updates track sizes but only the track's planned size;
3971         * rendering/RenderGrid.h:
3972
3973 2015-04-06  Chris Dumez  <cdumez@apple.com>
3974
3975         Bing video search result pages are not PageCacheable
3976         https://bugs.webkit.org/show_bug.cgi?id=143463
3977         <rdar://problem/20440916>
3978
3979         Reviewed by Alexey Proskuryakov.
3980
3981         Bing video search result pages are not PageCacheable (tested on iOS).
3982         It both:
3983         - is bad for power usage as it causes a reload when clicking one of the
3984           results then navigating back in history.
3985         - degrades user experience because the results page uses infinite
3986           scrolling and the scroll position is not properly restored when
3987           navigating back, not to mention the user has to wait for the reload
3988           to complete.
3989
3990         The issue was that the bing search page was doing a ping load when
3991         clicking on one of the search results. The ping load was done by
3992         create an image and its 'src' attribute to the ping URL. This load
3993         usua