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