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