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