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