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