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