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