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