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