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