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