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