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