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