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