Log number of bytes reclaimed at each step of memory pressure relief.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-04-17  Andreas Kling  <akling@apple.com>
2
3         Log number of bytes reclaimed at each step of memory pressure relief.
4         <https://webkit.org/b/131751>
5
6         Reviewed by Antti Koivisto.
7
8         * platform/MemoryPressureHandler.h:
9         * platform/MemoryPressureHandler.cpp:
10         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
11         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
12         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
13         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
14         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
15         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformMemoryUsage):
16         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformLog):
17
18             Add a simple RAII helper to check memory usage before and after
19             a block of code, and then dump the delta to system log.
20
21         (WebCore::MemoryPressureHandler::releaseMemory):
22         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
23         (WebCore::MemoryPressureHandler::platformReleaseMemory):
24
25             Use ReliefLogger to annotate the various attempts to reduce
26             our memory footprint. This will help us understand the efficiency
27             of our current strategy.
28
29 2014-04-17  David Hyatt  <hyatt@apple.com>
30
31         [New Multicolumn] columnNumberForOffset is not patched for new multicolumn code yet.
32         https://bugs.webkit.org/show_bug.cgi?id=131740
33
34         Reviewed by Enrica Casucci.
35         
36         I took the opportunity to clean this code up while adding support for the new columns.
37         columnNumberForOffset only applied for paginated RenderViews and was really about
38         pages and not columns. It also only returns an actual page number if the columns are
39         block progressed (e.g., right-to-left vertical Japanese books).
40         
41         Therefore I renamed columnNumberForOffset to pageNumberForBlockProgressionOffset and
42         moved it to RenderView.
43         
44         I also renamed the member variable of SelectionRect to be pageNumber instead of
45         columnNumber in order to make it more obvious that this isn't about columns per se
46         (since the fact that we implemented RenderView's pagination mode using columns is an
47         implementation detail).
48
49         * dom/Range.cpp:
50         (WebCore::coalesceSelectionRects):
51         (WebCore::Range::collectSelectionRects):
52         * platform/ios/SelectionRect.h:
53         (WebCore::SelectionRect::pageNumber):
54         (WebCore::SelectionRect::columnNumber): Deleted.
55         * rendering/RenderImage.cpp:
56         (WebCore::RenderImage::collectSelectionRects):
57         * rendering/RenderObject.cpp:
58         (WebCore::RenderObject::collectSelectionRects):
59         (WebCore::RenderObject::columnNumberForOffset): Deleted.
60         * rendering/RenderObject.h:
61         * rendering/RenderText.cpp:
62         (WebCore::RenderText::collectSelectionRects):
63         * rendering/RenderView.cpp:
64         (WebCore::RenderView::pageNumberForBlockProgressionOffset):
65         * rendering/RenderView.h:
66
67 2014-04-16  Brent Fulgham  <bfulgham@apple.com>
68
69         [Win] A few final cleanups to the DataObject classes.
70         https://bugs.webkit.org/show_bug.cgi?id=131784
71
72         Reviewed by Anders Carlsson.
73
74         * platform/win/WCDataObject.cpp:
75         (WebCore::WCDataObject::clearData): Use 'last()' method.
76
77 2014-04-15  Jer Noble  <jer.noble@apple.com>
78
79         Fullscreen media controls are unusable in pagination mode
80         https://bugs.webkit.org/show_bug.cgi?id=131705
81
82         Reviewed by Darin Adler.
83
84         When pagination mode is enabled, the full screen media will (depending on the width of the
85         pagination columns) overflow its column, and hit testing will be clipped to the column. In extreme
86         cases, where the column width < 0.5 * media element width, the media controls will be entirely
87         unclickable.
88
89         Rather than making the RenderFullScreen a child of the full screen element's parent's renderer,
90         make it a child of the RenderView, putting it outside of the columns entirely. Always create and
91         insert the fullscreenRenderer's placeholder, using it as the remembered insertion point for the
92         fullscreen element's renderer when we exit full screen.
93
94         Drive-by fix: don't wrap the full screen element's renderer in webkitWillEnterFullScreenForElement();
95         it will just be re-wrapped in createRendererIfNeeded().
96
97         * dom/Document.cpp:
98         (WebCore::Document::webkitWillEnterFullScreenForElement): Don't wrap the full screen element's renderer.
99         (WebCore::Document::setFullScreenRenderer): Call setPlaceholderStyle.
100         * rendering/RenderFullScreen.cpp:
101         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Call clearPlaceholder.
102         (WebCore::RenderFullScreen::wrapRenderer): Make fullscreenRenderer a child of the view().
103         (WebCore::RenderFullScreen::unwrapRenderer): Return the children to the parent of the placeholder().
104         (WebCore::RenderFullScreen::clearPlaceholder): Renamed from setPlaceholder().
105         (WebCore::RenderFullScreen::ensurePlaceholder): Added. 
106         (WebCore::RenderFullScreen::setPlaceholderStyle): Renamed from createPlaceholder().
107         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
108         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
109         * rendering/RenderFullScreen.h:
110
111 2014-04-16  Jer Noble  <jer.noble@apple.com>
112
113         [MSE] Multiple initialization segments with same codecs in tracks fail validation.
114         https://bugs.webkit.org/show_bug.cgi?id=131768
115
116         Additional initialization segments added to the same SourceBuffer with the same
117         codec values will fail validation. Update the validation check to add the correct
118         codec information for the initial segment, and check against the correct codecs during
119         the validation step.
120
121         Additionally, after validation, if successful update the Audio, Video, and TextTracks
122         for the SourceBuffer with the updated initialization segment information.
123
124         Reviewed by Eric Carlson.
125
126         Test: media/media-source/media-source-multiple-initialization-segments.html
127
128         * Modules/mediasource/SourceBuffer.cpp:
129         (WebCore::SourceBuffer::appendBufferTimerFired): m_source may have been cleared
130             as a result of the append, so check it before using.
131         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Call streamEndedWithError
132             instead of endOfStream as the latter is safe to call within an update.
133         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto.
134             Update the track lists if validation succeeds.
135         (WebCore::SourceBuffer::validateInitializationSegment): Switch the audio and video
136             codec checks.
137
138         Add the ability for Audio, Video, and InbandTextTracks to replace their private tracks:
139         * html/track/AudioTrack.cpp:
140         (WebCore::AudioTrack::AudioTrack): Call updateKindFromPrivate().
141         (WebCore::AudioTrack::setPrivate):
142         (WebCore::AudioTrack::updateKindFromPrivate): Split out from constructor.
143         * html/track/AudioTrack.h:
144         * html/track/InbandTextTrack.cpp:
145         (WebCore::InbandTextTrack::InbandTextTrack): Call updateKindFromPrivate().
146         (WebCore::InbandTextTrack::setPrivate):
147         (WebCore::InbandTextTrack::setMode): Split up into setModeInternal().
148         (WebCore::InbandTextTrack::setModeInternal): Broke out from setMode().
149         (WebCore::InbandTextTrack::updateKindFromPrivate): Split out from constructor.
150         * html/track/InbandTextTrack.h:
151         * html/track/TextTrack.h:
152         (WebCore::TextTrack::isInband): Added, returns false.
153         * html/track/VideoTrack.cpp:
154         (WebCore::VideoTrack::VideoTrack): Call updateKindFromPrivate().
155         (WebCore::VideoTrack::setPrivate):
156         (WebCore::VideoTrack::updateKindFromPrivate):  Split out from constructor.
157         * html/track/VideoTrack.h:
158
159 2014-04-17  David Hyatt  <hyatt@apple.com>
160
161         [New Multicolumn] Column sets below spanners don't repaint properly.
162         https://bugs.webkit.org/show_bug.cgi?id=131778
163
164         Reviewed by Beth Dakin.
165
166         Added fast/repaint/spanner-with-margins.html.
167
168         * rendering/RenderBox.cpp:
169         (WebCore::RenderBox::computeRectForRepaint):
170         Turn off some code that was running for in-flow RenderFlowThreads that made no sense.
171         I'm not convinced the code is right for other types of RenderFlowThreads either,
172         but will leave that to the named flow thread experts. :)
173
174 2014-04-17  Koji Ishii  <kojishi@gmail.com>
175
176         Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
177         https://bugs.webkit.org/show_bug.cgi?id=131175
178
179         Reviewed by Darin Adler.
180
181         Tests: html5lib/resources/ruby.dat
182                html5lib/resources/tests19.dat
183
184         This patch makes WebKit HTML parser to match to the tag omission rules of HTML5 CR Feb 2014:
185         http://www.w3.org/TR/2014/CR-html5-20140204/syntax.html#syntax-tag-omission
186         with the support for two new elements (rb, rtc) which were also defined in the spec:
187         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rb-element
188         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rtc-element
189         to better support use cases presented by W3C I18N WG:
190         http://www.w3.org/TR/ruby-use-cases/
191
192         * html/HTMLTagNames.in: rb and rtc added as HTMLElement interfaces.
193         * html/parser/HTMLConstructionSite.cpp:
194         (WebCore::hasImpliedEndTag): the spec says rb and rtc have implied end tags.
195         * html/parser/HTMLTreeBuilder.cpp:
196         (WebCore::HTMLTreeBuilder::processStartTagForInBody): rb and rtc added. rt excludes rtc from its implied end tags.
197
198 2014-04-17  Darin Adler  <darin@apple.com>
199
200         Try to fix EFL and GTK builds.
201
202         * workers/WorkerGlobalScope.idl: Touch file to make it rebuild, assuming that
203         module dependencies aren't working right with CMake. Tweaked formatting quite a
204         bit while I was in here.
205
206 2014-04-17  David Hyatt  <hyatt@apple.com>
207
208         [New Multicolumn] REGRESSION: Column set styles don't update when zooming etc.
209         https://bugs.webkit.org/show_bug.cgi?id=131777
210
211         Reviewed by Enrica Casucci.
212
213         Added fast/multicol/zoom-test.html
214
215         * rendering/RenderBlockFlow.cpp:
216         (WebCore::RenderBlockFlow::styleDidChange):
217         Put back in the code that propagates new styles to the flow thread and column sets
218         when styles change. This propagation was removed when the column span code landed.
219         This patch puts it back in but qualifies the types of objects that get styles
220         propagated to avoid accidentally propagating the wrong style to column spans.
221
222 2014-04-17  Darin Adler  <darin@apple.com>
223
224         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
225         https://bugs.webkit.org/show_bug.cgi?id=131785
226         rdar://problem/16003108
227
228         Reviewed by Brady Eidson.
229
230         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
231
232         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: Use the new conditional
233         instead of the old one.
234         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: Ditto.
235         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Ditto.
236
237 2014-04-17  Dan Bernstein  <mitz@apple.com>
238
239         WebCore part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
240         https://bugs.webkit.org/show_bug.cgi?id=131783
241
242         Reviewed by Tim Horton.
243
244         * loader/NavigationAction.cpp:
245         (WebCore::NavigationAction::NavigationAction): Initialize m_processingUserGesture to
246         ScriptController::processingUserGesture() at the time the NavigationAction is constructed.
247         * loader/NavigationAction.h:
248         Added boolean member variable m_processionUserGesture
249         (WebCore::NavigationAction::processingUserGesture): Added this getter.
250
251 2014-04-17  Ion Rosca  <rosca@adobe.com>
252
253         [CSS Blending] Isolation descendant dependent flags are not updated correctly
254         https://bugs.webkit.org/show_bug.cgi?id=130892
255
256         Reviewed by Dean Jackson.
257
258         The isolation descendant dependent flag (m_hasUnisolatedBlendingDescendants)
259         will help us to determine if a layer should isolate blending descendants or not.
260         The m_hasUnisolatedBlendingDescendants flag should be set for layers that have blending descendant layers
261         not isolated by descendant stacking contexts.
262         An element isolatesBlending() if it has this flag set and creates stacking context.
263
264         Tests: css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html
265                css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html
266                css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html
267                css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html
268                css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html
269                css3/compositing/blend-mode-isolation-flags-turn-off-blending.html
270                css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html
271                css3/compositing/blend-mode-isolation-flags-turn-on-blending.html
272                css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html
273
274         * rendering/RenderLayer.cpp:
275         (WebCore::RenderLayer::RenderLayer):
276         (WebCore::RenderLayer::updateBlendMode):
277         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
278             When a layer has blending and it hasn't had it before, we set the isolation
279         flag for all its ancestors up to the first layer creating stacking context.
280         I removed the isComposited() check here. Isolation flags should be correct regardless
281         of compositing state. Moreover, if this method is called from styleChanged(),
282         the compositing state might not be accurate, it's going to be recalculated afterwards.  
283         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
284             When a layer doesn't have blending, but it used to have it before, we mark
285         the isolation flag as dirty for all its ancestors up to the first layer
286         creating stacking context. The isolation flags will be recalculated by
287         RenderLayer::updateDescendantDependentFlags.
288         (WebCore::RenderLayer::updateDescendantDependentFlags):
289             Evaluates if the layer has unisolated blending descendants by traversing
290         the layer subtree.
291         (WebCore::RenderLayer::addChild):
292             When adding a subtree that has blending or has some unisolated descendants,
293         we set the flag for all the ancestors, up to the stacking context layer.
294         (WebCore::RenderLayer::removeChild):
295             When removing a subtree that had blending or had some unisolated descendants,
296         we dirty the flag so that it could be reevaluated.
297         (WebCore::RenderLayer::calculateClipRects):
298         (WebCore::RenderLayer::updateTransform):
299         * rendering/RenderLayer.h:
300             Rename m_hasBlendedElementInChildStackingContext => m_hasUnisolatedBlendingDescendants
301         and m_hasBlendedElementInChildStackingContextStatusDirty => m_hasUnisolatedBlendingDescendantsStatusDirty,
302         * rendering/RenderLayerCompositor.cpp:
303         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
304             Add an assert to make sure that if m_hasUnisolatedCompositedBlendingDescendants is true,
305         then m_hasUnisolatedBlendingDescendants is true as well.
306
307 2014-04-17  Tim Horton  <timothy_horton@apple.com>
308
309         Uninline blend(Color, Color) to get AnimationUtilities out of Color.h
310         https://bugs.webkit.org/show_bug.cgi?id=131781
311
312         Reviewed by Simon Fraser.
313
314         * platform/graphics/Color.cpp:
315         (WebCore::blend):
316         Un-inline.
317
318         * platform/graphics/Color.h:
319         No more AnimationUtilities.
320
321 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
322
323         Fix the build after r167412
324
325         * platform/ScrollView.cpp:
326         (WebCore::ScrollView::updateScrollbars):
327
328 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
329
330         [iOS][WK2] Fix annoying scrolling bugs
331         https://bugs.webkit.org/show_bug.cgi?id=131722
332
333         Reviewed by Simon Fraser.
334
335         * platform/ScrollView.cpp:
336         (WebCore::ScrollView::updateScrollbars):
337         Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
338         keep changing the scroll position to incorrect values.
339
340         On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
341         the code does not run because there is a platformWidget().
342
343         Just #ifdef the whole useless code.
344
345 2014-04-16  Alexandru Chiculita  <achicu@adobe.com>
346
347         Improve performance of the RenderLayerCompositor::OverlapMap
348         https://bugs.webkit.org/show_bug.cgi?id=115063
349
350         Reviewed by Simon Fraser.
351
352         No new tests, no new functionality or behavior.
353
354         Do not use the OverlapMap in RenderLayerCompositor::computeCompositingRequirements if the layer already
355         has a 3D transform. This way we can avoid a potential expensive lookups when we know for sure the layer
356         is already supposed to be composited. 
357
358         Also, added a bounding box of the overlap map, so that it can catch cases when the new layer is not overlapping
359         any of the previous layers. This is pretty common when having composited layers laid out in a vertical/horizontal list.
360
361
362         * rendering/RenderLayerCompositor.cpp:
363         (OverlapMapContainer):
364         (WebCore::OverlapMapContainer::add):
365         (WebCore::OverlapMapContainer::overlapsLayers):
366         (WebCore::OverlapMapContainer::unite):
367         (WebCore):
368         (WebCore::RenderLayerCompositor::OverlapMap::add):
369         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
370         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer):
371         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer):
372         (RenderLayerCompositor::OverlapMap):
373         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
374
375 2014-04-16  Brian J. Burg  <burg@cs.washington.edu>
376
377         Web Replay: memoize fallback time values for document.lastModified
378         https://bugs.webkit.org/show_bug.cgi?id=131318
379
380         Reviewed by Joseph Pecoraro.
381
382         If a document's Last-Modified header can't be found or used, then 
383         document.lastModified is derived from the current system time or
384         from filesystem data, which is obviously nondeterministic.
385
386         It's better to handle this inside Document::lastModified rather than using
387         MemoizedDOMResult, because only the fallback case is nondeterministic.
388
389         Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
390
391         The test is skipped for now, as it will be very flaky without the
392         functionality introduced by bugs 130728 and 129391.
393
394         * dom/Document.cpp:
395         (WebCore::Document::lastModified): Save or reuse memoized fallback value.
396         * replay/WebInputs.json: Add input DocumentLastModifiedDate.
397
398 2014-04-16  David Hyatt  <hyatt@apple.com>
399
400         [New Multicolumn] Selection gets confused when the mouse is in the column gaps.
401         https://bugs.webkit.org/show_bug.cgi?id=131739
402
403         Reviewed by Enrica Casucci.
404
405         * rendering/RenderBlock.cpp:
406         (WebCore::RenderBlock::selectionGaps):
407         Make sure not to paint selection gaps. This matches the old multi-column behavior. Even though
408         selection gaps *nearly* work with the new multi-column code, I am disabling them so that we
409         can turn them on without visual regressions.
410         
411         (WebCore::isChildHitTestCandidate):
412         Don't allow in-flow RenderFlowThreads to be descended into from positionForPoint. We always want
413         to look only at the spanners and at the sets.
414
415         * rendering/RenderMultiColumnFlowThread.cpp:
416         (WebCore::RenderMultiColumnFlowThread::nodeAtPoint):
417         * rendering/RenderMultiColumnFlowThread.h:
418         Override nodeAtPoint to disallow the RenderMultiColumnFlowThread from being considered for hit
419         testing when no DOM node is found. It's better to just let RenderBlock's positionForPoint run
420         to drill back down into the appropriate column set.
421
422         * rendering/RenderMultiColumnSet.cpp:
423         (WebCore::RenderMultiColumnSet::positionForPoint):
424         Implement positionForPoint for RenderMultiColumnSets. This is a straight-up port of the
425         old multi-column code's adjustPointToColumnContents function.
426
427         * rendering/RenderMultiColumnSet.h:
428         Add override of positionForPoint.
429
430 2014-04-16  Dean Jackson  <dino@apple.com>
431
432         MediaDocument on iOS should be full page
433         https://bugs.webkit.org/show_bug.cgi?id=131774
434
435         Reviewed by Jer Noble.
436
437         A MediaDocument on iOS has two problems. It can't rely
438         on intrinsic size, since it doesn't load the content until
439         a user gesture. Secondly, on a small screen you want the
440         media to fill the page.
441
442         Add width/height 100% for iOS documents.
443
444         Test: platform/iphone-simulator/media/media-document-controls-size.html
445
446         * html/MediaDocument.cpp:
447         (WebCore::MediaDocumentParser::createDocumentStructure):
448
449 2014-04-16  Roger Fong  <roger_fong@apple.com>
450
451         Add a way for layout tests to determine whether or not a plugin is snapshotted.
452         https://bugs.webkit.org/show_bug.cgi?id=131650.
453         <rdar://problem/16615528>
454
455         Reviewed by Dean Jackson.
456
457         * testing/Internals.cpp:
458         (WebCore::Internals::isPluginSnapshotted):
459         * testing/Internals.h:
460         * testing/Internals.idl:
461
462 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
463
464         Vanish unnecessary includes from Shapes.{h|cpp}
465         https://bugs.webkit.org/show_bug.cgi?id=131762
466
467         Reviewed by Andreas Kling.
468
469         No new tests, no behavior change.
470
471         * rendering/shapes/BoxShape.h:
472         * rendering/shapes/Shape.cpp:
473         * rendering/shapes/Shape.h:
474         * rendering/shapes/ShapeOutsideInfo.h:
475
476 2014-04-16  Andreas Kling  <akling@apple.com>
477
478         Revert direct caching of tagName and nodeName from r167383.
479
480         Ryosuke tells me this is not entirely safe, will need to rethink.
481
482         * dom/Element.idl:
483         * dom/Node.idl:
484
485 2014-04-16  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
486
487         Improve security mitigation added in webkit r94001.
488         We missed the case where attachLine was called when we already had an inline box wrapper.
489         https://bugs.webkit.org/show_bug.cgi?id=127285
490
491         Reviewed by Brent Fulgham.
492
493         Merged from Blink: https://src.chromium.org/viewvc/blink?revision=150697&view=revision
494
495         * rendering/RenderBox.cpp:
496         (WebCore::RenderBox::positionLineBox):
497         * rendering/RenderBox.h:
498         (WebCore::RenderBox::setInlineBoxWrapper):
499
500 2014-04-16  Bem Jones-Bey  <bjonesbe@adobe.com>
501
502         Fix CodeGenerator.pm to only write files if the generated content has changed
503         https://bugs.webkit.org/show_bug.cgi?id=131756
504
505         Reviewed by Sam Weinig.
506
507         To improve build speed, don't touch generated files unless the newly
508         generated content is actually different.
509
510         * bindings/scripts/CodeGenerator.pm:
511         (UpdateFile):
512
513 2014-04-16  Andreas Kling  <akling@apple.com>
514
515         Add a way to cache never-changing IDL attributes in the wrapper.
516         <https://webkit.org/b/131759>
517
518         Some IDL attributes will always return the same value when queried
519         on an object, so let's have a way to avoid calling into C++ code
520         every time they are queried.
521
522         This patch adds a custom IDL thingy called "ReturnsCacheableValue"
523         which causes the code generator to emit code to cache the returned
524         value directly in the JS wrapper object.
525
526         Reviewed by Oliver Hunt.
527
528         * bindings/scripts/IDLAttributes.txt:
529         * bindings/scripts/CodeGeneratorJS.pm:
530         (GenerateImplementation):
531
532             Add ReturnsCacheableValue custom attribute.
533
534         * dom/Element.idl:
535         * dom/Node.idl:
536
537             Annotate some attributes that return fully cacheable values.
538
539         * bindings/scripts/test/*:
540
541             Rebaseline.
542
543 2014-04-16  Noel Gordon  <noel.gordon@gmail.com>
544
545         Progressive JPEG outputScanlines() calls should handle failure
546         https://bugs.webkit.org/show_bug.cgi?id=116701
547
548         Reviewed by Brent Fulgham.
549
550         outputScanlines() can fail and delete |this|. Copy the decoder pointer
551         member and use that copy to detect and handle the failure case.
552
553         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
554         (WebCore::JPEGImageReader::decode):
555
556 2014-04-16  Robert Sipka  <sipka@inf.u-szeged.hu>
557
558         [curl] Add WEB_TIMING support
559         https://bugs.webkit.org/show_bug.cgi?id=127555
560
561         Reviewed by Brent Fulgham.
562
563         Access timing information related to navigation.
564
565         * platform/network/curl/ResourceHandleManager.cpp:
566         (WebCore::milisecondsSinceRequest):
567         (WebCore::calculateWebTimingInformations):
568         (WebCore::sockoptfunction):
569         (WebCore::headerCallback):
570         (WebCore::ResourceHandleManager::downloadTimerCallback):
571         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
572         (WebCore::ResourceHandleManager::initializeHandle):
573
574 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
575
576         Cleanup header includes in ShapeOutsideInfo.h
577         https://bugs.webkit.org/show_bug.cgi?id=131750
578
579         Reviewed by Antti Koivisto.
580
581         Make the build faster by removing unnecessary header includes.
582
583         No new tests, no behavior change.
584
585         * rendering/shapes/ShapeOutsideInfo.h:
586
587 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
588
589         Fix the iOS build.
590
591         * platform/graphics/cg/BitmapImageCG.cpp:
592         (WebCore::BitmapImage::draw):
593
594 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
595
596         DataTransfer should cache its FileList
597         https://bugs.webkit.org/show_bug.cgi?id=131694
598
599         Reviewed by Darin Adler.
600
601         Test: fast/events/data-transfer-files-attribute-identity.html
602
603         * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal):
604         Switched to a new FileList constructor, CloneDeserializer doesn't really need to modify
605         the FileList with append().
606
607         * dom/DataTransfer.h:
608         * dom/DataTransfer.cpp:
609         (WebCore::DataTransfer::types): Added a FIXME.
610         (WebCore::DataTransfer::files): Changed to reuse a cached FileList. It's currently
611         easy, because we don't support DataTransferItemList. Once we do, making any changes
612         through it will also require updating the FileList in a way that doesn't replace
613         File objects for unchanged files.
614
615         * fileapi/FileList.h:
616         (WebCore::FileList::create):
617         (WebCore::FileList::isEmpty):
618         (WebCore::FileList::FileList):
619         (WebCore::FileList::append):
620         (WebCore::FileList::clear):
621         Made non-const functions private, because neither DataTransfer nor FileInputType
622         expect the list to be modified without their knowledge. Added a new Vector based
623         constructor so that a FileList could be created without the use of append().
624
625         * html/FileInputType.cpp: (WebCore::FileInputType::createFileList): Simplified
626         the code a little bit. FileInputType still needs to modify the list for clear(),
627         but doesn't need to add to it dynamically - unlike with DataTransfer, it's expected
628         to create a new FileList when it's modified.
629
630 2014-04-15  Brent Fulgham  <bfulgham@apple.com>
631
632         [Win] Eliminate use of deleteAllValues in Windows Files
633         https://bugs.webkit.org/show_bug.cgi?id=131631
634
635         Reviewed by Darin Adler.
636
637         Update to use std::unique_ptr for object lifetime. Get rid of
638         deleteAllValues now that it is no loner needed. Use ranged for
639         loops where possible.
640
641         * platform/win/WCDataObject.cpp:
642         (WebCore::WCEnumFormatEtc::WCEnumFormatEtc):
643         (WebCore::WCDataObject::~WCDataObject):
644         (WebCore::WCDataObject::GetData):
645         (WebCore::WCDataObject::QueryGetData):
646         (WebCore::WCDataObject::SetData):
647         (WebCore::WCDataObject::clearData):
648         * platform/win/WCDataObject.h:
649
650 2014-04-16  Chris Fleizach  <cfleizach@apple.com>
651
652         AX: Accessing a table cell with an invalid column header crashes
653         https://bugs.webkit.org/show_bug.cgi?id=131719
654
655         Reviewed by Darin Adler.
656
657         If no tableCell is available as a column/row header, then do not continue processing.
658
659         Test: accessibility/table-missing-column-header-crash.html
660
661         * accessibility/AccessibilityTableCell.cpp:
662         (WebCore::AccessibilityTableCell::columnHeaders):
663         (WebCore::AccessibilityTableCell::rowHeaders):
664
665 2014-04-16  Brendan Long  <b.long@cablelabs.com>
666
667         [GTK] Fix unused parameter warnings
668         https://bugs.webkit.org/show_bug.cgi?id=131721
669
670         Reviewed by Darin Adler.
671
672         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
673         (WebCore::toJS): Remove unused 'exec' parameter.
674
675 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
676
677         Convert the boolean param of Image::startAnimation() to an enum
678         https://bugs.webkit.org/show_bug.cgi?id=131742
679
680         Reviewed by Tim Horton.
681
682         Use an enum to make the code more readable.
683
684         * platform/graphics/BitmapImage.cpp:
685         (WebCore::BitmapImage::startAnimation):
686         * platform/graphics/BitmapImage.h:
687         * platform/graphics/Image.cpp:
688         (WebCore::Image::drawTiled):
689         * platform/graphics/Image.h:
690         (WebCore::Image::startAnimation):
691         * svg/graphics/SVGImage.cpp:
692         (WebCore::SVGImage::startAnimation):
693         * svg/graphics/SVGImage.h:
694
695 2014-04-16  David Hyatt  <hyatt@apple.com>
696
697         Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights inside columns against
698         containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
699         an ancestor.
700
701         https://bugs.webkit.org/show_bug.cgi?id=131741
702
703         Reviewed by Simon Fraser.
704
705         Added fast/multicol/percent-height.html.
706
707         * rendering/RenderBox.cpp:
708         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
709         Add an isInFlowRenderFlowThread check so that we skip those blocks and don't consider them at all
710         when resolving percentage heights.
711
712 2014-04-16  Daewoong Jang  <daewoong.jang@navercorp.com>
713
714         [WinCairo][cURL] Build fix for WinCairo build with USE(CURL).
715         https://bugs.webkit.org/show_bug.cgi?id=131614
716
717         Reviewed by Brent Fulgham.
718
719         Build fix, no new tests needed.
720
721         * platform/network/curl/CurlCacheEntry.cpp:
722         (WebCore::CurlCacheEntry::loadResponseHeaders):
723         * platform/network/curl/CurlCacheManager.cpp:
724         (WebCore::CurlCacheManager::loadIndex):
725         * platform/network/soup/ResourceError.h:
726         * platform/network/soup/SocketStreamHandle.h:
727
728 2014-04-16  Martin Hodovan  <mhodovan@inf.u-szeged.hu>
729
730         ASSERTION FAILED: x2 >= x1 in WebCore::RenderObject::drawLineForBoxSide
731         https://bugs.webkit.org/show_bug.cgi?id=127835
732
733         In some cases when a negative margin and a positive padding are applied
734         together to the right and/or left side of the box, the logical width of
735         the borders can be set to a negative value, making the assertion fire.
736         The fix checks if the width or height of the box is negative, and if so,
737         it will not display the borders and shadows of the box.
738
739         Reviewed by Darin Adler.
740
741         Test: fast/css/padding-margin-negative-border.html
742
743         * rendering/RenderBoxModelObject.cpp:
744         (WebCore::RenderBoxModelObject::paintBorder):
745
746 2014-04-16  Jer Noble  <jer.noble@apple.com>
747
748         [MSE] Seeks into buffered ranges will never complete.
749         https://bugs.webkit.org/show_bug.cgi?id=131717
750
751         Reviewed by Eric Carlson.
752
753         Test: media/media-source/media-source-seek-complete.html
754
755         Run the SourceBuffer Monitoring step after initiating a seek.
756
757         * Modules/mediasource/SourceBuffer.cpp:
758         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
759
760 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
761
762         [EFL] Fix problems with the pixel dump.
763         https://bugs.webkit.org/show_bug.cgi?id=131265
764
765         Reviewed by Gyuyoung Kim.
766
767         Painting and compositing paths of WebKit-EFL were totally modified from r166768.
768         However pixel dump codes still call deprecated functions like ewk_view_paint(),
769         which causes that nothing is drawn.
770
771         This patch adds new member functions to AcceleratedCompositingContext to support pixel dump.
772         One of new functions is AcceleratedCompositingContext::extractImageData(),
773         which replaces deprecated function calls. Besides the extractImageData() is invoked by
774         ewk_view_screenshot_contents_get() in order to take the visible content displayed on the EFL webview.
775
776         * platform/graphics/cairo/CairoUtilities.cpp:
777         (WebCore::flipImageSurfaceVertically): Flip pixel data of given cairo_surface_t vertically up/down.
778         Whereas Cairo uses the top-left corner as being 0,0 of the coordinate system,
779         OpenGL uses the bottom-left corner being 0,0.
780         So we need to vertically flip resultant images taken by glReadPixels().
781         * platform/graphics/cairo/CairoUtilities.h:
782
783 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
784
785         Make page overlay functionality working on coordinated graphics.
786         https://bugs.webkit.org/show_bug.cgi?id=131425
787
788         Reviewed by Darin Adler.
789
790         Page overlay functionality did not work on coordinated graphics since r166975.
791         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
792         and makes CoordinatedLayerTreeHost use PageOverlayController.
793
794         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
795         (WebCore::CompositingCoordinator::setRootCompositingLayer):
796         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
797         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
798
799 2014-04-10  Roger Fong  <roger_fong@apple.com>
800
801         Snapshotted plugins may need to be restarted if style properties are changed after initial load of plugin.
802         https://bugs.webkit.org/show_bug.cgi?id=131553.
803         <rdar://problem/15443375>
804
805         Reviewed by Timothy Horton.
806
807         Test: plugins/snapshotting/set-plugin-size-to-tiny.html
808
809         When updating embedded objects during our post layout checks, check for certain style changes
810         that may result in the plugin needing to be restarted.
811
812         * html/HTMLPlugInImageElement.h: 
813         Add m_plugInDimensionsSpecified field to keep track of whether or not dimensions on the plugin’s renderer have been specified.
814         * html/HTMLPlugInImageElement.cpp:
815         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
816         Initialize m_plugInDimensionsSpecified.
817         (WebCore::isSmallerThanTinySizingThreshold):
818         Refactoring, move check for whether or not plugin is smaller than the tiny plugin size threshold to this method.
819         (WebCore::HTMLPlugInImageElement::isTopLevelFullPage): 
820         Refactoring, move check for whether or not plugin is top level full page to this method.
821         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): 
822         Use refactored checks here as well to determine whether or not we need to restart the snapshotted plugin.
823         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Use refactored checks.
824         If plugin dimensions were specified, set m_plugInDimensionsSpecified to true.
825
826 2014-04-15  Andreas Kling  <akling@apple.com>
827
828         [iOS WebKit2] Listen for system memory pressure notifications.
829         <https://webkit.org/b/131653>
830         <rdar://problem/16208123>
831
832         Reviewed by Antti Koivisto.
833
834         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
835         (WebCore::MemoryPressureHandler::install):
836
837             Use the right invocation to summon the memory pressure handler.
838
839         (WebCore::MemoryPressureHandler::install):
840         (WebCore::MemoryPressureHandler::uninstall):
841         (WebCore::MemoryPressureHandler::holdOff):
842         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
843
844             Make stubbed out functions !PLATFORM(COCOA)
845
846 2014-04-14  Morten Stenshorne  <mstensho@opera.com>
847
848         [New Multicolumn] Add support for column-span:all
849         https://bugs.webkit.org/show_bug.cgi?id=129330
850
851         Reviewed by Dave Hyatt.
852
853         Column spanners are implemented as siblings of RenderMultiColumnSet
854         objects (i.e. the regions for the column rows). This means that they
855         are pulled out from the flow thread tree where they would otherwise
856         live. This causes some complexity, most of which is contained within
857         the multicol code.
858
859         A placeholder is put in the flow thread tree where the spanner's
860         renderer would otherwise live. This is needed in order make sure that
861         we interrupt line layout before after the spanner. We also need this
862         to be able to switch from one multicol set to the next.
863
864         Some extra logic is required when dynamically inserting and removing
865         flow thread descendants now, because we need to figure out if the
866         renderer added should trigger creation of new multi column sets. If
867         a spanner is inserted in the middle of a multi column set, we need to
868         detect this, split the set and put the spanner in the middle.
869
870         Wrote a bunch of tests. A few of the tests were copied from existing
871         (old-impl) tests and put in a separate directory. That directory can
872         be wiped when we turn on the new multicol implementation by default.
873
874         Tests: fast/multicol/newmulticol/adjacent-spanners.html
875                fast/multicol/newmulticol/block-becomes-spanner.html
876                fast/multicol/newmulticol/change-spanner-display.html
877                fast/multicol/newmulticol/change-spanner-parent-display.html
878                fast/multicol/newmulticol/compare-with-old-impl/anonymous-block-split-crash.html
879                fast/multicol/newmulticol/compare-with-old-impl/before-child-anonymous-column-block.html
880                fast/multicol/newmulticol/compare-with-old-impl/clone-before-after-content-crash.html
881                fast/multicol/newmulticol/compare-with-old-impl/clone-block-children-inline-mismatch-crash.html
882                fast/multicol/newmulticol/compare-with-old-impl/clone-flexbox.html
883                fast/multicol/newmulticol/compare-with-old-impl/clone-summary.html
884                fast/multicol/newmulticol/compare-with-old-impl/column-span-inside-multicol-webkit-box.html
885                fast/multicol/newmulticol/compare-with-old-impl/continuation-crash.html
886                fast/multicol/newmulticol/compare-with-old-impl/double-merge-anonymous-block-crash.html
887                fast/multicol/newmulticol/compare-with-old-impl/empty-anonymous-block-split-crash.html
888                fast/multicol/newmulticol/compare-with-old-impl/float-not-removed-crash.html
889                fast/multicol/newmulticol/compare-with-old-impl/list-multi-column-crash.html
890                fast/multicol/newmulticol/compare-with-old-impl/positioned-child-not-removed-crash.html
891                fast/multicol/newmulticol/compare-with-old-impl/positioned-objects-not-removed-crash.html
892                fast/multicol/newmulticol/compare-with-old-impl/recursive-split-flow-crash.html
893                fast/multicol/newmulticol/compare-with-old-impl/removal-of-multicol-span-crash.html
894                fast/multicol/newmulticol/compare-with-old-impl/remove-child-split-flow-crash.html
895                fast/multicol/newmulticol/compare-with-old-impl/runin-continuation-crash.html
896                fast/multicol/newmulticol/compare-with-old-impl/span-as-immediate-child-complex-splitting.html
897                fast/multicol/newmulticol/compare-with-old-impl/span-as-nested-inline-block-child.html
898                fast/multicol/newmulticol/compare-with-old-impl/split-flow-anonymous-wrapper-crash.html
899                fast/multicol/newmulticol/compare-with-old-impl/split-inline-wrong-post-block-crash.html
900                fast/multicol/newmulticol/compare-with-old-impl/table-multi-column-crash.html
901                fast/multicol/newmulticol/compare-with-old-impl/textbox-not-removed-crash.html
902                fast/multicol/newmulticol/compare-with-old-impl/update-after-content-before-child-crash.html
903                fast/multicol/newmulticol/insert-row-content1.html
904                fast/multicol/newmulticol/insert-row-content2.html
905                fast/multicol/newmulticol/insert-row-content3.html
906                fast/multicol/newmulticol/insert-row-content4.html
907                fast/multicol/newmulticol/insert-row-content5.html
908                fast/multicol/newmulticol/insert-row-content6.html
909                fast/multicol/newmulticol/insert-row-content7.html
910                fast/multicol/newmulticol/insert-row-content8.html
911                fast/multicol/newmulticol/insert-row-content9.html
912                fast/multicol/newmulticol/insert-spanner-child1.html
913                fast/multicol/newmulticol/insert-spanner-child2.html
914                fast/multicol/newmulticol/insert-spanner-child3.html
915                fast/multicol/newmulticol/insert-spanner1.html
916                fast/multicol/newmulticol/insert-spanner2.html
917                fast/multicol/newmulticol/insert-spanner3.html
918                fast/multicol/newmulticol/insert-spanner4.html
919                fast/multicol/newmulticol/insert-spanner5.html
920                fast/multicol/newmulticol/insert-spanner6.html
921                fast/multicol/newmulticol/insert-spanner7.html
922                fast/multicol/newmulticol/insert-spanner8.html
923                fast/multicol/newmulticol/multicol-with-spanner-becomes-regular-block.html
924                fast/multicol/newmulticol/remove-row-content1.html
925                fast/multicol/newmulticol/remove-row-content2.html
926                fast/multicol/newmulticol/remove-row-content3.html
927                fast/multicol/newmulticol/remove-row-content4.html
928                fast/multicol/newmulticol/remove-row-content5.html
929                fast/multicol/newmulticol/remove-row-content6.html
930                fast/multicol/newmulticol/remove-row-content7.html
931                fast/multicol/newmulticol/remove-row-content8.html
932                fast/multicol/newmulticol/remove-row-content9.html
933                fast/multicol/newmulticol/remove-spanner1.html
934                fast/multicol/newmulticol/remove-spanner2.html
935                fast/multicol/newmulticol/remove-spanner3.html
936                fast/multicol/newmulticol/remove-spanner4.html
937                fast/multicol/newmulticol/remove-spanner5.html
938                fast/multicol/newmulticol/remove-spanner6.html
939                fast/multicol/newmulticol/sole-spanner.html
940                fast/multicol/newmulticol/span-between-text.html
941                fast/multicol/newmulticol/spanner-becomes-regular-block.html
942                fast/multicol/newmulticol/spanner-first.html
943                fast/multicol/newmulticol/spanner-img.html
944                fast/multicol/newmulticol/spanner-inline-block.html
945                fast/multicol/newmulticol/spanner-last.html
946                fast/multicol/newmulticol/spanner-nested-dynamic.html
947                fast/multicol/newmulticol/spanner-nested.html
948                fast/multicol/newmulticol/spanner-pseudo-after1.html
949                fast/multicol/newmulticol/spanner-pseudo-after2.html
950                fast/multicol/newmulticol/spanner-pseudo-after3.html
951                fast/multicol/newmulticol/spanner-pseudo-after4.html
952                fast/multicol/newmulticol/spanner-pseudo-before-after1.html
953                fast/multicol/newmulticol/spanner-pseudo-before-after2.html
954                fast/multicol/newmulticol/spanner-pseudo-before-after3.html
955                fast/multicol/newmulticol/spanner-pseudo-before-after4.html
956                fast/multicol/newmulticol/spanner-pseudo-before1.html
957                fast/multicol/newmulticol/spanner-pseudo-before2.html
958                fast/multicol/newmulticol/spanner-pseudo-before3.html
959                fast/multicol/newmulticol/spanner-pseudo-before4.html
960                fast/multicol/newmulticol/spanner-table.html
961                fast/multicol/newmulticol/spanner-with-margin.html
962                fast/multicol/newmulticol/spanner1.html
963                fast/multicol/newmulticol/spanner2.html
964                fast/multicol/newmulticol/spanner3.html
965                fast/multicol/newmulticol/spanner4.html
966                fast/multicol/newmulticol/spanner5.html
967                fast/multicol/newmulticol/spanner6.html
968                fast/multicol/newmulticol/spanner7.html
969                fast/multicol/newmulticol/spanner8.html
970                fast/multicol/newmulticol/spanner9.html
971                fast/multicol/newmulticol/trailing-margin-with-spanner.html
972                fast/multicol/newmulticol/trailing-margin-with-spanner2.html
973
974         * CMakeLists.txt:
975         * WebCore.vcxproj/WebCore.vcxproj:
976         * WebCore.vcxproj/WebCore.vcxproj.filters:
977         * rendering/RenderBlock.cpp:
978         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
979         Disable the old anonymous multicol container and spanner anonymous
980         block generation machinery when the new multicol implementation is
981         enabled.
982         * rendering/RenderBlockFlow.cpp:
983         (WebCore::RenderBlockFlow::createMultiColumnFlowThread):
984         (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread):
985         (WebCore::RenderBlockFlow::layoutBlockChild): Need to notify the
986         flow thread when a descendant's final position is known. Spanner
987         placeholders need to know where to terminate the column set that
988         it follows.
989         (WebCore::RenderBlockFlow::styleDidChange): Remove old code that
990         isn't needed anymore. The renderers in question (flow thread and
991         column sets) set display:block on themselves already. This code
992         caused problems for spanners, which got all their style wiped.
993         (WebCore::RenderBlockFlow::setMultiColumnFlowThread): If setting
994         the flow thread to nullptr, there's no need to create the "rare
995         data" structure.
996         (WebCore::RenderBlockFlow::relayoutForPagination):
997         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild):
998         (WebCore::RenderBlockFlow::addChild): beforeChild is retrieved via
999         the DOM. If it is a spanner, we need to locate the placeholder
1000         here, because that's the correct location to insert siblings,
1001         DOM-wise.
1002         (WebCore::RenderBlockFlow::removeChild): The multicol flow thread
1003         needs to know when children disappear.
1004         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
1005         Don't modify the height back and forth when calculating the
1006         multicol container's final height, as that messes up balancing.
1007         (WebCore::RenderBlockFlow::insertedIntoTree): Deleted.
1008         (WebCore::RenderBlockFlow::willBeDestroyed): Deleted.
1009         (WebCore::RenderBlockFlow::styleWillChange): Deleted.
1010         (WebCore::RenderBlockFlow::lineAtIndex): Deleted.
1011         * rendering/RenderBlockFlow.h:
1012         * rendering/RenderElement.cpp:
1013         (WebCore::RenderElement::insertedIntoTree): Set up an element's
1014         layer before notifying the flow thread. The multicol flow thread
1015         may decide to move the element (if it's a spanner), which may
1016         involve re-insertion of layers.  Calling
1017         RenderObject::insertedIntoTree() last instead of first also better
1018         matches the order we used to have prior to the introduction of
1019         RenderElement, FWIW.
1020         * rendering/RenderFlowThread.cpp:
1021         (WebCore::RenderFlowThread::layout):
1022         (WebCore::RenderFlowThread::removeRegionFromThread): Deleted.
1023         (WebCore::RenderFlowThread::invalidateRegions): Deleted.
1024         * rendering/RenderFlowThread.h:
1025         * rendering/RenderMultiColumnFlowThread.cpp:
1026         (WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread):
1027         (WebCore::RenderMultiColumnFlowThread::removeFlowChildInfo): When
1028         a flow thread descendant is inserted, the multicol flow thread
1029         needs to be notified.
1030         (WebCore::RenderMultiColumnFlowThread::firstMultiColumnSet):
1031         (WebCore::RenderMultiColumnFlowThread::lastMultiColumnSet):
1032         (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
1033         (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
1034         (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
1035         (WebCore::RenderMultiColumnFlowThread::layout):
1036         (WebCore::RenderMultiColumnFlowThread::findSetRendering):
1037         (WebCore::RenderMultiColumnFlowThread::populate):
1038         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
1039         (WebCore::RenderMultiColumnFlowThread::addRegionToThread):
1040         (WebCore::RenderMultiColumnFlowThread::willBeRemovedFromTree):
1041         Need to detach column sets here, since they have pointers to their
1042         flow thread.
1043         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
1044         (WebCore::isValidColumnSpanner):
1045         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1046         (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
1047         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut):
1048         (WebCore::RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset):
1049         Nothing to be done here for the time being. Column sets are now
1050         created during box creation. We are going to need to add some code
1051         here again once multicol properly supports nested fragmentation
1052         contexts (and you get adjacent column rows because of that).
1053         (WebCore::RenderMultiColumnFlowThread::regionAtBlockOffset):
1054         During layout, don't trust the region interval tree, as that one
1055         depends on the resulting layout.
1056         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox): With
1057         a convenience method to get the last column set, and column sets
1058         now being created during normal box creation, this young method
1059         needs an overhaul.
1060         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
1061         (WebCore::RenderMultiColumnFlowThread::isPageLogicalHeightKnown):
1062         * rendering/RenderMultiColumnFlowThread.h:
1063         * rendering/RenderMultiColumnSet.cpp:
1064         (WebCore::RenderMultiColumnSet::nextSiblingMultiColumnSet):
1065         (WebCore::RenderMultiColumnSet::previousSiblingMultiColumnSet):
1066         (WebCore::RenderMultiColumnSet::firstRendererInFlowThread):
1067         (WebCore::RenderMultiColumnSet::lastRendererInFlowThread):
1068         (WebCore::precedesRenderer):
1069         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
1070         (WebCore::RenderMultiColumnSet::setLogicalTopInFlowThread):
1071         (WebCore::RenderMultiColumnSet::setLogicalBottomInFlowThread):
1072         (WebCore::RenderMultiColumnSet::pageLogicalTopForOffset):
1073         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
1074         (WebCore::RenderMultiColumnSet::calculateBalancedHeight):
1075         (WebCore::RenderMultiColumnSet::addForcedBreak):
1076         (WebCore::RenderMultiColumnSet::recalculateColumnHeight):
1077         Previously only needed if columns were to be balanced, now it's
1078         also needed when not balancing.
1079         (WebCore::RenderMultiColumnSet::recordSpaceShortage): Some layout
1080         elements actually have 0 height. Skip them, since they're not
1081         taking us anywhere.
1082         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
1083         (WebCore::RenderMultiColumnSet::requiresBalancing): Column sets
1084         now have individual balancing needs. If they precede a spanner,
1085         they must always be balanced. For the last column set, see if
1086         height is unspecified or column-fill is 'balance' (like before).
1087         (WebCore::RenderMultiColumnSet::prepareForLayout):
1088         (WebCore::RenderMultiColumnSet::beginFlow):
1089         (WebCore::RenderMultiColumnSet::endFlow):
1090         (WebCore::RenderMultiColumnSet::layout):
1091         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
1092         (WebCore::RenderMultiColumnSet::columnRectAt):
1093         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
1094         (WebCore::RenderMultiColumnSet::paintColumnRules):
1095         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting):
1096         (WebCore::RenderMultiColumnSet::collectLayerFragments):
1097         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
1098         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight): Deleted.
1099         (WebCore::RenderMultiColumnSet::findRunWithTallestColumns): Deleted.
1100         (WebCore::RenderMultiColumnSet::clearForcedBreaks): Deleted.
1101         (WebCore::RenderMultiColumnSet::repaintFlowThreadContent): Deleted.
1102         * rendering/RenderMultiColumnSet.h:
1103         * rendering/RenderMultiColumnSpannerPlaceholder.cpp: Added.
1104         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
1105         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
1106         (WebCore::RenderMultiColumnSpannerPlaceholder::renderName):
1107         * rendering/RenderMultiColumnSpannerPlaceholder.h: Added.
1108         * rendering/RenderObject.cpp:
1109         (WebCore::RenderObject::insertedIntoTree): Need to notify the
1110         multicol flow thread when descendants are inserted. That may
1111         trigger insertion of column sets, or, in the case of spanners,
1112         they need to be moved out from the flow thread.
1113         * rendering/RenderObject.h:
1114         (WebCore::RenderObject::isRenderMultiColumnSpannerPlaceholder):
1115         (WebCore::RenderObject::isAnonymousBlock): Exclude column sets
1116         here, so that they don't get involved in anonymous block merging
1117         and other kinds of fun.
1118         * rendering/RenderRegion.h:
1119         * rendering/RenderRegionSet.h:
1120
1121 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
1122
1123         LayerTreeAsTextBehavior should be in the WebCore namespace
1124         https://bugs.webkit.org/show_bug.cgi?id=131683
1125
1126         Reviewed by Andrei Bucur.
1127
1128         Move LayerTreeAsTextBehavior and the bit flags into the WebCore namespace.
1129
1130         * platform/graphics/GraphicsLayer.cpp:
1131         (showGraphicsLayerTree):
1132         * platform/graphics/GraphicsLayer.h:
1133
1134 2014-04-15  Benjamin Poulain  <bpoulain@apple.com>
1135
1136         ViewportConfiguration handles userZoom incorrectly
1137         https://bugs.webkit.org/show_bug.cgi?id=131657
1138
1139         Reviewed by Darin Adler.
1140
1141         * page/ViewportConfiguration.cpp:
1142         (WebCore::viewportArgumentUserZoomIsSet):
1143         (WebCore::ViewportConfiguration::updateConfiguration):
1144         The other viewport values must be strictly positive, userZoom is always either zero, one or minus one.
1145         As a result, the value zero was never set.
1146
1147 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
1148
1149         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
1150         https://bugs.webkit.org/show_bug.cgi?id=131665
1151
1152         Reviewed by Tim Horton.
1153
1154         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
1155         was triggering a compositing layer flush when called with a null rootLayer, which happens
1156         for pages going into the page cache. This would trigger a layer flush that would clobber
1157         the root layer for the visible page, resulting in missing content.
1158         
1159         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
1160         was being added to (and then removed from) every single compositing layers.
1161         
1162         Fix both these by changing to a pull model, where RenderLayerCompositor requests
1163         the overlay layer via ChromeClient, and gets it at the end of every flush,
1164         adding to the children of the root layer.
1165
1166         * WebCore.exp.in:
1167         * page/ChromeClient.h:
1168         (WebCore::ChromeClient::documentOverlayLayerForFrame):
1169         * rendering/RenderLayerCompositor.cpp:
1170         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1171         (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
1172         into a variable for ease of debugging.
1173         (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
1174         that we're not in the page cache (this would have caught the bug).
1175         (WebCore::RenderLayerCompositor::appendOverlayLayers):
1176         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1177         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
1178         * rendering/RenderLayerCompositor.h:
1179
1180 2014-04-15  Commit Queue  <commit-queue@webkit.org>
1181
1182         Unreviewed, rolling out r167199 and r167251.
1183         https://bugs.webkit.org/show_bug.cgi?id=131678
1184
1185         Caused a DYEBench regression and does not seem to improve perf
1186         on relevant websites (Requested by rniwa on #webkit).
1187
1188         Reverted changesets:
1189
1190         "Rewrite Function.bind as a builtin"
1191         https://bugs.webkit.org/show_bug.cgi?id=131083
1192         http://trac.webkit.org/changeset/167199
1193
1194         "Update test result"
1195         http://trac.webkit.org/changeset/167251
1196
1197 2014-04-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1198
1199         Remove unnecessary null checking in NavigatorContentUtils
1200         https://bugs.webkit.org/show_bug.cgi?id=131652
1201
1202         Reviewed by Darin Adler.
1203
1204         Some functions have checked if document is null. However, document is always not
1205         null when frame is existed.
1206
1207         No new tests, no behavior changes.
1208
1209         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
1210         (WebCore::NavigatorContentUtils::registerProtocolHandler):
1211         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
1212         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
1213
1214 2014-04-15  Commit Queue  <commit-queue@webkit.org>
1215
1216         Unreviewed, rolling out r167298.
1217         https://bugs.webkit.org/show_bug.cgi?id=131670
1218
1219         Broke CSS filters (17 test crashes) (Requested by ap on
1220         #webkit).
1221
1222         Reverted changeset:
1223
1224         "[iOS WK2] Pages often blank on first load if page loaded by
1225         typing the URL"
1226         https://bugs.webkit.org/show_bug.cgi?id=131665
1227         http://trac.webkit.org/changeset/167298
1228
1229 2014-04-14  Pratik Solanki  <psolanki@apple.com>
1230
1231         Unreviewed. Attempt to fix Windows build after r167277.
1232
1233         * page/FrameView.cpp:
1234         (WebCore::FrameView::willPaintContents):
1235
1236 2014-04-14  Commit Queue  <commit-queue@webkit.org>
1237
1238         Unreviewed, rolling out r167261.
1239         https://bugs.webkit.org/show_bug.cgi?id=131667
1240
1241         broke many navigation tests (Requested by ap on #webkit).
1242
1243         Reverted changeset:
1244
1245         "Web Replay: memoize fallback time values for
1246         document.lastModified"
1247         https://bugs.webkit.org/show_bug.cgi?id=131318
1248         http://trac.webkit.org/changeset/167261
1249
1250 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1251
1252         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
1253         https://bugs.webkit.org/show_bug.cgi?id=131665
1254
1255         Reviewed by Tim Horton.
1256
1257         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
1258         was triggering a compositing layer flush when called with a null rootLayer, which happens
1259         for pages going into the page cache. This would trigger a layer flush that would clobber
1260         the root layer for the visible page, resulting in missing content.
1261         
1262         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
1263         was being added to (and then removed from) every single compositing layers.
1264         
1265         Fix both these by changing to a pull model, where RenderLayerCompositor requests
1266         the overlay layer via ChromeClient, and gets it at the end of every flush,
1267         adding to the children of the root layer.
1268
1269         * WebCore.exp.in:
1270         * page/ChromeClient.h:
1271         (WebCore::ChromeClient::documentOverlayLayerForFrame):
1272         * rendering/RenderLayerCompositor.cpp:
1273         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1274         (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
1275         into a variable for ease of debugging.
1276         (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
1277         that we're not in the page cache (this would have caught the bug).
1278         (WebCore::RenderLayerCompositor::appendOverlayLayers):
1279         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
1280         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
1281         * rendering/RenderLayerCompositor.h:
1282
1283 2014-04-14  Jon Honeycutt  <jhoneycutt@apple.com>
1284
1285         Assertion failure under FEImage::determineAbsolutePaintRect()
1286
1287         <https://bugs.webkit.org/show_bug.cgi?id=131660>
1288         <rdar://problem/15669294>
1289
1290         This patch merges Chromium r149536 (see
1291         <https://chromiumcodereview.appspot.com/14701012>), which moves
1292         m_absoluteTransform out of SVGFilter and into the base Filter class, so
1293         that it isn't necessary to cast a Filter to SVGFilter to get the
1294         absolute transform.
1295
1296         Reviewed by Geoffrey Garen.
1297
1298         Test: svg/filters/feImage-filter-assertion.html
1299
1300         * platform/graphics/filters/Filter.h:
1301         (WebCore::Filter::Filter):
1302         Changed to take the absolute transform.
1303         (WebCore::Filter::absoluteTransform):
1304         Moved from SVGFilter.
1305         (WebCore::Filter::mapAbsolutePointToLocalPoint):
1306         Ditto.
1307
1308         * rendering/FilterEffectRenderer.cpp:
1309         (WebCore::FilterEffectRenderer::FilterEffectRenderer):
1310         Pass a default AffineTransform() to the Filter base class.
1311
1312         * svg/graphics/filters/SVGFEImage.cpp:
1313         (WebCore::FEImage::determineAbsolutePaintRect):
1314         Use the Filter without casting it to SVGFilter.
1315         (WebCore::FEImage::platformApplySoftware):
1316         Ditto.
1317
1318         * svg/graphics/filters/SVGFilter.cpp:
1319         (WebCore::SVGFilter::SVGFilter):
1320         Pass the transform to the base class, and remove initialization of a
1321         removed member var.
1322
1323         * svg/graphics/filters/SVGFilter.h:
1324         Member var moved to Filter.h.
1325
1326 2014-04-14  Darin Adler  <darin@apple.com>
1327
1328         REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset>
1329         https://bugs.webkit.org/show_bug.cgi?id=126322
1330
1331         Reviewed by Ryosuke Niwa.
1332
1333         One additional tweak to the fix for the bug above.
1334         Fixes crash in editing/editability/ignored-content.html test.
1335
1336         * html/HTMLObjectElement.cpp:
1337         (WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to
1338         HTMLElement::canContainRangeEndPoint, bypassing HTMLPlugInElement override
1339         that always returns false. Without this change, this function was always
1340         returning false.
1341
1342 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1343
1344         Crash in TileController::tileRevalidationTimerFired
1345         https://bugs.webkit.org/show_bug.cgi?id=131656
1346         <rdar://problem/16583166>
1347
1348         Reviewed by Sam Weinig.
1349
1350         It's possible for the TileController revalidation timer to fire after
1351         the GraphicsLayer has been destroyed, so the PlatformCALayer no longer
1352         has an owningGraphicsLayer.
1353         
1354         Bail from the timer callback if owningGraphicsLayer() is null.
1355         
1356         Also some drive-by 0 -> nullptr changes.
1357
1358         * platform/graphics/ca/GraphicsLayerCA.cpp:
1359         (WebCore::GraphicsLayerCA::willBeDestroyed):
1360         * platform/graphics/ca/PlatformCALayer.cpp:
1361         (WebCore::PlatformCALayer::~PlatformCALayer):
1362         * platform/graphics/ca/mac/TileController.mm:
1363         (WebCore::TileController::tileRevalidationTimerFired):
1364
1365 2014-04-14  Bem Jones-Bey  <bjonesbe@adobe.com>
1366
1367         [CSS Shapes] Remove some leftover shape-inside code
1368         https://bugs.webkit.org/show_bug.cgi?id=131641
1369
1370         Reviewed by Dean Jackson.
1371
1372         I discovered that some code had been leftover from the shape-inside
1373         removal. This removes that leftover code.
1374
1375         No new tests, no behavior change.
1376
1377         * platform/text/BidiResolver.h:
1378         * rendering/BidiRun.cpp:
1379         (WebCore::BidiRun::BidiRun):
1380         * rendering/RenderBlockFlow.h:
1381         * rendering/RenderBlockLineLayout.cpp:
1382         (WebCore::RenderBlockFlow::createLineBoxes):
1383         (WebCore::RenderBlockFlow::constructLine):
1384         (WebCore::computeExpansionForJustifiedText):
1385         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1386
1387 2014-04-14  Jer Noble  <jer.noble@apple.com>
1388
1389         [MSE][Mac] video.currentTime is sometimes negative.
1390         https://bugs.webkit.org/show_bug.cgi?id=131644
1391
1392         Reviewed by Eric Carlson.
1393
1394         AVSampleBufferRenderSynchronizer will occasionally return slightly negative values
1395         when beginning playback. Clamp the return value to 0.
1396
1397         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1398         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble):
1399
1400 2014-04-14  Bem Jones-Bey  <bjonesbe@adobe.com>
1401
1402         [CSSExclusions] Remove FIXME referencing closed bug
1403         https://bugs.webkit.org/show_bug.cgi?id=131645
1404
1405         Reviewed by Dean Jackson.
1406
1407         This is silly, but the comment is really confusing as it's entirely
1408         wrong now.
1409
1410         No new tests, no behavior change.
1411
1412         * rendering/style/RenderStyle.cpp:
1413         (WebCore::RenderStyle::changeRequiresRepaint):
1414
1415 2014-04-14  Andreas Kling  <akling@apple.com>
1416
1417         Build fixage.
1418
1419         * page/FrameView.cpp:
1420
1421 2014-04-14  Jon Honeycutt  <jhoneycutt@apple.com>
1422
1423         Assertion failure !node || node->isElementNode() in
1424         WebCore::RenderBlock::inlineElementContinuation
1425   
1426         https://bugs.webkit.org/show_bug.cgi?id=108829
1427         <rdar://problem/13666405>
1428   
1429         I can't reproduce this assertion failure, but there seems to be an
1430         invalid assumption in RenderBlock::inlineElementContinuation() that
1431         anything with the "isInline()" bit set is a RenderInline.
1432         
1433         No new test because the test case in the bug does not repro for me.
1434
1435         Reviewed by Brent Fulgham.
1436
1437         * rendering/RenderBlock.cpp:
1438         (WebCore::RenderBlock::inlineElementContinuation):
1439         Dave Hyatt says that this function should only return RenderInline
1440         objects (not non-RenderInline inline objects), so update the checks
1441         from isInline() to isRenderInline() before casting with
1442         toRenderInline().
1443
1444         * rendering/RenderInline.cpp:
1445         (WebCore::RenderInline::inlineElementContinuation):
1446         Ditto.
1447
1448 2014-04-14  Andreas Kling  <akling@apple.com>
1449
1450         Do more things under memory pressure on non-iOS platforms.
1451         <https://webkit.org/b/131625>
1452
1453         Reviewed by Antti Koivisto.
1454
1455         Rename hasReceivedMemoryPressure() to isUnderMemoryPressure() and
1456         make it use std::atomic<bool> instead of OSAtomic primitives.
1457
1458         Unmask most of the PLATFORM(IOS) blocks so all platforms can take
1459         advantage of optimizations done while under pressure. Note that
1460         isUnderMemoryPressure() will still always return false on platforms
1461         other than iOS/WK1, but this will change soon.
1462
1463         * history/PageCache.cpp:
1464         (WebCore::PageCache::canCache):
1465         * loader/FrameLoader.cpp:
1466         (WebCore::FrameLoader::commitProvisionalLoad):
1467         * page/FrameView.cpp:
1468         (WebCore::FrameView::willPaintContents):
1469         (WebCore::FrameView::didPaintContents):
1470         * platform/MemoryPressureHandler.cpp:
1471         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
1472         * platform/MemoryPressureHandler.h:
1473         (WebCore::MemoryPressureHandler::isUnderMemoryPressure):
1474         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1475         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
1476         (WebCore::MemoryPressureHandler::clearMemoryPressure):
1477         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
1478         (WebCore::MemoryPressureHandler::hasReceivedMemoryPressure): Deleted.
1479         * platform/graphics/FontCache.cpp:
1480         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
1481         * platform/ios/LegacyTileCache.mm:
1482         (WebCore::LegacyTileCache::createTilesInActiveGrid):
1483         * platform/ios/LegacyTileGrid.mm:
1484         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage):
1485         * platform/ios/LegacyTileLayerPool.mm:
1486         (WebCore::LegacyTileLayerPool::addLayer):
1487         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
1488         (WebCore::TileControllerMemoryHandler::tileControllerGainedUnparentedTiles):
1489
1490 2014-04-14  Beth Dakin  <bdakin@apple.com>
1491
1492         RenderLayerCompositor's m_layerForOverhangAreas should be offset by the 
1493         topContentInset
1494         https://bugs.webkit.org/show_bug.cgi?id=131632
1495         -and corresponding-
1496         <rdar://problem/16609602>
1497
1498         Reviewed by Tim Horton.
1499
1500         Offset m_layerForOverhangAreas by the topContentInset. 
1501         * rendering/RenderLayerCompositor.cpp:
1502         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1503
1504 2014-04-14  Alexey Proskuryakov  <ap@apple.com>
1505
1506         Eliminate CachedFrame::m_mousePressNode
1507         https://bugs.webkit.org/show_bug.cgi?id=131626
1508
1509         Reviewed by Brady Eidson.
1510
1511         I couldn't find any observable effect of this change.
1512
1513         * history/CachedFrame.cpp:
1514         (WebCore::CachedFrameBase::CachedFrameBase):
1515         (WebCore::CachedFrameBase::restore):
1516         (WebCore::CachedFrame::clear):
1517         * history/CachedFrame.h:
1518         (WebCore::CachedFrame::documentLoader):
1519         (WebCore::CachedFrame::mousePressNode): Deleted.
1520         Eliminated m_mousePressNode, accessor, and code that reached out to EventHandler.
1521
1522         * page/EventHandler.cpp:
1523         (WebCore::EventHandler::mousePressNode): Deleted.
1524         (WebCore::EventHandler::setMousePressNode): Deleted.
1525         * page/EventHandler.h:
1526         (WebCore::EventHandler::setMousePressed): Deleted. This function was already unused.
1527
1528 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1529
1530         Run filter animations in the UI process with UI-side compositing
1531         https://bugs.webkit.org/show_bug.cgi?id=131199
1532         <rdar://problem/16479487>
1533
1534         Reviewed by Sam Weinig.
1535
1536         Add FilterOperation::clone() which is used during decoding.
1537         Export some things.
1538
1539         * WebCore.exp.in:
1540         * platform/graphics/filters/FilterOperation.h:
1541
1542 2014-04-14  Jer Noble  <jer.noble@apple.com>
1543
1544         Use after free in WebCore::CachedResourceHandleBase::~CachedResourceHandleBase / WebCore::removeDetachedChildrenInContainer
1545         https://bugs.webkit.org/show_bug.cgi?id=131169
1546
1547         Reviewed by Eric Carlson.
1548
1549         Invalidate the WebCoreAVFResourceLoader owned by MediaPlayerPrivateAVFoundationObjC
1550         in its destructor, to prevent a private function being called in response to the
1551         WebCoreAVFResourceLoader being stopped.
1552
1553         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1554         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
1555         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
1556         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1557         (WebCore::WebCoreAVFResourceLoader::invalidate):
1558
1559 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
1560
1561         [WK2 iOS] Scrolling to anchor links is broken
1562         https://bugs.webkit.org/show_bug.cgi?id=131618
1563         <rdar://problem/16599144>
1564
1565         Reviewed by Tim Horton.
1566
1567         Have ScrollingTreeScrollingNode pass RequestedScrollPosition updates
1568         to the scrolling tree, so that the scrolling tree can have custom behavior
1569         for them if necessary.
1570
1571         * page/scrolling/ScrollingTree.h:
1572         (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll):
1573         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1574         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
1575         * page/scrolling/ScrollingTreeScrollingNode.h:
1576
1577 2014-04-14  Brian J. Burg  <burg@cs.washington.edu>
1578
1579         Web Replay: memoize fallback time values for document.lastModified
1580         https://bugs.webkit.org/show_bug.cgi?id=131318
1581
1582         Reviewed by Joseph Pecoraro.
1583
1584         If a document's Last-Modified header can't be found or used, then 
1585         document.lastModified is derived from the current system time or
1586         from filesystem data, which is obviously nondeterministic.
1587
1588         It's better to handle this inside Document::lastModified rather than using
1589         MemoizedDOMResult, because only the fallback case is nondeterministic.
1590
1591         Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
1592
1593         * dom/Document.cpp:
1594         (WebCore::Document::lastModified): Save or reuse memoized fallback value.
1595         * replay/WebInputs.json: Add input DocumentLastModifiedDate.
1596
1597 2014-04-12  Antti Koivisto  <antti@apple.com>
1598
1599         Keep secondary tile grid for zoomed-out scale
1600         https://bugs.webkit.org/show_bug.cgi?id=131586
1601
1602         Reviewed by Darin Adler.
1603
1604         * platform/graphics/ca/GraphicsLayerCA.cpp:
1605         (WebCore::GraphicsLayerCA::updateContentsScale):
1606         
1607             Don't repaint tiled backing with setNeedsDisplay, it invalidates itself correctly in setContentsScale.
1608             Update custom child layers when tiled backing scale changes.
1609
1610         * platform/graphics/ca/mac/TileController.h:
1611         * platform/graphics/ca/mac/TileController.mm:
1612         (WebCore::TileController::TileController):
1613         (WebCore::TileController::setNeedsDisplay):
1614         
1615             Drop the whole zoomed-out grid on full repaint.
1616
1617         (WebCore::TileController::setNeedsDisplayInRect):
1618             
1619             Drop changed zoomed-out tiles. A more sophisticated strategy is possible.
1620
1621         (WebCore::TileController::setContentsScale):
1622         
1623             Swap the zoomed-out grid in and out as needed.
1624             Repaint the active grid after scale change so the client does not have to.
1625
1626         (WebCore::TileController::contentsScale):
1627         
1628             Get the content scale from the tile grid so it is not kept in two places.
1629
1630         (WebCore::TileController::zoomedOutContentsScale):
1631         (WebCore::TileController::setZoomedOutContentsScale):
1632         
1633             Drop the zoomed-out grid if it no longer matches the zoomed-out scale.
1634
1635         (WebCore::TileController::tileRevalidationTimerFired):
1636         (WebCore::TileController::retainedTileBackingStoreMemory):
1637         (WebCore::TileController::containerLayers):
1638         
1639             Return both zoomed-out tiles and the active tiles. Active tiles are on top.
1640
1641         (WebCore::TileController::numberOfUnparentedTiles):
1642         (WebCore::TileController::removeUnparentedTilesNow):
1643         * platform/graphics/ca/mac/TileGrid.h:
1644         * platform/graphics/ca/mac/TileGrid.mm:
1645         (WebCore::TileGrid::dropTilesInRect):
1646         
1647             Add a function for dropping tiles.
1648
1649         (WebCore::TileGrid::revalidateTiles):
1650
1651 2014-04-14  Oliver Hunt  <oliver@apple.com>
1652
1653         Update test result
1654
1655         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1656         (WebCore::JSTestNondeterministicConstructor::finishCreation):
1657
1658 2014-04-14  Dirk Schulze  <krit@webkit.org>
1659
1660         Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
1661         https://bugs.webkit.org/show_bug.cgi?id=79659
1662
1663         Reviewed by Darin Adler.
1664
1665         Optimize fill() and fillRect() operations in Canvas on composited contexts by
1666         10 to 20 times on CG.
1667
1668         Replacing the ImageBuffer code by transparency layers allows the
1669         graphics library to optimize the drawing.
1670
1671         Doing the same for drawImage() would give performance regressions.
1672
1673         An inline function will create a transparency layer for CG. Cairo graphics
1674         does not composite correctly when a transparency layer gets created. 
1675         The inline function is just a NOOP for Cairo.
1676
1677         This fixes bug 131303 as well.
1678
1679         Added performance tests with r167124 already.
1680
1681         * html/canvas/CanvasRenderingContext2D.cpp:
1682         (WebCore::CanvasRenderingContext2D::fillInternal):
1683         (WebCore::CanvasRenderingContext2D::strokeInternal):
1684         (WebCore::CanvasRenderingContext2D::beginCompositeLayer):
1685         (WebCore::CanvasRenderingContext2D::endCompositeLayer):
1686         (WebCore::CanvasRenderingContext2D::fillRect):
1687         (WebCore::CanvasRenderingContext2D::strokeRect):
1688         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1689         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedFill): Deleted.
1690         * html/canvas/CanvasRenderingContext2D.h:
1691
1692 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1693
1694         Lots of compositing test failures after r167152
1695         https://bugs.webkit.org/show_bug.cgi?id=131574
1696
1697         Reviewed by Darin Adler.
1698
1699         * platform/graphics/GraphicsLayer.cpp:
1700         (WebCore::dumpChildren):
1701         (WebCore::GraphicsLayer::dumpProperties):
1702         Make child-dumping recursive so that we can easily skip layers up to any depth.
1703
1704 2014-04-14  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
1705
1706         Fix incorrect indentations in CodeGeneratorJS.pm introduced in r165521
1707         https://bugs.webkit.org/show_bug.cgi?id=131613
1708
1709         Reviewed by Csaba Osztrogonác.
1710
1711         * bindings/scripts/CodeGeneratorJS.pm:
1712         (GenerateImplementation):
1713         Fixed 5-space indentation.
1714         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1715         Updated the tests accordingly.
1716
1717 2014-04-14  Manuel Rego Casasnovas  <rego@igalia.com>
1718
1719         [JSC] CSSStyleDeclaration report incorrect descriptor
1720         https://bugs.webkit.org/show_bug.cgi?id=89697
1721
1722         Reviewed by Benjamin Poulain.
1723
1724         Change descriptor of CSSStyleDeclaration properties in order to have
1725         writable and enumerable attributes set to true. Configurable is kept to
1726         false since the property is not deleteable.
1727
1728         Test: fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html
1729
1730         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1731         (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate): Only set
1732         DontDelete attribute when creating the descriptor for
1733         CSSStyleDeclaration properties.
1734
1735 2014-04-14  Benjamin Poulain  <benjamin@webkit.org>
1736
1737         [JSC] Improve the call site of string comparison in some hot path
1738         https://bugs.webkit.org/show_bug.cgi?id=131605
1739
1740         Reviewed by Darin Adler.
1741
1742         * dom/NodeRareData.h:
1743         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
1744         We should use the right comparison operation depending on the Hash Traits.
1745
1746 2014-04-14  Andreas Kling  <akling@apple.com>
1747
1748         Merge MemoryPressureHandler{Mac,IOS}.mm
1749         <https://webkit.org/b/131603>
1750
1751         Join the iOS and Mac platform implementations of MemoryPressureHandler
1752         under the shared Cocoa banner. Each platform still has its own quirky
1753         behavior, but this puts them in the same file so we can start sharing.
1754
1755         Reviewed by Darin Adler.
1756
1757         * WebCore.xcodeproj/project.pbxproj:
1758         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Renamed from Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm.
1759         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1760         (WebCore::MemoryPressureHandler::install):
1761         (WebCore::MemoryPressureHandler::uninstall):
1762         (WebCore::MemoryPressureHandler::holdOff):
1763         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
1764         (WebCore::respondToMemoryPressureCallback):
1765         (WebCore::MemoryPressureHandler::installMemoryReleaseBlock):
1766         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
1767         (WebCore::MemoryPressureHandler::hasReceivedMemoryPressure):
1768         (WebCore::MemoryPressureHandler::clearMemoryPressure):
1769         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
1770         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
1771         * platform/ios/MemoryPressureHandlerIOS.mm: Removed.
1772
1773 2014-04-14  Benjamin Poulain  <benjamin@webkit.org>
1774
1775         CSS JIT: compile the :nth-child() pseudo class
1776         https://bugs.webkit.org/show_bug.cgi?id=131602
1777
1778         Reviewed by Andreas Kling.
1779
1780         Tests: fast/selectors/nth-child-bounds.html
1781                fast/selectors/nth-child-with-backtracking.html
1782
1783         Compile the :nth-child() pseudo class function + some related clean up.
1784
1785         * css/CSSSelector.cpp:
1786         (WebCore::CSSSelector::nthA):
1787         (WebCore::CSSSelector::nthB):
1788         Expose the parsed value of an+b filters. Those values are used to compile
1789         the selector.
1790
1791         (WebCore::CSSSelector::RareData::parseNth):
1792         While working on the patch, I discovered some severe issues with the parsing of large
1793         values of a and/or b. The problem comes from the way the CSS parser handle the values:
1794         the values are parsed as a double then converted to an AtomicString for CSSSelector.
1795
1796         There are many problems related to large values but we never got bug reports because
1797         they are very uncommon. Fixing those problem would require changing the parser.
1798
1799         Here, CSSSelector::RareData::parseNth() is hardened a little bit to avoid absurd values
1800         of a and b.
1801
1802         * css/CSSSelector.h:
1803         * cssjit/RegisterAllocator.h:
1804         It looks like I forgot RDX in the list of register. Add it now since it is required
1805         for SelectorCodeGenerator::modulo().
1806
1807         * cssjit/SelectorCompiler.cpp:
1808         (WebCore::SelectorCompiler::addPseudoType):
1809         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
1810         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
1811         (WebCore::SelectorCompiler::SelectorCodeGenerator::moduloIsZero):
1812         There is no modulo() operation exposed on the macro assemblers. This is a basic
1813         implementation on top of idiv for x86_64.
1814
1815         Since idiv works exclusively with RAX and RDX, most of the code is about getting
1816         those registers efficiently.
1817
1818         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1819         (WebCore::SelectorCompiler::setElementChildIndex):
1820         (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle):
1821         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
1822         This is pretty much a straightforward implementation of :nth-child().
1823         The first part counts the number of previous elements.
1824         The second part updates the tree if this is style resolution.
1825         The last part compares the number of previous siblings to an+b to find if the filter matches.
1826
1827         The only part that diverges from SelectorChecker is how childIndex is used. Instead of testing it
1828         at every iteration, only the first iteration handle the cache.
1829
1830         * dom/ElementRareData.h:
1831         (WebCore::ElementRareData::childIndexMemoryOffset):
1832         * dom/Node.h:
1833         (WebCore::Node::rareDataMemoryOffset):
1834         (WebCore::Node::flagHasRareData):
1835         * rendering/style/RenderStyle.h:
1836
1837 2014-04-14  Tim Horton  <timothy_horton@apple.com>
1838
1839         Support setting a background color on page overlays
1840         https://bugs.webkit.org/show_bug.cgi?id=131600
1841
1842         Reviewed by Darin Adler.
1843
1844         * rendering/RenderLayerCompositor.cpp:
1845         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer):
1846         Mark the compositing tree as needing a rebuild when we get a new document-relative
1847         overlay layer; otherwise we were depending on something else coming along and
1848         requiring a rebuild, which didn't always happen.
1849
1850 2014-04-14  Mihnea Ovidenie  <mihnea@adobe.com>
1851
1852         [CSS Regions] Hit testing doesn't work in video
1853         https://bugs.webkit.org/show_bug.cgi?id=131485
1854
1855         Reviewed by Andrei Bucur.
1856
1857         When hit testing flow thread layer through the region layer,
1858         we have to pass the depth sorting information and take that
1859         into account for the situation in which an ancestor of the region
1860         has preserve-3d transform style.
1861
1862         Test: fast/regions/hit-test-region-preserve3d-container.html
1863
1864         * rendering/RenderLayer.cpp:
1865         (WebCore::RenderLayer::hitTestLayer):
1866         (WebCore::RenderLayer::hitTestFlowThreadIfRegionForFragments):
1867         * rendering/RenderLayer.h:
1868
1869 2014-04-13  Darin Adler  <darin@apple.com>
1870
1871         userVisibleString should not try to "encode" host names
1872         https://bugs.webkit.org/show_bug.cgi?id=131587
1873         rdar://problem/14686849
1874
1875         Reviewed by Alexey Proskuryakov.
1876
1877         * WebCore.exp.in: Updated for WebCoreNSURLExtras argument type changes.
1878
1879         * platform/mac/WebCoreNSURLExtras.h: Removed unneeded code to make this
1880         Objective-C++ header compile in plain C++ files, which we never need to do.
1881         Added missing argument name, baseURL, and changed mysterious CFIndex arguments
1882         to the correct type, CFURLComponentType.
1883
1884         * platform/mac/WebCoreNSURLExtras.mm:
1885         (WebCore::isLookalikeCharacter): Removed the inline keyword from this, and added
1886         more lookalike characters from the Mozilla list referenced here.
1887         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Updated argument type.
1888         (WebCore::dataForURLComponentType): Ditto.
1889         (WebCore::userVisibleString): Only call mapHostNames if host name decoding is
1890         needed; no encoding here.
1891
1892 2014-04-13  Darin Adler  <darin@apple.com>
1893
1894         REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset>
1895         https://bugs.webkit.org/show_bug.cgi?id=126322
1896
1897         Reviewed by Ryosuke Niwa.
1898
1899         * dom/Element.cpp:
1900         (WebCore::Element::canContainRangeEndPoint): Now returns false when the role of the element
1901         is "img". This is the same rule that's hard-coded in isRenderReplacedElement for the same
1902         reason. Need more test coverage to make sure this role feature works consistently.
1903
1904         * dom/Element.h: Made canContainRangeEndPoint no longer inline since it's not just a
1905         return statement any more.
1906
1907         * dom/Position.cpp:
1908         (WebCore::Position::isCandidate): Took out code that calls isRendererReplacedElement
1909         that was added in r158617; not needed now that we updated canContainRangeEndPoint.
1910
1911         * dom/Range.cpp:
1912         (WebCore::Range::firstNode): Removed code here that called isRendererReplacedElement.
1913         This was the wrong level to be adding editing logic, and there's a FIXME here to that
1914         effect, which we are now deleting. This was the change that broke Find.
1915
1916         * editing/TextIterator.cpp: Added a comment about the redundancy between the
1917         isRendererReplacedElement and editingIgnoresContent functions.
1918
1919         * html/HTMLHRElement.cpp:
1920         (WebCore::HTMLHRElement::canContainRangeEndPoint): Call through to base class instead
1921         of just returning true when we have child nodes. Lets Element::canContainRangeEndPoint
1922         do its thing.
1923         * html/HTMLHRElement.h: Ditto.
1924
1925         * html/HTMLObjectElement.cpp:
1926         (WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to base class instead
1927         of just returning true when we have fallback content. Lets Element::canContainRangeEndPoint
1928         do its thing.
1929         * html/HTMLObjectElement.h: Ditto.
1930
1931         * testing/Internals.cpp:
1932         (WebCore::Internals::countMatchesForText): Set the limit to 1000 instead of infinite.
1933
1934 2014-04-12  Darin Adler  <darin@apple.com>
1935
1936         Use unique_ptr for FillLayer::m_next
1937         https://bugs.webkit.org/show_bug.cgi?id=75222
1938
1939         Reviewed by Dan Bernstein.
1940
1941         * css/DeprecatedStyleBuilder.cpp:
1942         (WebCore::ApplyPropertyFillLayer::applyInheritValue):
1943         Renamed currChild to just child and prevChild to previousChild.
1944         Changed code to pass ownership of the new FillLayer immediately.
1945         Changed some loops to be for loops.
1946         (WebCore::ApplyPropertyFillLayer::applyInitialValue): Ditto.
1947         (WebCore::ApplyPropertyFillLayer::applyValue): Ditto.
1948
1949         * rendering/RenderBox.cpp:
1950         (WebCore::RenderBox::backgroundHasOpaqueTopLayer): Use reference
1951         instead of pointer.
1952         (WebCore::RenderBox::paintFillLayers): Ditto.
1953         * rendering/RenderBoxModelObject.cpp:
1954         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Ditto.
1955
1956         * rendering/style/FillLayer.cpp:
1957         (WebCore::FillLayer::FillLayer): Removed m_next initializer since it is now an
1958         OwnPtr and initializes automatically. In a couple other places, changed m_next
1959         initializer to use make_unique.
1960         (WebCore::FillLayer::~FillLayer): Wrote loop for deletion of m_next.
1961         (WebCore::FillLayer::operator=): Removed unneeded explicit deletion of m_next.
1962         (WebCore::FillLayer::cullEmptyLayers): Ditto.
1963         (WebCore::clipMax): Marked inline.
1964         (WebCore::FillLayer::computeClipMax): Rewrote to use a loop instead of recursion.
1965         (WebCore::FillLayer::containsImage): Ditto.
1966         (WebCore::FillLayer::imagesAreLoaded): Ditto.
1967         (WebCore::FillLayer::hasOpaqueImage): Rewrote to use && instead of multiple if.
1968         (WebCore::FillLayer::hasImage): Rewrote to use a loop instead of recursion.
1969         (WebCore::FillLayer::hasFixedImage): Ditto.
1970
1971         * rendering/style/FillLayer.h: Changed m_next to be a unique_ptr.
1972
1973 2014-04-13  Andy Estes  <aestes@apple.com>
1974
1975         [QuickLook] Move file system-related code into WebKit
1976         https://bugs.webkit.org/show_bug.cgi?id=131597
1977
1978         Reviewed by Dan Bernstein.
1979
1980         QuickLookHandle should not be responsible for saving a copy of the
1981         original document to disk as it might be running in a process that
1982         either can't write to disk or can only write into a sandboxed
1983         container. To account for this, we need to separate the concern of
1984         quick look conversion from that of original document saving so that
1985         each activity can run in the appropriate process.
1986
1987         Created a new interface between WebCore and WebKit by adding a client
1988         (QuickLookHandleClient) to QuickLookHandle which is notified of incoming
1989         bytes. A new function on FrameLoaderClient tells WebKit when a new
1990         QuickLookHandle is created, giving WebKit the opportunity to register a
1991         handle client. Moved the existing file system-related code as well as
1992         code only needed by WebKit1 in QuickLookHandle into a new WebKit1
1993         QuickLookHandleClient subclass.
1994
1995         * WebCore.exp.in:
1996         * WebCore.xcodeproj/project.pbxproj: Made QuickLookHandleClient.h Private.
1997         * loader/FrameLoaderClient.h:
1998         (WebCore::FrameLoaderClient::didCreateQuickLookHandle): Added.
1999         * loader/ResourceLoader.cpp:
2000         (WebCore::ResourceLoader::didCreateQuickLookHandle): Called FrameLoaderClient::didCreateQuickLookHandle().
2001         * loader/ResourceLoader.h:
2002         * platform/network/ResourceHandle.h: Made m_quickLook a unique_ptr.
2003         (WebCore::ResourceHandle::setQuickLookHandle): Changed to take a unique_ptr.
2004         * platform/network/ResourceHandleClient.h:
2005         (WebCore::ResourceHandleClient::didCreateQuickLookHandle): Added.
2006         * platform/network/ios/QuickLook.h: Added m_client, gave m_converter a stronger type, and made m_nsResponse a RetainPtr.
2007         (WebCore::QuickLookHandle::setClient): Added.
2008         (WebCore::QuickLookHandle::firstRequestURL): Added.
2009         (WebCore::QuickLookHandle::converter): Added.
2010         * platform/network/ios/QuickLook.mm:
2011         (WebCore::registerQLPreviewConverterIfNeeded):
2012         (WebCore::createTemporaryFileForQuickLook): Made non-static.
2013         (WebCore::emptyClient): Returned a shared empty QuickLookHandleClient.
2014         (WebCore::QuickLookHandle::QuickLookHandle): Removed file system and WebKit1-only code.
2015         (WebCore::QuickLookHandle::create): Changed to return a unique_ptr.
2016         (WebCore::QuickLookHandle::nsResponse):
2017         (WebCore::QuickLookHandle::didReceiveDataArray): Removed file system code and called QuickLookHandleClient::didReceiveDataArray() instead.
2018         (WebCore::QuickLookHandle::didReceiveData): Removed file system code and called QuickLookHandleClient::didReceiveData() instead.
2019         (WebCore::QuickLookHandle::didFinishLoading): Removed file system code and called QuickLookHandleClient::didFinishLoading() instead.
2020         (WebCore::QuickLookHandle::didFail): Removed file system and WebKit1-only code, calling QuickLookHandleClient::didFail() instead.
2021         (WebCore::QuickLookHandle::~QuickLookHandle): Removed file system and WebKit1-only code. Cleared our reference to m_client.
2022         (WebCore::QuickLookHandle::previewFileName): Retrieved from m_converter.
2023         (WebCore::QuickLookHandle::previewRequestURL): Ditto.
2024         * platform/network/ios/QuickLookHandleClient.h: Added.
2025         (WebCore::QuickLookHandleClient::~QuickLookHandleClient):
2026         (WebCore::QuickLookHandleClient::didReceiveDataArray):
2027         (WebCore::QuickLookHandleClient::didReceiveData):
2028         (WebCore::QuickLookHandleClient::didFinishLoading):
2029         (WebCore::QuickLookHandleClient::didFail):
2030
2031 2014-04-10  Pratik Solanki  <psolanki@apple.com>
2032
2033         Move early return out of dispatch_async() block so we can return from willSendRequest quickly
2034         https://bugs.webkit.org/show_bug.cgi?id=131478
2035         <rdar://problem/16575535>
2036
2037         Reviewed by Alexey Proskuryakov.
2038
2039         Do a quick check to see if we need to synthesize the redirect response on the dispatch queue
2040         and return from willSendRequest callback quickly instead of always doing an effectively synchronous
2041         call to the main thread. We can't call synthesizeRedirectResponseIfNecessary on the dispatch
2042         queue since that accesses the ResourceRequest.
2043
2044         No new tests because no change in functionality.
2045
2046         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
2047         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2048         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest): Save the
2049         request scheme to use later for early return from willSendRequest.
2050         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
2051
2052 2014-04-08  Oliver Hunt  <oliver@apple.com>
2053
2054         Rewrite Function.bind as a builtin
2055         https://bugs.webkit.org/show_bug.cgi?id=131083
2056
2057         Reviewed by Geoffrey Garen.
2058
2059         Switch WebCore to use the helper functions when defining the
2060         prototype properties on DOM constructors, and update bindings
2061         tests accordingly.
2062
2063         * bindings/js/JSImageConstructor.cpp:
2064         (WebCore::JSImageConstructor::finishCreation):
2065         * bindings/scripts/CodeGeneratorJS.pm:
2066         (GenerateConstructorHelperMethods):
2067         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2068         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
2069         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2070         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
2071         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2072         (WebCore::JSTestEventConstructorConstructor::finishCreation):
2073         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2074         (WebCore::JSTestEventTargetConstructor::finishCreation):
2075         * bindings/scripts/test/JS/JSTestException.cpp:
2076         (WebCore::JSTestExceptionConstructor::finishCreation):
2077         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2078         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
2079         * bindings/scripts/test/JS/JSTestInterface.cpp:
2080         (WebCore::JSTestInterfaceConstructor::finishCreation):
2081         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2082         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
2083         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2084         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
2085         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
2086         * bindings/scripts/test/JS/JSTestNode.cpp:
2087         (WebCore::JSTestNodeConstructor::finishCreation):
2088         * bindings/scripts/test/JS/JSTestObj.cpp:
2089         (WebCore::JSTestObjConstructor::finishCreation):
2090         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2091         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
2092         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2093         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
2094         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2095         (WebCore::JSTestTypedefsConstructor::finishCreation):
2096         * bindings/scripts/test/JS/JSattribute.cpp:
2097         (WebCore::JSattributeConstructor::finishCreation):
2098         * bindings/scripts/test/JS/JSreadonly.cpp:
2099         (WebCore::JSreadonlyConstructor::finishCreation):
2100
2101 2014-04-13  Simon Fraser  <simon.fraser@apple.com>
2102
2103         [iOS WK2] Hook up scrolling tree nodes when coming out of the page cache
2104         https://bugs.webkit.org/show_bug.cgi?id=131577
2105
2106         Reviewed by Tim Horton.
2107
2108         The call to scrollingCoordinator->frameViewRootLayerDidChange() was inside
2109         a #if !PLATFORM(IOS) block, but now that we use the ScrollingCoordinator
2110         for WK2 we want to call this.
2111
2112         * loader/HistoryController.cpp:
2113         (WebCore::HistoryController::restoreScrollPositionAndViewState):
2114
2115 2014-04-13  Zan Dobersek  <zdobersek@igalia.com>
2116
2117         Unreviewed build fix after r167196.
2118
2119         * platform/RemoteCommandListener.cpp:
2120         (WebCore::RemoteCommandListener::create): Fall back to using the new operator
2121         for allocating RemoteCommandListener object. Using std::make_unique() requires
2122         for the operator to be public, which doesn't work well with the static create()
2123         method.
2124
2125 2014-04-13  Zan Dobersek  <zdobersek@igalia.com>
2126
2127         Remove unnecessary uses of std::move() in return statements
2128         https://bugs.webkit.org/show_bug.cgi?id=131457
2129
2130         Reviewed by Darin Adler.
2131
2132         Don't use std::move() in return statements unless necessary as it inhibits
2133         named return value optimizations as performed by compilers.
2134
2135         * Modules/battery/BatteryManager.cpp:
2136         (WebCore::BatteryManager::create):
2137         * html/FormController.cpp:
2138         (WebCore::FormController::createSavedFormStateMap):
2139         * html/canvas/WebGLRenderingContext.cpp:
2140         (WebCore::WebGLRenderingContext::create):
2141         * platform/RemoteCommandListener.cpp:
2142         (WebCore::RemoteCommandListener::create):
2143         * platform/graphics/ca/GraphicsLayerCA.cpp:
2144         (WebCore::GraphicsLayer::create):
2145         * platform/ios/RemoteCommandListenerIOS.mm:
2146         (WebCore::RemoteCommandListener::create):
2147         * rendering/RenderGrid.cpp:
2148         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
2149         * rendering/RenderLayer.cpp:
2150         (WebCore::RenderLayer::setupFilters):
2151         * rendering/style/CounterDirectives.cpp:
2152         (WebCore::clone):
2153
2154 2014-04-13  Commit Queue  <commit-queue@webkit.org>
2155
2156         Unreviewed, rolling out r167168 and r167194.
2157         https://bugs.webkit.org/show_bug.cgi?id=131589
2158
2159         Caused massive ASSERTION failures on the GTK Debug bot
2160         (Requested by philn on #webkit).
2161
2162         Reverted changesets:
2163
2164         "[GTK] Add HighDPI support for non-accelerated compositing
2165         contents"
2166         https://bugs.webkit.org/show_bug.cgi?id=131562
2167         http://trac.webkit.org/changeset/167168
2168
2169         "Unreviewed. Fix GTK+ build with recent cairo and GTK+ after
2170         r167168."
2171         http://trac.webkit.org/changeset/167194
2172
2173 2014-04-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2174
2175         [GStreamer] No CORS support for media elements
2176         https://bugs.webkit.org/show_bug.cgi?id=99037
2177
2178         Reviewed by Philippe Normand.
2179
2180         Added CORS access control check to media sources when crossorigin attribute is set.
2181
2182         Added getter to CORS access control check status (used to compute whether the stream is tainted or not).
2183         Related test is http/tests/security/video-cross-origin-readback.html.
2184
2185         Disabled access to cross-origin streams that fail CORS check when crossorigin attribute is set.
2186         Related test is http/tests/security/video-cross-origin-accessfailure.html.
2187
2188         Tests: http/tests/security/video-cross-origin-accessfailure.html
2189                http/tests/security/video-cross-origin-accesssameorigin.html
2190
2191         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2192         (WebCore::MediaPlayerPrivateGStreamer::didPassCORSAccessCheck): Return whether media is cross-origin (tainted) or not by querying the gstreamer source layer.
2193         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added MediaPlayerPrivateGStreamer::didPassCORSAccessCheck declaration.
2194         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2195         (webKitWebSrcStart): Passed CORS mode parameter to the streaming client. In case of CORS check failure, stop the resource loading.
2196         (webKitSrcPassedCORSAccessCheck): Return whether CORS access control check was done and successful.
2197         (StreamingClient::handleResponseReceived): Take a parameter to assign the CORS access control check result.
2198         (CachedResourceStreamingClient::CachedResourceStreamingClient): Updated setting of the ResourceLoaderOptions according CORS mode.
2199         (CachedResourceStreamingClient::responseReceived): Check CORS and pass result to handleResponseReceived.
2200         (ResourceHandleStreamingClient::didReceiveResponse): No CORS check.
2201         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Added webKitSrcPassedCORSAccessCheck declaration.
2202
2203 2014-04-12  Darin Adler  <darin@apple.com>
2204
2205         REGRESSION (r166860): ASSERTION FAILED: !isCalculated() on fast/css/image-set-value-not-removed-crash.html
2206         https://bugs.webkit.org/show_bug.cgi?id=131480
2207
2208         Reviewed by Andreas Kling.
2209
2210         Fixes intermittent assertion failure in fast/css/image-set-value-not-removed-crash.html.
2211
2212         * css/CSSComputedStyleDeclaration.cpp:
2213         (WebCore::valueForImageSliceSide): Added. Helper used below in valueForNinePieceImageSlice.
2214         Handles calculated values by returning 0; incorrect but predictable.
2215         (WebCore::valueForNinePieceImageSlice): Updated to call valueForImageSliceSide.
2216         (WebCore::positionOffsetValue): Use nullptr.
2217         (WebCore::ComputedStyleExtractor::propertyValue): Updated to call positionOffsetValue
2218         by its new name. Removed "get" from the name.
2219         (WebCore::positionOffsetValue): Renamed from getPositionOffsetValue.
2220
2221         * platform/Length.h: Made isCalculated public.
2222
2223 2014-04-12  Andy Estes  <aestes@apple.com>
2224
2225         Fix the iOS build after r167183.
2226
2227         * platform/network/ResourceHandle.h:
2228         * platform/network/cf/ResourceHandleCFNet.cpp:
2229         (WebCore::ResourceHandle::schedule):
2230         (WebCore::ResourceHandle::unschedule):
2231
2232 2014-04-12  Andy Estes  <aestes@apple.com>
2233
2234         [iOS] Move QuickLookHandle from ResourceLoader to WebResourceLoader
2235         https://bugs.webkit.org/show_bug.cgi?id=131580
2236
2237         Reviewed by Darin Adler.
2238
2239         There's no need to bloat WebKit1's ResourceLoader with a pointer that
2240         only WebKit2's WebResourceLoader cares about.
2241
2242         * loader/ResourceLoader.h:
2243         (WebCore::ResourceLoader::quickLookHandle): Deleted.
2244         (WebCore::ResourceLoader::setQuickLookHandle): Deleted.
2245
2246 2014-04-12  Chris Fleizach  <cfleizach@apple.com>
2247
2248         AX: Cleanup AccessibilityObject::getAttribute
2249         https://bugs.webkit.org/show_bug.cgi?id=131555
2250
2251         Reviewed by Darin Adler.
2252
2253         No new functionality.
2254
2255         * accessibility/AccessibilityObject.cpp:
2256         (WebCore::AccessibilityObject::getAttribute):
2257
2258 2014-04-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2259
2260         [SOUP] Libsoup internal credential setting should be controlled by loader decision
2261         https://bugs.webkit.org/show_bug.cgi?id=130963
2262
2263         Reviewed by Darin Adler.
2264
2265         Disabled libsoup internal authentication manager for messages for which no credential is available and no stored credentials should be used.
2266         Updated synchronous loader to return whether using credentials or not according StoredCredential loader option parameter.
2267         Unskipped test http/tests/xmlhttprequest/cross-origin-no-authorization.html covers the patch.
2268
2269         * platform/network/ResourceHandleInternal.h:
2270         (WebCore::ResourceHandleInternal::ResourceHandleInternal): Added m_useAuthenticationManager boolean to control whether disable authentication manager or not.
2271         * platform/network/soup/ResourceHandleSoup.cpp:
2272         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader): Added m_storedCredentials member.
2273         (WebCore::WebCoreSynchronousLoader::shouldUseCredentialStorage): Return true if stored credentials are allowed.
2274         (WebCore::applyAuthenticationToRequest): Set m_useAuthenticationManager value to disable authentication manager if cannot use stored credentials and ResourceHandleInternal has no username and password.
2275         (WebCore::createSoupMessageForHandleAndRequest): Disable authentication mananger according m_useAuthenticationManager value.
2276         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Added StoredCredentials loader option to the sync loader constructor.
2277
2278 2014-04-11  Darin Adler  <darin@apple.com>
2279
2280         Some small loader refinements and refactoring
2281         https://bugs.webkit.org/show_bug.cgi?id=131541
2282
2283         Reviewed by Alexey Proskuryakov.
2284
2285         Cut down on use of ResourceLoader::handle, which always returns null when
2286         using a network process. Also streamlined conditionals and did some other
2287         small refactoring.
2288
2289         * loader/DocumentLoader.h: Use references rather than pointers for SchedulePair.
2290
2291         * loader/ResourceLoader.cpp:
2292         (WebCore::ResourceLoader::didChangePriority): Use m_handle instead of handle(),
2293         since we'd like to delete handle() entirely soon.
2294         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge): Ditto.
2295         (WebCore::ResourceLoader::schedule): Added.
2296         (WebCore::ResourceLoader::unschedule): Ditto.
2297         * loader/ResourceLoader.h: Rearranged header to eliminate nested conditionals.
2298         Added schedule and unschedule functions for Mac.
2299
2300         * loader/mac/DocumentLoaderMac.cpp:
2301         (WebCore::scheduleAll): Changed to take a reference and call ResourceLoader::schedule.
2302         (WebCore::unscheduleAll): Ditto.
2303         (WebCore::DocumentLoader::schedule): Ditto.
2304         (WebCore::DocumentLoader::unschedule): Ditto.
2305
2306         * page/mac/PageMac.cpp:
2307         (WebCore::Page::addSchedulePair): Pass a reference rather than a pointer to schedule.
2308         (WebCore::Page::removeSchedulePair): Ditto.
2309
2310         * platform/network/ResourceHandle.h: Did a bit of reformatting and reorganizing of
2311         conditionals.
2312
2313         * platform/network/ResourceHandleInternal.h: Removed a tiny bit of unneeded declaration.
2314
2315         * platform/network/mac/ResourceHandleMac.mm:
2316         (WebCore::ResourceHandle::schedule): Updated to take a reference rather than a pointer.
2317         (WebCore::ResourceHandle::unschedule): Ditto.
2318
2319 2014-04-11  Andreas Kling  <akling@apple.com>
2320
2321         Make NodeList.length inline-cacheable by JSC.
2322         <https://webkit.org/b/131579>
2323
2324         For objects with custom index or name getters, we have to make sure
2325         that builtin properties take precedence. We do this by scanning the
2326         ancestor chain for a suitable property slot before moving on to
2327         named items.
2328
2329         With this patch, we now mark such builtins as cacheable. This is
2330         safe since the whole point of doing this before processing named
2331         items is to ensure the same slot is returned consistently.
2332
2333         Reviewed by Benjamin Poulain.
2334
2335         * bindings/scripts/CodeGeneratorJS.pm:
2336         (GenerateGetOwnPropertySlotBody):
2337
2338 2014-04-11  Tim Horton  <timothy_horton@apple.com>
2339
2340         Lots of compositing test failures after r167152
2341         https://bugs.webkit.org/show_bug.cgi?id=131574
2342
2343         Reviewed by Simon Fraser.
2344
2345         * platform/graphics/GraphicsLayer.cpp:
2346         (WebCore::GraphicsLayer::dumpProperties):
2347         We were asking the parent's client whether the child should be dumped,
2348         but really the child's client is the one who should decide.
2349
2350 2014-04-11  Benjamin Poulain  <bpoulain@apple.com>
2351
2352         ViewportConfiguration::layoutWidth() compute the width incorrectly when initial-scale+width do not fit in view
2353         https://bugs.webkit.org/show_bug.cgi?id=131575
2354
2355         Reviewed by Enrica Casucci.
2356
2357         I made a mistake when writing the new viewport code: ViewportConfiguration::layoutWidth() uses m_contentSize in one place.
2358         That make no sense, contentSize depends on the layout width.
2359
2360         * page/ViewportConfiguration.cpp:
2361         (WebCore::ViewportConfiguration::layoutWidth):
2362
2363 2014-04-11  Andreas Kling  <akling@apple.com>
2364
2365         Remove "numeric index getter" stuff from bindings code generator.
2366         <https://webkit.org/b/131565>
2367
2368         This was used for an earlier generation of typed arrays. Now that JSC
2369         has native typed array support, we're not using this functionality and
2370         can just remove it.
2371
2372         Reviewed by Geoffrey Garen.
2373
2374         * bindings/scripts/CodeGeneratorJS.pm:
2375         (GenerateGetOwnPropertySlotBody):
2376         (HasComplexGetOwnProperty):
2377         (InterfaceRequiresAttributesOnInstance):
2378         (InstanceOverridesGetOwnPropertySlot):
2379         (GenerateHeader):
2380         (GenerateImplementation):
2381
2382 2014-04-11  Brian J. Burg  <burg@cs.washington.edu>
2383
2384         Web Replay: consolidate decoding macros used in SerializationMethods
2385         https://bugs.webkit.org/show_bug.cgi?id=131564
2386
2387         Reviewed by Timothy Hatcher.
2388
2389         We can use EncodingTraits<T>::DecodedType to create a local variable
2390         with the appropriate decoded type, rather than special casing.
2391
2392         * replay/SerializationMethods.cpp:
2393         (JSC::EncodingTraits<NondeterministicInputBase>::decodeValue):
2394         (JSC::EncodingTraits<KeypressCommand>::decodeValue):
2395         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2396         (JSC::EncodingTraits<PlatformMouseEvent>::decodeValue):
2397         (JSC::EncodingTraits<PlatformWheelEvent>::decodeValue):
2398         (JSC::EncodingTraits<PluginData>::decodeValue):
2399
2400 2014-04-11  Beth Dakin  <bdakin@apple.com>
2401
2402         Need WK2 API to disable rubber-banding
2403         https://bugs.webkit.org/show_bug.cgi?id=131567
2404
2405         Reviewed by Simon Fraser.
2406
2407         Page will now store a vertical and horizontal ScrollElasticity in case the API has 
2408         been called before the FrameView even exists.
2409
2410         New Page functions.
2411         * WebCore.exp.in:
2412
2413         Use Page’s cached ScrollElasticity.
2414         * page/FrameView.cpp:
2415         (WebCore::FrameView::FrameView):
2416
2417         If there is already a FrameView, then assign it the new ScrollElasticity.
2418         * page/Page.cpp:
2419         (WebCore::Page::Page):
2420         (WebCore::Page::setVerticalScrollElasticity):
2421         (WebCore::Page::setHorizontalScrollElasticity):
2422         * page/Page.h:
2423         (WebCore::Page::verticalScrollElasticity):
2424         (WebCore::Page::horizontalScrollElasticity):
2425
2426 2014-04-11  Martin Robinson  <mrobinson@igalia.com>
2427
2428         REGRESSION(167145): Many media tests fail
2429         https://bugs.webkit.org/show_bug.cgi?id=131569
2430
2431         Reviewed by Brent Fulgham.
2432
2433         * PlatformGTK.cmake: Add the localized strings file to the list of user agent scripts.
2434         * platform/gtk/RenderThemeGtk.cpp:
2435         (WebCore::RenderThemeGtk::mediaControlsScript): Include the localized strings file in the script body.
2436
2437 2014-04-11  Tim Horton  <timothy_horton@apple.com>
2438
2439         [iOS WebKit2] Find-in-page indicator
2440         https://bugs.webkit.org/show_bug.cgi?id=131510
2441         <rdar://problem/16547777>
2442
2443         Reviewed by Simon Fraser and Enrica Casucci.
2444
2445         * editing/Editor.cpp:
2446         (WebCore::Editor::findString):
2447         * editing/FindOptions.h:
2448         Add a find option which prevents WebCore from revealing the selection
2449         after selecting a successful find match.
2450
2451 2014-04-11  Owen Taylor  <otaylor@redhat.com>
2452
2453         [GTK] Add HighDPI support for non-accelerated compositing contents
2454         https://bugs.webkit.org/show_bug.cgi?id=131562
2455
2456         Reviewed by Martin Robinson.
2457
2458         No new tests. This will be tested once we have the proper dependencies in the WebKit testing
2459         JHBuild.
2460
2461         * platform/cairo/WidgetBackingStore.h:
2462         (WebCore::WidgetBackingStore::WidgetBackingStore): Accept a device scale argument.
2463         * platform/cairo/WidgetBackingStoreCairo.cpp: Use the device scale argument to make the surface the proper size and set the surface device scale.
2464         * platform/cairo/WidgetBackingStoreCairo.h: Accept a device scale argument.
2465         * platform/graphics/cairo/CairoUtilities.cpp: Add a new helper to set the device scale if Cairo built against is new enough.
2466         * platform/graphics/cairo/CairoUtilities.h:
2467         * platform/gtk/GtkVersioning.h: Add the HAVE_GTK_SCALE_FACTOR macro.
2468         * platform/gtk/WidgetBackingStoreGtkX11.cpp: Use the device scale argument to make the surface the proper size and set the surface device scale.
2469         * platform/gtk/WidgetBackingStoreGtkX11.h: Accept a device scale argument.
2470
2471 2014-04-11  Jon Honeycutt  <jhoneycutt@apple.com>
2472
2473         Assertion failure changing select element size during focus event
2474         dispatch
2475         <https://bugs.webkit.org/show_bug.cgi?id=131566>
2476         <rdar://problem/16400735>
2477
2478         Reviewed by Andy Estes.
2479
2480         Test: fast/forms/select-change-size-during-focus.html
2481
2482         * html/HTMLSelectElement.cpp:
2483         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
2484         Adopt the fix from Chromium r171216; check that the renderer is still
2485         of the expected type, and return early if it is not.
2486
2487 2014-04-11  Bem Jones-Bey  <bjonesbe@adobe.com>
2488
2489         Clear sibling floats while splitting inline flow
2490         https://bugs.webkit.org/show_bug.cgi?id=130905
2491
2492         Reviewed by David Hyatt.
2493
2494         This is a port of a Blink patch by kenrb@chromium.org.
2495         (https://src.chromium.org/viewvc/blink?revision=169658&view=revision)
2496
2497         During RenderInline::splitFlow(), floats are cleared on an anonymous
2498         containingBlock() for the inline being split. This is a problem if
2499         siblings of the block contain references to the same floats, since the
2500         float removal code in markSiblingsWithFloatsForLayout() will not later
2501         find them.
2502
2503         This change also affects RenderBlock::splitFlow() and
2504         RenderBoxModelObject::moveChildrenTo, since those are called in
2505         similar situations as RenderInline::splitFlow().
2506
2507         Test: fast/block/float/split-inline-sibling-of-float-crash.html
2508
2509         * rendering/RenderBlockFlow.cpp:
2510         (WebCore::RenderBlockFlow::removeFloatingObjects): Add call to
2511             markSiblingsWithFloatsForLayout() before removing floats.
2512
2513 2014-04-11  Gavin Barraclough  <baraclough@apple.com>
2514
2515         Rollout - Rewrite Function.bind as a builtin
2516         https://bugs.webkit.org/show_bug.cgi?id=131083
2517
2518         Unreviewed.
2519
2520         Rolling out r167020 while investigating a performance regression.
2521
2522         * bindings/js/JSImageConstructor.cpp:
2523         (WebCore::JSImageConstructor::finishCreation):
2524         * bindings/scripts/CodeGeneratorJS.pm:
2525         (GenerateConstructorHelperMethods):
2526         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2527         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
2528         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2529         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
2530         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2531         (WebCore::JSTestEventConstructorConstructor::finishCreation):
2532         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2533         (WebCore::JSTestEventTargetConstructor::finishCreation):
2534         * bindings/scripts/test/JS/JSTestException.cpp:
2535         (WebCore::JSTestExceptionConstructor::finishCreation):
2536         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2537         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
2538         * bindings/scripts/test/JS/JSTestInterface.cpp:
2539         (WebCore::JSTestInterfaceConstructor::finishCreation):
2540         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2541         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
2542         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2543         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
2544         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
2545         * bindings/scripts/test/JS/JSTestNode.cpp:
2546         (WebCore::JSTestNodeConstructor::finishCreation):
2547         * bindings/scripts/test/JS/JSTestObj.cpp:
2548         (WebCore::JSTestObjConstructor::finishCreation):
2549         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2550         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
2551         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2552         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
2553         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2554         (WebCore::JSTestTypedefsConstructor::finishCreation):
2555         * bindings/scripts/test/JS/JSattribute.cpp:
2556         (WebCore::JSattributeConstructor::finishCreation):
2557         * bindings/scripts/test/JS/JSreadonly.cpp:
2558         (WebCore::JSreadonlyConstructor::finishCreation):
2559
2560 2014-04-11  Myles C. Maxfield  <mmaxfield@apple.com>
2561
2562         Build Fix after r167151.
2563
2564         Unreviewed.
2565
2566         * editing/AlternativeTextController.cpp:
2567         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2568
2569 2014-04-10  Jer Noble  <jer.noble@apple.com>
2570
2571         [EME][Mac] Using KeySession.update([renew]) should trigger KeyMessage event instead of NeedKey event
2572         https://bugs.webkit.org/show_bug.cgi?id=131527
2573
2574         Reviewed by Eric Carlson.
2575
2576         Rather than triggering a needKey() event, necessatating the creation
2577         of an entirely new MediaKeySession, cause a new key request to be
2578         created by sending the same initData back into the AVSampleDataParser.
2579
2580         Also, do some drive-by clean up suggested by Darin in the review for
2581         r166509.
2582
2583         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2584         (WebCore::isEqual): Support an alloc-free equality check between
2585             Uint8Array and static strings.
2586         (WebCore::CDMSessionMediaSourceAVFObjC::update):
2587
2588 2014-04-11  David Kilzer  <ddkilzer@apple.com>
2589
2590         Build fix (r167151): Do not dereference Node::document() before passing to Range::create()
2591         <https://webkit.org/b/131475>
2592
2593         Fixes the following build failure:
2594
2595             WebCore/editing/AlternativeTextController.cpp:275:71: error: indirection requires pointer operand ('WebCore::Document' invalid)
2596                 int paragraphStartIndex = TextIterator::rangeLength(Range::create(*rootNode.document(), &rootNode, 0, paragraphRangeContainingCorrection.get()->startContainer(), paragraphRangeContainingCorrection.get()->startOffset()).get());
2597                                                                                   ^~~~~~~~~~~~~~~~~~~~
2598
2599         * editing/AlternativeTextController.cpp:
2600         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2601         Remove unneeded '*' operator since Node::document() returns a
2602         Document& and Range::create() accepts a Document& for its first
2603         argument.
2604
2605 2014-04-11  Brian J. Burg  <burg@cs.washington.edu>
2606
2607         Web Replay: memoize nondeterministic attributes of the Navigator interface
2608         https://bugs.webkit.org/show_bug.cgi?id=131340
2609
2610         Reviewed by Timothy Hatcher.
2611
2612         Most attributes of window.navigator do not change very often, but they
2613         could be easily changed by the user or embedder. So, memoize attribute values.
2614
2615         This change does not include navigator.mimeTypes and navigator.plugins,
2616         which will be handled at a different level. <https://webkit.org/b/131341>
2617
2618         Test: ManualTests/inspector/replay-window-navigator-basic.html
2619
2620         * page/Navigator.idl: Add Nondeterministic attribute.
2621
2622 2014-04-10  Jer Noble  <jer.noble@apple.com>
2623
2624         [iOS][WK2] Videos should animate into and out of fullscreen.
2625         https://bugs.webkit.org/show_bug.cgi?id=131497
2626
2627         Reviewed by Simon Fraser.
2628
2629         Use AVPlayerViewController's new enterFullScreenWithCompletionHandler: and exitFullScreenWithCompletionHandler:
2630         methods to animate into and out of full screen. To do so, use the provided initialFrame and finalFrame screen
2631         rects to correctly place the AVPlayerViewController's view before entering or exiting fullscreen.
2632
2633         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2634         (-[WebVideoFullscreenController enterFullscreen:]): Pass the media element's screen rect.
2635         (-[WebVideoFullscreenController exitFullscreen]): Ditto.
2636         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2637         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2638         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Renamed from shouldDismissWithReason.
2639         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Use the new AVKit APIs.
2640         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Ditto.
2641         * WebCore.exp.in: Modify the exported symbols for enter and exitFullscreen.
2642
2643 2014-04-11  Tim Horton  <timothy_horton@apple.com>
2644
2645         Support document-relative and custom-frame page overlays
2646         https://bugs.webkit.org/show_bug.cgi?id=131560
2647         <rdar://problem/16595556>
2648
2649         Reviewed by Simon Fraser.
2650
2651         * WebCore.exp.in:
2652         * rendering/RenderLayerCompositor.cpp:
2653         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2654         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2655         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer):
2656         * rendering/RenderLayerCompositor.h:
2657         Add the concept of a document overlay layer, which is plugged in as the
2658         last child of the root content layer. Expose it to WebKit2.
2659
2660 2014-04-09  Myles C. Maxfield  <mmaxfield@apple.com>
2661
2662         Autocorrection causes ASSERT when replacing alternative string
2663         https://bugs.webkit.org/show_bug.cgi?id=131475
2664
2665         Reviewed by Ryosuke Niwa.
2666
2667         In AlternativeTextController::applyAlternativeTextToRange(), we attempt to create
2668         a Range that crosses from outside of a shadow root to inside of one. Instead,
2669         we should keep the Range entirely within the shadow root.
2670
2671         Test: ManualTests/autocorrection/autocorrection-accept-crash.html
2672
2673         * editing/AlternativeTextController.cpp:
2674         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2675
2676 2014-04-11  Hans Muller  <hmuller@adobe.com>
2677
2678         [CSS Shapes] shape-outside from image doesn't load properly
2679         https://bugs.webkit.org/show_bug.cgi?id=131491
2680
2681         Reviewed by Bem Jones-Bey.
2682
2683         Make RenderImage::imageChanged() call super if there's a shape-outside
2684         image because the shape-outside imageChanged() logic is in RenderBox.
2685
2686         Test: http/tests/css/shape-image-file.html
2687
2688         * rendering/RenderElement.h:
2689         (WebCore::RenderElement::hasShapeOutside):
2690         * rendering/RenderImage.cpp:
2691         (WebCore::RenderImage::imageChanged):
2692
2693 2014-04-11  Brady Eidson  <beidson@apple.com>
2694
2695         Aggregate multiple "respondToChangedSelection" calls to one scan for telephone numbers
2696         https://bugs.webkit.org/show_bug.cgi?id=131559
2697
2698         Reviewed by Gavin Barraclough.
2699
2700         No new tests (Perf-only change to an untested feature)
2701
2702         * editing/Editor.cpp:
2703         (WebCore::Editor::Editor):
2704         (WebCore::Editor::respondToChangedSelection): Start a one shot timer for scanSelectionForTelephoneNumbers
2705           instead of scanning synchronously.
2706         (WebCore::Editor::scanSelectionForTelephoneNumbers):
2707         * editing/Editor.h:
2708
2709 2014-04-11  Antti Koivisto  <antti@apple.com>
2710
2711         Try to fix windows build.
2712         
2713         * platform/graphics/ca/GraphicsLayerCA.h:
2714
2715 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
2716
2717         Unreviewed follow-up for r167145
2718
2719         * English.lproj/mediaControlsLocalizedStringsiOS.js:
2720         (mediaControlsLocalizedStringsiOS): Use smart-quote in
2721         message string.
2722
2723 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
2724
2725         Regression: media controls and status messages are no longer localized.
2726         https://bugs.webkit.org/show_bug.cgi?id=120956
2727
2728         Reviewed by Jer Noble.
2729
2730         * English.lproj/mediaControlsLocalizedStrings.js: Added.
2731         (mediaControlsLocalizedStrings): Moved from mediaControlsApple.js.
2732         * English.lproj/mediaControlsLocalizedStringsiOS.js: Added.
2733         (mediaControlsLocalizedStringsiOS): Moved from mediaControlsiOS.js.
2734         * Modules/mediacontrols/mediaControlsApple.js:
2735         (Controller.prototype.UIString): Get strings from external file.
2736         * Modules/mediacontrols/mediaControlsiOS.js:
2737         (ControllerIOS.prototype.UIString): Ditto.
2738         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Copy to Windows bundle.
2739         * WebCore.xcodeproj/project.pbxproj: Copy new files to bundle.
2740         * rendering/RenderThemeIOS.mm:
2741         (WebCore::RenderThemeIOS::mediaControlsScript): Load the locale-specific
2742         string resource when loading the media controls.
2743         * rendering/RenderThemeMac.mm:
2744         (WebCore::RenderThemeMac::mediaControlsScript): Ditto.
2745         * rendering/RenderThemeWin.cpp:
2746         (WebCore::RenderThemeWin::mediaControlsScript): Ditto.
2747
2748 2014-04-11  Brent Fulgham  <bfulgham@apple.com>
2749
2750         [Win] Build fix after r167138
2751
2752         * platform/graphics/ca/GraphicsLayerCA.h: The TileController is
2753         only available on Mac/Cocoa builds.
2754
2755 2014-04-11  Mark Lam  <mark.lam@apple.com>
2756
2757         JSMainThreadExecState::call() should clear exceptions before returning.
2758         <https://webkit.org/b/131530>
2759
2760         Reviewed by Geoffrey Garen.
2761
2762         Test: fast/dom/regress-131530.html
2763
2764         Previously, JSMainThreadExecState::call() did not clear any pending
2765         exceptions in the VM before returning.  On returning, the
2766         JSMainThreadExecState destructor may re-enter the VM to notify
2767         MutationObservers.  This may result in a crash because the VM expects
2768         exceptions to be cleared at entry.
2769
2770         We now change JSMainThreadExecState::call() to return the exception
2771         (if present) via an argument, and clear it from the VM before returning.
2772
2773         As part of this change, I updated various parts of the code base to use the
2774         new API as needed.
2775
2776         * bindings/js/JSCallbackData.cpp:
2777         (WebCore::JSCallbackData::invokeCallback):
2778         * bindings/js/JSCustomXPathNSResolver.cpp:
2779         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
2780         * bindings/js/JSDOMGlobalObjectTask.cpp:
2781         - Assert that there's no unhandled exception after the Microtask returns.
2782           See comment for WebCore::JSMainThreadExecState::runTask below for more
2783           details.
2784
2785         * bindings/js/JSErrorHandler.cpp:
2786         (WebCore::JSErrorHandler::handleEvent):
2787         * bindings/js/JSEventListener.cpp:
2788         (WebCore::JSEventListener::handleEvent):
2789         * bindings/js/JSHTMLDocumentCustom.cpp:
2790         (WebCore::JSHTMLDocument::open):
2791         - Document.open() cannot be the first function on the JS stack.  Hence,
2792           there is no need to use JSMainThreadExecState to call into the VM, as
2793           this is only needed to catch the event of returning from the first
2794           function for the purpose of notifying MutationObservers.  Change to
2795           call JSC::call() directly.
2796
2797         * bindings/js/JSMainThreadExecState.cpp:
2798         (WebCore::functionCallHandlerFromAnyThread):
2799         * bindings/js/JSMainThreadExecState.h:
2800         (WebCore::JSMainThreadExecState::call):
2801         (WebCore::JSMainThreadExecState::evaluate):
2802         - Remove the explicitly acquisition of the JSLock here because we now
2803           acquire the JSLock as part of the JSMainThreadExecState instance.
2804         (WebCore::JSMainThreadExecState::runTask):
2805         - Added an assert to verify that the task does not return with an
2806           unhandled exception.  Currently, the only Microtask in use is for the
2807           Promise implementation, which will eat the exception before returning.
2808           This assertion is added here to verify that this contract does not
2809           inadvertantly change in the future.
2810         (WebCore::JSMainThreadExecState::JSMainThreadExecState):
2811         - Now acquires the JSLock as well since by definition, we're only
2812           instantiating the JSMainThreadExecState because we're about to enter
2813           the VM.
2814
2815         * bindings/js/JSMutationCallback.cpp:
2816         (WebCore::JSMutationCallback::call):
2817         * bindings/js/JSNodeFilterCondition.cpp:
2818         (WebCore::JSNodeFilterCondition::acceptNode):
2819         - acceptNode() is only used in the TreeWalker and NodeIterator APIs which
2820           cannot be the first function on the JS stack.  Hence, we should call
2821           JSC::call() directly instead of going through JSMainThreadExecState.
2822
2823         * bindings/js/ScheduledAction.cpp:
2824         (WebCore::ScheduledAction::executeFunctionInContext):
2825         * bindings/objc/WebScriptObject.mm:
2826         (WebCore::addExceptionToConsole):
2827         (-[WebScriptObject callWebScriptMethod:withArguments:]):
2828
2829 2014-04-11  Brian J. Burg  <burg@cs.washington.edu>
2830
2831         Web Replay: CodeGeneratorJS should guard includes of replay-related headers
2832         https://bugs.webkit.org/show_bug.cgi?id=131407
2833
2834         Reviewed by Timothy Hatcher.
2835
2836         This patch adds guards to headers that are only required by generated replay code
2837         that is itself guarded. Other ports probably haven't added the headers to their
2838         build files, so we don't want to emit the unused header includes.
2839
2840         This patch also converts generated uses of DEFINE_STATIC_LOCAL to NeverDestroyed<T>.
2841         Finally, a new bindings test was added to document changes to generated replay code.
2842
2843         Test: Source/WebCore/bindings/scripts/test/TestNondeterministic.idl
2844
2845         * bindings/scripts/CodeGeneratorJS.pm:
2846         (GenerateImplementation):
2847         (GenerateImplementationFunctionCall):
2848
2849         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.cpp: Added.
2850         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.h: Added.
2851         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministic.symbols: Added.
2852         * bindings/scripts/test/GObject/WebKitDOMTestNondeterministicPrivate.h: Added.
2853         * bindings/scripts/test/JS/JSTestNondeterministic.cpp: Added.
2854         * bindings/scripts/test/JS/JSTestNondeterministic.h: Added.
2855         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h: Added.
2856         * bindings/scripts/test/ObjC/DOMTestNondeterministic.mm: Added.
2857         * bindings/scripts/test/ObjC/DOMTestNondeterministicInternal.h: Added.
2858         * bindings/scripts/test/TestNondeterministic.idl: Added.
2859
2860 2014-04-11  Antti Koivisto  <antti@apple.com>
2861
2862         Pipe initial scale factor to TileController
2863         https://bugs.webkit.org/show_bug.cgi?id=131521
2864
2865         Reviewed by Tim Horton.
2866
2867         * WebCore.exp.in:
2868         * page/Page.cpp:
2869         (WebCore::Page::Page):
2870         (WebCore::Page::setZoomedOutPageScaleFactor):
2871         * page/Page.h:
2872         (WebCore::Page::zoomedOutPageScaleFactor):
2873         * platform/graphics/GraphicsLayerClient.h:
2874         (WebCore::GraphicsLayerClient::zoomedOutPageScaleFactor):
2875         * platform/graphics/TiledBacking.h:
2876         * platform/graphics/ca/GraphicsLayerCA.cpp:
2877         (WebCore::GraphicsLayerCA::updateContentsScale):
2878         * platform/graphics/ca/GraphicsLayerCA.h:
2879         * platform/graphics/ca/mac/TileController.h:
2880         * platform/graphics/ca/mac/TileController.mm:
2881         (WebCore::TileController::TileController):
2882         (WebCore::TileController::setContentsScale):
2883         (WebCore::TileController::setZoomedOutContentsScale):
2884         * rendering/RenderLayerBacking.cpp:
2885         (WebCore::RenderLayerBacking::zoomedOutPageScaleFactor):
2886         * rendering/RenderLayerBacking.h:
2887         * rendering/RenderLayerCompositor.cpp:
2888         (WebCore::RenderLayerCompositor::zoomedOutPageScaleFactor):
2889         * rendering/RenderLayerCompositor.h:
2890
2891 2014-04-10  Chris Fleizach  <cfleizach@apple.com>
2892
2893         Heap-use-after-free in WebCore::SpeechSynthesisUtterance::startTime
2894         https://bugs.webkit.org/show_bug.cgi?id=131482
2895
2896         Reviewed by David Kilzer.
2897
2898         Hold onto the utterance until it has time to fire, in case other references have been removed.
2899
2900         Merged from Blink r171077 by <dmazzoni@chromium.org>
2901
2902         Test: platform/mac/fast/speechsynthesis/speech-synthesis-gc-utterance-crash.html
2903
2904         * Modules/speech/SpeechSynthesis.cpp:
2905         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
2906
2907 2014-04-11  Zan Dobersek  <zdobersek@igalia.com>
2908
2909         Avoid Vector copies in RenderGrid::placeItemsOnGrid()
2910         https://bugs.webkit.org/show_bug.cgi?id=131452
2911
2912         Reviewed by Sergio Villar Senin.
2913
2914         * rendering/RenderGrid.cpp:
2915         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid): Take in a const reference to the
2916         Vector object. Make the for-loop that iterates through it range-based.
2917         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Ditto.
2918         * rendering/RenderGrid.h:
2919
2920 2014-04-11  Joseph Pecoraro  <pecoraro@apple.com>
2921
2922         Web Inspector: Remove shared PageScriptDebugServer, create per-Page
2923         https://bugs.webkit.org/show_bug.cgi?id=131523
2924
2925         Reviewed by Timothy Hatcher.
2926
2927         Having a shared PageScriptDebugServer was causing issues when we called
2928         JSC::Debugger::clearBreakpoints() closing one inspector while another
2929         is open for another WebCore::Page in the same process. Having the same
2930         JSC::Debugger underlying multiple InspectorDebuggerAgent instances
2931         means that when clearBreakpoints is called, the real JSC breakpoints
2932         underlying other InspectorDebuggerAgent's get removed. When those
2933         InspectorDebuggerAgents attempt to remove their breakpoints they
2934         encounter unexpected issues.
2935
2936         This entirely rebuilds PageScriptDebugServer to be per-Page instead
2937         of shared across all pages. So take this opportunity to move the
2938         file from WebCore/bindings/js to WebCore/inspector.
2939
2940         * CMakeLists.txt:
2941         * WebCore.vcxproj/WebCore.vcxproj:
2942         * WebCore.vcxproj/WebCore.vcxproj.filters:
2943         * WebCore.xcodeproj/project.pbxproj:
2944         * bindings/js/JSBindingsAllInOne.cpp:
2945         * bindings/js/PageScriptDebugServer.h: Removed.
2946         * inspector/InspectorAllInOne.cpp:
2947         Move PageScriptDebugServer.
2948
2949         * inspector/InspectorController.h:
2950         * inspector/InspectorController.cpp:
2951         (WebCore::InspectorController::InspectorController):
2952         Set the ScriptDebugServer directly on some other agents that
2953         were previously using the global debug server.
2954
2955         * inspector/InspectorProfilerAgent.h:
2956         (WebCore::InspectorProfilerAgent::scriptDebugServer):
2957         * inspector/InspectorProfilerAgent.cpp:
2958         (WebCore::InspectorProfilerAgent::InspectorProfilerAgent):
2959         (WebCore::InspectorProfilerAgent::setScriptDebugServer):
2960         (WebCore::InspectorProfilerAgent::start):
2961         (WebCore::InspectorProfilerAgent::willDestroyFrontendAndBackend): Deleted.
2962         * inspector/InspectorTimelineAgent.h:
2963         * inspector/InspectorTimelineAgent.cpp:
2964         (WebCore::InspectorTimelineAgent::start):
2965         (WebCore::InspectorTimelineAgent::stop):
2966         (WebCore::InspectorTimelineAgent::setPageScriptDebugServer):
2967         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2968         Refactor these two agents to take in a script debug server.
2969         The server is expected to be set during initialization and
2970         to always be valid (like debug server on RuntimeAgent).
2971
2972         * inspector/PageDebuggerAgent.h:
2973         * inspector/PageDebuggerAgent.cpp:
2974         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2975         (WebCore::PageDebuggerAgent::startListeningScriptDebugServer):
2976         (WebCore::PageDebuggerAgent::stopListeningScriptDebugServer):
2977         (WebCore::PageDebuggerAgent::scriptDebugServer):
2978         Have PageDebuggerAgent hold the PageScriptDebugServer.
2979         Update for the simplified interfaces.
2980
2981         * inspector/PageScriptDebugServer.h: Added.
2982         * inspector/PageScriptDebugServer.cpp: Renamed from Source/WebCore/bindings/js/PageScriptDebugServer.cpp.
2983         (WebCore::PageScriptDebugServer::PageScriptDebugServer):
2984         (WebCore::PageScriptDebugServer::addListener):
2985         (WebCore::PageScriptDebugServer::removeListener):
2986         (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
2987         (WebCore::PageScriptDebugServer::didPause):
2988         (WebCore::PageScriptDebugServer::didContinue):
2989         (WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
2990         (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
2991         (WebCore::PageScriptDebugServer::isContentScript):
2992         (WebCore::PageScriptDebugServer::reportException):
2993         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
2994         Model after JSGlobalObjectScriptDebugServer, the PageScriptDebugServer
2995         holds a reference to a Page.
2996
2997 2014-04-11  Bear Travis  <betravis@adobe.com>
2998
2999         [CSS Shapes] inset args and radial args should serialize to the simplest form
3000         https://bugs.webkit.org/show_bug.cgi?id=129825
3001
3002         Reviewed by Dirk Schulze.
3003
3004         Modify inset serialization to omit components where possible. The insets simplify
3005         according to the margin shorthand, while the corner radii simplify according to
3006         the border-radius shorthand.
3007
3008         Modifying existing parsing tests.
3009
3010         * css/CSSBasicShapes.cpp:
3011         (WebCore::buildInsetRadii): Add the necessary radii, omitting components where possible.
3012         (WebCore::buildInsetString): Omit components where possible.
3013
3014 2014-04-11  Praveen R Jadhav  <praveen.j@samsung.com>
3015
3016         "playbackTime" parameter is not present in AudioProcessingEvent Interface as per W3C spec
3017         https://bugs.webkit.org/show_bug.cgi?id=105518
3018
3019         Reviewed by Jer Noble.
3020
3021         Attribute "playbackTime" in AudioProcessingEvent implemented to pass playback time of
3022         audiobuffer associated with ScriptProcessorNode of the context.
3023  
3024         Reference: https://codereview.chromium.org/210973002
3025
3026         Spec: http://www.w3.org/TR/webaudio/#AudioProcessingEvent
3027
3028         Test: webaudio/audioprocessingevent.html
3029
3030         * Modules/webaudio/AudioProcessingEvent.cpp:
3031         (WebCore::AudioProcessingEvent::create):
3032         (WebCore::AudioProcessingEvent::AudioProcessingEvent):
3033         * Modules/webaudio/AudioProcessingEvent.h:
3034         (WebCore::AudioProcessingEvent::playbackTime):
3035         * Modules/webaudio/AudioProcessingEvent.idl:
3036         * Modules/webaudio/ScriptProcessorNode.cpp:
3037         (WebCore::ScriptProcessorNode::fireProcessEvent):
3038
3039 2014-04-11  Zalan Bujtas  <zalan@apple.com>
3040
3041         Subpixel rendering: WK1: Trail of cruft in redraw during animations.
3042         https://bugs.webkit.org/show_bug.cgi?id=131525
3043
3044         Reviewed by Simon Fraser.
3045
3046         Use enclosing rect instead of snapping to make sure the repaint rect always
3047         covers the dirty area when painting is requested in a non-compositing RenderView.
3048         This only applies to WK1 as WK2 has compositing RenderView and the repainting 
3049         is managed by RenderLayerBacking.
3050
3051         This is a temporary solution until after ScrollView/FrameView/RenderView
3052         is transitioned to device pixels. (tracked here: webkit.org/b/131526).
3053
3054         Test: fast/repaint/hidpi-block-width-change-leaves-cruft.html
3055
3056         * rendering/RenderView.cpp:
3057         (WebCore::RenderView::repaintViewRectangle):
3058
3059 2014-04-10  Dean Jackson  <dino@apple.com>
3060
3061         WebGL: need error checking after texture uploads
3062         https://bugs.webkit.org/show_bug.cgi?id=62902
3063         rdar://problem/9640309
3064
3065         Reviewed by Brent Fulgham.
3066
3067         A followup to Darin's r167109. We need to also check for errors
3068         in the texImage2D case.
3069
3070         This is difficult to reproducibly test because it would require
3071         attempting to exhaust GPU memory.
3072
3073         * html/canvas/WebGLRenderingContext.cpp:
3074         (WebCore::WebGLRenderingContext::compressedTexImage2D): Check for errors by calling
3075         moveErrorsToSyntheticErrorList twice, once before and once after. If an error
3076         occurred, explicitly mark the texture as invalid.
3077         (WebCore::WebGLRenderingContext::texImage2DBase): Ditto.
3078         * html/canvas/WebGLTexture.cpp:
3079         (WebCore::WebGLTexture::markInvalid): If the LevelInfo exists for this
3080         mipmap level, then set the valid flag to false. There is a chance that
3081         a previous call to texImage2D succeeded for this level, but it's probably
3082         better to assume that is now invalid.
3083         * html/canvas/WebGLTexture.h: New markInvalid method.
3084
3085 2014-04-10  Darin Adler  <darin@apple.com>
3086
3087         WebGL: need error checking after texture and buffer uploads in some cases
3088         https://bugs.webkit.org/show_bug.cgi?id=62902
3089         rdar://problem/9640309
3090
3091         Reviewed by Dean Jackson.
3092
3093         Not clear how to write a test for this.
3094
3095         * html/canvas/WebGLBuffer.cpp:
3096         (WebCore::WebGLBuffer::disassociateBufferData): Added.
3097         * html/canvas/WebGLBuffer.h: Added disassociateBufferData.
3098
3099         * html/canvas/WebGLRenderingContext.cpp:
3100         (WebCore::WebGLRenderingContext::bufferData): Check for errors by calling
3101         moveErrorsToSyntheticErrorList twice, once before and once after. If an error
3102         occurred, call the WebGLBuffer so it doesn't think it has data.
3103         (WebCore::WebGLRenderingContext::bufferSubData): Ditto.
3104
3105         * platform/graphics/GraphicsContext3D.h: Added moveErrorsToSyntheticErrorList.
3106
3107         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3108         (WebCore::GraphicsContext3D::moveErrorsToSyntheticErrorList): Added. Calls
3109         glError and moves any errors to the synthetic error list.
3110         (WebCore::GraphicsContext3D::getError): Added call to moveErrorsToSyntheticErrorList
3111         to preserve error ordering.
3112         (WebCore::GraphicsContext3D::synthesizeGLError): Ditto.
3113
3114 2014-04-10  Enrica Casucci  <enrica@apple.com>
3115
3116         iOS build fix to deal with CoreText changes.
3117         
3118         Reviewed by Benjamin Poulain.
3119         
3120         This is a temporary fix until CT fixes the issue.
3121
3122         * rendering/RenderThemeIOS.mm:
3123
3124 2014-04-10  Commit Queue  <commit-queue@webkit.org>
3125
3126         Unreviewed, rolling out r167073.
3127         https://bugs.webkit.org/show_bug.cgi?id=131516
3128
3129         This patch caused crashes in video tests. (Requested by
3130         mrobinson on #webkit).
3131
3132         Reverted changeset:
3133
3134         "[GStreamer] No CORS support for media elements"
3135         https://bugs.webkit.org/show_bug.cgi?id=99037
3136         http://trac.webkit.org/changeset/167073
3137
3138 2014-04-10  Beth Dakin  <bdakin@apple.com>
3139
3140         Radio buttons are using the wrong sizes and margins
3141         https://bugs.webkit.org/show_bug.cgi?id=131503
3142
3143         Reviewed by Jer Noble.
3144
3145         This is a regression that I caused recently when I combined radio button and 
3146         checkbox code. 
3147         * platform/mac/ThemeMac.mm:
3148         (WebCore::paintToggleButton):
3149
3150 2014-04-08  Jon Honeycutt  <jhoneycutt@apple.com>
3151
3152         Assertion failure in WebCore::FlexBoxIterator::next()
3153         <https://bugs.webkit.org/show_bug.cgi?id=117176>
3154         <rdar://problem/14054549>
3155
3156         Code added in r115687 began removing anonymous wrappers when children
3157         become inline. However, there are some objects, like
3158         RenderDeprecatedFlexBox, whose children should always be blocks.
3159
3160         Reviewed by Tim Horton.
3161
3162         * rendering/RenderBlock.h:
3163         (WebCore::RenderBlock::canCollapseAnonymousBlockChild):
3164         Made public.
3165
3166         * rendering/RenderObject.cpp:
3167         (WebCore::RenderObject::removeAnonymousWrappersForInlinesIfNecessary):
3168         Return early if we can't collapse anonymous block children.
3169
3170 2014-04-07  Jon Honeycutt  <jhoneycutt@apple.com>
3171
3172         Assertion failure, !node || node->isElementNode(), in
3173         WebCore::RenderBlock::clone()
3174         <https://bugs.webkit.org/show_bug.cgi?id=110489>
3175         <rdar://problem/13666425>
3176
3177         Reviewed by Antti Koivisto.
3178
3179         We're ending up in RenderBlock::splitBlocks() with |this| ==
3180         |fromBlock|.  We then try to climb the ancestor block chain from
3181         this->parent() to |fromBlock|, but this->parent() is already above
3182         |fromBlock|, so we end up climbing up to the RenderView and trying to
3183         clone it, causing the assertion failure.
3184
3185         Adopt Chromium's mitigation for this from
3186         <https://codereview.chromium.org/13852041>. This is not intended as a
3187         fix for the underlying issue.
3188
3189         Also, fix another issue that occurs with this fuzzed test case that's
3190         not handled by the Chromium fix.
3191
3192         * rendering/RenderBlock.cpp:
3193         (WebCore::RenderBlock::splitBlocks):
3194         Ensure while we're in the loop that |curr| is a descendant of
3195         |fromBlock|. From the Chromium patch:
3196
3197             We need to check in every iteration of the loop because
3198             moveChildrenTo could have moved |curr|. This is a mitigation and
3199             not really a fix against a class of tree craziness.
3200
3201         Finally, before moving children from |fromBlock| to |toBlock|, ensure
3202         that the children are children of |fromBlock|. If we never entered the
3203         loop, they will be siblings of |fromBlock|, not children.
3204
3205 2014-04-10  Enrica Casucci  <enrica@apple.com>
3206
3207         Build fix after http://trac.webkit.org/changeset/167085.
3208
3209         Reviewed by Timothy Hatcher.
3210
3211         * plugins/PluginData.h:
3212
3213 2014-04-10  Zalan Bujtas  <zalan@apple.com>
3214
3215         Web Inspector: Breakpoint in gutter has clipped / broken border image.
3216         https://bugs.webkit.org/show_bug.cgi?id=131500
3217
3218         Reviewed by Joseph Pecoraro.
3219
3220         Typo in r166925.
3221
3222         Test: fast/borders/border-image-slice-missing-right.html
3223
3224         * rendering/RenderBoxModelObject.cpp:
3225         (WebCore::RenderBoxModelObject::paintNinePieceImage):
3226
3227 2014-04-10  James Craig  <jcraig@apple.com>
3228
3229         Web Inspector: AXI: expose aria-busy state of current and ancestor nodes
3230         https://bugs.webkit.org/show_bug.cgi?id=130826
3231
3232         Reviewed by Timothy Hatcher.
3233
3234         Test: inspector-protocol/dom/getAccessibilityPropertiesForNode.html
3235
3236         Expose if node is contained by any "busy" ancestor nodes, too.
3237
3238         * inspector/InspectorDOMAgent.cpp:
3239         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3240
3241 2014-04-10  Joseph Pecoraro  <pecoraro@apple.com>
3242
3243         Web Inspector: Remove unused ruler in overlay code
3244         https://bugs.webkit.org/show_bug.cgi?id=131507
3245
3246         Reviewed by Timothy Hatcher.
3247
3248         * inspector/InspectorDOMAgent.cpp:
3249         (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
3250         * inspector/InspectorOverlay.cpp:
3251         (WebCore::buildObjectForHighlight):
3252         * inspector/InspectorOverlay.h:
3253         (WebCore::Highlight::Highlight):
3254         (WebCore::Highlight::setDataFromConfig):
3255         * inspector/InspectorOverlayPage.js:
3256         (_drawFragmentHighlight):
3257         (_drawRegionNumber): Deleted.
3258         (quadToPath): Deleted.
3259         (drawOutlinedQuad): Deleted.
3260         (pathCommand): Deleted.
3261         (drawPath): Deleted.
3262         (drawOutlinedQuadWithClip): Deleted.
3263         (quadEquals): Deleted.
3264         (drawGutter): Deleted.
3265         (drawNodeHighlight): Deleted.
3266         (drawQuadHighlight): Deleted.
3267         (setPlatform): Deleted.
3268         (dispatch): Deleted.
3269         (log): Deleted.
3270
3271 2014-04-10  Brian J. Burg  <burg@cs.washington.edu>
3272
3273         Web Replay: memoize plugin data for navigator.mimeTypes and navigator.plugins
3274         https://bugs.webkit.org/show_bug.cgi?id=131341
3275
3276         Reviewed by Timothy Hatcher.
3277
3278         Information about plugins and mime types is nondeterministic and can change
3279         at any time, whether by system events, browser settings changes, or
3280         triggered by script. To avoid interposing on all those code paths, just
3281         memoize the plugin data used by DOMPluginArray and DOMMimeTypeArray.
3282
3283         This is less efficient than controlling mutations to the underlying PluginData
3284         of a Page, but that can be done later if better plugin support is desired.
3285         The point of this change is to make analytics trackers deterministic across
3286         enabling/disabling of plugins.
3287
3288         Test: LayoutTests/inspector/window-navigator-plugins-memoized.hml
3289
3290         * plugins/DOMMimeTypeArray.cpp:
3291         (WebCore::DOMMimeTypeArray::getPluginData):
3292         * plugins/DOMPluginArray.cpp:
3293         (WebCore::DOMPluginArray::pluginData): Save or restore memoized plugin
3294         data during capture and replay, respectively.
3295
3296         * plugins/PluginData.h:
3297         (WebCore::PluginData::PluginData): Add a constructor that uses the
3298         provided plugin data rather than fetching live plugin data. This is
3299         marked protected so it's only used by a subclass specifically for
3300         deserialization.
3301
3302         * replay/SerializationMethods.cpp: Add encoder specializations.
3303         (JSC::EncodingTraits<MimeClassInfo>::encodeValue):
3304         (JSC::EncodingTraits<MimeClassInfo>::decodeValue):
3305         (JSC::EncodingTraits<PluginInfo>::encodeValue):
3306         (JSC::EncodingTraits<PluginInfo>::decodeValue):
3307         (JSC::EncodingTraits<PluginData>::encodeValue):
3308         (JSC::DeserializedPluginData::DeserializedPluginData): Add a custom
3309         subclass of PluginData that can be initialized from deserialized data.
3310         (JSC::EncodingTraits<PluginData>::decodeValue):
3311         * replay/SerializationMethods.h:
3312         * replay/WebInputs.json: Add new input FetchPluginData.
3313
3314 2014-04-10  Myles C. Maxfield  <mmaxfield@apple.com>
3315
3316         Remove "System Font" from character width calculations
3317         https://bugs.webkit.org/show_bug.cgi?id=131411
3318
3319         Reviewed by Tim Horton.
3320
3321         Covered by existing tests
3322
3323         * platform/graphics/Font.cpp:
3324         (WebCore::Font::hasValidAverageCharWidth):
3325
3326 2014-04-10  Bem Jones-Bey  <bjonesbe@adobe.com>
3327
3328         Invalid cast in WebCore::RenderLayer::setupClipPath
3329         https://bugs.webkit.org/show_bug.cgi?id=131368
3330
3331         Reviewed by Dirk Schulze.
3332
3333         Only attempt to clip to a box shape if the renderer being clipped is
3334         actually a box.
3335
3336         Test: css3/masking/clip-path-box-shape-on-inline-crash.html
3337
3338         * rendering/RenderLayer.cpp:
3339         (WebCore::RenderLayer::setupClipPath): Add isBox() check.
3340
3341 2014-04-10  Owen Taylor  <otaylor@redhat.com>
3342
3343         [GTK] Remove a comment that was incorrectly cut-and-pasted from WidgetBackingStoreCairo
3344         https://bugs.webkit.org/show_bug.cgi?id=131499
3345
3346         Reviewed by Martin Robinson.
3347
3348         * platform/gtk/WidgetBackingStoreGtkX11.cpp: Remove a comment that was incorrectly copy and pasted
3349         from the Cairo implementation.
3350
3351 2014-04-09  Alexey Proskuryakov  <ap@apple.com>
3352
3353         Eliminate DragSession structure
3354         https://bugs.webkit.org/show_bug.cgi?id=131465
3355
3356         Reviewed by Benjamin Poulain.
3357
3358         DragSession is really just a transient response to NSDragDestination delegate methods.
3359         The "session" name was quite misleading, and thankfully, we don't need a class for this
3360         bag of data at all.
3361
3362         * WebCore.xcodeproj/project.pbxproj:
3363         * page/DragController.cpp:
3364         (WebCore::DragController::DragController):
3365         (WebCore::DragController::dragEntered):
3366         (WebCore::DragController::dragUpdated):
3367         (WebCore::DragController::dragEnteredOrUpdated):
3368         (WebCore::DragController::tryDocumentDrag):
3369         * page/DragController.h:
3370         (WebCore::DragController::mouseIsOverFileInput):
3371         (WebCore::DragController::numberOfItemsToBeAccepted):
3372         * page/DragSession.h: Removed.
3373
3374 2014-04-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3375
3376         [GStreamer] No CORS support for media elements
3377         https://bugs.webkit.org/show_bug.cgi?id=99037
3378
3379         Reviewed by Philippe Normand.
3380
3381         Added CORS access control check to media sources when crossorigin attribute is set.
3382
3383         Added getter to CORS access control check status (used to compute whether the stream is tainted or not).
3384         Related test is http/tests/security/video-cross-origin-readback.html.
3385
3386         Disabled access to cross-origin streams that fail CORS check when crossorigin attribute is set.
3387         Related test is http/tests/security/video-cross-origin-accessfailure.html.
3388
3389         Tests: http/tests/security/video-cross-origin-accessfailure.html
3390                http/tests/security/video-cross-origin-accesssameorigin.html
3391
3392         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3393         (WebCore::MediaPlayerPrivateGStreamer::didPassCORSAccessCheck): Return whether media is cross-origin (tainted) or not by querying the gstreamer source layer.
3394         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added MediaPlayerPrivateGStreamer::didPassCORSAccessCheck declaration.
3395         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3396         (webKitWebSrcStart): Passed CORS mode parameter to the streaming client. In case of CORS check failure, stop the resource loading.
3397         (webKitSrcPassedCORSAccessCheck): Return whether CORS access control check was done and successful.
3398         (StreamingClient::handleResponseReceived): Take a parameter to assign the CORS access control check result.
3399         (CachedResourceStreamingClient::CachedResourceStreamingClient): Updated setting of the ResourceLoaderOptions according CORS mode.
3400         (CachedResourceStreamingClient::responseReceived): Check CORS and pass result to handleResponseReceived.
3401         (ResourceHandleStreamingClient::didReceiveResponse): No CORS check.
3402         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Added webKitSrcPassedCORSAccessCheck declaration.
3403
3404 2014-04-10  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
3405
3406         Move UseJSC.cmake back to CMakeLists.txt
3407         https://bugs.webkit.org/show_bug.cgi?id=130834
3408
3409         Reviewed by Csaba Osztrogonác.
3410
3411         No new tests required.
3412
3413         * CMakeLists.txt:
3414         * UseJSC.cmake: Removed.
3415
3416 2014-04-09  Commit Queue  <commit-queue@webkit.org>
3417