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