fbb1b75e032a397662086c8114b1b7f87d07fe5f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-01-03  Hans Muller  <hmuller@adobe.com>
2
3         [CSS Shapes] Simplify FloatRoundedRect, BoxShape construction
4         https://bugs.webkit.org/show_bug.cgi?id=125995
5
6         Reviewed by Andreas Kling.
7
8         Cleanup of various internal Shape issues:
9         - Removed unnecessary Shape() initialization list entries in Shape subclasses
10           per https://bugs.webkit.org/show_bug.cgi?id=125548#c2.
11         - Used const references instead of pointers for non-deprecated Shape:createShape() logic.
12         - Replaced createShape() overloads for Rasters and Boxes with functions named
13           createRasterShape() and createBoxShape().
14         - Added a FloatRoundedRect::Radii() constructor to reduce the parameter list
15           length of the FloatRoundedRect constructor in createBoxShape().
16
17         There are no new tests, this is just internal refactoring.
18
19         * platform/graphics/FloatRoundedRect.h:
20         (WebCore::FloatRoundedRect::Radii::Radii):
21         * rendering/shapes/BoxShape.h:
22         (WebCore::BoxShape::BoxShape):
23         * rendering/shapes/PolygonShape.h:
24         (WebCore::PolygonShape::PolygonShape):
25         * rendering/shapes/RasterShape.h:
26         (WebCore::RasterShape::RasterShape):
27         * rendering/shapes/RectangleShape.h:
28         (WebCore::RectangleShape::RectangleShape):
29         * rendering/shapes/Shape.cpp:
30         (WebCore::createInsetShape):
31         (WebCore::Shape::createShape):
32         (WebCore::Shape::createRasterShape):
33         (WebCore::Shape::createBoxShape):
34         * rendering/shapes/Shape.h:
35         * rendering/shapes/ShapeInfo.cpp:
36         (WebCore::ShapeInfo<RenderType>::computedShape):
37
38 2014-01-03  Andreas Kling  <akling@apple.com>
39
40         Remove unused Document::openSearchDescriptionURL().
41         <https://webkit.org/b/126419>
42
43         Reviewed by Antti Koivisto.
44
45         * dom/Document.h:
46         * dom/Document.cpp:
47
48             Scrub leftovers from the defunct Chromium port.
49
50 2014-01-03  Jinwoo Song  <jinwoo7.song@samsung.com>
51
52         VibrationPattern should allocate an single vector instance for single integer input
53         https://bugs.webkit.org/show_bug.cgi?id=126417
54
55         Reviewed by Gyuyoung Kim.
56
57         When the Vibration pattern is set with a single integer, the VibrationPattern should
58         be set with this integer as a vibration time. But the VibrationPattern(unsigned vector) was
59         initialized with a single parameter, the vibration time, so the time was used to set
60         the size of vector.
61
62         * Modules/vibration/NavigatorVibration.cpp:
63         (WebCore::NavigatorVibration::vibrate):
64
65 2014-01-02  Jaehun Lim  <ljaehun.lim@samsung.com>
66
67         IconController.cpp needs to include <wtf/text/CString.h>
68         https://bugs.webkit.org/show_bug.cgi?id=126415
69
70         Reviewed by Gyuyoung Kim.
71
72         Build fails in IconController.cpp when ICONDATABASE is disabled.
73         WebKit/Source/WebCore/loader/icon/IconController.cpp:124:110: error: invalid use of incomplete type ‘class WTF::CString’
74         IconController.cpp needs #include <wtf/text/CString.h>.
75
76         No new tests. Just build fix.
77
78         * loader/icon/IconController.cpp: Add #include statement.
79
80 2014-01-02  Ryuan Choi  <ryuan.choi@samsung.com>
81
82         [EFL] Previous scrollbar is remained sometimes
83         https://bugs.webkit.org/show_bug.cgi?id=126414
84
85         Reviewed by Gyuyoung Kim.
86
87         * platform/efl/ScrollbarEfl.cpp:
88         (ScrollbarEfl::invalidate):
89         Updated scrollbar visibility in Scrollbar::invalidate().
90         * platform/efl/ScrollbarEfl.h:
91         Removed show()/hide() which never been called() for scrollbar.
92
93 2014-01-02  Brent Fulgham  <bfulgham@apple.com>
94
95         [WebGL] Correct symbol lookup logic to handle 1-element arrays
96         https://bugs.webkit.org/show_bug.cgi?id=126411
97         <rdar://problem/15394564>
98
99         Reviewed by Dean Jackson.
100
101         Tested by revisions to webgl/1.0.2/conformance/glsl/misc/shader-with-array-of-structs-containing-arrays.html
102
103         * html/canvas/WebGLRenderingContext.cpp:
104         (WebCore::WebGLRenderingContext::getUniformLocation): Revise to
105         handle access to zeroeth element of the array.
106
107 2014-01-02  Myles C. Maxfield  <mmaxfield@apple.com>
108
109         Crash in WebCore::translateIntersectionPointsToSkipInkBoundaries
110         https://bugs.webkit.org/show_bug.cgi?id=126252
111
112         Reviewed by Alexey Proskuryakov.
113
114         lastIntermediate was a iterator pointing into a Vector, which was being re-used
115         even while appending to the Vector. If any of the append operators triggered
116         a realloc, the iterator would point to the old free'ed memory.
117
118         Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-crash-many-gaps.html
119
120         * rendering/InlineTextBox.cpp:
121         (WebCore::translateIntersectionPointsToSkipInkBoundaries):
122
123 2014-01-02  Brent Fulgham  <bfulgham@apple.com>
124
125         [WebGL] Correct symbol lookup logic to handle 1-element arrays
126         https://bugs.webkit.org/show_bug.cgi?id=126411
127         <rdar://problem/15394564>
128
129         Reviewed by Dean Jackson.
130
131         * html/canvas/WebGLRenderingContext.cpp:
132         (WebCore::WebGLRenderingContext::getUniformLocation): Revise code to handle the case of single-element
133         arrays.
134
135 2014-01-02  Sam Weinig  <sam@webkit.org>
136
137         Update Promises to the https://github.com/domenic/promises-unwrapping spec
138         https://bugs.webkit.org/show_bug.cgi?id=120954
139
140         Reviewed by Filip Pizlo.
141
142         * ForwardingHeaders/runtime/JSPromiseDeferred.h: Added.
143         * ForwardingHeaders/runtime/JSPromiseResolver.h: Removed.
144         * bindings/js/JSDOMGlobalObjectTask.cpp:
145         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask):
146         * bindings/js/JSDOMGlobalObjectTask.h:
147         * bindings/js/JSDOMPromise.cpp:
148         (WebCore::DeferredWrapper::DeferredWrapper):
149         (WebCore::DeferredWrapper::promise):
150         (WebCore::DeferredWrapper::resolve):
151         (WebCore::DeferredWrapper::reject):
152         * bindings/js/JSDOMPromise.h:
153         (WebCore::DeferredWrapper::resolve):
154         (WebCore::DeferredWrapper::reject):
155         (WebCore::DeferredWrapper::resolve<String>):
156         (WebCore::DeferredWrapper::resolve<bool>):
157         (WebCore::char>>):
158         (WebCore::DeferredWrapper::reject<String>):
159         * bindings/js/JSDOMWindowBase.cpp:
160         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
161         * bindings/js/JSDOMWindowBase.h:
162         * bindings/js/JSSubtleCryptoCustom.cpp:
163         (WebCore::JSSubtleCrypto::encrypt):
164         (WebCore::JSSubtleCrypto::decrypt):
165         (WebCore::JSSubtleCrypto::sign):
166         (WebCore::JSSubtleCrypto::verify):
167         (WebCore::JSSubtleCrypto::digest):
168         (WebCore::JSSubtleCrypto::generateKey):
169         (WebCore::JSSubtleCrypto::importKey):
170         (WebCore::JSSubtleCrypto::exportKey):
171         (WebCore::JSSubtleCrypto::wrapKey):
172         (WebCore::JSSubtleCrypto::unwrapKey):
173         * bindings/js/JSWorkerGlobalScopeBase.cpp:
174         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
175         * bindings/js/JSWorkerGlobalScopeBase.h:
176
177 2014-01-02  Tim Horton  <timothy_horton@apple.com>
178
179         ImageBufferBackingStoreCache should use DeferrableOneShotTimer
180         https://bugs.webkit.org/show_bug.cgi?id=126155
181
182         Reviewed by Anders Carlsson.
183
184         Since ImageBufferBackingStoreCache's purge timer is pushed out every time
185         a backing store is deallocated, we can easily waste a lot of time rescheduling
186         the timer. Since it's a cache purge timer and doesn't need that kind of precision,
187         adopt DeferrableOneShotTimer, which is much more performant when deferred frequently.
188
189         * platform/graphics/cg/ImageBufferBackingStoreCache.cpp:
190         (WebCore::ImageBufferBackingStoreCache::ImageBufferBackingStoreCache):
191         (WebCore::ImageBufferBackingStoreCache::timerFired):
192         (WebCore::ImageBufferBackingStoreCache::schedulePurgeTimer):
193         * platform/graphics/cg/ImageBufferBackingStoreCache.h:
194
195 2014-01-02  Myles C. Maxfield  <mmaxfield@apple.com>
196
197         Allow ImageBuffer to re-use IOSurfaces
198         https://bugs.webkit.org/show_bug.cgi?id=125477
199
200         Reviewed by Geoff Garen. Modifications reviewed by Tim Horton.
201
202         This patch is taken from r160945, but the modifications to ImageBufferCG.cpp
203         have been reverted.
204
205         This test adds a static class, ImageBufferBackingStoreCache, that vends 
206         IOSurfaces. It remembers IOSurfaces that have been returned to it until 
207         a configurable timeout. 
208
209         The storage used by this class is in the form of a HashMap from a 
210         bucketed size to the IOSurface. There are many other data structures 
211         that could be used, but this implementation gives a 80% hit rate on 
212         normal browsing of some example sites with Canvas and 
213         text-decoration-skip: ink. Because the buckets are fairly 
214         small (rounding the width and height up to multiples of 8), traversing the 
215         bucket contents takes on average 2 steps.  
216
217         Test: fast/canvas/canvas-backing-store-reuse.html 
218
219         * WebCore.xcodeproj/project.pbxproj: Added new caching class 
220         * platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Added. 
221         (WebCore::createIOSurface): Copied from ImageBufferCG.cpp 
222         (WebCore::ImageBufferBackingStoreCache::timerFired): Forget the cache 
223         contents 
224         (WebCore::ImageBufferBackingStoreCache::schedulePurgeTimer): 
225         (WebCore::ImageBufferBackingStoreCache::get): Static getter 
226         (WebCore::ImageBufferBackingStoreCache::ImageBufferBackingStoreCache): 
227         (WebCore::ImageBufferBackingStoreCache::insertIntoCache): Memory-management 
228         creation function 
229         (WebCore::ImageBufferBackingStoreCache::takeFromCache): Memory-management 
230         deletion function 
231         (WebCore::ImageBufferBackingStoreCache::isAcceptableSurface): Does this cached 
232         IOSurface fit the bill? 
233         (WebCore::ImageBufferBackingStoreCache::tryTakeFromCache): Lookup 
234         a bucket and walk through its contents 
235         (WebCore::ImageBufferBackingStoreCache::getOrAllocate): Public function 
236         for clients who want a IOSurface from the cache 
237         (WebCore::ImageBufferBackingStoreCache::deallocate): Public 
238         function for clients to return an IOSurface to the pool 
239         * platform/graphics/cg/ImageBufferBackingStoreCache.h: Added. 
240         (WebCore::ImageBuffer::ImageBuffer): 
241         (WebCore::ImageBuffer::~ImageBuffer): 
242
243 2014-01-02  Piotr Grad  <p.grad@samsung.com>
244
245         Video-seek-with-negative-playback was flaky.
246         https://bugs.webkit.org/show_bug.cgi?id=126379
247
248         Reviewed by Eric Carlson.
249
250         No new tests. Covered by existing tests.
251
252         m_player->setRate() should be called before updating m_playbackRate, because potentiallyPlaying() depends
253         on endedPlayback(), which checks m_playbackRate.
254
255         * html/HTMLMediaElement.cpp:
256         (WebCore::HTMLMediaElement::setPlaybackRate):
257
258 2014-01-02  Daniel Bates  <dabates@apple.com>
259
260         [iOS] Tapping any link crashes in WebCore::EventHandler::mouseMoved()
261         (also crashes when scrolling certain sites)
262         https://bugs.webkit.org/show_bug.cgi?id=126401
263         <rdar://problem/15739334>
264
265         Reviewed by Tim Horton.
266
267         * page/ios/EventHandlerIOS.mm:
268         (WebCore::currentEventSlot): Make the shared variable have static-storage duration.
269
270 2014-01-02  Gavin Barraclough  <barraclough@apple.com>
271
272         Remove WindowIsVisible
273         https://bugs.webkit.org/show_bug.cgi?id=126270
274
275         Reviewed by Tim Horton.
276
277         We currently track visibility in two ways - ViewState::IsVisible and ViewState::WindowIsVisible.
278         The latter detects that the content is hidden in fewer cases than the former, and as such, the
279         former is always preferable.
280
281         This affects the hidden state provided to FocusController::contentAreaDidShowOrHide and to
282         Plugin::windowVisibilityChanged.
283
284         * WebCore.exp.in:
285         * page/FocusController.cpp:
286         (WebCore::FocusController::FocusController):
287         (WebCore::FocusController::setContentIsVisible):
288         * page/FocusController.h:
289             - rename ContainingWindowIsVisible -> ContentIsVisible.
290
291 2014-01-02  Gavin Barraclough  <barraclough@apple.com>
292
293         Merge didMoveOnscreen / page visibility to isVisible
294         https://bugs.webkit.org/show_bug.cgi?id=126268
295
296         Reviewed by Tim Horton.
297
298         The onscreen state most closely tracks view visibility (though currently
299         also tracks a mix of in-window state). Make more consistent, simplify,
300         and move all animation suspension logic to Page, so it can be controlled
301         by the PageThrottler.
302
303         * WebCore.exp.in:
304         * page/EventHandler.cpp:
305         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
306         * page/FrameView.cpp:
307         (WebCore::FrameView::shouldSetCursor):
308         * page/Page.cpp:
309         (WebCore::Page::Page):
310             - initialize new variables.
311         (WebCore::Page::setIsVisible):
312             - merge setVisibilityState, didMoveOnscreen, willMoveOffscreen.
313         (WebCore::Page::setIsPrerender):
314             - switches visibility state from hidden to prerender.
315         (WebCore::Page::visibilityState):
316             - computed from m_isVisible, m_isPrerender.
317         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
318             - m_visibilityState -> m_isVisible.
319         * page/Page.h:
320             - remove didMoveOnscreen/willMoveOffscreen
321               m_isOnscreen & m_visibilityState -> m_isVisible & m_isPrerender
322               setVisibilityState -> setIsVisible & setIsPrerender.
323         (WebCore::Page::isVisible):
324             - isOnscreen -> isVisible.
325
326 2014-01-02  Oliver Hunt  <oliver@apple.com>
327
328         Update bindings test results
329
330         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
331         (WebCore::jsTestActiveDOMObjectConstructor):
332         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
333         (WebCore::jsTestCustomNamedGetterConstructor):
334         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
335         (WebCore::jsTestEventConstructorConstructor):
336         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
337         (WebCore::jsTestEventTargetConstructor):
338         * bindings/scripts/test/JS/JSTestException.cpp:
339         (WebCore::jsTestExceptionConstructor):
340         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
341         (WebCore::jsTestGenerateIsReachableConstructor):
342         * bindings/scripts/test/JS/JSTestInterface.cpp:
343         (WebCore::jsTestInterfaceConstructor):
344         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
345         (WebCore::jsTestMediaQueryListListenerConstructor):
346         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
347         (WebCore::jsTestNamedConstructorConstructor):
348         * bindings/scripts/test/JS/JSTestNode.cpp:
349         (WebCore::jsTestNodeConstructor):
350         * bindings/scripts/test/JS/JSTestObj.cpp:
351         (WebCore::jsTestObjConstructor):
352         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
353         (WebCore::jsTestOverloadedConstructorsConstructor):
354         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
355         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
356         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
357         (WebCore::jsTestTypedefsConstructor):
358         * bindings/scripts/test/JS/JSattribute.cpp:
359         (WebCore::jsattributeConstructor):
360         * bindings/scripts/test/JS/JSreadonly.cpp:
361         (WebCore::jsreadonlyConstructor):
362
363 2013-12-23  Oliver Hunt  <oliver@apple.com>
364
365         Refactor PutPropertySlot to be aware of custom properties
366         https://bugs.webkit.org/show_bug.cgi?id=126187
367
368         Reviewed by Antti Koivisto.
369
370         Update the bindings code generation and custom objects
371         to the new function signatures
372
373         * bindings/js/JSDOMWindowCustom.cpp:
374         (WebCore::JSDOMWindow::put):
375         * bindings/objc/WebScriptObject.mm:
376         (-[WebScriptObject setValue:forKey:]):
377         * bindings/scripts/CodeGeneratorJS.pm:
378         (GenerateImplementation):
379         * bindings/scripts/test/JS/JSTestInterface.cpp:
380         (WebCore::JSTestInterface::putByIndex):
381         * bridge/NP_jsobject.cpp:
382         (_NPN_SetProperty):
383
384 2014-01-02  Simon Fraser  <simon.fraser@apple.com>
385
386         Add AsyncScrollingCoordinator, which is a base class for threaded and future remote ScrollingCoordinators
387         https://bugs.webkit.org/show_bug.cgi?id=126389
388
389         Reviewed by Tim Horton.
390
391         Add AsyncScrollingCoordinator, a ScrollingCoordinator that knows about ScrollingStateTrees
392         and ScrollingTrees, but leaves it up to subclasses to decide when and how to commit.
393
394         * WebCore.xcodeproj/project.pbxproj: Added AsyncScrollingCoordinator.*
395         * page/scrolling/AsyncScrollingCoordinator.cpp: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm.
396         (WebCore::AsyncScrollingCoordinator::AsyncScrollingCoordinator):
397         (WebCore::AsyncScrollingCoordinator::~AsyncScrollingCoordinator):
398         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
399         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
400         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
401         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
402         (WebCore::AsyncScrollingCoordinator::attachToStateTree):
403         (WebCore::AsyncScrollingCoordinator::detachFromStateTree):
404         (WebCore::AsyncScrollingCoordinator::clearStateTree):
405         (WebCore::AsyncScrollingCoordinator::syncChildPositions):
406         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
407         (WebCore::AsyncScrollingCoordinator::updateScrollingNode):
408         (WebCore::AsyncScrollingCoordinator::updateViewportConstrainedNode):
409         (WebCore::AsyncScrollingCoordinator::setScrollLayerForNode):
410         (WebCore::AsyncScrollingCoordinator::setCounterScrollingLayerForNode):
411         (WebCore::AsyncScrollingCoordinator::setHeaderLayerForNode):
412         (WebCore::AsyncScrollingCoordinator::setFooterLayerForNode):
413         (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionForNode):
414         (WebCore::AsyncScrollingCoordinator::setWheelEventHandlerCountForNode):
415         (WebCore::AsyncScrollingCoordinator::setScrollBehaviorForFixedElementsForNode):
416         (WebCore::AsyncScrollingCoordinator::setScrollbarPaintersFromScrollbarsForNode):
417         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
418         (WebCore::AsyncScrollingCoordinator::updateMainFrameScrollLayerPosition):
419         (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView):
420         (WebCore::AsyncScrollingCoordinator::isRubberBandInProgress):
421         (WebCore::AsyncScrollingCoordinator::setScrollPinningBehavior):
422         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
423         * page/scrolling/AsyncScrollingCoordinator.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h.
424         (WebCore::AsyncScrollingCoordinator::scrollingTree):
425         (WebCore::AsyncScrollingCoordinator::setScrollingTree):
426         (WebCore::AsyncScrollingCoordinator::scrollingStateTree):
427         (WebCore::AsyncScrollingCoordinator::releaseScrollingTree):
428         * page/scrolling/ScrollingCoordinator.h: Add casting support.
429         (WebCore::ScrollingCoordinator::isAsyncScrollingCoordinator):
430         * page/scrolling/ThreadedScrollingTree.h: commitNewTreeState() needs to be public.
431         * page/scrolling/mac/ScrollingCoordinatorMac.h:
432         * page/scrolling/mac/ScrollingCoordinatorMac.mm: Lots of code moved to AsyncScrollingCoordinator.
433         (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
434         (WebCore::ScrollingCoordinatorMac::~ScrollingCoordinatorMac):
435         (WebCore::ScrollingCoordinatorMac::pageDestroyed):
436         (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
437         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
438         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
439         (WebCore::ScrollingCoordinatorMac::commitTreeState):
440         (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
441
442 2014-01-02  Andreas Kling  <akling@apple.com>
443
444         Simplify the insides of DocumentSharedObjectPool and reduce memory usage.
445
446         Merging Blink r164152 by Elliott Sprehn.
447
448         Instead of storing an OwnPtr to an object that has a pointer to the
449         ShareableElementData as well as a pointer into the ShareableElementData
450         and the length we can just store a RefPtr to the SharableElementData.
451
452         This also reduces the memory usage of the pool by 2 pointers per entry.
453
454         * dom/DocumentSharedObjectPool.h:
455         * dom/DocumentSharedObjectPool.cpp:
456         (WebCore::attributeHash):
457         (WebCore::hasSameAttributes):
458         (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
459
460 2014-01-02  Dirk Schulze  <krit@webkit.org>
461
462         Support <box> values computed style for 'clip-path' property
463         https://bugs.webkit.org/show_bug.cgi?id=126148
464
465         Reviewed by Simon Fraser.
466
467         Calculate computed style for 'clip-path' property.
468
469         Updated tests to check for computed style.
470
471         * css/BasicShapeFunctions.cpp: Add box value bounding-box.
472         (WebCore::valueForBox):
473         (WebCore::boxForValue):
474         * css/CSSComputedStyleDeclaration.cpp: Return the computed style
475             for 'clip-path'.
476         (WebCore::ComputedStyleExtractor::propertyValue):
477         * css/DeprecatedStyleBuilder.cpp: Create CSSValueLists for 'clip-th'.
478         (WebCore::ApplyPropertyClipPath::applyValue):
479         * rendering/ClipPathOperation.h: Add bounding-box value.
480         (WebCore::ShapeClipPathOperation::pathForReferenceRect):
481         (WebCore::ShapeClipPathOperation::setReferenceBox):
482         (WebCore::ShapeClipPathOperation::referenceBox):
483         (WebCore::BoxClipPathOperation::create):
484         (WebCore::BoxClipPathOperation::pathForReferenceRect):
485         (WebCore::BoxClipPathOperation::referenceBox):
486         (WebCore::BoxClipPathOperation::BoxClipPathOperation):
487         * rendering/shapes/ShapeInfo.h: Add bounding-box value.
488         (WebCore::ShapeInfo::setShapeSize):
489         (WebCore::ShapeInfo::logicalTopOffset):
490         (WebCore::ShapeInfo::logicalLeftOffset):
491         * rendering/style/BasicShapes.cpp: Add bounding-box value.
492         (WebCore::BasicShape::referenceBoxSize):
493         * rendering/style/BasicShapes.h:
494
495 2014-01-02  Antti Koivisto  <antti@apple.com>
496
497         Always resolve style from root
498         https://bugs.webkit.org/show_bug.cgi?id=126380
499
500         Reviewed by Andreas Kling.
501         
502         Forced style resolve that does not start from the root is never really correct. 
503         Remove the few remaining instances.
504
505         * dom/ShadowRoot.cpp:
506         (WebCore::ShadowRoot::setResetStyleInheritance):
507         
508             Update style asynchronously.
509
510         * dom/ShadowRoot.h:
511         * dom/Text.h:
512         * html/HTMLPlugInImageElement.cpp:
513         (WebCore::HTMLPlugInImageElement::createElementRenderer):
514         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
515         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
516         
517             Delete the render tree synchronously on suspend and rebuild it asynchronously on resume.
518             No need for m_customStyleForPageCache hack.
519
520         * html/HTMLPlugInImageElement.h:
521         
522             Remove m_customStyleForPageCache.
523
524         * style/StyleResolveTree.cpp:
525         * style/StyleResolveTree.h:
526         
527             Remove Element version of resolveTree from the interface.
528
529         * svg/SVGUseElement.h:
530
531 2014-01-02  Antti Koivisto  <antti@apple.com>
532
533         Remove PlaceholderDocument
534         https://bugs.webkit.org/show_bug.cgi?id=126382
535
536         Reviewed by Andreas Kling.
537
538         Remove PlaceholderDocument class and replace it with a bit in Document.
539
540         * WebCore.xcodeproj/project.pbxproj:
541         * dom/Document.cpp:
542         (WebCore::Document::Document):
543         (WebCore::Document::createRenderTree):
544         * dom/Document.h:
545         
546             Also make Synthesized a construction flag instead of a boolean parameter.
547
548         (WebCore::Document::createNonRenderedPlaceholder):
549         * html/HTMLDocument.cpp:
550         (WebCore::HTMLDocument::HTMLDocument):
551         * html/HTMLDocument.h:
552         (WebCore::HTMLDocument::create):
553         (WebCore::HTMLDocument::createSynthesizedDocument):
554         * loader/DocumentWriter.cpp:
555         (WebCore::DocumentWriter::createDocument):
556         * loader/PlaceholderDocument.cpp: Removed.
557         * loader/PlaceholderDocument.h: Removed.
558         * pdf/ios/PDFDocument.h:
559         (WebCore::PDFDocument::PDFDocument):
560
561 2014-01-01  Antti Koivisto  <antti@apple.com>
562
563         Remove public attachRenderTree
564         https://bugs.webkit.org/show_bug.cgi?id=126368
565
566         Reviewed by Andreas Kling.
567
568         Remove the remaining explicit render tree construction.
569
570         * dom/Document.cpp:
571         (WebCore::Document::createRenderTree):
572         
573            Use recalcStyle() instead of calling attachRenderTree directly.
574
575         * html/HTMLViewSourceDocument.cpp:
576         (WebCore::HTMLViewSourceDocument::addText):
577         
578             Remove forgotten attachTextRenderer.
579
580         * html/shadow/InsertionPoint.cpp:
581         (WebCore::InsertionPoint::InsertionPoint):
582         
583             Remove willAttachRenderers/didAttachRenderers hack.
584
585         * html/shadow/InsertionPoint.h:
586         (WebCore::toInsertionPoint):
587         * loader/PlaceholderDocument.cpp:
588         (WebCore::PlaceholderDocument::createRenderTree):
589         
590             Seriously, nothing to do here.
591
592         * style/StyleResolveTree.cpp:
593         (WebCore::Style::attachDistributedChildren):
594         (WebCore::Style::attachChildren):
595         (WebCore::Style::detachDistributedChildren):
596         (WebCore::Style::detachChildren):
597         
598             Making attaching and detaching distributed insertion point children part of ResolveTree internals.
599
600         * style/StyleResolveTree.h:
601         
602             Remove interfaces with no clients.
603
604 2014-01-01  Seokju Kwon  <seokju@webkit.org>
605
606         Remove stale ScriptProfiler methods
607         https://bugs.webkit.org/show_bug.cgi?id=126373
608
609         Reviewed by Darin Adler.
610
611         No new tests, No change behavior. 
612
613         * bindings/js/ScriptProfiler.h: Remove dead code.
614
615 2014-01-01  Andreas Kling  <akling@apple.com>
616
617         Remove ChromeClient::fullScreenRendererChanged().
618         <https://webkit.org/b/126370>
619
620         This hook was added in r75277 to notify WebFullScreenController when
621         the full screen renderer changed. In r110216 the code was refactored,
622         making this notification unnecessary.
623
624         Reviewed by Antti Koivisto.
625
626 2014-01-01  Simon Fraser  <simon.fraser@apple.com>
627
628         Fix the build by exposing some more scrolling state node headers
629         as Private in WebCore.framework.
630
631         * WebCore.xcodeproj/project.pbxproj:
632
633 2014-01-01  Ryuan Choi  <ryuan.choi@samsung.com>
634
635         [EFL] Unreviewed build fix after r160903 when ACCESSIBILITY is disabled
636
637         * accessibility/AccessibilityObject.h:
638         (WebCore::AccessibilityObject::children):
639
640 2014-01-01  Andreas Kling  <akling@apple.com>
641
642         RenderScrollbar: Map of scrollbar parts should use RenderPtr.
643         <https://webkit.org/b/126367>
644
645         Turn RenderScrollbar::m_parts into HashMap of RenderPtrs. This makes
646         renderer destruction automatic and lets us remove some code.
647
648         Reviewed by Antti Koivisto.
649
650         * rendering/RenderPtr.h:
651
652             Add HashTraits for RenderPtr so we can use them as values in
653             WTF hash tables.
654
655         * rendering/RenderScrollbar.h:
656         * rendering/RenderScrollbar.cpp:
657         (WebCore::RenderScrollbar::~RenderScrollbar):
658         (WebCore::RenderScrollbar::setParent):
659         (WebCore::RenderScrollbar::updateScrollbarParts):
660         (WebCore::RenderScrollbar::updateScrollbarPart):
661
662             Remove now-unneeded kludges of logic to manually delete scrollbar
663             part renderers in various scenarios.
664
665 2014-01-01  Antti Koivisto  <antti@apple.com>
666
667         Remove reattachRenderTree
668         https://bugs.webkit.org/show_bug.cgi?id=126366
669
670         Reviewed by Andreas Kling.
671
672         Remove the last remaining client.
673
674         * html/HTMLSelectElement.cpp:
675         (WebCore::HTMLSelectElement::parseAttribute):
676         
677             Reconstruct render tree asynchronously.
678
679         (WebCore::HTMLSelectElement::scrollToSelection):
680         (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
681         (WebCore::HTMLSelectElement::selectOption):
682         
683             It is not safe to cast the renderer based on usesMenuList test. Switch to RenderObject::isMenuList test.
684
685         (WebCore::HTMLSelectElement::parseMultipleAttribute):
686         
687             Reconstruct render tree asynchronously.
688
689         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
690         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
691         (WebCore::HTMLSelectElement::defaultEventHandler):
692         * style/StyleResolveTree.cpp:
693         * style/StyleResolveTree.h:
694         
695             Remove the function.
696
697 2014-01-01  Simon Fraser  <simon.fraser@apple.com>
698
699         Create a ThreadedScrollingTree subclass of ScrollingTree, and push all knowledge of the scrolling thread into it
700         https://bugs.webkit.org/show_bug.cgi?id=126362
701
702         Reviewed by Sam Weinig.
703
704         Eventually we'll have a ScrollingTree in situations where there is no scrolling
705         thread, so make the ScrollingTree base class thread-agnostic (but threadsafe),
706         and subclass it in ThreadedScrollingTree for scrolling-thread-specific functionality.
707         
708         The ScrollingTree base class also no longer needs to know about the
709         ScrollingCoordinator.
710
711         ScrollingCoordinatorMac creates a ThreadedScrollingTree.
712
713         * WebCore.exp.in:
714         * WebCore.xcodeproj/project.pbxproj: Add ThreadedScrollingTree.*
715         Make some headers Private that we'll need in WebKit2 soon.
716         * page/scrolling/ScrollingStateTree.h: Drive-by cleanup: clone() was unimplemented.
717         * page/scrolling/ScrollingTree.cpp:
718         (WebCore::ScrollingTree::ScrollingTree):
719         (WebCore::ScrollingTree::~ScrollingTree):
720         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Wrap up some logic that
721         involves taking the mutex, so ThreadedScrollingTree can conveniently call it.
722         (WebCore::ScrollingTree::handleWheelEvent):
723         (WebCore::ScrollingTree::commitNewTreeState):
724         (WebCore::ScrollingTree::setMainFrameScrollPosition):
725         (WebCore::ScrollingTree::isHandlingProgrammaticScroll):
726         * page/scrolling/ScrollingTree.h:
727         (WebCore::ScrollingTree::isThreadedScrollingTree):
728         (WebCore::ScrollingTree::invalidate):
729         * page/scrolling/ThreadedScrollingTree.cpp: Added.
730         (WebCore::ThreadedScrollingTree::create):
731         (WebCore::ThreadedScrollingTree::ThreadedScrollingTree):
732         (WebCore::ThreadedScrollingTree::~ThreadedScrollingTree):
733         (WebCore::ThreadedScrollingTree::tryToHandleWheelEvent):
734         (WebCore::ThreadedScrollingTree::handleWheelEvent):
735         (WebCore::derefScrollingCoordinator):
736         (WebCore::ThreadedScrollingTree::invalidate):
737         (WebCore::ThreadedScrollingTree::commitNewTreeState):
738         (WebCore::ThreadedScrollingTree::updateMainFrameScrollPosition):
739         (WebCore::ThreadedScrollingTree::handleWheelEventPhase):
740         * page/scrolling/ThreadedScrollingTree.h: Added.
741         (WebCore::ThreadedScrollingTree::isThreadedScrollingTree):
742         * page/scrolling/mac/ScrollingCoordinatorMac.h:
743         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
744         (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
745         (WebCore::ScrollingCoordinatorMac::handleWheelEvent):
746
747 2014-01-01  Andreas Kling  <akling@apple.com>
748
749         FrameView: Store scroll corner renderer in a RenderPtr.
750         <https://webkit.org/b/126364>
751
752         Make FrameView::m_scrollCorner a RenderPtr<RenderScrollbarPart> and
753         remove two manual destroy() calls.
754
755         Reviewed by Antti Koivisto.
756
757 2014-01-01  Antti Koivisto  <antti@apple.com>
758
759         Remove elementChildren/elementDescendants shorthands
760         https://bugs.webkit.org/show_bug.cgi?id=126363
761
762         Reviewed by Anders Carlsson.
763
764         Just use childrenOfType<Element>/descendantsOfType<Element> instead. They are not that much longer
765         and consistency is valuable.
766
767         * accessibility/AccessibilityNodeObject.cpp:
768         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
769         (WebCore::siblingWithAriaRole):
770         * accessibility/AccessibilityTable.cpp:
771         (WebCore::AccessibilityTable::isDataTable):
772         * css/StyleInvalidationAnalysis.cpp:
773         (WebCore::StyleInvalidationAnalysis::invalidateStyle):
774         * dom/ChildNodeList.cpp:
775         (WebCore::ChildNodeList::namedItem):
776         * dom/Document.cpp:
777         (WebCore::Document::buildAccessKeyMap):
778         (WebCore::Document::childrenChanged):
779         * dom/Element.cpp:
780         (WebCore::Element::resetComputedStyle):
781         * dom/ElementChildIterator.h:
782         * dom/ElementDescendantIterator.h:
783         * dom/SelectorQuery.cpp:
784         (WebCore::elementsForLocalName):
785         (WebCore::anyElement):
786         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
787         (WebCore::SelectorDataList::executeSingleClassNameSelectorData):
788         (WebCore::SelectorDataList::executeSingleSelectorData):
789         (WebCore::SelectorDataList::executeSingleMultiSelectorData):
790         * editing/ApplyStyleCommand.cpp:
791         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
792         * editing/ReplaceSelectionCommand.cpp:
793         (WebCore::removeHeadContents):
794         * editing/markup.cpp:
795         (WebCore::completeURLs):
796         * html/HTMLFieldSetElement.cpp:
797         (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
798         * html/HTMLObjectElement.cpp:
799         (WebCore::HTMLObjectElement::containsJavaApplet):
800         * loader/PlaceholderDocument.cpp:
801         (WebCore::PlaceholderDocument::createRenderTree):
802         * rendering/RenderChildIterator.h:
803         * svg/SVGSVGElement.cpp:
804         (WebCore::SVGSVGElement::getElementById):
805         * svg/SVGUseElement.cpp:
806         (WebCore::subtreeContainsDisallowedElement):
807         (WebCore::removeDisallowedElementsFromSubtree):
808
809 2014-01-01  Antti Koivisto  <antti@apple.com>
810
811         Do less synchronous render tree construction
812         https://bugs.webkit.org/show_bug.cgi?id=126359
813
814         Reviewed by Anders Carlsson.
815
816         Remove some now-unnecessary attachRenderTree calls.
817
818         * html/HTMLDetailsElement.cpp:
819         (WebCore::HTMLDetailsElement::parseAttribute):
820         * html/HTMLInputElement.cpp:
821         (WebCore::HTMLInputElement::parseAttribute):
822         * html/HTMLObjectElement.cpp:
823         (WebCore::HTMLObjectElement::renderFallbackContent):
824         * html/HTMLPlugInElement.cpp:
825         (WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
826         * html/HTMLPlugInImageElement.cpp:
827         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
828         (WebCore::HTMLPlugInImageElement::createShadowIFrameSubtree):
829         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
830         * html/HTMLViewSourceDocument.cpp:
831         (WebCore::HTMLViewSourceDocument::createContainingTable):
832         (WebCore::HTMLViewSourceDocument::addSpanWithClassName):
833         (WebCore::HTMLViewSourceDocument::addLine):
834         (WebCore::HTMLViewSourceDocument::finishLine):
835         (WebCore::HTMLViewSourceDocument::addBase):
836         (WebCore::HTMLViewSourceDocument::addLink):
837         * xml/XMLErrors.cpp:
838         (WebCore::XMLErrors::insertErrorMessageBlock):
839
840 2014-01-01  Simon Fraser  <simon.fraser@apple.com>
841
842         Updating the scrolling tree should use references to state nodes
843         https://bugs.webkit.org/show_bug.cgi?id=126360
844
845         Reviewed by Anders Carlsson.
846
847         Change functions related to ScrollingTreeNode updating to take
848         const references to state nodes rather than pointers.
849
850         * page/scrolling/ScrollingStateNode.h:
851         (WebCore::ScrollingStateNode::hasChangedProperty):
852         * page/scrolling/ScrollingTree.cpp:
853         (WebCore::ScrollingTree::commitNewTreeState):
854         (WebCore::ScrollingTree::updateTreeFromStateNode): The node can be nil so
855         this continues to take a pointer.
856         (WebCore::ScrollingTree::removeDestroyedNodes):
857         * page/scrolling/ScrollingTree.h:
858         * page/scrolling/ScrollingTreeNode.h:
859         (WebCore::ScrollingTreeNode::updateAfterChildren):
860         * page/scrolling/ScrollingTreeScrollingNode.cpp:
861         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
862         * page/scrolling/ScrollingTreeScrollingNode.h:
863         * page/scrolling/mac/ScrollingTreeFixedNode.h:
864         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
865         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
866         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
867         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
868         (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
869         (WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren):
870         * page/scrolling/mac/ScrollingTreeStickyNode.h:
871         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
872         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren):
873
874 2014-01-01  Simon Fraser  <simon.fraser@apple.com>
875
876         Add a typedef for PlatformLayerID on GraphicsLayer, and migrate RemoteLayerTreeTransaction to use it
877         https://bugs.webkit.org/show_bug.cgi?id=126346
878
879         Reviewed by Tim Horton.
880
881         Remote scrolling tree code is soon going to use RemoteLayerTreeTransaction::LayerID,
882         so it makes more sense to put this layerID type on GraphicsLayer as
883         GraphicsLayer::PlatformLayerID.
884         
885         Also add some type cast macros for PlatformCALayer and subclasses, and use them
886         where appropriate.
887
888         * platform/graphics/GraphicsLayer.h:
889         * platform/graphics/ca/GraphicsLayerCA.cpp:
890         (WebCore::GraphicsLayerCA::setName):
891         * platform/graphics/ca/PlatformCALayer.h:
892         (WebCore::PlatformCALayer::isPlatformCALayerMac):
893         (WebCore::PlatformCALayer::isPlatformCALayerRemote):
894         (WebCore::PlatformCALayer::PlatformCALayer):
895         * platform/graphics/ca/mac/PlatformCALayerMac.h:
896
897 2013-12-31  Simon Fraser  <simon.fraser@apple.com>
898
899         ScrollingStateNodes should have a reference to the ScrollingStateTree
900         https://bugs.webkit.org/show_bug.cgi?id=126348
901
902         Reviewed by Sam Weinig.
903
904         Make ScrollingStateNodes always belong to a ScrollingStateTree, and thus
905         have a reference to the tree rather than a pointer. When cloning nodes,
906         they are adopted by a new ScrollingStateTree, which adds them to its
907         node map (which didn't happen before).
908         
909         In subclasses access the ScrollingStateTree through a member function.
910
911         * page/scrolling/ScrollingStateFixedNode.cpp:
912         (WebCore::ScrollingStateFixedNode::create):
913         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
914         (WebCore::ScrollingStateFixedNode::clone):
915         (WebCore::ScrollingStateFixedNode::updateConstraints):
916         * page/scrolling/ScrollingStateFixedNode.h:
917         * page/scrolling/ScrollingStateNode.cpp:
918         (WebCore::ScrollingStateNode::ScrollingStateNode):
919         (WebCore::ScrollingStateNode::cloneAndReset):
920         (WebCore::ScrollingStateNode::cloneAndResetChildren):
921         (WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
922         * page/scrolling/ScrollingStateNode.h:
923         (WebCore::ScrollingStateNode::scrollingStateTree):
924         * page/scrolling/ScrollingStateScrollingNode.cpp:
925         (WebCore::ScrollingStateScrollingNode::create):
926         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
927         (WebCore::ScrollingStateScrollingNode::clone):
928         (WebCore::ScrollingStateScrollingNode::setViewportRect):
929         (WebCore::ScrollingStateScrollingNode::setTotalContentsSize):
930         (WebCore::ScrollingStateScrollingNode::setScrollOrigin):
931         (WebCore::ScrollingStateScrollingNode::setScrollableAreaParameters):
932         (WebCore::ScrollingStateScrollingNode::setFrameScaleFactor):
933         (WebCore::ScrollingStateScrollingNode::setNonFastScrollableRegion):
934         (WebCore::ScrollingStateScrollingNode::setWheelEventHandlerCount):
935         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
936         (WebCore::ScrollingStateScrollingNode::setScrollBehaviorForFixedElements):
937         (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
938         (WebCore::ScrollingStateScrollingNode::setHeaderHeight):
939         (WebCore::ScrollingStateScrollingNode::setFooterHeight):
940         * page/scrolling/ScrollingStateScrollingNode.h:
941         * page/scrolling/ScrollingStateStickyNode.cpp:
942         (WebCore::ScrollingStateStickyNode::create):
943         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
944         (WebCore::ScrollingStateStickyNode::clone):
945         (WebCore::ScrollingStateStickyNode::updateConstraints):
946         * page/scrolling/ScrollingStateStickyNode.h:
947         * page/scrolling/ScrollingStateTree.cpp:
948         (WebCore::ScrollingStateTree::attachNode):
949         (WebCore::ScrollingStateTree::commit):
950         (WebCore::ScrollingStateTree::addNode):
951         * page/scrolling/ScrollingStateTree.h:
952         * page/scrolling/mac/ScrollingStateNodeMac.mm:
953         (WebCore::ScrollingStateNode::setScrollLayer):
954         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
955         (WebCore::ScrollingStateScrollingNode::setCounterScrollingLayer):
956         (WebCore::ScrollingStateScrollingNode::setHeaderLayer):
957         (WebCore::ScrollingStateScrollingNode::setFooterLayer):
958         (WebCore::ScrollingStateScrollingNode::setScrollbarPaintersFromScrollbars):
959
960 2013-12-31  Simon Fraser  <simon.fraser@apple.com>
961
962         Give ScrollingStateNodes a nodeType()
963         https://bugs.webkit.org/show_bug.cgi?id=126347
964
965         Reviewed by Tim Horton.
966
967         When we start serializing ScrollingStateNodes to send to the UI process,
968         it's more convenient if they have a nodeType member rather than virtual functions,
969         so give them one, and fix the casting macros to use it. This allows us to use
970         a switch() on node creation, so the compiler will tell us if we forgot to create
971         a node type.
972
973         * page/scrolling/ScrollingStateFixedNode.cpp:
974         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
975         * page/scrolling/ScrollingStateFixedNode.h:
976         * page/scrolling/ScrollingStateNode.cpp:
977         (WebCore::ScrollingStateNode::ScrollingStateNode):
978         * page/scrolling/ScrollingStateNode.h: const ScrollingNodeType field
979         (can't be modified after construction), and move the m_scrollingStateTree
980         member after it (the awkward protected:/private: will be cleaned up in a later patch).
981         (WebCore::ScrollingStateNode::nodeType):
982         * page/scrolling/ScrollingStateScrollingNode.cpp:
983         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
984         * page/scrolling/ScrollingStateScrollingNode.h:
985         * page/scrolling/ScrollingStateStickyNode.cpp:
986         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
987         * page/scrolling/ScrollingStateStickyNode.h:
988         * page/scrolling/ScrollingTree.cpp:
989         (WebCore::ScrollingTree::updateTreeFromStateNode):
990
991 2013-12-31  Andreas Kling  <akling@apple.com>
992
993         Out-of-line RenderStyle substructure copying helpers.
994         <https://webkit.org/b/126340>
995
996         This shrinks the .access() calls by moving memory allocation logic
997         out-of-line, though I'm really doing this to make Instruments.app
998         allocations output more readable.
999
1000         Writes to e.g 'font' or 'color' will now be grouped under a single
1001         StyleInheritedData::copy() call instead of being spread out over
1002         setFontDescription(), setLineHeight(), setColor(), etc.
1003
1004         Reviewed by Anders Carlsson.
1005
1006 2013-12-31  Andreas Kling  <akling@apple.com>
1007
1008         RenderListItem should store its marker in a RenderPtr.
1009         <https://webkit.org/b/126298>
1010
1011         Make RenderListItem::m_marker a RenderPtr<RenderListMarker> and
1012         remove two manual destroy() calls. Tweaked code to reduce nesting.
1013
1014         Reviewed by Anders Carlsson.
1015
1016 2013-12-31  Andreas Kling  <akling@apple.com>
1017
1018         Element's renderer factory should return RenderPtrs.
1019         <https://webkit.org/b/126318>
1020
1021         Rename Element::createRenderer() to createElementRenderer() and have
1022         it return RenderPtr<RenderElement>. Propagate signature until it
1023         builds again.
1024
1025         We leakPtr() the renderer at two call sites when handing things over
1026         to raw pointer API. This'll get tidied up in subsequent patches.
1027
1028         Reviewed by Sam Weinig.
1029
1030 2013-12-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1031
1032         [SOUP] Return early in ResourceHandle::receivedCancellation if the load has already cancelled
1033         https://bugs.webkit.org/show_bug.cgi?id=126287
1034
1035         Reviewed by Martin Robinson.
1036
1037         This situation can happen when using the network process, because
1038         the ReceivedCancellation message can be received when the resource
1039         loader has already been removed, but the authentication challenge
1040         still has a reference to the ResourceHandleClient.
1041
1042         * platform/network/soup/ResourceHandleSoup.cpp:
1043         (WebCore::ResourceHandle::receivedCancellation):
1044
1045 2013-12-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1046
1047         [SOUP] The initiating page is lost after a redirection
1048         https://bugs.webkit.org/show_bug.cgi?id=126293
1049
1050         Reviewed by Martin Robinson.
1051
1052         The initiating page id is attached to the initial soup request
1053         object, but not to the one created after a redirection.
1054
1055         * platform/network/soup/ResourceHandleSoup.cpp:
1056         (WebCore::createSoupRequestAndMessageForHandle): Call
1057         setSoupRequestInitiatingPageIDFromNetworkingContext() here if the
1058         soup request is created successfully.
1059         (WebCore::ResourceHandle::start): Remove the call to
1060         setSoupRequestInitiatingPageIDFromNetworkingContext().
1061
1062 2013-12-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1063
1064         [SOUP] Implement ResourceHandle::continueWillSendRequest()
1065         https://bugs.webkit.org/show_bug.cgi?id=126291
1066
1067         Reviewed by Martin Robinson.
1068
1069         * platform/network/soup/ResourceHandleSoup.cpp:
1070         (WebCore::continueAfterWillSendRequest): Helper function that
1071         continues with the load after willSendRequest has been called.
1072         (WebCore::doRedirect): Call continueAfterWillSendRequest() when
1073         client doesn't use async callbacks.
1074         (WebCore::ResourceHandle::continueWillSendRequest): Call
1075         continueAfterWillSendRequest().
1076
1077 2013-12-30  Carlos Garcia Campos  <cgarcia@igalia.com>
1078
1079         [SOUP] willSendRequest doesn't work after a redirect
1080         https://bugs.webkit.org/show_bug.cgi?id=126290
1081
1082         Reviewed by Martin Robinson.
1083
1084         The problem is that we are creating the new soup request for the
1085         redirect before calling ResourceHandleClient::willSendRequest() so
1086         that any change made to the request by the client is ignored.
1087
1088         * platform/network/soup/ResourceHandleSoup.cpp:
1089         (WebCore::doRedirect): Create the new soup request and soup
1090         message for the redirect after calling willSendRequest() on the
1091         client.
1092
1093 2013-12-30  Andreas Kling  <akling@apple.com>
1094
1095         InputType should return input renderers wrapped in RenderPtr.
1096         <https://webkit.org/b/126307>
1097
1098         Rename InputType::createRenderer() to createInputRenderer() and
1099         make it return RenderPtr<RenderElement>. Also made it non-const.
1100
1101         Reviewed by Anders Carlsson.
1102
1103 2013-12-30  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1104
1105         Cleanup static_cast<HTMLFormElement*> by using toHTMLFormElement()
1106         https://bugs.webkit.org/show_bug.cgi?id=126309
1107
1108         Reviewed by Andreas Kling.
1109
1110         To detect bad type casts, it would be good to use toHTMLFormElement() instead of
1111         using manual type cast. Additionally FORM_ASSOCIATED_ELEMENT_TYPE_CASTS is introduced newly
1112         to do it.
1113
1114         No new tests, no behavior changes.
1115
1116         * html/FormAssociatedElement.h:
1117         * html/HTMLFormControlElement.h:
1118         * html/HTMLFormElement.cpp:
1119         (WebCore::HTMLFormElement::submitImplicitly):
1120         (WebCore::HTMLFormElement::validateInteractively):
1121         (WebCore::HTMLFormElement::submit):
1122         (WebCore::HTMLFormElement::reset):
1123         (WebCore::HTMLFormElement::defaultButton):
1124         (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
1125         (WebCore::HTMLFormElement::documentDidResumeFromPageCache):
1126         * loader/FormSubmission.cpp:
1127         (WebCore::FormSubmission::create):
1128
1129 2013-12-30  Anders Carlsson  <andersca@apple.com>
1130
1131         Replace yield() and pauseBriefly() with std::this_thread::yield()
1132         https://bugs.webkit.org/show_bug.cgi?id=126105
1133
1134         Reviewed by Sam Weinig.
1135
1136         * platform/sql/SQLiteDatabase.cpp:
1137         (WebCore::SQLiteDatabase::interrupt):
1138
1139 2013-12-30  Andreas Kling  <akling@apple.com>
1140
1141         Rename createRenderObject() to createRenderer().
1142
1143         Somewhat rubber-stamped by Antti Koivisto.
1144
1145 2013-12-30  Andreas Kling  <akling@apple.com>
1146
1147         Document should store its RenderView in a RenderPtr.
1148         <https://webkit.org/b/126299>
1149
1150         Make Document::m_renderView a RenderPtr<RenderView> and remove one
1151         manual destroy() call. Also removed the setRenderView() helper and
1152         inlined it at the two call sites.
1153
1154         Reviewed by Antti Koivisto.
1155
1156 2013-12-30  Martin Robinson  <mrobinson@igalia.com>
1157
1158         [CMake] [GTK] Add support for GObject introspection
1159         https://bugs.webkit.org/show_bug.cgi?id=126162
1160
1161         Reviewed by Daniel Bates.
1162
1163         * PlatformGTK.cmake: Build a list of WebKitDOM headers and expose it to the
1164         parent scope of the build.
1165
1166 2013-12-30  Andreas Kling  <akling@apple.com>
1167
1168         Text::createTextRenderer() should return a RenderPtr.
1169         <https://webkit.org/b/126292>
1170
1171         Make createTextRenderer() return a RenderPtr and remove one manual
1172         destroy() call. Also, since it should always return a valid object,
1173         I turned a null check into an assertion instead.
1174
1175         Reviewed by Antti Koivisto.
1176
1177 2013-12-30  Antti Koivisto  <antti@apple.com>
1178
1179         Remove attachChild
1180         https://bugs.webkit.org/show_bug.cgi?id=126288
1181
1182         Reviewed by Andreas Kling.
1183
1184         * dom/ContainerNode.cpp:
1185         (WebCore::destroyRenderTreeIfNeeded):
1186         
1187             Rename detachChild and move the tests here.
1188
1189         (WebCore::ContainerNode::takeAllChildrenFrom):
1190         
1191             No need to call attachRenderTree explicitly anymore.
1192
1193         (WebCore::ContainerNode::removeBetween):
1194
1195 2013-12-29  Andreas Kling  <akling@apple.com>
1196
1197         RenderLayer: Store corner and resizer renderers in RenderPtrs.
1198         <https://webkit.org/b/126274>
1199
1200         Turn RenderLayer::m_scrollCorner and m_resizer into RenderPtrs.
1201         Removed manual destroy() calls as appropriate. Also tweaked some
1202         code to reduce nesting.
1203
1204         Reviewed by Anders Carlsson.
1205
1206 2013-12-30  Antti Koivisto  <antti@apple.com>
1207
1208         XML document builder should create render tree asynchronously
1209         https://bugs.webkit.org/show_bug.cgi?id=126285
1210
1211         Reviewed by Andreas Kling.
1212         
1213         Stop creating renderers explicitly. 
1214         Fix SVG <use> element to not rely on parse time render tree construction.
1215
1216         * svg/SVGUseElement.cpp:
1217         (WebCore::SVGUseElement::svgAttributeChanged):
1218         
1219             Remove renderer check, we may not have created the render tree yet.
1220
1221         (WebCore::SVGUseElement::willAttachRenderers):
1222         
1223             Switch to willAttachRenderers from willRecalcStyle. The latter is only called as long as style
1224             recalc doesn't start creating new renderers.
1225
1226         (WebCore::SVGUseElement::invalidateShadowTree):
1227         
1228             Remove renderer check, we may not have created the render tree yet. 
1229             Invalidate with ReconstructRenderTree so willAttachRenderers will always get called.
1230
1231         * svg/SVGUseElement.h:
1232         * xml/parser/XMLDocumentParser.cpp:
1233         (WebCore::XMLDocumentParser::exitText):
1234         * xml/parser/XMLDocumentParserLibxml2.cpp:
1235         (WebCore::XMLDocumentParser::startElementNs):
1236         (WebCore::XMLDocumentParser::cdataBlock):
1237         
1238             Remove explicit call to attachRenderTree. The render tree will be created lazily.
1239
1240 2013-12-29  Joone Hur  <joone.hur@intel.com>
1241
1242         Reverted r156742. The same fix was reverted from Blink due to heap-use-after-free on ClusterFuzz.
1243         https://bugs.webkit.org/show_bug.cgi?id=126275
1244
1245         https://codereview.chromium.org/102993011
1246
1247         Reviewed by Darin Adler.
1248
1249         * rendering/RenderBlock.cpp:
1250         (WebCore::RenderBlock::updateFirstLetter):
1251
1252 2013-12-29  ChangSeok Oh  <changseok.oh@collabora.com>
1253
1254         Remove unused functions in GraphicsContext3D.cpp
1255         https://bugs.webkit.org/show_bug.cgi?id=126265
1256
1257         Reviewed by Andreas Kling.
1258
1259         platformGraphicsContext3D, platformTexture and platformLayer in GC3D.cpp
1260         seem not used by any ports.
1261
1262         No new tests, no functionality changed.
1263
1264         * platform/graphics/GraphicsContext3D.cpp:
1265
1266 2013-12-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1267
1268         Fix build error on 64bit debug build.
1269         https://bugs.webkit.org/show_bug.cgi?id=126248
1270
1271         r161076 used ‘%lli’(for long long int) for int64_t(aka long int).
1272         However, in a 64bit compile, int64_t is 'long int', not a 'long long int'.
1273         To support 32bit and 64bit, we use static_cast<long long>.
1274
1275         * Modules/indexeddb/IDBTransactionBackend.cpp:
1276         (WebCore::IDBTransactionBackend::commit):
1277
1278 2013-12-29  Antti Koivisto  <antti@apple.com>
1279
1280         Remove some accidental commented out code.
1281
1282         * testing/Internals.cpp:
1283         (WebCore::Internals::mallocStatistics):
1284
1285 2013-12-29  Antti Koivisto  <antti@apple.com>
1286
1287         Fix build.
1288
1289         * xml/parser/XMLDocumentParser.cpp:
1290
1291 2013-12-29  Antti Koivisto  <antti@apple.com>
1292
1293         Remove Node::attached()
1294         https://bugs.webkit.org/show_bug.cgi?id=126276
1295
1296         Reviewed by Sam Weinig.
1297
1298         Node::attached() is poorly defined. Replace it with renderer() and inRenderedDocument() tests as appropriate.
1299         
1300         Also remove some unnecessary explicit attachRenderTree/detachRenderTree calls from the tree builders.
1301
1302 2013-12-29  Andreas Kling  <akling@apple.com>
1303
1304         RenderLayer: Store reflection renderer in a RenderPtr.
1305         <https://webkit.org/b/126273>
1306
1307         Reviewed by Anders Carlsson.
1308
1309         * rendering/RenderLayer.h:
1310         * rendering/RenderLayer.cpp:
1311         (WebCore::RenderLayer::RenderLayer):
1312         (WebCore::RenderLayer::calculateClipRects):
1313
1314             Turn RenderLayer::m_reflection into a RenderPtr<RenderReplica>
1315             instead of a raw pointer.
1316
1317         * WebCore.xcodeproj/project.pbxproj:
1318
1319             Add RenderPtr.h to private headers.
1320
1321 2013-12-28  Andreas Kling  <akling@apple.com>
1322
1323         Add an owning smart pointer for RenderObjects and start using it.
1324         <https://webkit.org/b/126251>
1325
1326         This patch adds a RenderPtr pointer, essentially an OwnPtr for
1327         RenderObjects. The difference is that RenderPtr destroys the object
1328         by calling destroy() on it.
1329
1330         This is necessary to implement the willBeDestroyed() mechanism in
1331         RenderObject that notifies renderers just before they are about to
1332         be deleted, while they can still do tree traversal, etc.
1333
1334         I also added a make_unique-alike helper so you can write:
1335
1336             auto renderer = createRenderObject<RenderImage>(...);
1337
1338         Put it all to use by making ContentData::createRenderer() return
1339         RenderPtr<RenderObject> instead of raw RenderObject*.
1340
1341         Reviewed by Antti Koivisto.
1342
1343 2013-12-28  Benjamin Poulain  <benjamin@webkit.org>
1344
1345         Add a missing include path for GTK
1346         https://bugs.webkit.org/show_bug.cgi?id=126257
1347
1348         Reviewed by Philippe Normand.
1349
1350         * GNUmakefile.am:
1351
1352 2013-12-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1353
1354         Unreviewed. Update GObject DOM symbols file after r160733.
1355
1356         * bindings/gobject/webkitdom.symbols:
1357
1358 2013-12-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1359
1360         [GTK] Downloads are broken with the network process enabled
1361         https://bugs.webkit.org/show_bug.cgi?id=126131
1362
1363         Reviewed by Martin Robinson.
1364
1365         The problem is that the network process crashes when trying to
1366         convert the handle to a download, because at that point the
1367         download has finished and the handle is NULL. This happens because
1368         we are not implementing ResourceHandle::continueDidReceiveResponse().
1369
1370         * platform/network/soup/ResourceHandleSoup.cpp:
1371         (WebCore::nextMultipartResponsePartCallback): Call
1372         continueAfterDidReceiveResponse() when not using async callbacks.
1373         (WebCore::sendRequestCallback): Ditto.
1374         (WebCore::continueAfterDidReceiveResponse): Helper function that
1375         continues the load after didReceiveResponse.
1376         (WebCore::ResourceHandle::continueDidReceiveResponse): Call
1377         continueAfterDidReceiveResponse().
1378
1379 2013-12-27  Daniel Bates  <dabates@apple.com>
1380
1381         Another attempt to fix the Windows build after <http://trac.webkit.org/changeset/161106>
1382         (https://bugs.webkit.org/show_bug.cgi?id=126180)
1383
1384         * WebCore.vcxproj/WebCore.vcxproj.filters: Add files platform/audio/{AudioSession, AudioSessionListener}.h
1385         * WebCore.vcxproj/WebCoreCommon.props: Add directory WebCore/platform/audio to the list of
1386         include directories.
1387
1388 2013-12-27  Daniel Bates  <dabates@apple.com>
1389
1390         Attempt to fix the Windows build after <http://trac.webkit.org/changeset/161106>
1391         (https://bugs.webkit.org/show_bug.cgi?id=126180)
1392
1393         Add files platform/audio/AudioSession.{cpp, h} and platform/audio/AudioSessionListener.h
1394         to the Visual Studio project. Note, the contents of these files are guarded by USE(AUDIO_SESSION),
1395         which is only enabled on Mac and iOS at the time of writing.
1396
1397         I thought to try this approach to fix the build so as to avoid adding an extraneous
1398         USE(AUDIO_SESSION)-guard around the #include "AudioSession.h" in Settings.cpp since
1399         the contents of the file AudioSession.h is guarded by USE(AUDIO_SESSION).
1400
1401         * WebCore.vcxproj/WebCore.vcxproj:
1402
1403 2013-12-27  Daniel Bates  <dabates@apple.com>
1404
1405         [iOS] Upstream WebCore/page changes
1406         https://bugs.webkit.org/show_bug.cgi?id=126180
1407
1408         Reviewed by Darin Adler.
1409
1410         * WebCore.xcodeproj/project.pbxproj:
1411         * dom/EventNames.h:
1412         (WebCore::EventNames::isGestureEventType): Added.
1413         * page/AlternativeTextClient.h: Do not define WTF_USE_DICTATION_ALTERNATIVES when building for iOS.
1414         * page/Chrome.cpp:
1415         (WebCore::Chrome::Chrome):
1416         (WebCore::Chrome::dispatchViewportPropertiesDidChange): Added; guarded by PLATFORM(IOS).
1417         (WebCore::Chrome::setCursor): Make this an empty function when building for iOS.
1418         (WebCore::Chrome::setCursorHiddenUntilMouseMoves): Ditto.
1419         (WebCore::Chrome::didReceiveDocType): Added; iOS-specific.
1420         * page/Chrome.h:
1421         (WebCore::Chrome::setDispatchViewportDataDidChangeSuppressed): Added; guarded by PLATFORM(IOS).
1422         * page/ChromeClient.h:
1423         (WebCore::ChromeClient::didFlushCompositingLayers): Added; guarded by PLATFORM(IOS).
1424         (WebCore::ChromeClient::fetchCustomFixedPositionLayoutRect): Added; guarded by PLATFORM(IOS).
1425         (WebCore::ChromeClient::updateViewportConstrainedLayers): Added; guarded by PLATFORM(IOS).
1426         * page/DOMTimer.cpp:
1427         (WebCore::DOMTimer::install): Added iOS-specific code.
1428         (WebCore::DOMTimer::fired): Ditto.
1429         * page/DOMWindow.cpp:
1430         (WebCore::DOMWindow::DOMWindow): Ditto.
1431         (WebCore::DOMWindow::innerHeight): Ditto.
1432         (WebCore::DOMWindow::innerWidth): Ditto.
1433         (WebCore::DOMWindow::scrollX): Ditto.
1434         (WebCore::DOMWindow::scrollY): Ditto.
1435         (WebCore::DOMWindow::scrollBy): Ditto.
1436         (WebCore::DOMWindow::scrollTo): Ditto.
1437         (WebCore::DOMWindow::clearTimeout): Ditto.
1438         (WebCore::DOMWindow::addEventListener): Ditto.
1439         (WebCore::DOMWindow::incrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
1440         (WebCore::DOMWindow::decrementScrollEventListenersCount): Added; guarded by PLATFORM(IOS).
1441         (WebCore::DOMWindow::resetAllGeolocationPermission): Added; Also added FIXME comment.
1442         (WebCore::DOMWindow::removeEventListener): Added iOS-specific code.
1443         (WebCore::DOMWindow::dispatchEvent): Modified to prevent dispatching duplicate pageshow and pagehide
1444         events per <http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-pageshow>.
1445         (WebCore::DOMWindow::removeAllEventListeners): Added iOS-specific code.
1446         * page/DOMWindow.h:
1447         * page/DOMWindow.idl: Added IOS_GESTURE_EVENTS-guarded attributes: ongesture{change, end, start}. Also
1448         added IOS_TOUCH_EVENTS-guarded attributes: {Touch, TouchList}Constructor.
1449         * page/EditorClient.h:
1450         * page/EventHandler.cpp:
1451         (WebCore::EventHandler::EventHandler): Added iOS-specific code.
1452         (WebCore::EventHandler::clear): Ditto.
1453         (WebCore::EventHandler::startPanScrolling): Make this an empty function when building for iOS.
1454         (WebCore::EventHandler::handleMousePressEvent): Modified to invalidate a click when the clicked node is
1455         null. Also, opt out of code for updating the scrollbars as UIKit manages scrollbars on iOS.
1456         (WebCore::EventHandler::handleMouseMoveEvent): Opt of code for updating the scrollbars and cursor when building on iOS.
1457         (WebCore::hitTestResultInFrame): Made this a file-local static function since it's only used in EventHandler.cpp.
1458         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled): Added iOS-specific code.
1459         * page/EventHandler.h:
1460         * page/FocusController.h:
1461         * page/Frame.cpp:
1462         (WebCore::Frame::Frame): Added iOS-specific code.
1463         (WebCore::Frame::scrollOverflowLayer): Added; iOS-specific.
1464         (WebCore::Frame::overflowAutoScrollTimerFired): Added; iOS-specific.
1465         (WebCore::Frame::startOverflowAutoScroll): Added; iOS-specific.
1466         (WebCore::Frame::checkOverflowScroll): Added; iOS-specific.
1467         (WebCore::Frame::willDetachPage): Added iOS-specific code.
1468         (WebCore::Frame::createView): Ditto.
1469         (WebCore::Frame::setSelectionChangeCallbacksDisabled): Added; iOS-specific.
1470         (WebCore::Frame::selectionChangeCallbacksDisabled): Added; iOS-specific.
1471         * page/Frame.h:
1472         (WebCore::Frame::timersPaused): Added; guarded by PLATFORM(IOS).
1473         * page/FrameView.cpp:
1474         (WebCore::FrameView::FrameView): Added iOS-specific code.
1475         (WebCore::FrameView::clear): Ditto.
1476         (WebCore::FrameView::flushCompositingStateForThisFrame): Ditto.
1477         (WebCore::FrameView::graphicsLayerForPlatformWidget): Added.
1478         (WebCore::FrameView::scheduleLayerFlushAllowingThrottling): Added.
1479         (WebCore::FrameView::layout): Added iOS-specific code.
1480         (WebCore::countRenderedCharactersInRenderObjectWithThreshold): Added; helper function used by FrameView::renderedCharactersExceed().
1481         Also added FIXME comment.
1482         (WebCore::FrameView::renderedCharactersExceed): Added.
1483         (WebCore::FrameView::visibleContentsResized): Added iOS-specific code.
1484         (WebCore::FrameView::adjustTiledBackingCoverage): Ditto.
1485         (WebCore::FrameView::performPostLayoutTasks): Ditto.
1486         (WebCore::FrameView::sendResizeEventIfNeeded): Ditto.
1487         (WebCore::FrameView::paintContents): Added iOS-specific code. Also added FIXME comments.
1488         (WebCore::FrameView::setUseCustomFixedPositionLayoutRect): Added; iOS-specific.
1489         (WebCore::FrameView::setCustomFixedPositionLayoutRect): Added; iOS-specific.
1490         (WebCore::FrameView::updateFixedPositionLayoutRect): Added; iOS-specific.
1491         * page/FrameView.h:
1492         * page/Navigator.cpp:
1493         (WebCore::Navigator::standalone): Added; iOS-specific.
1494         * page/Navigator.h:
1495         * page/Navigator.idl: Added WTF_PLATFORM_IOS-guarded attribute: standalone. Also added FIXME comment.
1496         * page/NavigatorBase.cpp:
1497         (WebCore::NavigatorBase::platform): Added iOS-specific code.
1498         * page/Page.h:
1499         (WebCore::Page::hasCustomHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
1500         to remove this method.
1501         (WebCore::Page::customHTMLTokenizerTimeDelay): Added; guarded by PLATFORM(IOS). Also added FIXME comment
1502         to remove this method.
1503         * page/PageGroup.cpp:
1504         (WebCore::PageGroup::removeVisitedLink): Added.
1505         * page/PageGroup.h:
1506         * page/Settings.cpp:
1507         (WebCore::Settings::Settings):
1508         (WebCore::Settings::setScriptEnabled): Added; guarded by PLATFORM(IOS).
1509         (WebCore::Settings::setStandalone): Added; guarded by PLATFORM(IOS).
1510         (WebCore::Settings::setAudioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
1511         (WebCore::Settings::audioSessionCategoryOverride): Added; guarded by PLATFORM(IOS).
1512         (WebCore::Settings::setNetworkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
1513         (WebCore::Settings::networkDataUsageTrackingEnabled): Added; guarded by PLATFORM(IOS).
1514         (WebCore::sharedNetworkInterfaceNameGlobal): Added; guarded by PLATFORM(IOS).
1515         (WebCore::Settings::setNetworkInterfaceName): Added; guarded by PLATFORM(IOS).
1516         (WebCore::Settings::networkInterfaceName): Added; guarded by PLATFORM(IOS).
1517         * page/Settings.h:
1518         (WebCore::Settings::setMaxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
1519         (WebCore::Settings::maxParseDuration): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
1520         (WebCore::Settings::standalone): Added; guarded by PLATFORM(IOS).
1521         (WebCore::Settings::setTelephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
1522         (WebCore::Settings::telephoneNumberParsingEnabled): Added; guarded by PLATFORM(IOS).
1523         (WebCore::Settings::setMediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
1524         (WebCore::Settings::mediaDataLoadsAutomatically): Added; guarded by PLATFORM(IOS).
1525         (WebCore::Settings::setShouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
1526         (WebCore::Settings::shouldTransformsAffectOverflow): Added; guarded by PLATFORM(IOS).
1527         (WebCore::Settings::setShouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
1528         (WebCore::Settings::shouldDispatchJavaScriptWindowOnErrorEvents): Added; guarded by PLATFORM(IOS).
1529         (WebCore::Settings::setAlwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
1530         (WebCore::Settings::alwaysUseBaselineOfPrimaryFont): Added; guarded by PLATFORM(IOS).
1531         (WebCore::Settings::setAlwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
1532         (WebCore::Settings::alwaysUseAcceleratedOverflowScroll): Added; guarded by PLATFORM(IOS).
1533         * page/Settings.in: Added IOS_AIRPLAY-guarded setting: mediaPlaybackAllowsAirPlay.
1534         * page/animation/CSSPropertyAnimation.cpp:
1535         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Added iOS-specific code and FIXME comment.
1536         * page/ios/EventHandlerIOS.mm: Added.
1537         * page/ios/FrameIOS.mm: Added.
1538         * page/mac/ChromeMac.mm:
1539         * page/mac/PageMac.cpp:
1540         (WebCore::Page::addSchedulePair): Opt out of code when building for iOS.
1541         (WebCore::Page::removeSchedulePair): Ditto.
1542         * page/mac/SettingsMac.mm:
1543         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Added iOS-specific code.
1544         * page/mac/WebCoreFrameView.h:
1545
1546 2013-12-27  Gavin Barraclough  <barraclough@apple.com>
1547
1548         Merge PageVisibilityState & ViewState::IsVisible in WebKit2
1549         https://bugs.webkit.org/show_bug.cgi?id=126214
1550
1551         Reviewed by Alexey Proskuryakov.
1552
1553         WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
1554         state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
1555         state also tracks the prerender state - so split this out and handle it separately (a change
1556         we should make in WebCore, too).
1557
1558         WebCore - changes the API tests exposed a bug, a view should only ever come out of the
1559         prerender state when it becomes visible - redundant notifications that the view is still
1560         hidden should be ignored.
1561
1562         * page/Page.cpp:
1563         (WebCore::Page::setVisibilityState):
1564             - ignore visibility state change to hidden, if the current state is prerender.
1565
1566 2013-12-27  Joseph Pecoraro  <pecoraro@apple.com>
1567
1568         Unreviewed Windows build fix for r160946.
1569
1570         Add another file to the Windows InspectorAllInOne.cpp.
1571
1572         * inspector/InspectorAllInOne.cpp:
1573
1574 2013-12-27  Commit Queue  <commit-queue@webkit.org>
1575
1576         Unreviewed, rolling out r161096.
1577         http://trac.webkit.org/changeset/161096
1578         https://bugs.webkit.org/show_bug.cgi?id=126256
1579
1580         Made lots of tests crash (Requested by ap on #webkit).
1581
1582         * dom/ContainerNode.cpp:
1583         (WebCore::ContainerNode::insertBefore):
1584         (WebCore::ContainerNode::replaceChild):
1585         (WebCore::willRemoveChildren):
1586         (WebCore::ContainerNode::appendChild):
1587         * dom/Document.cpp:
1588         (WebCore::Document::visibilityStateChanged):
1589         (WebCore::Document::moveNodeIteratorsToNewDocument):
1590         (WebCore::Document::updateRangesAfterChildrenChanged):
1591         (WebCore::Document::nodeChildrenWillBeRemoved):
1592         (WebCore::Document::nodeWillBeRemoved):
1593         (WebCore::Document::textInserted):
1594         (WebCore::Document::textRemoved):
1595         (WebCore::Document::textNodesMerged):
1596         (WebCore::Document::textNodeSplit):
1597         (WebCore::Document::documentWillSuspendForPageCache):
1598         (WebCore::Document::documentDidResumeFromPageCache):
1599         (WebCore::Document::mediaVolumeDidChange):
1600         (WebCore::Document::privateBrowsingStateDidChange):
1601         (WebCore::Document::captionPreferencesChanged):
1602         (WebCore::Document::validateAutoSizingNodes):
1603         (WebCore::Document::resetAutoSizingNodes):
1604         (WebCore::Document::webkitExitFullscreen):
1605         * dom/MutationObserver.cpp:
1606         (WebCore::MutationObserver::disconnect):
1607         (WebCore::MutationObserver::getObservedNodes):
1608         (WebCore::MutationObserver::deliver):
1609         * dom/MutationObserverInterestGroup.cpp:
1610         (WebCore::MutationObserverInterestGroup::isOldValueRequested):
1611         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
1612         * dom/MutationObserverRegistration.cpp:
1613         (WebCore::MutationObserverRegistration::clearTransientRegistrations):
1614         (WebCore::MutationObserverRegistration::addRegistrationNodesToSet):
1615         * dom/Node.cpp:
1616         (WebCore::Node::dumpStatistics):
1617         (WebCore::Document::invalidateNodeListAndCollectionCaches):
1618         (WebCore::NodeListsNodeData::invalidateCaches):
1619         (WebCore::Node::didMoveToNewDocument):
1620         (WebCore::collectMatchingObserversForMutation):
1621         (WebCore::Node::notifyMutationObserversNodeWillDetach):
1622         * dom/NodeRareData.h:
1623         (WebCore::NodeListsNodeData::adoptDocument):
1624         * dom/ScriptExecutionContext.cpp:
1625         (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
1626         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
1627         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1628         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1629         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
1630         (WebCore::ScriptExecutionContext::closeMessagePorts):
1631         (WebCore::ScriptExecutionContext::adjustMinimumTimerInterval):
1632         (WebCore::ScriptExecutionContext::didChangeTimerAlignmentInterval):
1633         * dom/WebKitNamedFlow.cpp:
1634         (WebCore::WebKitNamedFlow::getRegionsByContent):
1635         (WebCore::WebKitNamedFlow::getRegions):
1636         (WebCore::WebKitNamedFlow::getContent):
1637
1638 2013-12-26  Sam Weinig  <sam@webkit.org>
1639
1640         Convert some of WebCore/dom over to range-for loops
1641         https://bugs.webkit.org/show_bug.cgi?id=126250
1642
1643         Reviewed by Andreas Kling.
1644
1645         * dom/ContainerNode.cpp:
1646         * dom/Document.cpp:
1647         * dom/MutationObserver.cpp:
1648         * dom/MutationObserverInterestGroup.cpp:
1649         * dom/MutationObserverRegistration.cpp:
1650         * dom/Node.cpp:
1651         * dom/NodeRareData.h:
1652         * dom/ScriptExecutionContext.cpp:
1653         * dom/WebKitNamedFlow.cpp:
1654
1655 2013-12-26  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1656
1657         [Nix] Cleanup Source/WebCore/PlatformNix.cmake
1658         https://bugs.webkit.org/show_bug.cgi?id=126226
1659
1660         Reviewed by Csaba Osztrogonác.
1661
1662         No new tests needed.
1663
1664         * PlatformNix.cmake:
1665
1666 2013-12-26  Joseph Pecoraro  <pecoraro@apple.com>
1667
1668         Unreviewed attempt at Windows build fix.
1669
1670         I think Window's "AllInOne.cpp" is causing a using namespace JSC
1671         to cause naming conflicts between Inspector::TypeBuilder::Debugger::types
1672         and JSC::types. So removing the ambiguity.
1673
1674         * inspector/InjectedScript.cpp:
1675         (WebCore::InjectedScript::getProperties):
1676         (WebCore::InjectedScript::wrapCallFrames):
1677
1678 2013-12-22  Andreas Kling  <akling@apple.com>
1679
1680         Make Text::createTextRenderer() take a const RenderStyle&.
1681         <https://webkit.org/b/126136>
1682
1683         Nuke a FIXME about constifying a RenderStyle& local.
1684
1685         Reviewed by Anders Carlsson.
1686
1687 2013-12-22  Andreas Kling  <akling@apple.com>
1688
1689         Move more inlines from RenderObject to RenderElement.
1690         <https://webkit.org/b/126134>
1691
1692         Lift some inline functions that use style() from RenderObject over
1693         to RenderElement, making them branchless.
1694
1695         Reviewed by Anders Carlsson.
1696
1697 2013-12-26  ChangSeok Oh  <changseok.oh@collabora.com>
1698
1699         Unreviewed build fix after r159526.
1700         isBoxValue is used at out of ENABLE_CSS_SHAPES gaurd. It causes a compile failure.
1701         So I moved isBoxValue to out side of ENABLE_CSS_SHAPES.
1702
1703         * css/CSSParser.cpp:
1704
1705 2013-12-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1706
1707         Set m_pos as private in InlineIterator, and use getter and setter functions.
1708         https://bugs.webkit.org/show_bug.cgi?id=125614
1709
1710         Reviewed by Alexey Proskuryakov.
1711
1712         InlineIterator has been exported m_pos as public directly though it is member variable.
1713         This patch set it as private, and add getter/setter functions for it.
1714
1715         No new tests, no behavior changes.
1716
1717         * rendering/InlineIterator.h:
1718         (WebCore::InlineIterator::setOffset):
1719         (WebCore::operator==):
1720         (WebCore::operator!=):
1721         (WebCore::InlineBidiResolver::appendRun):
1722         * rendering/RenderBlockLineLayout.cpp:
1723         (WebCore::RenderBlockFlow::appendRunsForObject):
1724         (WebCore::constructBidiRunsForLine):
1725         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1726         (WebCore::RenderBlockFlow::matchedEndLine):
1727         (WebCore::LineBreaker::nextSegmentBreak):
1728         * rendering/line/BreakingContextInlineHeaders.h:
1729         (WebCore::BreakingContext::handleBR):
1730         (WebCore::BreakingContext::handleFloat):
1731         (WebCore::iteratorIsBeyondEndOfRenderCombineText):
1732         (WebCore::ensureCharacterGetsLineBox):
1733         (WebCore::BreakingContext::handleText):
1734         (WebCore::checkMidpoints):
1735         (WebCore::BreakingContext::handleEndOfLine):
1736         * rendering/line/TrailingObjects.cpp:
1737         (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes):
1738
1739 2013-12-25  Kim Byung Jun  <bj1987.kim@samsung.com>
1740
1741         [EFL] Delete file.edc and file_*.png.
1742         https://bugs.webkit.org/show_bug.cgi?id=125134
1743
1744         Reviewed by Gyuyoung Kim.
1745
1746         File_theme uses button form.
1747
1748         * platform/efl/DefaultTheme/CMakeLists.txt:
1749         * platform/efl/DefaultTheme/default.edc:
1750         * platform/efl/DefaultTheme/widget/file/file.edc: Removed.
1751         * platform/efl/DefaultTheme/widget/file/file_focus.png: Removed.
1752         * platform/efl/DefaultTheme/widget/file/file_hover.png: Removed.
1753         * platform/efl/DefaultTheme/widget/file/file_normal.png: Removed.
1754         * platform/efl/DefaultTheme/widget/file/file_press.png: Removed.
1755
1756 2013-12-25  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1757
1758         [Nix] Adding createDragImageIconForCachedImageFilename method to DragImageNix
1759         https://bugs.webkit.org/show_bug.cgi?id=126230
1760
1761         Reviewed by Daniel Bates.
1762
1763         Also returning nullptr in other functions that were returning 0 as a pointer.
1764
1765         * platform/nix/DragImageNix.cpp:
1766         (WebCore::createDragImageFromImage):
1767         (WebCore::createDragImageIconForCachedImage):
1768         (WebCore::createDragImageIconForCachedImageFilename):
1769
1770 2013-12-25  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1771
1772         [Nix] Fixing DragData::asFragment signature in DragDataNix.cpp
1773         https://bugs.webkit.org/show_bug.cgi?id=126229
1774
1775         Reviewed by Daniel Bates.
1776
1777         * platform/nix/DragDataNix.cpp:
1778         (WebCore::DragData::asFragment):
1779
1780 2013-12-25  Commit Queue  <commit-queue@webkit.org>
1781
1782         Unreviewed, rolling out r161033 and r161074.
1783         http://trac.webkit.org/changeset/161033
1784         http://trac.webkit.org/changeset/161074
1785         https://bugs.webkit.org/show_bug.cgi?id=126240
1786
1787         Oliver says that a rollout would be better (Requested by ap on
1788         #webkit).
1789
1790         * bindings/js/JSDOMWindowCustom.cpp:
1791         (WebCore::JSDOMWindow::put):
1792         * bindings/objc/WebScriptObject.mm:
1793         (-[WebScriptObject setValue:forKey:]):
1794         * bindings/scripts/CodeGeneratorJS.pm:
1795         (GenerateImplementation):
1796         * bindings/scripts/test/JS/JSTestInterface.cpp:
1797         (WebCore::JSTestInterface::putByIndex):
1798         * bridge/NP_jsobject.cpp:
1799         (_NPN_SetProperty):
1800
1801 2013-12-25  Brady Eidson  <beidson@apple.com>
1802
1803         DatabaseProcess: Implement version changing
1804         https://bugs.webkit.org/show_bug.cgi?id=126099
1805
1806         Reviewed by Sam Weinig.
1807
1808         No new tests (No change in WebCore behavior).
1809
1810         * Modules/indexeddb/IDBTransactionBackend.cpp:
1811         (WebCore::IDBTransactionBackend::commit): Update some logging.
1812
1813         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
1814         (WebCore::IDBDatabaseBackend::VersionChangeOperation::perform): Move some things that used to be in
1815           IDBServerConnectionLevelDB::changeDatabaseVersion to this cross-platform location.
1816         * Modules/indexeddb/IDBTransactionBackendOperations.h:
1817         (WebCore::IDBDatabaseBackend::VersionChangeOperation::transaction):
1818
1819         * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp:
1820         (WebCore::IDBServerConnectionLevelDB::changeDatabaseVersion): Move the actual updating of the database backend
1821           metadata to the VersionChangeOperation.
1822
1823 2013-12-25  Martin Robinson  <mrobinson@igalia.com>
1824
1825         [GTK] [CMake] Clean up generated sources directories
1826         https://bugs.webkit.org/show_bug.cgi?id=126216
1827
1828         Reviewed by Gustavo Noronha Silva.
1829
1830         * PlatformGTK.cmake: Use the new directory variables.
1831
1832 2013-12-25  Dirk Schulze  <krit@webkit.org>
1833
1834         Support <box> values parsing on 'clip-path' property
1835         https://bugs.webkit.org/show_bug.cgi?id=126147
1836
1837         Reviewed by Ryosuke Niwa.
1838
1839         Support parsing of the background reference boxes, margin-box and bounding-box.
1840         A box will be a reference box and define the origin for a basic shape.
1841         If no basic shape is specified, the box defines the clipping path itself.
1842         The specification text follows the changes to CSS Shapes now.
1843
1844         https://dvcs.w3.org/hg/FXTF/raw-file/3f213145303e/css-masking-1/index.html#the-clip-path
1845
1846         Existing parsing test have been extended to test box values as well.
1847
1848         * css/CSSParser.cpp:
1849         (WebCore::CSSParser::parseValue):
1850         (WebCore::CSSParser::parseClipPath):
1851         * css/CSSParser.h:
1852         * css/CSSValueKeywords.in:
1853         * css/DeprecatedStyleBuilder.cpp:
1854         (WebCore::ApplyPropertyClipPath::applyValue):
1855
1856 2013-12-25  David Kilzer  <ddkilzer@apple.com>
1857
1858         [iOS] Upstream WebCore/pdf changes
1859         http://webkit.org/b/126097
1860
1861         Reviewed by Sam Weinig.
1862
1863         * WebCore.xcodeproj/project.pbxproj: Added files to project.
1864         * pdf/ios/PDFDocument.cpp: Added.
1865         (WebCore::PDFDocumentParser::create):
1866         (WebCore::PDFDocumentParser::document):
1867         (WebCore::PDFDocumentParser::PDFDocumentParser):
1868         (WebCore::PDFDocument::createParser):
1869         * pdf/ios/PDFDocument.h: Added.
1870         (WebCore::PDFDocument::create):
1871         (WebCore::PDFDocument::PDFDocument):
1872
1873 2013-12-24  Commit Queue  <commit-queue@webkit.org>
1874
1875         Unreviewed, rolling out r160959.
1876         http://trac.webkit.org/changeset/160959
1877         https://bugs.webkit.org/show_bug.cgi?id=126222
1878
1879         Caused Windows build to fail (Requested by rfong on #webkit).
1880
1881         * platform/sql/SQLiteDatabase.cpp:
1882         (WebCore::SQLiteDatabase::interrupt):
1883
1884 2013-12-24  Ryosuke Niwa  <rniwa@webkit.org>
1885
1886         Unreviewed, rolling out r161051.
1887         http://trac.webkit.org/changeset/161051
1888         https://bugs.webkit.org/show_bug.cgi?id=45994
1889
1890         Caused two DFG tests to hit assertions due to a separate bug
1891
1892         * xml/XMLHttpRequest.cpp:
1893         (WebCore::XMLHttpRequest::status):
1894         (WebCore::XMLHttpRequest::statusText):
1895         * xml/XMLHttpRequest.h:
1896         * xml/XMLHttpRequest.idl:
1897
1898 2013-12-24  Mihnea Ovidenie  <mihnea@adobe.com>
1899
1900         [CSSRegions] Crash while repainting an invalid region
1901         https://bugs.webkit.org/show_bug.cgi?id=126152
1902
1903         Reviewed by Daniel Bates.
1904
1905         An invalid region, part of a dependency cycle, should not attempt to repaint content from
1906         its associated named flow, otherwise there may be the case of an infinite repaint cycle,
1907         resulting in a crash due to a stack overflow.
1908
1909         Test: fast/regions/repaint/invalid-region-repaint-crash.html
1910
1911         * rendering/RenderLayer.cpp:
1912         (WebCore::RenderLayer::repaintIncludingDescendants):
1913
1914 2013-12-23  Ryosuke Niwa  <rniwa@webkit.org>
1915
1916         XMLHttpRequest: status and statusText throw DOM Exception 11 when the state is UNSENT or OPENED.
1917         https://bugs.webkit.org/show_bug.cgi?id=45994
1918
1919         Reviewed by Alexey Proskuryakov.
1920
1921         Merged https://chromium.googlesource.com/chromium/blink/+/23c90460de16e04c5aba7ed942fba76cb79fdb9b.
1922
1923         Latest XHR spec says that XHR should return 0 and an empty string when it's in UNSENT or OPENED state
1924         or error flag is set: http://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/#the-status-attribute
1925
1926         * xml/XMLHttpRequest.cpp:
1927         (WebCore::XMLHttpRequest::status):
1928         (WebCore::XMLHttpRequest::statusText):
1929         * xml/XMLHttpRequest.h:
1930         * xml/XMLHttpRequest.idl:
1931
1932 2013-12-23  Ryosuke Niwa  <rniwa@webkit.org>
1933
1934         Crash in ReplaceSelectionCommand
1935         https://bugs.webkit.org/show_bug.cgi?id=126107
1936
1937         Reviewed by Benjamin Poulain.
1938
1939         Merge https://chromium.googlesource.com/chromium/blink/+/c1ebe5c1e808daf9db5e348a8d0ab32570b9f7a5
1940         except the test since it doesn't reproduce the crash in WebKit.
1941
1942         * editing/ReplaceSelectionCommand.cpp:
1943         (WebCore::ReplaceSelectionCommand::doApply):
1944
1945 2013-12-23  Benjamin Poulain  <benjamin@webkit.org>
1946
1947         Add the pseudo classes link and any-link to the Selector Code Generator
1948         https://bugs.webkit.org/show_bug.cgi?id=126196
1949
1950         Reviewed by Ryosuke Niwa.
1951
1952         * cssjit/SelectorCompiler.cpp:
1953         (WebCore::SelectorCompiler::addPseudoType):
1954         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1955         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLink):
1956         * dom/Node.h:
1957         (WebCore::Node::flagIsElement):
1958         (WebCore::Node::flagIsLink):
1959         Fix the type to match TrustedImm32.
1960
1961 2013-12-23  Benjamin Poulain  <benjamin@webkit.org>
1962
1963         Add the experimental CSS code generator files to the remaining build systems
1964         https://bugs.webkit.org/show_bug.cgi?id=126192
1965
1966         Reviewed by Sam Weinig.
1967
1968         * CMakeLists.txt:
1969         * GNUmakefile.list.am:
1970         * WebCore.vcxproj/WebCore.vcxproj:
1971         * WebCore.vcxproj/WebCore.vcxproj.filters:
1972
1973 2013-12-23  Benjamin Poulain  <benjamin@webkit.org>
1974
1975         Add the pseudo class :focus to the Selector Code Generator
1976         https://bugs.webkit.org/show_bug.cgi?id=126189
1977
1978         Reviewed by Ryosuke Niwa.
1979
1980         * cssjit/SelectorCompiler.cpp:
1981         (WebCore::SelectorCompiler::addPseudoType):
1982         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
1983         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
1984         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFocused):
1985
1986 2013-12-23  Ryosuke Niwa  <rniwa@webkit.org>
1987
1988         Remove boolean argument from Element::setChildrenAffectBy* methods
1989         https://bugs.webkit.org/show_bug.cgi?id=126183
1990
1991         Reviewed by Daniel Bates.
1992
1993         Merge https://chromium.googlesource.com/chromium/blink/+/066ef2fa78336b2b65052cb17cb81b367fe7dbbf
1994
1995         These functions are never called with false.
1996
1997         * css/SelectorChecker.cpp:
1998         (WebCore::SelectorChecker::checkOne):
1999         * dom/Element.cpp:
2000         (WebCore::Element::setChildrenAffectedByActive):
2001         (WebCore::Element::setChildrenAffectedByDrag):
2002         * dom/Element.h:
2003         (WebCore::Element::setChildrenAffectedByHover):
2004
2005 2013-12-23  Tim Horton  <timothy_horton@apple.com>
2006
2007         Fix the iOS build after r161013 and r160672.
2008
2009         * WebCore.exp.in:
2010         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2011         (PlatformCALayerMac::updateCustomAppearance):
2012
2013 2013-12-23  Oliver Hunt  <oliver@apple.com>
2014
2015         Refactor PutPropertySlot to be aware of custom properties
2016         https://bugs.webkit.org/show_bug.cgi?id=126187
2017
2018         Reviewed by msaboff.
2019
2020         Update the bindings code generation and custom objects
2021         to the new function signatures
2022
2023         * bindings/js/JSDOMWindowCustom.cpp:
2024         (WebCore::JSDOMWindow::put):
2025         * bindings/objc/WebScriptObject.mm:
2026         (-[WebScriptObject setValue:forKey:]):
2027         * bindings/scripts/CodeGeneratorJS.pm:
2028         (GenerateImplementation):
2029         * bindings/scripts/test/JS/JSTestInterface.cpp:
2030         (WebCore::JSTestInterface::putByIndex):
2031         * bridge/NP_jsobject.cpp:
2032         (_NPN_SetProperty):
2033
2034 2013-12-23  Benjamin Poulain  <benjamin@webkit.org>
2035
2036         Add class matching to the Selector Code Generator
2037         https://bugs.webkit.org/show_bug.cgi?id=126176
2038
2039         Reviewed by Antti Koivisto.
2040
2041         Add selector matching based on classname to the Selector Compiler.
2042
2043         * cssjit/SelectorCompiler.cpp:
2044         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2045         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementDataMatching):
2046         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasClasses):
2047         * dom/ElementData.h:
2048         (WebCore::ElementData::classNamesMemoryOffset):
2049         * dom/SpaceSplitString.h:
2050         (WebCore::SpaceSplitStringData::sizeMemoryOffset):
2051         (WebCore::SpaceSplitStringData::tokensMemoryOffset):
2052
2053 2013-12-23  Daniel Bates  <dabates@apple.com>
2054
2055         [iOS] Upstream WebCore/storage changes
2056         https://bugs.webkit.org/show_bug.cgi?id=125913
2057
2058         Reviewed by David Kilzer.
2059
2060         * storage/StorageAreaSync.cpp:
2061         (WebCore::StorageAreaSync::openDatabase): Added iOS-specific code.
2062         (WebCore::StorageAreaSync::sync): Ditto.
2063         * storage/StorageTracker.cpp:
2064         (WebCore::StorageTracker::openTrackerDatabase): Ditto.
2065         (WebCore::StorageTracker::syncImportOriginIdentifiers): Ditto.
2066         (WebCore::StorageTracker::syncFileSystemAndTrackerDatabase): Ditto.
2067         (WebCore::StorageTracker::syncSetOriginDetails): Ditto.
2068         (WebCore::StorageTracker::syncDeleteAllOrigins): Ditto.
2069         (WebCore::StorageTracker::syncDeleteOrigin): Ditto.
2070         (WebCore::StorageTracker::databasePathForOrigin): Ditto.
2071
2072 2013-12-23  Daniel Bates  <dabates@apple.com>
2073
2074         Fix the iOS build following <http://trac.webkit.org/changeset/160236>
2075         (https://bugs.webkit.org/show_bug.cgi?id=125239)
2076
2077         * rendering/RenderBlock.h:
2078         * rendering/RenderBox.cpp:
2079         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned): Substitute view() for &view().
2080         * rendering/RenderLayer.cpp:
2081         (WebCore::RenderLayer::scrollTo): Fix indentation of closing brace.
2082         * rendering/RenderLayerCompositor.cpp: Include MainFrame.h.
2083         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles): Check that page->mainFrame().view()
2084         is non-null; also add explicit #else clause.
2085         (WebCore::RenderLayerCompositor::ensureRootLayer): Fix up main frame check.
2086         * rendering/RenderTheme.h:
2087         (WebCore::RenderTheme::paintFileUploadIconDecorations): Substitute rect for r.
2088         * rendering/RenderThemeIOS.mm:
2089         (WebCore::RenderThemeIOS::paintTextFieldDecorations): Use .get() to access underlying NeverDestroyed item.
2090         (WebCore::RenderThemeIOS::systemFont):
2091         * rendering/RenderView.cpp:
2092         (WebCore::fixedPositionOffset): Substitute frameView.scrollOffset() for frameView->scrollOffset().
2093
2094 2013-12-23  Ryosuke Niwa  <rniwa@webkit.org>
2095
2096         Minor optimization in FrameSelection::setNonDirectionalSelectionIfNeeded()
2097         https://bugs.webkit.org/show_bug.cgi?id=126108
2098
2099         Reviewed by Benjamin Poulain.
2100
2101         Merge https://chromium.googlesource.com/chromium/blink/+/237b987c324e2e389a9e0350293bfaf16a5e201d
2102
2103         * editing/FrameSelection.cpp:
2104         (WebCore::FrameSelection::setNonDirectionalSelectionIfNeeded):
2105
2106 2013-12-23  Ryosuke Niwa  <rniwa@webkit.org>
2107
2108         Use isDocumentFragment() instead of comparing nodeType() with Node::DOCUMENT_FRAGMENT_NODE
2109         https://bugs.webkit.org/show_bug.cgi?id=126178
2110
2111         Reviewed by Antti Koivisto.
2112
2113         Inspired by https://chromium.googlesource.com/chromium/blink/+/a622cb80af2bfb0c5d91123cbcfa4fa72a06554c
2114
2115         Use inline Node::isDocumentFragment() instead of virtual nodeType().
2116
2117         * dom/ContainerNode.cpp:
2118         (WebCore::collectChildrenAndRemoveFromOldParent):
2119         * dom/Document.cpp:
2120         (WebCore::Document::canReplaceChild):
2121
2122 2013-12-23  Gwang Yoon Hwang  <ryumiel@company100.net>
2123
2124         Clear ScratchBuffer::m_lastLayerSize when clearing the scratch buffer.
2125         https://bugs.webkit.org/show_bug.cgi?id=126150
2126
2127         Reviewed by Simon Fraser.
2128
2129         Since ScratchBuffer::clearScratchBuffer only clears m_lastRadius,
2130         ShadowBlur doesn't draw shadow into the re-created scratch buffer if it
2131         tries to draw shadow without blurRadius.
2132
2133         Clear m_lastLayerSize to empty is enought to ensure that there is no
2134         drawn contents in the scratch buffer.
2135
2136         No new tests due to the flaky nature of reproducing the issue.
2137
2138         * platform/graphics/ShadowBlur.cpp:
2139         (WebCore::ScratchBuffer::clearScratchBuffer):
2140
2141 2013-12-23  Benjamin Poulain  <benjamin@webkit.org>
2142
2143         Add id matching to the Selector Code Generator
2144         https://bugs.webkit.org/show_bug.cgi?id=126154
2145
2146         Reviewed by Antti Koivisto.
2147
2148         Compile matching for #id selectors. IDs are Atomic String so it is just a matter
2149         of comparing the pointers.
2150
2151         No attempt is made at optimizing for the double #id case because such problem
2152         do not really happen outside tests.
2153
2154         * cssjit/SelectorCompiler.cpp:
2155         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
2156         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2157         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2158         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2159         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementDataMatching):
2160         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasId):
2161         * dom/Element.h:
2162         (WebCore::Element::elementDataMemoryOffset):
2163         * dom/ElementData.h:
2164         (WebCore::ElementData::idForStyleResolutionMemoryOffset):
2165
2166 2013-12-23  Oliver Hunt  <oliver@apple.com>
2167
2168         Update custom setter implementations to perform type checks
2169         https://bugs.webkit.org/show_bug.cgi?id=126171
2170
2171         Reviewed by Daniel Bates.
2172
2173         Update the bindings code generator for setters so that they perform a real
2174         type check.
2175
2176         * bindings/scripts/CodeGeneratorJS.pm:
2177         (GenerateAttributeEventListenerCall):
2178         (GenerateHeader):
2179         (GenerateImplementation):
2180         * bindings/scripts/test/JS/JSTestInterface.cpp:
2181         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
2182         (WebCore::setJSTestInterfaceImplementsStr2):
2183         (WebCore::setJSTestInterfaceImplementsStr3):
2184         (WebCore::setJSTestInterfaceImplementsNode):
2185         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
2186         (WebCore::setJSTestInterfaceSupplementalStr2):
2187         (WebCore::setJSTestInterfaceSupplementalStr3):
2188         (WebCore::setJSTestInterfaceSupplementalNode):
2189         * bindings/scripts/test/JS/JSTestInterface.h:
2190         * bindings/scripts/test/JS/JSTestObj.cpp:
2191         (WebCore::setJSTestObjConstructorStaticStringAttr):
2192         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
2193         (WebCore::setJSTestObjEnumAttr):
2194         (WebCore::setJSTestObjByteAttr):
2195         (WebCore::setJSTestObjOctetAttr):
2196         (WebCore::setJSTestObjShortAttr):
2197         (WebCore::setJSTestObjUnsignedShortAttr):
2198         (WebCore::setJSTestObjLongAttr):
2199         (WebCore::setJSTestObjLongLongAttr):
2200         (WebCore::setJSTestObjUnsignedLongLongAttr):
2201         (WebCore::setJSTestObjStringAttr):
2202         (WebCore::setJSTestObjTestObjAttr):
2203         (WebCore::setJSTestObjXMLObjAttr):
2204         (WebCore::setJSTestObjCreate):
2205         (WebCore::setJSTestObjReflectedStringAttr):
2206         (WebCore::setJSTestObjReflectedIntegralAttr):
2207         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
2208         (WebCore::setJSTestObjReflectedBooleanAttr):
2209         (WebCore::setJSTestObjReflectedURLAttr):
2210         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
2211         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
2212         (WebCore::setJSTestObjReflectedCustomURLAttr):
2213         (WebCore::setJSTestObjTypedArrayAttr):
2214         (WebCore::setJSTestObjAttrWithGetterException):
2215         (WebCore::setJSTestObjAttrWithSetterException):
2216         (WebCore::setJSTestObjStringAttrWithGetterException):
2217         (WebCore::setJSTestObjStringAttrWithSetterException):
2218         (WebCore::setJSTestObjCustomAttr):
2219         (WebCore::setJSTestObjWithScriptStateAttribute):
2220         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2221         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
2222         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2223         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2224         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2225         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2226         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
2227         (WebCore::setJSTestObjConditionalAttr1):
2228         (WebCore::setJSTestObjConditionalAttr2):
2229         (WebCore::setJSTestObjConditionalAttr3):
2230         (WebCore::setJSTestObjConditionalAttr4Constructor):
2231         (WebCore::setJSTestObjConditionalAttr5Constructor):
2232         (WebCore::setJSTestObjConditionalAttr6Constructor):
2233         (WebCore::setJSTestObjAnyAttribute):
2234         (WebCore::setJSTestObjMutablePoint):
2235         (WebCore::setJSTestObjImmutablePoint):
2236         (WebCore::setJSTestObjStrawberry):
2237         (WebCore::setJSTestObjStrictFloat):
2238         (WebCore::setJSTestObjId):
2239         (WebCore::setJSTestObjReplaceableAttribute):
2240         (WebCore::setJSTestObjNullableLongSettableAttribute):
2241         (WebCore::setJSTestObjNullableStringValue):
2242         (WebCore::setJSTestObjAttributeWithReservedEnumType):
2243         * bindings/scripts/test/JS/JSTestObj.h:
2244         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2245         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
2246         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
2247         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2248         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2249         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
2250         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
2251         (WebCore::setJSTestTypedefsAttrWithGetterException):
2252         (WebCore::setJSTestTypedefsAttrWithSetterException):
2253         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
2254         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
2255         * bindings/scripts/test/JS/JSTestTypedefs.h:
2256
2257 2013-12-23  Lucas Forschler  <lforschler@apple.com>
2258
2259         <rdar://problem/15682948> Update copyright strings
2260
2261         Reviewed by Dan Bernstein
2262
2263         * Info.plist:
2264
2265 2013-12-23  Commit Queue  <commit-queue@webkit.org>
2266
2267         Unreviewed, rolling out r160945.
2268         http://trac.webkit.org/changeset/160945
2269         https://bugs.webkit.org/show_bug.cgi?id=126164
2270
2271         Seems to have broken multiple canvas tests (Requested by ap on
2272         #webkit).
2273
2274         * WebCore.xcodeproj/project.pbxproj:
2275         * platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Removed.
2276         * platform/graphics/cg/ImageBufferBackingStoreCache.h: Removed.
2277         * platform/graphics/cg/ImageBufferCG.cpp:
2278         (WebCore::createIOSurface):
2279         (WebCore::ImageBuffer::ImageBuffer):
2280         (WebCore::ImageBuffer::~ImageBuffer):
2281
2282 2013-12-23  Eric Carlson  <eric.carlson@apple.com>
2283
2284         AudioSessionManager should be MediaSessionManager
2285         https://bugs.webkit.org/show_bug.cgi?id=126087
2286
2287         Reviewed by Jer Noble.
2288
2289         No new tests, no change in functionality.
2290
2291         * WebCore.xcodeproj/project.pbxproj: Change file names.
2292
2293         * html/HTMLMediaElement.cpp:
2294         (WebCore::HTMLMediaElement::HTMLMediaElement): MediaSessionManagerToken::create() takes a client
2295             interface instead of the media type.
2296         * html/HTMLMediaElement.h:
2297
2298         * platform/audio/AudioSessionListener.h: Include <wtf/Noncopyable.h>.
2299         
2300         AudioSessionManager.* -> MediaSessionManager.*
2301         * platform/audio/AudioSessionManager.cpp: Removed.
2302         * platform/audio/AudioSessionManager.h: Removed.
2303         * platform/audio/MediaSessionManager.cpp: Copied from Source/WebCore/platform/audio/AudioSessionManager.cpp.
2304         (MediaSessionManagerToken::create):
2305         (MediaSessionManagerToken::MediaSessionManagerToken):
2306         (MediaSessionManagerToken::~MediaSessionManagerToken):
2307         (MediaSessionManager::sharedManager):
2308         (MediaSessionManager::MediaSessionManager):
2309         (MediaSessionManager::has):
2310         (MediaSessionManager::count):
2311         (MediaSessionManager::addToken):
2312         (MediaSessionManager::removeToken):
2313         (MediaSessionManager::updateSessionState):
2314         * platform/audio/MediaSessionManager.h: Copied from Source/WebCore/platform/audio/AudioSessionManager.h.
2315
2316         * platform/audio/mac/AudioDestinationMac.cpp:
2317         (WebCore::AudioDestinationMac::AudioDestinationMac): MediaSessionManagerToken::create() takes a
2318             client interface instead of the media type.
2319         * platform/audio/mac/AudioDestinationMac.h:
2320
2321         * platform/audio/mac/AudioSessionMac.cpp:
2322         * platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
2323         * platform/audio/mac/MediaSessionManagerMac.cpp: Copied from Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp.
2324         (MediaSessionManager::updateSessionState):
2325
2326 2013-12-23  Zan Dobersek  <zdobersek@igalia.com>
2327
2328         webkit gtk 2.2.3 stable tarball compilation error
2329         https://bugs.webkit.org/show_bug.cgi?id=125987
2330
2331         Reviewed by Gustavo Noronha Silva.
2332
2333         Only try including <gdk/gdkwayland.h> and using GDK_IS_WAYLAND_DISPLAY if the Wayland support has been
2334         enabled and when not compiling with GTK+ 2 (which occurs when building for libPlatformGtk2).
2335
2336         * platform/graphics/GLContext.cpp:
2337         (WebCore::GLContext::createContextForWindow):
2338
2339 2013-12-23  Piotr Grad  <p.grad@samsung.com>
2340
2341         [GStreamer] video/audio seeking is not unified.
2342         https://bugs.webkit.org/show_bug.cgi?id=125852
2343
2344         Reviewed by Philippe Normand.
2345
2346         This bug is fixing regression with seeking audio/video elements and unifies seeking
2347         in MediaPlayerPrivateGStreamer.
2348
2349         Test: media/video-seek-with-negative-playback.html
2350
2351         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2352         (WebCore::MediaPlayerPrivateGStreamer::seek):
2353         (WebCore::MediaPlayerPrivateGStreamer::seekIncludingRate):
2354         (WebCore::MediaPlayerPrivateGStreamer::setRate):
2355         (WebCore::MediaPlayerPrivateGStreamer::updateStates):
2356         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2357
2358 2013-12-23  ChangSeok Oh  <changseok.oh@collabora.com>
2359
2360         [GTK][WK2] WebGL is not working with GLES
2361         https://bugs.webkit.org/show_bug.cgi?id=126138
2362
2363         Reviewed by Martin Robinson.
2364
2365         m_texture has been unnecessarily regenerated. It's generated in GraphicsContext3D
2366         constructor for offscreen rendering. And m_compositorTexture is used by only Mac port.
2367         They create it in their GraphicsContext3D constructor so that we don't need to recreate it
2368         in GC3DOpenGLES::reshapeFBOs.
2369
2370         No new tests since no functionality changed.
2371
2372         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
2373         (WebCore::GraphicsContext3D::~GraphicsContext3D):
2374         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2375         (WebCore::GraphicsContext3D::reshapeFBOs):
2376         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2377         (WebCore::GraphicsContext3D::reshapeFBOs):
2378
2379 2013-12-22  Benjamin Poulain  <bpoulain@apple.com>
2380
2381         Create a skeleton for CSS Selector code generation
2382         https://bugs.webkit.org/show_bug.cgi?id=126044
2383
2384         Reviewed by Antti Koivisto and Gavin Barraclough.
2385
2386         Add CSSCompiler, which provides the basic infrastructure to compile
2387         CSS Selectors on x86_64.
2388
2389         Compilation happens in two phases.
2390         1) The various matching and relation of each CSSSelector is aggregated into units
2391            matching a single element: SelectorFragment.
2392            SelectorFragment also knows about the relations between different fragments,
2393            and contains all the information to generate the code for a particular element.
2394         2) The compiler then goes over the fragments, and generate code based on the information
2395            of each fragment.
2396
2397         It the current state, SelectorCompiler only compiles the tag matching selectors and
2398         any of the relation between selectors.
2399
2400         Depending on the relation and position of a fragment, failure on traversal or matching
2401         does not necessarily causes the complete selector. A failure can cause matching to
2402         resume from the parent or the sibling of a previously visisted node.
2403         The implementation of this is done through the BacktrackingAction. In case of failure,
2404         the next starting state is setup and the program counter jumps back to the appropriate
2405         starting point.
2406
2407         When backtracking, the method used to save the starting point depends on the type
2408         of backtracking.
2409         The child/parent relation (">") is very common so it uses an additional register to keep
2410         the next starting point (m_descendantBacktrackingStart).
2411         The indirect sibling relation ("~") is much less common and uses the stack to save
2412         the next starting point.
2413
2414         * WebCore.xcodeproj/project.pbxproj:
2415         * cssjit/SelectorCompiler.cpp: Added.
2416         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
2417         (WebCore::SelectorCompiler::compileSelector):
2418         (WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
2419         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2420         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2421         (WebCore::SelectorCompiler::updateChainStates):
2422         (WebCore::SelectorCompiler::isFirstAncestor):
2423         (WebCore::SelectorCompiler::isFirstAdjacent):
2424         (WebCore::SelectorCompiler::isAfterChildRelation):
2425         (WebCore::SelectorCompiler::solveBacktrackingAction):
2426         (WebCore::SelectorCompiler::requiresAdjacentTail):
2427         (WebCore::SelectorCompiler::requiresDescendantTail):
2428         (WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
2429         (WebCore::SelectorCompiler::testIsElementFlagOnNode):
2430         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement):
2431         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
2432         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAncestorTreeWalker):
2433         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacent):
2434         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
2435         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
2436         (WebCore::SelectorCompiler::SelectorCodeGenerator::markParentElementIfResolvingStyle):
2437         (WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
2438         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
2439         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
2440         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateBacktrackingTailsIfNeeded):
2441         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2442         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
2443         * cssjit/SelectorCompiler.h: Added.
2444         (WebCore::SelectorCompilationStatus::SelectorCompilationStatus):
2445         (WebCore::SelectorCompilationStatus::operator Status):
2446         (WebCore::SelectorCompiler::simpleSelectorCheckerFunction):
2447         (WebCore::SelectorCompiler::selectorCheckerFunctionWithCheckingContext):
2448         * dom/Element.cpp:
2449         (WebCore::Element::setChildrenAffectedByDirectAdjacentRules):
2450         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
2451         * dom/Element.h:
2452         (WebCore::Element::tagQNameMemoryOffset):
2453         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
2454         * dom/Node.h:
2455         (WebCore::Node::parentNodeMemoryOffset):
2456         (WebCore::Node::previousSiblingMemoryOffset):
2457         (WebCore::Node::nodeFlagsMemoryOffset):
2458         (WebCore::Node::flagIsElement):
2459         * dom/QualifiedName.h:
2460         (WebCore::QualifiedName::QualifiedNameImpl::localNameMemoryOffset):
2461         (WebCore::QualifiedName::QualifiedNameImpl::namespaceMemoryOffset):
2462         (WebCore::QualifiedName::implMemoryOffset):
2463
2464 2013-12-22  Mihnea Ovidenie  <mihnea@adobe.com>
2465
2466         [CSSRegions] Crash when trying to select content from invalid region
2467         https://bugs.webkit.org/show_bug.cgi?id=126113
2468
2469         Reviewed by Antti Koivisto.
2470
2471         After fix for https://bugs.webkit.org/show_bug.cgi?id=120769, positionForPoint for a region attempts to use the associated named flow to perform its task.
2472         However, this should happen only when the region is valid. If the region is invalid, part of a dependency cycle, positionForPoint should behave as usual
2473         for a block instead of a region, otherwise it may run into an infinite loop due to cyclic dependencies and a crash will occur.
2474
2475         This patch ensures that positionForPoint region specifie behaviour is followed only if the region is valid - not part of a dependency cycle.
2476
2477         Test: fast/regions/selection/invalid-region-selection-crash.html
2478
2479         * rendering/RenderRegion.cpp:
2480         (WebCore::RenderRegion::positionForPoint):
2481
2482 2013-12-21  Dirk Schulze  <krit@webkit.org>
2483
2484         Start refactoring Filter code to reuse CachedSVGDocument for clipPath
2485         https://bugs.webkit.org/show_bug.cgi?id=126069
2486
2487         Reviewed by Andreas Kling.
2488
2489         Smaller refactoring of the CSS filter style resolver code. Previously the code
2490         requested the FilterOperations list from RenderStyle and compared the content
2491         in this list with an internal map. Then the resource loading was triggered.
2492         With the refactoring we do not request the list from RenderStyle anymore but
2493         rely on the hash map data entirely.
2494
2495         * css/StyleResolver.cpp:
2496         (WebCore::StyleResolver::loadPendingSVGDocuments):
2497         * platform/graphics/filters/FilterOperation.h:
2498
2499 2013-12-20  Andy Estes  <aestes@apple.com>
2500
2501         [Mac] Soft-link WebContentAnalysis.framework
2502         https://bugs.webkit.org/show_bug.cgi?id=126102
2503
2504         Reviewed by Dan Bernstein.
2505
2506         * Configurations/WebCore.xcconfig: There's no need to modify LDFLAGS
2507         now that we don't hard link against WebContentAnalysis.framework.
2508         * WebCore.xcodeproj/project.pbxproj: Removed
2509         WebContentAnalysis.framework from the 'Link Binary with Libraries'
2510         build phase.
2511         * platform/mac/ContentFilterMac.mm: Soft-linked
2512         WebContentAnalysis.framework and the WebFilterEvaluator @class.
2513         (WebCore::ContentFilter::ContentFilter): Called getWebFilterEvaluatorClass().
2514         (WebCore::ContentFilter::isEnabled): Ditto.
2515         * platform/mac/SoftLinking.h: Added an implementation of
2516         SOFT_LINK_PRIVATE_FRAMEWORK().
2517
2518 2013-12-21  Antti Koivisto  <antti@apple.com>
2519
2520         Unreviewed, rolling out r160916.
2521         http://trac.webkit.org/changeset/160916
2522         https://bugs.webkit.org/show_bug.cgi?id=126073
2523
2524         Roll out a temporary fix. The underlying issue was fixed.
2525
2526         * accessibility/AccessibilityRenderObject.cpp:
2527         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
2528         (WebCore::AccessibilityRenderObject::~AccessibilityRenderObject):
2529         (WebCore::AccessibilityRenderObject::detach):
2530         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2531         * accessibility/AccessibilityRenderObject.h:
2532
2533 2013-12-21  Antti Koivisto  <antti@apple.com>
2534
2535         Figure out if node is focusable without requiring renderer
2536         https://bugs.webkit.org/show_bug.cgi?id=126118
2537
2538         Reviewed by Andreas Kling.
2539
2540         * dom/Element.cpp:
2541         (WebCore::Element::computedStyle):
2542         
2543             Use inDocument() test instead of the attached() test. We can compute style for anything that
2544             is in document.
2545
2546         * dom/Node.cpp:
2547         (WebCore::Node::isContentEditable):
2548         (WebCore::Node::isContentRichlyEditable):
2549         (WebCore::Node::hasEditableStyle):
2550         
2551             Use computedStyle instead of getting the style from renderer. Computed style gets constructed
2552             on demand if renderer does not exist. If it does then the existing style is used.
2553
2554         (WebCore::Node::isEditableToAccessibility):
2555         (WebCore::Node::canStartSelection):
2556         (WebCore::Node::isRootEditableElement):
2557         (WebCore::Node::rootEditableElement):
2558         * dom/Node.h:
2559         (WebCore::Node::hasEditableStyle):
2560         (WebCore::Node::hasRichlyEditableStyle):
2561         
2562             Renamed from rendererIsEditable since these no longer require renderer.
2563
2564         (WebCore::HTMLElement::supportsFocus):
2565         
2566             Stop calling updateStyleIfNeeded() and forcing render tree construction.
2567
2568 2013-12-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2569
2570         [SOUP] ResourceHandleSoup should use async client callbacks when client uses async callbacks
2571         https://bugs.webkit.org/show_bug.cgi?id=126006
2572
2573         Reviewed by Martin Robinson.
2574
2575         This fixes WebKit2 loader client unit tests when using the network
2576         process.
2577
2578         * platform/network/ResourceHandle.cpp:
2579         * platform/network/soup/ResourceHandleSoup.cpp:
2580         (WebCore::doRedirect): Call willSendRequestAsync on the client
2581         when usesAsyncCallbacks returns true.
2582         (WebCore::nextMultipartResponsePartCallback): Call
2583         didReceiveResponseAsync on the client when usesAsyncCallbacks
2584         returns true.
2585         (WebCore::sendRequestCallback): Ditto.
2586         (WebCore::ResourceHandle::continueWillSendRequest): Empty
2587         implementation for now because the default one asserts.
2588         (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto.
2589         (WebCore::ResourceHandle::continueShouldUseCredentialStorage): Ditto.
2590
2591 2013-12-20  Anders Carlsson  <andersca@apple.com>
2592
2593         Replace yield() and pauseBriefly() with std::this_thread::yield()
2594         https://bugs.webkit.org/show_bug.cgi?id=126105
2595
2596         Reviewed by Sam Weinig.
2597
2598         * platform/sql/SQLiteDatabase.cpp:
2599         (WebCore::SQLiteDatabase::interrupt):
2600
2601 2013-12-20  Ryosuke Niwa  <rniwa@webkit.org>
2602
2603         Assert that RootInlineBox::setLineBreakInfo should is never called on a RenderInline without line boxes
2604         https://bugs.webkit.org/show_bug.cgi?id=126101
2605
2606         Reviewed by Simon Fraser.
2607
2608         Merge assertions added in https://chromium.googlesource.com/chromium/blink/+/716ac74fd475b581d69c0aa8ec2d806201c3a420
2609
2610         The code change was not merged since we never hit the added assertion on the attached test case in WebKit.
2611
2612         * rendering/RootInlineBox.cpp:
2613         (WebCore::RootInlineBox::setLineBreakInfo):
2614
2615 2013-12-20  Joseph Pecoraro  <pecoraro@apple.com>
2616
2617         Web Inspector: Remove the references to Node in InjectedScript
2618         https://bugs.webkit.org/show_bug.cgi?id=126091
2619
2620         Reviewed by Timothy Hatcher.
2621
2622         Remove the last DOM references from InjectedScript so that
2623         InjectedScript can move down into JavaScriptCore. The only
2624         remaining references were to Nodes, which are all just thin
2625         wrappers around existing functions. Move Node / JSNode (JSValue)
2626         conversion into InspectorDOMAgent, where it was used.
2627
2628         No new tests, no observable change in functionality.
2629
2630         * bindings/js/JSInjectedScriptHostCustom.cpp:
2631         * inspector/InjectedScript.cpp:
2632         (WebCore::InjectedScript::inspectObject):
2633         (WebCore::InjectedScript::releaseObject):
2634         * inspector/InjectedScript.h:
2635         * inspector/InjectedScriptHost.h:
2636         * inspector/InjectedScriptSource.js:
2637         * inspector/InspectorDOMAgent.cpp:
2638         (WebCore::InspectorDOMAgent::focusNode):
2639         (WebCore::InspectorDOMAgent::highlightNode):
2640         (WebCore::InspectorDOMAgent::requestNode):
2641         (WebCore::InspectorDOMAgent::nodeForObjectId):
2642         (WebCore::InspectorDOMAgent::resolveNode):
2643         (WebCore::InspectorDOMAgent::scriptValueAsNode):
2644         (WebCore::InspectorDOMAgent::nodeAsScriptValue):
2645         * inspector/InspectorDOMAgent.h:
2646         * inspector/PageConsoleAgent.cpp:
2647
2648 2013-12-20  Myles C. Maxfield  <mmaxfield@apple.com>
2649
2650         Faster implementation of text-decoration-skip: ink
2651         https://bugs.webkit.org/show_bug.cgi?id=125718
2652
2653         Reviewed by Simon Fraser.
2654
2655         This new implementation of text-decoration-skip: ink extracts
2656         each glyph into a path, then decomposes each path into a series
2657         of contours. It then intersects each contour with the top and
2658         bottom of the underline (by approximating the contour with a line).
2659         It then draws underlines in between these intersection regions.
2660
2661         Tests for text-decoration-skip: ink already exist in
2662         fast/css3-text/css3-text-decoration/text-decoration-skip
2663
2664         * platform/graphics/Font.h: Signature of new function
2665         * platform/graphics/mac/FontMac.mm:
2666         (WebCore::GlyphIterationState::GlyphIterationState): Persistent
2667         between calls to findPathIntersections
2668         (WebCore::findIntersectionPoint): Calculates an intersection point
2669         between two lines
2670         (WebCore::findPathIntersections): Called by CGPathApply to find
2671         intersections of each contour
2672         (WebCore::Font::intersectionPoints): Function to get the places
2673         where an underline would intersect a TextRun.
2674         * rendering/InlineTextBox.cpp:
2675         (WebCore::compareTuples): Used for sorting intersection ranges
2676         (WebCore::translateIntersectionPointsToSkipInkBoundaries): Converts
2677         a sequence of intersection points to the locations where
2678         text-decoration-skip: ink should draw underlines
2679         (WebCore::drawSkipInkUnderline): Draws a sequence of short underlines
2680         (WebCore::InlineTextBox::paintDecoration):
2681         * rendering/TextPainter.cpp:
2682         (WebCore::TextPainter::intersectionPoints): Calls Font::intersectionPoints
2683         * rendering/TextPainter.h:
2684
2685 2013-12-20  Joseph Pecoraro  <pecoraro@apple.com>
2686
2687         Web Inspector: Give the CommandLineAPIModule its own Host object, making InjectedScriptHost viable for a JS Context
2688         https://bugs.webkit.org/show_bug.cgi?id=126082
2689
2690         Reviewed by Timothy Hatcher.
2691
2692         Extract CommandLineAPIHost from InjectedScriptHost. The command line API contained
2693         a bunch of DOM specific JavaScript that would not be suitable for a pure JavaScript
2694         environment. Now that the DOM related code is in this WebCore only module, give this
2695         module a host object that WebCore will provide.
2696
2697         No new tests, no observable change in functionality.
2698
2699         * CMakeLists.txt:
2700         * DerivedSources.cpp:
2701         * DerivedSources.make:
2702         * GNUmakefile.list.am:
2703         * UseJSC.cmake:
2704         * WebCore.vcxproj/WebCore.vcxproj:
2705         * WebCore.vcxproj/WebCore.vcxproj.filters:
2706         * WebCore.xcodeproj/project.pbxproj:
2707         * bindings/js/JSBindingsAllInOne.cpp:
2708         Add new files.
2709
2710         * bindings/js/JSCommandLineAPIHostCustom.cpp: Added.
2711         (WebCore::JSCommandLineAPIHost::inspectedObject):
2712         (WebCore::getJSListenerFunctions):
2713         (WebCore::JSCommandLineAPIHost::getEventListeners):
2714         (WebCore::JSCommandLineAPIHost::inspect):
2715         (WebCore::JSCommandLineAPIHost::databaseId):
2716         (WebCore::JSCommandLineAPIHost::storageId):
2717         * bindings/js/JSInjectedScriptHostCustom.cpp:
2718         * inspector/CommandLineAPIHost.cpp: Copied from Source/WebCore/inspector/InjectedScriptHost.cpp.
2719         (WebCore::CommandLineAPIHost::create):
2720         (WebCore::CommandLineAPIHost::CommandLineAPIHost):
2721         (WebCore::CommandLineAPIHost::~CommandLineAPIHost):
2722         (WebCore::CommandLineAPIHost::disconnect):
2723         (WebCore::CommandLineAPIHost::inspectImpl):
2724         (WebCore::CommandLineAPIHost::getEventListenersImpl):
2725         (WebCore::CommandLineAPIHost::clearConsoleMessages):
2726         (WebCore::CommandLineAPIHost::copyText):
2727         (WebCore::CommandLineAPIHost::InspectableObject::get):
2728         (WebCore::CommandLineAPIHost::addInspectedObject):
2729         (WebCore::CommandLineAPIHost::clearInspectedObjects):
2730         (WebCore::CommandLineAPIHost::inspectedObject):
2731         (WebCore::CommandLineAPIHost::databaseIdImpl):
2732         (WebCore::CommandLineAPIHost::storageIdImpl):
2733         * inspector/CommandLineAPIHost.h: Copied from Source/WebCore/inspector/InjectedScriptHost.h.
2734         (WebCore::CommandLineAPIHost::init):
2735         * inspector/CommandLineAPIHost.idl: Copied from Source/WebCore/inspector/InjectedScriptHost.idl.
2736         * inspector/CommandLineAPIModule.cpp:
2737         These are almost all pure copies from InjectedScriptHost files. Cleaned up a bit.
2738
2739         * inspector/InjectedScriptModule.h:
2740         * inspector/InjectedScriptModule.cpp:
2741         (WebCore::InjectedScriptModule::ensureInjected):
2742         Modules can now define a host object when they are getting injected.
2743
2744         (WebCore::CommandLineAPIModule::host):
2745         * inspector/CommandLineAPIModule.h:
2746         Provide a CommandLineAPIHost, host object.
2747
2748         * inspector/InjectedScriptCanvasModule.h:
2749         * inspector/InjectedScriptCanvasModule.cpp:
2750         (WebCore::InjectedScriptCanvasModule::host):
2751         No host object is needed for the CanvasModule.
2752
2753         * inspector/InjectedScriptSource.js:
2754         * inspector/CommandLineAPIModuleSource.js:
2755         When injecting a module, pass on an optional host object to
2756         the module's source. Move a little more code between the
2757         two files. The two files are very tightly coupled right now.
2758
2759         * inspector/InjectedScriptHost.cpp:
2760         (WebCore::InjectedScriptHost::create):
2761         * inspector/InjectedScriptHost.h:
2762         (WebCore::InjectedScriptHost::~InjectedScriptHost):
2763         (WebCore::InjectedScriptHost::InjectedScriptHost):
2764         * inspector/InjectedScriptHost.idl:
2765         Move any command line specific logic to CommandLineAPIHost classes.
2766
2767         * inspector/InjectedScriptManager.cpp:
2768         (WebCore::InjectedScriptManager::disconnect):
2769         * inspector/InjectedScriptManager.h:
2770         (WebCore::InjectedScriptManager::commandLineAPIHost):
2771         * inspector/InspectorConsoleAgent.cpp:
2772         (WebCore::InspectorConsoleAgent::addInspectedHeapObject):
2773         * inspector/InspectorController.cpp:
2774         (WebCore::InspectorController::InspectorController):
2775         * inspector/InspectorHeapProfilerAgent.cpp:
2776         (WebCore::InspectorHeapProfilerAgent::resetState):
2777         * inspector/InspectorProfilerAgent.cpp:
2778         (WebCore::InspectorProfilerAgent::resetState):
2779         * inspector/PageConsoleAgent.cpp:
2780         (WebCore::PageConsoleAgent::addInspectedNode):
2781         * inspector/PageInjectedScriptManager.cpp:
2782         (WebCore::PageInjectedScriptManager::PageInjectedScriptManager):
2783         (WebCore::PageInjectedScriptManager::disconnect):
2784         * inspector/PageInjectedScriptManager.h:
2785         * inspector/WorkerInspectorController.cpp:
2786         (WebCore::WorkerInspectorController::WorkerInspectorController):
2787         An InjectedScriptManager may optionally have a commandLineAPIHost object.
2788         If it does, initialize it, and send it messages.
2789
2790 2013-12-09  Myles C. Maxfield  <mmaxfield@apple.com>
2791
2792         Allow ImageBuffer to re-use IOSurfaces
2793         https://bugs.webkit.org/show_bug.cgi?id=125477
2794
2795         Reviewed by Geoff Garen.
2796
2797         This test adds a static class, ImageBufferBackingStoreCache, that vends
2798         IOSurfaces. It remembers IOSurfaces that have been returned to it until
2799         a configurable timeout.
2800
2801         The storage used by this class is in the form of a HashMap from a
2802         bucketed size to the IOSurface. There are many other data structures
2803         that could be used, but this implementation gives a 80% hit rate on
2804         normal browsing of some example sites with Canvas and
2805         text-decoration-skip: ink. Because the buckets are fairly
2806         small (rounding the width and height up to multiples of 8), traversing the
2807         bucket contents takes on average 2 steps. 
2808
2809         Test: fast/canvas/canvas-backing-store-reuse.html
2810
2811         * WebCore.xcodeproj/project.pbxproj: Added new caching class
2812         * platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Added.
2813         (WebCore::createIOSurface): Moved from ImageBufferCG.cpp
2814         (WebCore::ImageBufferBackingStoreCache::timerFired): Forget the cache
2815         contents
2816         (WebCore::ImageBufferBackingStoreCache::schedulePurgeTimer):
2817         (WebCore::ImageBufferBackingStoreCache::get): Static getter
2818         (WebCore::ImageBufferBackingStoreCache::ImageBufferBackingStoreCache):
2819         (WebCore::ImageBufferBackingStoreCache::insertIntoCache): Memory-management
2820         creation function
2821         (WebCore::ImageBufferBackingStoreCache::takeFromCache): Memory-management
2822         deletion function
2823         (WebCore::ImageBufferBackingStoreCache::isAcceptableSurface): Does this cached
2824         IOSurface fit the bill?
2825         (WebCore::ImageBufferBackingStoreCache::tryTakeFromCache): Lookup
2826         a bucket and walk through its contents
2827         (WebCore::ImageBufferBackingStoreCache::getOrAllocate): Public function
2828         for clients who want a IOSurface from the cache
2829         (WebCore::ImageBufferBackingStoreCache::deallocate): Public
2830         function for clients to return an IOSurface to the pool
2831         * platform/graphics/cg/ImageBufferBackingStoreCache.h: Added.
2832         * platform/graphics/cg/ImageBufferCG.cpp: Update to use new cache
2833         (WebCore::ImageBuffer::ImageBuffer):
2834         (WebCore::ImageBuffer::~ImageBuffer):
2835
2836 2013-12-20  Simon Fraser  <simon.fraser@apple.com>
2837
2838         Change "threaded scrolling" terminology to "asynchronous scrolling"
2839         https://bugs.webkit.org/show_bug.cgi?id=126094
2840
2841         Reviewed by Tim Horton.
2842
2843         Rename ENABLE_THREADED_SCROLLING to ENABLE_ASYNC_SCROLLING, and change
2844         references to "main thread scrolling" to "synchronous scrolling".
2845         
2846         In a few places, functions with names like shouldUpdateScrollLayerPositionOnMainThread()
2847         were actually returning SynchronousScrollingReasons, so rename them appropriately.
2848
2849         * WebCore.exp.in:
2850         * page/FrameView.cpp:
2851         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling):
2852         (WebCore::FrameView::isRubberBandInProgress):
2853         (WebCore::FrameView::requestScrollPositionUpdate):
2854         (WebCore::FrameView::updatesScrollLayerPositionOnMainThread):
2855         (WebCore::FrameView::wheelEvent):
2856         * page/Page.cpp:
2857         (WebCore::Page::synchronousScrollingReasonsAsText):
2858         * page/Page.h:
2859         * page/scrolling/ScrollingCoordinator.cpp:
2860         (WebCore::ScrollingCoordinator::create):
2861         (WebCore::ScrollingCoordinator::ScrollingCoordinator):
2862         (WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange):
2863         (WebCore::ScrollingCoordinator::frameViewFixedObjectsDidChange):
2864         (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2865         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
2866         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
2867         (WebCore::ScrollingCoordinator::setForceSynchronousScrollLayerPositionUpdates):
2868         (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
2869         * page/scrolling/ScrollingCoordinator.h:
2870         (WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously):
2871         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
2872         * page/scrolling/ScrollingStateFixedNode.cpp:
2873         * page/scrolling/ScrollingStateFixedNode.h:
2874         * page/scrolling/ScrollingStateNode.cpp:
2875         * page/scrolling/ScrollingStateNode.h:
2876         * page/scrolling/ScrollingStateScrollingNode.cpp:
2877         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
2878         (WebCore::ScrollingStateScrollingNode::setSynchronousScrollingReasons):
2879         (WebCore::ScrollingStateScrollingNode::dumpProperties):
2880         * page/scrolling/ScrollingStateScrollingNode.h: Awkward "ReasonsForSynchronousScrolling" to avoid
2881         conflict with the enum called SynchronousScrollingReasons.
2882         * page/scrolling/ScrollingStateStickyNode.cpp:
2883         * page/scrolling/ScrollingStateStickyNode.h:
2884         * page/scrolling/ScrollingStateTree.cpp:
2885         * page/scrolling/ScrollingStateTree.h:
2886         * page/scrolling/ScrollingThread.cpp:
2887         * page/scrolling/ScrollingThread.h:
2888         * page/scrolling/ScrollingTree.cpp:
2889         * page/scrolling/ScrollingTree.h:
2890         * page/scrolling/ScrollingTreeNode.cpp:
2891         * page/scrolling/ScrollingTreeNode.h:
2892         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2893         (WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
2894         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
2895         * page/scrolling/ScrollingTreeScrollingNode.h:
2896         (WebCore::ScrollingTreeScrollingNode::synchronousScrollingReasons):
2897         (WebCore::ScrollingTreeScrollingNode::shouldUpdateScrollLayerPositionSynchronously):
2898         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2899         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2900         (WebCore::ScrollingCoordinatorMac::setSynchronousScrollingReasons):
2901         (WebCore::ScrollingCoordinatorMac::commitTreeState):
2902         * page/scrolling/mac/ScrollingStateNodeMac.mm:
2903         * page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
2904         * page/scrolling/mac/ScrollingThreadMac.mm:
2905         * page/scrolling/mac/ScrollingTreeFixedNode.h:
2906         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2907         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
2908         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
2909         (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
2910         (WebCore::ScrollingTreeScrollingNodeMac::scrollPosition):
2911         (WebCore::ScrollingTreeScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2912         (WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
2913         (WebCore::logThreadedScrollingMode):
2914         * page/scrolling/mac/ScrollingTreeStickyNode.h:
2915         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2916         * platform/Scrollbar.cpp:
2917         (WebCore::Scrollbar::supportsUpdateOnSecondaryThread):
2918         * platform/graphics/TiledBacking.h:
2919         * platform/graphics/ca/mac/TileController.mm:
2920         (WebCore::TileController::TileController):
2921         (WebCore::TileController::updateTileCoverageMap):
2922         * platform/mac/MemoryPressureHandlerMac.mm:
2923         (WebCore::MemoryPressureHandler::releaseMemory):
2924         * rendering/RenderLayer.cpp:
2925         (WebCore::RenderLayer::setupFontSubpixelQuantization):
2926         * rendering/RenderLayerBacking.cpp:
2927         (WebCore::computeTileCoverage):
2928         * testing/Internals.cpp:
2929         (WebCore::Internals::mainThreadScrollingReasons):
2930         * testing/Internals.idl:
2931
2932 2013-12-20  Tim Horton  <timothy_horton@apple.com>
2933
2934         Revert r160327, r160273, and r160260.
2935
2936         We'll come up with something less aggressive, as this doesn't quite work.
2937
2938         * loader/cache/CachedImage.h:
2939         * loader/cache/CachedResource.h:
2940         * loader/cache/MemoryCache.cpp:
2941         (WebCore::MemoryCache::pruneLiveResourcesToSize):
2942         * platform/graphics/BitmapImage.cpp:
2943         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
2944         * platform/graphics/BitmapImage.h:
2945         * platform/graphics/Image.h:
2946
2947 2013-12-20  Anders Carlsson  <andersca@apple.com>
2948
2949         PostAttachCallbackDisabler should take a Document
2950         https://bugs.webkit.org/show_bug.cgi?id=126090
2951
2952         Reviewed by Andreas Kling.
2953
2954         suspendPostAttachCallbacks and resumePostAttachCallbacks always only get the document from the
2955         container node, so make them static member functions that take a Document&. Also, move PostAttachCallbackDisabler
2956         to Element.h in preparation for moving post attach callback handling to Element.
2957
2958         * dom/ContainerNode.cpp:
2959         (WebCore::ContainerNode::suspendPostAttachCallbacks):
2960         (WebCore::ContainerNode::resumePostAttachCallbacks):
2961         * dom/ContainerNode.h:
2962         * dom/Element.h:
2963         (WebCore::PostAttachCallbackDisabler::PostAttachCallbackDisabler):
2964         (WebCore::PostAttachCallbackDisabler::~PostAttachCallbackDisabler):
2965         * style/StyleResolveTree.cpp:
2966         (WebCore::Style::attachRenderTree):
2967
2968 2013-12-20  Anders Carlsson  <andersca@apple.com>
2969
2970         Move scheduleSetNeedsStyleRecalc to HTMLFrameOwnerElement
2971         https://bugs.webkit.org/show_bug.cgi?id=126083
2972
2973         Reviewed by Antti Koivisto.
2974
2975         scheduleSetNeedsStyleRecalc is only ever called on HTMLFrameOwnerElement, so
2976         move it there, remove the Node implementation and make it non-virtual.
2977
2978         * dom/ContainerNode.cpp:
2979         * dom/ContainerNode.h:
2980         * dom/Node.h:
2981         * html/HTMLFrameOwnerElement.cpp:
2982         (WebCore::needsStyleRecalcCallback):
2983         (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc):
2984         * html/HTMLFrameOwnerElement.h:
2985
2986 2013-12-20  Andy Estes  <aestes@apple.com>
2987
2988         Remove an unneeded include of WebCoreSystemInterface.h.
2989
2990         Rubber-stamped by Dan Bernstein.
2991
2992         * platform/mac/ContentFilterMac.mm:
2993
2994 2013-12-20  Anders Carlsson  <andersca@apple.com>
2995
2996         Node post attach callbacks should use references
2997         https://bugs.webkit.org/show_bug.cgi?id=126081
2998
2999         Reviewed by Antti Koivisto.
3000
3001         * dom/ContainerNode.cpp:
3002         (WebCore::ContainerNode::queuePostAttachCallback):
3003         (WebCore::ContainerNode::dispatchPostAttachCallbacks):
3004         (WebCore::needsStyleRecalcCallback):
3005         (WebCore::ContainerNode::scheduleSetNeedsStyleRecalc):
3006         * dom/ContainerNode.h:
3007         * html/HTMLFormControlElement.cpp:
3008         (WebCore::focusPostAttach):
3009         (WebCore::HTMLFormControlElement::didAttachRenderers):
3010         (WebCore::updateFromElementCallback):
3011         (WebCore::HTMLFormControlElement::didRecalcStyle):
3012         * html/HTMLPlugInImageElement.cpp:
3013         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
3014         (WebCore::HTMLPlugInImageElement::updateWidgetCallback):
3015         (WebCore::HTMLPlugInImageElement::startLoadingImageCallback):
3016         * html/HTMLPlugInImageElement.h:
3017
3018 2013-12-20  Joseph Pecoraro  <pecoraro@apple.com>
3019
3020         Web Inspector: Extract CommandLineAPI into its own InjectedScriptModule
3021         https://bugs.webkit.org/show_bug.cgi?id=126038
3022
3023         Reviewed by Timothy Hatcher.
3024
3025         Only inject the CommandLineAPIModule once, when the InjectedScript
3026         is first created. This avoids running a small snippet of JavaScript
3027         to check if the module is loaded every time we fetch the InjectedScript.
3028
3029         * CMakeLists.txt:
3030         * GNUmakefile.list.am:
3031         * WebCore.vcxproj/WebCore.vcxproj:
3032         * WebCore.vcxproj/WebCore.vcxproj.filters:
3033         * WebCore.xcodeproj/project.pbxproj:
3034         * inspector/InspectorAllInOne.cpp:
3035         Add new files to the build.
3036
3037         * inspector/InjectedScriptManager.h:
3038         * inspector/InjectedScriptManager.cpp:
3039         (WebCore::InjectedScriptManager::createForPage):
3040         (WebCore::InjectedScriptManager::injectedScriptFor):
3041         (WebCore::InjectedScriptManager::didCreateInjectedScript):
3042         Add didCreateInjectedScript hook for a subclass to inject more scripts.
3043
3044         * inspector/PageInjectedScriptManager.h: Added.
3045         * inspector/PageInjectedScriptManager.cpp: Added.
3046         (WebCore::PageInjectedScriptManager::didCreateInjectedScript):
3047         For pages, inject the CommandLineAPIModule.
3048
3049         * inspector/PageRuntimeAgent.cpp:
3050         (WebCore::PageRuntimeAgent::injectedScriptForEval):
3051         This is replaced by PageInjectedScriptManager, we no longer need
3052         to do extra work every time we fetch the injectedScriptForEval.
3053
3054 2013-12-20  Joseph Pecoraro  <pecoraro@apple.com>
3055
3056         Web Inspector: Extract CommandLineAPI into its own InjectedScriptModule
3057         https://bugs.webkit.org/show_bug.cgi?id=126038
3058
3059         Reviewed by Timothy Hatcher.
3060
3061         No tests, no observable change in behavior.
3062
3063         Move the CommandLineAPI source into its own module. Load the module
3064         in InjectedScripts for WebCore::Pages. Not for workers.
3065
3066         Moving CommandLineAPI into it's own module moves it from being inside
3067         the same anonymous function to being evaluated outside the anonymous
3068         function. To connect the two InjectedScript passes itself to the
3069         injected module, and the CommandLineAPI module places its class on the
3070         injectedScript as injectedScript.CommandLineAPI.
3071
3072         This essentially makes the CommandLineAPI module an InjectedScript
3073         extension. InjectedScriptSource checks for the existence of
3074         this.CommandLineAPI to see if the fuller version is available. Otherwise
3075         it falls back to a BasicCommandLineAPI which only exposes "$_",
3076         which is the "last evaluated result". That will be useful for JS Contexts
3077         and Workers.
3078
3079         At the same time, this patch makes InjectedScriptModule more generic,
3080         to support being used in a pure JavaScript environment, meaning one
3081         without "window" as the global object.
3082
3083         * CMakeLists.txt:
3084         * DerivedSources.make:
3085         * GNUmakefile.am:
3086         * GNUmakefile.list.am:
3087         * WebCore.vcxproj/WebCore.vcxproj:
3088         * WebCore.vcxproj/WebCore.vcxproj.filters:
3089         * WebCore.xcodeproj/project.pbxproj:
3090         * inspector/InspectorAllInOne.cpp:
3091         Add files. Minify the CommandLineAPIModuleSource in generation.
3092
3093         * inspector/CommandLineAPIModule.h: Added.
3094         * inspector/CommandLineAPIModule.cpp: Added.
3095         (WebCore::CommandLineAPIModule::CommandLineAPIModule):
3096         (WebCore::CommandLineAPIModule::injectIfNeeded):
3097         (WebCore::CommandLineAPIModule::source):
3098         Inject the module that doesn't return an object, its just evaluated code
3099         extending the original InjectedScript.
3100
3101         * inspector/InjectedScriptModule.h:
3102         * inspector/InjectedScriptModule.cpp:
3103         (WebCore::InjectedScriptModule::ensureInjected):
3104         Only ASSERT the result was an object if the Module claims it returns an object.
3105
3106         * inspector/InjectedScriptCanvasModule.h:
3107         (WebCore::InjectedScriptCanvasModule::returnsObject):
3108         Return an object used later to call into the CanvasModule.
3109
3110         * inspector/PageRuntimeAgent.cpp:
3111         (WebCore::PageRuntimeAgent::injectedScriptForEval):
3112         Ensure the CommandLineAPIModule is loaded in the Page's InjectedScript.
3113
3114         * inspector/CommandLineAPIModuleSource.js: Added.
3115         Create the CommandLineAPI class and place it on injectedScript.
3116
3117         * inspector/InjectedScriptSource.js:
3118         (InjectedScript.prototype._evaluateOn):
3119         Inject either the BasicCommandLineAPI or extended CommandLineAPI.
3120         Derive the globalObject dynamically instead of assuming window.
3121         Inject the commandLineAPI on window.console or the globalObject based on context.
3122         Audit and rename uses of "window" to something like globalObject.
3123
3124 2013-12-20  Tim Horton  <timothy_horton@apple.com>
3125
3126         WebKit2 View Gestures: Implement smartMagnifyWithEvent: and make it work
3127         https://bugs.webkit.org/show_bug.cgi?id=125752
3128         <rdar://problem/15664245>
3129
3130         Reviewed by Anders Carlsson.
3131
3132         * WebCore.exp.in:
3133         Add some exports.
3134
3135 2013-12-20  Antti Koivisto  <antti@apple.com>
3136
3137         http/tests/misc/object-image-error.html asserts
3138         https://bugs.webkit.org/show_bug.cgi?id=126074
3139
3140         Reviewed by Andreas Kling.
3141
3142         * html/HTMLPlugInImageElement.cpp:
3143         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
3144         (WebCore::HTMLPlugInImageElement::updateWidgetCallback):
3145         (WebCore::HTMLPlugInImageElement::startLoadingImage):
3146         (WebCore::HTMLPlugInImageElement::startLoadingImageCallback):
3147         * html/HTMLPlugInImageElement.h:
3148         
3149             Start image load from post-attach so we don't re-enter attach when image load fails synchronously.
3150
3151 2013-12-20  Antti Koivisto  <antti@apple.com>
3152
3153         Crashes in AccessibilityRenderObject::computeAccessibilityIsIgnored()
3154         https://bugs.webkit.org/show_bug.cgi?id=126073
3155
3156         Reviewed by Ryosuke Niwa.
3157
3158         Prevent the crash and try to catch in debug why it is happening.
3159
3160         * accessibility/AccessibilityRenderObject.cpp:
3161         (WebCore::AccessibilityRenderObject::AccessibilityRenderObject):
3162         (WebCore::AccessibilityRenderObject::~AccessibilityRenderObject):
3163         (WebCore::AccessibilityRenderObject::detach):
3164         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
3165         * accessibility/AccessibilityRenderObject.h:
3166
3167 2013-12-20  Antti Koivisto  <antti@apple.com>
3168
3169         Fix asserting accesibility tests.
3170
3171         * html/HTMLElement.cpp:
3172         (WebCore::HTMLElement::supportsFocus): Accessibility code checks focus status during painting.
3173
3174 2013-12-20  Zan Dobersek  <zdobersek@igalia.com>
3175
3176         Unreviewed GTK build fix after r160909.
3177         Remove remaining uses of AttachLazily in code specific to the GTK port.
3178
3179         * html/shadow/MediaControlsGtk.cpp:
3180         (WebCore::MediaControlsGtk::initializeControls):
3181         (WebCore::MediaControlsGtk::createTextTrackDisplay):
3182
3183 2013-12-19  Antti Koivisto  <antti@apple.com>
3184
3185         Create render tree lazily
3186         https://bugs.webkit.org/show_bug.cgi?id=120685
3187
3188         Reviewed by Andreas Kling.
3189
3190         We currently recompute style and construct renderer for each DOM node immediately after they are added to 
3191         the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be
3192         redone. 
3193         
3194         With this patch we always compute style and construct render tree lazily, either on style recalc timer or
3195         synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then
3196         all nodes are conceptually "attached" even if this happens lazily.
3197         
3198         The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing
3199         may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox
3200         and Chrome in our test cases.
3201         
3202         * WebCore.exp.in:
3203         * bindings/js/JSNodeCustom.cpp:
3204         (WebCore::JSNode::insertBefore):
3205         (WebCore::JSNode::replaceChild):
3206         (WebCore::JSNode::appendChild):
3207         
3208             All attaching is now lazy, remove AttachLazily.
3209
3210         * css/CSSComputedStyleDeclaration.cpp:
3211         (WebCore::ComputedStyleExtractor::propertyValue):
3212         
3213             SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior.
3214
3215         * dom/ContainerNode.cpp:
3216         (WebCore::ContainerNode::insertBefore):
3217         (WebCore::ContainerNode::parserInsertBefore):
3218         (WebCore::ContainerNode::replaceChild):
3219         (WebCore::ContainerNode::appendChild):
3220         (WebCore::ContainerNode::parserAppendChild):
3221         (WebCore::ContainerNode::updateTreeAfterInsertion):
3222         * dom/ContainerNode.h:
3223         * dom/Document.cpp:
3224         (WebCore::Document::~Document):
3225         (WebCore::Document::updateStyleIfNeeded):
3226         (WebCore::Document::createRenderTree):
3227         (WebCore::Document::destroyRenderTree):
3228         
3229             Remove attach bit maintenance.
3230
3231         (WebCore::Document::webkitDidExitFullScreenForElement):
3232         
3233             Do lazy render tree reconstruction after returning from full screen. That is the only reliable way
3234             to get the render tree back to decent shape.
3235
3236         * dom/Element.cpp:
3237         (WebCore::Element::isFocusable):
3238         
3239             Remove pointless !renderer()->needsLayout() assert.
3240
3241         (WebCore::Element::addShadowRoot):
3242         (WebCore::Element::childShouldCreateRenderer):
3243         (WebCore::Element::resetComputedStyle):
3244         
3245             Take care to reset computed style in all descendants. attachRenderTree no longer does this.
3246
3247         * dom/Element.h:
3248         * dom/Node.cpp:
3249         (WebCore::Node::insertBefore):
3250         (WebCore::Node::replaceChild):
3251         (WebCore::Node::appendChild):
3252         (WebCore::Node::setNeedsStyleRecalc):
3253         
3254             Propagate ReconstructRenderTree.
3255
3256         (WebCore::Node::attached):
3257         
3258             Emulate the behavior of old attached bit for now so existing code calling this mostly stays working.
3259
3260         * dom/Node.h:
3261         
3262             Add new ReconstructRenderTree value for StyleChangeType.
3263
3264         * dom/Range.cpp:
3265         (WebCore::Range::isPointInRange):
3266         (WebCore::Range::comparePoint):
3267         (WebCore::Range::compareNode):
3268         (WebCore::Range::intersectsNode):
3269         * editing/AppendNodeCommand.cpp:
3270         (WebCore::AppendNodeCommand::doApply):
3271         * editing/CompositeEditCommand.cpp:
3272         (WebCore::CompositeEditCommand::canRebalance):
3273         * editing/InsertNodeBeforeCommand.cpp:
3274         (WebCore::InsertNodeBeforeCommand::doApply):
3275         * html/HTMLDetailsElement.cpp:
3276         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
3277         * html/HTMLDocument.cpp:
3278         (WebCore::HTMLDocument::activeElement):
3279         * html/HTMLElement.cpp:
3280         (WebCore::HTMLElement::setInnerText):
3281         
3282             TextControlInnerTextElement always preserves newline even if it doesn't have style yet.
3283
3284         (WebCore::HTMLElement::supportsFocus):
3285         * html/HTMLEmbedElement.cpp:
3286         (WebCore::HTMLEmbedElement::parseAttribute):
3287         * html/HTMLFormControlElement.cpp:
3288         (WebCore::shouldAutofocus):
3289         
3290             Don't autofocus until we have renderer.
3291
3292         * html/HTMLFormControlElementWithState.cpp:
3293         (WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
3294         * html/HTMLFrameElementBase.cpp:
3295         (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
3296         * html/HTMLInputElement.cpp:
3297         (WebCore::HTMLInputElement::updateType):
3298         
3299             Lazy render tree construction.
3300
3301         (WebCore::HTMLInputElement::parseAttribute):
3302         (WebCore::HTMLInputElement::defaultEventHandler):
3303         * html/HTMLMediaElement.cpp:
3304         (WebCore::HTMLMediaElement::parseAttribute):
3305         * html/HTMLObjectElement.cpp:
3306         (WebCore::HTMLObjectElement::parseAttribute):
3307         * html/HTMLSummaryElement.cpp:
3308         (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
3309         * html/parser/HTMLConstructionSite.cpp:
3310         (WebCore::executeTask):
3311         
3312             Don't attach renderer after construction.
3313
3314         * html/parser/HTMLTreeBuilder.cpp:
3315         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
3316         * html/shadow/ContentDistributor.cpp:
3317         (WebCore::ContentDistributor::invalidateDistribution):
3318         * html/shadow/InsertionPoint.cpp:
3319         (WebCore::InsertionPoint::willAttachRenderers):
3320         (WebCore::InsertionPoint::willDetachRenderers):
3321         * html/shadow/MediaControlElements.cpp:
3322         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
3323         * html/shadow/MediaControls.cpp:
3324         (WebCore::MediaControls::createTextTrackDisplay):
3325         * html/shadow/MediaControlsApple.cpp:
3326         (WebCore::MediaControlsApple::createControls):
3327         * html/track/TextTrackCue.cpp:
3328         (WebCore::TextTrackCue::getDisplayTree):
3329         * loader/PlaceholderDocument.cpp:
3330         (WebCore::PlaceholderDocument::createRenderTree):
3331         * loader/cache/CachedResourceLoader.cpp:
3332         (WebCore::CachedResourceLoader::preload):
3333         * style/StyleResolveTree.cpp:
3334         (WebCore::Style::attachTextRenderer):
3335         (WebCore::Style::detachTextRenderer):
3336         
3337             Remove attached bit maintenance.
3338
3339         (WebCore::Style::attachChildren):
3340         (WebCore::Style::attachShadowRoot):
3341         (WebCore::Style::attachRenderTree):
3342         (WebCore::Style::detachShadowRoot):
3343         (WebCore::Style::detachRenderTree):
3344         (WebCore::Style::resolveLocal):
3345         * svg/SVGTests.cpp:
3346         (WebCore::SVGTests::handleAttributeChange):
3347         
3348             Make lazy.
3349
3350         * testing/Internals.cpp:
3351         (WebCore::Internals::attached):
3352         (WebCore::Internals::elementRenderTreeAsText):
3353         (WebCore::Internals::markerAt):
3354         (WebCore::Internals::nodesFromRect):
3355
3356 2013-12-20  Andreas Kling  <akling@apple.com>
3357
3358         Devirtualize RenderElement::setStyle().
3359         <https://webkit.org/b/126065>
3360
3361         setStyle() was only virtual in order to let RenderSVGBlock override
3362         the display type in some cases. Devirtualized it and moved the fixup
3363         logic to StyleResolver::adjustRenderStyle().
3364
3365         This hack had an evil twin in RenderElement::initializeStyle() that
3366         also goes away. FIXME--!
3367
3368         Based on a Blink change by Elliott Sprehn.
3369
3370         Reviewed by Antti Koivisto.
3371
3372 2013-12-20  Radu Stavila  <stavila@adobe.com>
3373
3374         [CSS Regions] When changing flow-from/flow-into on :hover, elements overflowing the region are not correctly repainted
3375         https://bugs.webkit.org/show_bug.cgi?id=117259
3376
3377         Reviewed by Antti Koivisto.
3378
3379         When computing the repaint rect for a region, the existing visual overflow must be taken into consideration.
3380         For this purpose, I overridden the visualOverflowRect method in RenderNamedFlowFragment, which ends up being
3381         called from RenderBox::clippedOverflowRectForRepaint. 
3382
3383         Test: fast/regions/hover-single-flow-from-none-overflow.html
3384               fast/regions/hover-single-flow-from-none-overflow-top.html
3385
3386         * rendering/RenderNamedFlowFragment.cpp:
3387         (WebCore::RenderNamedFlowFragment::visualOverflowRect):
3388         * rendering/RenderNamedFlowFragment.h:
3389
3390 2013-12-20  Mario Sanchez Prada  <mario.prada@samsung.com>
3391
3392         Programmatically-inserted children lack accessibility events
3393         https://bugs.webkit.org/show_bug.cgi?id=100275
3394
3395         Reviewed by Chris Fleizach.
3396
3397         Test: accessibility/children-changed-sends-notification.html
3398
3399         Emit children-changed::add and children-changed::remove whenever
3400         an object has been added/removed to the accessibility hierarchy,
3401         that is, when a new AtkObject is being attached/detached.
3402
3403         * accessibility/AXObjectCache.h:
3404         (WebCore::AXObjectCache::detachWrapper): Added a new parameter and
3405         updated all the prototypes in different ports.
3406         * accessibility/AXObjectCache.cpp:
3407         (WebCore::AXObjectCache::~AXObjectCache): Call detachWrapper()
3408         specifying that we do it because the cache is being destroyed.
3409         (WebCore::AXObjectCache::remove): Call detachWrapper() specifying
3410         that we do it because an accessible element is being destroyed.
3411
3412         * accessibility/atk/AXObjectCacheAtk.cpp:
3413         (WebCore::AXObjectCache::detachWrapper): Emit the children-changed
3414         signal when needed. We rely on the cached reference to the parent
3415         AtkObject (using the implementation of atk_object_get_parent from
3416         the AtkObject class) to find the right object to emit the signal
3417         from here, since the accessibility hierarchy from WebCore will no
3418         longer be accessible at this point.
3419         (WebCore::AXObjectCache::attachWrapper): Emit the children-change
3420         signal from here unless we are in the middle of a layout update,
3421         trying to provide as much information (e.g. the offset) as possible.
3422         (WebCore::AXObjectCache::postPlatformNotification): Make sure we
3423         update (touch) the subtree under an accessibility object whenever
3424         we receive AXChildrenChanded from WebCore, to ensure that those
3425         objects will also be visible rightaway to ATs, and that those get
3426         properly notified of the event at that very same moment.
3427
3428         * accessibility/ios/AXObjectCacheIOS.mm:
3429         (WebCore::AXObjectCache::detachWrapper): Updated function signature.
3430         * accessibility/mac/AXObjectCacheMac.mm:
3431         (WebCore::AXObjectCache::detachWrapper): Ditto.
3432         * accessibility/win/AXObjectCacheWin.cpp:
3433         (WebCore::AXObjectCache::detachWrapper): Ditto.
3434
3435         * accessibility/AccessibilityObject.cpp:
3436         (WebCore::AccessibilityObject::children): Add the option ot
3437         request the AccessibilityChildrenVector without updating it if
3438         needed, to avoid maybe recreating the child subtree when trying to
3439         get the offset of a newly attached element from attachWrapper.
3440         * accessibility/AccessibilityObject.h:
3441
3442 2013-12-20  Laszlo Vidacs  <lvidacs.u-szeged@partner.samsung.com>
3443
3444         Move function calls outside loop in dom
3445         https://bugs.webkit.org/show_bug.cgi?id=125916
3446
3447         Reviewed by Csaba Osztrogonác.
3448
3449         Do not call length() in each iteration.
3450
3451         * dom/Element.cpp:
3452         (WebCore::Element::cloneAttributesFromElement):
3453         * dom/Node.cpp:
3454         (WebCore::Node::dumpStatistics):
3455
3456 2013-12-19  Beth Dakin  <bdakin@apple.com>
3457
3458         REGRESSION: cnn.com will continue to reveal 1 px of overhang after rubber-banding 
3459         at the top
3460         https://bugs.webkit.org/show_bug.cgi?id=126054
3461
3462         Reviewed by Simon Fraser.
3463
3464         This regression was caused by http://trac.webkit.org/changeset/160791 It turns out 
3465         that the line of code I removed was not always a no-op. In some instances, like on 
3466         cnn.com, it would ensure that our final scroll position after a rubber-band was 
3467         not something within the overhang area. It was still wrong in its assumption that 
3468         rubber-band is always bouncing back the spot it originated from. So this patch 
3469         continues to ignore the rubber-bands origin, and instead finds the nearest point 
3470         that is not in the overhang area, and scrolls to that point instead of the origin.
3471
3472         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
3473         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
3474         (WebCore::ScrollingTreeScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary):
3475         * platform/mac/ScrollAnimatorMac.h:
3476         * platform/mac/ScrollAnimatorMac.mm:
3477         (WebCore::ScrollAnimatorMac::adjustScrollPositionToBoundsIfNecessary):
3478         * platform/mac/ScrollElasticityController.h:
3479         * platform/mac/ScrollElasticityController.mm:
3480         (WebCore::ScrollElasticityController::snapRubberBandTimerFired):
3481
3482 2013-12-19  Simon Fraser  <simon.fraser@apple.com>
3483
3484         Clarify the behavior of composited canvases
3485         https://bugs.webkit.org/show_bug.cgi?id=126042
3486
3487         Reviewed by Tim Horton.
3488
3489         Different platforms composite 2D and 3D canvases in different ways.
3490         
3491         "Accelerated 2D" canvases, and WebGL are always set as GraphicsLayer
3492         contents.
3493         
3494         "IOSurface" canvases (Mac and iOS-only) get a compositing layer, but
3495         paint into it (because this is fast, and a convenient way to get
3496         synchronization).
3497         
3498         So make these behaviors explicit in RenderLayerBacking and RenderLayerCompositor.
3499         No behavior changes on OS X, bug fix on iOS.
3500
3501         * rendering/RenderLayerBacking.cpp:
3502         (WebCore::canvasCompositingStrategy):
3503         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
3504         (WebCore::RenderLayerBacking::containsPaintedContent):
3505         (WebCore::RenderLayerBacking::contentChanged):
3506         * rendering/RenderLayerBacking.h:
3507         * rendering/RenderLayerCompositor.cpp:
3508         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
3509
3510 2013-12-19  Joseph Pecoraro  <pecoraro@apple.com>
3511
3512         Web Inspector: Add InspectorFrontendHost.debuggableType to let the frontend know it's backend is JavaScript or Web
3513         https://bugs.webkit.org/show_bug.cgi?id=126016
3514
3515         Reviewed by Timothy Hatcher.
3516
3517         * inspector/InspectorFrontendHost.cpp:
3518         (WebCore::InspectorFrontendHost::debuggableType):
3519         * inspector/InspectorFrontendHost.h:
3520         * inspector/InspectorFrontendHost.idl:
3521         Expose the debuggableType to the frontend. In WebCore it is always a "web" type.
3522
3523 2013-12-19  Benjamin Poulain  <benjamin@webkit.org>
3524
3525         Add an utility class to simplify generating function calls
3526         https://bugs.webkit.org/show_bug.cgi?id=125972
3527
3528         Reviewed by Geoffrey Garen.
3529
3530         FunctionCall is a little helper class to make function calls from the JIT
3531         in 3 or 4 lines.
3532
3533         FunctionCall takes a StackAllocator, a RegisterAllocator and a function pointer.
3534         When the call is generated, the helper saves the registers as necessary, aligns
3535         the stack, does the call, restores the stack, and restore the registers.
3536
3537         * cssjit/FunctionCall.h: Added.
3538         (WebCore::FunctionCall::FunctionCall):
3539         (WebCore::FunctionCall::setFunctionAddress):
3540         (WebCore::FunctionCall::setFirstArgument):
3541         (WebCore::FunctionCall::call):
3542
3543         (WebCore::FunctionCall::callAndBranchOnCondition): Most test functions used
3544         with FunctionCall return a boolean. When the boolean is the sole purpose of the function
3545         call, this provides an easy way to branch on the boolean without worrying about registers.
3546
3547         The return register is tested first, then all the saved registers are restored from the stack
3548         (which can include the return register), finally the flags are used for a jump.
3549
3550         (WebCore::FunctionCall::prepareAndCall):
3551         (WebCore::FunctionCall::cleanupPostCall):
3552         (WebCore::FunctionCall::saveAllocatedRegisters):
3553         (WebCore::FunctionCall::restoreAllocatedRegisters):
3554         * WebCore.xcodeproj/project.pbxproj:
3555         * cssjit/FunctionCall.h: Added.
3556         (WebCore::FunctionCall::FunctionCall):
3557         (WebCore::FunctionCall::setFunctionAddress):
3558         (WebCore::FunctionCall::setFirstArgument):
3559         (WebCore::FunctionCall::call):
3560         (WebCore::FunctionCall::callAndBranchOnCondition):
3561         (WebCore::FunctionCall::prepareAndCall):
3562         (WebCore::FunctionCall::cleanupPostCall):
3563         (WebCore::FunctionCall::saveAllocatedRegisters):
3564         (WebCore::FunctionCall::restoreAllocatedRegisters):
3565
3566 2013-12-19  Anders Carlsson  <andersca@apple.com>
3567
3568         Begin stubbing out the KeyedDecoder class
3569         https://bugs.webkit.org/show_bug.cgi?id=126031
3570
3571         Reviewed by Andreas Kling.
3572
3573         KeyedDecoder is going to be the new way to decode back forward trees.
3574
3575         * history/HistoryItem.cpp:
3576         (WebCore::HistoryItem::decodeBackForwardTree):
3577         * history/HistoryItem.h:
3578         * platform/KeyedCoding.h:
3579         (WebCore::KeyedDecoder::~KeyedDecoder):
3580
3581 2013-12-19  Oliver Hunt  <oliver@apple.com>
3582
3583         DOM bindings should use thisValue for attributes
3584         https://bugs.webkit.org/show_bug.cgi?id=126011
3585
3586         Reviewed by Antti Koivisto.
3587
3588         Make all standard DOM attributes use the thisValue instead
3589         of the slot object.  This requires using a dynamic cast in
3590         the attribute getters. Happily for normal uses this a single
3591         indirect load and pointer compare, and we were already doing
3592         it for many attributes.
3593
3594         Alas it's too expensive to do this on the window object still
3595         due to the proxy indirection that intercepts global variable
3596         access.  I'll correct this in a follow on patch (bug 126013).
3597
3598         A number of custom getters have also been updated to use the
3599         thisValue and full type checks.
3600
3601         This patch still leaves the index and generic named getters
3602         on the slot based model as fixing these cases requires more
3603         complicated changes.
3604
3605         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3606         (WebCore::cssPropertyGetterPixelOrPosPrefixCallback):
3607         (WebCore::cssPropertyGetterCallback):
3608         * bindings/js/JSPluginElementFunctions.cpp:
3609         (WebCore::pluginElementPropertyGetter):
3610         * bindings/scripts/CodeGeneratorJS.pm:
3611         (GenerateImplementation):
3612         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3613         (WebCore::jsTestActiveDOMObjectExcitingAttr):
3614         (WebCore::jsTestActiveDOMObjectConstructor):
3615         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3616         (WebCore::jsTestCustomNamedGetterConstructor):
3617         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3618         (WebCore::jsTestEventConstructorAttr1):
3619         (WebCore::jsTestEventConstructorAttr2):
3620         (WebCore::jsTestEventConstructorConstructor):
3621         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3622         (WebCore::jsTestEventTargetConstructor):
3623         * bindings/scripts/test/JS/JSTestException.cpp:
3624         (WebCore::jsTestExceptionName):
3625         (WebCore::jsTestExceptionConstructor):
3626         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3627         (WebCore::jsTestGenerateIsReachableConstructor):
3628         * bindings/scripts/test/JS/JSTestInterface.cpp:
3629         (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
3630         (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
3631         (WebCore::jsTestInterfaceImplementsStr1):
3632         (WebCore::jsTestInterfaceImplementsStr2):
3633         (WebCore::jsTestInterfaceImplementsStr3):
3634         (WebCore::jsTestInterfaceImplementsNode):
3635         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
3636         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
3637         (WebCore::jsTestInterfaceSupplementalStr1):
3638         (WebCore::jsTestInterfaceSupplementalStr2):
3639         (WebCore::jsTestInterfaceSupplementalStr3):
3640         (WebCore::jsTestInterfaceSupplementalNode):
3641         (WebCore::jsTestInterfaceConstructor):
3642         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3643         (WebCore::jsTestMediaQueryListListenerConstructor):
3644         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3645         (WebCore::jsTestNamedConstructorConstructor):
3646         * bindings/scripts/test/JS/JSTestNode.cpp:
3647         (WebCore::jsTestNodeConstructor):
3648         * bindings/scripts/test/JS/JSTestObj.cpp:
3649         (WebCore::jsTestObjReadOnlyLongAttr):
3650         (WebCore::jsTestObjReadOnlyStringAttr):
3651         (WebCore::jsTestObjReadOnlyTestObjAttr):
3652         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
3653         (WebCore::jsTestObjConstructorStaticStringAttr):
3654         (WebCore::jsTestObjConstructorTestSubObj):
3655         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
3656         (WebCore::jsTestObjEnumAttr):
3657         (WebCore::jsTestObjByteAttr):
3658         (WebCore::jsTestObjOctetAttr):
3659         (WebCore::jsTestObjShortAttr):
3660         (WebCore::jsTestObjUnsignedShortAttr):
3661         (WebCore::jsTestObjLongAttr):
3662         (WebCore::jsTestObjLongLongAttr):
3663         (WebCore::jsTestObjUnsignedLongLongAttr):
3664         (WebCore::jsTestObjStringAttr):
3665         (WebCore::jsTestObjTestObjAttr):
3666         (WebCore::jsTestObjXMLObjAttr):
3667         (WebCore::jsTestObjCreate):
3668         (WebCore::jsTestObjReflectedStringAttr):
3669         (WebCore::jsTestObjReflectedIntegralAttr):
3670         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
3671         (WebCore::jsTestObjReflectedBooleanAttr):
3672         (WebCore::jsTestObjReflectedURLAttr):
3673         (WebCore::jsTestObjReflectedCustomIntegralAttr):
3674         (WebCore::jsTestObjReflectedCustomBooleanAttr):
3675         (WebCore::jsTestObjReflectedCustomURLAttr):
3676         (WebCore::jsTestObjTypedArrayAttr):
3677         (WebCore::jsTestObjAttrWithGetterException):
3678         (WebCore::jsTestObjAttrWithSetterException):
3679         (WebCore::jsTestObjStringAttrWithGetterException):
3680         (WebCore::jsTestObjStringAttrWithSetterException):
3681         (WebCore::jsTestObjCustomAttr):
3682         (WebCore::jsTestObjWithScriptStateAttribute):
3683         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3684         (WebCore::jsTestObjWithScriptStateAttributeRaises):
3685         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3686         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3687         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3688         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3689         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
3690         (WebCore::jsTestObjConditionalAttr1):
3691         (WebCore::jsTestObjConditionalAttr2):
3692         (WebCore::jsTestObjConditionalAttr3):
3693         (WebCore::jsTestObjConditionalAttr4Constructor):
3694         (WebCore::jsTestObjConditionalAttr5Constructor):
3695         (WebCore::jsTestObjConditionalAttr6Constructor):
3696         (WebCore::jsTestObjCachedAttribute1):
3697         (WebCore::jsTestObjCachedAttribute2):
3698         (WebCore::jsTestObjAnyAttribute):
3699         (WebCore::jsTestObjContentDocument):
3700         (WebCore::jsTestObjMutablePoint):
3701         (WebCore::jsTestObjImmutablePoint):
3702         (WebCore::jsTestObjStrawberry):
3703         (WebCore::jsTestObjStrictFloat):
3704         (WebCore::jsTestObjDescription):
3705         (WebCore::jsTestObjId):
3706         (WebCore::jsTestObjHash):
3707         (WebCore::jsTestObjReplaceableAttribute):
3708         (WebCore::jsTestObjNullableDoubleAttribute):
3709         (WebCore::jsTestObjNullableLongAttribute):
3710         (WebCore::jsTestObjNullableBooleanAttribute):
3711         (WebCore::jsTestObjNullableStringAttribute):
3712         (WebCore::jsTestObjNullableLongSettableAttribute):
3713         (WebCore::jsTestObjNullableStringValue):
3714         (WebCore::jsTestObjAttribute):
3715         (WebCore::jsTestObjAttributeWithReservedEnumType):
3716         (WebCore::jsTestObjConstructor):
3717         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3718         (WebCore::jsTestOverloadedConstructorsConstructor):
3719         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3720         (WebCore::jsTestSerializedScriptValueInterfaceValue):
3721         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
3722         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
3723         (WebCore::jsTestSerializedScriptValueInterfacePorts):
3724         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
3725         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
3726         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3727         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
3728         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
3729         (WebCore::jsTestTypedefsConstructorTestSubObj):
3730         (WebCore::jsTestTypedefsAttrWithGetterException):
3731         (WebCore::jsTestTypedefsAttrWithSetterException):
3732         (WebCore::jsTestTypedefsStringAttrWithGetterException):
3733         (WebCore::jsTestTypedefsStringAttrWithSetterException):
3734         (WebCore::jsTestTypedefsConstructor):
3735         * bindings/scripts/test/JS/JSattribute.cpp:
3736         (WebCore::jsattributeReadonly):
3737         (WebCore::jsattributeConstructor):
3738         * bindings/scripts/test/JS/JSreadonly.cpp:
3739         (WebCore::jsreadonlyConstructor):
3740         * bridge/runtime_array.cpp:
3741         (JSC::RuntimeArray::lengthGetter):
3742         * bridge/runtime_method.cpp:
3743         (JSC::RuntimeMethod::lengthGetter):
3744
3745 2013-12-19  Andy Estes  <aestes@apple.com>
3746
3747         Remove WebFilterEvaluator wrappers from WebKitSystemInterface
3748         https://bugs.webkit.org/show_bug.cgi?id=126028
3749
3750         Reviewed by Anders Carlsson.
3751
3752         It's overkill to pipe access to WebFilterEvaluator through
3753         WebKitSystemInterface. Instead, include WebFilterEvaluator.h when it
3754         exists and re-declare WebFilterEvaluator when it doesn't.
3755         
3756         WebKitSystemInterface used to soft-link WebContentAnalysis.framework
3757         since OS X 10.7 didn't contain this framework. Since we no longer
3758         support 10.7, we can now directly link against the framework.
3759
3760         * Configurations/WebCore.xcconfig: Add /System/Library/PrivateHeaders
3761         to the system framework search path at both compile and link time so
3762         that we can find WebContentAnalysis.framework.
3763         * WebCore.exp.in: Don't export removed symbols.
3764         * WebCore.xcodeproj/project.pbxproj: Added WebContentAnalysis.framework
3765         to the 'Link Binary With Libraries' build phase.
3766         * platform/mac/ContentFilterMac.mm: Included WebFilterEvaluator.h when
3767         it exists and re-declared WebFilterEvaluator when it doesn't.
3768         (WebCore::ContentFilter::ContentFilter): Directly called a method on
3769         m_platformContentFilter rather than going through WKSI.
3770         (WebCore::ContentFilter::isEnabled): Ditto.
3771         (WebCore::ContentFilter::addData): Ditto.
3772         (WebCore::ContentFilter::finishedAddingData): Ditto.
3773         (WebCore::ContentFilter::needsMoreData): Ditto.
3774         (WebCore::ContentFilter::didBlockData): Ditto.
3775         * platform/mac/WebCoreSystemInterface.h: Removed function pointers for
3776         calling into WKSI.
3777         * platform/mac/WebCoreSystemInterface.mm: Ditto.
3778
3779 2013-12-19  Andreas Kling  <akling@apple.com>
3780
3781         Use CascadedProperties for page and keyframe style resolution as well.
3782         <https://webkit.org/b/125997>
3783
3784         Port StyleResolver's styleForKeyframe() and styleForPage() over to
3785         the new property cascading code. Neither of them care about !important
3786         or matched properties caches, so the code is very simple.
3787
3788         Removed the old applyMatchedProperties and applyProperties code with
3789         low/high priority passes.
3790
3791         Reviewed by Antti Koivisto.
3792
3793 2013-12-19  Eric Carlson  <eric.carlson@apple.com>
3794
3795         tryAddEventListener uses local PassRefPtr<>
3796         https://bugs.webkit.org/show_bug.cgi?id=126001
3797
3798         Reviewed by Daniel Bates.
3799
3800         * dom/Node.cpp:
3801         (WebCore::tryAddEventListener): Put PassRefPtr<EventListener> parameter into a local RefPtr
3802             because it is sometimes used twice.
3803
3804 2013-12-19  Ryosuke Niwa  <rniwa@webkit.org>
3805
3806         overflowchanged event could cause a crash
3807         https://bugs.webkit.org/show_bug.cgi?id=125978
3808
3809         Reviewed by Tim Horton.
3810
3811         Made the event asynchrnous by re-using Document's event queuing ability. Also removed
3812         the infrastructure to queue up events in FrameView.
3813
3814         Test: fast/events/overflowchanged-inside-selection-collapse-crash.html
3815
3816         * dom/Document.cpp:
3817         (WebCore::Document::recalcStyle):
3818         (WebCore::Document::enqueueOverflowEvent):
3819         * dom/Document.h:
3820         * page/FrameView.cpp:
3821         (WebCore::FrameView::FrameView):
3822         (WebCore::FrameView::~FrameView):
3823         (WebCore::FrameView::layout):
3824         (WebCore::FrameView::performPostLayoutTasks):
3825         (WebCore::FrameView::updateOverflowStatus):
3826         * page/FrameView.h:
3827         * rendering/RenderBlock.cpp:
3828         (WebCore::OverflowEventDispatcher::~OverflowEventDispatcher):
3829         * rendering/RenderLayer.cpp:
3830         (WebCore::RenderLayer::scrollRectToVisible):
3831         * rendering/RenderMarquee.cpp:
3832         (WebCore::RenderMarquee::start):
3833
3834 2013-12-19  Daniel Bates  <dabates@apple.com>
3835
3836         Fix the Windows build after <http://trac.webkit.org/changeset/160841>
3837         (https://bugs.webkit.org/show_bug.cgi?id=125879)
3838
3839         Add ENABLE(CACHE_PARTITIONING)-guard around call to ResourceRequest::setCachePartition()
3840         as this function is only compiled when building with cache partitioning enabled.
3841
3842         * loader/cache/MemoryCache.cpp:
3843         (WebCore::MemoryCache::addImageToCache):
3844
3845 2013-12-19  Daniel Bates  <dabates@apple.com>
3846
3847         [iOS] Upstream WebCore/accessibility changes
3848         https://bugs.webkit.org/show_bug.cgi?id=125925
3849
3850         Reviewed by Chris Fleizach.
3851
3852         * accessibility/AccessibilityRenderObject.cpp:
3853         (WebCore::AccessibilityRenderObject::visiblePositionForPoint): Opt out of code when building for iOS.
3854
3855 2013-12-19  Alex Christensen  <achristensen@webkit.org>
3856
3857         [WinCairo] Compile fix for VS2013 when using ACCELERATED_COMPOSITING.
3858         https://bugs.webkit.org/show_bug.cgi?id=124866
3859
3860         Reviewed by Darin Adler.
3861
3862         * platform/graphics/TiledBackingStore.cpp:
3863         (WebCore::TiledBackingStore::TiledBackingStore):
3864         * platform/graphics/TiledBackingStore.h:
3865         Added constructor overload to avoid compile errors
3866         from using MSVC's make_unique as a default parameter.
3867
3868 2013-12-19  Daniel Bates  <dabates@apple.com>
3869
3870         [iOS] Upstream WebCore/loader changes
3871         https://bugs.webkit.org/show_bug.cgi?id=125879
3872
3873         Reviewed by Darin Adler.
3874
3875         * WebCore.exp.in: Added symbols for MemoryCache::{addImageToCache, removeImageFromCache}().
3876         * loader/DocumentLoader.cpp:
3877         (WebCore::areAllLoadersPageCacheAcceptable): Added.
3878         (WebCore::DocumentLoader::DocumentLoader): Initialize m_subresourceLoadersArePageCacheAcceptable.
3879         (WebCore::DocumentLoader::stopLoading): Modified to conditionally call areAllLoadersPageCacheAcceptable().
3880         (WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Modified to query FrameLoader::loadsSynchronously()
3881         whether to load substitute data immediately or to schedule a load.
3882         (WebCore::DocumentLoader::responseReceived): Modified to create a content filer when the response protocol
3883         is either HTTP or HTTPS, assuming content filtering is enabled.
3884         (WebCore::DocumentLoader::dataReceived): Modified to call DocumentLoader::setContentFilterForBlockedLoad()
3885         as appropriate.
3886         (WebCore::DocumentLoader::clearMainResourceLoader): Added PLATFORM(IOS)-guarded code. Also added a
3887         FIXME comment to remove the PLATFORM(IOS)-guard once we upstream the iOS changes to ResourceRequest.h.
3888         (WebCore::DocumentLoader::setResponseMIMEType): Added; guard by PLATFORM(IOS). Also added FIXME comment.
3889         (WebCore::DocumentLoader::startLoadingMainResource): Added PLATFORM(IOS)-guarded code. Also added a
3890         FIXME comment to remove the PLATFORM(IOS)-guard once we upstream the iOS changes to ResourceRequest.h.
3891         I also substituted static NeverDestroyed<> for DEFINE_STATIC_LOCAL.
3892         (WebCore::DocumentLoader::setContentFilterForBlockedLoad): Added; guarded by USE(CONTENT_FILTERING).
3893         (WebCore::DocumentLoader::handleContentFilterRequest): Added; guarded by USE(CONTENT_FILTERING) and PLATFORM(IOS).
3894         Also added a FIXME comment to remove the PLATFORM(IOS) guard inside its function body once we upstream
3895         file ContentFilterIOS.mm and implement ContentFilter::requestUnblockAndDispatchIfSuccessful() for Mac.
3896         * loader/DocumentLoader.h:
3897         (WebCore::DocumentLoader::setResponse): Added; guard by PLATFORM(IOS). Also added a FIXME comment as
3898         this method seems to violate the encapsulation of DocumentLoader.
3899         (WebCore::DocumentLoader::subresourceLoadersArePageCacheAcceptable): Added.
3900         (WebCore::DocumentLoader::documentURL): Added; returns the URL of the document resulting from the DocumentLoader.
3901         * loader/DocumentWriter.cpp:
3902         (WebCore::DocumentWriter::createDocument): Added iOS-specific code to create a PDF document.
3903         * loader/EmptyClients.cpp:
3904         (WebCore::EmptyChromeClient::openDateTimeChooser): Opt out of compiling this code for iOS. Also substituted
3905         nullptr for 0.
3906         * loader/EmptyClients.h:
3907         * loader/FrameLoader.cpp:
3908         (WebCore::FrameLoader::FrameProgressTracker::~FrameProgressTracker):
3909         (WebCore::FrameLoader::FrameLoader): Initialize m_loadsSynchronously.
3910         (WebCore::FrameLoader::initForSynthesizedDocument): Added; guarded by PLATFORM(IOS). Also added FIXME comment.
3911         (WebCore::FrameLoader::checkCompleted): Added iOS-specific code with FIXME comment.
3912         (WebCore::FrameLoader::willLoadMediaElementURL): Added iOS-specific code.
3913         (WebCore::FrameLoader::stopForUserCancel): Added iOS-specific code and FIXME comment.
3914         (WebCore::FrameLoader::commitProvisionalLoad): Added iOS-specific code and FIXME comment.
3915         (WebCore::FrameLoader::transitionToCommitted): Opt out of ENABLE(TOUCH_EVENTS) logic when building for iOS.
3916         (WebCore::FrameLoader::didFirstLayout): Added iOS-specific code.
3917         (WebCore::FrameLoader::connectionProperties): Added; guarded by PLATFORM(IOS).
3918         (WebCore::createWindow): Added iOS-specific code and FIXME comment.
3919         * loader/FrameLoader.h:
3920         (WebCore::FrameLoader::setLoadsSynchronously): Added.
3921         (WebCore::FrameLoader::loadsSynchronously): Added.
3922         * loader/FrameLoaderClient.h:
3923         * loader/HistoryController.cpp:
3924         (WebCore::HistoryController::restoreScrollPositionAndViewState): Opt out of scroll position logic when building for iOS.
3925         (WebCore::HistoryController::replaceCurrentItem): Added.
3926         * loader/HistoryController.h:
3927         * loader/PlaceholderDocument.h: Changed access control of constructor from private to protected and removed the FINAL
3928         keyword from the class so that we can subclass PlaceholderDocument on iOS.
3929         * loader/PolicyChecker.cpp:
3930         (WebCore::PolicyChecker::checkNavigationPolicy): Added USE(QUICK_LOOK)- and USE(CONTENT_FILTERING)-guarded code.
3931         * loader/ResourceBuffer.cpp:
3932         (WebCore::ResourceBuffer::shouldUsePurgeableMemory): Added; guarded by PLATFORM(IOS).
3933         * loader/ResourceBuffer.h:
3934         * loader/ResourceLoadNotifier.cpp:
3935         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest): Added USE(QUICK_LOOK)-guarded code.
3936         * loader/ResourceLoadScheduler.cpp:
3937         (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): Added iOS-specific code.
3938         (WebCore::ResourceLoadScheduler::scheduleLoad): Ditto.
3939         (WebCore::ResourceLoadScheduler::remove): Added iOS-specific code with FIXME comment.
3940         (WebCore::ResourceLoadScheduler::crossOriginRedirectReceived): Added null-check for variable oldHost. Also added
3941         iOS-specific code.
3942         (WebCore::ResourceLoadScheduler::servePendingRequests): Added iOS-specific code.
3943         * loader/ResourceLoader.cpp:
3944         (WebCore::ResourceLoader::init): Ditto.
3945         (WebCore::ResourceLoader::willSendRequest): Ditto.
3946         (WebCore::ResourceLoader::connectionProperties): Added; guarded by PLATFORM(IOS).
3947         * loader/ResourceLoader.h:
3948         (WebCore::ResourceLoader::startLoading): Added; guarded by PLATFORM(IOS).
3949         (WebCore::ResourceLoader::iOSOriginalRequest): Added; iOS-specific.
3950         * loader/SubframeLoader.cpp:
3951         (WebCore::SubframeLoader::loadPlugin): Added iOS-specific code.
3952         * loader/SubresourceLoader.cpp:
3953         (WebCore::SubresourceLoader::create): Ditto.
3954         (WebCore::SubresourceLoader::startLoading): Added; guarded by PLATFORM(IOS).
3955         (WebCore::SubresourceLoader::didFinishLoading): Added iOS-specific code.
3956         (WebCore::SubresourceLoader::willCancel): Ditto.
3957         (WebCore::SubresourceLoader::notifyDone): Ditto.
3958         (WebCore::SubresourceLoader::releaseResources): Ditto.
3959         * loader/SubresourceLoader.h:
3960         * loader/appcache/ApplicationCacheStorage.cpp:
3961         (WebCore::ApplicationCacheStorage::loadCacheGroup): Added iOS-specific code.
3962         (WebCore::ApplicationCacheStorage::loadManifestHostHashes): Ditto.
3963         (WebCore::ApplicationCacheStorage::cacheGroupForURL): Ditto.
3964         (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): Ditto.
3965         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Ditto.
3966         (WebCore::ApplicationCacheStorage::calculateUsageForOrigin): Ditto.
3967         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache): Ditto.
3968         (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin): Ditto.
3969         (WebCore::ApplicationCacheStorage::executeSQLCommand): Ditto.
3970         (WebCore::ApplicationCacheStorage::verifySchemaVersion): Ditto.
3971         (WebCore::ApplicationCacheStorage::openDatabase): Ditto.
3972         (WebCore::ApplicationCacheStorage::executeStatement): Ditto.
3973         (WebCore::ApplicationCacheStorage::store): Ditto.
3974         (WebCore::ApplicationCacheStorage::storeUpdatedType): Ditto.
3975         (WebCore::ApplicationCacheStorage::ensureOriginRecord): Ditto.
3976         (WebCore::ApplicationCacheStorage::loadCache): Ditto.
3977         (WebCore::ApplicationCacheStorage::remove): Ditto.
3978         (WebCore::ApplicationCacheStorage::empty): Ditto.
3979         (WebCore::ApplicationCacheStorage::storeCopyOfCache): Ditto.
3980         (WebCore::ApplicationCacheStorage::manifestURLs): Ditto.
3981         (WebCore::ApplicationCacheStorage::cacheGroupSize): Ditto.
3982         (WebCore::ApplicationCacheStorage::deleteCacheGroup): Ditto.
3983         (WebCore::ApplicationCacheStorage::vacuumDatabaseFile): Ditto.
3984         * loader/cache/CachedImage.cpp:
3985         (WebCore::CachedImage::CachedImage): Added.
3986         (WebCore::CachedImage::imageSizeForRenderer): Added iOS-specific code.
3987         (WebCore::CachedImageManual::CachedImageManual): Added; guarded by USE(CF). Also added FIXME comment to incorporate
3988         the functionality of this class into CachedImage and to remove the USE(CF)-guard once we make MemoryCache::addImageToCache()
3989         platform-independent.
3990         (WebCore::CachedImageManual::mustRevalidateDueToCacheHeaders): Added; guarded by USE(CF).
3991         * loader/cache/CachedImage.h: Removed FINAL keyword from class so that we can define derived class CachedImageManual.
3992         (WebCore::CachedImage::isManual): Added; guarded by USE(CF). Also added FIXME comment.
3993         (WebCore::CachedImageManual::addFakeClient): Added; guarded by USE(CF).
3994         (WebCore::CachedImageManual::removeFakeClient): Added; guarded by USE(CF).
3995         * loader/cache/CachedResource.cpp:
3996         (WebCore::CachedResource::load): Added iOS-specific code.
3997         * loader/cache/CachedResource.h:
3998         * loader/cache/CachedResourceLoader.cpp:
3999         (WebCore::CachedResourceLoader::loadDone): Added argument shouldPerformPostLoadActions, defaults to true. Modified
4000         to conditionally call performPostLoadActions() with respect to the argument shouldPerformPostLoadActions.
4001         (WebCore::CachedResourceLoader::preload): Added iOS-specific code.
4002         (WebCore::CachedResourceLoader::checkForPendingPreloads): Ditto.
4003         * loader/cache/CachedResourceLoader.h:
4004         * loader/cache/MemoryCache.cpp:
4005         (WebCore::memoryCache):
4006         (WebCore::MemoryCache::add): Added iOS-specific code.
4007         (WebCore::MemoryCache::revalidationFailed): Ditto.
4008         (WebCore::MemoryCache::resourceForRequest): Ditto.
4009         (WebCore::MemoryCache::addImageToCache): Added; guarded by USE(CF). Also added FIXME comment.
4010         (WebCore::MemoryCache::removeImageFromCache): Added; guarded by USE(CF). Also added FIXME comment.
4011         (WebCore::MemoryCache::pruneLiveResources): Modified to take argument shouldDestroyDecodedDataForAllLiveResources.
4012         (WebCore::MemoryCache::pruneLiveResourcesToSize): Modified to take argument shouldDestroyDecodedDataForAllLiveResources,
4013         defaults to false. When this argument is true we destroy the decoded data for all live resources from the memory cache.
4014         Such functionality is useful when the system is running low on memory.
4015         (WebCore::MemoryCache::evict): Added iOS-specific code.
4016         * loader/cache/MemoryCache.h:
4017         * loader/cf/SubresourceLoaderCF.cpp:
4018         (WebCore::SubresourceLoader::didReceiveDataArray): Actually make this code compile. In particular, there is no
4019         method called sendDataToResource on SubresourceLoader or in its class hierarchy.
4020         * loader/mac/DocumentLoaderMac.cpp:
4021         (WebCore::DocumentLoader::schedule): This method has an empty implementation when building for iOS.
4022         (WebCore::DocumentLoader::unschedule): Ditto.
4023         * platform/graphics/BitmapImage.h: Exposed decodedSize() to access the decoded size of the bitmap image.
4024         This functionality is used in MemoryCache::addImageToCache().
4025
4026 2013-12-19  Jer Noble  <jer.noble@apple.com>
4027
4028         Build fix for platforms which do not define -[AVSampleBufferAudioRenderer muted].
4029         Rubber-stamped by Eric Carlson.
4030
4031         To work around platforms with broken AVSampleBufferAudioRenderer headers, just