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