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