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