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