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