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