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