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