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