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