IndexedDB: Introduce putWithIndexKeys and calculate them in the renderer
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-07-16  Alec Flett  <alecflett@chromium.org>
2
3         IndexedDB: Introduce putWithIndexKeys and calculate them in the renderer
4         https://bugs.webkit.org/show_bug.cgi?id=90923
5
6         Reviewed by Darin Fisher.
7
8         Refactor IndexWriter to depend only on IDBIndexMetadata and on
9         (databaseId, objectStoreId, indexId) so that it can talk directly
10         to the backing store, and also eventually be moved into the renderer.
11
12         This also introduces IDBObjectStoreBackendInterface::putWithIndexKeys
13         as a replacement for IDBObjectStoreBackendInterface::put, already
14         stubbed out in the chromium port. It will fully replace put()
15         after both chromium and webkit sides have reached alignment.
16
17         No new tests as this is just a refactor and existing tests cover
18         correctness.
19
20         * Modules/indexeddb/IDBCursor.cpp:
21         (WebCore::IDBCursor::setValueReady):
22         * Modules/indexeddb/IDBIndexBackendImpl.cpp:
23         * Modules/indexeddb/IDBIndexBackendImpl.h:
24         * Modules/indexeddb/IDBObjectStore.h:
25         (IDBObjectStore):
26         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
27         (WebCore::IDBObjectStoreBackendImpl::put):
28         (WebCore):
29         (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
30         (WebCore::IDBObjectStoreBackendImpl::putInternal):
31         (WebCore::IDBObjectStoreBackendImpl::populateIndex):
32         * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
33         (IDBObjectStoreBackendImpl):
34         * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
35         * Modules/indexeddb/IDBRequest.cpp:
36         (WebCore::IDBRequest::onSuccess):
37
38 2012-07-16  Adrienne Walker  <enne@google.com>
39
40         [chromium] Unify compositor quad transforms into content space
41         https://bugs.webkit.org/show_bug.cgi?id=91350
42
43         Reviewed by Kenneth Russell.
44
45         For the purpose of simplification and as a first step towards removing
46         any transform that takes a centered rect, remove the ability of layers
47         to override the quad transform. All quads and quad transforms operate
48         on content space with the origin in the top left.
49
50         The gutter quads used to use the root layer (that doesn't draw
51         content) as the layer to create the shared quad state from. This is
52         now created manually as a layer without bounds should never in general
53         need a shared quad state created for it.
54
55         No change in functionality; tested by existing layout and unit tests.
56
57         * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
58         (WebCore::CCIOSurfaceLayerImpl::appendQuads):
59         * platform/graphics/chromium/cc/CCLayerImpl.cpp:
60         (WebCore::CCLayerImpl::createSharedQuadState):
61         * platform/graphics/chromium/cc/CCLayerImpl.h:
62         (CCLayerImpl):
63         * platform/graphics/chromium/cc/CCRenderPass.cpp:
64         (WebCore::CCRenderPass::appendQuadsToFillScreen):
65         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp:
66         (WebCore::CCSolidColorLayerImpl::appendQuads):
67         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
68         (CCSolidColorLayerImpl):
69         * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
70         (WebCore::CCTextureLayerImpl::appendQuads):
71         * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
72         * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
73         (CCTiledLayerImpl):
74         * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
75         (WebCore::CCVideoLayerImpl::appendQuads):
76
77 2012-07-16  Joshua Bell  <jsbell@chromium.org>
78
79         IndexedDB: Resolve test and IDL FIXMEs for a handful of landed patches
80         https://bugs.webkit.org/show_bug.cgi?id=91423
81
82         Reviewed by Tony Chang.
83
84         IDBObjectStore.createIndex() had a hack to handle a null keyPath argument for the
85         DOMString[] overload and treat it as the string "null". Now that IDL arrays are not
86         nullable by default following r121817 this hack can be removed and the binding layer
87         will automagically coerce to DOMString.
88
89         Test: storage/indexeddb/keypath-basics.html
90
91         * Modules/indexeddb/IDBObjectStore.cpp:
92         (WebCore::IDBObjectStore::createIndex): Remove special case for null in DOMString[] overload.
93         * Modules/indexeddb/IDBObjectStore.idl: Remove Nullable suffix from DOMString[] overload
94         so that the DOMString overload will match null.
95
96 2012-07-16  Bear Travis  <betravis@adobe.com>
97
98         Resolve CSS Exclusions shapeInside, shapeOutside properties to Length based WrapShape classes
99         https://bugs.webkit.org/show_bug.cgi?id=89670
100
101         Reviewed by Dirk Schulze.
102
103         Layout of CSS Exclusions requires length based WrapShape classes,
104         rather than the existing CSSValue based CSSWrapShape classes. This
105         patch adds length based WrapShape analogs to the CSSWrapShapes, and
106         modifies RenderStyle to use a WrapShape instead of a CSSWrapShape.
107         The translation between WrapShape and CSSWrapShape classes
108         is handled by helper functions in the new WrapShapeFunctions files.
109         StyleBuilder resolves CSSWrapShapes to WrapShapes for layout use.
110         CSSComputedStyleDeclaration translates WrapShapes to CSSWrapShapes
111         for style use.
112
113         There are existing tests that cover the style serialization / resolution
114         in fast/exclusions/parsing-wrap-shape-inside.html and
115         fast/exclusions/parsing/wrap-shape-outside.html
116
117         Test: fast/exclusions/parsing-wrap-shape-lengths.html
118
119         * CMakeLists.txt: Build system changes for adding new files
120         * GNUmakefile.list.am: Ditto
121         * Target.pri: Ditto
122         * WebCore.gypi: Ditto
123         * WebCore.vcproj/WebCore.vcproj: Ditto
124         * WebCore.xcodeproj/project.pbxproj: Ditto
125         * css/CSSComputedStyleDeclaration.cpp: Translate WrapShapes back to CSSWrapShapes
126         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
127         * css/CSSWrapShapes.h: Mostly changing functions to be const
128         (WebCore::CSSWrapShapeRectangle::type):
129         (WebCore::CSSWrapShapeCircle::type):
130         (WebCore::CSSWrapShapeEllipse::type):
131         (WebCore::CSSWrapShapePolygon::getXAt):
132         (WebCore::CSSWrapShapePolygon::getYAt):
133         (WebCore::CSSWrapShapePolygon::values):
134         (WebCore::CSSWrapShapePolygon::type):
135         * css/StyleBuilder.cpp: Resolve CSSWrapShapes to WrapShapes
136         (WebCore):
137         (WebCore::ApplyPropertyWrapShape::setValue):
138         (WebCore::ApplyPropertyWrapShape::applyValue):
139         (WebCore::ApplyPropertyWrapShape::createHandler):
140         * css/WrapShapeFunctions.cpp: Added.
141         (WebCore):
142         (WebCore::valueForWrapShape):
143         (WebCore::convertToLength):
144         (WebCore::wrapShapeForValue):
145         * css/WrapShapeFunctions.h: Added.
146         (WebCore):
147         * rendering/style/RenderStyle.h:
148         * rendering/style/StyleRareNonInheritedData.h:
149         (StyleRareNonInheritedData):
150         * rendering/style/WrapShapes.h: Added.
151         (WebCore):
152         (WrapShape):
153         (WebCore::WrapShape::~WrapShape):
154         (WebCore::WrapShape::WrapShape):
155         (WrapShapeRectangle):
156         (WebCore::WrapShapeRectangle::create):
157         (WebCore::WrapShapeRectangle::left):
158         (WebCore::WrapShapeRectangle::top):
159         (WebCore::WrapShapeRectangle::width):
160         (WebCore::WrapShapeRectangle::height):
161         (WebCore::WrapShapeRectangle::cornerRadiusX):
162         (WebCore::WrapShapeRectangle::cornerRadiusY):
163         (WebCore::WrapShapeRectangle::setLeft):
164         (WebCore::WrapShapeRectangle::setTop):
165         (WebCore::WrapShapeRectangle::setWidth):
166         (WebCore::WrapShapeRectangle::setHeight):
167         (WebCore::WrapShapeRectangle::setCornerRadiusX):
168         (WebCore::WrapShapeRectangle::setCornerRadiusY):
169         (WebCore::WrapShapeRectangle::type):
170         (WebCore::WrapShapeRectangle::WrapShapeRectangle):
171         (WrapShapeCircle):
172         (WebCore::WrapShapeCircle::create):
173         (WebCore::WrapShapeCircle::left):
174         (WebCore::WrapShapeCircle::top):
175         (WebCore::WrapShapeCircle::radius):
176         (WebCore::WrapShapeCircle::setLeft):
177         (WebCore::WrapShapeCircle::setTop):
178         (WebCore::WrapShapeCircle::setRadius):
179         (WebCore::WrapShapeCircle::type):
180         (WebCore::WrapShapeCircle::WrapShapeCircle):
181         (WrapShapeEllipse):
182         (WebCore::WrapShapeEllipse::create):
183         (WebCore::WrapShapeEllipse::top):
184         (WebCore::WrapShapeEllipse::left):
185         (WebCore::WrapShapeEllipse::radiusX):
186         (WebCore::WrapShapeEllipse::radiusY):
187         (WebCore::WrapShapeEllipse::setTop):
188         (WebCore::WrapShapeEllipse::setLeft):
189         (WebCore::WrapShapeEllipse::setRadiusX):
190         (WebCore::WrapShapeEllipse::setRadiusY):
191         (WebCore::WrapShapeEllipse::type):
192         (WebCore::WrapShapeEllipse::WrapShapeEllipse):
193         (WrapShapePolygon):
194         (WebCore::WrapShapePolygon::create):
195         (WebCore::WrapShapePolygon::windRule):
196         (WebCore::WrapShapePolygon::values):
197         (WebCore::WrapShapePolygon::getXAt):
198         (WebCore::WrapShapePolygon::getYAt):
199         (WebCore::WrapShapePolygon::setWindRule):
200         (WebCore::WrapShapePolygon::appendPoint):
201         (WebCore::WrapShapePolygon::type):
202         (WebCore::WrapShapePolygon::WrapShapePolygon):
203
204 2012-07-16  Simon Fraser  <simon.fraser@apple.com>
205
206         Fix compositing layers in columns when in paginated mode
207         https://bugs.webkit.org/show_bug.cgi?id=91425
208
209         Reviewed by Dave Hyatt.
210
211         Enhance a hack that was added to allow composited layers to
212         display in columns to work for paginated mode, where the
213         RenderView is renderer with columns.
214
215         Test: compositing/columns/composited-in-paginated.html
216
217         * rendering/RenderLayer.cpp:
218         (WebCore::RenderLayer::updateLayerPosition):
219
220 2012-07-16  Emil A Eklund  <eae@chromium.org>
221
222         Inconsistent rounding in table layout causes background color to bleed through
223         https://bugs.webkit.org/show_bug.cgi?id=91410
224
225         Reviewed by Eric Seidel.
226
227         At certain zoom levels a rounding error in the table layout code cases
228         the table background color to bleed through between cells. Tables layout
229         happens on pixel bounds however the paint offset wasn't correctly rounded.
230
231         Test: fast/sub-pixel/table-rows-no-gaps.html
232
233         * rendering/RenderTable.cpp:
234         (WebCore::RenderTable::paintObject):
235         Round paintOffset before passing it to the paint method of the children.
236
237 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
238
239         Unreviewed, rolling out r122739.
240         http://trac.webkit.org/changeset/122739
241         https://bugs.webkit.org/show_bug.cgi?id=91424
242
243         Broke mac builds (Requested by rniwa on #webkit).
244
245         * inspector/CodeGeneratorInspector.py:
246         (flatten_list):
247
248 2012-07-16  Dana Jansens  <danakj@chromium.org>
249
250         [chromium] Remove non-ephemeral data from RenderSurface as it duplicates data from the owning layer
251         https://bugs.webkit.org/show_bug.cgi?id=91418
252
253         Reviewed by Adrienne Walker.
254
255         This removes the filters and masks from render surfaces, and makes them
256         used directly from the owning layer. Also removes skipsDraw from
257         surfaces as it was just not used at all.
258
259         Covered by existing tests.
260
261         * platform/graphics/chromium/LayerChromium.h:
262         (WebCore::LayerChromium::filters):
263         (WebCore::LayerChromium::backgroundFilters):
264         (WebCore::LayerChromium::hasMask):
265         (WebCore::LayerChromium::hasReplica):
266         (WebCore::LayerChromium::replicaHasMask):
267         (LayerChromium):
268         * platform/graphics/chromium/RenderSurfaceChromium.cpp:
269         (WebCore::RenderSurfaceChromium::RenderSurfaceChromium):
270         * platform/graphics/chromium/RenderSurfaceChromium.h:
271         (RenderSurfaceChromium):
272         * platform/graphics/chromium/cc/CCLayerImpl.h:
273         (WebCore::CCLayerImpl::hasMask):
274         (WebCore::CCLayerImpl::hasReplica):
275         (WebCore::CCLayerImpl::replicaHasMask):
276         (CCLayerImpl):
277         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
278         (WebCore::CCLayerTreeHost::calculateMemoryForRenderSurfaces):
279         * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
280         (WebCore::calculateDrawTransformsInternal):
281         * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
282         (WebCore::::finishedRenderTarget):
283         (WebCore::reduceOcclusionBelowSurface):
284         (WebCore::::leaveToRenderTarget):
285         * platform/graphics/chromium/cc/CCRenderPass.cpp:
286         (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):
287         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
288         (WebCore::CCRenderSurface::drawableContentRect):
289         (WebCore::CCRenderSurface::appendQuads):
290         * platform/graphics/chromium/cc/CCRenderSurface.h:
291         (CCRenderSurface):
292
293 2012-07-16  Beth Dakin  <bdakin@apple.com>
294
295         https://bugs.webkit.org/show_bug.cgi?id=91299
296         Paginated views should restrict available height to column height
297         -and corresponding-
298         <rdar://problem/11152108>
299
300         Reviewed by Dan Bernstein.
301
302         Now that RenderViews can have columns, availableLogicalHeight needs to consider 
303         that column height, much like how availableLogicalWidth already considers column 
304         width.
305
306         availableLogicalHeight is newly virtual, like the already-virtual 
307         availableLogicalWidth.
308         * rendering/RenderBox.h:
309         (RenderBox):
310
311         Check with the columnHeight.
312         * rendering/RenderView.cpp:
313         (WebCore):
314         (WebCore::RenderView::availableLogicalHeight):
315         * rendering/RenderView.h:
316
317         setPagination now takes pageLength as an optional parameter. 
318         * testing/InternalSettings.cpp:
319         (WebCore::InternalSettings::setPagination):
320         * testing/InternalSettings.h:
321         (WebCore::InternalSettings::setPagination):
322         (InternalSettings):
323         * testing/InternalSettings.idl:
324         * testing/Internals.cpp:
325         (WebCore::Internals::setPagination):
326         * testing/Internals.h:
327         (WebCore::Internals::setPagination):
328         (Internals):
329         * testing/Internals.idl:
330
331 2012-07-16  Dana Jansens  <danakj@chromium.org>
332
333         [chromium] Remove targetRenderSurface concept, give layers a renderTarget which is the layer whose coordinate space they draw into
334         https://bugs.webkit.org/show_bug.cgi?id=91288
335
336         Reviewed by Adrienne Walker.
337
338         Always use pointers to layers when discussing render targets instead of
339         pointing directly to a RenderSurface.
340
341         Covered by existing tests.
342
343         * platform/graphics/chromium/LayerChromium.cpp:
344         (WebCore::LayerChromium::LayerChromium):
345         (WebCore::LayerChromium::createRenderSurface):
346         * platform/graphics/chromium/LayerChromium.h:
347         (WebCore::LayerChromium::renderTarget):
348         (WebCore::LayerChromium::setRenderTarget):
349         (LayerChromium):
350         * platform/graphics/chromium/RenderSurfaceChromium.cpp:
351         * platform/graphics/chromium/RenderSurfaceChromium.h:
352         * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
353         (WebCore::ScrollbarLayerChromium::setTexturePriorities):
354         * platform/graphics/chromium/TiledLayerChromium.cpp:
355         (WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
356         * platform/graphics/chromium/cc/CCLayerImpl.cpp:
357         (WebCore::CCLayerImpl::CCLayerImpl):
358         (WebCore::CCLayerImpl::createRenderSurface):
359         (WebCore::CCLayerImpl::dumpLayerProperties):
360         * platform/graphics/chromium/cc/CCLayerImpl.h:
361         (WebCore::CCLayerImpl::renderTarget):
362         (WebCore::CCLayerImpl::setRenderTarget):
363         (CCLayerImpl):
364         * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
365         (WebCore::calculateLayerScissorRect):
366         (WebCore::calculateSurfaceScissorRect):
367         (WebCore::calculateVisibleContentRect):
368         (WebCore::computeScrollCompensationForThisLayer):
369         (WebCore::calculateDrawTransformsInternal):
370         (WebCore::pointIsClippedBySurfaceOrClipRect):
371         * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
372         (WebCore::::enterLayer):
373         (WebCore::::leaveLayer):
374         (WebCore::::enterRenderTarget):
375         (WebCore::::finishedRenderTarget):
376         (WebCore):
377         (WebCore::reduceOcclusionBelowSurface):
378         (WebCore::::leaveToRenderTarget):
379         (WebCore::::markOccludedBehindLayer):
380         (WebCore::::occluded):
381         (WebCore::::unoccludedContentRect):
382         (WebCore::::unoccludedContributingSurfaceContentRect):
383         (WebCore::::layerScissorRectInTargetSurface):
384         * platform/graphics/chromium/cc/CCOcclusionTracker.h:
385         (CCOcclusionTrackerBase):
386         (WebCore::CCOcclusionTrackerBase::StackObject::StackObject):
387         (StackObject):
388         * platform/graphics/chromium/cc/CCQuadCuller.cpp:
389         (WebCore::CCQuadCuller::appendSurface):
390         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
391         * platform/graphics/chromium/cc/CCRenderSurface.h:
392         (CCRenderSurface):
393
394 2012-07-16  Florin Malita  <fmalita@chromium.org>
395
396         SVGAnimationElement::currentValuesForValuesAnimation crash
397         https://bugs.webkit.org/show_bug.cgi?id=91326
398
399         Reviewed by Simon Fraser.
400
401         SVGSMILElement::progress() assumes that seekToIntervalCorrespondingToTime() always
402         lands inside a defined interval, but one can force arbitrary time offsets using
403         setCurrentTime(). This patch adds logic for handling non-interval time offsets
404         gracefully.
405
406         Test: svg/animations/smil-setcurrenttime-crash.svg
407
408         * svg/animation/SVGSMILElement.cpp:
409         (WebCore::SVGSMILElement::progress):
410
411 2012-07-16  Joshua Netterfield  <jnetterfield@rim.com>
412
413         [BlackBerry] Upstream WebGL Code
414         https://bugs.webkit.org/show_bug.cgi?id=91143
415
416         Reviewed by Rob Buis.
417
418         This patch includes BlackBerry-specific fixes for anti-aliasing, logging, and shader compilation.
419
420         No new tests, because there is no new functionality.
421
422         * platform/graphics/GraphicsContext3D.h: Add a value for TI Imagination chipsets on BlackBerry platforms
423         * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp: Multiple downstream changes
424         (WebCore::GraphicsContext3D::GraphicsContext3D):
425         (WebCore::GraphicsContext3D::reshapeFBOs):
426         (WebCore):
427         (WebCore::GraphicsContext3D::logFrameBufferStatus):
428         (WebCore::GraphicsContext3D::readPixelsIMG): BlackBerry-specific fix for Imagination hardware.
429         (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
430         (WebCore::GraphicsContext3D::platformTexture):
431         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
432         (WebCore::GraphicsContext3D::paintToCanvas):
433         * platform/graphics/opengl/Extensions3DOpenGL.h: Remove unnecessary whitespace.
434         (Extensions3DOpenGL):
435         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
436         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Hack to fix ANGLE-generated code on BlackBerry platforms.
437         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
438         (Extensions3DOpenGLCommon):
439         * platform/graphics/opengl/Extensions3DOpenGLES.cpp: I am not in a position to change system headers from correct to incorrect.
440         (WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
441         (WebCore::Extensions3DOpenGLES::supportsExtension):
442         * platform/graphics/opengl/Extensions3DOpenGLES.h: I am not in a position to change system headers from correct to incorrect.
443         (Extensions3DOpenGLES):
444         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Add a BlackBerry-specific anti-aliasing fix.
445         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
446         (WebCore::GraphicsContext3D::prepareTexture):
447         (WebCore::GraphicsContext3D::bindFramebuffer):
448         (WebCore::GraphicsContext3D::compileShader):
449         (WebCore::GraphicsContext3D::copyTexImage2D):
450         (WebCore::GraphicsContext3D::copyTexSubImage2D):
451         (WebCore):
452         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
453         (WebCore):
454
455 2012-07-16  Tony Chang  <tony@chromium.org>
456
457         Position grid items by row/column index
458         https://bugs.webkit.org/show_bug.cgi?id=91293
459
460         Reviewed by Ojan Vafai.
461
462         Do some initial grid positioning. Only handle the simple case where tracks are
463         fixed values and don't properly size the grid items. This gives us something to
464         work with and starts implementing the "Grid Track Sizing Algorithm":
465         http://dev.w3.org/csswg/css3-grid-layout/#grid-track-sizing-algorithm0
466
467         Test: fast/css-grid-layout/place-cell-by-index.html
468
469         * rendering/RenderGrid.cpp:
470         (RenderGrid::GridTrack): Data structure for holding the track size. UsedBreadth matches the terminology
471         used in the spec.
472         (WebCore::RenderGrid::layoutBlock): Pull in some boiler plate code and put the
473         grid specific code in layoutGridItems.
474         (WebCore::RenderGrid::computedUsedBreadthOfGridTracks): Implement part of the grid track sizing algorithm.
475         (WebCore::RenderGrid::layoutGridItems): Compute the size of grid tracks, layout and position children.
476         (WebCore::RenderGrid::findChildLogicalPosition): Map track sizes to the actual position of the child.
477         * rendering/RenderGrid.h:
478         * rendering/style/RenderStyle.h: Just return a copy of Length rather than a reference to Length. This seems
479         more consistent with other getters that return a Length.
480
481 2012-07-16  Sami Kyostila  <skyostil@chromium.org>
482
483         [chromium] Only apply page scale delta to root scroll layer
484         https://bugs.webkit.org/show_bug.cgi?id=91374
485
486         Reviewed by Adrienne Walker.
487
488         When the user pinch-zooms the web page though the Chromium compositor, the
489         per-layer page scale delta is used to keep track of the difference between the
490         page scale on the compositor thread versus the main thread. On the next
491         commit to the main thread these values are reset to 1.
492
493         When calculating layer positions, the compositor applies a layer's page scale
494         delta both to the layer itself as well as all of its children. Since we are
495         currently updating the page scale delta on all scrollable layers, this results
496         in scrollable child layers getting scaled multiple times.
497
498         This patch changes the compositor to only apply the page scale delta on the
499         root scroll layer.
500
501         New unit test: CCLayerTreeHostImplTest.pageScaleDeltaAppliedToRootScrollLayerOnly
502
503         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
504         (WebCore::CCLayerTreeHostImpl::setPageScaleFactorAndLimits):
505         (WebCore::CCLayerTreeHostImpl::setPageScaleDelta):
506
507 2012-07-16  Kihong Kwon  <kihong.kwon@samsung.com>
508
509         Remove setController from BatteryClient
510         https://bugs.webkit.org/show_bug.cgi?id=90944
511
512         Reviewed by Adam Barth.
513
514         BatteryClient doesn't need to keep m_controller,
515         because BatteryController can be accessed using BatteryController::from().
516         Remove BatteryClient::setController function.
517
518         No new tests. Covered by existing tests.
519
520         * Modules/battery/BatteryClient.h:
521         * Modules/battery/BatteryController.cpp:
522         (WebCore::BatteryController::BatteryController):
523
524 2012-07-16  Mike West  <mkwst@chromium.org>
525
526         Invalid `script-nonce` directives should block script execution.
527         https://bugs.webkit.org/show_bug.cgi?id=91353
528
529         Reviewed by Adam Barth.
530
531         If the `script-nonce` Content Security Policy directive contains an
532         invalid value, we should fail loudly, throwing a warning to the console
533         and denying execution of script on the page. The is in line with the
534         current state of the experimental CSP 1.1 Editors Draft[1].
535
536         [1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-nonce--experimental
537
538         Test: http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html
539
540         * page/ContentSecurityPolicy.cpp:
541         (WebCore::CSPDirectiveList::checkNonceAndReportViolation):
542             Check against null rather than empty for early exit, otherwise
543             only compare nonces if the stored nonce isn't empty.
544         (WebCore::CSPDirectiveList::parseScriptNonce):
545             Assign the empty string if nonce is invalid.
546
547 2012-07-16  Min Qin  <qinmin@chromium.org>
548
549         [Android] remove RenderThemeChromiumAndroid::paintMediaFullscreenButton()
550         https://bugs.webkit.org/show_bug.cgi?id=91291
551
552         Reviewed by Adam Barth.
553
554         The recent media control refactoring added paintMediaFullscreenButton() in RenderThemeChromiumSkia.
555         Since RenderThemeChromiumAndroid inherits from that class, we don't need to redefine this function.
556         No test needed as this change just removes an unnecessary override.
557
558         * rendering/RenderThemeChromiumAndroid.cpp:
559         * rendering/RenderThemeChromiumAndroid.h:
560
561 2012-07-16  Peter Rybin  <peter.rybin@gmail.com>
562
563         Web Inspector: CodeGeneratorInspector.py: fix output write logic to support incremental build
564         https://bugs.webkit.org/show_bug.cgi?id=90642
565
566         Reviewed by Yury Semikhatsky.
567
568         A small intermediate writer is added. It handles comparing old and new source before actual writing.
569
570         * inspector/CodeGeneratorInspector.py:
571         (flatten_list):
572         (SmartOutput):
573         (SmartOutput.__init__):
574         (SmartOutput.write):
575         (SmartOutput.close):
576
577 2012-07-16  Dana Jansens  <danakj@chromium.org>
578
579         [chromium] Incorrect assertion: Replicas will cause a RenderPass to be removed twice
580         https://bugs.webkit.org/show_bug.cgi?id=91328
581
582         Reviewed by Adrienne Walker.
583
584         We asserted that we would never attempt to remove a render pass that had
585         already been removed. This was incorrect as a surface with a replica has
586         two quads and both may cause us to attempt its removal. We must handle
587         this case gracefully.
588
589         Test: CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
590
591         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
592         (WebCore::CCLayerTreeHostImpl::CullRenderPassesWithNoQuads::shouldRemoveRenderPass):
593
594 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
595
596         Web Inspector: native memory: fix instrumentation for string members
597         https://bugs.webkit.org/show_bug.cgi?id=91384
598
599         Reviewed by Pavel Feldman.
600
601         It was possible to report a string member via addMember instead of addString.
602         This patch is fixing the problem and adding a link time guard.
603
604         Covered by existing inspector performance tests infrastructure.
605
606         * dom/ElementAttributeData.h:
607         (WebCore::ElementAttributeData::reportMemoryUsage):
608         * dom/MemoryInstrumentation.h:
609         (WebCore):
610         (WebCore::MemoryClassInfo::addString):
611         * dom/QualifiedName.h:
612         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
613
614 2012-07-16  Zoltan Horvath  <zoltan@webkit.org>
615
616         Unreviewed. Remove unnecessary executable bits after r122720.
617
618         * platform/graphics/ImageSource.h:
619         * platform/graphics/qt/ImageBufferQt.cpp:
620         * platform/graphics/qt/ImageDecoderQt.cpp:
621         * platform/graphics/qt/ImageQt.cpp:
622         * platform/graphics/qt/StillImageQt.h:
623         * platform/graphics/qt/TransparencyLayer.h:
624
625 2012-07-16  Zoltan Horvath  <zoltan@webkit.org>
626
627         [Qt] Change NativeImagePtr from QPixmap* to QImage*
628         https://bugs.webkit.org/show_bug.cgi?id=88785
629
630         Reviewed by Simon Hausmann.
631
632         Since we use raster engine there is no difference between QPixmap and QImage, so we are going
633         to use QImage everywhere where it is possible. This refactoring contains the change of the
634         NativeImagePtr typedef from QPixmap* to QImage* and covers the related modifications.
635
636         Part of the change is similar to Viatcheslav Ostapenko's internal work.
637
638         Covered by existing tests.
639
640         * bridge/qt/qt_pixmapruntime.cpp:
641         (JSC::Bindings::QtPixmapAssignToElementMethod::invoke):
642         (JSC::Bindings::QtPixmapInstance::variantFromObject):
643         * platform/DragImage.h:
644         (WebCore):
645         * platform/graphics/GraphicsContext.h:
646         (GraphicsContext):
647         * platform/graphics/Image.h:
648         (Image):
649         * platform/graphics/ImageSource.h:
650         (WebCore):
651         * platform/graphics/gstreamer/ImageGStreamer.h:
652         * platform/graphics/gstreamer/ImageGStreamerQt.cpp:
653         (ImageGStreamer::ImageGStreamer):
654         * platform/graphics/qt/GraphicsContext3DQt.cpp:
655         (WebCore::GraphicsContext3D::getImageData):
656         * platform/graphics/qt/GraphicsContextQt.cpp:
657         (WebCore::GraphicsContext::pushTransparencyLayerInternal):
658         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
659         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
660         * platform/graphics/qt/ImageBufferDataQt.h:
661         (ImageBufferData):
662         * platform/graphics/qt/ImageBufferQt.cpp:
663         (WebCore::ImageBufferData::ImageBufferData):
664         (WebCore::ImageBuffer::copyImage):
665         (WebCore::ImageBuffer::clip):
666         (WebCore::ImageBuffer::platformTransformColorSpace):
667         (WebCore::getImageData):
668         (WebCore::ImageBuffer::putByteArray):
669         (WebCore::encodeImage):
670         (WebCore::ImageBuffer::toDataURL):
671         * platform/graphics/qt/ImageDecoderQt.cpp:
672         (WebCore::ImageFrame::asNewNativeImage):
673         * platform/graphics/qt/ImageQt.cpp:
674         (graphics):
675         (loadResourceImage):
676         (WebCore::Image::loadPlatformResource):
677         (WebCore::Image::setPlatformResource):
678         (WebCore::Image::drawPattern):
679         (WebCore::BitmapImage::BitmapImage):
680         (WebCore::BitmapImage::draw):
681         (WebCore::BitmapImage::checkForSolidColor):
682         (WebCore::BitmapImage::create):
683         * platform/graphics/qt/NativeImageQt.h: Added.
684         (WebCore):
685         (NativeImageQt):
686         (WebCore::NativeImageQt::defaultFormatForAlphaEnabledImages):
687         (WebCore::NativeImageQt::defaultFormatForOpaqueImages):
688          * platform/graphics/qt/PatternQt.cpp:
689         (WebCore::Pattern::createPlatformPattern):
690         * platform/graphics/qt/StillImageQt.cpp:
691         (WebCore::StillImage::StillImage):
692         (WebCore::StillImage::~StillImage):
693         (WebCore::StillImage::currentFrameHasAlpha):
694         (WebCore::StillImage::size):
695         (WebCore::StillImage::nativeImageForCurrentFrame):
696         (WebCore::StillImage::draw):
697         * platform/graphics/qt/StillImageQt.h:
698         (WebCore::StillImage::create):
699         (WebCore::StillImage::createForRendering):
700         (StillImage):
701         * platform/graphics/qt/TransparencyLayer.h:
702         (WebCore::TransparencyLayer::TransparencyLayer):
703         (TransparencyLayer):
704         * platform/graphics/texmap/TextureMapperGL.cpp:
705         * platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp:
706         (WebCore::GraphicsSurface::createReadOnlyImage):
707          * platform/qt/ClipboardQt.cpp:
708         (WebCore::ClipboardQt::createDragImage):
709         (WebCore::ClipboardQt::declareAndWriteDragImage):
710         * platform/qt/CursorQt.cpp:
711         (WebCore::createCustomCursor):
712         * platform/qt/DragImageQt.cpp:
713         (WebCore::createDragImageFromImage):
714         * platform/qt/PasteboardQt.cpp:
715         (WebCore::Pasteboard::writeImage):
716
717 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
718
719         Web Inspector: moving forward to the better memory instrumentation API
720         https://bugs.webkit.org/show_bug.cgi?id=91259
721
722         Reviewed by Pavel Feldman.
723
724         I'm trying to remove unnecessary complexity of the API
725         reportInstrumentedObject and reportInstrumentedPointer will be replaced with addInstrumentedMember
726         The same will happen with reportPointer, reportObject pair.
727         Also info.report* will be replaced with info.add*
728
729         * bindings/js/ScriptWrappable.h:
730         (WebCore::ScriptWrappable::reportMemoryUsage):
731         * bindings/v8/DOMDataStore.cpp:
732         (WebCore::DOMDataStore::reportMemoryUsage):
733         * bindings/v8/IntrusiveDOMWrapperMap.h:
734         (WebCore::ChunkedTable::reportMemoryUsage):
735         * bindings/v8/ScriptProfiler.cpp:
736         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
737         * bindings/v8/ScriptWrappable.h:
738         (WebCore::ScriptWrappable::reportMemoryUsage):
739         * bindings/v8/V8Binding.cpp:
740         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
741         (WebCore::StringCache::reportMemoryUsage):
742         * bindings/v8/V8DOMMap.h:
743         * css/StylePropertySet.h:
744         (WebCore::StylePropertySet::reportMemoryUsage):
745         * dom/CharacterData.cpp:
746         (WebCore::CharacterData::reportMemoryUsage):
747         * dom/ContainerNode.h:
748         (WebCore::ContainerNode::reportMemoryUsage):
749         * dom/Document.cpp:
750         (WebCore::Document::reportMemoryUsage):
751         * dom/Element.h:
752         (WebCore::Element::reportMemoryUsage):
753         * dom/ElementAttributeData.h:
754         (WebCore::ElementAttributeData::reportMemoryUsage):
755         * dom/MemoryInstrumentation.h:
756         (WebCore::MemoryInstrumentation::addInstrumentedMember):
757         (MemoryInstrumentation):
758         (WebCore::MemoryInstrumentation::addMember):
759         (WebCore::MemoryInstrumentation::OwningTraits::addInstrumentedMember):
760         (WebCore::MemoryInstrumentation::OwningTraits::addMember):
761         (WebCore::MemoryInstrumentation::addInstrumentedMemberImpl):
762         (WebCore::MemoryInstrumentation::addMemberImpl):
763         (WebCore::MemoryClassInfo::addInstrumentedMember):
764         (WebCore::MemoryClassInfo::addMember):
765         (WebCore::MemoryClassInfo::addHashMap):
766         (WebCore::MemoryClassInfo::addHashSet):
767         (WebCore::MemoryClassInfo::addListHashSet):
768         (WebCore::MemoryClassInfo::addVector):
769         (WebCore::MemoryClassInfo::addString):
770         (WebCore::MemoryInstrumentation::addHashMap):
771         (WebCore::MemoryInstrumentation::addHashSet):
772         (WebCore::MemoryInstrumentation::addListHashSet):
773         (WebCore::MemoryInstrumentation::addVector):
774         * dom/Node.cpp:
775         (WebCore::Node::reportMemoryUsage):
776         * dom/QualifiedName.h:
777         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
778         (WebCore::QualifiedName::reportMemoryUsage):
779         * inspector/InspectorMemoryAgent.cpp:
780         (WebCore):
781         * platform/TreeShared.h:
782         (WebCore::TreeShared::reportMemoryUsage):
783
784 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
785
786         Unreviewed, rolling out r122714.
787         http://trac.webkit.org/changeset/122714
788         https://bugs.webkit.org/show_bug.cgi?id=91380
789
790         It broke mac compilation (Requested by loislo on #webkit).
791
792         * bindings/js/ScriptWrappable.h:
793         (WebCore::ScriptWrappable::reportMemoryUsage):
794         * bindings/v8/DOMDataStore.cpp:
795         (WebCore::DOMDataStore::reportMemoryUsage):
796         * bindings/v8/IntrusiveDOMWrapperMap.h:
797         (WebCore::ChunkedTable::reportMemoryUsage):
798         * bindings/v8/ScriptProfiler.cpp:
799         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
800         * bindings/v8/ScriptWrappable.h:
801         (WebCore::ScriptWrappable::reportMemoryUsage):
802         * bindings/v8/V8Binding.cpp:
803         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
804         (WebCore::StringCache::reportMemoryUsage):
805         * bindings/v8/V8DOMMap.h:
806         * css/StylePropertySet.h:
807         (WebCore::StylePropertySet::reportMemoryUsage):
808         * dom/CharacterData.cpp:
809         (WebCore::CharacterData::reportMemoryUsage):
810         * dom/ContainerNode.h:
811         (WebCore::ContainerNode::reportMemoryUsage):
812         * dom/Document.cpp:
813         (WebCore::Document::reportMemoryUsage):
814         * dom/Element.h:
815         (WebCore::Element::reportMemoryUsage):
816         * dom/ElementAttributeData.h:
817         (WebCore::ElementAttributeData::reportMemoryUsage):
818         * dom/MemoryInstrumentation.h:
819         (WebCore::MemoryInstrumentation::reportObject):
820         (MemoryInstrumentation):
821         (WebCore::MemoryInstrumentation::reportPointer):
822         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
823         (WebCore::MemoryClassInfo::reportInstrumentedObject):
824         (WebCore::MemoryClassInfo::reportPointer):
825         (WebCore::MemoryClassInfo::reportObject):
826         (WebCore::MemoryClassInfo::reportHashMap):
827         (WebCore::MemoryClassInfo::reportHashSet):
828         (WebCore::MemoryClassInfo::reportListHashSet):
829         (WebCore::MemoryClassInfo::reportVector):
830         (MemoryClassInfo):
831         (WebCore::MemoryClassInfo::reportString):
832         (WebCore):
833         (WebCore::MemoryInstrumentation::reportInstrumentedPointer):
834         (WebCore::MemoryInstrumentation::reportInstrumentedObject):
835         (WebCore::MemoryInstrumentation::reportHashMap):
836         (WebCore::MemoryInstrumentation::reportHashSet):
837         (WebCore::MemoryInstrumentation::reportListHashSet):
838         (WebCore::MemoryInstrumentation::reportVector):
839         * dom/Node.cpp:
840         (WebCore::Node::reportMemoryUsage):
841         * dom/QualifiedName.h:
842         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
843         (WebCore::QualifiedName::reportMemoryUsage):
844         * inspector/InspectorMemoryAgent.cpp:
845         (WebCore):
846         * platform/TreeShared.h:
847         (WebCore::TreeShared::reportMemoryUsage):
848
849 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
850
851         Web Inspector: moving forward to the better memory instrumentation API
852         https://bugs.webkit.org/show_bug.cgi?id=91259
853
854         Reviewed by Pavel Feldman.
855
856         I'm trying to remove unnecessary complexity of the API
857         reportInstrumentedObject and reportInstrumentedPointer will be replaced with addInstrumentedMember
858         The same will happen with reportPointer, reportObject pair.
859         Also info.report* will be replaced with info.add*
860
861         * bindings/js/ScriptWrappable.h:
862         (WebCore::ScriptWrappable::reportMemoryUsage):
863         * bindings/v8/DOMDataStore.cpp:
864         (WebCore::DOMDataStore::reportMemoryUsage):
865         * bindings/v8/IntrusiveDOMWrapperMap.h:
866         (WebCore::ChunkedTable::reportMemoryUsage):
867         * bindings/v8/ScriptProfiler.cpp:
868         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
869         * bindings/v8/ScriptWrappable.h:
870         (WebCore::ScriptWrappable::reportMemoryUsage):
871         * bindings/v8/V8Binding.cpp:
872         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
873         (WebCore::StringCache::reportMemoryUsage):
874         * bindings/v8/V8DOMMap.h:
875         * css/StylePropertySet.h:
876         (WebCore::StylePropertySet::reportMemoryUsage):
877         * dom/CharacterData.cpp:
878         (WebCore::CharacterData::reportMemoryUsage):
879         * dom/ContainerNode.h:
880         (WebCore::ContainerNode::reportMemoryUsage):
881         * dom/Document.cpp:
882         (WebCore::Document::reportMemoryUsage):
883         * dom/Element.h:
884         (WebCore::Element::reportMemoryUsage):
885         * dom/ElementAttributeData.h:
886         (WebCore::ElementAttributeData::reportMemoryUsage):
887         * dom/MemoryInstrumentation.h:
888         (WebCore::MemoryInstrumentation::addInstrumentedMember):
889         (MemoryInstrumentation):
890         (WebCore::MemoryInstrumentation::addMember):
891         (WebCore::MemoryInstrumentation::OwningTraits::addInstrumentedMember):
892         (WebCore::MemoryInstrumentation::OwningTraits::addMember):
893         (WebCore::MemoryInstrumentation::addInstrumentedMemberImpl):
894         (WebCore::MemoryInstrumentation::addMemberImpl):
895         (WebCore::MemoryClassInfo::addInstrumentedMember):
896         (WebCore::MemoryClassInfo::addMember):
897         (WebCore::MemoryClassInfo::addHashMap):
898         (WebCore::MemoryClassInfo::addHashSet):
899         (WebCore::MemoryClassInfo::addListHashSet):
900         (WebCore::MemoryClassInfo::addVector):
901         (WebCore::MemoryClassInfo::addString):
902         (WebCore::MemoryInstrumentation::addHashMap):
903         (WebCore::MemoryInstrumentation::addHashSet):
904         (WebCore::MemoryInstrumentation::addListHashSet):
905         (WebCore::MemoryInstrumentation::addVector):
906         * dom/Node.cpp:
907         (WebCore::Node::reportMemoryUsage):
908         * dom/QualifiedName.h:
909         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
910         (WebCore::QualifiedName::reportMemoryUsage):
911         * inspector/InspectorMemoryAgent.cpp:
912         (WebCore):
913         * platform/TreeShared.h:
914         (WebCore::TreeShared::reportMemoryUsage):
915
916 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
917
918         Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo
919         https://bugs.webkit.org/show_bug.cgi?id=91227
920
921         Reviewed by Pavel Feldman.
922
923         void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
924         {
925             MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
926             info.visitBaseClass<ScriptWrappable>(this);
927
928             info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference
929             info.addInstrumentedMember(m_next);
930             info.addHashSet<MemoryInstrumentation::NonClass>(m_aHash);                // NonClass value_type (report only size of internal template structures)
931             info.addHashSet<MemoryInstrumentation::NotInstrumentedClass>(m_aHashSet); // not instrumented value_type (use sizeof)
932             info.addHashSet<MemoryInstrumentation::InstrumentedClass>(m_aHashSet);    // instrumented value_type (call visit)
933         }
934
935         The change is covered by existing tests for native memory snapshot.
936
937         * bindings/v8/DOMDataStore.cpp:
938         (WebCore::DOMDataStore::reportMemoryUsage):
939         * bindings/v8/IntrusiveDOMWrapperMap.h:
940         (WebCore::ChunkedTable::reportMemoryUsage):
941         * bindings/v8/ScriptWrappable.h:
942         (WebCore::ScriptWrappable::reportMemoryUsage):
943         * bindings/v8/V8Binding.cpp:
944         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
945         (WebCore::StringCache::reportMemoryUsage):
946         * bindings/v8/V8DOMMap.h:
947         * css/StylePropertySet.h:
948         (WebCore::StylePropertySet::reportMemoryUsage):
949         * dom/CharacterData.cpp:
950         (WebCore::CharacterData::reportMemoryUsage):
951         * dom/ContainerNode.h:
952         (WebCore::ContainerNode::reportMemoryUsage):
953         * dom/Document.cpp:
954         (WebCore::Document::reportMemoryUsage):
955         * dom/Element.h:
956         (WebCore::Element::reportMemoryUsage):
957         * dom/ElementAttributeData.h:
958         (WebCore::ElementAttributeData::reportMemoryUsage):
959         * dom/MemoryInstrumentation.h:
960         (MemoryInstrumentation):
961         (WebCore::MemoryObjectInfo::objectType):
962         (WebCore::MemoryObjectInfo::objectSize):
963         (WebCore::MemoryObjectInfo::memoryInstrumentation):
964         (MemoryObjectInfo):
965         (WebCore::MemoryObjectInfo::reportObjectInfo):
966         (WebCore):
967         (MemoryClassInfo):
968         (WebCore::MemoryClassInfo::MemoryClassInfo):
969         (WebCore::MemoryClassInfo::visitBaseClass):
970         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
971         (WebCore::MemoryClassInfo::reportInstrumentedObject):
972         (WebCore::MemoryClassInfo::reportPointer):
973         (WebCore::MemoryClassInfo::reportObject):
974         (WebCore::MemoryClassInfo::reportHashMap):
975         (WebCore::MemoryClassInfo::reportHashSet):
976         (WebCore::MemoryClassInfo::reportListHashSet):
977         (WebCore::MemoryClassInfo::reportVector):
978         (WebCore::MemoryClassInfo::reportString):
979         * dom/Node.cpp:
980         (WebCore::Node::reportMemoryUsage):
981         * dom/QualifiedName.h:
982         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
983         (WebCore::QualifiedName::reportMemoryUsage):
984         * platform/TreeShared.h:
985         (WebCore::TreeShared::reportMemoryUsage):
986
987 2012-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
988
989         Unreviewed. Fix make distcheck.
990
991         * GNUmakefile.am: Add missing idl directory.
992         * GNUmakefile.list.am: Add missing files to compilation.
993
994 2012-07-16  Eugene Klyuchnikov  <eustas.big@gmail.com>
995
996         Web Inspector: Implement message loop instrumentation for timeline
997         https://bugs.webkit.org/show_bug.cgi?id=88325
998
999         Reviewed by Pavel Feldman.
1000
1001         Message loop instrumentation will show when the render thread is busy.
1002
1003         * inspector/front-end/Settings.js:
1004         (WebInspector.ExperimentsSettings):
1005         Added new experiment.
1006         * inspector/front-end/TimelineGrid.js:
1007         (WebInspector.TimelineGrid.prototype.get dividersLabelBarElement):
1008         Exposed label bar element.
1009         * inspector/front-end/TimelinePanel.js:
1010         (WebInspector.TimelinePanel):
1011         (WebInspector.TimelinePanel.prototype._resetPanel):
1012         Cleanups recorded tasks.
1013         (WebInspector.TimelinePanel.prototype._refresh):
1014         Updates CPU bar.
1015         (WebInspector.TimelinePanel.prototype._refreshRecords):
1016         Ditto.
1017         (WebInspector.TimelinePanel.prototype._refreshCpuBars.compareEndTime):
1018         Ditto.
1019         (WebInspector.TimelinePanel.prototype._refreshCpuBars):
1020         Ditto.
1021         (WebInspector.TimelinePanel.prototype._enableMainThreadMonitoringExperiment):
1022         Adds CPU bar to UI.
1023         (WebInspector.TimelinePanel.prototype._showPopover):
1024         Fix NPE.
1025         (WebInspector.TimelineCalculator.prototype.computeTime):
1026         Utility for position to time conversion.
1027         (WebInspector.TimelineCalculator.prototype.setDisplayWindow):
1028         Remenbers clientWidth.
1029         * inspector/front-end/TimelinePresentationModel.js:
1030         (WebInspector.TimelinePresentationModel.categories):
1031         Define CPU bar colors.
1032         * inspector/front-end/timelinePanel.css:
1033         (.timeline-cpu-bars):
1034         CPU bar styles.
1035         (.timeline-cpu-bars-label):
1036         Ditto.
1037
1038 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
1039
1040         Unreviewed, rolling out r122681.
1041         http://trac.webkit.org/changeset/122681
1042         https://bugs.webkit.org/show_bug.cgi?id=91363
1043
1044         Patch introduces crashes in debug builds for GTK and EFL ports
1045         (Requested by zdobersek on #webkit).
1046
1047         * platform/ScrollableArea.cpp:
1048         (WebCore::ScrollableArea::scrollPositionChanged):
1049
1050 2012-07-16  Luke Macpherson  <macpherson@chromium.org>
1051
1052         Compilation failure in StyleResolver.cpp (clang)
1053         https://bugs.webkit.org/show_bug.cgi?id=89892
1054
1055         Reviewed by Ryosuke Niwa.
1056
1057         Patch adds assertions that unreachable code is in fact not reached.
1058
1059         Covered by fast/css/variables tests.
1060
1061         * css/CSSParser.cpp:
1062         (WebCore::CSSParser::parseValue):
1063         * css/StyleResolver.cpp:
1064         (WebCore::StyleResolver::collectMatchingRulesForList):
1065
1066 2012-07-15  Mike Lawther  <mikelawther@chromium.org>
1067
1068         Fix calculation of rgba's alpha in CSS custom text
1069         https://bugs.webkit.org/show_bug.cgi?id=91355
1070
1071         Reviewed by Ryosuke Niwa.
1072
1073         Alpha values are stored as an 8 bit value. To convert this to a float in the
1074         range [0,1], we need to divide by 255, not 256. 
1075
1076         Test: fast/css/rgba-custom-text.html
1077
1078         * css/CSSPrimitiveValue.cpp:
1079         (WebCore::CSSPrimitiveValue::customCssText):
1080
1081 2012-07-15  Jason Liu  <jason.liu@torchmobile.com.cn>
1082
1083         [BlackBerry] We shouldn't call didFinishLoading for the old request when a new request has been sent by notifyAuthReceived.
1084         https://bugs.webkit.org/show_bug.cgi?id=90962
1085
1086         Reviewed by Rob Buis.
1087
1088         We start a new NetworkJob with credentials after receiving 401/407 status.
1089         We should not release resources in webcore when the old job is closed because
1090         they are needed by the new one.
1091         We should do as 3XX.
1092
1093         No new tests. No change in behaviour.
1094
1095         * platform/network/blackberry/NetworkJob.cpp:
1096         (WebCore::NetworkJob::NetworkJob):
1097         (WebCore::NetworkJob::notifyAuthReceived):
1098         (WebCore::NetworkJob::shouldReleaseClientResource):
1099         (WebCore::NetworkJob::handleRedirect):
1100         * platform/network/blackberry/NetworkJob.h:
1101         (NetworkJob):
1102
1103 2012-07-15  Ryosuke Niwa  <rniwa@webkit.org>
1104
1105         REGRESSION(r122660): Cannot iterate over HTMLCollection that contains non-child descendent nodes in some conditions
1106         https://bugs.webkit.org/show_bug.cgi?id=91334
1107
1108         Reviewed by Ojan Vafai.
1109
1110         The bug was caused by using lastChild() as the starting node for traversePreviousNode. Since it's the inverse of
1111         Node::traverseNextNode(), which visits nodes in pre order, we must start our search from the last descendent node,
1112         which is visited traverseNextNode immediately before reaching the root node.
1113
1114         Test: fast/dom/htmlcollection-backwards-subtree-iteration.html
1115
1116         * html/HTMLCollection.cpp:
1117         (WebCore::lastDescendent):
1118         (WebCore):
1119         (WebCore::itemBeforeOrAfter):
1120
1121 2012-07-15  Joseph Pecoraro  <pecoraro@apple.com>
1122
1123         Windowless WebView not firing JavaScript load event if there is a media element
1124         https://bugs.webkit.org/show_bug.cgi?id=91331
1125
1126         Reviewed by Eric Carlson.
1127
1128         In prepareForLoad we start deferring the load event. If we fall into this
1129         clause where the page can not start loading media we bail, potentially
1130         indefinitely waiting until we can start loading media. Since we can not
1131         be certain this will ever happen, we should stop deferring the page's
1132         load event.
1133
1134         Test: WebKit1.WindowlessWebViewWithMedia TestWebKitAPI test. The only
1135         way this path was reachable right now is on the mac port.
1136
1137         * html/HTMLMediaElement.cpp:
1138         (WebCore::HTMLMediaElement::loadInternal):
1139
1140 2012-07-15  Dan Bernstein  <mitz@apple.com>
1141
1142         <rdar://problem/11875795> REGRESSION (tiled drawing): Page’s scroll bars flash with each character you type in a textarea (affects Wikipedia and YouTube)
1143         https://bugs.webkit.org/show_bug.cgi?id=91348
1144
1145         Reviewed by Anders Carlsson.
1146
1147         * platform/ScrollableArea.cpp:
1148         (WebCore::ScrollableArea::scrollPositionChanged): Added an early return if the scroll position
1149         did not, in fact, change. This avoids the call to ScrollAnimator::notifyContentAreaScrolled,
1150         which is what causes the scroll bars to flash.
1151
1152 2012-07-14  Eric Carlson  <eric.carlson@apple.com>
1153
1154         Enable AVCF hardware video decoding
1155         https://bugs.webkit.org/show_bug.cgi?id=90015
1156         <rdar://problem/10770317>
1157
1158         Reviewed by Anders Carlsson.
1159
1160         * html/HTMLMediaElement.cpp:
1161         (WebCore):
1162         (WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): New, return the client's graphics 
1163             device adapter.
1164         * html/HTMLMediaElement.h:
1165
1166         * page/ChromeClient.h:
1167         (WebCore::ChromeClient::graphicsDeviceAdapter): New.
1168
1169         * platform/graphics/MediaPlayer.cpp:
1170         (WebCore::MediaPlayer::graphicsDeviceAdapter): New, ask the media element for the graphics
1171             device adapter.
1172         * platform/graphics/MediaPlayer.h:
1173
1174         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Soft-link AVCFPlayerSetDirect3DDevice
1175             and AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey.
1176
1177         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: 
1178         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Pass the current d3d9
1179             device interface to the AVFWrapper.
1180         (WebCore::AVFWrapper::createAssetForURL): If the d3d9 device implements IDirect3DDevice9Ex,
1181             tell the AVAsset to enable hardware video decoding.
1182         (WebCore::AVFWrapper::createPlayer): Pass the d3d9 device to the player if it implements IDirect3DDevice9Ex.
1183
1184         * platform/graphics/ca/win/CACFLayerTreeHost.h:
1185         (WebCore::CACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
1186
1187         * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
1188         (WebCore::LegacyCACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
1189         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
1190         (WebCore::WKCACFViewLayerTreeHost::graphicsDeviceAdapter): New.
1191         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
1192
1193         * platform/win/SoftLinking.h: Define SOFT_LINK_DLL_IMPORT_OPTIONAL, SOFT_LINK_LOADED_LIBRARY,
1194             and SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL.
1195
1196 2012-07-14  Ryosuke Niwa  <rniwa@webkit.org>
1197
1198         Fix Chromium Mac build failure after r122670.
1199
1200         * platform/graphics/mac/ComplexTextController.cpp:
1201
1202 2012-07-14  Mark Rowe  <mrowe@apple.com>
1203
1204         Fix the Snow Leopard build.
1205
1206         * platform/LocalizedStrings.cpp:
1207         (WebCore::contextMenuItemTagLookUpInDictionary): Fix a typo in the condition so that Snow Leopard
1208         continues to take the expected path.
1209
1210 2012-07-14  Ryosuke Niwa  <rniwa@webkit.org>
1211
1212         Accessing the last item in children should be a constant time operation
1213         https://bugs.webkit.org/show_bug.cgi?id=91320
1214
1215         Reviewed by Ojan Vafai.
1216
1217         Traverse nodes from the last item when the target offset we're looking for is closer to the last item
1218         than to the cached item. e.g. if the cached item was at offset 0 in the collection and length was 100,
1219         we should not be looking for the item at offset 95 from the cached item.
1220
1221         Note that this trick can be only used in HTML collection that supports itemBefore and when the length
1222         cache is available.
1223
1224         Also broke shouldSearchFromFirstItem into smaller logical pieces to clarify the intents.
1225
1226         Test: perf/htmlcollection-last-item.html
1227
1228         * html/HTMLCollection.cpp:
1229         (WebCore):
1230         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
1231         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
1232         (WebCore::HTMLCollection::item):
1233         * html/HTMLCollection.h:
1234         (HTMLCollection):
1235
1236 2012-07-14  Mark Rowe  <mrowe@apple.com>
1237
1238         Fix the Windows build.
1239
1240         * platform/network/cf/DNSCFNet.cpp: Fix the condition to take Windows in to account.
1241
1242 2012-07-14  Mark Rowe  <mrowe@apple.com>
1243
1244         Make it explicit which code paths iOS should use when doing checks based on OS X versions.
1245
1246         Rubber-stamped by David Kilzer.
1247
1248         * WebCore.exp.in:
1249         * accessibility/AccessibilityList.h:
1250         * accessibility/AccessibilityTable.h:
1251         * accessibility/mac/AXObjectCacheMac.mm:
1252         * editing/mac/EditorMac.mm:
1253         * loader/MainResourceLoader.cpp:
1254         * loader/MainResourceLoader.h:
1255         * page/AlternativeTextClient.h:
1256         * page/mac/SettingsMac.mm:
1257         * platform/LocalizedStrings.cpp:
1258         * platform/MemoryPressureHandler.cpp:
1259         * platform/audio/mac/AudioBusMac.mm:
1260         * platform/graphics/Gradient.h:
1261         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1262         * platform/graphics/ca/GraphicsLayerCA.cpp:
1263         * platform/graphics/ca/PlatformCALayer.h:
1264         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1265         * platform/graphics/ca/mac/TileCache.mm:
1266         * platform/graphics/cg/GraphicsContextCG.cpp:
1267         * platform/graphics/cg/ImageBufferCG.cpp:
1268         * platform/graphics/cg/ImageBufferDataCG.h:
1269         * platform/graphics/cg/ImageCG.cpp:
1270         * platform/graphics/cg/ImageSourceCG.cpp:
1271         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1272         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1273         * platform/graphics/mac/ComplexTextController.cpp:
1274         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1275         * platform/graphics/mac/FontCacheMac.mm:
1276         * platform/graphics/mac/FontCustomPlatformData.cpp:
1277         * platform/graphics/mac/FontMac.mm:
1278         * platform/graphics/mac/GraphicsContextMac.mm:
1279         * platform/graphics/mac/SimpleFontDataMac.mm:
1280         * platform/graphics/mac/WebLayer.h:
1281         * platform/graphics/mac/WebLayer.mm:
1282         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1283         * platform/mac/DisplaySleepDisabler.cpp:
1284         * platform/mac/DisplaySleepDisabler.h:
1285         * platform/mac/HTMLConverter.h:
1286         * platform/mac/HTMLConverter.mm:
1287         * platform/mac/MemoryPressureHandlerMac.mm:
1288         * platform/mac/SharedTimerMac.mm:
1289         * platform/mac/SuddenTermination.mm:
1290         * platform/mac/WebFontCache.mm:
1291         * platform/network/Credential.h:
1292         * platform/network/ResourceHandle.h:
1293         * platform/network/cf/DNSCFNet.cpp:
1294         * platform/network/cf/ProxyServerCFNet.cpp:
1295         * platform/network/cf/ResourceRequest.h:
1296         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1297         * platform/network/mac/AuthenticationMac.mm:
1298         * platform/network/mac/CookieStorageMac.mm:
1299         * platform/network/mac/ResourceHandleMac.mm:
1300         * platform/network/mac/ResourceRequestMac.mm:
1301         * platform/network/mac/WebCoreURLResponse.mm:
1302         * platform/text/TextChecking.h:
1303         * platform/text/cf/HyphenationCF.cpp:
1304         * platform/text/mac/HyphenationMac.mm:
1305         * rendering/RenderLayerBacking.cpp:
1306         * rendering/RenderLayerCompositor.cpp:
1307
1308 2012-07-14  Sheriff Bot  <webkit.review.bot@gmail.com>
1309
1310         Unreviewed, rolling out r122614.
1311         http://trac.webkit.org/changeset/122614
1312         https://bugs.webkit.org/show_bug.cgi?id=91317
1313
1314         Broke performance tests (Requested by rniwa on #webkit).
1315
1316         * bindings/v8/V8Binding.cpp:
1317         (WebCore::StringCache::v8ExternalStringSlow):
1318
1319 2012-07-05  Robert Hogan  <robert@webkit.org>
1320
1321         CSS 2.1 failure: vertical-align-boxes-001 fails
1322         https://bugs.webkit.org/show_bug.cgi?id=90626
1323
1324         Reviewed by Eric Seidel.
1325
1326         Tests: css2.1/20110323/vertical-align-boxes-001.htm
1327
1328         A percentage value vertical-align is always a percentage of the actual line-height rather than
1329         the margin box per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages: 
1330         refer to the 'line-height' of the element itself'.  Confusingly, RenderBox::lineheight() is a
1331         shorthand into the dimensions of the margin box for replaced elements in the other vertical-align
1332         cases, i.e. where it's the margin box that's relevant rather than the 'line-height'. So rather than patch RenderBox's
1333         lineHeight() to somehow consider the percentage cases, just give percentage vertical-align the full computedLineHeight()
1334         rather than lineHeight()'s margin box.
1335
1336         * rendering/RootInlineBox.cpp:
1337         (WebCore::RootInlineBox::verticalPositionForBox):
1338
1339 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
1340
1341         Iterating backwards over HTMLCollection is O(n^2)
1342         https://bugs.webkit.org/show_bug.cgi?id=91306
1343
1344         Reviewed by Anders Carlsson.
1345
1346         Fixed the bug by introducing itemBefore that iterates nodes backwards to complement itemAfter.
1347         Unfortunately, some HTML collections such as HTMLFormCollection and HTMLTableRowsCollection have
1348         its own itemAfter function and writing an equivalent itemBefore is somewhat tricky. For now,
1349         added a new boolean flag indicating whether a given HTML collection supports itemBefore or not,
1350         and left those HTML collections that override itemAfter alone.
1351
1352         This also paves our way to share more code between DynamicNodeList and HTMLCollection.
1353
1354         Test: perf/htmlcollection-backwards-iteration.html
1355
1356         * dom/DynamicNodeList.h:
1357         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Takes ItemBeforeSupportType.
1358         (WebCore::DynamicNodeListCacheBase::supportsItemBefore): Added.
1359         (DynamicNodeListCacheBase):
1360         (WebCore::DynamicNodeListCacheBase::setItemCache): Replaced a FIXME by an assertion now that
1361         we can.
1362         * html/HTMLAllCollection.cpp:
1363         (WebCore::HTMLAllCollection::HTMLAllCollection): Supports itemBefore since it doesn't override
1364         itemAfter.
1365         * html/HTMLCollection.cpp:
1366         (WebCore::HTMLCollection::HTMLCollection):
1367         (WebCore::HTMLCollection::create):
1368         (WebCore::isAcceptableElement): Made it a static local function instead of a static member.
1369         (WebCore::nextNode): Templatized.
1370         (WebCore::itemBeforeOrAfter): Extracted from itemAfter and templatized.
1371         (WebCore::HTMLCollection::itemBefore): Added.
1372         (WebCore::HTMLCollection::itemAfter):
1373         (WebCore::HTMLCollection::shouldSearchFromFirstItem): Added. Determines whether we should reset
1374         the item cache to the first item. We obviously do if the cache is invalid. If the target offset
1375         is after the cached offset, then we shouldn't go back regardless of availability of itemBefore.
1376         Otherwise, we go back to the first item iff itemBefore is not available or the distance from
1377         the cached offset to the target offset is greater than the target offset itself.
1378         (WebCore::HTMLCollection::length):
1379         (WebCore::HTMLCollection::item): Use the term "offset" to match the terminology elsewhere.
1380         (WebCore::HTMLCollection::itemBeforeOrAfterCachedItem): Ditto. Also added the logic to iterate
1381         nodes backwards using itemBefore. Once we're in this branch, we should always find a matching
1382         item since the target offset was less than the cached offset, and offsets are non-negative.
1383         If we had ever reached the end of the loop without finding an item, it indicates that the cache
1384         has been invalid and we have some serious bug elsewhere.
1385         * html/HTMLCollection.h:
1386         (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
1387         (HTMLCollection):
1388         * html/HTMLOptionsCollection.cpp:
1389         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Supports itemBefore since it doesn't
1390         override itemAfter.
1391         * html/HTMLFormCollection.cpp:
1392         (WebCore::HTMLFormCollection::HTMLFormCollection): Doesn't support itemBefore as it overrides
1393         itemAfter.
1394         * html/HTMLNameCollection.cpp:
1395         (WebCore::HTMLNameCollection::HTMLNameCollection): Ditto.
1396         * html/HTMLPropertiesCollection.cpp:
1397         (WebCore::HTMLPropertiesCollection::HTMLPropertiesCollection):
1398         * html/HTMLTableRowsCollection.cpp:
1399         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
1400
1401 2012-07-13  Eric Penner  <epenner@google.com>
1402
1403         [chromium] Add 'self-managed' option to CCPrioritizedTexture to enable render-surface and canvas use cases.
1404         https://bugs.webkit.org/show_bug.cgi?id=91177
1405
1406         Reviewed by Adrienne Walker.
1407
1408         This makes the render-surface memory use case generic as 'self-managed' textures,
1409         as this use case is popping up in other places (eg. canvases). It's exactly the
1410         same idea except we can have as many place-holders as we want at arbitrary
1411         priorities.
1412
1413         This already tested by the render surface unit tests which now also use the 
1414         generic placeholder.
1415
1416         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
1417         (WebCore::CCLayerTreeHost::CCLayerTreeHost):
1418         (WebCore::CCLayerTreeHost::initializeLayerRenderer):
1419         (WebCore::CCLayerTreeHost::updateLayers):
1420         (WebCore::CCLayerTreeHost::setPrioritiesForSurfaces):
1421         (WebCore):
1422         (WebCore::CCLayerTreeHost::setPrioritiesForLayers):
1423         (WebCore::CCLayerTreeHost::prioritizeTextures):
1424         (WebCore::CCLayerTreeHost::calculateMemoryForRenderSurfaces):
1425         (WebCore::CCLayerTreeHost::paintLayerContents):
1426         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
1427         (CCLayerTreeHost):
1428         * platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
1429         (WebCore::CCPrioritizedTexture::CCPrioritizedTexture):
1430         (WebCore::CCPrioritizedTexture::setToSelfManagedMemoryPlaceholder):
1431         * platform/graphics/chromium/cc/CCPrioritizedTexture.h:
1432         (CCPrioritizedTexture):
1433         (WebCore::CCPrioritizedTexture::setIsSelfManaged):
1434         (WebCore::CCPrioritizedTexture::isSelfManaged):
1435         * platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
1436         (WebCore::CCPrioritizedTextureManager::prioritizeTextures):
1437         (WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded):
1438         (WebCore::CCPrioritizedTextureManager::destroyBacking):
1439         * platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
1440         (CCPrioritizedTextureManager):
1441         (WebCore::CCPrioritizedTextureManager::memoryForSelfManagedTextures):
1442
1443 2012-07-13  Kent Tamura  <tkent@chromium.org>
1444
1445         Internals: Clean up the mock PagePopupDriver correctly.
1446         https://bugs.webkit.org/show_bug.cgi?id=91250
1447
1448         Unreviewed, a trivial testing code fix.
1449
1450         * testing/InternalSettings.cpp:
1451         (WebCore::InternalSettings::Backup::restoreTo):
1452         (WebCore::InternalSettings::reset):
1453         Resetting PaePopupDriver here instead of Backup::restoreTo.
1454         Also, close the mock popup before resetting PagePopupDriver by clearing m_pagePopupDriver.
1455         * testing/MockPagePopupDriver.cpp:
1456         (WebCore::MockPagePopupDriver::~MockPagePopupDriver):
1457         Close the popup.
1458
1459 2012-07-13  Tony Payne  <tpayne@chromium.org>
1460
1461         Remove Widget from screenColorProfile
1462         https://bugs.webkit.org/show_bug.cgi?id=91300
1463
1464         Reviewed by Adam Barth.
1465
1466         Chromium, the only platform implementing screenColorProfile, does not
1467         need the Widget, so removing for simplicity.
1468
1469         Covered by existing tests.
1470
1471         * platform/PlatformScreen.h:
1472         (WebCore): Updated comment to remove reference to type param that no
1473         longer exists and removed Widget param.
1474         * platform/blackberry/PlatformScreenBlackBerry.cpp:
1475         (WebCore::screenColorProfile): Removed widget param.
1476         * platform/chromium/PlatformScreenChromium.cpp:
1477         (WebCore::screenColorProfile): Removed widget param.
1478         * platform/efl/PlatformScreenEfl.cpp:
1479         (WebCore::screenColorProfile): Removed widget param.
1480         * platform/gtk/PlatformScreenGtk.cpp:
1481         (WebCore::screenColorProfile): Removed widget param.
1482         * platform/image-decoders/ImageDecoder.h:
1483         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): removed param to
1484         match screenColorProfile()'s new spec.
1485         * platform/mac/PlatformScreenMac.mm:
1486         (WebCore::screenColorProfile): Removed widget param.
1487         * platform/qt/PlatformScreenQt.cpp:
1488         (WebCore::screenColorProfile): Removed widget param.
1489         * platform/win/PlatformScreenWin.cpp:
1490         (WebCore::screenColorProfile): Removed widget param.
1491
1492 2012-07-13  Brian Anderson  <brianderson@chromium.org>
1493
1494         [chromium] Add flushes to CCTextureUpdater::update
1495         https://bugs.webkit.org/show_bug.cgi?id=89035
1496
1497         Reviewed by Adrienne Walker.
1498
1499         Automatic flushes are being removed from the command buffer, so
1500         this moves the flushes into the CCTextureUpdater itself.
1501
1502         CCTextureUpdaterTest added to verify texture upload/flushing patterns.
1503
1504         * platform/graphics/chromium/cc/CCGraphicsContext.h:
1505         (WebCore::CCGraphicsContext::flush):
1506         (CCGraphicsContext):
1507         * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
1508         (WebCore):
1509         (WebCore::CCTextureUpdater::update): Manual flushes added here.
1510
1511 2012-07-13  Kiran Muppala  <cmuppala@apple.com>
1512
1513         REGRESSION: RenderInline boundingBox ignores relative position offset
1514         https://bugs.webkit.org/show_bug.cgi?id=91168
1515
1516         Reviewed by Simon Fraser.
1517
1518         RenderGeometryMap, used for caching the transform to the view,
1519         expects the first mapping pushed, to be that of the view itself.
1520         RenderInline was instead pushing it's own offset first.  Besides
1521         the offset of the view itself was not being pushed.
1522
1523         Relaxed the RenderGeometryMap restriction that the first pushed
1524         step should be of the view.  It is sufficient that the view's mapping
1525         is pushed in the first call to pushMappingsToAncestor.  Modified
1526         RenderInline to push the offset of the view also to the geometry map.
1527
1528         Test: fast/inline/inline-relative-offset-boundingbox.html
1529
1530         * rendering/RenderGeometryMap.cpp:
1531         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to
1532         check if mapping to view was pushed in first invocation.
1533         (WebCore::RenderGeometryMap::pushView): Correct assertion that checks
1534         if the view's mapping is the first one to be applied.
1535         (WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if
1536         a mapping step belongs to a view instead of using mapping size.
1537         (WebCore::RenderGeometryMap::stepRemoved): Ditto.
1538         * rendering/RenderInline.cpp:
1539         (WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext):
1540         Push mappings all the way up to and including the view.
1541
1542 2012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
1543
1544         Move WebCore/platform/text/Base64 to WTF/wtf/text
1545         https://bugs.webkit.org/show_bug.cgi?id=91162
1546
1547         Reviewed by Adam Barth.
1548
1549         No new tests. Files moving only.
1550
1551         * CMakeLists.txt:
1552         * GNUmakefile.list.am:
1553         * Modules/websockets/WebSocketHandshake.cpp:
1554         (WebCore::generateSecWebSocketKey):
1555         (WebCore::WebSocketHandshake::getExpectedWebSocketAccept):
1556         * Target.pri:
1557         * WebCore.gypi:
1558         * WebCore.order:
1559         * WebCore.vcproj/WebCore.vcproj:
1560         * WebCore.xcodeproj/project.pbxproj:
1561         * fileapi/FileReaderLoader.cpp:
1562         (WebCore::FileReaderLoader::convertToDataURL):
1563         * inspector/DOMPatchSupport.cpp:
1564         (WebCore::DOMPatchSupport::createDigest):
1565         * inspector/InspectorFileSystemAgent.cpp:
1566         (WebCore):
1567         * inspector/InspectorPageAgent.cpp:
1568         (WebCore::InspectorPageAgent::cachedResourceContent):
1569         (WebCore::InspectorPageAgent::sharedBufferContent):
1570         * loader/archive/mhtml/MHTMLArchive.cpp:
1571         (WebCore::MHTMLArchive::generateMHTMLData):
1572         * loader/archive/mhtml/MHTMLParser.cpp:
1573         (WebCore::MHTMLParser::parseNextPart):
1574         * page/DOMWindow.cpp:
1575         (WebCore::DOMWindow::btoa):
1576         (WebCore::DOMWindow::atob):
1577         * page/Page.cpp:
1578         (WebCore::Page::userStyleSheetLocationChanged):
1579         * platform/graphics/cairo/ImageBufferCairo.cpp:
1580         (WebCore::ImageBuffer::toDataURL):
1581         * platform/graphics/cg/ImageBufferCG.cpp:
1582         (WebCore::CGImageToDataURL):
1583         * platform/graphics/gtk/ImageBufferGtk.cpp:
1584         (WebCore::ImageBuffer::toDataURL):
1585         * platform/graphics/skia/FontCustomPlatformData.cpp:
1586         (WebCore::createUniqueFontName):
1587         * platform/graphics/skia/ImageBufferSkia.cpp:
1588         (WebCore::ImageBuffer::toDataURL):
1589         (WebCore::ImageDataToDataURL):
1590         * platform/graphics/win/FontCustomPlatformData.cpp:
1591         (WebCore::createUniqueFontName):
1592         * platform/graphics/wince/FontCustomPlatformData.cpp:
1593         (WebCore::createUniqueFontName):
1594         * platform/graphics/wince/ImageBufferWinCE.cpp:
1595         * platform/graphics/wx/ImageBufferWx.cpp:
1596         * platform/network/DataURL.cpp:
1597         (WebCore::handleDataURL):
1598         * platform/network/cf/ResourceHandleCFNet.cpp:
1599         (WebCore::applyBasicAuthorizationHeader):
1600         * platform/network/mac/ResourceHandleMac.mm:
1601         (WebCore::applyBasicAuthorizationHeader):
1602         * platform/network/soup/ResourceHandleSoup.cpp:
1603         * platform/win/SSLKeyGeneratorWin.cpp:
1604         (WebCore::WebCore::signedPublicKeyAndChallengeString):
1605
1606 2012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
1607
1608         [Chromium] Sometimes bottom of text is truncated when page has a fractional scale
1609         https://bugs.webkit.org/show_bug.cgi?id=88684
1610
1611         Reviewed by Tony Chang.
1612
1613         When the page has a fractional scale, the ascent and descent part of the fonts might be fractional.
1614         If the descent part is rounded down, the bottom of the text might be truncated when displayed
1615         when subpixel text positioning is enabled.
1616         To avoid that, borrow one unit from the ascent when possible.
1617
1618         Test: fast/text/descent-clip-in-scaled-page.html
1619
1620         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
1621         (WebCore::FontPlatformData::setupPaint): Moved NoPreference handling into querySystemForRenderStyle so that fontRenderStyle() can have actual styles without NoPreference.
1622         (WebCore::FontPlatformData::querySystemForRenderStyle): Added NoPreference handling (moved from setupPaint)
1623         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
1624         (FontPlatformData):
1625         (WebCore::FontPlatformData::fontRenderStyle): Added to let SimpleFontDataSkia access the font render styles.
1626         * platform/graphics/skia/SimpleFontDataSkia.cpp:
1627         (WebCore::SimpleFontData::platformInit):
1628
1629 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
1630
1631         Remove an assertion after r122637.
1632
1633         * dom/DynamicNodeList.h:
1634         (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange):
1635
1636 2012-07-13  Pierre Rossi  <pierre.rossi@gmail.com>
1637
1638         [Qt] Improve the mobile theme slightly
1639         https://bugs.webkit.org/show_bug.cgi?id=90806
1640
1641         Reviewed by Kenneth Rohde Christiansen.
1642
1643         Improve drawing of the mobile theme's controls' background.
1644
1645         Ensure the focus ring never appears with the mobile theme, since it
1646         looks bad in combination with the highlights.
1647
1648         No new tests. The painting code from the mobile theme is still
1649         not covered specifically (it will when we revive pixel tests).
1650
1651         * platform/qt/RenderThemeQtMobile.cpp:
1652         (WebCore):
1653         (WebCore::addPointToOctants): Added. This is simply a helper to avoid
1654             doing too much duplicate work in drawControlBackground.
1655         (WebCore::drawControlBackground): Rely on the octant logic added above
1656             and take the opportunity to increase the granularity.
1657         (WebCore::borderPen):
1658         (WebCore::StylePainterMobile::findLineEdit):
1659         (WebCore::RenderThemeQtMobile::adjustTextFieldStyle):
1660         * platform/qt/RenderThemeQtMobile.h:
1661         (RenderThemeQtMobile):
1662         (WebCore::RenderThemeQtMobile::supportsFocusRing):
1663
1664 2012-07-13  Julien Chaffraix  <jchaffraix@webkit.org>
1665
1666         Remove an always-failing table-wrapping check in RenderObject::addChild
1667         https://bugs.webkit.org/show_bug.cgi?id=91286
1668
1669         Reviewed by Eric Seidel.
1670
1671         Due to the structure of the code, this test is always failing (newChild->isTableCell()
1672         is true to get in the branch).
1673
1674         The changeset adding the code didn't add testing so I poundered adding the mentioned test,
1675         which is passing. However the test would need to be blindly changed to be included in our
1676         test harness. I would also expect this code to be exercised by other table tests anyway.
1677
1678         * rendering/RenderObject.cpp:
1679         (WebCore::RenderObject::addChild):
1680         Removed never-reached branch. While at it, removed a 'what' comment in the same file.
1681
1682 2012-07-13  Emil A Eklund  <eae@chromium.org>
1683
1684         Use LayoutBoxExtent for image outsets
1685         https://bugs.webkit.org/show_bug.cgi?id=91166
1686
1687         Reviewed by Tony Chang.
1688
1689         Change RenderStyle and calling code to use LayoutBoxExtent for image
1690         outsets and remove text direction and writing mode versions of the
1691         outline getters from RenderStyle as LayoutBoxExtent provides the same
1692         functionality.
1693
1694         No new tests, no change in functionality.
1695
1696         * platform/graphics/FractionalLayoutBoxExtent.h:
1697         * platform/graphics/FractionalLayoutBoxExtent.cpp:
1698         (WebCore::FractionalLayoutBoxExtent::logicalTop):
1699         (WebCore::FractionalLayoutBoxExtent::logicalBottom):
1700         Add logicalTop and logicalBottom methods to go with the existing
1701         logicalLeft and logicalRight ones.
1702
1703         * platform/graphics/FractionalLayoutRect.h:
1704         (WebCore::FractionalLayoutRect::expand):
1705         Add FractionalLayoutBoxExtent version of expand method.
1706
1707         * rendering/InlineFlowBox.cpp:
1708         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
1709         Change implementation to use the new FractionalLayoutBoxExtent version of
1710         borderImageOutsets and the logicalTop/Bottom/Left/Right methods.
1711         
1712         (WebCore::clipRectForNinePieceImageStrip):
1713         Change implementation to use the new FractionalLayoutBoxExtent version of
1714         borderImageOutsets.
1715         
1716         * rendering/RenderBox.cpp:
1717         (WebCore::RenderBox::maskClipRect):
1718         Change implementation to use the new FractionalLayoutBoxExtent version of
1719         borderImageOutsets and the new FractionalLayoutRect::expand method.
1720         
1721         (WebCore::RenderBox::addVisualEffectOverflow):
1722         Change implementation to use the new FractionalLayoutBoxExtent version of
1723         borderImageOutsets.
1724         
1725         * rendering/RenderBoxModelObject.cpp:
1726         (WebCore::RenderBoxModelObject::paintNinePieceImage):
1727         Change implementation to use the new FractionalLayoutBoxExtent version of
1728         borderImageOutsets and the new FractionalLayoutRect::expand method.
1729
1730         * rendering/style/RenderStyle.h:
1731         * rendering/style/RenderStyle.cpp:
1732         (WebCore::RenderStyle::imageOutsets):
1733         Change getImageOutsets to return a FractionalLayoutBoxExtent object and
1734         rename to imageOutsets to match the webkit naming convention for getters.
1735
1736         Remove getBorderImageHorizontalOutsets, getBorderImageVerticalOutsets,
1737         getBorderImageInlineDirectionOutsets, getImageHorizontalOutsets,
1738         getImageVerticalOutsets and getBorderImageBlockDirectionOutsets methods
1739         as the same functionality is provided by FractionalLayoutBoxExtent.
1740
1741 2012-07-13  David Hyatt  <hyatt@apple.com>
1742
1743         https://bugs.webkit.org/show_bug.cgi?id=91278
1744         Improve block margin estimation function to account for not having a layout and for quirks mode
1745         
1746         Reviewed by Simon Fraser.
1747
1748         * rendering/RenderBlock.cpp:
1749         (WebCore::RenderBlock::marginBeforeEstimateForChild):
1750         Revise marginBeforeEstimateForChild so that it computes block margins for the grandchild before
1751         recurring. This includes the quirks margin information as well. This ensures that the margins are
1752         up-to-date when checked, even before the object has had its first layout.
1753         
1754         * rendering/RenderBlock.h:
1755         (WebCore::RenderBlock::setMarginStartForChild):
1756         (WebCore::RenderBlock::setMarginEndForChild):
1757         (WebCore::RenderBlock::setMarginBeforeForChild):
1758         (WebCore::RenderBlock::setMarginAfterForChild):
1759         * rendering/RenderBox.cpp:
1760         (WebCore::RenderBox::computeBlockDirectionMargins):
1761         * rendering/RenderBox.h:
1762         (RenderBox):
1763         Add consts in order to compile.
1764
1765 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
1766
1767         NodeLists should not invalidate on irreleavnt attribute changes
1768         https://bugs.webkit.org/show_bug.cgi?id=91277
1769
1770         Reviewed by Ojan Vafai.
1771
1772         Explicitely check the invalidation type and the changed attribute in NodeListNodeData::invalidateCaches
1773         and ElementRareData::clearHTMLCollectionCaches to only invalidate node lists affected by the change.
1774
1775         Also merged invalidateNodeListsCacheAfterAttributeChanged and invalidateNodeListsCacheAfterChildrenChanged
1776         as invalidateNodeListCachesInAncestors since they're almost identical after r122498.
1777
1778         In addition, moved shouldInvalidateNodeListForType from Document.cpp to DynamicNodeList.h and renamed it to
1779         shouldInvalidateTypeOnAttributeChange since it needs to called in Node.cpp and ElementRareData.h.
1780
1781         * dom/Attr.cpp:
1782         (WebCore::Attr::setValue):
1783         (WebCore::Attr::childrenChanged):
1784         * dom/ContainerNode.cpp:
1785         (WebCore::ContainerNode::childrenChanged):
1786         * dom/Document.cpp:
1787         (WebCore::Document::registerNodeListCache): Calls isRootedAtDocument() instead of directly comparing
1788         the value of NodeListRootType in order to prepare for the bug 80269.
1789         (WebCore::Document::unregisterNodeListCache): Ditto.
1790         (WebCore): shouldInvalidateNodeListForType is moved to DynamicNodeList.h
1791         (WebCore::Document::shouldInvalidateNodeListCaches):
1792         * dom/DynamicNodeList.h:
1793         (DynamicNodeListCacheBase):
1794         (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange): Moved from Document.cpp.
1795         * dom/Element.cpp: 
1796         (WebCore::Element::attributeChanged):
1797         * dom/ElementRareData.h:
1798         (WebCore::ElementRareData::clearHTMLCollectionCaches): Takes const QualifiedName* to compare against
1799         the invalidation type of HTML collections via shouldInvalidateTypeOnAttributeChange.
1800         * dom/Node.cpp:
1801         (WebCore::Node::invalidateNodeListCachesInAncestors): Merged invalidateNodeListCachesInAncestors and
1802         invalidateNodeListsCacheAfterChildrenChanged. Also pass attrName to clearHTMLCollectionCaches.
1803         (WebCore::NodeListsNodeData::invalidateCaches): Compares attrName against the invalidation type of
1804         node lists via shouldInvalidateTypeOnAttributeChange.
1805         (WebCore):
1806         * dom/Node.h:
1807         (Node):
1808         * dom/NodeRareData.h:
1809         (WebCore::NodeRareData::ensureNodeLists): Merged NodeRareData::createNodeLists.
1810         (WebCore::NodeRareData::clearChildNodeListCache): Moved from Node.cpp.
1811         (NodeRareData):
1812         * html/HTMLCollection.h:
1813         (HTMLCollectionCacheBase):
1814
1815 2012-07-13  Arpita Bahuguna  <arpitabahuguna@gmail.com>
1816
1817         Refactor RenderTable to use the section's iteration functions.
1818         https://bugs.webkit.org/show_bug.cgi?id=89751
1819
1820         Reviewed by Julien Chaffraix.
1821
1822         Removing anti-pattern wherever possible from RenderTable code. Also, modifying
1823         RenderTable sections' iterations to use helper functions.
1824
1825         No new tests required for this change since no change in behavior is expected.
1826
1827         * rendering/RenderTable.cpp:
1828         (WebCore::RenderTable::addOverflowFromChildren):
1829         (WebCore::RenderTable::setCellLogicalWidths):
1830         (WebCore::RenderTable::outerBorderStart):
1831         (WebCore::RenderTable::outerBorderEnd):
1832         Removed anti-patterns involving iterations over RenderObjects.
1833
1834         (WebCore::RenderTable::outerBorderAfter):
1835         Modified RenderTable sections' iteration to use helper functions.
1836
1837 2012-07-13  Enrica Casucci  <enrica@apple.com>
1838
1839         Threadsafety issues in WebScriptObject
1840         https://bugs.webkit.org/show_bug.cgi?id=90849
1841
1842         Reviewed by Geoff Garen.
1843
1844         Updated fix for this bug. The JSC API lock needs to be acquired also in JSObject.
1845
1846         * bindings/objc/WebScriptObject.mm:
1847         (-[WebScriptObject JSObject]):
1848
1849 2012-07-13  Raymond Toy  <rtoy@google.com>
1850
1851         DelayNode doesn't work if delayTime.value == delayTime.maxValue
1852         https://bugs.webkit.org/show_bug.cgi?id=90357
1853
1854         Reviewed by Kenneth Russell.
1855
1856         Increase delay buffer size slightly so that the read and write
1857         pointers don't become equal when the delay and the max delay are
1858         the same.
1859         
1860         Tests: webaudio/delaynode-max-default-delay.html
1861                webaudio/delaynode-max-nondefault-delay.html
1862
1863         * Modules/webaudio/DelayDSPKernel.cpp:
1864         (WebCore): Moved SmoothingTimeConstant to WebCore namespace.
1865         (WebCore::DelayDSPKernel::DelayDSPKernel): Add some additional checks to prevent crashes; use bufferLengthForDelay to compute buffer length.
1866         (WebCore::DelayDSPKernel::bufferLengthForDelay): New function to compute buffer length.
1867         * Modules/webaudio/DelayDSPKernel.h:
1868         (DelayDSPKernel): Declare bufferLengthForDelay. 
1869
1870 2012-07-13  Benjamin Poulain  <bpoulain@apple.com>
1871
1872         Always aggressively preload on iOS
1873         https://bugs.webkit.org/show_bug.cgi?id=91276
1874
1875         Reviewed by Simon Fraser.
1876
1877         * loader/cache/CachedResourceLoader.cpp:
1878         (WebCore::CachedResourceLoader::preload):
1879
1880 2012-07-13  Vineet Chaudhary  <rgf748@motorola.com>
1881
1882         Restructure V8Utilities::extractTransferables() with help of toV8Sequence()
1883         https://bugs.webkit.org/show_bug.cgi?id=91208
1884
1885         Reviewed by Kentaro Hara.
1886
1887         We can remove the specialised check for MessagePort from V8Utilities::extractTransferables()
1888         using toV8Sequence() as it validates the passed object for sequence type per WebIDL spec.
1889
1890         No new test as just refactoring.
1891         Existing tests under fast/dom/Window/window-* fast/dom/events/*
1892         covers tests.
1893
1894         * bindings/v8/V8Utilities.cpp:
1895         (WebCore::extractTransferables):
1896
1897 2012-07-13  Vincent Scheib  <scheib@chromium.org>
1898
1899         Pointer Lock handles disconnected DOM elements
1900         https://bugs.webkit.org/show_bug.cgi?id=77029
1901
1902         Reviewed by Adrienne Walker.
1903
1904         Pointer Lock Controller now checks when elements or documents are
1905         removed, and unlocks if the target element is being removed.
1906
1907         Tests: pointer-lock/locked-element-iframe-removed-from-dom.html
1908                pointer-lock/locked-element-removed-from-dom.html
1909
1910         * dom/Document.cpp:
1911         (WebCore::Document::detach):
1912         * dom/Element.cpp:
1913         (WebCore::Element::removedFrom):
1914         (WebCore::Element::webkitRequestPointerLock):
1915         * page/PointerLockController.cpp:
1916         (WebCore::PointerLockController::requestPointerLock):
1917         (WebCore::PointerLockController::elementRemoved):
1918         (WebCore):
1919         (WebCore::PointerLockController::documentDetached):
1920         (WebCore::PointerLockController::didLosePointerLock):
1921         (WebCore::PointerLockController::enqueueEvent):
1922         * page/PointerLockController.h:
1923         (WebCore):
1924         (PointerLockController):
1925
1926 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
1927
1928         HTMLCollection should use DynamicNodeList's invalidation model
1929         https://bugs.webkit.org/show_bug.cgi?id=90326
1930
1931         Reviewed by Anders Carlsson.
1932
1933         Make HTMLCollection invalidated upon attribute and children changes instead of invalidating it on demand
1934         by comparing DOM tree versions. Node that HTMLCollections owned by Document are invalidated with other
1935         document-rooted node lists in m_listsInvalidatedAtDocument for simplicity although this mechanism is
1936         normally used for node lists owned by a non-Document node that contains nodes outside of its subtree.
1937         ItemProperties and FormControls are more "traditional" users of the mechanism.
1938
1939         Also, merged DynamicNodeList::invalidateCache and HTMLCollection::invalidateCache.
1940
1941         * dom/Document.cpp:
1942         (WebCore::Document::registerNodeListCache): Renamed. No longer takes NodeListInvalidationType or
1943         NodeListRootType since they can be obtained from the cache base. Increment the node list counter for
1944         InvalidateOnIdNameAttrChange when a HTMLCollection is passed in since all HTMLCollections need to be
1945         invalidated on id or name content attribute changes due to named getters.
1946         (WebCore::Document::unregisterNodeListCache): Ditto.
1947         (WebCore::shouldInvalidateNodeListForType):
1948         (WebCore::Document::shouldInvalidateNodeListCaches):
1949         (WebCore::Document::clearNodeListCaches):
1950         * dom/Document.h:
1951         (WebCore): Added InvalidateOnIdNameAttrChange, InvalidateOnHRefAttrChange, and InvalidateOnAnyAttrChange.
1952         (Document):
1953         * dom/DynamicNodeList.cpp:
1954         (WebCore::DynamicNodeListCacheBase::invalidateCache): Added. Invalidates caches of both DynamicNodeList
1955         and HTMLCollection. We can't afford to use virtual function calls here because this function is called on
1956         all node lists and HTML collections owned by ancestors of an element under which a node is added, removed,
1957         or its attributes are changed.
1958         (WebCore):
1959         * dom/DynamicNodeList.h:
1960         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Initializes member variables directly
1961         instead of calling clearCache now that DynamicNodeListCacheBase::invalidateCache has become polymorphic.
1962         (DynamicNodeListCacheBase): Increased the number of bits for m_invalidationType since we now have 9
1963         invalidation types.
1964         (WebCore::DynamicSubtreeNodeList::~DynamicSubtreeNodeList):
1965         (WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList):
1966         * dom/ElementRareData.h:
1967         (ElementRareData):
1968         (WebCore::ElementRareData::clearHTMLCollectionCaches): Added.
1969         (WebCore::ElementRareData::adoptTreeScope): Added; similar to NodeRareData::adoptTreeScope.
1970         * dom/Node.cpp:
1971         (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged): Clears HTML collection caches as well as
1972         node list caches.
1973         (WebCore::Node::invalidateNodeListsCacheAfterChildrenChanged): Ditto.
1974         * dom/NodeRareData.h:
1975         (WebCore::NodeListsNodeData::adoptTreeScope):
1976         * dom/TreeScopeAdopter.cpp:
1977         (WebCore::TreeScopeAdopter::moveTreeToNewScope): Calls ElementRareData's adoptTreeScope as well as
1978         NodeRareData's.
1979         * html/HTMLAllCollection.cpp:
1980         (WebCore::HTMLAllCollection::namedItemWithIndex):
1981         * html/HTMLCollection.cpp:
1982         (WebCore::rootTypeFromCollectionType): Added. As mentioned above, treat all Document-owned HTML collection
1983         as if rooted at document for convenience.
1984         (WebCore::invalidationTypeExcludingIdAndNameAttributes): Added. Since all HTML collection requires
1985         invalidation on id and name content attribute changes, which is taken care by the special logic in
1986         Document::registerNodeListCache, exclude those two attributes from consideration.
1987         (WebCore::HTMLCollection::HTMLCollection): Calls Document::registerNodeListCache.
1988         (WebCore::HTMLCollection::~HTMLCollection): Calls Document::unregisterNodeListCache.
1989         (WebCore::HTMLCollection::length):
1990         (WebCore::HTMLCollection::item):
1991         (WebCore::HTMLCollection::namedItem):
1992         (WebCore::HTMLCollection::updateNameCache):
1993         * html/HTMLCollection.h:
1994         (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
1995         (HTMLCollectionCacheBase): Removed m_cacheTreeVersion and clearCache since they're no longer used.
1996         (HTMLCollection):
1997         * html/HTMLFormCollection.cpp:
1998         (WebCore::HTMLFormCollection::namedItem):
1999         (WebCore::HTMLFormCollection::updateNameCache):
2000         * html/HTMLOptionsCollection.h:
2001         (HTMLOptionsCollection):
2002         * html/HTMLPropertiesCollection.cpp:
2003         (WebCore::HTMLPropertiesCollection::updateNameCache):
2004         * html/HTMLPropertiesCollection.h:
2005         (WebCore::HTMLPropertiesCollection::invalidateCache):
2006
2007 2012-07-13  Shawn Singh  <shawnsingh@chromium.org>
2008
2009         [chromium] Remove incorrect debug assertion in LayerRendererChromium.cpp
2010         https://bugs.webkit.org/show_bug.cgi?id=91260
2011
2012         Reviewed by Adrienne Walker.
2013
2014         ASSERT(!clipped) was being triggered after skinny almost-degenerate
2015         quads went through anti-aliasing inflation, and then were being
2016         transformed back from device space to local space. It turns out
2017         this assertion is too aggressive, and we don't yet have an obvious
2018         need to change the behavior on the clipped==true case.
2019
2020         No new tests needed, this patch fixes only comments and debug code.
2021
2022         * platform/graphics/chromium/LayerRendererChromium.cpp:
2023         (WebCore::LayerRendererChromium::drawRenderPassQuad):
2024            fixed a comment.
2025
2026         (WebCore::LayerRendererChromium::drawTileQuad):
2027            fixed a similar comment, removed unnecessary assertion.
2028
2029 2012-07-13  Philip Rogers  <pdr@google.com>
2030
2031         Remove assert in localCoordinateSpaceTransform()
2032         https://bugs.webkit.org/show_bug.cgi?id=91189
2033
2034         Reviewed by Nikolas Zimmermann.
2035
2036         The assert in localCoordinateSpaceTransform was added to catch subclasses forgetting
2037         to override the method but it is better to simply return the identity matrix.
2038
2039         This scenario can occur when we break the SVG content model, such as asking for
2040         the CTM of a <g> element inside a <tspan>. This is undefined in the spec because
2041         tspan is not a subclass of SVGLocatable but both Firefox and Opera
2042         implement this by returning the identity matrix.
2043
2044         Test: svg/custom/invalid-ctm.svg
2045
2046         * svg/SVGStyledElement.cpp:
2047         (WebCore::SVGStyledElement::localCoordinateSpaceTransform):
2048
2049 2012-07-13  Kentaro Hara  <haraken@chromium.org>
2050
2051         [V8] String wrappers should be marked Independent
2052         https://bugs.webkit.org/show_bug.cgi?id=91251
2053
2054         Reviewed by Adam Barth.
2055
2056         Currently V8 String wrappers are not marked Independent.
2057         By marking them Independent, they can be reclaimed by the scavenger GC.
2058
2059         I tried to find some cases where this change reduces memory usage,
2060         but couldn't due to sensitive behavior of GC.
2061
2062         No tests. No change in behavior.
2063
2064         * bindings/v8/V8Binding.cpp:
2065         (WebCore::StringCache::v8ExternalStringSlow):
2066
2067 2012-07-13  Peter Beverloo  <peter@chromium.org>
2068
2069         [Chromium] Make the v8 i18n API dependency conditional for Android, disable strict aliasing
2070         https://bugs.webkit.org/show_bug.cgi?id=91240
2071
2072         Reviewed by Adam Barth.
2073
2074         Disable the v8 internationalization API for Chromium Android, as it's
2075         disabled and not always available in checkouts. Furthermore, disable
2076         strict aliasing for the webkit_remaining target, similar to what
2077         x11-based builds are doing (see the webcore_prerequisites target).
2078
2079         * WebCore.gyp/WebCore.gyp:
2080
2081 2012-07-13  Kentaro Hara  <haraken@chromium.org>
2082
2083         [CallWith=XXX] arguments should be placed at the head of method arguments
2084         https://bugs.webkit.org/show_bug.cgi?id=91217
2085
2086         Reviewed by Adam Barth.
2087
2088         The EFL build with the ENABLE_FILE_SYSTEM flag caused a build error,
2089         because CodeGeneratorJS.pm assumes webkitEntries(ScriptExecutionContext*, HTMLInputElement*)
2090         but the actual signature is webkitEntries(HTMLInputElement*, ScriptExecutionContext*) (bug 91185).
2091
2092         Per https://trac.webkit.org/wiki/WebKitIDL#CallWith, [CallWith=XXX] arguments should be placed
2093         at the head of the arguments. (i.e. the behavior of CodeGeneratorJS.pm is correct.)
2094
2095         Thus the correct fix is (1) to change the signature of webkitEntries() and webkitGetAsEntry()
2096         so that ScriptExecutionContext* comes first and (2) to modify CodeGeneratorV8.pm to support the order.
2097
2098         Test: bindings/scripts/test/TestObj.idl
2099
2100         * Modules/filesystem/DataTransferItemFileSystem.h: Placed ScriptExecutionContext* at the head of arguments.
2101         (DataTransferItemFileSystem):
2102         * Modules/filesystem/HTMLInputElementFileSystem.cpp: Ditto.
2103         (WebCore::HTMLInputElementFileSystem::webkitEntries):
2104         * Modules/filesystem/HTMLInputElementFileSystem.h: Ditto.
2105         (HTMLInputElementFileSystem):
2106         * Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp: Ditto.
2107         (WebCore::DataTransferItemFileSystem::webkitGetAsEntry):
2108
2109         * bindings/scripts/CodeGeneratorV8.pm: Modified to support the correct order.
2110         (GenerateNormalAttrGetter):
2111         (GenerateNormalAttrSetter):
2112         (GenerateFunctionCallString):
2113
2114         * bindings/scripts/test/V8/V8TestInterface.cpp: Updated run-bindings-tests results.
2115         (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
2116
2117 2012-07-13  Mary Wu  <mary.wu@torchmobile.com.cn>
2118
2119         [BlackBerry] Some small changes in network code
2120         https://bugs.webkit.org/show_bug.cgi?id=90974
2121
2122         Reviewed by Rob Buis.
2123
2124         1. Set status in NetworkJob/SocketStreamHandleBlackBerry so that
2125         its wrapped stream can also query the stream result.
2126         2. pass download attribute to NetworkRequest.
2127
2128         RIM PR# 171555
2129         Reviewed internally by Lyon Chen and Joe Mason.
2130
2131         * platform/network/blackberry/NetworkJob.cpp:
2132         (WebCore::NetworkJob::handleNotifyClose):
2133         * platform/network/blackberry/NetworkJob.h:
2134         (WebCore::NetworkJob::status):
2135         * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
2136         (WebCore::platformTargetTypeForRequest):
2137         * platform/network/blackberry/SocketStreamHandle.h:
2138         (WebCore::SocketStreamHandle::status):
2139         (SocketStreamHandle):
2140         * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
2141         (WebCore::SocketStreamHandle::notifyStatusReceived):
2142         (WebCore::SocketStreamHandle::notifyClose):
2143
2144 2012-07-13  Vsevolod Vlasov  <vsevik@chromium.org>
2145
2146         Web Inspector: Remove uiSourceCode from Resource.
2147         https://bugs.webkit.org/show_bug.cgi?id=91201
2148
2149         Reviewed by Pavel Feldman.
2150
2151         Removed Resource._uiSourceCode field as it is not used anymore.
2152
2153         * inspector/front-end/Resource.js:
2154         (WebInspector.Resource.prototype.isHidden):
2155         * inspector/front-end/UISourceCode.js:
2156         (WebInspector.UISourceCode):
2157
2158 2012-07-13  Sheriff Bot  <webkit.review.bot@gmail.com>
2159
2160         Unreviewed, rolling out r122450 and r122580.
2161         http://trac.webkit.org/changeset/122450
2162         http://trac.webkit.org/changeset/122580
2163         https://bugs.webkit.org/show_bug.cgi?id=91263
2164
2165         Caused multiple regressions on ClusterFuzz (Requested by
2166         inferno-sec on #webkit).
2167
2168         * bindings/js/ScriptWrappable.h:
2169         (WebCore::ScriptWrappable::reportMemoryUsage):
2170         * bindings/v8/DOMDataStore.cpp:
2171         (WebCore::DOMDataStore::reportMemoryUsage):
2172         * bindings/v8/IntrusiveDOMWrapperMap.h:
2173         (WebCore::ChunkedTable::reportMemoryUsage):
2174         * bindings/v8/ScriptWrappable.h:
2175         (WebCore::ScriptWrappable::reportMemoryUsage):
2176         * bindings/v8/V8Binding.cpp:
2177         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
2178         (WebCore::StringCache::reportMemoryUsage):
2179         * bindings/v8/V8DOMMap.h:
2180         * css/PropertySetCSSStyleDeclaration.cpp:
2181         (WebCore::InlineCSSStyleDeclaration::ensureMutablePropertySet):
2182         * css/StylePropertySet.cpp:
2183         * css/StylePropertySet.h:
2184         (WebCore::StylePropertySet::reportMemoryUsage):
2185         * dom/CharacterData.cpp:
2186         (WebCore::CharacterData::reportMemoryUsage):
2187         * dom/ContainerNode.h:
2188         (WebCore::ContainerNode::reportMemoryUsage):
2189         * dom/Document.cpp:
2190         (WebCore::Document::reportMemoryUsage):
2191         * dom/Element.cpp:
2192         (WebCore::Element::detachAttribute):
2193         (WebCore::Element::removeAttribute):
2194         (WebCore::Element::attributes):
2195         (WebCore::Element::setAttributeInternal):
2196         (WebCore::Element::parserSetAttributes):
2197         (WebCore::Element::hasEquivalentAttributes):
2198         (WebCore::Element::createAttributeData):
2199         (WebCore):
2200         (WebCore::Element::setAttributeNode):
2201         (WebCore::Element::removeAttributeNode):
2202         (WebCore::Element::getAttributeNode):
2203         (WebCore::Element::getAttributeNodeNS):
2204         (WebCore::Element::hasAttribute):
2205         (WebCore::Element::hasAttributeNS):
2206         (WebCore::Element::normalizeAttributes):
2207         (WebCore::Element::cloneAttributesFromElement):
2208         * dom/Element.h:
2209         (WebCore::Element::attributeData):
2210         (Element):
2211         (WebCore::Element::reportMemoryUsage):
2212         (WebCore::Element::ensureAttributeData):
2213         (WebCore::Element::updatedAttributeData):
2214         (WebCore::Element::ensureUpdatedAttributeData):
2215         * dom/ElementAttributeData.cpp:
2216         (WebCore::ElementAttributeData::attrIfExists):
2217         (WebCore::ElementAttributeData::ensureAttr):
2218         (WebCore::ElementAttributeData::setAttr):
2219         (WebCore::ElementAttributeData::removeAttr):
2220         (WebCore::ElementAttributeData::setClass):
2221         (WebCore):
2222         (WebCore::ElementAttributeData::ensureInlineStyle):
2223         (WebCore::ElementAttributeData::ensureMutableInlineStyle):
2224         (WebCore::ElementAttributeData::destroyInlineStyle):
2225         (WebCore::ElementAttributeData::addAttribute):
2226         (WebCore::ElementAttributeData::removeAttribute):
2227         (WebCore::ElementAttributeData::isEquivalent):
2228         (WebCore::ElementAttributeData::detachAttrObjectsFromElement):
2229         (WebCore::ElementAttributeData::getAttributeItemIndexSlowCase):
2230         (WebCore::ElementAttributeData::cloneDataFrom):
2231         (WebCore::ElementAttributeData::clearAttributes):
2232         (WebCore::ElementAttributeData::replaceAttribute):
2233         (WebCore::ElementAttributeData::getAttributeNode):
2234         * dom/ElementAttributeData.h:
2235         (WebCore::ElementAttributeData::create):
2236         (ElementAttributeData):
2237         (WebCore::ElementAttributeData::setIdForStyleResolution):
2238         (WebCore::ElementAttributeData::setAttributeStyle):
2239         (WebCore::ElementAttributeData::length):
2240         (WebCore::ElementAttributeData::isEmpty):
2241         (WebCore::ElementAttributeData::attributeItem):
2242         (WebCore::ElementAttributeData::getAttributeItem):
2243         (WebCore::ElementAttributeData::reportMemoryUsage):
2244         (WebCore::ElementAttributeData::ElementAttributeData):
2245         (WebCore::ElementAttributeData::attributeVector):
2246         (WebCore::ElementAttributeData::clonedAttributeVector):
2247         (WebCore::ElementAttributeData::removeAttribute):
2248         (WebCore::ElementAttributeData::getAttributeItemIndex):
2249         * dom/MemoryInstrumentation.h:
2250         (MemoryInstrumentation):
2251         (MemoryObjectInfo):
2252         (WebCore::MemoryObjectInfo::reportInstrumentedPointer):
2253         (WebCore::MemoryObjectInfo::reportPointer):
2254         (WebCore::MemoryObjectInfo::reportInstrumentedObject):
2255         (WebCore::MemoryObjectInfo::reportObject):
2256         (WebCore::MemoryObjectInfo::reportObjectInfo):
2257         (WebCore::MemoryObjectInfo::reportHashMap):
2258         (WebCore::MemoryObjectInfo::reportHashSet):
2259         (WebCore::MemoryObjectInfo::reportListHashSet):
2260         (WebCore::MemoryObjectInfo::reportVector):
2261         (WebCore::MemoryObjectInfo::reportString):
2262         (WebCore::MemoryObjectInfo::objectType):
2263         (WebCore::MemoryObjectInfo::objectSize):
2264         (WebCore::MemoryObjectInfo::memoryInstrumentation):
2265         * dom/Node.cpp:
2266         (WebCore::Node::reportMemoryUsage):
2267         * dom/QualifiedName.h:
2268         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
2269         (WebCore::QualifiedName::reportMemoryUsage):
2270         * dom/StyledElement.cpp:
2271         (WebCore::StyledElement::style):
2272         (WebCore::StyledElement::classAttributeChanged):
2273         (WebCore::StyledElement::setInlineStyleProperty):
2274         (WebCore::StyledElement::removeInlineStyleProperty):
2275         (WebCore::StyledElement::addSubresourceAttributeURLs):
2276         * dom/StyledElement.h:
2277         (WebCore::StyledElement::ensureInlineStyle):
2278         * html/parser/HTMLConstructionSite.cpp:
2279         (WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement):
2280         * platform/TreeShared.h:
2281         (WebCore::TreeShared::reportMemoryUsage):
2282         * xml/parser/XMLDocumentParserQt.cpp:
2283         (WebCore::XMLDocumentParser::XMLDocumentParser):
2284
2285 2012-07-13  Huang Dongsung  <luxtella@company100.net>
2286
2287         Remove down-casting to BitmapImage in GraphicsContext::drawImage.
2288         https://bugs.webkit.org/show_bug.cgi?id=90755
2289
2290         Reviewed by Simon Fraser.
2291
2292         Add a BitmapImage draw method which takes RespectImageOrientationEnum enum as
2293         the last argument for CG. Then we can remove the conditional down-casting in
2294         GraphicsContext::drawImage.
2295
2296         This change is needed for parallel image decoders. Because parallel image
2297         decoders use a Bitmap image wrapper class which extends Image (not Bitmap), the
2298         down-casting above causes the loss of RespectImageOrientationEnum which must be
2299         passed to BitmapImage.
2300
2301         No new tests, no behavior change.
2302
2303         * platform/graphics/BitmapImage.cpp:
2304         * platform/graphics/BitmapImage.h:
2305         * platform/graphics/GraphicsContext.cpp:
2306         (WebCore::GraphicsContext::drawImage):
2307         * platform/graphics/Image.cpp:
2308         (WebCore::Image::draw):
2309         (WebCore):
2310         * platform/graphics/Image.h:
2311         (Image):
2312
2313 2012-07-13  Lauro Neto  <lauro.neto@openbossa.org>
2314
2315         Fix QtWebKit build with OpenGLES after GC3D/E3D refactor
2316         https://bugs.webkit.org/show_bug.cgi?id=91156
2317
2318         Reviewed by Noam Rosenthal.
2319
2320         Adds several build fixes.
2321
2322         * platform/graphics/GraphicsContext3D.h:
2323             Use E3DOpenGLES instead of previously removed E3DQt.
2324
2325         * platform/graphics/OpenGLESShims.h:
2326             Enable defines for Qt.
2327
2328         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
2329         (WebCore::Extensions3DOpenGLES::blitFramebuffer):
2330         (WebCore):
2331         (WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
2332         (WebCore::Extensions3DOpenGLES::copyTextureCHROMIUM):
2333             Added pure virtual stubs.
2334
2335         (WebCore::Extensions3DOpenGLES::supportsExtension):
2336             Remove PROC suffix. See bug #91130.
2337
2338         * platform/graphics/opengl/Extensions3DOpenGLES.h:
2339         (Extensions3DOpenGLES):
2340             Added pure virtual stubs.
2341
2342         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2343         (WebCore::GraphicsContext3D::reshapeFBOs):
2344             Readded missing function after removed in r122250.
2345
2346         (WebCore):
2347             Use PLATFORM(BLACKBERRY) guard around port-specific include.
2348
2349         * platform/graphics/qt/GraphicsContext3DQt.cpp:
2350             Added USE(OPENGL_ES_2) guard instead of always loading the OpenGL extensions.
2351
2352
2353 2012-07-13  Keishi Hattori  <keishi@webkit.org>
2354
2355         Form of FormAssociatedElement is not updated when id target changes.
2356         https://bugs.webkit.org/show_bug.cgi?id=91042
2357
2358         Reviewed by Kent Tamura.
2359
2360         Test: fast/forms/update-form-attribute-element.html
2361
2362         This patch introduces the IdTargetObserver and IdTargetObserverRegistry class.
2363         They can be used to be notified when the element that an id is pointing to (the id target)
2364         changes.
2365
2366         * CMakeLists.txt: Added IdTargetObserverRegistry.{h,cpp} and IdTargetObserver.{h,cpp}
2367         * GNUmakefile.list.am: Ditto.
2368         * Target.pri: Ditto.
2369         * WebCore.gypi: Ditto.
2370         * WebCore.vcproj/WebCore.vcproj: Ditto.
2371         * WebCore.xcodeproj/project.pbxproj: Ditto.
2372         * dom/DOMAllInOne.cpp:
2373         * dom/IdTargetObserver.cpp: Added. When you want notified of changes to an id target, you should create a new class that inherits this.
2374         (WebCore):
2375         (WebCore::IdTargetObserver::IdTargetObserver):
2376         (WebCore::IdTargetObserver::~IdTargetObserver):
2377         * dom/IdTargetObserver.h: Added.
2378         (WebCore):
2379         (IdTargetObserver):
2380         * dom/IdTargetObserverRegistry.cpp: Added.
2381         (WebCore):
2382         (WebCore::IdTargetObserverRegistry::create):
2383         (WebCore::IdTargetObserverRegistry::addObserver): Register an IdTargetObserver to observe an id target.
2384         (WebCore::IdTargetObserverRegistry::removeObserver): Unregisters an IdTargetObserver from observing.
2385         (WebCore::IdTargetObserverRegistry::notifyObserversInternal):
2386         * dom/IdTargetObserverRegistry.h: Added.
2387         (WebCore):
2388         (IdTargetObserverRegistry):
2389         (WebCore::IdTargetObserverRegistry::IdTargetObserverRegistry):
2390         (WebCore::IdTargetObserverRegistry::notifyObservers): Calls idTargetChanged on all observers for an id. Inlining first part of function for performance.
2391         * dom/TreeScope.cpp:
2392         (WebCore::TreeScope::TreeScope):
2393         (WebCore::TreeScope::addElementById): Calls IdTargetObserverRegistry::notifyObservers because the id target might have changed.
2394         (WebCore::TreeScope::removeElementById): Ditto.
2395         * dom/TreeScope.h:
2396         (WebCore):
2397         (WebCore::TreeScope::idTargetObserverRegistry):
2398         (TreeScope):
2399         * html/FormAssociatedElement.cpp: Observer for id targets defined by the form attribute.
2400         (WebCore::FormAssociatedElement::didMoveToNewDocument):
2401         (WebCore::FormAssociatedElement::insertedInto):
2402         (WebCore::FormAssociatedElement::removedFrom):
2403         (WebCore::FormAssociatedElement::formAttributeChanged):
2404         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver): Creates and sets up a new FormAttributeTargetObserver.
2405         (WebCore):
2406         (WebCore::FormAssociatedElement::formAttributeTargetChanged):
2407         (WebCore::FormAttributeTargetObserver::create):
2408         (WebCore::FormAttributeTargetObserver::FormAttributeTargetObserver):
2409         (WebCore::FormAttributeTargetObserver::idTargetChanged):
2410         * html/FormAssociatedElement.h:
2411         (FormAssociatedElement):
2412         * html/FormController.cpp:
2413         * html/FormController.h:
2414         (FormController):
2415         * html/HTMLFormElement.cpp:
2416         (WebCore::HTMLFormElement::removedFrom):
2417         (WebCore::HTMLFormElement::formElementIndexWithFormAttribute): Modified to take a range. It
2418         scans the range and returns the index to insert the element in m_associatedElement.
2419         (WebCore::HTMLFormElement::formElementIndex): Modified to only scan the elements in
2420         m_associatedElement that precede and follow the form element.
2421         * html/HTMLFormElement.h:
2422         (HTMLFormElement):
2423
2424 2012-07-13  Gabor Rapcsanyi  <rgabor@webkit.org>
2425
2426         Optimizing blend filter to ARM-NEON with intrinsics
2427         https://bugs.webkit.org/show_bug.cgi?id=90949
2428
2429         Reviewed by Zoltan Herczeg.
2430
2431         The feBlend SVG filter modes can be greatly fasten up with ARM-NEON since
2432         we are able to calculate with 2 pixels (8 channels) at the same time.
2433         The code is written with NEON intrinsics and it doesn't affect the
2434         general - it has the same behaviour as the original algorithm.
2435         With this NEON optimization the calculation is ~4.5 times faster for each mode.
2436
2437         Existing tests cover this issue.
2438
2439         * CMakeLists.txt:
2440         * GNUmakefile.list.am:
2441         * Target.pri:
2442         * WebCore.gypi:
2443         * WebCore.vcproj/WebCore.vcproj:
2444         * WebCore.xcodeproj/project.pbxproj:
2445         * platform/graphics/filters/FEBlend.cpp:
2446         (WebCore::FEBlend::platformApplyGeneric):
2447         (WebCore):
2448         (WebCore::FEBlend::platformApplySoftware):
2449         * platform/graphics/filters/FEBlend.h:
2450         (FEBlend):
2451         * platform/graphics/filters/arm/FEBlendNEON.h: Added.
2452         (WebCore):
2453         (FEBlendUtilitiesNEON):
2454         (WebCore::FEBlendUtilitiesNEON::div255): integer divison with 255
2455         (WebCore::FEBlendUtilitiesNEON::normal): calculate normal mode blending for two pixels
2456         (WebCore::FEBlendUtilitiesNEON::multiply): calculate multiply mode blending for two pixels
2457         (WebCore::FEBlendUtilitiesNEON::screen): calculate screen mode blending for two pixels
2458         (WebCore::FEBlendUtilitiesNEON::darken): calculate darken mode blending for two pixels
2459         (WebCore::FEBlendUtilitiesNEON::lighten): calculate lighten mode blending for two pixels
2460         (WebCore::FEBlend::platformApplyNEON):
2461
2462 2012-07-13  Ilya Tikhonovsky  <loislo@chromium.org>
2463
2464         Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo
2465         https://bugs.webkit.org/show_bug.cgi?id=91227
2466
2467         Reviewed by Pavel Feldman.
2468
2469         void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
2470         {
2471             MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
2472             info.visitBaseClass<ScriptWrappable>(this);
2473
2474             info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference
2475             info.addInstrumentedMember(m_next);
2476             info.addHashSet<MemoryInstrumentation::NonClass>(m_aHash);                // NonClass value_type (report only size of internal template structures)
2477             info.addHashSet<MemoryInstrumentation::NotInstrumentedClass>(m_aHashSet); // not instrumented value_type (use sizeof)
2478             info.addHashSet<MemoryInstrumentation::InstrumentedClass>(m_aHashSet);    // instrumented value_type (call visit)
2479         }
2480
2481         The change is covered by existing tests for native memory snapshot.
2482
2483         * bindings/v8/DOMDataStore.cpp:
2484         (WebCore::DOMDataStore::reportMemoryUsage):
2485         * bindings/v8/IntrusiveDOMWrapperMap.h:
2486         (WebCore::ChunkedTable::reportMemoryUsage):
2487         * bindings/v8/ScriptWrappable.h:
2488         (WebCore::ScriptWrappable::reportMemoryUsage):
2489         * bindings/v8/V8Binding.cpp:
2490         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
2491         (WebCore::StringCache::reportMemoryUsage):
2492         * bindings/v8/V8DOMMap.h:
2493         * css/StylePropertySet.h:
2494         (WebCore::StylePropertySet::reportMemoryUsage):
2495         * dom/CharacterData.cpp:
2496         (WebCore::CharacterData::reportMemoryUsage):
2497         * dom/ContainerNode.h:
2498         (WebCore::ContainerNode::reportMemoryUsage):
2499         * dom/Document.cpp:
2500         (WebCore::Document::reportMemoryUsage):
2501         * dom/Element.h:
2502         (WebCore::Element::reportMemoryUsage):
2503         * dom/ElementAttributeData.h:
2504         (WebCore::ElementAttributeData::reportMemoryUsage):
2505         * dom/MemoryInstrumentation.h:
2506         (MemoryInstrumentation):
2507         (WebCore::MemoryObjectInfo::objectType):
2508         (WebCore::MemoryObjectInfo::objectSize):
2509         (WebCore::MemoryObjectInfo::memoryInstrumentation):
2510         (MemoryObjectInfo):
2511         (WebCore::MemoryObjectInfo::reportObjectInfo):
2512         (WebCore):
2513         (MemoryClassInfo):
2514         (WebCore::MemoryClassInfo::MemoryClassInfo):
2515         (WebCore::MemoryClassInfo::visitBaseClass):
2516         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
2517         (WebCore::MemoryClassInfo::reportInstrumentedObject):
2518         (WebCore::MemoryClassInfo::reportPointer):
2519         (WebCore::MemoryClassInfo::reportObject):
2520         (WebCore::MemoryClassInfo::reportHashMap):
2521         (WebCore::MemoryClassInfo::reportHashSet):
2522         (WebCore::MemoryClassInfo::reportListHashSet):
2523         (WebCore::MemoryClassInfo::reportVector):
2524         (WebCore::MemoryClassInfo::reportString):
2525         * dom/Node.cpp:
2526         (WebCore::Node::reportMemoryUsage):
2527         * dom/QualifiedName.h:
2528         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
2529         (WebCore::QualifiedName::reportMemoryUsage):
2530         * platform/TreeShared.h:
2531         (WebCore::TreeShared::reportMemoryUsage):
2532
2533 2012-07-13  Pavel Feldman  <pfeldman@chromium.org>
2534
2535         Web Inspector: align scope filters
2536         https://bugs.webkit.org/show_bug.cgi?id=91213
2537
2538         Reviewed by Vsevolod Vlasov.
2539
2540         * inspector/front-end/elementsPanel.css:
2541         (.crumbs):
2542         * inspector/front-end/inspector.css:
2543         (.status-bar > div):
2544         (.scope-bar):
2545         (.scope-bar li):
2546         (.scope-bar li.all):
2547         * inspector/front-end/networkLogView.css:
2548
2549 2012-07-13  Peter Rybin  <peter.rybin@gmail.com>
2550
2551         Web Inspector: too many hardcoded strings in InspectorBackendDispatcher.
2552         https://bugs.webkit.org/show_bug.cgi?id=89198
2553
2554         Reviewed by Yury Semikhatsky.
2555
2556         Instead of generating error message string on every call (mostly for nothing),
2557         error message is generated deeper inside the handler and only command name
2558         is passed every time.
2559
2560         * inspector/CodeGeneratorInspector.py:
2561         (Generator.process_command):
2562
2563 2012-07-13  Joshua Netterfield  <jnetterfield@rim.com>
2564
2565         [BlackBerry] Update about:* pages
2566         https://bugs.webkit.org/show_bug.cgi?id=91121
2567
2568         Reviewed by Yong Li.
2569
2570         Update the about:config pages, and improve the aesthetics of the about:build, about:version, about:credits, about:memory, about:config, and similar pages.
2571
2572         No new tests, because there is no new funtionality.
2573
2574         * platform/network/blackberry/NetworkJob.cpp: Update the aesthetics of about:* pages
2575
2576 2012-07-13  Olivier Blin  <olivier.blin@softathome.com>
2577
2578         Fix checking for optional DeviceOrientationEvent.absolute in JSC bindings
2579         https://bugs.webkit.org/show_bug.cgi?id=91225
2580
2581         Reviewed by Steve Block.
2582
2583         This issue comes from r105036
2584
2585         * bindings/js/JSDeviceOrientationEventCustom.cpp:
2586         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
2587
2588 2012-07-13  Andrei Bucur  <abucur@adobe.com>
2589         [CSS Regions] Fix build for bug 89000
2590         https://bugs.webkit.org/show_bug.cgi?id=91215
2591
2592         Reviewed by Kentaro Hara.
2593
2594         Remove the unused variable m_state that was a leftover from a previous version of the patch.
2595
2596         Tests: No new tests, build fix.
2597
2598         * dom/WebKitNamedFlow.cpp:
2599         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
2600         * dom/WebKitNamedFlow.h:
2601         (WebKitNamedFlow):
2602
2603 2012-07-13  Kenichi Ishibashi  <bashi@chromium.org>
2604
2605         [Chromium] Fix bugs in HarfBuzzShaper
2606         https://bugs.webkit.org/show_bug.cgi?id=90951
2607
2608         Reviewed by Tony Chang.
2609
2610         The current implementation has following problems:
2611         - Cannot render RTL text if the TextRun is divided into more than two
2612           HarfBuzzRun.
2613         - Script handling in TextRun partitioning is incorrect.
2614         - Inaccurate calculation of selection rect.
2615         - Wrong rendering position when the first glyph of the TextRun have
2616           non-zero offsets in terms of HarfBuzz.
2617
2618         To fix these problems I rewrote HarfBuzzShaper class. Here is the summary:
2619         - Divide the whole range of TextRun first, then shape them in visual
2620           order.
2621         - Divide TextRun in the same way of old-harfbuzz's
2622           hb_utf16_script_run_next().
2623         - Prefer float than int when calculating selection.
2624         - Adjust the drawing point after shaping.
2625
2626         Added tests covers the fix except for the last problem. The last problem will be covered
2627         by fast/text/international/complex-joining-using-gpos.html after chromium linux port switches
2628         to use HarfBuzzShaper.
2629
2630         Tests: fast/text/shaping/shaping-script-order.html
2631                fast/text/shaping/shaping-selection-rect.html
2632
2633         * platform/graphics/harfbuzz/FontHarfBuzz.cpp:
2634         (WebCore::Font::drawComplexText): Adjusts point after shaping.
2635         * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
2636         (WebCore::HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun):
2637         (WebCore):
2638         (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Added.
2639         (WebCore::HarfBuzzShaper::HarfBuzzRun::setGlyphAndAdvance): Offsets are no longer needed.
2640         (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Calculates character offset based on advance.
2641         (WebCore::normalizeCharacters): Added.
2642         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
2643         (WebCore::HarfBuzzShaper::~HarfBuzzShaper):
2644         (WebCore::HarfBuzzShaper::shape): Divides TextRun first, then shapes them.
2645         (WebCore::HarfBuzzShaper::adjustStartPoint): Added.
2646         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Added.
2647         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Added.
2648         (WebCore::HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun): Followed other changes.
2649         (WebCore::HarfBuzzShaper::selectionRect): Use float for calculating selection.
2650         * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h:
2651         (HarfBuzzShaper): Holds the start index of character. Removed unnecessary variables.
2652         (WebCore::HarfBuzzShaper::HarfBuzzRun::create): Ditto.
2653         (HarfBuzzRun):
2654         (WebCore::HarfBuzzShaper::HarfBuzzRun::fontData): Added.
2655         (WebCore::HarfBuzzShaper::HarfBuzzRun::startIndex): Ditto.
2656         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Ditto.
2657         (WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto.
2658
2659 2012-07-13  Kentaro Hara  <haraken@chromium.org>
2660
2661         Unreviewed, rolling out r122545.
2662         http://trac.webkit.org/changeset/122545
2663         https://bugs.webkit.org/show_bug.cgi?id=91185
2664
2665         We found that this was a wrong fix
2666
2667         * bindings/scripts/CodeGeneratorJS.pm:
2668         (GenerateImplementation):
2669
2670 2012-07-13  Kentaro Hara  <haraken@chromium.org>
2671
2672         Unreviewed, rolling out r122553.
2673         http://trac.webkit.org/changeset/122553
2674         https://bugs.webkit.org/show_bug.cgi?id=91198
2675
2676         We found that this was a wrong fix
2677
2678         * bindings/scripts/CodeGeneratorJS.pm:
2679         (GenerateImplementation):
2680
2681 2012-07-13  Kent Tamura  <tkent@chromium.org>
2682
2683         Change the timing of form state restore
2684         https://bugs.webkit.org/show_bug.cgi?id=89962
2685
2686         Reviewed by Hajime Morita.
2687
2688         For a preparation to fix a form identification problem (Bug 91209),
2689         restore controls states when the parsing of their owner forms is
2690         completed. For controls without owners, their states are restored when
2691         their parsing is completed as ever.
2692
2693         No new tests. This doesn't change observable behavior.
2694
2695         * html/FormController.cpp:
2696         (WebCore::ownerFormForState):
2697         Added. This code was used in formKey(), and restoreControlState*() use it.
2698         (WebCore::FormKeyGenerator::formKey): Use ownerFormForState(). No behavior change.
2699         (WebCore::FormController::restoreControlStateFor):
2700         Moved some code from HTMLFormControlElementWithState::finishParsingChildren().
2701         The difference is we don't resotre state if this control is owned by a form.
2702         (WebCore::FormController::restoreControlStateIn):
2703         Restore states of associated controls. This is called from
2704         finishParsingChildren() for <form>.
2705         * html/FormController.h:
2706         (FormController):
2707         - Declare restoreControlStateFor() and restoreControlStateIn().
2708         - Make takeStateForFormElement() private.
2709
2710         * html/FormAssociatedElement.cpp:
2711         (WebCore::FormAssociatedElement::isFormControlElementWithState):
2712         Added. The default implementation returns false.
2713         * html/FormAssociatedElement.h:
2714         (FormAssociatedElement):
2715         Added isFormControlElementWithState() for FormController::restoreControlStateIn().
2716         * html/HTMLFormControlElementWithState.cpp:
2717         (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
2718         Some code was moved to FormController:restoreControlStateFor().
2719         (WebCore::HTMLFormControlElementWithState::isFormControlElementWithState):
2720         Added. Returns true.
2721         * html/HTMLFormControlElementWithState.h:
2722         (HTMLFormControlElementWithState): Declare isFormControlElementWithState().
2723         * html/HTMLFormElement.cpp:
2724         (WebCore::HTMLFormElement::finishParsingChildren):
2725         Added. Calls FormController::restoreControlStateIn().
2726         * html/HTMLFormElement.h:
2727         (HTMLFormElement): Declare finishParsingChildren().
2728
2729 2012-07-13  Kent Tamura  <tkent@chromium.org>
2730
2731         Make calendar pickers testable
2732         https://bugs.webkit.org/show_bug.cgi?id=84827
2733
2734         Reviewed by Hajime Morita.
2735
2736         WebCore:
2737         - Add PagePopupDriver, an interface to open/close a PagePopup.
2738         - Add setPagePopupDriver() to ChromeClient in order to inject a
2739         PagePopupDriver for testing.
2740
2741         Internals:
2742         Add MockPagePopupDriver, which creates a MockPagePopup, which creates a
2743         normal <iframe> in the top-level document, and load the popup content on
2744         it. MockPagePopupDriver is enabled by
2745         internals.settings.setEnableMockPagePopup(true).
2746
2747         Test: fast/forms/date/calendar-picker-appearance.html
2748
2749         * WebCore.gypi: Add new files.
2750         * WebCore.xcodeproj/project.pbxproj: Add files to make this buildable.
2751         * page/ChromeClient.h:
2752         (ChromeClient): Add function for PagePopupDriver.
2753         * loader/EmptyClients.h: Add empty implementations for PagePopupDriver functions.
2754         * page/PagePopupDriver.h: Added.
2755         (PagePopupDriver):
2756         (WebCore::PagePopupDriver::~PagePopupDriver):
2757
2758         * testing/InternalSettings.cpp:
2759         (WebCore::InternalSettings::Backup::restoreTo): Reset the mock PagePopupDriver.
2760         (WebCore::InternalSettings::setEnableMockPagePopup):
2761         Register MockPagePopupDriver to ChromeClient.
2762         * testing/InternalSettings.h:
2763         (InternalSettings): Declare setEnableMockPagePopup().
2764         * testing/InternalSettings.idl: ditto.
2765         * testing/MockPagePopupDriver.cpp: Added.
2766         (MockPagePopup): Pseudo PagePopup implementation with the standard <iframe>.
2767         (WebCore::MockPagePopupDriver::MockPagePopupDriver): Added.
2768         (WebCore::MockPagePopupDriver::create): Added.
2769         (WebCore::MockPagePopupDriver::~MockPagePopupDriver): Added.
2770         (WebCore::MockPagePopupDriver::openPagePopup):
2771         Added. An override of PagePopupDriver function. This creates a MockPagePopup.
2772         (WebCore::MockPagePopupDriver::closePagePopup):
2773         Added. An override of PagePopupDriver function. This deletes the MockPagePopup.
2774         * testing/MockPagePopupDriver.h:
2775         (MockPagePopupDriver): Added.
2776
2777         * testing/v8/WebCoreTestSupport.cpp:
2778         (WebCoreTestSupport::injectPagePopupController):
2779         Added. Production code uses per-Page context feature framework. However
2780         MockPagePopup uses the same page as the host page. So we can't use the
2781         framework and need to inject window.pagePopupController manually.
2782         * testing/v8/WebCoreTestSupport.h:
2783         (WebCoreTestSupport): Add injectPagePopupController().
2784
2785 2012-07-12  Pavel Feldman  <pfeldman@chromium.org>
2786
2787         Web Inspector: mute the native looks of the selects in the console.
2788         https://bugs.webkit.org/show_bug.cgi?id=91120
2789
2790         Reviewed by Vsevolod Vlasov.
2791
2792         This is necessary for Mac now that we don't use border images for select.
2793
2794         * inspector/front-end/ConsoleView.js:
2795         (WebInspector.ConsoleView.prototype.get statusBarItems):
2796         (WebInspector.ConsoleView.prototype.addContext):
2797         (WebInspector.ConsoleView.prototype.removeContext):
2798         (WebInspector.ConsoleView.prototype._updateIsolatedWorldSelector):
2799         (WebInspector.ConsoleView.prototype._appendIsolatedContextOption):
2800         (WebInspector.ConsoleView.prototype._currentEvaluationContext):
2801         (WebInspector.ConsoleView.prototype._currentIsolatedContextId):
2802         * inspector/front-end/StatusBarButton.js:
2803         (WebInspector.StatusBarComboBox):
2804         (WebInspector.StatusBarComboBox.prototype.addOption):
2805         (WebInspector.StatusBarComboBox.prototype.removeOption):
2806         (WebInspector.StatusBarComboBox.prototype.removeOptions):
2807         (WebInspector.StatusBarComboBox.prototype.selectedOption):
2808         * inspector/front-end/inspector.css:
2809         (.status-bar-select-container):
2810         (select.status-bar-item):
2811         (.console-context):
2812
2813 2012-07-13  Andrei Bucur  <abucur@adobe.com>
2814
2815         [CSS Regions] Fix the lifecycle for the flow objects and their renderers
2816         https://bugs.webkit.org/show_bug.cgi?id=89000
2817
2818         Reviewed by Eric Seidel.
2819
2820         This patch adds the concept of a NamedFlowCollection, owned by the document, that keeps track of
2821         all the named flows that exist in the Document. This collection contains a ListHashSet of weak references to
2822         all the existing NamedFlows in the document. This is not a managed set because the CREATED flows are referenced from the renderer and
2823         the NULL flows are only cached, they should be destructible.
2824         Two named flows are considered to be equal if they have the same name.
2825         I've changed the NamedFlow state to depend on the existence of its renderer. A flow thread that has a renderer will also have a NamedFlow object.
2826         A flow thread without a renderer can have a NamedFlow object, but only in the NULL state. It's possible for a NamedFlow object to jump from the
2827         NULL state to the CREATED state if it was not destroyed (e.g. it was referenced from JS). Keeping track of the NULL state flows that have listeners will be important
2828         so when they go back to the CREATED state, the listeners would still be there.
2829
2830         Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/
2831
2832         Tests: The old tests have been modified to take into account the new behavior
2833
2834         * CMakeLists.txt:
2835         * GNUmakefile.list.am:
2836         * Target.pri:
2837         * WebCore.gypi:
2838         * WebCore.vcproj/WebCore.vcproj:
2839         * WebCore.xcodeproj/project.pbxproj:
2840         * dom/DOMAllInOne.cpp:
2841         * dom/Document.cpp:
2842         (WebCore::Document::~Document):
2843         (WebCore):
2844         (WebCore::Document::webkitGetFlowByName):
2845         (WebCore::Document::namedFlows):
2846         * dom/Document.h:
2847         (WebCore):
2848         (Document):
2849         * dom/WebKitNamedFlow.cpp:
2850         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
2851         (WebCore::WebKitNamedFlow::~WebKitNamedFlow):
2852         (WebCore::WebKitNamedFlow::create):
2853         (WebCore):
2854         (WebCore::WebKitNamedFlow::name):
2855         (WebCore::WebKitNamedFlow::overset):
2856         (WebCore::nodeInFlowThread):
2857         (WebCore::WebKitNamedFlow::getRegionsByContentNode):
2858         (WebCore::WebKitNamedFlow::getContent):
2859         (WebCore::WebKitNamedFlow::setRenderer):
2860         * dom/WebKitNamedFlow.h:
2861         (WebCore):
2862         (WebKitNamedFlow):
2863         (WebCore::WebKitNamedFlow::getFlowState):
2864         (WebCore::WebKitNamedFlow::switchFlowState):
2865         * dom/WebKitNamedFlowCollection.cpp: Added.
2866         (WebCore):
2867         (WebCore::WebKitNamedFlowCollection::WebKitNamedFlowCollection):
2868         (WebCore::WebKitNamedFlowCollection::length): An O(1) operation
2869         (WebCore::WebKitNamedFlowCollection::item): An O(N) operation
2870         (WebCore::WebKitNamedFlowCollection::flowByName): An O(1) operation
2871         (WebCore::WebKitNamedFlowCollection::ensureNamedFlowInCreatedState): An O(1) operation
2872         (WebCore::WebKitNamedFlowCollection::moveNamedFlowToNullState): An O(1) operation
2873         (WebCore::WebKitNamedFlowCollection::discardNamedFlow): An O(1) operation
2874         (WebCore::WebKitNamedFlowCollection::documentDestroyed):
2875         (WebCore::WebKitNamedFlowCollection::NamedFlowHashFunctions::hash):
2876         (WebCore::WebKitNamedFlowCollection::NamedFlowHashFunctions::equal):
2877         (WebKitNamedFlowCollection::NamedFlowHashFunctions):
2878         (WebCore::WebKitNamedFlowCollection::NamedFlowHashTranslator::hash):
2879         (WebCore::WebKitNamedFlowCollection::NamedFlowHashTranslator::equal):
2880         * dom/WebKitNamedFlowCollection.h: Copied from Source/WebCore/dom/WebKitNamedFlow.h.
2881         (WebCore):
2882         (WebKitNamedFlowCollection):
2883         (WebCore::WebKitNamedFlowCollection::create):
2884         (WebCore::WebKitNamedFlowCollection::document):
2885         * rendering/FlowThreadController.cpp:
2886         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
2887         (WebCore::FlowThreadController::removeFlowThread):
2888         (WebCore):
2889         * rendering/FlowThreadController.h:
2890         (FlowThreadController):
2891         * rendering/RenderNamedFlowThread.cpp:
2892         (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
2893         (WebCore):
2894         (WebCore::RenderNamedFlowThread::~RenderNamedFlowThread):
2895         (WebCore::RenderNamedFlowThread::removeRegionFromThread):
2896         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentNode):
2897         (WebCore::RenderNamedFlowThread::flowThreadName):
2898         (WebCore::RenderNamedFlowThread::willBeDestroyed):
2899         * rendering/RenderNamedFlowThread.h:
2900         (RenderNamedFlowThread):
2901         (WebCore::RenderNamedFlowThread::contentNodes):
2902         (WebCore::RenderNamedFlowThread::canBeDestroyed):
2903
2904 2012-07-13  Vineet Chaudhary  <rgf748@motorola.com>
2905
2906         [V8Bindings] Implement generalised method to validates that the passed object is a sequence type.
2907         https://bugs.webkit.org/show_bug.cgi?id=91056
2908
2909         Reviewed by Kentaro Hara.
2910
2911         Currently the V8 implementation validates that the passed object is a sequence type only
2912         for MessagePort in V8Utilities::extractTransferables().
2913         There should be generalised method for other types too.
2914         Spec URL: http://www.w3.org/TR/2012/WD-WebIDL-20120207/#es-sequence
2915
2916         No new test, Just refactoring. There should be no behavioral changes.
2917
2918         * bindings/v8/V8Binding.h:
2919         (WebCore::toV8Sequence): Added implementation of toV8Sequence().
2920
2921 2012-07-13  Zeno Albisser  <zeno@webkit.org>
2922
2923         [Qt][WK2] Implement GraphicsSurface for Linux/GLX.
2924         https://bugs.webkit.org/show_bug.cgi?id=90881
2925
2926         Add a GLX based GraphicsSurface implementation for Linux.
2927         Native X windows are being used for exchanging textures
2928         with the UIProcess.
2929
2930         Reviewed by Noam Rosenthal.
2931
2932         * Target.pri:
2933         * WebCore.pri:
2934         * platform/graphics/surfaces/GraphicsSurface.cpp:
2935         (WebCore::GraphicsSurface::create):
2936             Move creating GraphicsSurface instance into
2937             platformCreate/platformImport functions to allow
2938             platform specific creation based on the provided flags.
2939         (WebCore::GraphicsSurface::GraphicsSurface):
2940         (WebCore::GraphicsSurface::~GraphicsSurface):
2941             Call platformDestroy when destroying a GraphicsSurface.
2942         (WebCore):
2943         * platform/graphics/surfaces/GraphicsSurface.h:
2944             Make platformCreate/platformImport functions static
2945             to be able to call these from the static create function.
2946             Add Destructor prototype and add GraphicsSurfacePrivate member.
2947         (WebCore):
2948         (GraphicsSurface):
2949         * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
2950         (WebCore):
2951         (WebCore::GraphicsSurface::platformCreate):
2952         (WebCore::GraphicsSurface::platformImport):
2953             Insert creation of GraphicsSurface instance.
2954             This allows having a platform specific creation mechanism
2955             for GLX.
2956         * platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp: Added.
2957         (WebCore):
2958         (OffScreenRootWindow):
2959         (WebCore::OffScreenRootWindow::OffScreenRootWindow):
2960         (WebCore::OffScreenRootWindow::get):
2961         (WebCore::OffScreenRootWindow::~OffScreenRootWindow):
2962             Add an OffScreenRootWindow singelton that is being used
2963             as a parent for all native offscreen windows.
2964         (GraphicsSurfacePrivate):
2965             This class is used to manage all the X related resources
2966             such as opening a display or creating XPixmaps etc.
2967         (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
2968             Open a connection to the X server and create a
2969             QOpenGLContext that can be used to resolve GL functions.
2970         (WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):
2971             Properly cleanup and release all the X resources again.
2972         (WebCore::GraphicsSurfacePrivate::createSurface):
2973             Create a surface that is placed off screen and can be
2974             used as a rendering target by the WebProcess.
2975         (WebCore::GraphicsSurfacePrivate::createPixmap):
2976             Create a GLXPixmap from the XWindow that was previously
2977             redirected by the WebProcess. This GLXPixmap can then be
2978             bound to a texture and being painted on screen by the
2979             UIProcess.
2980         (WebCore::GraphicsSurfacePrivate::makeCurrent):
2981         (WebCore::GraphicsSurfacePrivate::swapBuffers):
2982         (WebCore::GraphicsSurfacePrivate::display):
2983         (WebCore::GraphicsSurfacePrivate::glxPixmap):
2984         (WebCore::GraphicsSurfacePrivate::size):
2985         (WebCore::GraphicsSurfacePrivate::glContext):
2986         (WebCore::resolveGLMethods):
2987             Initialize all the function pointers for the GL functions used.
2988         (WebCore::GraphicsSurface::platformExport):
2989         (WebCore::GraphicsSurface::platformGetTextureID):
2990             Bind the GLXPixmap to a texture.
2991         (WebCore::GraphicsSurface::platformCopyToGLTexture):
2992             Not beeing implemented for GLX.
2993         (WebCore::GraphicsSurface::platformCopyFromFramebuffer):
2994             Blit origin fbo onto the GraphicsSurface's backing.
2995         (WebCore::GraphicsSurface::platformCreate):
2996         (WebCore::GraphicsSurface::platformImport):
2997         (WebCore::GraphicsSurface::platformLock):
2998         (WebCore::GraphicsSurface::platformUnlock):
2999         (WebCore::GraphicsSurface::platformDestroy):
3000
3001 2012-07-13  Dongwoo Im  <dw.im@samsung.com>
3002
3003         CodeGeneratorJS.pm : SetterExpression should use 'push' rather than 'unshift'
3004         https://bugs.webkit.org/show_bug.cgi?id=91198
3005
3006         Reviewed by Kentaro Hara.
3007
3008         'SetterExpression' should use 'push' to make arguments, rather than 'unshift'.
3009
3010         No new tests. Covered by existing tests.
3011
3012         * bindings/scripts/CodeGeneratorJS.pm:
3013         (GenerateImplementation):
3014
3015 2012-07-13  Yoshifumi Inoue  <yosin@chromium.org>
3016
3017         REGRESSION(r119948): [Forms] Spin button Up/Down actions make value to zero for input type "number" when step mismatched
3018         https://bugs.webkit.org/show_bug.cgi?id=91197
3019
3020         Reviewed by Kent Tamura.
3021
3022         This patch fixes implementation of Decimal::ceiling() and floor().
3023         They return wrong value for small fractional numbers.
3024
3025         The bug is occurred when:
3026           - Step-able input type, e.g. number, date, datetime, and so on.
3027           - Current value is step mismatched
3028           - Current value is smaller than step
3029           - Step up/down by spin button
3030         because spin button up/down actions are implemented in InputType::setpUpFromRenderer
3031         which calls Decimal::ceiling() and floor() for step mismatched case.
3032
3033         Tests: fast/forms/number/number-stepup-stepdown-from-renderer.html: Added test cases
3034                WebKit/chromium/tests/DecimalTest.cpp: Added test cases
3035
3036         * platform/Decimal.cpp:
3037         (WebCore::Decimal::ceiling): Changed to return 1 for positive small fractional number.
3038         (WebCore::Decimal::floor): Changed to return -1 for negative small fractional number.
3039
3040 2012-07-13  Dominic Mazzoni  <dmazzoni@google.com>
3041
3042         Should be possible to focus elements within canvas fallback content
3043         https://bugs.webkit.org/show_bug.cgi?id=87898
3044
3045         Reviewed by Chris Fleizach.
3046
3047         Patches isFocusable in dom/Node.cpp and html/HTMLFormControlElement.cpp
3048         to make elements focusable if they're a descendent of a canvas element
3049         if they would otherwise have been focusable but just didn't have
3050         a renderer. Adds a bit to ElementRareData to efficiently keep track
3051         of elements in a canvas subtree.
3052
3053         Test: fast/canvas/fallback-content.html
3054
3055         * dom/Element.cpp:
3056         (WebCore::Element::attach):
3057         (WebCore::Element::detach):
3058         (WebCore::Element::setIsInCanvasSubtree):
3059         (WebCore):
3060         (WebCore::Element::isInCanvasSubtree):
3061         * dom/Element.h:
3062         (Element):
3063         * dom/ElementRareData.h:
3064         (ElementRareData):
3065         (WebCore::ElementRareData::ElementRareData):
3066         * dom/Node.cpp:
3067         (WebCore::Node::isFocusable):
3068         * html/HTMLCanvasElement.cpp:
3069         (WebCore::HTMLCanvasElement::attach):
3070         (WebCore):
3071         * html/HTMLCanvasElement.h:
3072         (HTMLCanvasElement):
3073         * html/HTMLFormControlElement.cpp:
3074         (WebCore::HTMLFormControlElement::isFocusable):
3075
3076 2012-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3077
3078         [GTK] Add API to get HTTPS status to WebKit2 GTK+
3079         https://bugs.webkit.org/show_bug.cgi?id=91100
3080
3081         Reviewed by Martin Robinson.
3082
3083         * platform/network/soup/ResourceResponse.h:
3084         (WebCore::ResourceResponse::soupMessageCertificate): Return the
3085         certificate.
3086         (WebCore::ResourceResponse::setSoupMessageCertificate): Set a
3087         certificate.
3088         (WebCore::ResourceResponse::soupMessageTLSErrors): Return the TLS
3089         errors.
3090         (WebCore::ResourceResponse::setSoupMessageTLSErrors): Set TLS
3091         errors.
3092         * platform/network/soup/ResourceResponseSoup.cpp:
3093         (WebCore::ResourceResponse::toSoupMessage): Set the certificate
3094         and TLS errors to the newly created SoupMessage.
3095         (WebCore::ResourceResponse::updateFromSoupMessage): Get the
3096         certificate and TLS errors from the SoupMessage.
3097
3098 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
3099
3100         RadioNodeList is not updated upon input type change
3101         https://bugs.webkit.org/show_bug.cgi?id=91178
3102
3103         Reviewed by Alexey Proskuryakov.
3104
3105         Invalidate the radio node lists when type content attribute changes since it excludes
3106         image type input elements.
3107
3108         Test: fast/forms/radionodelist-image-type.html
3109
3110         * dom/Document.cpp:
3111         (WebCore::shouldInvalidateNodeListForType):
3112         * dom/Document.h: Renamed InvalidateOnIdNameForAttrChange to InvalidateOnFormAttrChange
3113         since listing all attribute name isn't useful at this point.
3114         * html/RadioNodeList.cpp:
3115         (WebCore::RadioNodeList::RadioNodeList):
3116
3117 2012-07-12  Dongwoo Im  <dw.im@samsung.com>
3118
3119         CodeGeneratorJS.pm need to handle the attribute which has "CallWith=ScriptExecutionContext" option.
3120         https://bugs.webkit.org/show_bug.cgi?id=91185
3121
3122         Reviewed by Kentaro Hara.
3123
3124         When an attribute has "CallWith=ScriptExecutionContext" option, 'ScriptExecutionContext*' parameter should be the last parameter.
3125
3126         No new tests. Covered by existing tests.
3127
3128         * bindings/scripts/CodeGeneratorJS.pm:
3129         (GenerateImplementation):
3130
3131 2012-07-12  Yoshifumi Inoue  <yosin@chromium.org>
3132
3133         REGRESSION(r117738): [Forms] stepMismatch for input type "time" with large step value always return false.
3134         https://bugs.webkit.org/show_bug.cgi?id=91062
3135
3136         Reviewed by Kent Tamura.
3137
3138         This patch changes value of StepRange::acceptableError to zero for
3139         integer restricted step value.
3140
3141         No new tests, existing test covers (fast/forms/time/ValidityState-stepMismatch-time.html) this change although they are listed in TestExpectation file.
3142
3143         * html/StepRange.cpp:
3144         (WebCore::StepRange::acceptableError): Changed to return 0 if step value is restricted to be an integer.
3145
3146 2012-07-12  Dan Bernstein  <mitz@apple.com>
3147
3148         Pass an option flag to CFStringGetHyphenationLocationBeforeIndex() that tells it to not
3149         terminate the search at the last word boundary before the given index.
3150
3151         Reviewed by Adele Peterson.
3152
3153         No test, because the current version of Core Foundation ignores the options parameter.
3154
3155         * platform/text/cf/HyphenationCF.cpp:
3156         (WebCore::lastHyphenLocation): Changed the options parameter from 0 to 1.
3157
3158 2012-07-12  Eric Seidel  <eric@webkit.org>
3159
3160         Incorrect behaviour calling Range setStart or setEnd with boundary in different document
3161         https://bugs.webkit.org/show_bug.cgi?id=42517
3162
3163         Reviewed by Ojan Vafai.
3164
3165         Added a new static inline "checkForDifferentRootContainer" to share some code
3166         and made setStart/setEnd do the right thing in the x-document case.  I removed
3167         the bogus checks in set*After/set*Before functions, and since they just call
3168         through to setStart/setEnd, they also now do the right thing.
3169
3170         Test: fast/dom/Range/set-wrong-document-err.html
3171
3172         * dom/Range.cpp:
3173         (WebCore::checkForDifferentRootContainer):
3174         (WebCore):
3175         (WebCore::Range::setStart):
3176         (WebCore::Range::setEnd):
3177         (WebCore::Range::setStartAfter):
3178         (WebCore::Range::setEndBefore):
3179         (WebCore::Range::setEndAfter):
3180         (WebCore::Range::setStartBefore):
3181
3182 2012-07-12  Erik Arvidsson  <arv@chromium.org>
3183
3184         [V8] Simplify CodeGeneratorV8 since V8OnProto is only true for DOMWindow
3185         https://bugs.webkit.org/show_bug.cgi?id=91165
3186
3187         Reviewed by Nate Chapin.
3188
3189         The old code was dead code since V8OnProto only ever gets set to 1 for DOMWindow.
3190
3191         No new tests. No change in functionality.
3192
3193         * bindings/scripts/CodeGeneratorV8.pm:
3194         (GenerateNormalAttrSetter):
3195
3196 2012-07-12  Ryosuke Niwa  <rniwa@webkit.org>
3197
3198         Build fix. Initialize unused const member variables to make compilers happy.
3199
3200         * dom/DynamicNodeList.h:
3201         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase):
3202
3203 2012-07-12  Konrad Piascik  <kpiascik@rim.com>
3204
3205         Web Inspector: Geolocation override
3206         https://bugs.webkit.org/show_bug.cgi?id=89365
3207
3208         Reviewed by Pavel Feldman.
3209
3210         Reverted original patch.
3211         Change has not been reviewed by the right people. It declares
3212         public protocol methods and is wrong in several ways.
3213
3214         * Modules/geolocation/GeolocationController.cpp:
3215         (WebCore::GeolocationController::GeolocationController):
3216         (WebCore::GeolocationController::positionChanged):
3217         * Modules/geolocation/GeolocationController.h:
3218         (GeolocationController):
3219         * inspector/Inspector.json:
3220         * inspector/InspectorInstrumentation.cpp:
3221         (WebCore):
3222         * inspector/InspectorInstrumentation.h:
3223         (WebCore):
3224         (InspectorInstrumentation):
3225         * inspector/InspectorPageAgent.cpp:
3226         (WebCore::InspectorPageAgent::InspectorPageAgent):
3227         * inspector/InspectorPageAgent.h:
3228         * inspector/front-end/Settings.js:
3229         * inspector/front-end/SettingsScreen.js:
3230         (WebInspector.UserAgentSettingsTab):
3231         (WebInspector.UserAgentSettingsTab.prototype._createDeviceMetricsElement):
3232         * inspector/front-end/UserAgentSupport.js:
3233
3234 2012-07-12  Ryosuke Niwa  <rniwa@webkit.org>
3235
3236         Move m_type and m_hasNameCache from HTMLCollectionCacheBase to DynamicNodeListCacheBase for better bit packing
3237         https://bugs.webkit.org/show_bug.cgi?id=91164
3238
3239         Reviewed by Anders Carlsson.
3240
3241         Moved m_type and m_hasNameCache from HTMLCollection and renamed them to m_collectionType and m_isNameCacheValid.
3242
3243         Also renamed shouldIncludeChildren to shouldOnlyIncludeDirectChildren and negated the return value since
3244         all HTMLCollection include children in the collection and the function was meant to tell us whether the collection
3245         should include descendents that are not direct children of base().
3246
3247         In addition, renamed nextNodeOrSibling to nextNode since "or sibling" doesn't seem to add any semantic clarity.
3248
3249         * dom/DynamicNodeList.h:
3250         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase):
3251         (DynamicNodeListCacheBase):
3252         (WebCore::DynamicNodeListCacheBase::type):
3253         (WebCore::DynamicNodeListCacheBase::hasNameCache):
3254         (WebCore::DynamicNodeListCacheBase::setHasNameCache):
3255         (WebCore::DynamicNodeListCacheBase::clearCache):
3256         * html/HTMLCollection.cpp:
3257         (WebCore::shouldOnlyIncludeDirectChildren):
3258         (WebCore::HTMLCollection::HTMLCollection):
3259         (WebCore::HTMLCollection::isAcceptableElement):
3260         (WebCore::nextNode):
3261         (WebCore::HTMLCollection::itemAfter):
3262         * html/HTMLCollection.h:
3263         (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
3264         (HTMLCollectionCacheBase):
3265         (WebCore::HTMLCollectionCacheBase::clearCache):
3266
3267 2012-07-12  Shinya Kawanaka  <shinyak@chromium.org>
3268
3269         Needs callback before AuthorShadowRoot is added.
3270         https://bugs.webkit.org/show_bug.cgi?id=91167
3271
3272         Reviewed by Hajime Morita.
3273
3274         This is a preliminary patch for adding multiple Shadow DOM support for media elements and form elements.
3275         They assume that UserAgentShadowRoot is the oldest, however currently a page author may try to add
3276         AuthorShadowRoot before adding UserAgentShadowRoot.
3277
3278         This patch adds a callback before AuthorShadowRoot is being added, and allow us to add UserAgentShadowRoot
3279         for those elements. See also Bug 77936, Bug 77937, Bug 90532.
3280
3281         * dom/Element.h:
3282         (WebCore::Element::willAddAuthorShadowRoot):
3283         * dom/ElementShadow.cpp:
3284         (WebCore::ElementShadow::addShadowRoot):
3285         * dom/ElementShadow.h:
3286         (ElementShadow):
3287         * dom/ShadowRoot.cpp:
3288         (WebCore::ShadowRoot::create):
3289
3290 2012-07-12  Dana Jansens  <danakj@chromium.org>
3291
3292         [chromium] Remove the RenderPass pointer from RenderPassDrawQuad
3293         https://bugs.webkit.org/show_bug.cgi?id=91023
3294
3295         Reviewed by Adrienne Walker.
3296
3297         Removes the RenderPass pointer and keeps only an integer id in the
3298         quad to refer back to the RenderPass the quad reads from.
3299
3300         Covered by existing tests.
3301
3302         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
3303         (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
3304         (WebCore::findRenderPassById):
3305         (WebCore):
3306         (WebCore::removeRenderPassesRecursive):
3307         (WebCore::CCLayerTreeHostImpl::CullRenderPassesWithCachedTextures::shouldRemoveRenderPass):
3308         (WebCore::CCLayerTreeHostImpl::CullRenderPassesWithNoQuads::shouldRemoveRenderPass):
3309         (WebCore::CCLayerTreeHostImpl::removeRenderPasses):
3310         (WebCore::CCLayerTreeHostImpl::prepareToDraw):
3311         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
3312         (FrameData):
3313         (CullRenderPassesWithCachedTextures):
3314         (CullRenderPassesWithNoQuads):
3315         (CCLayerTreeHostImpl):
3316         * platform/graphics/chromium/cc/CCRenderPass.cpp:
3317         (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):
3318         * platform/graphics/chromium/cc/CCRenderPass.h:
3319         (WebCore):
3320         * platform/graphics/chromium/cc/CCRenderPassDrawQuad.cpp:
3321         (WebCore::CCRenderPassDrawQuad::create):
3322         (WebCore::CCRenderPassDrawQuad::CCRenderPassDrawQuad):
3323         * platform/graphics/chromium/cc/CCRenderPassDrawQuad.h:
3324         (CCRenderPassDrawQuad):
3325         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
3326         (WebCore::CCRenderSurface::appendQuads):
3327         * platform/graphics/chromium/cc/CCRenderSurface.h:
3328         (CCRenderSurface):
3329
3330 2012-07-12  Elliott Sprehn  <esprehn@gmail.com>
3331
3332         Unneeded tree walking when adding or removing children due to RenderCounter / RenderQuote logic
3333         https://bugs.webkit.org/show_bug.cgi?id=89900
3334
3335         Reviewed by Eric Seidel and Abhishek Arya.
3336
3337         Previously we would walk the all children a renderer whenever adding
3338         or removing a child renderer from its RenderObjectChildList to look for 
3339         RenderQuote and RenderCounter instances to update. This patch introduces 
3340         a counter in RenderView for the number of RenderQuote and RenderCounter 
3341         instances in that document so we can avoid these traversals.
3342
3343         No tests needed since this is just a short circuiting of logic and the existing
3344         tests should cover it.
3345
3346         * rendering/RenderCounter.cpp:
3347         (WebCore::RenderCounter::RenderCounter): Increment instance counter.
3348         (WebCore::RenderCounter::willBeDestroyed): Decrement instance counter.
3349         (WebCore):
3350         (WebCore::RenderCounter::rendererRemovedFromTree): Short circuit when counter is zero.
3351         (WebCore::RenderCounter::rendererSubtreeAttached): Short circuit when counter is zero.
3352         * rendering/RenderCounter.h:
3353         (RenderCounter):
3354         * rendering/RenderObjectChildList.cpp:
3355         (WebCore::RenderObjectChildList::removeChildNode): Short circuit calling into Counter and Quote code when the document is being destroyed.
3356         * rendering/RenderQuote.cpp:
3357         (WebCore::RenderQuote::RenderQuote):
3358         (WebCore::RenderQuote::willBeDestroyed):
3359         (WebCore):
3360         (WebCore::RenderQuote::rendererSubtreeAttached): Increment instance counter.
3361         (WebCore::RenderQuote::rendererRemovedFromTree): Decrement instance counter.
3362         * rendering/RenderQuote.h:
3363         (RenderQuote):
3364         * rendering/RenderView.cpp:
3365         (WebCore::RenderView::RenderView):
3366         * rendering/RenderView.h: Methods for managing the RenderQuote and RenderCounter counts.
3367         (RenderView):
3368         (WebCore::RenderView::addRenderQuote):
3369         (WebCore::RenderView::removeRenderQuote):
3370         (WebCore::RenderView::hasRenderQuotes):
3371         (WebCore::RenderView::addRenderCounter):
3372         (WebCore::RenderView::removeRenderCounter):
3373         (WebCore::RenderView::hasRenderCounters):
3374
3375 2012-07-12  Ryosuke Niwa  <rniwa@webkit.org>
3376
3377         Merge HTMLCollectionWithArrayStorage into HTMLCollection
3378         https://bugs.webkit.org/show_bug.cgi?id=91144
3379
3380         Reviewed by Anders Carlsson.
3381
3382         Merged HTMLCollectionWithArrayStorage::item into HTMLCollection::item and got rid of
3383         HTMLCollectionWithArrayStorage. Also de-virtualized HTMLCollection::item and HTMLCollection::length
3384         and merged itemInArrayAfter and itemAfter.
3385
3386         In addition, improved the algorithm in HTMLCollection::length to take advantage of item cache.
3387         Instead of always computing the length from the beginning, we start the search from the cached item
3388         so that if we're near end of the collection, we avoid significant portion of the node traversal.
3389
3390         Furthermore, made HTMLCollection always call setItemCache with a non-null item and HTMLCollection::item
3391         set the length cache when it reaches the end of the collection to avoid redundant length calculations.
3392
3393         * dom/DynamicNodeList.h:
3394         (WebCore::DynamicNodeListCacheBase::setItemCache): Add a FIXME.
3395         * html/HTMLCollection.cpp:
3396         (WebCore::HTMLCollection::itemAfter): Regular HTMLCollection doesn't have uses elements array so
3397         assert that offsetInArray is always 0.
3398         (WebCore): Removed calcLength.
3399         (WebCore::HTMLCollection::length): Rewritten. The algorithm is as follows:
3400         When there is no item cache, we look for the first item by calling item(0). If item(0) returns null,
3401         then it must have set the length cache so bail out. If the previous step didn't bail out, then
3402         the item cache is valid and not null (see above), so count the number of remaining items in collection
3403         starting at the cached item's offset + 1.
3404         (WebCore::HTMLCollection::item): Avoid calling setItemCache with null. When the first item is null,
3405         set the length cache instead.
3406         (WebCore::HTMLCollection::itemAfterCachedItem): Extracted from HTMLCollectionWithArrayStorage::item.
3407         (WebCore::HTMLCollection::namedItem): Pass in arrayOffset to itemAfter. Note this variable is never
3408         used since only HTMLFormCollection and HTMLPropertiesCollection use array offsets but they override
3409         this function.
3410         (WebCore::HTMLCollection::updateNameCache): Ditto.
3411         * html/HTMLCollection.h:
3412         (HTMLCollection):
3413         (WebCore):
3414         * html/HTMLFormCollection.cpp: Removed calcLength(). Even though this function didn't iterate over
3415         the collection directly, HTMLFormElement::length and HTMLFieldSetElement::length did so we're not
3416         regressing any performance here.
3417         (WebCore::HTMLFormCollection::HTMLFormCollection):
3418         (WebCore::HTMLFormCollection::itemAfter):
3419         * html/HTMLFormCollection.h:
3420         (HTMLFormCollection):
3421         * html/HTMLNameCollection.cpp:
3422         (WebCore::HTMLNameCollection::itemAfter):
3423         * html/HTMLNameCollection.h:
3424         (HTMLNameCollection):
3425         * html/HTMLPropertiesCollection.cpp: Removed calcLength().
3426         (WebCore::HTMLPropertiesCollection::HTMLPropertiesCollection):
3427         (WebCore::HTMLPropertiesCollection::itemAfter):