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