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