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