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