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