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