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