Fix repaint issues when resizing a window with centered content, for platforms with...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-12-15  Simon Fraser  <simon.fraser@apple.com>
2
3         Fix repaint issues when resizing a window with centered content, for platforms with a tile cache
4         https://bugs.webkit.org/show_bug.cgi?id=105073
5
6         Reviewed by Dan Bernstein.
7
8         There were several issues with the "do full repaint" code path in
9         FrameView::layout(). These caused repaint issues when resizing the web view,
10         especially for platforms that use a tile cache.
11         
12         First, the m_doFullRepaint flag wold get clobbered on resize-layouts, because
13         the call to adjustViewSize() re-enters layout(), and resets the m_doFullRepaint member
14         variable to false, even if the outer call had previously set it to true. This would
15         cause us to lose track of whether we needed to do a full repaint. The patch fixes
16         this by restoring m_doFullRepaint to the value it had before the call to adjustViewSize().
17         
18         The second problem was that full repaints would not propagate to compositing
19         layers. They only repainted the RenderView, and on platforms that use a tile cache,
20         this only repaints the top portion of that tile cache. This was fixed by sending
21         a NeedsFullRepaintInBacking flag down into RenderLayer::updateLayerPositions(),
22         and using that to do a full repaint on all compositing layers.
23         
24         Sending this new flag down into updateAfterLayout() prompted some boolean/flags
25         cleanup with propagated into several files. This also allowed me to no longer
26         include RenderLayerBacking.h in RenderLayerCompositor.h, but that required
27         header cleanup in several files.
28
29         Automated testing is not possible because WebKitTestRunner resizes the window
30         asynchronously (bug 105101). Added manual test.
31
32         * page/FrameView.cpp:
33         (WebCore::updateLayerPositionFlags):
34         (WebCore::FrameView::layout):
35         * page/scrolling/ScrollingCoordinator.cpp:
36         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
37         * rendering/RenderLayer.cpp:
38         (WebCore::RenderLayer::updateLayerPositions):
39         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
40         * rendering/RenderLayer.h:
41         * rendering/RenderLayerBacking.cpp:
42         (WebCore::RenderLayerBacking::updateAfterLayout):
43         (WebCore::RenderLayerBacking::contentChanged):
44         * rendering/RenderLayerBacking.h:
45         * rendering/RenderLayerCompositor.cpp:
46         (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
47         * rendering/RenderLayerCompositor.h:
48         * rendering/RenderObject.cpp:
49         * rendering/RenderView.cpp:
50
51 2012-12-15  Anders Carlsson  <andersca@apple.com>
52
53         Fix build.
54
55         * platform/graphics/ca/GraphicsLayerCA.h:
56         Remove an unused member variable.
57
58 2012-12-15  Simon Fraser  <simon.fraser@apple.com>
59
60         REGRESSION (r137006): TileCache flashes to linen, rather than the background color, when scrolling fast
61         https://bugs.webkit.org/show_bug.cgi?id=104746
62
63         Reviewed by Darin Adler.
64
65         Make RenderLayerBacking::updateBackgroundColor() responsible for setting the background
66         color of the main frame's root layer to the document background color (rather than doing
67         it in code related to overlay scrollbars, which was crazy). This is only done for platforms
68         that use a TiledBacking (currently, just Mac).
69         
70         Also fix updateBackgroundColor() to not call m_graphicsLayer->setContentsToBackgroundColor()
71         and then call clearBackgroundColor() right away if the color was transparent.
72         
73         * page/FrameView.cpp:
74         (WebCore::FrameView::recalculateScrollbarOverlayStyle): Remove code that calls documentBackgroundColorDidChange().
75         * rendering/RenderLayerBacking.cpp:
76         (WebCore::clipBox): Remove blank linke.
77         (WebCore::RenderLayerBacking::updateBackgroundColor):
78         * rendering/RenderLayerCompositor.cpp:
79         * rendering/RenderLayerCompositor.h:
80         (RenderLayerCompositor):
81
82 2012-12-15  No'am Rosenthal  <noam.rosenthal@nokia.com>
83
84         Disambiguate "background color" and "contents as solid color" on GraphicsLayer
85         https://bugs.webkit.org/show_bug.cgi?id=104842
86
87         Reviewed by Simon Fraser.
88
89         Rename overloads in GraphicsLayerTextureMapper and GraphicsLayerChromium to account for the rename in GraphicsLayer.
90
91         Covered by existing tests.
92
93         * platform/graphics/chromium/GraphicsLayerChromium.cpp:
94         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
95         (WebCore::GraphicsLayerTextureMapper::setContentsToSolidColor):
96         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
97         (GraphicsLayerTextureMapper):
98         (WebCore::GraphicsLayerTextureMapper::solidColor):
99         * platform/graphics/texmap/TextureMapperLayer.cpp:
100         (WebCore::TextureMapperLayer::paintSelf):
101         (WebCore::TextureMapperLayer::flushCompositingStateSelf):
102         * platform/graphics/texmap/TextureMapperLayer.h:
103         (State):
104
105 2012-12-13  Simon Fraser  <simon.fraser@apple.com>
106
107         Disambiguate "background color" and "contents as solid color" on GraphicsLayer
108         https://bugs.webkit.org/show_bug.cgi?id=104842
109
110         Reviewed by Dean Jackson.
111
112         GraphicsLayer failed to be clear about the distinction between
113         the layer background color, and setting the layer contents
114         to a color. This caused some recently added tests to fail,
115         and required some special-casing for the TileCache in
116         GraphicsLayerCA.
117         
118         Separate these two concepts on GraphicsLayer. setBackgroundColor()
119         now sets the background color on the entire layer, which will only
120         be used in special cases like the TileCache.
121         
122         The existing setContentsToBackgroundColor() is renamed to
123         setContentsToSolidColor(), and is an explicit request to create
124         a contents layer for the purpose of displaying a simple color.
125         
126         In both cases, 'clear' methods are not necessary; calling
127         the setter with an invalid color clears the color.
128
129         Covered by existing tests.
130
131         * WebCore.exp.in: Remove GraphicsLayer::clearBackgroundColor().
132         * platform/graphics/GraphicsLayer.cpp:
133         (WebCore::GraphicsLayer::GraphicsLayer):
134         (WebCore::GraphicsLayer::setBackgroundColor):
135         (WebCore::GraphicsLayer::dumpProperties):
136         * platform/graphics/GraphicsLayer.h:
137         (GraphicsLayer): Remove m_backgroundColorSet; we just check whether
138         the color is a valid color now.
139         (WebCore::GraphicsLayer::setContentsToSolidColor):
140         * platform/graphics/ca/GraphicsLayerCA.cpp:
141         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
142         (WebCore::GraphicsLayerCA::setBackgroundColor):
143         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
144         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
145         (WebCore::GraphicsLayerCA::updateBackgroundColor):
146         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
147         (WebCore):
148         * platform/graphics/ca/GraphicsLayerCA.h:
149         (GraphicsLayerCA):
150         * rendering/RenderLayerBacking.cpp:
151         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): We have
152         to call updateBackgroundColor(), because the 'is simple compositing layer'
153         state may change in this code path.
154         (WebCore::RenderLayerBacking::updateBackgroundColor): Don't initialize
155         the Color to transparent (it will be invalid initially), and always
156         call setContentsToSolidColor() which will either set or remove the color.
157
158 2012-12-15  Mark Lam  <mark.lam@apple.com>
159
160         Re-landing patch for "Introducing the DatabaseStrategy and database servers".
161         https://bugs.webkit.org/show_bug.cgi?id=104934.
162
163         Not reviewed.
164
165         Merged from r137767. Previously reviewed by Sam Weinig.
166         Also added __ZTVN7WebCore16DatabaseStrategyE to WebCore.exp.in.
167
168         No new tests.
169
170         * CMakeLists.txt:
171         * GNUmakefile.list.am:
172         * Modules/webdatabase/AbstractDatabaseServer.h: Copied from Source/WebCore/Modules/webdatabase/AbstractDatabaseServer.h.
173         * Modules/webdatabase/DBBackendServer.h: Copied from Source/WebCore/Modules/webdatabase/DBBackendServer.h.
174         * Modules/webdatabase/DatabaseManager.cpp:
175         (WebCore::DatabaseManager::DatabaseManager):
176         * Modules/webdatabase/DatabaseManager.h:
177         (DatabaseManager):
178         * Target.pri:
179         * WebCore.exp.in:
180         * WebCore.gypi:
181         * WebCore.vcproj/WebCore.vcproj:
182         * WebCore.xcodeproj/project.pbxproj:
183         * platform/DatabaseStrategy.cpp: Copied from Source/WebCore/platform/DatabaseStrategy.cpp.
184         * platform/DatabaseStrategy.h: Copied from Source/WebCore/platform/DatabaseStrategy.h.
185         * platform/PlatformStrategies.h:
186         (WebCore::PlatformStrategies::databaseStrategy):
187         (PlatformStrategies):
188         (WebCore::PlatformStrategies::PlatformStrategies):
189
190 2012-12-14  Yuki Sekiguchi  <yuki.sekiguchi@access-company.com>
191
192         Emphasis mark is printed after inline-block with justify
193         https://bugs.webkit.org/show_bug.cgi?id=104631
194
195         Reviewed by Dean Jackson.
196
197         Do not print an emphasis mark after an inline-block when justified.
198
199         If an inline-block is expanded, it has a space appended to it.
200         This space should not have any emphasis marks drawn.
201
202         Test: fast/inline/justify-emphasis-inline-box.html
203
204         * platform/graphics/SimpleFontData.h:
205         (WebCore::SimpleFontData::zeroWidthSpaceGlyph): Add getter method to get zero width space glyph.
206         * platform/graphics/WidthIterator.cpp:
207         (WebCore::WidthIterator::advanceInternal): We use zero width space for the extra space not to draw emphasis marks.
208
209 2012-12-14  Jer Noble  <jer.noble@apple.com>
210
211         Unreviewed bug fix after r137782.
212
213         Add new source file TextTrackRepresentation.cpp to CMakeLists.txt.
214
215         * CMakeLists.txt:
216
217 2012-12-14  Sheriff Bot  <webkit.review.bot@gmail.com>
218
219         Unreviewed, rolling out r137767.
220         http://trac.webkit.org/changeset/137767
221         https://bugs.webkit.org/show_bug.cgi?id=105062
222
223         Broke Mac builds. (Requested by mlam on #webkit).
224
225         * CMakeLists.txt:
226         * GNUmakefile.list.am:
227         * Modules/webdatabase/AbstractDatabaseServer.h: Removed.
228         * Modules/webdatabase/DBBackendServer.h: Removed.
229         * Modules/webdatabase/DatabaseManager.cpp:
230         (WebCore::DatabaseManager::DatabaseManager):
231         * Modules/webdatabase/DatabaseManager.h:
232         * Target.pri:
233         * WebCore.exp.in:
234         * WebCore.gypi:
235         * WebCore.vcproj/WebCore.vcproj:
236         * WebCore.xcodeproj/project.pbxproj:
237         * platform/DatabaseStrategy.cpp: Removed.
238         * platform/DatabaseStrategy.h: Removed.
239         * platform/PlatformStrategies.h:
240         (WebCore):
241         (WebCore::PlatformStrategies::PlatformStrategies):
242         (PlatformStrategies):
243
244 2012-12-14  Jer Noble  <jer.noble@apple.com>
245
246         Allow the text track contents to be displayed externally to WebCore.
247         https://bugs.webkit.org/show_bug.cgi?id=105052
248
249         Reviewed by Eric Carlson.
250
251         Support scenarios where the text track contents must be rendered outside of WebCore, such as to an external
252         display or window.  Add an abstract base class which encapsulates the external representation to which the
253         text tracks will be rendered.
254
255         Add a new abstract base class and client to wrap the external rendering of a TextTrack.
256         * platform/graphics/TextTrackRepresentation.h: Added.
257         (WebCore::TextTrackRepresentationClient::~TextTrackRepresentationClient):
258         (WebCore::TextTrackRepresentation::~TextTrackRepresentation):
259
260         Add an empty concrete implementation for those ports who do not yet support external display of subtitles.
261         * platform/graphics/TextTrackRepresentation.cpp: Added.
262         (NullTextTrackRepresentation):
263         (WebCore::NullTextTrackRepresentation::~NullTextTrackRepresentation):
264         (WebCore::NullTextTrackRepresentation::update):
265         (WebCore::NullTextTrackRepresentation::platformLayer):
266         (WebCore::NullTextTrackRepresentation::setContentScale):
267         (WebCore::NullTextTrackRepresentation::bounds):
268         (WebCore::TextTrackRepresentation::create):
269
270         Add methods to MediaPlayerPrivateIOS to handle the TextTrackRepresentation.
271         * platform/graphics/ios/MediaPlayerPrivateIOS.h:
272         * platform/graphics/ios/MediaPlayerPrivateIOS.mm:
273         (WebCore::MediaPlayerPrivateIOS::deliverNotification): Remove the representation when exiting full screen.
274         (WebCore::MediaPlayerPrivateIOS::requiresTextTrackRepresentation): Return YES if in full screen mode.
275         (WebCore::MediaPlayerPrivateIOS::setTextTrackRepresentation): Pass the representation's layer to the player plug-in.
276
277         Expose those methods via HTMLMediaElement:
278         * html/HTMLMediaElement.cpp:
279         (WebCore::HTMLMediaElement::requiresTextTrackRepresentation):
280         (WebCore::HTMLMediaElement::setTextTrackRepresentation):
281         * html/HTMLMediaElement.h:
282         * platform/graphics/MediaPlayer.cpp:
283         (WebCore::MediaPlayer::requiresTextTrackRepresentation):
284         (WebCore::MediaPlayer::setTextTrackRepresentation):
285         * platform/graphics/MediaPlayer.h:
286         (WebCore::MediaPlayerClient::textTrackRepresentationBoundsChanged):
287         (WebCore::MediaPlayerClient::paintTextTrackRepresentation):
288         * platform/graphics/MediaPlayerPrivate.h:
289         (WebCore::MediaPlayerPrivateInterface::requiresTextTrackRepresentation):
290         (WebCore::MediaPlayerPrivateInterface::setTextTrackRepresentation):
291
292         * html/shadow/MediaControlElements.cpp:
293         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Create the representation, if necessary.
294         (WebCore::MediaControlTextTrackContainerElement::updateSizes): Use the representation to determine the font size.
295         (WebCore::MediaControlTextTrackContainerElement::paintTextTrackRepresentation): Added. Paint the TextTrack into the provided graphics context.
296         (WebCore::MediaControlTextTrackContainerElement::textTrackRepresentationBoundsChanged): Added. Call updateSizes().
297         * html/shadow/MediaControlElements.h:
298
299         Add the new files to the project.
300         * WebCore.xcodeproj/project.pbxproj:
301         * GNUmakefile.list.am:
302         * Target.pri:
303         * WebCore.gypi:
304         * WebCore.vcproj/WebCore.vcproj:
305
306 2012-12-14  Fady Samuel  <fsamuel@chromium.org>
307
308         Allow embedder to observe changes to frame names
309         https://bugs.webkit.org/show_bug.cgi?id=104404
310
311         Reviewed by Darin Fisher.
312
313         * loader/FrameLoaderClient.h:
314         (WebCore::FrameLoaderClient::didChangeName):
315         (FrameLoaderClient):
316         * page/DOMWindow.cpp:
317         (WebCore::DOMWindow::setName):
318
319 2012-12-14  James Simonsen  <simonjam@chromium.org>
320
321         [Resource Timing] Properly report reused connections
322         https://bugs.webkit.org/show_bug.cgi?id=104986
323
324         Reviewed by Tony Gentilcore.
325
326         Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_connection_reuse.html
327
328         * page/PerformanceResourceTiming.cpp:
329         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
330         (WebCore::PerformanceResourceTiming::connectStart):
331         (WebCore::PerformanceResourceTiming::connectEnd):
332         * page/PerformanceResourceTiming.h:
333         (PerformanceResourceTiming):
334
335 2012-12-14  Roger Fong  <roger_fong@apple.com>
336
337         Enable video caption controls on Windows.
338         https://bugs.webkit.org/show_bug.cgi?id=105045.
339
340         Reviewed by Eric Carlson.
341
342         Now that video tracks have been enabled on Windows, enable controls as well.
343
344         * html/shadow/MediaControlElements.cpp:
345         (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
346         (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
347         * html/shadow/MediaControlElements.h:
348         * rendering/RenderThemeWin.h:
349
350 2012-12-14  Mark Lam  <mark.lam@apple.com>
351
352         Introducing the DatabaseStrategy and database servers.
353         https://bugs.webkit.org/show_bug.cgi?id=104934.
354
355         Reviewed by Sam Weinig.
356
357         The database server is currently a placeholder that does nothing.
358
359         No new tests.
360
361         * CMakeLists.txt:
362         * GNUmakefile.list.am:
363         * Modules/webdatabase/AbstractDatabaseServer.h: Added.
364         (WebCore):
365         (AbstractDatabaseServer):
366         (WebCore::AbstractDatabaseServer::AbstractDatabaseServer):
367         (WebCore::AbstractDatabaseServer::~AbstractDatabaseServer):
368         * Modules/webdatabase/DBBackendServer.h: Added.
369         (DBBackend):
370         * Modules/webdatabase/DatabaseManager.cpp:
371         (WebCore::DatabaseManager::DatabaseManager):
372         * Modules/webdatabase/DatabaseManager.h:
373         (WebCore):
374         (DatabaseManager):
375         * Target.pri:
376         * WebCore.exp.in:
377         * WebCore.gypi:
378         * WebCore.vcproj/WebCore.vcproj:
379         * WebCore.xcodeproj/project.pbxproj:
380         * platform/DatabaseStrategy.cpp: Added.
381         (WebCore):
382         (WebCore::DatabaseStrategy::getDatabaseServer):
383         * platform/DatabaseStrategy.h: Added.
384         (WebCore):
385         (DatabaseStrategy):
386         (WebCore::DatabaseStrategy::~DatabaseStrategy):
387         * platform/PlatformStrategies.h:
388         (WebCore):
389         (WebCore::PlatformStrategies::databaseStrategy):
390         (PlatformStrategies):
391         (WebCore::PlatformStrategies::PlatformStrategies):
392
393 2012-12-14  Anton Vayvod  <avayvod@chromium.org>
394
395         Text Autosizing: Consider inline-block and inline-table elements to be autosizing clusters.
396         https://bugs.webkit.org/show_bug.cgi?id=104702
397
398         Reviewed by Julien Chaffraix.
399
400         A common pattern for creating adjacent columns in CSS is to set each of the columns to
401         display:inline-block, display:inline-table or alike WebKit-specific styles. Whenever columns
402         are used, Text Autosizing needs to assign each of the columns to different clusters (since
403         the user can zoom in such that a column fills the width of the screen, so text within a column
404         should have a smaller multiplier than it's wider enclosing cluster would have needed).
405
406         This patch causes display:inline-block, display:inline-table and alike styles to trigger new clusters.
407
408         Test: fast/text-autosizing/cluster-inline-block-or-table.html
409         Test: fast/text-autosizing/cluster-inline-grid-flex-box.html
410
411         * rendering/TextAutosizer.cpp:
412         (WebCore::TextAutosizer::isAutosizingContainer):
413         (WebCore::TextAutosizer::isAutosizingCluster):
414             Consider display:inline-block, inline-table and alike elements to be autosizing containers and clusters.
415
416 2012-12-14  Anders Carlsson  <andersca@apple.com>
417
418         REGRESSION (r137607): Cannot download files, stuck in "Preparing to download"
419         https://bugs.webkit.org/show_bug.cgi?id=105044
420         <rdar://problem/12879657>
421
422         Reviewed by Alexey Proskuryakov.
423
424         Make ResourceHandle::cancel return early if the handle has been converted to a download.
425
426         * platform/network/mac/ResourceHandleMac.mm:
427         (WebCore::ResourceHandle::cancel):
428
429 2012-12-14  Sheriff Bot  <webkit.review.bot@gmail.com>
430
431         Unreviewed, rolling out r137570.
432         http://trac.webkit.org/changeset/137570
433         https://bugs.webkit.org/show_bug.cgi?id=105048
434
435         Stale nodes in the touchEventTarget HashCountedSet are
436         triggering crashes. Rolling out while I find the root cause.
437         (Requested by leviw on #webkit).
438
439         * dom/Document.cpp:
440         (WebCore::Document::Document):
441         (WebCore::Document::didAddTouchEventHandler):
442         (WebCore::Document::didRemoveTouchEventHandler):
443         * dom/Document.h:
444         (WebCore::Document::touchEventHandlerCount):
445         (Document):
446         * dom/Node.cpp:
447         (WebCore::Node::didMoveToNewDocument):
448         (WebCore::tryAddEventListener):
449         (WebCore::tryRemoveEventListener):
450         * history/CachedFrame.cpp:
451         (WebCore::CachedFrameBase::restore):
452         * html/HTMLInputElement.cpp:
453         (WebCore::HTMLInputElement::~HTMLInputElement):
454         (WebCore::HTMLInputElement::updateType):
455         * page/DOMWindow.cpp:
456         (WebCore::DOMWindow::addEventListener):
457         (WebCore::DOMWindow::removeEventListener):
458         * page/EventHandler.cpp:
459         (WebCore::EventHandler::handleTouchEvent):
460         * page/Frame.cpp:
461         (WebCore::Frame::setDocument):
462         * page/scrolling/ScrollingCoordinator.cpp:
463         * page/scrolling/ScrollingCoordinator.h:
464         * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
465         (WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated):
466         * page/scrolling/chromium/ScrollingCoordinatorChromium.h:
467         (ScrollingCoordinatorChromium):
468         * testing/Internals.cpp:
469         (WebCore::Internals::touchEventHandlerCount):
470         * testing/Internals.h:
471         (Internals):
472         * testing/Internals.idl:
473
474 2012-12-14  Michelangelo De Simone  <michelangelo@webkit.org>
475
476         [CSS Shaders] Remove code for the other mesh box types (border-box | padding-box | content-box)
477         https://bugs.webkit.org/show_bug.cgi?id=103776
478
479         Reviewed by Dean Jackson.
480
481         The MeshBoxType has been removed and the code has been refactored. The specs will be updated shortly
482         and therefore this feature - even though it was not fully implemented yet - shall not be used anymore.
483
484         In this patch we remove everything but the parsing code, which shall be addressed in a different patch
485         (see: https://bugs.webkit.org/show_bug.cgi?id=103778).
486
487         Specification to be updated: http://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#ltboxgt
488
489         Existing tests have been updated and new parsing legacy cases have been added.
490
491         * css/CSSComputedStyleDeclaration.cpp:
492         (WebCore::CSSComputedStyleDeclaration::valueForFilter):
493         * css/CSSParser.cpp:
494         (WebCore::CSSParser::parseCustomFilter):
495         * css/CSSPrimitiveValueMappings.h:
496         * css/StyleResolver.cpp:
497         (WebCore::StyleResolver::createCustomFilterOperation):
498         * platform/graphics/filters/CustomFilterConstants.h:
499         * platform/graphics/filters/CustomFilterOperation.cpp:
500         (WebCore::CustomFilterOperation::CustomFilterOperation):
501         (WebCore::CustomFilterOperation::blend):
502         * platform/graphics/filters/CustomFilterOperation.h:
503         (WebCore::CustomFilterOperation::create):
504         (CustomFilterOperation):
505         (WebCore::CustomFilterOperation::operator==):
506         * platform/graphics/filters/CustomFilterRenderer.cpp:
507         (WebCore::CustomFilterRenderer::create):
508         (WebCore::CustomFilterRenderer::CustomFilterRenderer):
509         * platform/graphics/filters/CustomFilterRenderer.h:
510         (CustomFilterRenderer):
511         * platform/graphics/filters/FECustomFilter.cpp:
512         (WebCore::FECustomFilter::FECustomFilter):
513         (WebCore::FECustomFilter::create):
514         * platform/graphics/filters/FECustomFilter.h:
515         (FECustomFilter):
516         * platform/graphics/filters/ValidatedCustomFilterOperation.cpp:
517         (WebCore::ValidatedCustomFilterOperation::ValidatedCustomFilterOperation):
518         * platform/graphics/filters/ValidatedCustomFilterOperation.h:
519         (WebCore::ValidatedCustomFilterOperation::create):
520         (WebCore::ValidatedCustomFilterOperation::operator==):
521         (ValidatedCustomFilterOperation):
522         * rendering/FilterEffectRenderer.cpp:
523         (WebCore::createCustomFilterEffect):
524         * rendering/RenderLayer.cpp:
525         (WebCore::RenderLayer::computeFilterOperations):
526         * platform/graphics/texmap/TextureMapperGL.cpp:
527         (WebCore::TextureMapperGL::drawUsingCustomFilter):
528
529 2012-12-14  Yury Semikhatsky  <yurys@chromium.org>
530
531         Web Inspector: optional parameters of protocol commands should go after required ones
532         https://bugs.webkit.org/show_bug.cgi?id=105019
533
534         Reviewed by Pavel Feldman.
535
536         * inspector/Inspector.json: Moved required x and y parameters declaration before
537         optional ones.
538         * inspector/InspectorInputAgent.cpp:
539         (WebCore::InspectorInputAgent::dispatchMouseEvent):
540         * inspector/InspectorInputAgent.h:
541         (InspectorInputAgent):
542
543 2012-12-14  Jessie Berlin  <jberlin@apple.com>
544
545         Mac build fix after r137724.
546
547         * platform/graphics/MediaPlayer.h:
548         (WebCore::MediaPlayerClient::mediaPlayerKeyAdded):
549         Comment out the names of the unused parameters so they don't trigger unused parameter
550         warnings.
551         (WebCore::MediaPlayerClient::mediaPlayerKeyError):
552         Ditto.
553         (WebCore::MediaPlayerClient::mediaPlayerKeyMessage):
554         Ditto.
555         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
556         Ditto.
557
558         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
559         (WebCore::MediaPlayerPrivateAVFoundationObjC::generateKeyRequest):
560         Pass an empty URL for the new defaultURL parameter in the keyMessage call.
561
562 2012-12-14  Alberto Garcia  <agarcia@igalia.com>
563
564         [GTK] When in private mode WebKitGTK+ should not save HTTP authentication credentials to the persistent storage
565         https://bugs.webkit.org/show_bug.cgi?id=104910
566
567         Reviewed by Martin Robinson.
568
569         Add new parameter to GtkAuthenticationDialog to select whether we
570         allow persistent storage of credential information or not. In the
571         latter case, the "Remember password" check button is not shown and
572         the credentials are always stored in the session.
573
574         * platform/gtk/GtkAuthenticationDialog.cpp:
575         (WebCore::GtkAuthenticationDialog::GtkAuthenticationDialog):
576         (WebCore::GtkAuthenticationDialog::createContentsInContainer):
577         (WebCore::GtkAuthenticationDialog::buttonClickedCallback):
578         * platform/gtk/GtkAuthenticationDialog.h:
579         (GtkAuthenticationDialog):
580
581 2012-12-14  Andrey Kosyakov  <caseq@chromium.org>
582
583         Unreviewed, rolling out r129633 and r129757.
584         http://trac.webkit.org/changeset/129633
585         http://trac.webkit.org/changeset/129757
586         https://bugs.webkit.org/show_bug.cgi?id=97659
587
588         Causes performance regression whn inspector overlay is
589         displayed
590
591         * inspector/InspectorOverlay.cpp:
592         (WebCore::InspectorOverlay::paint):
593
594 2012-12-14  Yury Semikhatsky  <yurys@chromium.org>
595
596         Web Inspector: add data grid for exploring native heap graph
597         https://bugs.webkit.org/show_bug.cgi?id=105012
598
599         Reviewed by Pavel Feldman.
600
601         Added a view for displaying native heap graph nodes.
602
603         * inspector/HeapGraphSerializer.cpp:
604         (WebCore::HeapGraphSerializer::reportEdge):
605         * inspector/front-end/NativeMemorySnapshotView.js:
606         (WebInspector.NativeMemorySnapshotView):
607         (WebInspector.NativeMemorySnapshotView.prototype._onSelectedViewChanged):
608         (WebInspector.NativeMemorySnapshotView.prototype.get statusBarItems):
609         (WebInspector.NativeHeapGraphNode):
610         (WebInspector.NativeHeapGraphNode.prototype.id):
611         (WebInspector.NativeHeapGraphNode.prototype.type):
612         (WebInspector.NativeHeapGraphNode.prototype.size):
613         (WebInspector.NativeHeapGraphNode.prototype.className):
614         (WebInspector.NativeHeapGraphNode.prototype.name):
615         (WebInspector.NativeHeapGraphNode.prototype.hasReferencedNodes):
616         (WebInspector.NativeHeapGraphNode.prototype.referencedNodes):
617         (WebInspector.NativeHeapGraphNode.prototype._firstEdgePoistion):
618         (WebInspector.NativeHeapGraphNode.prototype._afterLastEdgePosition):
619         (WebInspector.NativeHeapGraphNode.prototype._getStringField):
620         (WebInspector.NativeHeapGraph):
621         (WebInspector.NativeHeapGraph.prototype.rootNodes):
622         (WebInspector.NativeHeapGraph.prototype._calculateNodeEdgeIndexes):
623         (WebInspector.NativeHeapGraphDataGrid):
624         (WebInspector.NativeHeapGraphDataGridRoot):
625         (WebInspector.NativeHeapGraphDataGridRoot.prototype._populate):
626         (WebInspector.NativeHeapGraphDataGridNode):
627         (WebInspector.NativeHeapGraphDataGridNode.prototype._populate):
628         (WebInspector.NativeMemoryProfileType.prototype.buttonClicked.didReceiveMemorySnapshot):
629         (WebInspector.NativeMemoryProfileType.prototype.buttonClicked):
630
631 2012-12-14  Ilya Tikhonovsky  <loislo@chromium.org>
632
633         Web Inspector: Native Memory Instrumentation: do not validate InlineFlowBox objects against tcmalloc data.
634         https://bugs.webkit.org/show_bug.cgi?id=105001
635
636         Reviewed by Yury Semikhatsky.
637
638         This is a follow-up change for r137589.
639
640         * rendering/InlineFlowBox.cpp:
641         (WebCore::InlineFlowBox::reportMemoryUsage):
642         (WebCore):
643         * rendering/InlineFlowBox.h:
644         (InlineFlowBox):
645
646 2012-12-14  Kentaro Hara  <haraken@chromium.org>
647
648         ChildNodesLazySnapshot::nextNode() can crash in Debug builds
649         https://bugs.webkit.org/show_bug.cgi?id=104982
650
651         Reviewed by Ryosuke Niwa.
652
653         The original fix in r137702 was not enough. r137702 fixed a crash
654         in Release builds but didn't fix a crash in Debug builds.
655         We have to also change a return type of ChildNodesLazySnapshot::nextNode()
656         from a raw pointer to a RefPtr.
657
658         Test: fast/dom/insertedIntoDocument-no-crash.html
659         (Confirm that this test does not crash in Debug builds.)
660
661         * dom/ContainerNode.h:
662         (WebCore::ChildNodesLazySnapshot::nextNode):
663         * dom/ContainerNodeAlgorithms.cpp:
664         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
665         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
666
667 2012-12-14  John Mellor  <johnme@chromium.org>
668
669         Text Autosizing: Don't autosize unwrappable blocks
670         https://bugs.webkit.org/show_bug.cgi?id=104925
671
672         Reviewed by Julien Chaffraix.
673
674         If we autosize an unwrappable block (white-space:nowrap/pre), it'll
675         expand sideways. This doesn't actually improve its legibility, and it
676         can often severely break web page layouts. This patch prevents us from
677         autosizing unwrappable blocks. A follow-up patch will address the more
678         complex issue of unwrappable inline elements.
679
680         Tests: fast/text-autosizing/unwrappable-blocks.html
681                fast/text-autosizing/unwrappable-inlines.html
682
683         * rendering/TextAutosizer.cpp:
684         (WebCore::TextAutosizer::processContainer):
685             Use containerShouldbeAutosized instead of contentHeightIsConstrained.
686         (WebCore::contentHeightIsConstrained):
687             Unchanged, just moved lower down the file.
688         (WebCore::TextAutosizer::containerShouldbeAutosized):
689             Checks that the block is wrappable, and also that contentHeightIsConstrained is false.
690         (WebCore::TextAutosizer::measureDescendantTextWidth):
691             Use containerShouldbeAutosized instead of contentHeightIsConstrained.
692         * rendering/TextAutosizer.h:
693             Declared containerShouldbeAutosized.
694
695 2012-12-14  Vsevolod Vlasov  <vsevik@chromium.org>
696
697         Web Inspector: Duplicate scripts appear in workspace when script was referenced by url with a fragment part.
698         https://bugs.webkit.org/show_bug.cgi?id=105004
699
700         Reviewed by Alexander Pavlov.
701
702         * inspector/front-end/NetworkUISourceCodeProvider.js:
703         (WebInspector.NetworkUISourceCodeProvider.prototype._parsedScriptSource):
704
705 2012-12-14  Kunihiko Sakamoto  <ksakamoto@chromium.org>
706
707         Hours field of date/time input UI should respect step attribute
708         https://bugs.webkit.org/show_bug.cgi?id=104993
709
710         Reviewed by Kent Tamura.
711
712         This patch makes step-up/-down UI of the hours field respect step attribute when possible.
713
714         Test: fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html
715
716         * html/shadow/DateTimeEditElement.cpp:
717         (WebCore::DateTimeEditBuilder::visitField): Pass step parameters to the hour field constructor.
718         * html/shadow/DateTimeFieldElements.cpp:
719         (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement): Add Parameters argument.
720         (WebCore::DateTimeHourFieldElement::create): Ditto.
721         * html/shadow/DateTimeFieldElements.h:
722         (DateTimeHourFieldElement): Ditto.
723
724 2012-12-14  Yury Semikhatsky  <yurys@chromium.org>
725
726         Unreviewed. Windows compilation fix after r137728.
727
728         * inspector/InspectorAllInOne.cpp:
729
730 2012-12-14  Shinya Kawanaka  <shinyak@chromium.org>
731
732         [Shadow DOM] ShadowRoot.getElementById() should work outside document.
733         https://bugs.webkit.org/show_bug.cgi?id=87815
734
735         Reviewed by Hajime Morita.
736
737         ShadowRoot.getElementById() didn't work if ShadowRoot is outside document. We need to update id when an element
738         is in ShadowTree event if it is not in document.
739
740         For performance reason, we introduce IsInShadowTree flag, which enables us to check isInTreeScope() fast.
741         This is maintained in Element::insertedInto and removedFrom. Here, we're anxious about performance regression,
742         however our benchmark result shows this doesn't regress the performance.
743
744         I've measured Dromaeo/dom-modify.html and Parser/html5-full-render.html 2 times.
745
746         Dromaeo/dom-modify.html
747              35.21,   35.27 [runs/s] --->   35.76,   35.56 [runs/s]
748         Parser/html5-full-render.html
749            4328.51, 4254.94 [ms]     ---> 4277.14, 4222.43 [ms]
750
751         Test: fast/dom/shadow/getelementbyid-in-orphan.html
752
753         * dom/Element.cpp:
754         (WebCore::Element::insertedInto):
755         * dom/Element.h:
756         (WebCore::Element::updateId):
757         * dom/Node.cpp:
758         (WebCore::Node::insertedInto): If the parent node is in shadow tree, this node should be also in the same shadow tree.
759         Since this node is inserted, parentOrHostNode() will not be null.
760         (WebCore::Node::removedFrom): When node is removed from ShadowTree, its treeScope() should not be ShadowRoot.
761         * dom/Node.h:
762         (Node):
763         (WebCore::Node::isInShadowTree):
764         (WebCore::Node::isInTreeScope):
765
766 2012-12-14  Antoine Quint  <graouts@apple.com>
767
768         LayerTreeAgent should only be enabled upon restore if it was previously in the enabled state
769         https://bugs.webkit.org/show_bug.cgi?id=104887
770
771         Reviewed by Pavel Feldman.
772
773         Check that we were previously in the enabled state before re-enabling the agent upon restore,
774         as suggested by Pavel Feldman in follow-up discussion to https://bugs.webkit.org/show_bug.cgi?id=103513.
775
776         * inspector/InspectorLayerTreeAgent.cpp:
777         (WebCore::InspectorLayerTreeAgent::restore):
778
779 2012-12-14  Eugene Klyuchnikov  <eustas@chromium.org>
780
781         Web Inspector: CPU Profile: Search in "heavy" mode is very slow.
782         https://bugs.webkit.org/show_bug.cgi?id=103682
783
784         Reviewed by Pavel Feldman.
785
786         In "heavy" mode the searchable tree is much larger than original tree.
787         That is why search can cause watchdog timer fired.
788
789         Simple optimization makes search much faster.
790
791         * inspector/front-end/CPUProfileView.js:
792         (WebInspector.CPUProfileView.prototype.searchCanceled):
793         Fix cleanup.
794         (WebInspector.CPUProfileView.prototype.matchesQuery):
795         Precompute regexp.
796         (WebInspector.CPUProfileView.prototype.performSearch):
797         Use precomputed regexp instead of generating one on each iteration.
798
799 2012-12-13  Yury Semikhatsky  <yurys@chromium.org>
800
801         Web Inspector: collect native heap graph and report it to the front-end
802         https://bugs.webkit.org/show_bug.cgi?id=104888
803
804         Reviewed by Pavel Feldman.
805
806         Added an option to serialize native heap graph in a format similar to that
807         of JS heap profiler and send it in reply to getProcessMemoryDistribution
808         command. This is a first attempt and we likely change the report mechanism to
809         use a stream instread of sending whole graph at once.
810
811         * CMakeLists.txt:
812         * GNUmakefile.list.am:
813         * Target.pri:
814         * WebCore.gypi:
815         * WebCore.vcproj/WebCore.vcproj:
816         * WebCore.xcodeproj/project.pbxproj:
817         * inspector/HeapGraphSerializer.cpp: Added.
818         (WebCore):
819         (HeapGraphNode):
820         (WebCore::HeapGraphNode::HeapGraphNode):
821         (HeapGraphEdge):
822         (WebCore::HeapGraphEdge::HeapGraphEdge):
823         (WebCore::HeapGraphSerializer::HeapGraphSerializer):
824         (WebCore::HeapGraphSerializer::~HeapGraphSerializer):
825         (WebCore::HeapGraphSerializer::serialize):
826         (WebCore::HeapGraphSerializer::reportNode):
827         (WebCore::HeapGraphSerializer::reportEdge):
828         (WebCore::HeapGraphSerializer::reportLeaf):
829         (WebCore::HeapGraphSerializer::reportBaseAddress):
830         (WebCore::HeapGraphSerializer::adjutEdgeTargets):
831         (WebCore::HeapGraphSerializer::addString):
832         * inspector/HeapGraphSerializer.h: Copied from Source/WebCore/inspector/InspectorMemoryAgent.h.
833         (WebCore):
834         (HeapGraphSerializer):
835         * inspector/Inspector.json:
836         * inspector/InspectorMemoryAgent.cpp:
837         (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
838         * inspector/InspectorMemoryAgent.h:
839         (InspectorMemoryAgent):
840         * inspector/MemoryInstrumentationImpl.cpp:
841         (WebCore::MemoryInstrumentationClientImpl::reportNode):
842         (WebCore):
843         (WebCore::MemoryInstrumentationClientImpl::reportEdge):
844         (WebCore::MemoryInstrumentationClientImpl::reportLeaf):
845         (WebCore::MemoryInstrumentationClientImpl::reportBaseAddress):
846         * inspector/MemoryInstrumentationImpl.h:
847         (WebCore):
848         (WebCore::MemoryInstrumentationClientImpl::MemoryInstrumentationClientImpl):
849         (MemoryInstrumentationClientImpl):
850
851 2012-12-14  Yoshifumi Inoue  <yosin@chromium.org>
852
853         Handling autoscroll in EventHandler should be re-factor
854         https://bugs.webkit.org/show_bug.cgi?id=104764
855
856         Reviewed by Hajime Morita.
857
858         This patch introduces new class AutoscrollController for moving autoscroll
859         and panscroll from EventHandler class for ease of maintenance of
860         EventHandler and ease of adding autoscroll related features, e.g. autoscroll
861         during drag-and-drop, autoscoll by gesture.
862
863         No new tests. This patch doesn't change behavior.
864
865         * CMakeLists.txt: Changed to add page/AutoscrollController.cpp
866         * GNUmakefile.list.am:  Changed to add page/AutoscrollController.{cpp,h}
867         * Target.pri:  Changed to add page/AutoscrollController.cpp
868         * WebCore.gypi: Changed to add page/AutoscrollController.{cpp,h}
869         * WebCore.vcproj/WebCore.vcproj: Changed to add page/AutoscrollController.{cpp,h}
870         * WebCore.xcodeproj/project.pbxproj: Changed to add page/AutoscrollController.{cpp,h}
871         * page/AutoscrollController.cpp: Added.
872         (WebCore::getMainFrame): Helper function.
873         (WebCore::AutoscrollController::AutoscrollController): Moved from EventHandler.
874         (WebCore::AutoscrollController::autoscrollRenderer): Moved from EventHandler.
875         (WebCore::AutoscrollController::autoscrollInProgress): Moved from EventHandler.
876         (WebCore::AutoscrollController::startAutoscrollForSelection): Replacement of EventHandler::handleAutoscroll().
877         (WebCore::AutoscrollController::stopAutoscrollTimer): Moveed from EventHandler.
878         (WebCore::AutoscrollController::updateAutoscrollRenderer): ditto
879         (WebCore::AutoscrollController::didPanScrollStart): Added for updating pan scrolling status of main frame.
880         (WebCore::AutoscrollController::didPanScrollStop): ditto
881         (WebCore::AutoscrollController::handleMouseReleaseEvent): Extracted from EventHandler.
882         (WebCore::AutoscrollController::panScrollInProgress): Replacement of EventHandler::m_panScrollInProgress.
883         (WebCore::AutoscrollController::startPanScrolling): Moved from EventHandler::startPanScrolling()
884         (WebCore::AutoscrollController::autoscrollTimerFired): Moved from EventHandler::autoscrollTimerFired().
885         (WebCore::AutoscrollController::startAutoscrollTimer): Moved from EventHandler::startAutoscrollTimer().
886         (WebCore::AutoscrollController::updatePanScrollState): Moved from EventHandler::updatePanScrollState().
887         * page/AutoscrollController.h: Added.
888         (AutoscrollController):
889         * page/EventHandler.cpp:
890         (WebCore::EventHandler::EventHandler): Changed autoscroll and panscroll related member variable initializations to m_autoscrollController initialization.
891         (WebCore::EventHandler::handleMouseDraggedEvent): Changed to call AutoscrollController::startAutoscrollForSelection().
892         (WebCore::EventHandler::handleMouseReleaseEvent): Changed to remove m_autoscrollInProgress reference.
893         (WebCore::EventHandler::didPanScrollStart): Added for updating pan scrolling status of main frame.
894         (WebCore::EventHandler::didPanScrollStop): ditto
895         (WebCore::EventHandler::startPanScrolling): Changed to call AutoscrollController::startPanScrolling().
896         (WebCore::EventHandler::autoscrollRenderer): Changed to use AutoscrollController.
897         (WebCore::EventHandler::updateAutoscrollRenderer): ditto
898         (WebCore::EventHandler::autoscrollInProgress): ditto
899         (WebCore::EventHandler::panScrollInProgress): Added to replace m_panScrollInProgress.
900         (WebCore::EventHandler::stopAutoscrollTimer): Changed to use AutoscrollController.
901         (WebCore::EventHandler::selectCursor): Changed to use panScrollInProgress().
902         (WebCore::EventHandler::handleMousePressEvent): Chagned to call AutoscrollController::handleMousePressEvent().
903         (WebCore::EventHandler::keyEvent): Changed to use panScrollInProgress().
904         * page/EventHandler.h:
905         (WebCore::EventHandler::autoscrollController): Added for using main frame's panScrollInProgress().
906         (WebCore::EventHandler::mouseDownWasInSubframe): Added for AutoscrollController.
907         * rendering/RenderBox.cpp:
908         (WebCore::RenderBox::canAutoscroll): Moved from EventHandler.cpp.
909         (WebCore::RenderBox::findAutoscrollable): Moved from EventHandler.cpp.
910         * rendering/RenderBox.h:
911         (RenderBox): Added new functions canAutoscroll() and findAutoscrollable().
912
913 2012-12-14  David Dorwin  <ddorwin@chromium.org>
914
915         EME v0.1: Report defaultURL in KeyMessage.
916         https://bugs.webkit.org/show_bug.cgi?id=104284
917
918         Reviewed by Darin Fisher.
919
920         Passes defaultURL down from the media engine to HTMLMediaElement.
921         Only Valid URLs will be passed.
922
923         No test because Clear Key does not provide a defaultURL (in v0.1).
924
925         * html/HTMLMediaElement.cpp:
926         (WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
927         * html/HTMLMediaElement.h:
928         (HTMLMediaElement):
929         * platform/graphics/MediaPlayer.cpp:
930         (WebCore::MediaPlayer::keyMessage):
931         * platform/graphics/MediaPlayer.h:
932         (WebCore::MediaPlayerClient::mediaPlayerKeyAdded):
933         (WebCore::MediaPlayerClient::mediaPlayerKeyError):
934         (WebCore::MediaPlayerClient::mediaPlayerKeyMessage):
935         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
936         (MediaPlayer):
937
938 2012-12-13  Hajime Morrita  <morrita@google.com>
939
940         ContentDistributor and ShadowRootContentDistributionData should use RefPtr to hold elements.
941         https://bugs.webkit.org/show_bug.cgi?id=104918
942
943         Reviewed by Kentaro Hara.
944
945         This change turns some raw pointers to RefPtrs.
946
947         No new tests. Hard to write reliable fast tests since the error
948         reproduction needs GC to run in certain timing. Although original
949         report has a repdocution, it takes a few seconds before crash and
950         isn't suited for a layout test.
951
952         * dom/ShadowRoot.cpp:
953         (WebCore::ShadowRoot::insertionPointList):
954         * dom/ShadowRoot.h:
955         (ShadowRoot):
956         * html/shadow/ContentDistributor.cpp:
957         (WebCore::ShadowRootContentDistributionData::ensureInsertionPointList):
958         (WebCore::ContentDistributor::findInsertionPointFor):
959         (WebCore::ContentDistributor::distribute):
960         (WebCore::ContentDistributor::invalidate):
961         * html/shadow/ContentDistributor.h:
962         (ShadowRootContentDistributionData):
963         (ContentDistributor):
964
965 2012-12-13  Hajime Morrita  <morrita@google.com>
966
967         NodeRenderingContext is slow due to ComposedShadowTreeWalker
968         https://bugs.webkit.org/show_bug.cgi?id=104332
969
970         Reviewed by Dimitri Glazkov.
971
972         NodeRenderingContext has some slowness due to the complexity of
973         ComposedShadowTreeWalker that NRC relies on. This change
974         creates some fast paths to address such slowness.
975
976         = NodeRenderingTraversal module:
977
978         This change introduces NodeRenderingTraversal namespace, a sister
979         of NodeTraversal. NRT consists of a set of tree traversal
980         functions that is responsible for traversal in NRC.  Before this
981         change, NRC directly used CSTW. This NRT module hides and narrows
982         the usage of CSTW.
983
984         - Traversals provided by NRT have fast paths. In many case, such traversals
985           don't need to use CSTW and just goes to neighboring nodes in a plain DOM way.
986         - It also handles NRC specific traversal concerns like pseudo elements.
987           CSTW::pseudoAwareNextSibling() and CSTW::pseudoAwarePreviousSibling() are
988           merged into this module.
989         - CSTW::ParentTraversalDetails is moved and renamed to
990           NRT::ParentDetails with small modification. This is a pure
991           refactoring: As the name implies, This class is used only by NRC
992           and used during a traversal there.
993
994         NodeRenderingTraversal is an isolation layer between generic DOM and CSTW. This hides CSTW
995         behind the wall and will help further reduction of its usage.
996
997         = Node::NeedsShadowTreeWalkerFlag flag:
998
999         NRT fast path is enabled by newly introduced NeedsShadowTreeWalker
1000         node flag. Each DOM node is now markd as NeedsShadowTreeWalker if
1001         it requires non-trivial traversal in NRT which uses CSTW. This
1002         means that each node can go fast path unless it is marked with this flag.
1003
1004         A node is marked as it NeedsShadowTreeWalker if:
1005
1006         - The node is a shadow boundary like InsertionPoint or ShadowRoot,
1007         - The node has pseudo elements like generated content or
1008         - The node is a pseudo element.
1009
1010         This criteria is defined in Node::needsShadowTreeWalkerSlow(). The node actually needs
1011         the walker if the node or its parent is marked with this flag.
1012
1013         The original idea of this change was demonstrated by Antti Koivisto on bug 103208 and bug 104507.
1014         This chagne has 2-3% speedup on Dromaeo/dom-modify/innerHTML on Apple Mac.
1015
1016         No new tests. Covered by existing tests.
1017
1018         * CMakeLists.txt:
1019         * GNUmakefile.list.am:
1020         * Target.pri:
1021         * WebCore.gypi:
1022         * WebCore.xcodeproj/project.pbxproj:
1023         * dom/ComposedShadowTreeWalker.cpp:
1024         * dom/ComposedShadowTreeWalker.h:
1025         (ComposedShadowTreeWalker): Move some part to NodeRenderingTraversal
1026         * dom/ContainerNode.h:
1027         (WebCore::Node::needsShadowTreeWalker): Added. This is located here since it refers ContainerNode definition.
1028         (WebCore):
1029         * dom/DOMAllInOne.cpp:
1030         * dom/Element.cpp:
1031         (WebCore::Element::updatePseudoElement): Refactored.
1032         (WebCore::Element::hasPseudoElements): Ditto.
1033         (WebCore::Element::pseudoElement): Ditto.
1034         (WebCore::Element::setPseudoElement): Refactored and added a flag update logic.
1035         (WebCore):
1036         * dom/Element.h:
1037         (Element):
1038         (WebCore::Element::beforePseudoElement): Refactored.
1039         (WebCore::Element::afterPseudoElement): Refactored.
1040         * dom/ElementRareData.h:
1041         (WebCore::ElementRareData::hasPseudoElements): Factored out.
1042         * dom/ElementShadow.cpp:
1043         (WebCore::ElementShadow::addShadowRoot): Added a flag update logic.
1044         * dom/Node.cpp:
1045         (WebCore::Node::needsShadowTreeWalkerSlow): Added.
1046         * dom/Node.h:
1047         (WebCore::Node::isInsertionPointNode): Added.
1048         (Node):
1049         (WebCore::Node::isInsertionPoint): Changed to use NeedsShadowTreeWalkerFlag.
1050         (WebCore::Node::setNeedsShadowTreeWalker):
1051         (WebCore::Node::resetNeedsShadowTreeWalker):
1052         * dom/NodeRenderingContext.cpp: Adopted NodeRenderingTraversal.
1053         (WebCore::NodeRenderingContext::NodeRenderingContext):
1054         (WebCore::NodeRenderingContext::nextRenderer):
1055         (WebCore::NodeRenderingContext::previousRenderer):
1056         (WebCore::NodeRenderingContext::parentRenderer):
1057         (WebCore::NodeRenderingContext::shouldCreateRenderer):
1058         * dom/NodeRenderingContext.h: Ditto.
1059         (NodeRenderingContext):
1060         (WebCore::NodeRenderingContext::parentNodeForRenderingAndStyle):
1061         * dom/NodeRenderingTraversal.cpp: Added.
1062         (WebCore):
1063         (NodeRenderingTraversal):
1064         (WebCore::NodeRenderingTraversal::ParentDetails::didTraverseInsertionPoint): Moved from ComposedShadowTreeWalker
1065         (WebCore::NodeRenderingTraversal::ParentDetails::didTraverseShadowRoot): Ditto.
1066         (WebCore::NodeRenderingTraversal::parentSlow): Ditto.
1067         (WebCore::NodeRenderingTraversal::nextSiblingSlow): Ditto. The original was pseudoAwareNextSibling.
1068         (WebCore::NodeRenderingTraversal::previousSiblingSlow): Ditto. The original was pseudoAwarePreviousSibling.
1069         * dom/NodeRenderingTraversal.h: Added.
1070         (WebCore):
1071         (NodeRenderingTraversal):
1072         (ParentDetails): Moved from ComposedShadowTreeWalker.
1073         (WebCore::NodeRenderingTraversal::ParentDetails::ParentDetails):
1074         (WebCore::NodeRenderingTraversal::ParentDetails::insertionPoint):
1075         (WebCore::NodeRenderingTraversal::ParentDetails::resetStyleInheritance):
1076         (WebCore::NodeRenderingTraversal::ParentDetails::outOfComposition):
1077         (WebCore::NodeRenderingTraversal::ParentDetails::childWasOutOfComposition):
1078         (WebCore::NodeRenderingTraversal::ParentDetails::operator==):
1079         (WebCore::NodeRenderingTraversal::parent):
1080         (WebCore::NodeRenderingTraversal::nextSibling):
1081         (WebCore::NodeRenderingTraversal::previousSibling):
1082         * dom/PseudoElement.cpp:
1083         (WebCore::PseudoElement::PseudoElement): Added an assertion.
1084         * dom/Text.cpp:
1085         * html/HTMLOptGroupElement.cpp: Added a #include which revealed by a chagne on NodeRenderingContext.h
1086         * html/HTMLOptionElement.cpp: Ditto.
1087         * html/HTMLProgressElement.cpp: Dito.
1088         * html/shadow/InsertionPoint.h: Added an override of isInsertionPointNode().
1089
1090 2012-12-13  Kent Tamura  <tkent@chromium.org>
1091
1092         Refactoring: Fix indentation of ChromeClient.h
1093         https://bugs.webkit.org/show_bug.cgi?id=104989
1094
1095         Reviewed by Kentaro Hara.
1096
1097         The contents of an outermost namespace block should not be indented.
1098         http://www.webkit.org/coding/coding-style.html#indentation-namespace
1099
1100         No behavior change.
1101
1102         * page/ChromeClient.h:
1103
1104 2012-12-13  Kunihiko Sakamoto  <ksakamoto@chromium.org>
1105
1106         Seconds/Minutes field of date/time input UI should respect step attribute
1107         https://bugs.webkit.org/show_bug.cgi?id=104985
1108
1109         Reviewed by Kent Tamura.
1110
1111         This patch makes step-up/-down UI of the seconds and minutes fields respect
1112         step attribute when possible.
1113
1114         Test: fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html
1115
1116         * html/shadow/DateTimeEditElement.cpp:
1117         (DateTimeEditBuilder):
1118         (WebCore::DateTimeEditBuilder::visitField): Compute step parameters for seconds and minutes fields, and pass it to the field element constructors.
1119         (WebCore::DateTimeEditBuilder::createNumericFieldParameters): Added.
1120         * html/shadow/DateTimeFieldElements.cpp:
1121         (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): Use Parameters instead of step and stepBase.
1122         (WebCore::DateTimeMillisecondFieldElement::create): Ditto.
1123         (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement): Add Parameters argument.
1124         (WebCore::DateTimeMinuteFieldElement::create): Ditto.
1125         (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement): Ditto.
1126         (WebCore::DateTimeSecondFieldElement::create): Ditto.
1127         * html/shadow/DateTimeFieldElements.h:
1128         (DateTimeMillisecondFieldElement): Use Parameters instead of step and stepBase.
1129         (DateTimeMinuteFieldElement): Add Parameters argument.
1130         (DateTimeSecondFieldElement): Ditto.
1131         * html/shadow/DateTimeNumericFieldElement.cpp:
1132         (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement): Use Parameters instead of step and stepBase.
1133         * html/shadow/DateTimeNumericFieldElement.h:
1134         (DateTimeNumericFieldElement):
1135         (WebCore::DateTimeNumericFieldElement::Parameters::Parameters):
1136         (Parameters): Added.
1137
1138 2012-12-13  Filip Pizlo  <fpizlo@apple.com>
1139
1140         Attempt to rationalize and simplify WTF::binarySearch
1141         https://bugs.webkit.org/show_bug.cgi?id=104890
1142
1143         Reviewed by Maciej Stachowiak.
1144
1145         Switch to using the new binarySearch() API. No change in behavior, so no new tests.
1146
1147         * svg/animation/SVGSMILElement.cpp:
1148         (WebCore::SVGSMILElement::findInstanceTime):
1149
1150 2012-12-13  Takashi Sakamoto  <tasak@google.com>
1151
1152         [Shadow DOM]: scoped styles are not applied in the cascade order.
1153         https://bugs.webkit.org/show_bug.cgi?id=103239
1154
1155         Reviewed by Dimitri Glazkov.
1156
1157         If the scoping elements of two declarations have an ancestor/
1158         descendant relationship, the declaration whose scoping element is
1159         the descendant should win.
1160         c.f. http://dev.w3.org/csswg/css3-cascade/#cascade
1161
1162         Test: fast/css/style-scoped/style-scoped-nested.html
1163               fast/css/style-scoped/style-scoped-with-important-rule.html
1164
1165         * css/RuleSet.cpp:
1166         (WebCore::RuleSet::addRule):
1167         Removed specificity for @host @-rules. Now @host @-rules use the
1168         cascading order instead.
1169         * css/RuleSet.h:
1170         Removed increaseSpecificity. The method is used by only @host @-rules.
1171         * css/StyleResolver.cpp:
1172         (WebCore::StyleResolver::matchScopedAuthorRules):
1173         (WebCore::StyleResolver::matchHostRules):
1174         (WebCore::StyleResolver::matchAuthorRules):
1175         Modified to invoke sortAndTransferMatchedRules per scoping element.
1176         The order of "matchXXXRules" must be the same as the cascading order.
1177         So matchHostRules was invoked after collecting all scoped author rules.
1178         * css/StyleScopeResolver.cpp:
1179         (WebCore::StyleScopeResolver::addHostRule):
1180         Removed RuleIsHostRule. We don't need the flag.
1181         * html/HTMLStyleElement.cpp:
1182         (WebCore::HTMLStyleElement::registerWithScopingNode):
1183         Needs to pass the last test case of style-scoped-nested.html.
1184         When appending some style element to a shadow root, we should recalc
1185         styles of all elements in the shadow dom tree. And if the style
1186         element has @host @-rules, we have to update the host's style.
1187
1188 2012-12-13  Filip Pizlo  <fpizlo@apple.com>
1189
1190         MediaPlayerPrivateAVFoundation::m_inbandTrackConfigurationPending is unused except when HAVE(AVFOUNDATION_TEXT_TRACK_SUPPORT)
1191         https://bugs.webkit.org/show_bug.cgi?id=104987
1192
1193         Rubber stamped by Michael Saboff.
1194
1195         No change in behavior so no new tests.
1196
1197         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1198         (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
1199         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1200         (MediaPlayerPrivateAVFoundation):
1201
1202 2012-12-13  Kentaro Hara  <haraken@chromium.org>
1203
1204         Unreviewed. Rebaselined run-bindings-tests results.
1205
1206         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1207         (JSTestCustomNamedGetter):
1208         * bindings/scripts/test/JS/JSTestEventTarget.h:
1209         (JSTestEventTarget):
1210
1211 2012-12-13  Yoshifumi Inoue  <yosin@chromium.org>
1212
1213         Unreviewed, rolling out r137691.
1214         http://trac.webkit.org/changeset/137691
1215         https://bugs.webkit.org/show_bug.cgi?id=104764
1216
1217         panscroll test on AppleWin failed
1218
1219         * CMakeLists.txt:
1220         * GNUmakefile.list.am:
1221         * Target.pri:
1222         * WebCore.gypi:
1223         * WebCore.vcproj/WebCore.vcproj:
1224         * WebCore.xcodeproj/project.pbxproj:
1225         * page/AutoscrollController.cpp: Removed.
1226         * page/AutoscrollController.h: Removed.
1227         * page/EventHandler.cpp:
1228         (WebCore):
1229         (WebCore::EventHandler::EventHandler):
1230         (WebCore::canAutoscroll):
1231         (WebCore::EventHandler::handleMouseDraggedEvent):
1232         (WebCore::EventHandler::handleMouseReleaseEvent):
1233         (WebCore::EventHandler::handleAutoscroll):
1234         (WebCore::EventHandler::autoscrollTimerFired):
1235         (WebCore::EventHandler::startPanScrolling):
1236         (WebCore::EventHandler::updatePanScrollState):
1237         (WebCore::EventHandler::autoscrollRenderer):
1238         (WebCore::EventHandler::updateAutoscrollRenderer):
1239         (WebCore::EventHandler::setAutoscrollRenderer):
1240         (WebCore::EventHandler::startAutoscrollTimer):
1241         (WebCore::EventHandler::stopAutoscrollTimer):
1242         (WebCore::EventHandler::selectCursor):
1243         (WebCore::EventHandler::handleMousePressEvent):
1244         (WebCore::EventHandler::keyEvent):
1245         * page/EventHandler.h:
1246         (EventHandler):
1247         (WebCore::EventHandler::autoscrollInProgress):
1248         * rendering/RenderBox.cpp:
1249         * rendering/RenderBox.h:
1250         (RenderBox):
1251
1252 2012-12-13  Kentaro Hara  <haraken@chromium.org>
1253
1254         ChildNodesLazySnapshot::nextNode() can crash
1255         https://bugs.webkit.org/show_bug.cgi?id=104982
1256
1257         Reviewed by Hajime Morita.
1258
1259         ChildNodesLazySnapshot::nextNode() can crash for
1260         fast/dom/insertedIntoDocument-no-crash.html.
1261         The root cause is that ChildNodesLazySnapshot::m_currentNode
1262         was not a RefPtr. This patch changes it to a RefPtr.
1263
1264         Test: fast/dom/insertedIntoDocument-no-crash.html
1265
1266         * dom/ContainerNode.h:
1267         (WebCore::ChildNodesLazySnapshot::nextNode):
1268         (WebCore::ChildNodesLazySnapshot::takeSnapshot):
1269         (ChildNodesLazySnapshot):
1270
1271 2012-12-13  Philip Rogers  <pdr@google.com>
1272
1273         Clear m_timeContainer on SVGSMILElement removal.
1274         https://bugs.webkit.org/show_bug.cgi?id=104972
1275
1276         Reviewed by Abhishek Arya.
1277
1278         This patch fixes a regression introduced by r137509 where we did not clear
1279         m_timeContainer in SVGSMILElement::removedFrom.
1280
1281         Test: svg/custom/removed-from-animation-crash.html
1282
1283         * svg/animation/SVGSMILElement.cpp:
1284         (WebCore::SVGSMILElement::removedFrom):
1285
1286 2012-12-13  Filip Pizlo  <fpizlo@apple.com>
1287
1288         Named lookups on HTML documents produce inconsistent results in JavaScriptCore bindings
1289         https://bugs.webkit.org/show_bug.cgi?id=104623
1290
1291         Reviewed by Geoffrey Garen.
1292
1293         All DOM objects that have named getters or directly override getOwnPropertySlot are now marked as
1294         HasImpureGetOwnPropertySlot.
1295
1296         Tests: fast/js/prototype-chain-caching-with-impure-get-own-property-slot-traps
1297                fast/js/dfg-prototype-chain-caching-with-impure-get-own-property-slot-traps
1298
1299         * bindings/scripts/CodeGeneratorJS.pm:
1300         (GenerateHeader):
1301
1302 2012-12-13  Xianzhu Wang  <wangxianzhu@chromium.org>
1303
1304         Out-of-view check of fixed position element in frame is incorrect when page is scaled
1305         https://bugs.webkit.org/show_bug.cgi?id=104943
1306
1307         Reviewed by Simon Fraser.
1308
1309         Use frameScaleFactor instead of pageScaleFactor to scale the layer bounds.
1310
1311         Tests: compositing/layer-creation/fixed-position-out-of-view-scaled-iframe-scroll.html
1312                compositing/layer-creation/fixed-position-out-of-view-scaled-iframe.html
1313
1314         * rendering/RenderLayerCompositor.cpp:
1315         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1316
1317 2012-12-13  Bear Travis  <betravis@adobe.com>
1318
1319         Positioned replaced elements should resolve vertical margins against their containing
1320         block's logical width
1321         https://bugs.webkit.org/show_bug.cgi?id=103579
1322
1323         Reviewed by Emil A Eklund.
1324
1325         According to the CSS box model & writing modes specifications, percentage margin
1326         & padding values, including top & bottom, should be resolved based on the
1327         containing block's logical width (logical with respect to the containing block's
1328         writing mode).
1329         http://www.w3.org/TR/CSS2/box.html#margin-properties
1330         http://dev.w3.org/csswg/css3-writing-modes/#dimension-mapping
1331
1332         Previously, a positioned replaced element resolved margin before/after relative to
1333         its inline direction (containerLogicalHeight), and margin start/end relative to
1334         its block direction (containerLogicalWidth). This patch measures the container's
1335         logical width in its own inline direction (containerRelativeLogicalWidth) to
1336         resolve all margin percentage values.
1337
1338         Test: fast/writing-mode/percentage-margins-absolute-replaced.html
1339
1340         * rendering/RenderBox.cpp:
1341         (WebCore::RenderBox::computePositionedLogicalWidthReplaced): Calculate the logical
1342         width of the container, and use it to calculate margins.
1343         (WebCore::RenderBox::computePositionedLogicalHeightReplaced): Ditto.
1344
1345 2012-12-13  Yoshifumi Inoue  <yosin@chromium.org>
1346
1347         Handling autoscroll in EventHandler should be re-factor
1348         https://bugs.webkit.org/show_bug.cgi?id=104764
1349
1350         Reviewed by Hajime Morita.
1351
1352         This patch introduces new class AutoscrollController for moving autoscroll
1353         and panscroll from EventHandler class for ease of maintenance of
1354         EventHandler and ease of adding autoscroll related features, e.g. autoscroll
1355         during drag-and-drop, autoscoll by gesture.
1356
1357         No new tests. This patch doesn't change behavior.
1358
1359         * CMakeLists.txt: Changed to add page/AutoscrollController.cpp
1360         * GNUmakefile.list.am:  Changed to add page/AutoscrollController.{cpp,h}
1361         * Target.pri:  Changed to add page/AutoscrollController.cpp
1362         * WebCore.gypi: Changed to add page/AutoscrollController.{cpp,h}
1363         * WebCore.vcproj/WebCore.vcproj: Changed to add page/AutoscrollController.{cpp,h}
1364         * WebCore.xcodeproj/project.pbxproj: Changed to add page/AutoscrollController.{cpp,h}
1365         * page/AutoscrollController.cpp: Added.
1366         (WebCore::getMainFrame): Helper function.
1367         (WebCore::AutoscrollController::AutoscrollController): Moved from EventHandler.
1368         (WebCore::AutoscrollController::autoscrollRenderer): Moved from EventHandler.
1369         (WebCore::AutoscrollController::autoscrollInProgress): Moved from EventHandler.
1370         (WebCore::AutoscrollController::startAutoscrollForSelection): Replacement of EventHandler::handleAutoscroll().
1371         (WebCore::AutoscrollController::stopAutoscrollTimer): Moveed from EventHandler.
1372         (WebCore::AutoscrollController::updateAutoscrollRenderer): ditto
1373         (WebCore::AutoscrollController::didPanScrollStart): Added for updating pan scrolling status of main frame.
1374         (WebCore::AutoscrollController::didPanScrollStop): ditto
1375         (WebCore::AutoscrollController::handleMouseReleaseEvent): Extracted from EventHandler.
1376         (WebCore::AutoscrollController::panScrollInProgress): Replacement of EventHandler::m_panScrollInProgress.
1377         (WebCore::AutoscrollController::startPanScrolling): Moved from EventHandler::startPanScrolling()
1378         (WebCore::AutoscrollController::autoscrollTimerFired): Moved from EventHandler::autoscrollTimerFired().
1379         (WebCore::AutoscrollController::startAutoscrollTimer): Moved from EventHandler::startAutoscrollTimer().
1380         (WebCore::AutoscrollController::updatePanScrollState): Moved from EventHandler::updatePanScrollState().
1381         * page/AutoscrollController.h: Added.
1382         (AutoscrollController):
1383         * page/EventHandler.cpp:
1384         (WebCore::EventHandler::EventHandler): Changed autoscroll and panscroll related member variable initializations to m_autoscrollController initialization.
1385         (WebCore::EventHandler::handleMouseDraggedEvent): Changed to call AutoscrollController::startAutoscrollForSelection().
1386         (WebCore::EventHandler::handleMouseReleaseEvent): Changed to remove m_autoscrollInProgress reference.
1387         (WebCore::EventHandler::didPanScrollStart): Added for updating pan scrolling status of main frame.
1388         (WebCore::EventHandler::didPanScrollStop): ditto
1389         (WebCore::EventHandler::startPanScrolling): Changed to call AutoscrollController::startPanScrolling().
1390         (WebCore::EventHandler::autoscrollRenderer): Changed to use AutoscrollController.
1391         (WebCore::EventHandler::updateAutoscrollRenderer): ditto
1392         (WebCore::EventHandler::autoscrollInProgress): ditto
1393         (WebCore::EventHandler::panScrollInProgress): Added to replace m_panScrollInProgress.
1394         (WebCore::EventHandler::stopAutoscrollTimer): Changed to use AutoscrollController.
1395         (WebCore::EventHandler::selectCursor): Changed to use panScrollInProgress().
1396         (WebCore::EventHandler::handleMousePressEvent): Chagned to call AutoscrollController::handleMousePressEvent().
1397         (WebCore::EventHandler::keyEvent): Changed to use panScrollInProgress().
1398         * page/EventHandler.h:
1399         (WebCore::EventHandler::autoscrollController): Added for using main frame's panScrollInProgress().
1400         (WebCore::EventHandler::mouseDownWasInSubframe): Added for AutoscrollController.
1401         * rendering/RenderBox.cpp:
1402         (WebCore::RenderBox::canAutoscroll): Moved from EventHandler.cpp.
1403         (WebCore::RenderBox::findAutoscrollable): Moved from EventHandler.cpp.
1404         * rendering/RenderBox.h:
1405         (RenderBox): Added new functions canAutoscroll() and findAutoscrollable().
1406
1407 2012-12-13  Beth Dakin  <bdakin@apple.com>
1408
1409         https://bugs.webkit.org/show_bug.cgi?id=102599
1410         ASSERT loading Acid3 test in run-safari --debug (r135050)
1411
1412         Reviewed by Simon Fraser.
1413
1414         New flag IncludeCompositedDescendants will always calculate the layer bounds for 
1415         descendants, even when the are composited. 
1416         * rendering/RenderLayer.cpp:
1417         (WebCore::RenderLayer::calculateLayerBounds):
1418         * rendering/RenderLayer.h:
1419
1420         calculateCompositedBounds() should not include this new flag, so instead of 
1421         calling that, call calculateLayerBounds() directly with the 
1422         IncludeCompositedDescendants flag. This will get us the information we need 
1423         upfront and avoid the toggling later on. 
1424         * rendering/RenderLayerCompositor.cpp:
1425         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1426
1427 2012-12-13  Tien-Ren Chen  <trchen@chromium.org>
1428
1429         Don't consider container nodes of other disambiguated nodes
1430         https://bugs.webkit.org/show_bug.cgi?id=104619
1431
1432         Reviewed by Eric Seidel.
1433
1434         It is not uncommon to have a clickable <div> that contains other clickable objects.
1435         This heuristic avoids excessive disambiguation in that case.
1436
1437         New unit test: WebFrameTest.DisambiguationPopupNoContainer
1438
1439         * page/TouchDisambiguation.cpp:
1440         (WebCore::findGoodTouchTargets):
1441
1442 2012-12-13  Adrienne Walker  <enne@chromium.org>
1443
1444         Unreviewed, rolling out r137645, r137646, and r137667.
1445         http://trac.webkit.org/changeset/137645
1446         http://trac.webkit.org/changeset/137646
1447         http://trac.webkit.org/changeset/137667
1448         https://bugs.webkit.org/show_bug.cgi?id=104911
1449
1450         Breaks some overflow layout tests
1451
1452         * rendering/RenderLayer.cpp:
1453         (WebCore::RenderLayer::RenderLayer):
1454         (WebCore::RenderLayer::updateDescendantDependentFlags):
1455         (WebCore::RenderLayer::addChild):
1456         (WebCore::RenderLayer::removeChild):
1457         (WebCore::RenderLayer::usesCompositedScrolling):
1458         (WebCore::RenderLayer::scrollTo):
1459         (WebCore::RenderLayer::dirtyZOrderLists):
1460         (WebCore::RenderLayer::dirtyNormalFlowList):
1461         (WebCore::RenderLayer::updateLayerListsIfNeeded):
1462         (WebCore::RenderLayer::shouldBeNormalFlowOnly):
1463         (WebCore::RenderLayer::shouldBeSelfPaintingLayer):
1464         (WebCore::RenderLayer::styleChanged):
1465         * rendering/RenderLayer.h:
1466         (RenderLayer):
1467         * rendering/RenderLayerBacking.cpp:
1468         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
1469         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
1470         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1471         * rendering/RenderLayerBacking.h:
1472         (RenderLayerBacking):
1473         * rendering/RenderLayerCompositor.cpp:
1474         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1475         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling):
1476         * rendering/RenderLayerCompositor.h:
1477         (RenderLayerCompositor):
1478         * testing/InternalSettings.cpp:
1479         * testing/InternalSettings.h:
1480         (InternalSettings):
1481         * testing/InternalSettings.idl:
1482
1483 2012-12-13  Andreas Kling  <akling@apple.com>
1484
1485         Event dispatch: Avoid heap allocations in ensureEventAncestors() typical case.
1486         <http://webkit.org/b/104938>
1487
1488         Reviewed by Anders Carlsson.
1489
1490         Give the EventTarget and EventContext vectors an inline capacity of 32 (no science here, just a
1491         non-zero number.) As these vectors are created on the stack already, this is merely using a bit
1492         more stack space to avoid malloc()ing all the gosh-darn time.
1493
1494         Looks like ~6% improvement on Dromaeo/jslib-event-prototype.
1495
1496         * dom/EventDispatcher.cpp:
1497         (WebCore::EventRelatedTargetAdjuster::adjust):
1498         (WebCore::EventRelatedTargetAdjuster::findRelatedTarget):
1499         (WebCore::EventDispatcher::ensureEventAncestors):
1500         * dom/EventDispatcher.h:
1501         (EventRelatedTargetAdjuster):
1502         (EventDispatcher):
1503
1504 2012-12-13  James Simonsen  <simonjam@chromium.org>
1505
1506         [Resource Timing] Don't report resources with data: urls
1507         https://bugs.webkit.org/show_bug.cgi?id=104868
1508
1509         Reviewed by Tony Gentilcore.
1510
1511         Test: http/tests/w3c/webperf/submission/resource-timing/html/test_resource_ignore_data_url.html
1512
1513         * loader/cache/CachedResourceLoader.cpp:
1514         (WebCore::CachedResourceLoader::loadDone):
1515
1516 2012-12-13  Ian Vollick  <vollick@chromium.org>
1517
1518         Add a missing nullity check in RenderObject::containingBlock
1519         https://bugs.webkit.org/show_bug.cgi?id=104961
1520
1521         Reviewed by Adrienne Walker.
1522
1523         Adds a missing nullity check in an assert.
1524
1525         No new tests, no change in functionality.
1526
1527         * rendering/RenderObject.cpp:
1528         (WebCore::RenderObject::containingBlock):
1529
1530 2012-12-13  Tab Atkins  <tabatkins@google.com>
1531
1532         Switch the gradient drawing code to use bearing angles
1533         https://bugs.webkit.org/show_bug.cgi?id=104616
1534
1535         Reviewed by Dean Jackson.
1536
1537         Switch the gradient math from polar-coordinate angles to bearing angles.
1538         To make this possible without behavior changes, 
1539         switch the m_deprecatedType boolean to an m_gradientType enum,
1540         and fix all usages accordingly.
1541
1542         No new tests, as this is a refactoring and should have no behavior changes. Existing tests suffice.
1543
1544         * css/CSSGradientValue.cpp:
1545         (WebCore::endPointsFromAngle):
1546         This is the only mechanical change. The rest are just fixing the plumbing around the boolean->enum change.
1547
1548         * css/CSSGradientValue.cpp:
1549         (WebCore::CSSGradientValue::sortStopsIfNeeded):
1550         (WebCore::CSSGradientValue::addStops):
1551         (WebCore::CSSLinearGradientValue::customCssText):
1552         (WebCore::CSSLinearGradientValue::createGradient):
1553         (WebCore::CSSRadialGradientValue::customCssText):
1554         * css/CSSGradientValue.h:
1555         (WebCore::CSSGradientValue::gradientType):
1556         (WebCore::CSSGradientValue::CSSGradientValue):
1557         (WebCore::CSSLinearGradientValue::create):
1558         (WebCore::CSSLinearGradientValue::CSSLinearGradientValue):
1559         (WebCore::CSSRadialGradientValue::create):
1560         (WebCore::CSSRadialGradientValue::CSSRadialGradientValue):
1561         * css/CSSParser.cpp:
1562         (WebCore::CSSParser::parseDeprecatedGradient):
1563         (WebCore::CSSParser::parseDeprecatedLinearGradient):
1564         (WebCore::CSSParser::parseDeprecatedRadialGradient):
1565
1566 2012-12-13  Ian Vollick  <vollick@chromium.org>
1567
1568         [chromium] Automatically use composited scrolling
1569         https://bugs.webkit.org/show_bug.cgi?id=94743
1570
1571         Reviewed by Adrienne Walker.
1572
1573         We currently use the composited scrolling facilities provided by
1574         wkb.ug/91117 if the overflow scroll block element is styled with
1575         -webkit-overflow-scrolling: touch. Ideally, we could automatically
1576         opt into composited scrolling if it is safe to do so. This can affect
1577         antialiasing, so it is important that automatically opting in is only
1578         enabled via a setting.
1579
1580         The way I determine if it is safe is by checking that z-ordering will
1581         not be affected if the overflow scrollable element were promoted to a
1582         stacking context (details below), and that clipping our scrolling
1583         descendants will not affect rendering.
1584
1585         To check the first condition (that z-ordering will not be affected).
1586         I ensure that the candidate element and all its descendants appear as a 
1587         continuous block in the candidate's stacking context. That is, if no 
1588         other elements are 'between' any of the candidates descendants when we
1589         sort in paint order, then we're safe. This is overly conservative,
1590         however. We could, in future, only consider stacking problems between
1591         elements that actually overlap.
1592
1593         To ensure that clipping will not cause a rendering change, I ensure
1594         that the layer has no out of flow positioned descendant whose
1595         containing block is not also a descendant of ours.
1596
1597         Test: compositing/overflow/automatically-opt-into-compositing-scrolling.html
1598
1599         (WebCore):
1600         * rendering/RenderLayer.cpp:
1601         (WebCore::RenderLayer::RenderLayer):
1602         (WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled):
1603         (WebCore):
1604         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
1605         (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrderRecursive):
1606         (WebCore::RenderLayer::positionOverflowControlsAfterPromotionToCompositedScrolling):
1607         (WebCore::RenderLayer::canSafelyEstablishAStackingContext):
1608           Returns true if the RenderLayer could become a stacking context without
1609           affecting the stacking order.
1610         (WebCore::RenderLayer::updateDescendantDependentFlags):
1611           We now need to keep track of out of flow positioned descendants.
1612         (WebCore::RenderLayer::addChild):
1613         (WebCore::RenderLayer::removeChild):
1614         (WebCore::RenderLayer::usesCompositedScrolling):
1615           Has been updated to return true if it can safely establish a stacking
1616           context, and the setting is turned on.
1617         (WebCore::RenderLayer::needsCompositedScrolling):
1618           This function returns true if we would like to use composited
1619           scrolling.
1620         (WebCore::RenderLayer::updateNeedsCompositedScrolling):
1621         (WebCore::RenderLayer::scrollTo):
1622         (WebCore::RenderLayer::dirtyZOrderLists):
1623         (WebCore::RenderLayer::dirtyNormalFlowList):
1624           Since these could affect opting into composited scrolling, we must
1625           request that the RenderLayerCompositor reevaluate compositing.
1626         (WebCore::RenderLayer::updateLayerListsIfNeeded):
1627           We call updateCanSafelyEstablishStackingContext here, if necessary.
1628         (WebCore::RenderLayer::shouldBeNormalFlowOnly):
1629         (WebCore::RenderLayer::shouldBeSelfPaintingLayer):
1630           usesCompositedScrolling -> needsCompositedScrolling
1631         (WebCore::RenderLayer::setAncestorChainHasOutOfFlowPositionedDescendant):
1632         (WebCore::RenderLayer::dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus):
1633         (WebCore::RenderLayer::updateOutOfFlowPositioned):
1634           Dirties and sets the out of flow positioned descendant state.
1635         (WebCore::RenderLayer::styleChanged):
1636         * rendering/RenderLayer.h:
1637         (RenderLayer):
1638         (WebCore::RenderLayer::hasOutOfFlowPositionedDescendant):
1639         * rendering/RenderLayerBacking.cpp:
1640         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
1641         (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
1642         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
1643         (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers):
1644         (WebCore):
1645         * rendering/RenderLayerBacking.h:
1646         (RenderLayerBacking):
1647         * rendering/RenderLayerCompositor.cpp:
1648         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1649           We now ensure that newly created overflow scroll controls get
1650           positioned.
1651         (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling):
1652         * rendering/RenderLayerCompositor.h:
1653         (WebCore::RenderLayerCompositor::setShouldReevaluateCompositingAfterLayout):
1654         * testing/InternalSettings.cpp:
1655         (WebCore::InternalSettings::setEnableCompositingForOverflowScroll):
1656           Allows enabling the setting in layout tests.
1657         (WebCore):
1658         * testing/InternalSettings.h:
1659         (InternalSettings):
1660         * testing/InternalSettings.idl:
1661
1662 2012-12-13  Ryosuke Niwa  <rniwa@webkit.org>
1663
1664         REGRESSION(r137406): NodeTraversal changes causing large renderer crash
1665         https://bugs.webkit.org/show_bug.cgi?id=104937
1666
1667         Reviewed by Antti Koivisto.
1668
1669         Add a null pointer check to exit early since ElementTraversal::next assumes a non-null pointer.
1670
1671         No new tests since I don't think this function is ever exposed to any ES5 bindings.
1672
1673         * editing/FrameSelection.cpp:
1674         (WebCore::scanForForm):
1675
1676 2012-12-13  David Grogan  <dgrogan@chromium.org>
1677
1678         IndexedDB: Improve error messages
1679         https://bugs.webkit.org/show_bug.cgi?id=104624
1680
1681         Reviewed by Tony Chang.
1682
1683         Add detail to error messages so that they are more helpful and can be
1684         traced back to a specific line of code.
1685
1686         Updated test: transaction-error.html
1687
1688         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
1689         (WebCore::IDBDatabaseBackendImpl::CreateObjectStoreOperation::perform):
1690         (WebCore::IDBDatabaseBackendImpl::DeleteObjectStoreOperation::perform):
1691         (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
1692         (WebCore::IDBDatabaseBackendImpl::openConnection):
1693         (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
1694         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
1695         (WebCore::IDBDatabaseBackendImpl::close):
1696         * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
1697         (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
1698         (WebCore::IDBFactoryBackendImpl::deleteDatabase):
1699         (WebCore::IDBFactoryBackendImpl::open):
1700         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
1701         (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
1702         (WebCore::IDBObjectStoreBackendImpl::createIndex):
1703         (WebCore::IDBObjectStoreBackendImpl::CreateIndexOperation::perform):
1704         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
1705         (WebCore::IDBTransactionBackendImpl::abort):
1706         (WebCore::IDBTransactionBackendImpl::commit):
1707
1708 2012-12-13  Claudio Saavedra  <csaavedra@igalia.com>
1709
1710         [GTK] Safeguard against possible NULL-dereference
1711         https://bugs.webkit.org/show_bug.cgi?id=104931
1712
1713         Reviewed by Chris Fleizach.
1714
1715         This was spotted by Coverity. See bug 104114.
1716
1717         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1718         (webkitAccessibleGetIndexInParent): If parent is NULL
1719         bail out early.
1720
1721 2012-12-13  David Barton  <dbarton@mathscribe.com>
1722
1723         Heap-use-after-free in WebCore::RenderBlock::finishDelayUpdateScrollInfo
1724         https://bugs.webkit.org/show_bug.cgi?id=103750
1725
1726         Reviewed by Tony Chang.
1727
1728         MathML sometimes creates and destroys renderers for descendants during layout (or even to calculate
1729         preferred logical widths), e.g. for operator stretching. RenderBlock::finishDelayUpdateScrollInfo
1730         must therefore leave gDelayedUpdateScrollInfoSet intact as it iterates over it, so
1731         RenderBlock::willBeDestroyed can call gDelayedUpdateScrollInfoSet->remove(this) effectively if needed.
1732         This also prevents duplicate entries from being added to gDelayedUpdateScrollInfoSet.
1733
1734         Test: mathml/mo-stretch-crash.html
1735
1736         * rendering/RenderBlock.cpp:
1737         (WebCore::RenderBlock::startDelayUpdateScrollInfo):
1738             - Allow gDelayedUpdateScrollInfoSet to be non-null when gDelayUpdateScrollInfo is 0 during
1739               RenderBlock::finishDelayUpdateScrollInfo.
1740         (WebCore::RenderBlock::finishDelayUpdateScrollInfo):
1741             - Remove blocks from gDelayedUpdateScrollInfoSet one at a time, waiting for each block until it is
1742               about to be updated.
1743
1744 2012-12-13  Alexey Proskuryakov  <ap@apple.com>
1745
1746         <rdar://problem/12838354> Per-Tab WebProcess: DOM cookie access functions should respect private browsing
1747         https://bugs.webkit.org/show_bug.cgi?id=104691
1748
1749         Reviewed by Sam Weinig.
1750
1751         * platform/network/NetworkingContext.h: Added a function that returns current
1752         context type. Ideally, we would track contexts across processes in a generic manner,
1753         but we only have two now, and don't need such complications.
1754
1755 2012-12-13  Alexey Proskuryakov  <ap@apple.com>
1756
1757         ResourceLoader::didReceiveAuthenticationChallenge uses a wrong client
1758         https://bugs.webkit.org/show_bug.cgi?id=104935
1759         <rdar://problem/12870361>
1760
1761         Reviewed by Anders Carlsson.
1762
1763         * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
1764         The handle is null when NetworkProcess is used. In any case, it should be correct
1765         to use the client carried within AuthenticationChallenge.
1766
1767 2012-12-13  Stephen White  <senorblanco@chromium.org>
1768
1769         CanvasRenderingContext2D::setFont() is slow.
1770         https://bugs.webkit.org/show_bug.cgi?id=104923
1771
1772         Reviewed by James Robinson.
1773
1774         This spends most of its time in the CSS parser.  As a first step,
1775         early-out if the new value is the same as unparsed string for the current font.
1776         See also http://code.google.com/p/chromium/issues/detail?id=164016.
1777
1778         Covered by existing tests in canvas/ and fast/canvas, and ManualTests/canvas-font-speed.html.
1779
1780         * html/canvas/CanvasRenderingContext2D.cpp:
1781         (WebCore::CanvasRenderingContext2D::setFont):
1782
1783 2012-12-13  Parth Patel  <parpatel@rim.com>, Max Feil <mfeil@rim.com>
1784
1785         Allow plugins to be disabled by shared library filename
1786         https://bugs.webkit.org/show_bug.cgi?id=101274
1787
1788         Reviewed by Antonio Gomes.
1789
1790         This fix makes PluginDatabase changes general so that other ports
1791         can use this mechanism if they wish.
1792
1793         Layout test not included with this patch because there
1794         is currently no framework within LayoutTests to allow calls
1795         from an external application via platform API code (such as the
1796         WebView API).
1797
1798         * plugins/PluginDatabase.cpp:
1799         (WebCore::PluginDatabase::fileExistsAndIsNotDisabled):
1800         (WebCore):
1801         (WebCore::PluginDatabase::getDeletedPlugins):
1802         (WebCore::PluginDatabase::removeDisabledPluginFile):
1803         (WebCore::PluginDatabase::addDisabledPluginFile):
1804         (WebCore::PluginDatabase::getPluginPathsInDirectories):
1805         * plugins/PluginDatabase.h:
1806         (PluginDatabase):
1807
1808 2012-12-13  Yongjun Zhang  <yongjun_zhang@apple.com>
1809
1810         Document will never be released when an Image is created inside unload event listener
1811         https://bugs.webkit.org/show_bug.cgi?id=104830
1812
1813         Reviewed by Darin Adler.
1814
1815         When setting src attribute to an Image object inside unload event listener, ImageLoader will
1816         mark it as load failure (by setting m_hasPendingErrorEvent to true) and the following call
1817         to updatedHasPendingEvent will ref the element but won't be deref-ed since the Document is
1818         being dismissed.  This was introduced in r131670.  To match pre r131670 behavior, we shouldn't
1819         trigger error event for image loading when the page is being dismissed.
1820
1821         No new tests, there is no visual change.  Manually tested to verify documents are released by
1822         using heap in Mac OS X.
1823
1824         * loader/ImageLoader.cpp:
1825         (WebCore::pageIsBeingDismissed): add a helper function to test whether the page is being dismissed.
1826         (WebCore::ImageLoader::updateFromElement): don't trigger error event if the page is being dismissed.
1827
1828 2012-12-13  Claudio Saavedra  <csaavedra@igalia.com>
1829
1830         [GTK] Add missing breaks in switch-case statements
1831         https://bugs.webkit.org/show_bug.cgi?id=104929
1832
1833         Reviewed by Martin Robinson.
1834
1835         * platform/gtk/ClipboardGtk.cpp:
1836         (WebCore::ClipboardGtk::clearData): Add missing breaks.
1837
1838 2012-12-13  Nate Chapin  <japhet@chromium.org>
1839
1840         Route main resource loads through the memory cache.
1841         https://bugs.webkit.org/show_bug.cgi?id=49246
1842
1843         Reviewed by Alexey Proskuryakov.
1844
1845         Note that this patch doesn't actually enable caching of main resources. That will be done in a later patch.
1846         The MainResourceLoader actually has an underlying SubresourceLoader (with the cache layer between them).
1847         In several places, the MainResourceLoader's SubresourceLoader is treated as special.
1848
1849         No new tests, as this is primarily a refactor. A couple of expected results changed slightly.
1850
1851         * loader/DocumentLoader.cpp:
1852         (WebCore::DocumentLoader::setRequest):
1853         (WebCore::DocumentLoader::subresource):
1854         (WebCore::DocumentLoader::addSubresourceLoader): Because the SubresourceLoader underlying the main resource
1855             needs special handling in certain cases, track it separately from the real SubresourceLoaders.
1856         (WebCore::DocumentLoader::removeSubresourceLoader):
1857         (WebCore::DocumentLoader::startLoadingMainResource):
1858         * loader/MainResourceLoader.cpp:
1859         (WebCore::MainResourceLoader::MainResourceLoader):
1860         (WebCore::MainResourceLoader::receivedError):
1861         (WebCore::MainResourceLoader::cancel):
1862         (WebCore::MainResourceLoader::clearResource):
1863         (WebCore):
1864         (WebCore::MainResourceLoader::frameLoader):
1865         (WebCore::MainResourceLoader::request):
1866         (WebCore::MainResourceLoader::continueAfterNavigationPolicy):
1867         (WebCore::MainResourceLoader::resourceData):
1868         (WebCore::MainResourceLoader::redirectReceived):
1869         (WebCore::MainResourceLoader::willSendRequest):
1870         (WebCore::MainResourceLoader::continueAfterContentPolicy):
1871         (WebCore::MainResourceLoader::responseReceived):
1872         (WebCore::MainResourceLoader::dataReceived):
1873         (WebCore::MainResourceLoader::didFinishLoading):
1874         (WebCore::MainResourceLoader::notifyFinished):
1875         (WebCore::MainResourceLoader::reportMemoryUsage):
1876         (WebCore::MainResourceLoader::handleSubstituteDataLoadNow):
1877         (WebCore::MainResourceLoader::load):
1878         (WebCore::MainResourceLoader::setDefersLoading):
1879         (WebCore::MainResourceLoader::defersLoading):
1880         (WebCore::MainResourceLoader::setShouldBufferData):
1881         (WebCore::MainResourceLoader::loader):
1882         (WebCore::MainResourceLoader::identifier):
1883         * loader/MainResourceLoader.h:
1884         (MainResourceLoader):
1885         (WebCore::MainResourceLoader::documentLoader):
1886         * loader/ResourceLoader.cpp:
1887         (WebCore::ResourceLoader::willSendRequest):
1888         * loader/ResourceLoader.h:
1889         (WebCore::ResourceLoader::defersLoading):
1890         (WebCore::ResourceLoader::cancelled):
1891         * loader/appcache/ApplicationCacheHost.cpp:
1892         (WebCore::ApplicationCacheHost::maybeLoadFallbackForMainResponse):
1893         (WebCore::ApplicationCacheHost::maybeLoadFallbackForMainError):
1894         * loader/mac/DocumentLoaderMac.cpp:
1895         (WebCore::DocumentLoader::schedule):
1896         (WebCore::DocumentLoader::unschedule):
1897
1898 2012-12-13  Pratik Solanki  <psolanki@apple.com>
1899
1900         Duplicate code in GraphicsContext3D::validateAttributes() and GraphicsContext3D::validateDepthStencil()
1901         https://bugs.webkit.org/show_bug.cgi?id=97275
1902
1903         Reviewed by Dean Jackson.
1904
1905         Remove duplicate code in validateAttributes(). validateAttributes() calls
1906         validateDepthStencil() which has the exact same code.
1907
1908         No new tests because no change in functionality.
1909
1910         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1911         (WebCore::GraphicsContext3D::validateAttributes):
1912
1913 2012-12-13  Nate Chapin  <japhet@chromium.org>
1914
1915         CachedResources should hang on to stripped fragment identifiers
1916         https://bugs.webkit.org/show_bug.cgi?id=104721
1917
1918         Reviewed by Maciej Stachowiak.
1919
1920         No new tests, this will be unused until bug
1921         https://bugs.webkit.org/show_bug.cgi?id=49246 re-lands. Then, it will
1922         allow http/tests/inspector/resource-parameters.html to continue passing.
1923
1924         * loader/cache/CachedResource.cpp:
1925         (WebCore::CachedResource::CachedResource):
1926         (WebCore::CachedResource::load):
1927         * loader/cache/CachedResource.h:
1928         (CachedResource):
1929         * loader/cache/CachedResourceLoader.cpp:
1930         (WebCore::CachedResourceLoader::requestResource): We override the request's url with the
1931             local variable "url" here. The only difference between url and request.url() is that url
1932             has had any fragment identifier removed. Do this work later (in the CachedResource constructor)
1933             so that the CachedResource can save the fragment for later.
1934
1935 2012-12-13  Claudio Saavedra  <csaavedra@igalia.com>
1936
1937         [GTK] Remove deprecated API usage
1938         https://bugs.webkit.org/show_bug.cgi?id=104894
1939
1940         Reviewed by Martin Robinson.
1941
1942         Remove deprecated GTK+ API usage.
1943
1944         * platform/gtk/RenderThemeGtk3.cpp:
1945         (WebCore::spinButtonArrowSize): Do not use deprecated
1946         gtk_style_context_get_font().
1947
1948 2012-12-13  Zeno Albisser  <zeno@webkit.org>
1949
1950         [Qt] Remove temporary workaround from GraphicsSurfaceGLX constructor.
1951         https://bugs.webkit.org/show_bug.cgi?id=104904
1952
1953         QXcbNativeInterface::nativeResourceForContext() is now
1954         available in Qt5. Therefore the temporary workaround
1955         in GraphicsSurfaceGLX can be removed.
1956
1957         Reviewed by Kenneth Rohde Christiansen.
1958
1959         * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
1960         (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
1961
1962 2012-12-13  Joanmarie Diggs  <jdiggs@igalia.com>
1963
1964         [GTK] Expose ARIA roles for tab, tabpanel and tablist
1965         https://bugs.webkit.org/show_bug.cgi?id=84043
1966
1967         Reviewed by Martin Robinson.
1968
1969         Mapped the ARIA roles to their corresponding ATK roles.
1970
1971         No new tests; instead unskipped the associated test.
1972
1973         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1974         (atkRole): Mapped the ARIA roles to their corresponding ATK roles
1975
1976 2012-12-13  Vivek Galatage  <vivek.vg@samsung.com>
1977
1978         Web Inspector: "Add Attribute" context menu on closing tag should apply on the opening tag on Elements Panel
1979         https://bugs.webkit.org/show_bug.cgi?id=104902
1980
1981         Reviewed by Alexander Pavlov.
1982
1983         The context menu action on the closing tag scrolls to the opening tag for adding the attribute.
1984
1985         No new tests as this is a UI change.
1986
1987         * inspector/front-end/ElementsTreeOutline.js:
1988         (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
1989         (WebInspector.ElementsTreeElement.prototype._addNewAttribute):
1990
1991 2012-12-13  Sheriff Bot  <webkit.review.bot@gmail.com>
1992
1993         Unreviewed, rolling out r137512.
1994         http://trac.webkit.org/changeset/137512
1995         https://bugs.webkit.org/show_bug.cgi?id=104912
1996
1997         The entire GTK+ layout test step has been failing for hours
1998         (Requested by mrobinson on #webkit).
1999
2000         * accessibility/AccessibilityNodeObject.cpp:
2001         (WebCore::AccessibilityNodeObject::textUnderElement):
2002         * accessibility/AccessibilityRenderObject.cpp:
2003         (WebCore::AccessibilityRenderObject::textUnderElement):
2004
2005 2012-12-13  Tamas Czene  <tczene@inf.u-szeged.hu>
2006
2007         OpenCL version of FEColorMatrix.
2008         https://bugs.webkit.org/show_bug.cgi?id=103398
2009
2010         Reviewed by Zoltan Herczeg.
2011
2012         ~3x speed-up (depending on hardware configuration)
2013
2014         * Target.pri: Added a new file to the build system.
2015         * platform/graphics/filters/FEColorMatrix.cpp: calculateSaturateComponents and calculateHueRotateComponents methodes are moved to the header, since they are used by OpenCL as well
2016         (WebCore::effectType):
2017         * platform/graphics/filters/FEColorMatrix.h:
2018         (FEColorMatrix):
2019         (WebCore::FEColorMatrix::calculateSaturateComponents):
2020         (WebCore):
2021         (WebCore::FEColorMatrix::calculateHueRotateComponents):
2022         * platform/graphics/gpu/opencl/FilterContextOpenCL.h: Required fields for the ColorMatrix kernels were added
2023         (WebCore::FilterContextOpenCL::FilterContextOpenCL):
2024         (FilterContextOpenCL):
2025         * platform/graphics/gpu/opencl/OpenCLFEColorMatrix.cpp: the core implementation goes here
2026         (WebCore):
2027         (WebCore::FilterContextOpenCL::compileFEColorMatrix):
2028         (WebCore::FilterContextOpenCL::applyFEColorMatrix):
2029         (WebCore::FEColorMatrix::platformApplyOpenCL):
2030
2031 2012-12-13  Ilya Tikhonovsky  <loislo@chromium.org>
2032
2033         Web Inspector: Native Memory Instrumentation: do not validate pointers to objects in RenderArena agains tcmalloc data.
2034         https://bugs.webkit.org/show_bug.cgi?id=104903
2035
2036         Reviewed by Yury Semikhatsky.
2037
2038         This is a simplest approach to do that with zero performance overhead.
2039
2040         * inspector/InspectorResourceAgent.cpp:
2041         (WebCore::InspectorResourceAgent::reportMemoryUsage):
2042         * rendering/InlineBox.cpp:
2043         (WebCore::InlineBox::reportMemoryUsage):
2044         (WebCore):
2045         * rendering/InlineBox.h:
2046         (InlineBox):
2047         * rendering/InlineTextBox.cpp:
2048         (WebCore::InlineTextBox::reportMemoryUsage):
2049         (WebCore):
2050         * rendering/InlineTextBox.h:
2051         (InlineTextBox):
2052         * rendering/RenderLayer.cpp:
2053         (WebCore::RenderLayer::reportMemoryUsage):
2054         * rendering/RenderObject.cpp:
2055         (WebCore::RenderObject::reportMemoryUsage):
2056
2057 2012-12-13  Alberto Garcia  <agarcia@igalia.com>
2058
2059         [GTK] Don't leak GStaticRecMutex
2060         https://bugs.webkit.org/show_bug.cgi?id=104901
2061
2062         Reviewed by Martin Robinson.
2063
2064         The mutex in WebKitWebAudioSourceGStreamer is allocated using
2065         g_new(), but that memory is not freed when the object is
2066         destroyed.
2067
2068         This patch replaces that pointer with the structure itself, which
2069         is faster and doesn't need to be explicitly freed.
2070
2071         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2072         (_WebKitWebAudioSourcePrivate):
2073         (webkit_web_audio_src_init):
2074         (webKitWebAudioSrcFinalize):
2075
2076 2012-12-13  Eugene Klyuchnikov  <eustas@chromium.org>
2077
2078         Web Inspector: Network: Sorting cookies by size is broken.
2079         https://bugs.webkit.org/show_bug.cgi?id=104893
2080
2081         Reviewed by Alexander Pavlov.
2082
2083         Problem: cookie "size" is not a field now; its value is accessible
2084         through getter method.
2085
2086         Solution: make cookie fields uniformly accessible (add getters for name,
2087         type and value).
2088
2089         * inspector/front-end/CookieItemsView.js: Adopt changes.
2090         * inspector/front-end/CookieParser.js:
2091         (WebInspector.Cookie): Refine JsDoc.
2092         (WebInspector.Cookie.prototype.name): Added getter.
2093         (WebInspector.Cookie.prototype.value): Ditto.
2094         (WebInspector.Cookie.prototype.type): Ditto.
2095         (WebInspector.Cookies.buildCookiesFromString): Adopt changes.
2096         (WebInspector.Cookies.buildCookieProtocolObject): Ditto.
2097         * inspector/front-end/CookiesTable.js:
2098         (WebInspector.CookiesTable): Remove unused parameter.
2099         (WebInspector.CookiesTable.prototype._sortCookies):
2100         Use getters instead of field names.
2101         (WebInspector.CookiesTable.prototype._createGridNode): Adopt changes.
2102         * inspector/front-end/HAREntry.js: Ditto.
2103         * inspector/front-end/RequestCookiesView.js: Ditto.
2104
2105 2012-12-13  Kentaro Hara  <haraken@chromium.org>
2106
2107         Unreviewed, rolling out r137569.
2108         http://trac.webkit.org/changeset/137569
2109         https://bugs.webkit.org/show_bug.cgi?id=104876
2110
2111         A bunch of CSS tests hit ASSERTs
2112
2113         * css/CSSProperty.h:
2114         (WebCore::CSSProperty::CSSProperty):
2115
2116 2012-12-13  Byungwoo Lee  <bw80.lee@samsung.com>
2117
2118         [EFL] Remove redundant pipe write to prevent pipe buffer full.
2119         https://bugs.webkit.org/show_bug.cgi?id=101135
2120
2121         Reviewed by Gyuyoung Kim.
2122
2123         To prevent a source of a deadlock, remove the redundant pipe write
2124         in wakeUp() function.
2125
2126         EFL uses ecore_pipe_write() to wake up main run loop, and the function
2127         uses POSIX pipe write with O_NONBLOCK disabled.
2128         With O_NONBLOCK disabled, when written data is more than PIPE_BUF,
2129         pipe write will be blocked until it can be written.
2130
2131         Currently, every wakeUp() function calls ecore_pipe_write() to invoke
2132         wakeUpEvent() callback. And this can make pipe buffer full status
2133         which is the one reason of the lockup problem described in Bug 99494.
2134
2135         * platform/RunLoop.h:
2136         (RunLoop):
2137         * platform/efl/RunLoopEfl.cpp:
2138         (WebCore::RunLoop::RunLoop):
2139         (WebCore::RunLoop::wakeUpEvent):
2140         (WebCore::RunLoop::wakeUp):
2141
2142 2012-12-13  Antti Harju  <antti.harju@ixonos.com>
2143
2144         [Qt] Fix deleteAllCookies() invalid SQL statement
2145         https://bugs.webkit.org/show_bug.cgi?id=101580
2146
2147         Reviewed by Jocelyn Turcotte.
2148
2149         * platform/network/qt/CookieJarQt.cpp:
2150         (WebCore::SharedCookieJarQt::deleteAllCookies):
2151
2152 2012-12-13  Ryosuke Niwa  <rniwa@webkit.org>
2153
2154         Safari spends a lot of time in WebCore::findSimpleWordBoundary while selecting text on large scrabutility.com page
2155         https://bugs.webkit.org/show_bug.cgi?id=104884
2156
2157         Reviewed by Hajime Morita.
2158
2159         We don't need to do anything in AlternativeTextController if selection is already outside of the editable region.
2160
2161         No new tests are added since this is only a performance improvement, and doesn't change any asymptotic behavior.
2162
2163         * editing/AlternativeTextController.cpp:
2164         (WebCore::AlternativeTextController::respondToChangedSelection):
2165
2166 2012-12-12  Jon Lee  <jonlee@apple.com>
2167
2168         Crash in PlugInOriginHash with empty MIME type (104882)
2169         https://bugs.webkit.org/show_bug.cgi?id=104882
2170         <rdar://problem/12872298>
2171
2172         Reviewed by Filip Pizlo.
2173
2174         The crash occurs because the strings might be null. Add a check for it, but also try to infer a MIME type
2175         in case the markup does not include a type attribute, but we can find it from the extension in the URL.
2176
2177         * platform/KURL.cpp: Add a new function mimeTypeFromURL() which tries to return the implied MIME type
2178         based on the URL provided. If nothing was found, return a null string.
2179         (WebCore::mimeTypeFromURL): Factored out from FrameLoader::defaultObjectContentType().
2180         * platform/KURL.h:
2181
2182         * loader/FrameLoader.cpp:
2183         (WebCore::FrameLoader::defaultObjectContentType): Refactor to use mimeTypeFromURL().
2184         * plugins/PlugInOriginHash.cpp:
2185         (WebCore::addCaseFoldedCharacters): Add a check for an empty string.
2186         (WebCore::PlugInOriginHash::hash): If the service type is empty, try to infer the MIME type.
2187
2188 2012-12-13  Christophe Dumez  <christophe.dumez@intel.com>
2189
2190         Regression(r137486): Broke EFL build
2191         https://bugs.webkit.org/show_bug.cgi?id=104883
2192
2193         Unreviewed EFL build fix.
2194
2195         Fix EFL build break after r137486 due to missing WebCore::
2196         namespace.
2197
2198         No new tests, no behavior change for layout tests.
2199
2200         * platform/NotImplemented.h:
2201
2202 2012-12-07  Levi Weintraub  <leviw@chromium.org>
2203
2204         Add support for tracking hit test rectangles to enable fast event rejection in the compositor
2205         https://bugs.webkit.org/show_bug.cgi?id=103914
2206
2207         Reviewed by Simon Fraser.
2208
2209         Adding support for tracking hit test target regions for the purpose of performing initial hit testing
2210         in the compositor to avoid blocking scrolling on the main thread while waiting to hit test events that
2211         aren't occuring in regions with handlers. This is initially being done to avoid having to go to the main
2212         thread when scrolling by flicking on touch devices when the flick occurs outside a tracked touch event
2213         region. This patch includes the implementation to turn this on in Chromium.
2214
2215         To accomplish this goal, Document will now keep a counted hash set of nodes with touch event handlers
2216         instead of only an unsigned integer of the total count. ScrollingCoordinator then updates the compositor
2217         when new touch event handlers are registered or removed, or after layout much like how
2218         nonFastScrollableRegions are currently tracked.
2219
2220         This implementation will not properly update the hit test rects when the renderers are inside a sub-
2221         tree that scrolls.
2222
2223         Test: platform/chromium/fast/events/touch/compositor-touch-hit-rects.html
2224
2225         * dom/Document.cpp:
2226         (WebCore::Document::Document): Added a HashCountedSet of touch target nodes. Note: DOMWindow targets
2227         are stored as the Document they point to.
2228         (WebCore::Document::didAddTouchEventHandler): Changed to keep track of the handler instead of a count, and
2229         to update the ScrollingCoordinator with the change.
2230         (WebCore::Document::didRemoveTouchEventHandler): Ditto.
2231         * dom/Document.h:
2232         (WebCore::Document::hasTouchEventHandlers): It's no longer O(1) to get the count of touch handlers, so
2233         expose whether there are any or not.
2234         (WebCore::Document::touchEventTargets):
2235         * dom/Node.cpp:
2236         (WebCore::Node::didMoveToNewDocument):
2237         (WebCore::tryAddEventListener):
2238         (WebCore::tryRemoveEventListener):
2239         * history/CachedFrame.cpp:
2240         (WebCore::CachedFrameBase::restore):
2241         * html/HTMLInputElement.cpp:
2242         (WebCore::HTMLInputElement::~HTMLInputElement):
2243         (WebCore::HTMLInputElement::updateType):
2244         * page/DOMWindow.cpp:
2245         (WebCore::DOMWindow::addEventListener): Add the Document to the touch target set instead of DOMWindow.
2246         (WebCore::DOMWindow::removeEventListener):
2247         * page/EventHandler.cpp:
2248         (WebCore::EventHandler::handleTouchEvent):
2249         * page/Frame.cpp:
2250         (WebCore::Frame::setDocument):
2251         * page/scrolling/ScrollingCoordinator.cpp:
2252         (WebCore::ScrollingCoordinator::computeAbsoluteTouchEventTargetRects): Walk the renderers for event handler
2253         nodes and generate the absolute hit testing rects.
2254         * page/scrolling/ScrollingCoordinator.h:
2255         (WebCore::ScrollingCoordinator::setTouchEventTargetRectsChanged): Hook to pass along the hit test rects to
2256         the scrolling tree/compositor.
2257         (ScrollingCoordinator):
2258         * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
2259         (WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated):
2260         (WebCore::ScrollingCoordinatorChromium::setTouchEventTargetRectsChanged):
2261         (WebCore::ScrollingCoordinatorChromium::setNonFastScrollableRegion):
2262         (WebCore::ScrollingCoordinatorChromium::setTouchEventTargetRects):
2263         * page/scrolling/chromium/ScrollingCoordinatorChromium.h:
2264         (ScrollingCoordinatorChromium):
2265         * testing/Internals.cpp:
2266         (WebCore::Internals::touchEventHandlerCount): Changed to do the work to calculate the actual count since
2267         it's no longer stored as an int in Document.
2268         (WebCore::Internals::touchEventTargetClientRects):
2269         * testing/Internals.h:
2270         (Internals):
2271         * testing/Internals.idl:
2272
2273 2012-12-12  Luke Macpherson   <macpherson@chromium.org>
2274
2275         Add ASSERTions to ensure that CSSPropertys that are variables only ever refer to CSSValues that are variables.
2276         https://bugs.webkit.org/show_bug.cgi?id=104876
2277
2278         Reviewed by Steve Block.
2279
2280         Add assertions to CSSProperty constructors to make that if it is initialized with CSSPropertyVariable that
2281         the value type associated with it is also a variable. This is already asserted at read time, but ASSERTing
2282         here will produce a more useful backtrace.
2283
2284         No new tests as functionality unchanged.
2285
2286         * css/CSSProperty.h:
2287         (WebCore::CSSProperty::CSSProperty):
2288
2289 2012-12-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2290
2291         NetworkInfoController needs to support destructor
2292         https://bugs.webkit.org/show_bug.cgi?id=104642
2293
2294         Reviewed by Kentaro Hara.
2295
2296         Though NetworkInfoController can be referenced by each port in order to update network status change,
2297         there is no virtual interface to destroy it. Beside each port client also needs to be destroyed when
2298         controller is destroyed.
2299
2300         * Modules/networkinfo/NetworkInfoClient.h:
2301         (NetworkInfoClient):
2302         * Modules/networkinfo/NetworkInfoConnection.h:
2303         (WebCore::NetworkInfoConnection::networkInfoControllerDestroyed):
2304         * Modules/networkinfo/NetworkInfoController.cpp:
2305         (WebCore::NetworkInfoController::~NetworkInfoController):
2306
2307 2012-12-12  Kent Tamura  <tkent@chromium.org>
2308
2309         Validity of a radio button is not updated correctly when it is detached from an invalid radio group
2310         https://bugs.webkit.org/show_bug.cgi?id=104873
2311
2312         Reviewed by Kentaro Hara.
2313
2314         When a radio button is detached from an invalid radio group,
2315         A) we should update button's validity, and
2316         B) it should be valid.
2317
2318         A is handled by the following code in RadioButtonGroup::remove.
2319             if (!wasValid) {
2320                 // A radio button not in a group is always valid. We need to make it
2321                 // valid only if the group was invalid.
2322                 button->setNeedsValidityCheck();
2323
2324         B was incomplete.
2325             bool RadioInputType::valueMissing(const String&) const
2326             {
2327                 return element()->isInRequiredRadioButtonGroup() && !element()->checkedRadioButtonForGroup();
2328         isInRequiredRadioButtonGroup checked required state of a group with the
2329         name attribute value even if the radio button was already detached from
2330         the group. isInRequiredRadioButtonGroup should check membership of the
2331         radio button precisely.
2332
2333         Tests: Update fast/forms/radio/radio-live-validation-style.html
2334
2335         * dom/CheckedRadioButtons.cpp:
2336         (RadioButtonGroup): Declare contains.
2337         (WebCore::RadioButtonGroup::contains): Added.
2338         (WebCore::CheckedRadioButtons::isInRequiredGroup): Renamed from
2339         isRequiredGroup. This function takes HTMLInputElement* argument.
2340         * dom/CheckedRadioButtons.h:
2341         (CheckedRadioButtons): Rename isRequiredGroup to isInRequiredGroup.
2342         * html/HTMLInputElement.cpp:
2343         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup):
2344         Make this non-const becaues RadioButtonGroup::m_members needs non-const
2345         pointers. Use CheckedRadioButtons::isInRequiredGroup.
2346         * html/HTMLInputElement.h:
2347         (HTMLInputElement): Make isInRequiredRadioButtonGroup non-const.
2348
2349 2012-12-12  Shinya Kawanaka  <shinyak@chromium.org>
2350
2351         ContainerNodeAlgorithm::notifyInsertedIntoDocument is not used
2352         https://bugs.webkit.org/show_bug.cgi?id=104874
2353
2354         Reviewed by Hajime Morita.
2355
2356         ContainerNodeAlgorithm::notifyInsertedIntoDocument() is not used by anyone. We can remove it safely.
2357
2358         No new tests, no change in behavior.
2359
2360         * dom/ContainerNodeAlgorithms.h:
2361
2362 2012-12-12  Kunihiko Sakamoto  <ksakamoto@chromium.org>
2363
2364         Milliseconds field of date/time input UI should respect step attribute
2365         https://bugs.webkit.org/show_bug.cgi?id=104628
2366
2367         Reviewed by Kent Tamura.
2368
2369         This patch makes step-up/-down UI of the milliseconds fields respect step attribute
2370         in a special case when the step is divisible by 1000 milliseconds.
2371
2372         Test: fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html
2373
2374         * html/shadow/DateTimeEditElement.cpp:
2375         (WebCore::DateTimeEditBuilder::visitField):
2376         If step of the element (in milliseconds) is divisible by 1000, use it as the step of the milliseconds field. Otherwise, the millisecond field has step 1.
2377         * html/shadow/DateTimeFieldElements.cpp:
2378         (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement): Add step and stepBase arguments.
2379         (WebCore::DateTimeMillisecondFieldElement::create): Ditto.
2380         * html/shadow/DateTimeFieldElements.h:
2381         (DateTimeMillisecondFieldElement): Ditto.
2382         * html/shadow/DateTimeNumericFieldElement.cpp:
2383         (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement): Ditto.
2384         (WebCore::DateTimeNumericFieldElement::stepDown): Changed to compute next allowed value using roundDown().
2385         (WebCore::DateTimeNumericFieldElement::stepUp): Changed to compute next allowed value using roundUp().
2386         (WebCore::DateTimeNumericFieldElement::roundDown): Added.
2387         (WebCore::DateTimeNumericFieldElement::roundUp): Added.
2388         * html/shadow/DateTimeNumericFieldElement.h:
2389         (DateTimeNumericFieldElement): Add m_step and m_stepBase fields.
2390
2391 2012-12-12  Julien Chaffraix  <jchaffraix@webkit.org>
2392
2393         [CSS Grid Layout] Include paddings and borders into the grid element's logical height / width
2394         https://bugs.webkit.org/show_bug.cgi?id=104818
2395
2396         Reviewed by Tony Chang.
2397
2398         This change makes RenderGrid add the borders and paddings in the right direction during layout
2399         so that the grid element's size accounts them like any other renderer.
2400
2401         Test: fast/css-grid-layout/grid-element-padding-margin.html
2402
2403         * rendering/RenderGrid.cpp:
2404         (WebCore::RenderGrid::computePreferredLogicalWidths):
2405         (WebCore::RenderGrid::layoutGridItems):
2406
2407 2012-12-12  Roger Fong  <roger_fong@apple.com>
2408
2409         Include Apple Windows in GraphicsLayer::supportsBackgroundColorContent().
2410         https://bugs.webkit.org/show_bug.cgi?id=104852.
2411
2412         Reviewed by Simon Fraser.
2413
2414         * platform/graphics/GraphicsLayer.h:
2415         (WebCore::GraphicsLayer::supportsBackgroundColorContent):
2416
2417 2012-12-12  KyungTae Kim  <ktf.kim@samsung.com>
2418
2419         Unused parameters on TextureMapperImageBuffer.cpp
2420         https://bugs.webkit.org/show_bug.cgi?id=104857
2421
2422         Reviewed by Kentaro Hara.
2423
2424         The updateContents has unused parameter 'textureMapper',
2425         remove the parameter name to fix 'unused parameter' build warning. 
2426
2427         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
2428         (WebCore::BitmapTextureImageBuffer::updateContents):
2429
2430 2012-12-12  Shinya Kawanaka  <shinyak@chromium.org>
2431
2432         [Shadow] HTMLContentElement::getDistributedNodes() doesn't work correctly if not in document tree.
2433         https://bugs.webkit.org/show_bug.cgi?id=104345
2434
2435         Reviewed by Hajime Morita.
2436
2437         Since document->updateLayout() does affect nodes in Document, distribution will not occur in
2438         InsertionPoints out of Document. We have to find the element in document tree scope, and start distribution from it.
2439
2440         Test: fast/dom/shadow/get-distributed-nodes-orphan.html
2441
2442         * html/shadow/InsertionPoint.cpp:
2443         (WebCore::InsertionPoint::getDistributedNodes):
2444
2445 2012-12-12  Patrick Gansterer  <paroga@webkit.org>
2446
2447         [WIN] Implement WebCore::fileSystemRepresentation() for !USE(CF)
2448         https://bugs.webkit.org/show_bug.cgi?id=104456
2449
2450         Reviewed by Brent Fulgham.
2451
2452         Convert the UTF-16 path to the system default Windows ANSI code page (usually Windows Latin1).
2453
2454         * platform/win/FileSystemWin.cpp:
2455         (WebCore::fileSystemRepresentation):
2456
2457 2012-12-12  No'am Rosenthal  <noam@webkit.org>
2458
2459         [Texmap] Remove lowp/highp indicators as they're not needed with ANGLE.
2460         https://bugs.webkit.org/show_bug.cgi?id=104707
2461
2462         Reviewed by Kenneth Rohde Christiansen.
2463
2464         lowp/highp indicator were needed for GLES2, but ANGLE does not require them.
2465
2466         Covered by existing tests.
2467
2468         * platform/graphics/texmap/TextureMapperShaderManager.cpp:
2469         (WebCore::getShaderSpec):
2470
2471 2012-12-12  Andy Estes  <aestes@apple.com>
2472
2473         Don't dispatch fake mousemove events when we don't know where the cursor is
2474         https://bugs.webkit.org/show_bug.cgi?id=104861
2475
2476         Reviewed by Sam Weinig.
2477
2478         When EventHandler is instantiated or cleared, it sets the current mouse
2479         position to (0, 0), even though this is probably not where the mouse
2480         cursor really is (and we won't know until the mouse moves into the WebView).
2481         If a fake mousemove event fires and the page has an element at (0, 0)
2482         that responds to mousemove, we might end up changing the cursor or
2483         displaying a tooltip at the current mouse position, even if it is
2484         outside the WebView.
2485
2486         Fake mousemove events are dispatched in order to update a cursor that
2487         is already over the WebView. Don't dispatch the event if we don't know
2488         this to be true.
2489
2490         * page/EventHandler.cpp:
2491         (WebCore::EventHandler::EventHandler): Instantiate m_mousePositionIsUnknown to true.
2492         (WebCore::EventHandler::clear): Reset m_mousePositionIsUnknown to true.
2493         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon): Return early if the mouse position is unknown.
2494         (WebCore::EventHandler::setLastKnownMousePosition): Set the mouse position from the PlatformMouseEvent and set m_mousePositionIsUnknown to false.
2495         (WebCore::EventHandler::handleMousePressEvent): Call setLastKnownMousePosition() instead of setting the position directly.
2496         (WebCore::EventHandler::handleMouseDoubleClickEvent): Ditto.
2497         (WebCore::EventHandler::handleMouseMoveEvent): Ditto.
2498         (WebCore::EventHandler::handleMouseReleaseEvent): Ditto.
2499         (WebCore::EventHandler::updateSelectionForMouseDrag): Rename currentMouse(Global)Position to lastKnownMouse(Global)Position.
2500         (WebCore::EventHandler::handleAutoscroll): Ditto.
2501         (WebCore::EventHandler::updatePanScrollState): Ditto.
2502         (WebCore::EventHandler::lastKnownMousePosition): Ditto.
2503         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): Ditto.
2504         (WebCore::EventHandler::fakeMouseMoveEventTimerFired): Ditto.
2505         (WebCore::EventHandler::hoverTimerFired): Ditto.
2506         * page/FrameView.cpp:
2507         (WebCore::FrameView::lastKnownMousePosition): Ditto.
2508         * platform/ScrollableArea.h:
2509         (WebCore::ScrollableArea::lastKnownMousePosition): Ditto.
2510         * platform/mac/ScrollAnimatorMac.mm:
2511         (-[WebScrollbarPainterControllerDelegate mouseLocationInContentAreaForScrollerImpPair:]): Ditto.
2512         (-[WebScrollbarPainterDelegate mouseLocationInScrollerForScrollerImp:]): Ditto.
2513         * rendering/RenderLayer.cpp:
2514         (WebCore::RenderLayer::panScrollFromPoint): Ditto.
2515         (WebCore::RenderLayer::autoscroll): Ditto.
2516         (WebCore::RenderLayer::lastKnownMousePosition): Ditto.
2517         * rendering/RenderListBox.cpp:
2518         (WebCore::RenderListBox::panScroll): Ditto.
2519         (WebCore::RenderListBox::autoscroll): Ditto.
2520         (WebCore::RenderListBox::lastKnownMousePosition): Ditto.
2521
2522 2012-12-12  Martin Robinson  <mrobinson@igalia.com>
2523
2524         Try to fix the GTK+ debug bulid
2525
2526         Logging.h is no longer included in headers, so we need to include it manually in
2527         files that require logging macros.
2528
2529         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Include Logging.h.
2530
2531 2012-12-12  Sheriff Bot  <webkit.review.bot@gmail.com>
2532
2533         Unreviewed, rolling out r137524.
2534         http://trac.webkit.org/changeset/137524
2535         https://bugs.webkit.org/show_bug.cgi?id=104859
2536
2537         Causes m_deletionHasBegun assertion failures in
2538         MutationObserver tests (Requested by aklein on #webkit).
2539
2540         * dom/Document.cpp:
2541         (WebCore::Document::Document):
2542         (WebCore::Document::~Document):
2543         (WebCore::Document::suggestedMIMEType):
2544         * dom/Document.h:
2545         (WebCore::Node::isDocumentNode):
2546         (WebCore):
2547         (WebCore::Node::treeScope):
2548         (WebCore::Node::Node):
2549         * dom/Element.cpp:
2550         (WebCore::Element::createRareData):
2551         * dom/ElementRareData.h:
2552         (ElementRareData):
2553         (WebCore::ElementRareData::ElementRareData):
2554         * dom/Node.cpp:
2555         (WebCore::Node::~Node):
2556         (WebCore::Node::setDocument):
2557         (WebCore):
2558         (WebCore::Node::setTreeScope):
2559         (WebCore::Node::createRareData):
2560         (WebCore::Node::attach):
2561         (WebCore::Node::reportMemoryUsage):
2562         * dom/Node.h:
2563         (WebCore):
2564         (WebCore::NodeRareDataBase::treeScope):
2565         (WebCore::NodeRareDataBase::setTreeScope):
2566         (NodeRareDataBase):
2567         (WebCore::NodeRareDataBase::NodeRareDataBase):
2568         (Node):
2569         (WebCore::Node::inDocument):
2570         (WebCore::Node::documentInternal):
2571         * dom/NodeRareData.cpp:
2572         (SameSizeAsNodeRareData):
2573         (WebCore::NodeRareData::reportMemoryUsage):
2574         * dom/NodeRareData.h:
2575         (WebCore::NodeRareData::NodeRareData):
2576         * dom/ShadowRoot.cpp:
2577         (WebCore::ShadowRoot::ShadowRoot):
2578         * dom/TreeScope.cpp:
2579         (SameSizeAsTreeScope):
2580         (WebCore::TreeScope::TreeScope):
2581         (WebCore::TreeScope::setParentTreeScope):
2582         * dom/TreeScope.h:
2583         (WebCore):
2584         (TreeScope):
2585         * dom/TreeScopeAdopter.cpp:
2586         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
2587         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
2588
2589 2012-12-12  Seokju Kwon  <seokju.kwon@gmail.com>
2590
2591         Fix build warning when ENABLE_INSPECTOR is disabled
2592         https://bugs.webkit.org/show_bug.cgi?id=104757
2593
2594         Reviewed by Kentaro Hara.
2595
2596         Use UNUSED_PARAM macro to fix build warning -Wunused-parameter.
2597
2598         No new tests, no behavior change.
2599
2600         * inspector/InspectorCanvasInstrumentation.h:
2601         (WebCore::InspectorInstrumentation::wrapCanvas2DRenderingContextForInstrumentation):
2602         (WebCore::InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation):
2603         * inspector/InspectorConsoleInstrumentation.h:
2604         (WebCore::InspectorInstrumentation::addMessageToConsole):
2605         (WebCore::InspectorInstrumentation::consoleCount):
2606         (WebCore::InspectorInstrumentation::startConsoleTiming):
2607         (WebCore::InspectorInstrumentation::stopConsoleTiming):
2608         (WebCore::InspectorInstrumentation::consoleTimeStamp):
2609         (WebCore::InspectorInstrumentation::addStartProfilingMessageToConsole):
2610         (WebCore::InspectorInstrumentation::addProfile):
2611         (WebCore::InspectorInstrumentation::profilerEnabled):
2612         (WebCore::InspectorInstrumentation::getCurrentUserInitiatedProfileName):
2613         * inspector/InspectorCounters.h:
2614         (WebCore::InspectorCounters::incrementCounter):
2615         (WebCore::InspectorCounters::decrementCounter):
2616         * inspector/InspectorDatabaseInstrumentation.h:
2617         (WebCore::InspectorInstrumentation::didOpenDatabase):
2618         * inspector/InspectorInstrumentation.h:
2619         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
2620         (WebCore::InspectorInstrumentation::isDebuggerPaused):
2621         (WebCore::InspectorInstrumentation::willInsertDOMNode):
2622         (WebCore::InspectorInstrumentation::didInsertDOMNode):
2623         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
2624         (WebCore::InspectorInstrumentation::willModifyDOMAttr):
2625         (WebCore::InspectorInstrumentation::didModifyDOMAttr):
2626         (WebCore::InspectorInstrumentation::didRemoveDOMAttr):
2627         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
2628         (WebCore::InspectorInstrumentation::frameWindowDiscarded):
2629         (WebCore::InspectorInstrumentation::mediaQueryResultChanged):
2630         (WebCore::InspectorInstrumentation::didPushShadowRoot):
2631         (WebCore::InspectorInstrumentation::willPopShadowRoot):
2632         (WebCore::InspectorInstrumentation::didCreateNamedFlow):
2633         (WebCore::InspectorInstrumentation::willRemoveNamedFlow):
2634         (WebCore::InspectorInstrumentation::didUpdateRegionLayout):
2635         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
2636         (WebCore::InspectorInstrumentation::handleTouchEvent):
2637         (WebCore::InspectorInstrumentation::handleMousePress):
2638         (WebCore::InspectorInstrumentation::forcePseudoState):
2639         (WebCore::InspectorInstrumentation::characterDataModified):
2640         (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
2641         (WebCore::InspectorInstrumentation::didScheduleResourceRequest):
2642         (WebCore::InspectorInstrumentation::didInstallTimer):
2643         (WebCore::InspectorInstrumentation::didRemoveTimer):
2644         (WebCore::InspectorInstrumentation::willCallFunction):
2645         (WebCore::InspectorInstrumentation::didCallFunction):
2646         (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent):
2647         (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent):
2648         (WebCore::InspectorInstrumentation::willDispatchEvent):
2649         (WebCore::InspectorInstrumentation::didDispatchEvent):
2650         (WebCore::InspectorInstrumentation::willHandleEvent):
2651         (WebCore::InspectorInstrumentation::didHandleEvent):
2652         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
2653         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
2654         (WebCore::InspectorInstrumentation::willEvaluateScript):
2655         (WebCore::InspectorInstrumentation::didEvaluateScript):
2656         (WebCore::InspectorInstrumentation::didCreateIsolatedContext):
2657         (WebCore::InspectorInstrumentation::willFireTimer):
2658         (WebCore::InspectorInstrumentation::didFireTimer):
2659         (WebCore::InspectorInstrumentation::didBeginFrame):
2660         (WebCore::InspectorInstrumentation::didCancelFrame):
2661         (WebCore::InspectorInstrumentation::didInvalidateLayout):
2662         (WebCore::InspectorInstrumentation::willLayout):
2663         (WebCore::InspectorInstrumentation::didLayout):
2664         (WebCore::InspectorInstrumentation::didScroll):
2665         (WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent):
2666         (WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent):
2667         (WebCore::InspectorInstrumentation::willPaint):
2668         (WebCore::InspectorInstrumentation::didPaint):
2669         (WebCore::InspectorInstrumentation::willScrollLayer):
2670         (WebCore::InspectorInstrumentation::didScrollLayer):
2671         (WebCore::InspectorInstrumentation::willComposite):
2672         (WebCore::InspectorInstrumentation::didComposite):
2673         (WebCore::InspectorInstrumentation::willRecalculateStyle):
2674         (WebCore::InspectorInstrumentation::didRecalculateStyle):
2675         (WebCore::InspectorInstrumentation::didScheduleStyleRecalculation):
2676         (WebCore::InspectorInstrumentation::willMatchRule):
2677         (WebCore::InspectorInstrumentation::didMatchRule):
2678         (WebCore::InspectorInstrumentation::willProcessRule):
2679         (WebCore::InspectorInstrumentation::didProcessRule):
2680         (WebCore::InspectorInstrumentation::applyUserAgentOverride):
2681         (WebCore::InspectorInstrumentation::applyScreenWidthOverride):
2682         (WebCore::InspectorInstrumentation::applyScreenHeightOverride):
2683         (WebCore::InspectorInstrumentation::shouldApplyScreenWidthOverride):
2684         (WebCore::InspectorInstrumentation::applyEmulatedMedia):
2685         (WebCore::InspectorInstrumentation::shouldApplyScreenHeightOverride):
2686         (WebCore::InspectorInstrumentation::willSendRequest):
2687         (WebCore::InspectorInstrumentation::continueAfterPingLoader):
2688         (WebCore::InspectorInstrumentation::markResourceAsCached):
2689         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
2690         (WebCore::InspectorInstrumentation::willReceiveResourceData):
2691         (WebCore::InspectorInstrumentation::didReceiveResourceData):
2692         (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
2693         (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
2694         (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
2695         (WebCore::InspectorInstrumentation::continueWithPolicyDownload):
2696         (WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
2697         (WebCore::InspectorInstrumentation::didReceiveData):
2698         (WebCore::InspectorInstrumentation::didFinishLoading):
2699         (WebCore::InspectorInstrumentation::didFailLoading):
2700         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient):
2701         (WebCore::InspectorInstrumentation::willLoadXHR):
2702         (WebCore::InspectorInstrumentation::didFailXHRLoading):
2703         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
2704         (WebCore::InspectorInstrumentation::didReceiveXHRResponse):
2705         (WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
2706         (WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
2707         (WebCore::InspectorInstrumentation::scriptImported):
2708         (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
2709         (WebCore::InspectorInstrumentation::didReceiveScriptResponse):
2710         (WebCore::InspectorInstrumentation::domContentLoadedEventFired):
2711         (WebCore::InspectorInstrumentation::loadEventFired):
2712         (WebCore::InspectorInstrumentation::frameDetachedFromParent):
2713         (WebCore::InspectorInstrumentation::didCommitLoad):
2714         (WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
2715         (WebCore::InspectorInstrumentation::willDestroyCachedResource):
2716         (WebCore::InspectorInstrumentation::willWriteHTML):
2717         (WebCore::InspectorInstrumentation::didWriteHTML):
2718         (WebCore::InspectorInstrumentation::didUseDOMStorage):
2719         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
2720         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart):
2721         (WebCore::InspectorInstrumentation::didStartWorkerContext):
2722         (WebCore::InspectorInstrumentation::workerContextTerminated):
2723         (WebCore::InspectorInstrumentation::didCreateWebSocket):
2724         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
2725         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
2726         (WebCore::InspectorInstrumentation::didCloseWebSocket):
2727         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrame):
2728         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameError):
2729         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
2730         (WebCore::InspectorInstrumentation::networkStateChanged):
2731         (WebCore::InspectorInstrumentation::updateApplicationCacheStatus):
2732         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
2733         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
2734         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
2735         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
2736         (WebCore::InspectorInstrumentation::overrideGeolocationPosition):
2737         (WebCore::InspectorInstrumentation::overrideDeviceOrientation):
2738         * loader/appcache/ApplicationCacheGroup.cpp:
2739         (WebCore::ApplicationCacheGroup::didFinishLoading):
2740         (WebCore::ApplicationCacheGroup::didFail):
2741
2742 2012-12-12  Dean Jackson  <dino@apple.com>
2743
2744         Reinstate CIFilter code for Lion
2745         https://bugs.webkit.org/show_bug.cgi?id=104847
2746
2747         Reviewed by Simon Fraser.
2748
2749         This basically reverts r137500 for Lion, because some
2750         CAFilter types are not available there.
2751
2752         Covered by existing tests, with the warning that Lion
2753         baselines will need updating.
2754
2755         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2756         (PlatformCALayer::setFilters): Put an ugly #if in to
2757         detect OS X 10.7, and rename caFilter variable to
2758         filter.
2759
2760 2012-12-12  Seokju Kwon  <seokju.kwon@gmail.com>
2761
2762         [EFL] Refactor duplicate code into EflInspectorUtilities
2763         https://bugs.webkit.org/show_bug.cgi?id=104329
2764
2765         Reviewed by Kenneth Rohde Christiansen.
2766
2767         Move duplicate work into EflInspectorUtilities.
2768
2769         No new tests, refactoring.
2770
2771         * PlatformEfl.cmake:
2772         * platform/efl/EflInspectorUtilities.cpp: Added.
2773         (WebCore):
2774         (WebCore::inspectorResourcePath):
2775         * platform/efl/EflInspectorUtilities.h: Added.
2776         (WebCore):
2777
2778 2012-12-12  Mark Lam  <mark.lam@apple.com>
2779
2780         Fixing a chromium build breakage due to r137520.
2781         https://bugs.webkit.org/show_bug.cgi?id=104741.
2782
2783         Not reviewed.
2784
2785         Added #ifdef !PLATFORM(CHROMIUM) for one function chromium doesn't use.
2786
2787         No new tests.
2788
2789         * Modules/webdatabase/DatabaseManager.cpp:
2790         (WebCore::DatabaseManager::initialize):
2791         * Modules/webdatabase/DatabaseTracker.h:
2792         (DatabaseTracker):
2793
2794 2012-12-11  Emil A Eklund  <eae@chromium.org>
2795
2796         REGRESSION (Subpixel layout): Gray vertical lines appear when moving insertion point to right on Mac
2797         https://bugs.webkit.org/show_bug.cgi?id=102402
2798
2799         Reviewed by Simon Fraser.
2800
2801         Round paintOffset in CaretBase::paintCaret to ensure that caret is painted at an integer pixel boundary.
2802
2803         Test: fast/sub-pixel/input-caret-on-subpixel-bound.html
2804
2805         * editing/FrameSelection.cpp:
2806         (WebCore::CaretBase::paintCaret): Round paintOffset to ensure it is on a pixel boundary.
2807
2808 2012-12-12  Elliott Sprehn  <esprehn@gmail.com>
2809
2810         REGRESSION(137336): Generated run-ins are not placed correctly
2811         https://bugs.webkit.org/show_bug.cgi?id=104840
2812
2813         Reviewed by Abhishek Arya.
2814
2815         Now that :before and :after are not anonymous we no longer need special
2816         handling for run-ins. Currently placeRunInIfNeeded will only place
2817         a generated content run-in if a special flag is passed, but I removed
2818         the call with the flag as it wasn't needed in r137336. This patch just
2819         removes all special handling for generated content run-ins.
2820
2821         Test: fast/css-generated-content/generated-runin.html
2822
2823         * rendering/RenderBlock.cpp:
2824         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
2825         (WebCore::RenderBlock::placeRunInIfNeeded):
2826         (WebCore::RenderBlock::createReplacementRunIn):
2827             Lots of simplfication since there's no more anonymous run-ins.
2828         * rendering/RenderBlock.h:
2829         (RenderBlock):
2830         * rendering/RenderObject.h:
2831
2832 2012-12-12  Simon Fraser  <simon.fraser@apple.com>
2833
2834         Don't unconditionally repaint compositing layers when their size changes
2835         https://bugs.webkit.org/show_bug.cgi?id=104461
2836
2837         Reviewed by James Robinson.
2838
2839         In r137215 I attempted to avoid excessive repainting when compositing layers
2840         change size. This caused stretched layers when layer size changed as a result
2841         of bounds constraining in updateCompositedBounds(), so was conditionalized
2842         based on whether constraining happend, in r137248.
2843         
2844         However, the TileCache layer was affected by constraining, erroneously:
2845         shouldClipCompositedBounds() returned true of the tile cache layer. This
2846         is pointless, because we only constrain to the document bounds (or enclosing
2847         overflow), and the tile cache is already the size of the document bounds.
2848
2849         So, disable size constraining for the tile cache layer, and fix
2850         a confusing comment in updateCompositedBounds() that refers to the
2851         view's bounds, rather than the document's bounds.
2852
2853         * rendering/RenderLayerBacking.cpp:
2854         (WebCore::RenderLayerBacking::shouldClipCompositedBounds):
2855         (WebCore::RenderLayerBacking::updateCompositedBounds):
2856
2857 2012-12-12  Elliott Sprehn  <esprehn@gmail.com>
2858
2859         [Refactoring] Replace Node's Document pointer with a TreeScope pointer
2860         https://bugs.webkit.org/show_bug.cgi?id=59816
2861
2862         Reviewed by Ryosuke Niwa.
2863
2864         Instead of giving every node in a shadow a rare data, which can be quite
2865         large, we replace the Document pointer in Node with a TreeScope pointer
2866         and we give TreeScope a pointer to it's document scope.
2867
2868         This introduces no branches in document() because in the common
2869         case document() becomes equivalent to m_treeScope->m_documentScope where
2870         the documentScope is actually m_treeScope so this shouldn't introduce a
2871         perf regression.
2872
2873         Note also that TreeScope can never be null after r136328, and the document
2874         pointer is only null for DocumentType nodes so we can use a special
2875         no-document TreeScope for this case that always returns null from
2876         documentScope().
2877
2878         No new tests, no change in behavior.
2879
2880         * dom/Document.cpp:
2881         (WebCore::Document::Document):
2882         (WebCore::Document::~Document):
2883         (WebCore::Document::suggestedMIMEType):
2884         * dom/Document.h:
2885         (WebCore::Node::isDocumentNode):
2886         (WebCore::Node::Node):
2887         * dom/Element.cpp:
2888         (WebCore::Element::createRareData):
2889         * dom/ElementRareData.h:
2890         (ElementRareData):
2891         (WebCore::ElementRareData::ElementRareData):
2892         * dom/Node.cpp:
2893         (WebCore::Node::~Node):
2894         (WebCore::Node::createRareData):
2895         (WebCore::Node::attach):
2896         (WebCore::Node::reportMemoryUsage):
2897         * dom/Node.h:
2898         (WebCore):
2899         (WebCore::NodeRareDataBase::NodeRareDataBase):
2900         (NodeRareDataBase):
2901         (WebCore::Node::treeScope):
2902         (WebCore::Node::inDocument):
2903         (WebCore::Node::documentInternal):
2904         (WebCore::Node::setTreeScope):
2905         (Node):
2906         * dom/NodeRareData.cpp:
2907         (WebCore::NodeRareData::reportMemoryUsage):
2908         * dom/NodeRareData.h:
2909         (WebCore::NodeRareData::NodeRareData):
2910         * dom/ShadowRoot.cpp:
2911         (WebCore::ShadowRoot::ShadowRoot):
2912         * dom/TreeScope.cpp:
2913         (SameSizeAsTreeScope):
2914         (WebCore::TreeScope::TreeScope):
2915         (WebCore::TreeScope::setParentTreeScope):
2916         * dom/TreeScope.h:
2917         (WebCore):
2918         (TreeScope):
2919         (WebCore::TreeScope::documentScope):
2920         (WebCore::TreeScope::noDocumentInstance):
2921             Returns a special tree scope that has no document for use with
2922             DocumentType nodes.
2923         (WebCore::TreeScope::setDocumentScope):
2924         * dom/TreeScopeAdopter.cpp:
2925         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
2926         (WebCore::TreeScopeAdopter::moveTreeToNewDocument):
2927         (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
2928
2929 2012-12-12  Mark Lam  <mark.lam@apple.com>
2930
2931         Encapsulate externally used webdatabase APIs in DatabaseManager.
2932         https://bugs.webkit.org/show_bug.cgi?id=104741.
2933
2934         Reviewed by Sam Weinig.
2935
2936         Use DatabaseManager instead of accessing DatabaseTracker, AbstractDatabase,
2937         and DatabaseContext directly. This is to prepare for upcoming webkit2
2938         refactoring.
2939
2940         No new tests.
2941
2942         * CMakeLists.txt:
2943         * Modules/webdatabase/DatabaseManager.cpp: Added.
2944         (WebCore::DatabaseManager::manager):
2945         (WebCore::DatabaseManager::DatabaseManager):
2946         (WebCore::DatabaseManager::initialize):
2947         (WebCore::DatabaseManager::setClient):
2948         (WebCore::DatabaseManager::isAvailable):
2949         (WebCore::DatabaseManager::setIsAvailable):
2950         (WebCore::DatabaseManager::hasOpenDatabases):
2951         (WebCore::DatabaseManager::stopDatabases):
2952         (WebCore::DatabaseManager::fullPathForDatabase):
2953         (WebCore::DatabaseManager::databaseDirectoryPath):
2954         (WebCore::DatabaseManager::setDatabaseDirectoryPath):
2955         (WebCore::DatabaseManager::hasEntryForOrigin):
2956         (WebCore::DatabaseManager::origins):
2957         (WebCore::DatabaseManager::databaseNamesForOrigin):
2958         (WebCore::DatabaseManager::detailsForNameAndOrigin):
2959         (WebCore::DatabaseManager::usageForOrigin):
2960         (WebCore::DatabaseManager::quotaForOrigin):
2961         (WebCore::DatabaseManager::setQuota):
2962         (WebCore::DatabaseManager::deleteAllDatabases):
2963         (WebCore::DatabaseManager::deleteOrigin):
2964         (WebCore::DatabaseManager::deleteDatabase):
2965         (WebCore::DatabaseManager::closeDatabasesImmediately):
2966         (WebCore::DatabaseManager::interruptAllDatabasesForContext):
2967         * Modules/webdatabase/DatabaseManager.h: Added.
2968         (DatabaseManager):
2969         (WebCore::DatabaseManager::~DatabaseManager):
2970         * Modules/webdatabase/DatabaseManagerClient.h: Copied from Source/WebCore/Modules/webdatabase/DatabaseTrackerClient.h.
2971         (WebCore::DatabaseManagerClient::~DatabaseManagerClient):
2972         * Modules/webdatabase/DatabaseTracker.cpp:
2973         (WebCore::DatabaseTracker::setClient):
2974         * Modules/webdatabase/DatabaseTracker.h:
2975         (DatabaseTracker):
2976         * Modules/webdatabase/DatabaseTrackerClient.h: Removed.
2977         * Target.pri:
2978         * WebCore.exp.in:
2979         * WebCore.gyp/WebCore.gyp:
2980         * WebCore.gypi:
2981         * WebCore.order:
2982         * WebCore.vcproj/WebCore.vcproj:
2983         * WebCore.xcodeproj/project.pbxproj:
2984         * bindings/generic/RuntimeEnabledFeatures.cpp:
2985         (WebCore::RuntimeEnabledFeatures::openDatabaseEnabled):
2986         (WebCore::RuntimeEnabledFeatures::openDatabaseSyncEnabled):
2987         * history/PageCache.cpp:
2988         (WebCore::logCanCacheFrameDecision):
2989         (WebCore::PageCache::canCachePageContainingThisFrame):
2990         * loader/FrameLoader.cpp:
2991         (WebCore::FrameLoader::stopLoading):
2992         * page/DOMWindow.cpp:
2993         * workers/WorkerThread.cpp:
2994         (WebCore::WorkerThreadShutdownStartTask::performTask):
2995         (WebCore::WorkerThread::stop):
2996
2997 2012-12-12  Tony Chang  <tony@chromium.org>
2998
2999         [chromium] don't write additional idl files to a gyp temp file
3000         https://bugs.webkit.org/show_bug.cgi?id=104831
3001
3002         Reviewed by Kentaro Hara.
3003
3004         The <|( command doesn't work for files like <(PRODUCT_DIR) or <(SHARED_INTERMEDIATE_DIR).
3005         For additional_idl_files, pass it as a parameter instead of a file listing the filenames.
3006         There are currently only 3 files in this variable. This shouldn't overflow the command
3007         line since the limit on Windows is 8k and with this change, we're still only around 4.5k.
3008         Also, the longest part of the command line is the list of defines. If needed, we could put
3009         that in a file instead.
3010
3011         No new tests, this is a refactoring of the build files.
3012
3013         * WebCore.gyp/WebCore.gyp: Don't use <|( for additional_idl_files.
3014         * bindings/scripts/generate-bindings.pl: Change --additionalIdlFilesList to
3015         --additionalIdlFiles, which is a shell argument containing the filenames.
3016
3017 2012-12-12  Chris Rogers  <crogers@google.com>
3018
3019         Implement OfflineAudioContext constructor
3020         https://bugs.webkit.org/show_bug.cgi?id=104188
3021
3022         Reviewed by Kentaro Hara.
3023
3024         The Web Audio layout tests have relied on an undocumented way (in the specification) to render
3025         audio faster than realtime using an OfflineAudioContext.  We want to expose a proper OfflineAudioContext
3026         object and constructor instead of piggybacking off of the normal AudioContext.
3027              
3028         * CMakeLists.txt:
3029         * DerivedSources.make:
3030         * DerivedSources.pri:
3031         * GNUmakefile.list.am:
3032         * Modules/webaudio/AudioContext.cpp:
3033         (WebCore::AudioContext::isSampleRateRangeGood):
3034         * Modules/webaudio/AudioContext.h:
3035         (AudioContext):
3036         * Modules/webaudio/DOMWindowWebAudio.idl:
3037         * Modules/webaudio/OfflineAudioContext.cpp: Added.
3038         (WebCore):
3039         (WebCore::OfflineAudioContext::create):
3040         (WebCore::OfflineAudioContext::OfflineAudioContext):
3041         (WebCore::OfflineAudioContext::~OfflineAudioContext):
3042         * Modules/webaudio/OfflineAudioContext.h: Added.
3043         (WebCore):
3044         (OfflineAudioContext):
3045         * Modules/webaudio/OfflineAudioContext.idl: Added.
3046         * WebCore.gypi:
3047         * WebCore.xcodeproj/project.pbxproj:
3048         * bindings/generic/RuntimeEnabledFeatures.h:
3049         (WebCore::RuntimeEnabledFeatures::webkitOfflineAudioContextEnabled):
3050         * bindings/js/JSAudioContextCustom.cpp:
3051         (WebCore::JSAudioContextConstructor::constructJSAudioContext):
3052         * bindings/v8/custom/V8AudioContextCustom.cpp:
3053         (WebCore::V8AudioContext::constructorCallbackCustom):
3054
3055 2012-12-12  John Griggs  <jgriggs@rim.com>
3056
3057         2012-12-12  John Griggs  <jgriggs@rim.com>
3058
3059         [BlackBerry] Update Media Controls for BlackBerry Platform
3060         https://bugs.webkit.org/show_bug.cgi?id=104443
3061         https://przilla.ott.qnx.com/bugzilla/show_bug.cgi?id=204748
3062
3063         Reviewed by Rob Buis.
3064
3065         Update Media Controls for BlackBerry platform to allow audio, embedded video and fullscreen video controls to be positioned and styled differently.
3066
3067         BlackBerry-specific update to Media Controls - No new tests required.
3068
3069         * PlatformBlackBerry.cmake:
3070         * css/mediaControlsBlackBerry.css:
3071         (audio):
3072         (audio::-webkit-media-controls-embedded-panel, video::-webkit-media-controls-embedded-panel):
3073         (audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel):
3074         (video::-webkit-media-controls-button-group-container, audio::-webkit-media-controls-button-group-container):
3075         (video::-webkit-media-controls-fullscreen-time-display-container, audio::-webkit-media-controls-fullscreen-time-display-container):
3076         (video::-webkit-media-controls-time-display-container, audio::-webkit-media-controls-time-display-container):
3077         (video::-webkit-media-controls-fullscreen-play-button, audio::-webkit-media-controls-fullscreen-play-button):
3078         (video::-webkit-media-controls-play-button, audio::-webkit-media-controls-play-button):
3079         (audio::-webkit-media-controls-fullscreen-timeline-container, video::-webkit-media-controls-fullscreen-timeline-container):
3080         (video::-webkit-media-controls-timeline-container, audio::-webkit-media-controls-timeline-container):
3081         (audio::-webkit-media-controls-fullscreen-current-time-display, video::-webkit-media-controls-fullscreen-current-time-display):
3082         (audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display):
3083         (video::-webkit-media-controls-fullscreen-time-remaining-display, audio::-webkit-media-controls-fullscreen-time-remaining-display):
3084         (video::-webkit-media-controls-time-remaining-display, audio::-webkit-media-controls-time-remaining-display):
3085         (audio::-webkit-media-controls-fullscreen-timeline, video::-webkit-media-controls-fullscreen-timeline):
3086         (video::-webkit-media-controls-fullscreen-fullscreen-button, audio::-webkit-media-controls-fullscreen-fullscreen-button):
3087         (video::-webkit-media-controls-fullscreen-button):
3088         (audio::-webkit-media-controls-fullscreen-button):
3089         (audio::-webkit-media-controls-audio-mute-button):
3090         (video::-webkit-media-controls-audio-mute-button):
3091         (audio::-webkit-media-controls-volume-slider-container):
3092         (video::-webkit-media-controls-volume-slider-container):
3093         (audio::-webkit-media-controls-volume-slider):
3094         (video::-webkit-media-controls-volume-slider):
3095         (video::-webkit-media-controls-fullscreen-button-divider, audio::-webkit-media-controls-fullscreen-button-divider):
3096         (video::-webkit-media-controls-fullscreen-button-container, video::-webkit-media-controls-play-button-container, audio::-webkit-media-controls-fullscreen-button-container, audio::-webkit-media-controls-play-button-container):
3097         * css/mediaControlsBlackBerryFullscreen.css: Added.
3098         (body:-webkit-full-page-media):
3099         (video:-webkit-full-screen::-webkit-media-controls-embedded-panel):
3100         (video:-webkit-full-screen::-webkit-media-controls-panel):
3101         (video:-webkit-full-screen::-webkit-media-controls-button-group-container):
3102         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-time-display-container):
3103         (video:-webkit-full-screen::-webkit-media-controls-time-display-container):
3104         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-play-button):
3105         (video:-webkit-full-screen::-webkit-media-controls-play-button):
3106         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-timeline-container):
3107         (video:-webkit-full-screen::-webkit-media-controls-timeline-container):
3108         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-current-time-display):
3109         (video:-webkit-full-screen::-webkit-media-controls-current-time-display):
3110         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-time-remaining-display):
3111         (video:-webkit-full-screen::-webkit-media-controls-time-remaining-display):
3112         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-timeline):
3113         (video:-webkit-full-screen::-webkit-media-controls-timeline):
3114         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-fullscreen-button):
3115         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-button):
3116         (video:-webkit-full-screen::-webkit-media-controls-audio-mute-button):
3117         (video:-webkit-full-screen::-webkit-media-controls-volume-slider-container):
3118         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
3119         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-button-divider):
3120         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-button-container, video:-webkit-full-screen::-webkit-media-controls-play-button-container):
3121         (video:-webkit-full-screen::-webkit-media-controls-fullscreen-button-container):
3122         (video:-webkit-full-screen::-webkit-media-controls-play-button-container):
3123         (video:-webkit-full-screen::-webkit-media-controls-placeholder):
3124         * html/shadow/MediaControlsBlackBerry.cpp: Added.
3125         (WebCore):
3126         (WebCore::MediaControlButtonGroupContainerElement::MediaControlButtonGroupContainerElement):
3127         (WebCore::MediaControlButtonGroupContainerElement::create):
3128         (WebCore::MediaControlButtonGroupContainerElement::shadowPseudoId):
3129         (WebCore::MediaControlTimeDisplayContainerElement::MediaControlTimeDisplayContainerElement):
3130         (WebCore::MediaControlTimeDisplayContainerElement::create):
3131         (WebCore::MediaControlTimeDisplayContainerElement::shadowPseudoId):
3132         (WebCore::MediaControlEmbeddedPanelElement::MediaControlEmbeddedPanelElement):
3133         (WebCore::MediaControlEmbeddedPanelElement::create):
3134         (WebCore::MediaControlEmbeddedPanelElement::shadowPseudoId):
3135         (WebCore::MediaControlEmbeddedPanelElement::startDrag):
3136         (WebCore::MediaControlEmbeddedPanelElement::continueDrag):
3137         (WebCore::MediaControlEmbeddedPanelElement::endDrag):
3138         (WebCore::MediaControlEmbeddedPanelElement::startTimer):
3139         (WebCore::MediaControlEmbeddedPanelElement::stopTimer):
3140         (WebCore::MediaControlEmbeddedPanelElement::transitionTimerFired):
3141         (WebCore::MediaControlEmbeddedPanelElement::setPosition):
3142         (WebCore::MediaControlEmbeddedPanelElement::resetPosition):
3143         (WebCore::MediaControlEmbeddedPanelElement::makeOpaque):
3144         (WebCore::MediaControlEmbeddedPanelElement::makeTransparent):
3145         (WebCore::MediaControlEmbeddedPanelElement::defaultEventHandler):
3146         (WebCore::MediaControlEmbeddedPanelElement::setCanBeDragged):
3147         (WebCore::MediaControlEmbeddedPanelElement::setIsDisplayed):
3148         (WebCore::MediaControlFullscreenTimeDisplayContainerElement::MediaControlFullscreenTimeDisplayContainerElement):
3149         (WebCore::MediaControlFullscreenTimeDisplayContainerElement::create):
3150         (WebCore::MediaControlFullscreenTimeDisplayContainerElement::shadowPseudoId):
3151         (WebCore::MediaControlFullscreenButtonContainerElement::MediaControlFullscreenButtonContainerElement):
3152         (WebCore::MediaControlFullscreenButtonContainerElement::create):
3153         (WebCore::MediaControlFullscreenButtonContainerElement::shadowPseudoId):
3154         (WebCore::MediaControlFullscreenButtonDividerElement::MediaControlFullscreenButtonDividerElement):
3155         (WebCore::MediaControlFullscreenButtonDividerElement::create):
3156         (WebCore::MediaControlFullscreenButtonDividerElement::shadowPseudoId):
3157         (WebCore::MediaControlPlayButtonContainerElement::MediaControlPlayButtonContainerElement):
3158         (WebCore::MediaControlPlayButtonContainerElement::create):
3159         (WebCore::MediaControlPlayButtonContainerElement::shadowPseudoId):
3160         (WebCore::MediaControlPlaceholderElement::MediaControlPlaceholderElement):
3161         (WebCore::MediaControlPlaceholderElement::create):
3162         (WebCore::MediaControlPlaceholderElement::shadowPseudoId):
3163         (WebCore::MediaControlFullscreenPlayButtonElement::MediaControlFullscreenPlayButtonElement):
3164         (WebCore::MediaControlFullscreenPlayButtonElement::create):
3165         (WebCore::MediaControlFullscreenPlayButtonElement::defaultEventHandler):
3166         (WebCore::MediaControlFullscreenPlayButtonElement::updateDisplayType):
3167         (WebCore::MediaControlFullscreenPlayButtonElement::shadowPseudoId):
3168         (WebCore::MediaControlFullscreenFullscreenButtonElement::MediaControlFullscreenFullscreenButtonElement):
3169         (WebCore::MediaControlFullscreenFullscreenButtonElement::create):
3170         (WebCore::MediaControlFullscreenFullscreenButtonElement::defaultEventHandler):
3171         (WebCore::MediaControlFullscreenFullscreenButtonElement::shadowPseudoId):
3172         (WebCore::MediaControlFullscreenFullscreenButtonElement::setIsFullscreen):
3173         (WebCore::MediaControlFullscreenTimelineContainerElement::MediaControlFullscreenTimelineContainerElement):
3174         (WebCore::MediaControlFullscreenTimelineContainerElement::create):
3175         (WebCore::MediaControlFullscreenTimelineContainerElement::shadowPseudoId):
3176         (WebCore::MediaControlFullscreenTimelineElement::MediaControlFullscreenTimelineElement):
3177         (WebCore::MediaControlFullscreenTimelineElement::create):
3178         (WebCore::MediaControlFullscreenTimelineElement::defaultEventHandler):
3179         (WebCore::MediaControlFullscreenTimelineElement::willRespondToMouseClickEvents):
3180         (WebCore::MediaControlFullscreenTimelineElement::setPosition):
3181         (WebCore::MediaControlFullscreenTimelineElement::setDuration):
3182         (WebCore::MediaControlFullscreenTimelineElement::shadowPseudoId):
3183         (WebCore::MediaControlFullscreenTimeRemainingDisplayElement::create):
3184         (WebCore::MediaControlFullscreenTimeRemainingDisplayElement::MediaControlFullscreenTimeRemainingDisplayElement):
3185         (WebCore::MediaControlFullscreenTimeRemainingDisplayElement::shadowPseudoId):
3186         (WebCore::MediaControlFullscreenCurrentTimeDisplayElement::create):
3187         (WebCore::MediaControlFullscreenCurrentTimeDisplayElement::MediaControlFullscreenCurrentTimeDisplayElement):
3188         (WebCore::MediaControlFullscreenCurrentTimeDisplayElement::shadowPseudoId):
3189         (WebCore::MediaControlAudioMuteButtonElement::MediaControlAudioMuteButtonElement):
3190         (WebCore::MediaControlAudioMuteButtonElement::create):
3191         (WebCore::MediaControlAudioMuteButtonElement::defaultEventHandler):
3192         (WebCore::MediaControlAudioMuteButtonElement::shadowPseudoId):
3193         (WebCore::MediaControlsBlackBerry::MediaControlsBlackBerry):
3194         (WebCore::MediaControls::create):
3195         (WebCore::MediaControlsBlackBerry::createControls):
3196         (WebCore::MediaControlsBlackBerry::setMediaController):
3197         (WebCore::MediaControlsBlackBerry::show):
3198         (WebCore::MediaControlsBlackBerry::hide):
3199         (WebCore::MediaControlsBlackBerry::makeOpaque):
3200         (WebCore::MediaControlsBlackBerry::makeTransparent):
3201         (WebCore::MediaControlsBlackBerry::reset):
3202         (WebCore::MediaControlsBlackBerry::bufferingProgressed):
3203         (WebCore::MediaControlsBlackBerry::playbackStarted):
3204         (WebCore::MediaControlsBlackBerry::playbackProgressed):
3205         (WebCore::MediaControlsBlackBerry::playbackStopped):
3206         (WebCore::MediaControlsBlackBerry::updateCurrentTimeDisplay):
3207         (WebCore::MediaControlsBlackBerry::reportedError):
3208         (WebCore::MediaControlsBlackBerry::changedMute):
3209         (WebCore::MediaControlsBlackBerry::enteredFullscreen):
3210         (WebCore::MediaControlsBlackBerry::exitedFullscreen):
3211         (WebCore::MediaControlsBlackBerry::showVolumeSlider):
3212         (WebCore::MediaControlsBlackBerry::toggleVolumeSlider):
3213         (WebCore::MediaControlsBlackBerry::shouldHideControls):
3214         * html/shadow/MediaControlsBlackBerry.h: Added.
3215         (WebCore):
3216         (MediaControlButtonGroupContainerElement):
3217         (MediaControlTimeDisplayContainerElement):
3218         (MediaControlEmbeddedPanelElement):
3219         (MediaControlFullscreenTimeDisplayContainerElement):
3220         (MediaControlFullscreenButtonContainerElement):
3221         (MediaControlFullscreenButtonDividerElement):
3222         (MediaControlPlayButtonContainerElement):
3223         (MediaControlPlaceholderElement):
3224         (MediaControlFullscreenPlayButtonElement):
3225         (MediaControlFullscreenFullscreenButtonElement):
3226         (MediaControlFullscreenTimelineContainerElement):
3227         (MediaControlFullscreenTimelineElement):
3228         (MediaControlFullscreenTimeRemainingDisplayElement):
3229         (MediaControlFullscreenCurrentTimeDisplayElement):
3230         (MediaControlAudioMuteButtonElement):
3231         (MediaControlsBlackBerry):
3232         * platform/blackberry/RenderThemeBlackBerry.cpp:
3233         (WebCore):
3234         (WebCore::RenderThemeBlackBerry::extraFullScreenStyleSheet):
3235         (WebCore::RenderThemeBlackBerry::adjustSliderThumbSize):
3236         (WebCore::RenderThemeBlackBerry::paintSliderTrackRect):
3237         (WebCore::RenderThemeBlackBerry::adjustMediaControlStyle):
3238         (WebCore::RenderThemeBlackBerry::adjustSliderTrackStyle):
3239         (WebCore::RenderThemeBlackBerry::paintMediaRewindButton):
3240         (WebCore::RenderThemeBlackBerry::paintMediaMuteButton):
3241         (WebCore::RenderThemeBlackBerry::paintMediaFullscreenButton):
3242         (WebCore::RenderThemeBlackBerry::paintMediaSliderTrack):
3243         (WebCore::RenderThemeBlackBerry::paintMediaSliderThumb):
3244         (WebCore::RenderThemeBlackBerry::paintMediaVolumeSliderTrack):
3245         (WebCore::RenderThemeBlackBerry::paintMediaVolumeSliderThumb):
3246         * platform/blackberry/RenderThemeBlackBerry.h:
3247         (WebCore::RenderThemeBlackBerry::usesVerticalVolumeSlider):
3248         (RenderThemeBlackBerry):
3249
3250 2012-12-12  Dominic Mazzoni  <dmazzoni@google.com>
3251
3252         AX: textUnderElement should consider alt text, but skip links and controls
3253         https://bugs.webkit.org/show_bug.cgi?id=101650
3254
3255         Reviewed by Chris Fleizach.
3256
3257         Getting inner text from an element now ignores focusable descendants and
3258         containers, but uses alternative text.
3259
3260         The computation of textUnderElement is now recursive. This caused a crash
3261         if it was called by accessibilityIsIgnored during object destruction,
3262         so I simplified accessibilityIsIgnored to not actually call textUnderElement,
3263         without affecting test results, which should actually be a decent speedup.
3264
3265         Test: accessibility/button-title-uses-inner-img-alt.html
3266         Test: accessibility/focusable-div.html
3267
3268         * accessibility/AccessibilityNodeObject.cpp:
3269         (WebCore):
3270         (WebCore::shouldUseAccessiblityObjectInnerText):
3271         (WebCore::AccessibilityNodeObject::textUnderElement):
3272         * accessibility/AccessibilityRenderObject.cpp:
3273         (WebCore::AccessibilityRenderObject::textUnderElement):
3274
3275 2012-12-12  Eberhard Graether  <egraether@google.com>
3276
3277         Web Inspector: follow up to r136974: handle visibility shortcut in keydown event of ElementsTreeOutline.element
3278         https://bugs.webkit.org/show_bug.cgi?id=104694
3279
3280         Reviewed by Pavel Feldman.
3281
3282         Typing H in the StylesSidebarPane caused toggling of the selected elements visibility. This change only handles
3283         the H keydown when the ElementsPanel is focused.
3284
3285         No new tests.
3286
3287         * inspector/front-end/ElementsTreeOutline.js:
3288         (WebInspector.ElementsTreeOutline):
3289         (WebInspector.ElementsTreeOutline.prototype._onkeydown):
3290         (WebInspector.ElementsTreeOutline.prototype.handleShortcut):
3291         * inspector/front-end/KeyboardShortcut.js:
3292         (WebInspector.KeyboardShortcut.hasNoModifiers):
3293
3294 2012-12-12  Philip Rogers  <pdr@google.com>
3295
3296         Fix target element handling in SVGSMILElement.
3297         https://bugs.webkit.org/show_bug.cgi?id=104495
3298
3299         Reviewed by Abhishek Arya.
3300
3301         This patch fixes two bugs that led to stale target elements in SVGSMILElement.
3302
3303         r122449 changed the <use> code to call removeAllElementReferencesForTarget to rebuild
3304         dependent <use> trees. This contained a bug where element references would be incorrectly
3305         removed. removeAllElementReferencesForTarget calls svgAttributeChanged(href) on all
3306         references, which can then re-add the references back. The bug is that
3307         removeAllElementReferencesForTarget removes a newly-added reference as the last step.
3308
3309         r136906 changed targetElement() to no longer be lazily resolved so any changes to an
3310         animation's href attribute needed to be tracked. r136906 refactored the code but did not
3311         fix a bug where animation elements not in the document would not react to
3312         svgAttributeChanged(href).
3313
3314         The combination of these two bugs allowed stale targetElement references to exist. A
3315         target element could be removed from the document without dependent animation elements
3316         receiving a notification (bug 1) and not reacting to notifications they received (bug 2).
3317
3318         This patch updates SVGUseElement::buildInstanceTree to only rebuild (not remove) the
3319         elements referencing the target by adding rebuildAllElementReferencesForTarget. This patch
3320         also updates SVGSMILElement to correctly react to svgAttributeChanged() notifications
3321         for href changes even when not in the document.
3322
3323         Test: svg/animations/target-condition-crash.html
3324
3325         * svg/SVGDocumentExtensions.cpp:
3326         (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
3327         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget):
3328
3329             Refactored so that we can notify element references to update without removing
3330             references.
3331
3332         * svg/SVGDocumentExtensions.h:
3333         (SVGDocumentExtensions):
3334         * svg/SVGElement.cpp:
3335         (WebCore::SVGElement::~SVGElement):
3336         (WebCore::SVGElement::removedFrom):
3337
3338             Similar to SVGUseElement::buildShadowAndInstanceTree, this callsite was updated to
3339             only rebuild references instead of removing them.
3340
3341         (WebCore::SVGElement::attributeChanged):
3342         * svg/SVGUseElement.cpp:
3343         (WebCore::SVGUseElement::buildShadowAndInstanceTree):
3344
3345             The comment indicates we just want to rebuild (not remove). This callsite has been
3346             updated to use the new rebuildAllElementReferencesForTarget function.
3347
3348         (WebCore::SVGUseElement::buildInstanceTree):
3349         * svg/animation/SVGSMILElement.cpp:
3350         (WebCore::SVGSMILElement::buildPendingResource):
3351         (WebCore::SVGSMILElement::removedFrom):
3352
3353             Previously, if an SVGSMILElement was not in the document, only clearResourceReferences
3354             would be called when the target changed. This has been refactored to reset the
3355             targetElement if the element needs to build resources but is not in the document.
3356
3357             I looked at moving this into clearResourceReferences (since the target element might
3358             be considered a reference) but we run into issues calling pure virtual functions in
3359             the destructor. The current implementation seemed the cleanest.
3360
3361             SVGSMILElement::removedFrom was cleaned up to match the rest of the code. The comment
3362             in removedFrom appears to be stale since disconnectConditions does not kill the element.
3363
3364         (WebCore::SVGSMILElement::svgAttributeChanged):
3365
3366             Removed the bad !inDocument() checks that broke href change notifications.
3367
3368         (WebCore::SVGSMILElement::setTargetElement):
3369
3370 2012-12-12  Alpha Lam  <hclam@chromium.org>
3371
3372         [chromium] Minimize memcpy for encoded image data in ImageFrameGenerator
3373         https://bugs.webkit.org/show_bug.cgi?id=103797
3374
3375         Reviewed by Stephen White.
3376
3377         Added a new class ThreadSafeDataTransport to help transporting data in
3378         SharedBuffer from one thread to another. This class is designed to minimize
3379         thread contention and memory copy.
3380
3381         It is implemented using a data queue. New data segments are copied into
3382         this queue. The queue is then consolidated with existing data when user
3383         requests access to the final SharedBuffer.
3384
3385         Memory is copied into and out of the queue but this approach avoid
3386         copying the entire SharedBuffer.
3387
3388         ImageFrameGenerator is now using this class for data transport between
3389         threads.
3390
3391         Unit tests in ThreadSafeDataTransportTest. Also existing ImageFrameGeneratorTest passes.
3392
3393         * WebCore.gypi:
3394         * platform/graphics/chromium/ImageFrameGenerator.cpp:
3395         (WebCore::ImageFrameGenerator::ImageFrameGenerator):
3396         (WebCore::ImageFrameGenerator::setData):
3397         (WebCore::ImageFrameGenerator::tryToResumeDecodeAndScale):
3398         Added logic to skip decoding if there's no new data.
3399         (WebCore::ImageFrameGenerator::decode):
3400         * platform/graphics/chromium/ImageFrameGenerator.h:
3401         (ImageFrameGenerator):
3402         * platform/graphics/chromium/ThreadSafeDataTransport.cpp: Added.
3403         (WebCore):
3404         (WebCore::ThreadSafeDataTransport::ThreadSafeDataTransport):
3405         (WebCore::ThreadSafeDataTransport::~ThreadSafeDataTransport):