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