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