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