Update ANGLE in WebKit
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-07-17  Max Vujovic  <mvujovic@adobe.com>
2
3         Update ANGLE in WebKit
4         https://bugs.webkit.org/show_bug.cgi?id=89039
5
6         Reviewed by Dean Jackson and Mark Rowe.
7
8         Update ANGLE to r1170, with the following modifications:
9
10         (1) Use Bison 2.3 instead of Bison 2.4.2 to generate ExpressionParser.cpp and
11         glslang_tab.cpp. I had to modify ExpressionParser.y to make it compatible with Bison
12         2.3. The changes have been contributed back to ANGLE in r1224.
13
14         (2) Continue to recognize QNX as POSIX in ANGLE. This has been contributed back to ANGLE
15         in r1223.
16
17         (3) Rename ANGLE/src/compiler/preprocessor/new/Diagnostic.cpp to DiagnosticBase.cpp.
18         Rename ANGLE/src/compiler/preprocessor/new/DirectiveHandler.cpp to DirectiveHandlerBase.cpp.
19
20         With the introduction of ANGLE's new preprocessor, there were two files named Diagnostic.cpp
21         in ANGLE under different folders. This caused problems on the QT build when their object
22         files, both named Diagnostic.o, tried to go in the same folder. Renaming one of them to
23         DiagnosticBase.cpp avoids this conflict. The same situation occurred with
24         DirectiveHandler.cpp. I will work on contributing this change back to ANGLE for future
25         updates.
26
27         (4) Add the following lines to glslang.y and ExpressionParser.y:
28         #define YYENABLE_NLS 0
29         #define YYLTYPE_IS_TRIVIAL 1
30
31         Bison 2.3 doesn't first check that these macros are defined before reading their value,
32         which causes the QT build to fail.
33
34         We work around this issue in the same way in CSSGrammar.y.
35
36         I will work on contributing this change back to ANGLE.
37
38         No new tests. No change in behavior.
39
40         * CMakeLists.txt:
41         * GNUmakefile.list.am:
42         * Target.pri:
43
44 2012-07-17  Stephen Chenney  <schenney@chromium.org>
45
46         Crash in SVGStopElement::stopColorIncludingOpacity
47         https://bugs.webkit.org/show_bug.cgi?id=90814
48
49         Reviewed by Dirk Schulze.
50
51         No new tests as there should be no change in functionality.
52
53         * svg/SVGStopElement.cpp:
54         (WebCore::SVGStopElement::stopColorIncludingOpacity): Added a check for null
55         renderer and style. It is hard to see how this is happening because
56         the code is only invoked if the parent gradient has a renderer, and it seems
57         the stop element should always have a renderer when the parent has a renderer.
58         Still, it obviously can happen and does so frequently enough to generate multiple
59         Chromium crash reports per day. The fix is marked with a FIXME, as we expect to
60         remove this code entirely soon.
61
62 2012-07-17  Emil A Eklund  <eae@chromium.org>
63
64         Incorrect offset used for scrollWidth/Height calculation
65         https://bugs.webkit.org/show_bug.cgi?id=91461
66
67         Reviewed by Eric Seidel.
68
69         Due to a different offset being used to calculate the scrollWidth/Height
70         and pixelSnappedClientWidth/Height the scroll value can be off by one in
71         same cases. This can causes scrollbars to appear even when there is no
72         overflow.
73
74         Test: fast/sub-pixel/block-with-margin-overflow.html
75
76         * rendering/RenderBox.cpp:
77         (WebCore::RenderBox::scrollWidth):
78         Change location offset passed to snapSizeToPixel to include x() to match
79         offset used by pixelSnappedClientWidth.
80         
81         (WebCore::RenderBox::scrollHeight):
82         Change location offset passed to snapSizeToPixel to include y() to match
83         offset used by pixelSnappedClientHeight.
84
85         * rendering/RenderLayer.cpp:
86         (WebCore::RenderLayer::clampScrollOffset):
87         Change calculation to use pixelSnappedClientWidth/Height as it is
88         subtracted from the pixel snapped scrollWidth/Height values.
89         
90         (WebCore::RenderLayer::scrollWidth):
91         (WebCore::RenderLayer::scrollHeight):
92         Change RenderLayer versions of scrollWidth/Height to include x()/y() as
93         per the RenderBox versions.
94
95 2012-07-17  Hans Muller  <hmuller@adobe.com>
96
97         Rename CSS Exclusions CSSWrapShape class properties to match Exclusion shape function parameters
98         https://bugs.webkit.org/show_bug.cgi?id=89669
99
100         Reviewed by Dirk Schulze.
101
102         Renamed left,top properties in the exclusion shape types to better match the specification
103         http://dev.w3.org/csswg/css3-exclusions/#shapes-from-svg-syntax:
104
105         WrapShapeRectangle, CSSWrapShapeRectangle - left,top should be x, y
106         WrapShapeCircle, CSSWrapShapeCircle - left,top should be centerX, centerY
107         WrapShapeEllipse, CSSWrapShapeEllipse - left,top should be centerX, centerY
108
109         No new tests or tests revisions were needed, the existing tests cover these APIs.
110
111         * css/CSSParser.cpp:
112         (WebCore::CSSParser::parseExclusionShapeRectangle):
113         (WebCore::CSSParser::parseExclusionShapeCircle):
114         (WebCore::CSSParser::parseExclusionShapeEllipse):
115         * css/CSSWrapShapes.cpp:
116         (WebCore::CSSWrapShapeRectangle::cssText):
117         (WebCore::CSSWrapShapeCircle::cssText):
118         (WebCore::CSSWrapShapeEllipse::cssText):
119         * css/CSSWrapShapes.h:
120         (WebCore::CSSWrapShapeRectangle::x):
121         (WebCore::CSSWrapShapeRectangle::y):
122         (WebCore::CSSWrapShapeRectangle::setX):
123         (WebCore::CSSWrapShapeRectangle::setY):
124         (CSSWrapShapeRectangle):
125         (WebCore::CSSWrapShapeCircle::centerX):
126         (WebCore::CSSWrapShapeCircle::centerY):
127         (WebCore::CSSWrapShapeCircle::setCenterX):
128         (WebCore::CSSWrapShapeCircle::setCenterY):
129         (CSSWrapShapeCircle):
130         (WebCore::CSSWrapShapeEllipse::centerX):
131         (WebCore::CSSWrapShapeEllipse::centerY):
132         (WebCore::CSSWrapShapeEllipse::setCenterX):
133         (WebCore::CSSWrapShapeEllipse::setCenterY):
134         (CSSWrapShapeEllipse):
135         * css/WrapShapeFunctions.cpp:
136         (WebCore::valueForWrapShape):
137         (WebCore::wrapShapeForValue):
138         * rendering/style/WrapShapes.h:
139         (WebCore::WrapShapeRectangle::x):
140         (WebCore::WrapShapeRectangle::y):
141         (WebCore::WrapShapeRectangle::setX):
142         (WebCore::WrapShapeRectangle::setY):
143         (WrapShapeRectangle):
144         (WebCore::WrapShapeCircle::centerX):
145         (WebCore::WrapShapeCircle::centerY):
146         (WebCore::WrapShapeCircle::setCenterX):
147         (WebCore::WrapShapeCircle::setCenterY):
148         (WrapShapeCircle):
149         (WebCore::WrapShapeEllipse::centerX):
150         (WebCore::WrapShapeEllipse::centerY):
151         (WebCore::WrapShapeEllipse::setCenterX):
152         (WebCore::WrapShapeEllipse::setCenterY):
153         (WrapShapeEllipse):
154
155 2012-07-16  Pavel Feldman  <pfeldman@chromium.org>
156
157         Web Inspector: implement search / replace in source files (behind experiment flag)
158         https://bugs.webkit.org/show_bug.cgi?id=91394
159
160         Reviewed by Vsevolod Vlasov.
161
162         This change adds "loop" parameter to the go to next / previous search + adds a UI component
163         for search / replace of text in the sources panel. New UI component is behind the experiment.
164
165         * English.lproj/localizedStrings.js:
166         * inspector/front-end/ConsolePanel.js:
167         (WebInspector.ConsolePanel.prototype.performSearch):
168         (WebInspector.ConsolePanel.prototype.jumpToNextSearchResult):
169         (WebInspector.ConsolePanel.prototype.jumpToPreviousSearchResult):
170         * inspector/front-end/ElementsPanel.js:
171         (WebInspector.ElementsPanel.prototype.jumpToNextSearchResult):
172         (WebInspector.ElementsPanel.prototype.jumpToPreviousSearchResult):
173         * inspector/front-end/ExtensionPanel.js:
174         (WebInspector.ExtensionPanel.prototype.performSearch):
175         (WebInspector.ExtensionPanel.prototype.jumpToNextSearchResult):
176         (WebInspector.ExtensionPanel.prototype.jumpToPreviousSearchResult):
177         * inspector/front-end/JavaScriptSourceFrame.js:
178         (WebInspector.JavaScriptSourceFrame.prototype.afterTextChanged):
179         (WebInspector.JavaScriptSourceFrame.prototype.beforeTextChanged):
180         * inspector/front-end/NetworkPanel.js:
181         (WebInspector.NetworkLogView.prototype._sortItems):
182         (WebInspector.NetworkLogView.prototype._updateFilter):
183         (WebInspector.NetworkLogView.prototype.performSearch):
184         (WebInspector.NetworkLogView.prototype.jumpToPreviousSearchResult):
185         (WebInspector.NetworkLogView.prototype.jumpToNextSearchResult):
186         (WebInspector.NetworkPanel.prototype.performSearch):
187         * inspector/front-end/Panel.js:
188         (WebInspector.Panel.prototype.performSearch):
189         (WebInspector.Panel.prototype.jumpToNextSearchResult):
190         (WebInspector.Panel.prototype.jumpToPreviousSearchResult):
191         (WebInspector.Panel.prototype.canSearchAndReplace):
192         (WebInspector.Panel.prototype.replaceSelectionWith):
193         (WebInspector.Panel.prototype.replaceAllWith):
194         * inspector/front-end/ProfilesPanel.js:
195         (WebInspector.ProfilesPanel.prototype.jumpToNextSearchResult):
196         (WebInspector.ProfilesPanel.prototype.jumpToPreviousSearchResult):
197         * inspector/front-end/ResourcesPanel.js:
198         (WebInspector.ResourcesPanel.prototype.jumpToNextSearchResult):
199         (WebInspector.ResourcesPanel.prototype.jumpToPreviousSearchResult):
200         * inspector/front-end/ScriptsPanel.js:
201         (WebInspector.ScriptsPanel.prototype.performSearch.finishedCallback):
202         (WebInspector.ScriptsPanel.prototype.performSearch):
203         (WebInspector.ScriptsPanel.prototype.jumpToNextSearchResult):
204         (WebInspector.ScriptsPanel.prototype.jumpToPreviousSearchResult):
205         (WebInspector.ScriptsPanel.prototype.canSearchAndReplace):
206         (WebInspector.ScriptsPanel.prototype.replaceSelectionWith):
207         (WebInspector.ScriptsPanel.prototype.replaceAllWith):
208         * inspector/front-end/SearchController.js:
209         (WebInspector.SearchController):
210         (WebInspector.SearchController.prototype.cancelSearch):
211         (WebInspector.SearchController.prototype.disableSearchUntilExplicitAction):
212         (WebInspector.SearchController.prototype.handleShortcut):
213         (WebInspector.SearchController.prototype.activePanelChanged.performPanelSearch):
214         (WebInspector.SearchController.prototype.activePanelChanged):
215         (WebInspector.SearchController.prototype._updateSearchNavigationButtonState):
216         (WebInspector.SearchController.prototype.showSearchField):
217         (WebInspector.SearchController.prototype._onKeyDown):
218         (WebInspector.SearchController.prototype._onInput):
219         (WebInspector.SearchController.prototype._onNextButtonSearch):
220         (WebInspector.SearchController.prototype._onPrevButtonSearch):
221         (WebInspector.SearchController.prototype._performSearch):
222         (WebInspector.SearchController.prototype._toggleReplaceVisibility):
223         (WebInspector.SearchController.prototype._replace):
224         (WebInspector.SearchController.prototype._replaceAll):
225         * inspector/front-end/Settings.js:
226         (WebInspector.ExperimentsSettings):
227         * inspector/front-end/SourceFrame.js:
228         (WebInspector.SourceFrame.createSearchRegex):
229         (WebInspector.SourceFrame.prototype.beforeTextChanged):
230         (WebInspector.SourceFrame.prototype.replaceSearchMatchWith):
231         (WebInspector.SourceFrame.prototype.replaceAllWith):
232         (WebInspector.TextEditorDelegateForSourceFrame.prototype.beforeTextChanged):
233         (WebInspector.TextEditorDelegateForSourceFrame.prototype.commitEditing):
234         * inspector/front-end/StylesPanel.js:
235         (WebInspector.StyleSourceFrame.prototype.afterTextChanged):
236         * inspector/front-end/TextEditor.js:
237         (WebInspector.TextEditor.prototype._commitEditing):
238         * inspector/front-end/TextEditorModel.js:
239         (WebInspector.TextEditorModel.endsWithBracketRegex.):
240         * inspector/front-end/inspector.css:
241         (.search-replace):
242         (.search-replace:focus):
243         (.toolbar-search-navigation-controls):
244         (.toolbar-search-navigation.enabled):
245         (.toolbar-search):
246         (.toolbar-search input[type="checkbox"]):
247         (.toolbar-search button):
248         (.toolbar-search button:active):
249         (.toolbar-search-control):
250         (.toolbar-replace-control):
251         (.toolbar-search-navigation.enabled:active):
252         (.toolbar-search-navigation.toolbar-search-navigation-prev):
253         (.toolbar-search-navigation.toolbar-search-navigation-prev.enabled:active):
254         (.toolbar-search-navigation.toolbar-search-navigation-next):
255         (.toolbar-search-navigation.toolbar-search-navigation-next.enabled:active):
256         (.drawer-header-close-button):
257         (.inspector-footer):
258
259 2012-07-17  Gabor Ballabas  <gaborb@inf.u-szeged.hu>
260
261         [Qt][V8] Remove the V8 related codepaths and configuration
262         https://bugs.webkit.org/show_bug.cgi?id=90863
263
264         Reviewed by Simon Hausmann.
265
266         No new tests because no new functionality.
267
268         * DerivedSources.pri:
269         * Target.pri:
270         * WebCore.gypi:
271         * WebCore.pri:
272         * bindings/v8/ScriptCachedFrameData.cpp:
273         * bindings/v8/ScriptCachedFrameData.h:
274         * bindings/v8/ScriptController.cpp:
275         * bindings/v8/ScriptController.h:
276         (ScriptController):
277         * bindings/v8/ScriptControllerQt.cpp: Removed.
278         * bindings/v8/V8GCController.cpp:
279         (WebCore::V8GCController::checkMemoryUsage):
280         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
281         (WebCore::histogramEnumeration):
282         (WebCore::V8InspectorFrontendHost::recordActionTakenCallback):
283         (WebCore::V8InspectorFrontendHost::recordPanelShownCallback):
284         (WebCore::V8InspectorFrontendHost::recordSettingChangedCallback):
285         * config.h:
286
287 2012-07-17  Zoltan Horvath  <zoltan@webkit.org>
288
289         [QT] REGRESSION (r122720): svg/filters/feSpecularLight-premultiplied.svg
290         https://bugs.webkit.org/show_bug.cgi?id=91390
291
292         Reviewed by Zoltan Herczeg.
293
294         Fix the regression by using the proper imagetype conversion in ImageBuffer::platformTransformColorSpace.
295
296         The test is unskipped.
297
298         * platform/graphics/qt/ImageBufferQt.cpp:
299         (WebCore::ImageBuffer::platformTransformColorSpace):
300
301 2012-07-17  Vivek Galatage  <vivekgalatage@gmail.com>
302
303         Web Inspector: refactor InspectorController::connectFrontend() to accept InspectorFrontendChannel.
304         https://bugs.webkit.org/show_bug.cgi?id=91196
305
306         Reviewed by Pavel Feldman.
307
308         Refactoring InspectorClients. InspectorClient::openInspectorFrontend
309         now returning the InspectorFrontendChannel. Also refactored
310         InspectorController::connectFrontend() to receive
311         InspectorFrontendChannel.
312
313         No new test as code refactoring done.
314
315         * inspector/InspectorClient.h:
316         (WebCore):
317         (InspectorClient):
318         * inspector/InspectorController.cpp:
319         (WebCore::InspectorController::InspectorController):
320         (WebCore::InspectorController::connectFrontend):
321         (WebCore::InspectorController::show):
322         (WebCore::InspectorController::reconnectFrontend):
323         * inspector/InspectorController.h:
324         (WebCore):
325         (InspectorController):
326         * loader/EmptyClients.h:
327         (WebCore::EmptyInspectorClient::openInspectorFrontend):
328         (WebCore::EmptyInspectorClient::hideHighlight):
329
330 2012-07-17  Sheriff Bot  <webkit.review.bot@gmail.com>
331
332         Unreviewed, rolling out r122834.
333         http://trac.webkit.org/changeset/122834
334         https://bugs.webkit.org/show_bug.cgi?id=91492
335
336         it broke the chromium (Requested by kkristof on #webkit).
337
338         * DerivedSources.pri:
339         * Target.pri:
340         * WebCore.pri:
341         * bindings/v8/ScriptCachedFrameData.cpp:
342         (WebCore):
343         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
344         (WebCore::ScriptCachedFrameData::domWindow):
345         (WebCore::ScriptCachedFrameData::restore):
346         (WebCore::ScriptCachedFrameData::clear):
347         * bindings/v8/ScriptCachedFrameData.h:
348         (WebCore):
349         (ScriptCachedFrameData):
350         (WebCore::ScriptCachedFrameData::~ScriptCachedFrameData):
351         * bindings/v8/ScriptController.cpp:
352         * bindings/v8/ScriptController.h:
353         (ScriptController):
354         * bindings/v8/ScriptControllerQt.cpp: Copied from Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp.
355         (WebCore):
356         (WebCore::ScriptController::qtScriptEngine):
357         * bindings/v8/V8GCController.cpp:
358         (WebCore::V8GCController::checkMemoryUsage):
359         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
360         (WebCore):
361         (WebCore::V8InspectorFrontendHost::recordActionTakenCallback):
362         (WebCore::V8InspectorFrontendHost::recordPanelShownCallback):
363         (WebCore::V8InspectorFrontendHost::recordSettingChangedCallback):
364         * config.h:
365
366 2012-07-17  Gabor Ballabas  <gaborb@inf.u-szeged.hu>
367
368         [Qt][V8] Remove the V8 related codepaths and configuration
369         https://bugs.webkit.org/show_bug.cgi?id=90863
370
371         Reviewed by Simon Hausmann.
372
373         No new tests, because there is no new functionality.
374
375         * DerivedSources.pri:
376         * Target.pri:
377         * WebCore.pri:
378         * bindings/v8/ScriptCachedFrameData.cpp:
379         * bindings/v8/ScriptCachedFrameData.h:
380         * bindings/v8/ScriptController.cpp:
381         * bindings/v8/ScriptController.h:
382         (ScriptController):
383         * bindings/v8/ScriptControllerQt.cpp: Removed.
384         * bindings/v8/V8GCController.cpp:
385         (WebCore::V8GCController::checkMemoryUsage):
386         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
387         (WebCore::histogramEnumeration):
388         (WebCore::V8InspectorFrontendHost::recordActionTakenCallback):
389         (WebCore::V8InspectorFrontendHost::recordPanelShownCallback):
390         (WebCore::V8InspectorFrontendHost::recordSettingChangedCallback):
391         * config.h:
392
393 2012-07-17  Kwang Yul Seo  <skyul@company100.net>
394
395         "in body" insertion mode, "any other end tag" step 2.1 is updated
396         https://bugs.webkit.org/show_bug.cgi?id=91473
397
398         Reviewed by Eric Seidel.
399
400         The HTML5 spec is updated to change the 'end tag' processing to not imply
401         its own end tag, since that makes no sense. Step 2.1 now says
402         "Generate implied end tags, except for elements with the same tag name as the token."
403         Modified to follow the updated spec. Also removed the first FIXME because now
404         ElementRecord can't be deleted by the preceeding call.
405
406         This patch does not actually change the behavior because of the previous
407         check (aborts if generateImpliedEndTags has already popped the node for the token),
408         so no new tests.
409
410         * html/parser/HTMLTreeBuilder.cpp:
411         (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
412
413 2012-07-17  Shinya Kawanaka  <shinyak@chromium.org> 
414
415         [Regression] Infinite loop in document.elementFromPoint
416         https://bugs.webkit.org/show_bug.cgi?id=90820
417
418         Reviewed by Nikolas Zimmermann.
419
420         Node::shadowAncestorNode returns the caller node itself for SVGElement. However,
421         since we have already implemented event retargeting algorithm in Shadow DOM, we don't have to
422         take a special care of SVGElement for Node.shadowAncestorNode() now.
423
424         This patch will removes the special care code and fixes infinite loop in document.elementFromPoint().
425
426         Test: svg/hittest/svg-use-element-from-point.html
427
428         * dom/Node.cpp:
429         (WebCore::Node::shadowAncestorNode):
430
431 2012-07-17  Shinya Kawanaka  <shinyak@chromium.org>
432
433         Shadow DOM for img element
434         https://bugs.webkit.org/show_bug.cgi?id=90532
435
436         Reviewed by Hajime Morita.
437
438         This patch adds Shadow DOM support for img element.
439
440         According to the Shadow DOM spec, img element should behave like having a user agent Shadow DOM.
441         However, if we add Shadow DOM to img by default, it will cause performance regression and memory bloat.
442
443         So, we would like to postpone adding a Shadow DOM to img until when we really need it. In other words,
444         we add our User Agent Shadow DOM to img just before a user adds Author Shadow DOM.
445
446         The User Agent Shadow DOM for img has only one element, which displays an image. If img has
447         a Shadow DOM, img will behave like <span style="display: inline-block"> by default. The display style can
448         be chagned using CSS though.
449
450         This patch also adds ImageLoaderClient. The element we render an image and the element we take an argument
451         from were the same, however not they might be different. We would like to encapsulate the fact into
452         ImageLoaderClient.
453
454         Tests: fast/dom/shadow/shadowdom-for-image-alt-update.html
455                fast/dom/shadow/shadowdom-for-image-alt.html
456                fast/dom/shadow/shadowdom-for-image-content.html
457                fast/dom/shadow/shadowdom-for-image-dynamic.html
458                fast/dom/shadow/shadowdom-for-image-event-click.html
459                fast/dom/shadow/shadowdom-for-image-in-shadowdom.html
460                fast/dom/shadow/shadowdom-for-image-map.html
461                fast/dom/shadow/shadowdom-for-image-style.html
462                fast/dom/shadow/shadowdom-for-image-with-multiple-shadow.html
463                fast/dom/shadow/shadowdom-for-image-with-width-and-height.html
464                fast/dom/shadow/shadowdom-for-image.html
465
466         * CMakeLists.txt:
467         * GNUmakefile.list.am:
468         * Target.pri:
469         * WebCore.gypi:
470         * WebCore.vcproj/WebCore.vcproj:
471         * WebCore.xcodeproj/project.pbxproj:
472         * css/html.css:
473         (img):
474         * html/HTMLImageElement.cpp:
475         (WebCore::ImageElement::setImageIfNecessary):
476         (WebCore):
477         (WebCore::ImageElement::createRendererForImage):
478         (WebCore::HTMLImageElement::willAddAuthorShadowRoot): When we don't have a user agent Shadow DOM yet
479         we add it.
480         (WebCore::HTMLImageElement::createShadowSubtree):
481         (WebCore::HTMLImageElement::imageElement):
482         (WebCore::HTMLImageElement::parseAttribute):
483         (WebCore::HTMLImageElement::createRenderer): If a user agent Shadow DOM is attached, we create
484         Renderer from style, instead of creating RenderImage.
485         (WebCore::HTMLImageElement::attach):
486         (WebCore::HTMLImageElement::innerElement):
487         * html/HTMLImageElement.h:
488         (WebCore):
489         (ImageElement):
490         (HTMLImageElement):
491         (WebCore::HTMLImageElement::sourceElement):
492         (WebCore::HTMLImageElement::refSourceElement):
493         (WebCore::HTMLImageElement::derefSourceElement):
494         (WebCore::HTMLImageElement::imageRenderer):
495         (WebCore::HTMLImageElement::imageLoader):
496         (WebCore::isHTMLImageElement):
497         (WebCore::toHTMLImageElement):
498         * html/HTMLImageLoader.cpp:
499         (WebCore::HTMLImageLoader::HTMLImageLoader):
500         (WebCore::HTMLImageLoader::dispatchLoadEvent):
501         (WebCore::HTMLImageLoader::sourceURI):
502         (WebCore::HTMLImageLoader::notifyFinished):
503         * html/HTMLImageLoader.h:
504         (HTMLImageLoader):
505         * html/HTMLInputElement.h:
506         * html/HTMLObjectElement.h:
507         * html/HTMLPlugInElement.h:
508         * html/HTMLTagNames.in:
509         * html/HTMLVideoElement.h:
510         * html/shadow/ImageInnerElement.cpp: Added.
511         (WebCore):
512         (WebCore::ImageInnerElement::ImageInnerElement):
513         (WebCore::ImageInnerElement::hostImage):
514         (WebCore::ImageInnerElement::imageLoader):
515         (WebCore::ImageInnerElement::attach):
516         (WebCore::ImageInnerElement::createRenderer):
517         * html/shadow/ImageInnerElement.h: Added.
518         (WebCore):
519         (ImageInnerElement):
520         (WebCore::ImageInnerElement::imageRenderer):
521         (WebCore::ImageInnerElement::create):
522         (WebCore::isImageInnerElement):
523         (WebCore::toImageInnerElement):
524         * loader/ImageLoader.cpp:
525         (WebCore::ImageLoader::ImageLoader):
526         (WebCore::ImageLoader::~ImageLoader):
527         (WebCore):
528         (WebCore::ImageLoader::document):
529         (WebCore::ImageLoader::updateFromElement):
530         (WebCore::ImageLoader::notifyFinished):
531         (WebCore::ImageLoader::renderImageResource):
532         (WebCore::ImageLoader::updatedHasPendingLoadEvent):
533         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
534         (WebCore::ImageLoader::dispatchPendingLoadEvent):
535         (WebCore::ImageLoader::dispatchPendingErrorEvent):
536         * loader/ImageLoader.h:
537         (WebCore):
538         (ImageLoader):
539         (WebCore::ImageLoader::client):
540         * loader/ImageLoaderClient.h: Added.
541         (WebCore):
542         (ImageLoaderClient): Provides the necessary interfaces to ImageLoader.
543         (WebCore::ImageLoaderClient::~ImageLoaderClient):
544         (ImageLoaderClientBase):
545         (WebCore::ImageLoaderClientBase::sourceElement):
546         (WebCore::ImageLoaderClientBase::imageElement):
547         (WebCore::ImageLoaderClientBase::refSourceElement):
548         (WebCore::ImageLoaderClientBase::derefSourceElement):
549         * rendering/RenderImage.cpp:
550         (WebCore::RenderImage::paintIntoRect):
551         (WebCore::RenderImage::imageMap):
552         (WebCore::RenderImage::updateAltText):
553         (WebCore::RenderImage::hostImageElement):
554         (WebCore):
555         * rendering/RenderImage.h:
556         (WebCore):
557         (RenderImage):
558         * rendering/RenderObject.cpp:
559         (WebCore::RenderObject::shouldRespectImageOrientation):
560         * svg/SVGImageElement.h:
561         (SVGImageElement):
562         * svg/SVGImageLoader.cpp:
563         (WebCore::SVGImageLoader::SVGImageLoader):
564         (WebCore::SVGImageLoader::dispatchLoadEvent):
565         (WebCore::SVGImageLoader::sourceURI):
566         * svg/SVGImageLoader.h:
567         (SVGImageLoader):
568
569 2012-07-17  Kent Tamura  <tkent@chromium.org>
570
571         Internals: Remove injectPagePopupController()
572         https://bugs.webkit.org/show_bug.cgi?id=91471
573
574         Reviewed by Hajime Morita.
575
576         r122558 introduced injectPagePopupController(), however we'd like to
577         avoid adding such JavaScript binding code. We can avoid it by exposing a
578         PagePopupController for a mock and injecting the following code to the
579         popup document:
580
581         <script>window.pagePopupController = window.internals.pagePopupController</script>
582
583         No new tests. This is a kind of refactoring.
584
585         * testing/InternalSettings.cpp:
586         (WebCore::InternalSettings::pagePopupController):
587         Added. Accessor for PagePopupControler owned by the MockPagePopupDriver.
588         * testing/InternalSettings.h:
589         (InternalSettings): Declare pagePopupController() for Internals::pagePopupController().
590         * testing/Internals.cpp:
591         (WebCore::Internals::pagePopupController):
592         Added. This uses InternalSettings::pagePopupController().
593         * testing/Internals.h:
594         (Internals): Declare pagePopupController() for Internals.idl.
595         * testing/Internals.idl: Declare pagePopupController.
596
597         * testing/MockPagePopupDriver.cpp:
598         Moved m_pagePopupController from MockPagePopup to MockPagePopupDriver.
599         (WebCore::MockPagePopup::MockPagePopup):
600         Added a script element to prepare window.pagePopupController.
601         Removed a callsite of injectPagePopupController().
602         (WebCore::MockPagePopupDriver::openPagePopup):
603         (WebCore::MockPagePopupDriver::closePagePopup):
604         * testing/MockPagePopupDriver.h:
605         (WebCore::MockPagePopupDriver::pagePopupController):
606         Accessor for a PagePopupController object.
607         (MockPagePopupDriver): Add RefPtr<PagePopupController> data member.
608
609         * testing/v8/WebCoreTestSupport.cpp: Remove injectPagePopupController().
610         * testing/v8/WebCoreTestSupport.h: ditto.
611
612 2012-07-17  Ryuan Choi  <ryuan.choi@samsung.com>
613
614         [EFL] Move codes related to theme setting from Widget to RenderTheme
615         https://bugs.webkit.org/show_bug.cgi?id=89842
616
617         Reviewed by Kenneth Rohde Christiansen.
618
619         WebKit/Efl uses custom theme for Scrollbar, RenderTheme and Cursor.
620         However, theme information itself is in WidgetEfl so it is accessed by
621         calling recursive function.
622         Because theme is managed by each page, this patch moves codes related to
623         theme from WidgetEfl to RenderThemeEfl which is contained by page.
624
625         * platform/Widget.h: Removed functions related to theme.
626         * platform/efl/RenderThemeEfl.cpp:
627         (WebCore::RenderThemeEfl::setThemePath): Added to set theme path.
628         (WebCore::RenderThemeEfl::createEdje): Updated method to use RenderThemeEfl's theme.
629         (WebCore::RenderThemeEfl::RenderThemeEfl):
630         * platform/efl/RenderThemeEfl.h:
631         (WebCore::RenderThemeEfl::themePath): Added to get theme path
632         * platform/efl/ScrollbarEfl.cpp: Updated method to use RenderThemeEfl's theme.
633         (ScrollbarEfl::setParent):
634         * platform/efl/WidgetEfl.cpp: Removed codes related theme.
635         (WidgetPrivate):
636
637 2012-07-17  Shinya Kawanaka  <shinyak@chromium.org>
638
639         HTMLMediaElement should not use Element::ensureShadowRoot()
640         https://bugs.webkit.org/show_bug.cgi?id=77936
641
642         Reviewed by Hajime Morita.
643
644         a video element and an audio element add UserAgentShadowRoot dynamically, and they assume that it's the oldest ShadowRoot.
645         However an AuthorShadowRoot could be added by a user before a video element and an audio element add UserAgentShadowRoot.
646         It breaks the assumption that the UserAgentShadowRoot is the oldest.
647
648         If the UserAgentShadowRoot is not the oldest, the AuthorShadowRoot a page author added might be ignored.
649         Since the timing to add UserAgentShadowRoot is not known by a user, the fact that UserAgentShadorRoot is
650         not the oldest will cause inconsistent behavior.
651
652         Adding AuthorShadowRoot to a video element and an audio element is allowed by this patch.
653
654         Test: fast/dom/shadow/shadowdom-for-media.html
655
656         * dom/ShadowRoot.cpp:
657         (WebCore::allowsAuthorShadowRoot):
658         * html/HTMLMediaElement.cpp:
659         (WebCore::HTMLMediaElement::createShadowSubtree):
660         (WebCore):
661         (WebCore::HTMLMediaElement::willAddAuthorShadowRoot):
662         (WebCore::HTMLMediaElement::createMediaControls):
663         * html/HTMLMediaElement.h:
664         (HTMLMediaElement):
665
666 2012-07-16  Daniel Bates  <dbates@webkit.org>
667
668         Attempt to fix the Chromium Mac build after <http://trac.webkit.org/changeset/122802>
669         (https://bugs.webkit.org/show_bug.cgi?id=91451)
670  
671         Remove unused private instance variable AbsoluteQuadsGeneratorContext::m_wasFixed.
672         This instance variable has remained unused since it was added in
673         <http://trac.webkit.org/changeset/116718> (https://bugs.webkit.org/show_bug.cgi?id=85725).
674
675         I'm unclear as to why the Chromium Mac build began to complain about this
676         unused instance variable following <http://trac.webkit.org/changeset/122802>, since this
677         code has been in the tree for a while and we previously instantiated AbsoluteQuadsGeneratorContext
678         with wasFixed (even though it wasn't used). Regardless, we should remove the unused
679         instance variable AbsoluteQuadsGeneratorContext::m_wasFixed.
680
681         * rendering/RenderInline.cpp:
682         (WebCore): Remove AbsoluteQuadsGeneratorContext::m_wasFixed.
683         (WebCore::RenderInline::absoluteQuads):
684
685 2012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
686
687         Add RegisterProtocolHandlerClient to the Modules/protocolhandler
688         https://bugs.webkit.org/show_bug.cgi?id=90940
689
690         Reviewed by Hajime Morita.
691
692         As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
693         to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
694         protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
695
696         In addition, NavigatorRegisterProtocolHandler should be supplementable.
697
698         No new tests. Covered by existing tests.
699
700         * GNUmakefile.list.am:
701         * Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp:
702         (WebCore::NavigatorRegisterProtocolHandler::from):
703         (WebCore::NavigatorRegisterProtocolHandler::create):
704         (WebCore):
705         (WebCore::NavigatorRegisterProtocolHandler::registerProtocolHandler):
706         (WebCore::customHandlersStateString):
707         (WebCore::NavigatorRegisterProtocolHandler::isProtocolHandlerRegistered):
708         (WebCore::NavigatorRegisterProtocolHandler::unregisterProtocolHandler):
709         (WebCore::NavigatorRegisterProtocolHandler::supplementName):
710         (WebCore::provideRegisterProtocolHandlerTo):
711         * Modules/protocolhandler/NavigatorRegisterProtocolHandler.h:
712         (WebCore):
713         (NavigatorRegisterProtocolHandler):
714         (WebCore::NavigatorRegisterProtocolHandler::NavigatorRegisterProtocolHandler):
715         (WebCore::NavigatorRegisterProtocolHandler::client):
716         * Modules/protocolhandler/RegisterProtocolHandlerClient.h: Added.
717         (WebCore):
718         (RegisterProtocolHandlerClient):
719         * WebCore.gypi:
720         * loader/EmptyClients.h:
721         * page/ChromeClient.h:
722         (ChromeClient):
723         * platform/network/soup/CookieJarSoup.cpp:
724         (WebCore::setCookies):
725         (WebCore::getRawCookies):
726
727 2012-07-16  Pete Williamson  <petewil@google.com>
728
729         Changed the behavior of iconURLs to always recalculate the list.
730         https://bugs.webkit.org/show_bug.cgi?id=88665
731
732         Reviewed by Kent Tamura.
733
734         As it turns out, it can contain stale URLs in the case that some script
735         manipulates the DOM, which breaks scripts trying to reset the favicon
736         URL. Also added a method in Internals to allow tests to get the list of
737         icon
738
739         Tests: fast/dom/icon-url-change.html
740                fast/dom/icon-url-list.html
741
742         * WebCore.exp.in: export Document::iconURLs on the mac for the Internals class
743         * dom/Document.cpp:
744         (WebCore::Document::iconURLs): Changed the method to recalculate the iconURL list every time
745         (WebCore::Document::addIconURL): we no longer need to add to the internal list since we recalculate it
746         (WebCore::Document::setUseSecureKeyboardEntryWhenActive): removed extra whitespace
747         * dom/Document.h:
748         (Document): removed the addIconURL method which is no longer used
749         * html/HTMLLinkElement.cpp:
750         (WebCore::HTMLLinkElement::iconType): exposed the icon type with an accessor
751         (WebCore):
752         (WebCore::HTMLLinkElement::iconSizes): exposed the icon sizes with an accessor
753         * html/HTMLLinkElement.h:
754         (HTMLLinkElement): declared the icon type and size accessors
755         * testing/Internals.cpp:
756         (WebCore::Internals::iconURLs): made a method to be used by unit tests for inspecting the icon URL list
757         (WebCore):
758         * testing/Internals.h:
759         (Internals): declared the method for unit testing the icon URL list
760         * testing/Internals.idl: exported the Document::iconURLs function
761
762 2012-07-16  Hajime Morrita  <morrita@chromium.org>
763
764         WebCore needs WEBCORE_TESTING macro to mark methods being exported for testing.
765         https://bugs.webkit.org/show_bug.cgi?id=90764
766
767         Reviewed by Adam Barth.
768
769         Defined WEBCORE_TESTING based on USE(EXPORT_MACROS_FOR_TESTING) and
770         applied it to FrameDestructionObserver.
771
772         * bindings/js/JSDOMGlobalObject.h: Removed conflicting symbols
773         * page/FrameDestructionObserver.h: Added WEBKIT_TESTING
774         (FrameDestructionObserver):
775         * platform/PlatformExportMacros.h:
776
777 2012-07-16  Kiran Muppala  <cmuppala@apple.com>
778
779         REGRESSION: RenderInline::absoluteQuads produces incorrect results for fixed position.
780         https://bugs.webkit.org/show_bug.cgi?id=91451
781
782         Reviewed by Simon Fraser.
783
784         RenderInline::absoluteQuads relies on copies of RenderGeometryMap,
785         created indirectly by passing AbsoluteQuadsGeneratorContext object by
786         value.  These copies are unsafe because the individual transform steps
787         within the geometry map include a owned poitner to their respective
788         transform.
789
790         Modify the callee methods to take context by reference and disable
791         copy constructor for RenderGeometryMap.
792
793         Test: fast/inline/inline-fixed-position-boundingbox.html
794
795         * rendering/RenderGeometryMap.h:
796         (WebCore::RenderGeometryMapStep::RenderGeometryMapStep): Add missing
797         m_offset to copy constructor initialization list.
798         (RenderGeometryMap): Disable copy constructor.
799         * rendering/RenderInline.cpp: Pass context object by reference.
800         (WebCore::RenderInline::generateLineBoxRects): 
801         (WebCore::RenderInline::generateCulledLineBoxRects):
802         (WebCore::RenderInline::absoluteRects):
803         (WebCore::RenderInline::absoluteQuads):
804         (WebCore::RenderInline::linesBoundingBox):
805         (WebCore::RenderInline::culledInlineVisualOverflowBoundingBox):
806         (WebCore::RenderInline::addFocusRingRects):
807         * rendering/RenderInline.h:
808         (RenderInline::generateLineBoxRects): Update method declarations to
809         show pass by reference context parameter.
810         (RenderInline::generateCulledLineBoxRects): Ditto.
811
812 2012-07-16  Hayato Ito  <hayato@chromium.org>
813
814         Some events should be always stopped at shadow boundary.
815         https://bugs.webkit.org/show_bug.cgi?id=90436
816
817         Reviewed by Ryosuke Niwa.
818
819         The spec is here:
820         https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#events-that-are-always-stopped
821
822         Test: fast/dom/shadow/events-stopped-at-shadow-boundary.html
823
824         * dom/EventDispatcher.cpp:
825         (WebCore::EventDispatcher::determineDispatchBehavior):
826
827 2012-07-16  Yoshifumi Inoue  <yosin@chromium.org>
828
829         REGRESSION(r119948): [Form] HTMLInputElement.valueAsNumber for input type "month" should return number of month since January 1970
830         https://bugs.webkit.org/show_bug.cgi?id=91211
831
832         Reviewed by Kent Tamura.
833
834         This patch changes BaseDateAndTimeInputType::valueAsDouble() to call
835         virtual function parseToNumber() which "month" input type overrides
836         instead of non-virtual function parseToDouble() which returns number
837         of milliseconds.
838
839         No new tests. Existing test (fast/form/month/input-valueasnumber-month.html) coverts this, although it is disabled.
840
841         * html/BaseDateAndTimeInputType.cpp:
842         (WebCore::BaseDateAndTimeInputType::valueAsDouble): Changed to call parseToNumber().
843         (WebCore::BaseDateAndTimeInputType::parseToNumber): Changed to what parseToDouble() did.
844         * html/BaseDateAndTimeInputType.h:
845         (BaseDateAndTimeInputType): Remove parseToDouble().
846
847 2012-07-16  Adrienne Walker  <enne@google.com>
848
849         [chromium] Turn off ScrollbarLayerChromium for Windows due to bad alpha values
850         https://bugs.webkit.org/show_bug.cgi?id=91438
851
852         Reviewed by Kenneth Russell.
853
854         r120509 turned on blending for scrollbar thumbs. Unfortunately for
855         Windows XP scrollbar thumbs, their alpha channel is bogus and so the
856         thumb ends up being completely transparent. This should ultimately be
857         fixed in Chromium theme code, but in the meantime this patch turns
858         off the use of ScrollbarLayerChromium.
859
860         This change makes Windows scrollbars fall back to using normal
861         ContentLayerChromiums and being painted all in one layer on the main
862         thread rather than being painted separately and composited on the
863         compositor thread.
864
865         * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
866         (WebCore::createScrollbarLayer):
867
868 2012-07-16  Koji Ishii  <kojiishi@gmail.com>
869
870         Vertical alternate glyph (GSUB) support for OpenTypeVerticalData
871         https://bugs.webkit.org/show_bug.cgi?id=81389
872
873         Reviewed by Tony Chang.
874
875         This patch adds support for reading 'GSUB' OpenType table to get
876         vertical alternate glyphs.
877         http://www.microsoft.com/typography/otspec/gsub.htm
878
879         Like bug 81326, this code isn't on any code path yet.
880
881         Tests: WebKit/chromium/tests/OpenTypeVerticalDataTest.cpp
882
883         * platform/graphics/opentype/OpenTypeTypes.h:
884         (WebCore::OpenType::validateTable): Moved from OpenTypeVerticalData.cpp for unit tests.
885         (OpenType):
886         (TableBase): Ditto.
887         (WebCore::OpenType::TableBase::isValidEnd):
888         (WebCore::OpenType::TableBase::validatePtr):
889         (WebCore::OpenType::TableBase::validateOffset):
890         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
891         (OpenType): Added several OpenType tables used by 'GSUB' table.
892         (CoverageTable):
893         (Coverage1Table):
894         (Coverage2Table):
895         (RangeRecord):
896         (SubstitutionSubTable):
897         (WebCore::OpenType::SubstitutionSubTable::coverage):
898         (SingleSubstitution2SubTable):
899         (LookupTable):
900         (WebCore::OpenType::LookupTable::getSubstitutions):
901         (LookupList):
902         (WebCore::OpenType::LookupList::lookup):
903         (FeatureTable):
904         (WebCore::OpenType::FeatureTable::getGlyphSubstitutions):
905         (FeatureList):
906         (FeatureRecord):
907         (WebCore::OpenType::FeatureList::feature):
908         (LangSysTable):
909         (WebCore::OpenType::LangSysTable::feature):
910         (ScriptTable):
911         (LangSysRecord):
912         (WebCore::OpenType::ScriptTable::defaultLangSys):
913         (ScriptList):
914         (ScriptRecord):
915         (WebCore::OpenType::ScriptList::script):
916         (WebCore::OpenType::ScriptList::defaultScript):
917         (WebCore::OpenType::ScriptList::defaultLangSys):
918         (GSUBTable):
919         (WebCore::OpenType::GSUBTable::scriptList):
920         (WebCore::OpenType::GSUBTable::featureList):
921         (WebCore::OpenType::GSUBTable::lookupList):
922         (WebCore::OpenType::GSUBTable::defaultLangSys):
923         (WebCore::OpenType::GSUBTable::feature):
924         (WebCore::OpenType::GSUBTable::getVerticalGlyphSubstitutions):
925         (WebCore::OpenTypeVerticalData::OpenTypeVerticalData):
926         (WebCore::OpenTypeVerticalData::loadMetrics): Split code to load metrics from ctor.
927         (WebCore::OpenTypeVerticalData::loadVerticalGlyphSubstitutions): Load the vertical alternate Glyph substitution table.
928         (WebCore):
929         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs): Substitute Glyph IDs with vertical alternate Glyph IDs.
930         * platform/graphics/opentype/OpenTypeVerticalData.h:
931         (OpenTypeVerticalData): Added m_verticalGlyphMap.
932
933 2012-07-16  Vincent Scheib  <scheib@chromium.org>
934
935         Fix spelling of EnforceIFrameAllowFullScreenRequirement and ExemptIFrameAllowFullScreenRequirement.
936         https://bugs.webkit.org/show_bug.cgi?id=91437
937
938         Reviewed by Adrienne Walker.
939
940         Document contained spelling errors of 'FulScreen' instead of 'FullScreen'
941         for the FullScreenCheckType enumeration.
942
943         No test changes needed.
944
945         * dom/Document.cpp:
946         (WebCore::Document::requestFullScreenForElement):
947         * dom/Document.h:
948         * dom/Element.cpp:
949         (WebCore::Element::webkitRequestFullscreen):
950         (WebCore::Element::webkitRequestFullScreen):
951         * html/HTMLMediaElement.cpp:
952         (WebCore::HTMLMediaElement::enterFullscreen):
953         * html/shadow/MediaControlElements.cpp:
954         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
955
956 2012-07-16  MORITA Hajime  <morrita@google.com>
957
958         Comment on WebCore::HTMLMediaElement::childShouldCreateRenderer() should explain why
959         https://bugs.webkit.org/show_bug.cgi?id=91174
960
961         Reviewed by Kent Tamura.
962
963         Clarified the explanation.
964
965         * html/HTMLMediaElement.cpp:
966         (WebCore::HTMLMediaElement::childShouldCreateRenderer):
967
968 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
969
970         Unreviewed, rolling out r120033.
971         http://trac.webkit.org/changeset/120033
972         https://bugs.webkit.org/show_bug.cgi?id=91454
973
974         Broke background gradients (Requested by smfr on #webkit).
975
976         * platform/graphics/GeneratorGeneratedImage.cpp:
977         (WebCore::GeneratorGeneratedImage::draw):
978
979 2012-07-16  Joshua Bell  <jsbell@chromium.org>
980
981         IndexedDB: Implement spec updates to IDBTransaction.error
982         https://bugs.webkit.org/show_bug.cgi?id=91409
983
984         Reviewed by Tony Chang.
985
986         The Indexed DB spec was updated to resolve some edge cases around the
987         IDBTransaction.error attribute. It was agreed that accessing error should
988         never throw, error should be null if the transaction is not finished or
989         abort() was explicitly called, an appropriate error should be returned if
990         a commit failed, and a generic AbortError should be used if a request
991         callback throws. These cases are now handled per spec, except that a reason
992         is not provided for the commit failure (it's always UnknownError).
993
994         Test: storage/indexeddb/transaction-error.html
995               storage/indexeddb/transaction-abort.html
996
997         * Modules/indexeddb/IDBRequest.cpp:
998         (WebCore::IDBRequest::dispatchEvent): Refactor some nested if() blocks; don't
999         re-abort the transaction if dispatching in response to an abort.
1000         (WebCore::IDBRequest::uncaughtExceptionInEventHandler): Abort transaction
1001         only if not already aborting, and set it's error to AbortError.
1002         * Modules/indexeddb/IDBTransaction.cpp:
1003         (WebCore::IDBTransaction::onAbort): Set error if abort triggered by back end.
1004         * Modules/indexeddb/IDBTransaction.h:
1005         (WebCore::IDBTransaction::db): Move impl to header file.
1006         (WebCore::IDBTransaction::error): Move impl to header file, simplify.
1007         (IDBTransaction):
1008         * Modules/indexeddb/IDBTransaction.idl: The error attribute no longer throws.
1009
1010 2012-07-16  Joshua Bell  <jsbell@chromium.org>
1011
1012         IndexedDB: Implement spec updates to IDBTransaction.error
1013         https://bugs.webkit.org/show_bug.cgi?id=91409
1014
1015         Reviewed by Tony Chang.
1016
1017         The Indexed DB spec was updated to resolve some edge cases around the
1018         IDBTransaction.error attribute. It was agreed that accessing error should
1019         never throw, error should be null if the transaction is not finished or
1020         abort() was explicitly called, an appropriate error should be returned if
1021         a commit failed, and a generic AbortError should be used if a request
1022         callback throws. These cases are now handled per spec, except that a reason
1023         is not provided for the commit failure (it's always UnknownError).
1024
1025         Test: storage/indexeddb/transaction-error.html
1026               storage/indexeddb/transaction-abort.html
1027
1028         * Modules/indexeddb/IDBRequest.cpp:
1029         (WebCore::IDBRequest::dispatchEvent): Refactor some nested if() blocks; don't
1030         re-abort the transaction if dispatching in response to an abort.
1031         (WebCore::IDBRequest::uncaughtExceptionInEventHandler): Abort transaction
1032         only if not already aborting, and set it's error to AbortError.
1033         * Modules/indexeddb/IDBTransaction.cpp:
1034         (WebCore::IDBTransaction::onAbort): Set error if abort triggered by back end.
1035         * Modules/indexeddb/IDBTransaction.h:
1036         (WebCore::IDBTransaction::db): Move impl to header file.
1037         (WebCore::IDBTransaction::error): Move impl to header file, simplify.
1038         (IDBTransaction):
1039         * Modules/indexeddb/IDBTransaction.idl: The error attribute no longer throws.
1040
1041 2012-07-16  Alec Flett  <alecflett@chromium.org>
1042
1043         IndexedDB: Introduce putWithIndexKeys and calculate them in the renderer
1044         https://bugs.webkit.org/show_bug.cgi?id=90923
1045
1046         Reviewed by Darin Fisher.
1047
1048         Refactor IndexWriter to depend only on IDBIndexMetadata and on
1049         (databaseId, objectStoreId, indexId) so that it can talk directly
1050         to the backing store, and also eventually be moved into the renderer.
1051
1052         This also introduces IDBObjectStoreBackendInterface::putWithIndexKeys
1053         as a replacement for IDBObjectStoreBackendInterface::put, already
1054         stubbed out in the chromium port. It will fully replace put()
1055         after both chromium and webkit sides have reached alignment.
1056
1057         No new tests as this is just a refactor and existing tests cover
1058         correctness.
1059
1060         * Modules/indexeddb/IDBCursor.cpp:
1061         (WebCore::IDBCursor::setValueReady):
1062         * Modules/indexeddb/IDBIndexBackendImpl.cpp:
1063         * Modules/indexeddb/IDBIndexBackendImpl.h:
1064         * Modules/indexeddb/IDBObjectStore.h:
1065         (IDBObjectStore):
1066         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
1067         (WebCore::IDBObjectStoreBackendImpl::put):
1068         (WebCore):
1069         (WebCore::IDBObjectStoreBackendImpl::putWithIndexKeys):
1070         (WebCore::IDBObjectStoreBackendImpl::putInternal):
1071         (WebCore::IDBObjectStoreBackendImpl::populateIndex):
1072         * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
1073         (IDBObjectStoreBackendImpl):
1074         * Modules/indexeddb/IDBObjectStoreBackendInterface.h:
1075         * Modules/indexeddb/IDBRequest.cpp:
1076         (WebCore::IDBRequest::onSuccess):
1077
1078 2012-07-16  Adrienne Walker  <enne@google.com>
1079
1080         [chromium] Unify compositor quad transforms into content space
1081         https://bugs.webkit.org/show_bug.cgi?id=91350
1082
1083         Reviewed by Kenneth Russell.
1084
1085         For the purpose of simplification and as a first step towards removing
1086         any transform that takes a centered rect, remove the ability of layers
1087         to override the quad transform. All quads and quad transforms operate
1088         on content space with the origin in the top left.
1089
1090         The gutter quads used to use the root layer (that doesn't draw
1091         content) as the layer to create the shared quad state from. This is
1092         now created manually as a layer without bounds should never in general
1093         need a shared quad state created for it.
1094
1095         No change in functionality; tested by existing layout and unit tests.
1096
1097         * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
1098         (WebCore::CCIOSurfaceLayerImpl::appendQuads):
1099         * platform/graphics/chromium/cc/CCLayerImpl.cpp:
1100         (WebCore::CCLayerImpl::createSharedQuadState):
1101         * platform/graphics/chromium/cc/CCLayerImpl.h:
1102         (CCLayerImpl):
1103         * platform/graphics/chromium/cc/CCRenderPass.cpp:
1104         (WebCore::CCRenderPass::appendQuadsToFillScreen):
1105         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp:
1106         (WebCore::CCSolidColorLayerImpl::appendQuads):
1107         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
1108         (CCSolidColorLayerImpl):
1109         * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
1110         (WebCore::CCTextureLayerImpl::appendQuads):
1111         * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
1112         * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
1113         (CCTiledLayerImpl):
1114         * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
1115         (WebCore::CCVideoLayerImpl::appendQuads):
1116
1117 2012-07-16  Adrienne Walker  <enne@google.com>
1118
1119         [chromium] Unify compositor quad transforms into content space
1120         https://bugs.webkit.org/show_bug.cgi?id=91350
1121
1122         Reviewed by Kenneth Russell.
1123
1124         For the purpose of simplification and as a first step towards removing
1125         any transform that takes a centered rect, remove the ability of layers
1126         to override the quad transform. All quads and quad transforms operate
1127         on content space with the origin in the top left.
1128
1129         The gutter quads used to use the root layer (that doesn't draw
1130         content) as the layer to create the shared quad state from. This is
1131         now created manually as a layer without bounds should never in general
1132         need a shared quad state created for it.
1133
1134         No change in functionality; tested by existing layout and unit tests.
1135
1136         * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
1137         (WebCore::CCIOSurfaceLayerImpl::appendQuads):
1138         * platform/graphics/chromium/cc/CCLayerImpl.cpp:
1139         (WebCore::CCLayerImpl::createSharedQuadState):
1140         * platform/graphics/chromium/cc/CCLayerImpl.h:
1141         (CCLayerImpl):
1142         * platform/graphics/chromium/cc/CCRenderPass.cpp:
1143         (WebCore::CCRenderPass::appendQuadsToFillScreen):
1144         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.cpp:
1145         (WebCore::CCSolidColorLayerImpl::appendQuads):
1146         * platform/graphics/chromium/cc/CCSolidColorLayerImpl.h:
1147         (CCSolidColorLayerImpl):
1148         * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
1149         (WebCore::CCTextureLayerImpl::appendQuads):
1150         * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
1151         * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
1152         (CCTiledLayerImpl):
1153         * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
1154         (WebCore::CCVideoLayerImpl::appendQuads):
1155
1156 2012-07-16  Joshua Bell  <jsbell@chromium.org>
1157
1158         IndexedDB: Resolve test and IDL FIXMEs for a handful of landed patches
1159         https://bugs.webkit.org/show_bug.cgi?id=91423
1160
1161         Reviewed by Tony Chang.
1162
1163         IDBObjectStore.createIndex() had a hack to handle a null keyPath argument for the
1164         DOMString[] overload and treat it as the string "null". Now that IDL arrays are not
1165         nullable by default following r121817 this hack can be removed and the binding layer
1166         will automagically coerce to DOMString.
1167
1168         Test: storage/indexeddb/keypath-basics.html
1169
1170         * Modules/indexeddb/IDBObjectStore.cpp:
1171         (WebCore::IDBObjectStore::createIndex): Remove special case for null in DOMString[] overload.
1172         * Modules/indexeddb/IDBObjectStore.idl: Remove Nullable suffix from DOMString[] overload
1173         so that the DOMString overload will match null.
1174
1175 2012-07-16  Bear Travis  <betravis@adobe.com>
1176
1177         Resolve CSS Exclusions shapeInside, shapeOutside properties to Length based WrapShape classes
1178         https://bugs.webkit.org/show_bug.cgi?id=89670
1179
1180         Reviewed by Dirk Schulze.
1181
1182         Layout of CSS Exclusions requires length based WrapShape classes,
1183         rather than the existing CSSValue based CSSWrapShape classes. This
1184         patch adds length based WrapShape analogs to the CSSWrapShapes, and
1185         modifies RenderStyle to use a WrapShape instead of a CSSWrapShape.
1186         The translation between WrapShape and CSSWrapShape classes
1187         is handled by helper functions in the new WrapShapeFunctions files.
1188         StyleBuilder resolves CSSWrapShapes to WrapShapes for layout use.
1189         CSSComputedStyleDeclaration translates WrapShapes to CSSWrapShapes
1190         for style use.
1191
1192         There are existing tests that cover the style serialization / resolution
1193         in fast/exclusions/parsing-wrap-shape-inside.html and
1194         fast/exclusions/parsing/wrap-shape-outside.html
1195
1196         Test: fast/exclusions/parsing-wrap-shape-lengths.html
1197
1198         * CMakeLists.txt: Build system changes for adding new files
1199         * GNUmakefile.list.am: Ditto
1200         * Target.pri: Ditto
1201         * WebCore.gypi: Ditto
1202         * WebCore.vcproj/WebCore.vcproj: Ditto
1203         * WebCore.xcodeproj/project.pbxproj: Ditto
1204         * css/CSSComputedStyleDeclaration.cpp: Translate WrapShapes back to CSSWrapShapes
1205         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1206         * css/CSSWrapShapes.h: Mostly changing functions to be const
1207         (WebCore::CSSWrapShapeRectangle::type):
1208         (WebCore::CSSWrapShapeCircle::type):
1209         (WebCore::CSSWrapShapeEllipse::type):
1210         (WebCore::CSSWrapShapePolygon::getXAt):
1211         (WebCore::CSSWrapShapePolygon::getYAt):
1212         (WebCore::CSSWrapShapePolygon::values):
1213         (WebCore::CSSWrapShapePolygon::type):
1214         * css/StyleBuilder.cpp: Resolve CSSWrapShapes to WrapShapes
1215         (WebCore):
1216         (WebCore::ApplyPropertyWrapShape::setValue):
1217         (WebCore::ApplyPropertyWrapShape::applyValue):
1218         (WebCore::ApplyPropertyWrapShape::createHandler):
1219         * css/WrapShapeFunctions.cpp: Added.
1220         (WebCore):
1221         (WebCore::valueForWrapShape):
1222         (WebCore::convertToLength):
1223         (WebCore::wrapShapeForValue):
1224         * css/WrapShapeFunctions.h: Added.
1225         (WebCore):
1226         * rendering/style/RenderStyle.h:
1227         * rendering/style/StyleRareNonInheritedData.h:
1228         (StyleRareNonInheritedData):
1229         * rendering/style/WrapShapes.h: Added.
1230         (WebCore):
1231         (WrapShape):
1232         (WebCore::WrapShape::~WrapShape):
1233         (WebCore::WrapShape::WrapShape):
1234         (WrapShapeRectangle):
1235         (WebCore::WrapShapeRectangle::create):
1236         (WebCore::WrapShapeRectangle::left):
1237         (WebCore::WrapShapeRectangle::top):
1238         (WebCore::WrapShapeRectangle::width):
1239         (WebCore::WrapShapeRectangle::height):
1240         (WebCore::WrapShapeRectangle::cornerRadiusX):
1241         (WebCore::WrapShapeRectangle::cornerRadiusY):
1242         (WebCore::WrapShapeRectangle::setLeft):
1243         (WebCore::WrapShapeRectangle::setTop):
1244         (WebCore::WrapShapeRectangle::setWidth):
1245         (WebCore::WrapShapeRectangle::setHeight):
1246         (WebCore::WrapShapeRectangle::setCornerRadiusX):
1247         (WebCore::WrapShapeRectangle::setCornerRadiusY):
1248         (WebCore::WrapShapeRectangle::type):
1249         (WebCore::WrapShapeRectangle::WrapShapeRectangle):
1250         (WrapShapeCircle):
1251         (WebCore::WrapShapeCircle::create):
1252         (WebCore::WrapShapeCircle::left):
1253         (WebCore::WrapShapeCircle::top):
1254         (WebCore::WrapShapeCircle::radius):
1255         (WebCore::WrapShapeCircle::setLeft):
1256         (WebCore::WrapShapeCircle::setTop):
1257         (WebCore::WrapShapeCircle::setRadius):
1258         (WebCore::WrapShapeCircle::type):
1259         (WebCore::WrapShapeCircle::WrapShapeCircle):
1260         (WrapShapeEllipse):
1261         (WebCore::WrapShapeEllipse::create):
1262         (WebCore::WrapShapeEllipse::top):
1263         (WebCore::WrapShapeEllipse::left):
1264         (WebCore::WrapShapeEllipse::radiusX):
1265         (WebCore::WrapShapeEllipse::radiusY):
1266         (WebCore::WrapShapeEllipse::setTop):
1267         (WebCore::WrapShapeEllipse::setLeft):
1268         (WebCore::WrapShapeEllipse::setRadiusX):
1269         (WebCore::WrapShapeEllipse::setRadiusY):
1270         (WebCore::WrapShapeEllipse::type):
1271         (WebCore::WrapShapeEllipse::WrapShapeEllipse):
1272         (WrapShapePolygon):
1273         (WebCore::WrapShapePolygon::create):
1274         (WebCore::WrapShapePolygon::windRule):
1275         (WebCore::WrapShapePolygon::values):
1276         (WebCore::WrapShapePolygon::getXAt):
1277         (WebCore::WrapShapePolygon::getYAt):
1278         (WebCore::WrapShapePolygon::setWindRule):
1279         (WebCore::WrapShapePolygon::appendPoint):
1280         (WebCore::WrapShapePolygon::type):
1281         (WebCore::WrapShapePolygon::WrapShapePolygon):
1282
1283 2012-07-16  Simon Fraser  <simon.fraser@apple.com>
1284
1285         Fix compositing layers in columns when in paginated mode
1286         https://bugs.webkit.org/show_bug.cgi?id=91425
1287
1288         Reviewed by Dave Hyatt.
1289
1290         Enhance a hack that was added to allow composited layers to
1291         display in columns to work for paginated mode, where the
1292         RenderView is renderer with columns.
1293
1294         Test: compositing/columns/composited-in-paginated.html
1295
1296         * rendering/RenderLayer.cpp:
1297         (WebCore::RenderLayer::updateLayerPosition):
1298
1299 2012-07-16  Emil A Eklund  <eae@chromium.org>
1300
1301         Inconsistent rounding in table layout causes background color to bleed through
1302         https://bugs.webkit.org/show_bug.cgi?id=91410
1303
1304         Reviewed by Eric Seidel.
1305
1306         At certain zoom levels a rounding error in the table layout code cases
1307         the table background color to bleed through between cells. Tables layout
1308         happens on pixel bounds however the paint offset wasn't correctly rounded.
1309
1310         Test: fast/sub-pixel/table-rows-no-gaps.html
1311
1312         * rendering/RenderTable.cpp:
1313         (WebCore::RenderTable::paintObject):
1314         Round paintOffset before passing it to the paint method of the children.
1315
1316 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
1317
1318         Unreviewed, rolling out r122739.
1319         http://trac.webkit.org/changeset/122739
1320         https://bugs.webkit.org/show_bug.cgi?id=91424
1321
1322         Broke mac builds (Requested by rniwa on #webkit).
1323
1324         * inspector/CodeGeneratorInspector.py:
1325         (flatten_list):
1326
1327 2012-07-16  Dana Jansens  <danakj@chromium.org>
1328
1329         [chromium] Remove non-ephemeral data from RenderSurface as it duplicates data from the owning layer
1330         https://bugs.webkit.org/show_bug.cgi?id=91418
1331
1332         Reviewed by Adrienne Walker.
1333
1334         This removes the filters and masks from render surfaces, and makes them
1335         used directly from the owning layer. Also removes skipsDraw from
1336         surfaces as it was just not used at all.
1337
1338         Covered by existing tests.
1339
1340         * platform/graphics/chromium/LayerChromium.h:
1341         (WebCore::LayerChromium::filters):
1342         (WebCore::LayerChromium::backgroundFilters):
1343         (WebCore::LayerChromium::hasMask):
1344         (WebCore::LayerChromium::hasReplica):
1345         (WebCore::LayerChromium::replicaHasMask):
1346         (LayerChromium):
1347         * platform/graphics/chromium/RenderSurfaceChromium.cpp:
1348         (WebCore::RenderSurfaceChromium::RenderSurfaceChromium):
1349         * platform/graphics/chromium/RenderSurfaceChromium.h:
1350         (RenderSurfaceChromium):
1351         * platform/graphics/chromium/cc/CCLayerImpl.h:
1352         (WebCore::CCLayerImpl::hasMask):
1353         (WebCore::CCLayerImpl::hasReplica):
1354         (WebCore::CCLayerImpl::replicaHasMask):
1355         (CCLayerImpl):
1356         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
1357         (WebCore::CCLayerTreeHost::calculateMemoryForRenderSurfaces):
1358         * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
1359         (WebCore::calculateDrawTransformsInternal):
1360         * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
1361         (WebCore::::finishedRenderTarget):
1362         (WebCore::reduceOcclusionBelowSurface):
1363         (WebCore::::leaveToRenderTarget):
1364         * platform/graphics/chromium/cc/CCRenderPass.cpp:
1365         (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):
1366         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
1367         (WebCore::CCRenderSurface::drawableContentRect):
1368         (WebCore::CCRenderSurface::appendQuads):
1369         * platform/graphics/chromium/cc/CCRenderSurface.h:
1370         (CCRenderSurface):
1371
1372 2012-07-16  Beth Dakin  <bdakin@apple.com>
1373
1374         https://bugs.webkit.org/show_bug.cgi?id=91299
1375         Paginated views should restrict available height to column height
1376         -and corresponding-
1377         <rdar://problem/11152108>
1378
1379         Reviewed by Dan Bernstein.
1380
1381         Now that RenderViews can have columns, availableLogicalHeight needs to consider 
1382         that column height, much like how availableLogicalWidth already considers column 
1383         width.
1384
1385         availableLogicalHeight is newly virtual, like the already-virtual 
1386         availableLogicalWidth.
1387         * rendering/RenderBox.h:
1388         (RenderBox):
1389
1390         Check with the columnHeight.
1391         * rendering/RenderView.cpp:
1392         (WebCore):
1393         (WebCore::RenderView::availableLogicalHeight):
1394         * rendering/RenderView.h:
1395
1396         setPagination now takes pageLength as an optional parameter. 
1397         * testing/InternalSettings.cpp:
1398         (WebCore::InternalSettings::setPagination):
1399         * testing/InternalSettings.h:
1400         (WebCore::InternalSettings::setPagination):
1401         (InternalSettings):
1402         * testing/InternalSettings.idl:
1403         * testing/Internals.cpp:
1404         (WebCore::Internals::setPagination):
1405         * testing/Internals.h:
1406         (WebCore::Internals::setPagination):
1407         (Internals):
1408         * testing/Internals.idl:
1409
1410 2012-07-16  Dana Jansens  <danakj@chromium.org>
1411
1412         [chromium] Remove targetRenderSurface concept, give layers a renderTarget which is the layer whose coordinate space they draw into
1413         https://bugs.webkit.org/show_bug.cgi?id=91288
1414
1415         Reviewed by Adrienne Walker.
1416
1417         Always use pointers to layers when discussing render targets instead of
1418         pointing directly to a RenderSurface.
1419
1420         Covered by existing tests.
1421
1422         * platform/graphics/chromium/LayerChromium.cpp:
1423         (WebCore::LayerChromium::LayerChromium):
1424         (WebCore::LayerChromium::createRenderSurface):
1425         * platform/graphics/chromium/LayerChromium.h:
1426         (WebCore::LayerChromium::renderTarget):
1427         (WebCore::LayerChromium::setRenderTarget):
1428         (LayerChromium):
1429         * platform/graphics/chromium/RenderSurfaceChromium.cpp:
1430         * platform/graphics/chromium/RenderSurfaceChromium.h:
1431         * platform/graphics/chromium/ScrollbarLayerChromium.cpp:
1432         (WebCore::ScrollbarLayerChromium::setTexturePriorities):
1433         * platform/graphics/chromium/TiledLayerChromium.cpp:
1434         (WebCore::TiledLayerChromium::setTexturePrioritiesInRect):
1435         * platform/graphics/chromium/cc/CCLayerImpl.cpp:
1436         (WebCore::CCLayerImpl::CCLayerImpl):
1437         (WebCore::CCLayerImpl::createRenderSurface):
1438         (WebCore::CCLayerImpl::dumpLayerProperties):
1439         * platform/graphics/chromium/cc/CCLayerImpl.h:
1440         (WebCore::CCLayerImpl::renderTarget):
1441         (WebCore::CCLayerImpl::setRenderTarget):
1442         (CCLayerImpl):
1443         * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
1444         (WebCore::calculateLayerScissorRect):
1445         (WebCore::calculateSurfaceScissorRect):
1446         (WebCore::calculateVisibleContentRect):
1447         (WebCore::computeScrollCompensationForThisLayer):
1448         (WebCore::calculateDrawTransformsInternal):
1449         (WebCore::pointIsClippedBySurfaceOrClipRect):
1450         * platform/graphics/chromium/cc/CCOcclusionTracker.cpp:
1451         (WebCore::::enterLayer):
1452         (WebCore::::leaveLayer):
1453         (WebCore::::enterRenderTarget):
1454         (WebCore::::finishedRenderTarget):
1455         (WebCore):
1456         (WebCore::reduceOcclusionBelowSurface):
1457         (WebCore::::leaveToRenderTarget):
1458         (WebCore::::markOccludedBehindLayer):
1459         (WebCore::::occluded):
1460         (WebCore::::unoccludedContentRect):
1461         (WebCore::::unoccludedContributingSurfaceContentRect):
1462         (WebCore::::layerScissorRectInTargetSurface):
1463         * platform/graphics/chromium/cc/CCOcclusionTracker.h:
1464         (CCOcclusionTrackerBase):
1465         (WebCore::CCOcclusionTrackerBase::StackObject::StackObject):
1466         (StackObject):
1467         * platform/graphics/chromium/cc/CCQuadCuller.cpp:
1468         (WebCore::CCQuadCuller::appendSurface):
1469         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
1470         * platform/graphics/chromium/cc/CCRenderSurface.h:
1471         (CCRenderSurface):
1472
1473 2012-07-16  Florin Malita  <fmalita@chromium.org>
1474
1475         SVGAnimationElement::currentValuesForValuesAnimation crash
1476         https://bugs.webkit.org/show_bug.cgi?id=91326
1477
1478         Reviewed by Simon Fraser.
1479
1480         SVGSMILElement::progress() assumes that seekToIntervalCorrespondingToTime() always
1481         lands inside a defined interval, but one can force arbitrary time offsets using
1482         setCurrentTime(). This patch adds logic for handling non-interval time offsets
1483         gracefully.
1484
1485         Test: svg/animations/smil-setcurrenttime-crash.svg
1486
1487         * svg/animation/SVGSMILElement.cpp:
1488         (WebCore::SVGSMILElement::progress):
1489
1490 2012-07-16  Joshua Netterfield  <jnetterfield@rim.com>
1491
1492         [BlackBerry] Upstream WebGL Code
1493         https://bugs.webkit.org/show_bug.cgi?id=91143
1494
1495         Reviewed by Rob Buis.
1496
1497         This patch includes BlackBerry-specific fixes for anti-aliasing, logging, and shader compilation.
1498
1499         No new tests, because there is no new functionality.
1500
1501         * platform/graphics/GraphicsContext3D.h: Add a value for TI Imagination chipsets on BlackBerry platforms
1502         * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp: Multiple downstream changes
1503         (WebCore::GraphicsContext3D::GraphicsContext3D):
1504         (WebCore::GraphicsContext3D::reshapeFBOs):
1505         (WebCore):
1506         (WebCore::GraphicsContext3D::logFrameBufferStatus):
1507         (WebCore::GraphicsContext3D::readPixelsIMG): BlackBerry-specific fix for Imagination hardware.
1508         (WebCore::GraphicsContext3D::paintsIntoCanvasBuffer):
1509         (WebCore::GraphicsContext3D::platformTexture):
1510         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
1511         (WebCore::GraphicsContext3D::paintToCanvas):
1512         * platform/graphics/opengl/Extensions3DOpenGL.h: Remove unnecessary whitespace.
1513         (Extensions3DOpenGL):
1514         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1515         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE): Hack to fix ANGLE-generated code on BlackBerry platforms.
1516         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
1517         (Extensions3DOpenGLCommon):
1518         * platform/graphics/opengl/Extensions3DOpenGLES.cpp: I am not in a position to change system headers from correct to incorrect.
1519         (WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
1520         (WebCore::Extensions3DOpenGLES::supportsExtension):
1521         * platform/graphics/opengl/Extensions3DOpenGLES.h: I am not in a position to change system headers from correct to incorrect.
1522         (Extensions3DOpenGLES):
1523         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: Add a BlackBerry-specific anti-aliasing fix.
1524         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
1525         (WebCore::GraphicsContext3D::prepareTexture):
1526         (WebCore::GraphicsContext3D::bindFramebuffer):
1527         (WebCore::GraphicsContext3D::compileShader):
1528         (WebCore::GraphicsContext3D::copyTexImage2D):
1529         (WebCore::GraphicsContext3D::copyTexSubImage2D):
1530         (WebCore):
1531         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
1532         (WebCore):
1533
1534 2012-07-16  Tony Chang  <tony@chromium.org>
1535
1536         Position grid items by row/column index
1537         https://bugs.webkit.org/show_bug.cgi?id=91293
1538
1539         Reviewed by Ojan Vafai.
1540
1541         Do some initial grid positioning. Only handle the simple case where tracks are
1542         fixed values and don't properly size the grid items. This gives us something to
1543         work with and starts implementing the "Grid Track Sizing Algorithm":
1544         http://dev.w3.org/csswg/css3-grid-layout/#grid-track-sizing-algorithm0
1545
1546         Test: fast/css-grid-layout/place-cell-by-index.html
1547
1548         * rendering/RenderGrid.cpp:
1549         (RenderGrid::GridTrack): Data structure for holding the track size. UsedBreadth matches the terminology
1550         used in the spec.
1551         (WebCore::RenderGrid::layoutBlock): Pull in some boiler plate code and put the
1552         grid specific code in layoutGridItems.
1553         (WebCore::RenderGrid::computedUsedBreadthOfGridTracks): Implement part of the grid track sizing algorithm.
1554         (WebCore::RenderGrid::layoutGridItems): Compute the size of grid tracks, layout and position children.
1555         (WebCore::RenderGrid::findChildLogicalPosition): Map track sizes to the actual position of the child.
1556         * rendering/RenderGrid.h:
1557         * rendering/style/RenderStyle.h: Just return a copy of Length rather than a reference to Length. This seems
1558         more consistent with other getters that return a Length.
1559
1560 2012-07-16  Sami Kyostila  <skyostil@chromium.org>
1561
1562         [chromium] Only apply page scale delta to root scroll layer
1563         https://bugs.webkit.org/show_bug.cgi?id=91374
1564
1565         Reviewed by Adrienne Walker.
1566
1567         When the user pinch-zooms the web page though the Chromium compositor, the
1568         per-layer page scale delta is used to keep track of the difference between the
1569         page scale on the compositor thread versus the main thread. On the next
1570         commit to the main thread these values are reset to 1.
1571
1572         When calculating layer positions, the compositor applies a layer's page scale
1573         delta both to the layer itself as well as all of its children. Since we are
1574         currently updating the page scale delta on all scrollable layers, this results
1575         in scrollable child layers getting scaled multiple times.
1576
1577         This patch changes the compositor to only apply the page scale delta on the
1578         root scroll layer.
1579
1580         New unit test: CCLayerTreeHostImplTest.pageScaleDeltaAppliedToRootScrollLayerOnly
1581
1582         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
1583         (WebCore::CCLayerTreeHostImpl::setPageScaleFactorAndLimits):
1584         (WebCore::CCLayerTreeHostImpl::setPageScaleDelta):
1585
1586 2012-07-16  Kihong Kwon  <kihong.kwon@samsung.com>
1587
1588         Remove setController from BatteryClient
1589         https://bugs.webkit.org/show_bug.cgi?id=90944
1590
1591         Reviewed by Adam Barth.
1592
1593         BatteryClient doesn't need to keep m_controller,
1594         because BatteryController can be accessed using BatteryController::from().
1595         Remove BatteryClient::setController function.
1596
1597         No new tests. Covered by existing tests.
1598
1599         * Modules/battery/BatteryClient.h:
1600         * Modules/battery/BatteryController.cpp:
1601         (WebCore::BatteryController::BatteryController):
1602
1603 2012-07-16  Mike West  <mkwst@chromium.org>
1604
1605         Invalid `script-nonce` directives should block script execution.
1606         https://bugs.webkit.org/show_bug.cgi?id=91353
1607
1608         Reviewed by Adam Barth.
1609
1610         If the `script-nonce` Content Security Policy directive contains an
1611         invalid value, we should fail loudly, throwing a warning to the console
1612         and denying execution of script on the page. The is in line with the
1613         current state of the experimental CSP 1.1 Editors Draft[1].
1614
1615         [1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-nonce--experimental
1616
1617         Test: http/tests/security/contentSecurityPolicy/1.1/scriptnonce-invalidnonce.html
1618
1619         * page/ContentSecurityPolicy.cpp:
1620         (WebCore::CSPDirectiveList::checkNonceAndReportViolation):
1621             Check against null rather than empty for early exit, otherwise
1622             only compare nonces if the stored nonce isn't empty.
1623         (WebCore::CSPDirectiveList::parseScriptNonce):
1624             Assign the empty string if nonce is invalid.
1625
1626 2012-07-16  Min Qin  <qinmin@chromium.org>
1627
1628         [Android] remove RenderThemeChromiumAndroid::paintMediaFullscreenButton()
1629         https://bugs.webkit.org/show_bug.cgi?id=91291
1630
1631         Reviewed by Adam Barth.
1632
1633         The recent media control refactoring added paintMediaFullscreenButton() in RenderThemeChromiumSkia.
1634         Since RenderThemeChromiumAndroid inherits from that class, we don't need to redefine this function.
1635         No test needed as this change just removes an unnecessary override.
1636
1637         * rendering/RenderThemeChromiumAndroid.cpp:
1638         * rendering/RenderThemeChromiumAndroid.h:
1639
1640 2012-07-16  Peter Rybin  <peter.rybin@gmail.com>
1641
1642         Web Inspector: CodeGeneratorInspector.py: fix output write logic to support incremental build
1643         https://bugs.webkit.org/show_bug.cgi?id=90642
1644
1645         Reviewed by Yury Semikhatsky.
1646
1647         A small intermediate writer is added. It handles comparing old and new source before actual writing.
1648
1649         * inspector/CodeGeneratorInspector.py:
1650         (flatten_list):
1651         (SmartOutput):
1652         (SmartOutput.__init__):
1653         (SmartOutput.write):
1654         (SmartOutput.close):
1655
1656 2012-07-16  Dana Jansens  <danakj@chromium.org>
1657
1658         [chromium] Incorrect assertion: Replicas will cause a RenderPass to be removed twice
1659         https://bugs.webkit.org/show_bug.cgi?id=91328
1660
1661         Reviewed by Adrienne Walker.
1662
1663         We asserted that we would never attempt to remove a render pass that had
1664         already been removed. This was incorrect as a surface with a replica has
1665         two quads and both may cause us to attempt its removal. We must handle
1666         this case gracefully.
1667
1668         Test: CCLayerTreeHostTestSurfaceNotAllocatedForLayersOutsideMemoryLimit
1669
1670         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
1671         (WebCore::CCLayerTreeHostImpl::CullRenderPassesWithNoQuads::shouldRemoveRenderPass):
1672
1673 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
1674
1675         Web Inspector: native memory: fix instrumentation for string members
1676         https://bugs.webkit.org/show_bug.cgi?id=91384
1677
1678         Reviewed by Pavel Feldman.
1679
1680         It was possible to report a string member via addMember instead of addString.
1681         This patch is fixing the problem and adding a link time guard.
1682
1683         Covered by existing inspector performance tests infrastructure.
1684
1685         * dom/ElementAttributeData.h:
1686         (WebCore::ElementAttributeData::reportMemoryUsage):
1687         * dom/MemoryInstrumentation.h:
1688         (WebCore):
1689         (WebCore::MemoryClassInfo::addString):
1690         * dom/QualifiedName.h:
1691         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
1692
1693 2012-07-16  Zoltan Horvath  <zoltan@webkit.org>
1694
1695         Unreviewed. Remove unnecessary executable bits after r122720.
1696
1697         * platform/graphics/ImageSource.h:
1698         * platform/graphics/qt/ImageBufferQt.cpp:
1699         * platform/graphics/qt/ImageDecoderQt.cpp:
1700         * platform/graphics/qt/ImageQt.cpp:
1701         * platform/graphics/qt/StillImageQt.h:
1702         * platform/graphics/qt/TransparencyLayer.h:
1703
1704 2012-07-16  Zoltan Horvath  <zoltan@webkit.org>
1705
1706         [Qt] Change NativeImagePtr from QPixmap* to QImage*
1707         https://bugs.webkit.org/show_bug.cgi?id=88785
1708
1709         Reviewed by Simon Hausmann.
1710
1711         Since we use raster engine there is no difference between QPixmap and QImage, so we are going
1712         to use QImage everywhere where it is possible. This refactoring contains the change of the
1713         NativeImagePtr typedef from QPixmap* to QImage* and covers the related modifications.
1714
1715         Part of the change is similar to Viatcheslav Ostapenko's internal work.
1716
1717         Covered by existing tests.
1718
1719         * bridge/qt/qt_pixmapruntime.cpp:
1720         (JSC::Bindings::QtPixmapAssignToElementMethod::invoke):
1721         (JSC::Bindings::QtPixmapInstance::variantFromObject):
1722         * platform/DragImage.h:
1723         (WebCore):
1724         * platform/graphics/GraphicsContext.h:
1725         (GraphicsContext):
1726         * platform/graphics/Image.h:
1727         (Image):
1728         * platform/graphics/ImageSource.h:
1729         (WebCore):
1730         * platform/graphics/gstreamer/ImageGStreamer.h:
1731         * platform/graphics/gstreamer/ImageGStreamerQt.cpp:
1732         (ImageGStreamer::ImageGStreamer):
1733         * platform/graphics/qt/GraphicsContext3DQt.cpp:
1734         (WebCore::GraphicsContext3D::getImageData):
1735         * platform/graphics/qt/GraphicsContextQt.cpp:
1736         (WebCore::GraphicsContext::pushTransparencyLayerInternal):
1737         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
1738         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
1739         * platform/graphics/qt/ImageBufferDataQt.h:
1740         (ImageBufferData):
1741         * platform/graphics/qt/ImageBufferQt.cpp:
1742         (WebCore::ImageBufferData::ImageBufferData):
1743         (WebCore::ImageBuffer::copyImage):
1744         (WebCore::ImageBuffer::clip):
1745         (WebCore::ImageBuffer::platformTransformColorSpace):
1746         (WebCore::getImageData):
1747         (WebCore::ImageBuffer::putByteArray):
1748         (WebCore::encodeImage):
1749         (WebCore::ImageBuffer::toDataURL):
1750         * platform/graphics/qt/ImageDecoderQt.cpp:
1751         (WebCore::ImageFrame::asNewNativeImage):
1752         * platform/graphics/qt/ImageQt.cpp:
1753         (graphics):
1754         (loadResourceImage):
1755         (WebCore::Image::loadPlatformResource):
1756         (WebCore::Image::setPlatformResource):
1757         (WebCore::Image::drawPattern):
1758         (WebCore::BitmapImage::BitmapImage):
1759         (WebCore::BitmapImage::draw):
1760         (WebCore::BitmapImage::checkForSolidColor):
1761         (WebCore::BitmapImage::create):
1762         * platform/graphics/qt/NativeImageQt.h: Added.
1763         (WebCore):
1764         (NativeImageQt):
1765         (WebCore::NativeImageQt::defaultFormatForAlphaEnabledImages):
1766         (WebCore::NativeImageQt::defaultFormatForOpaqueImages):
1767          * platform/graphics/qt/PatternQt.cpp:
1768         (WebCore::Pattern::createPlatformPattern):
1769         * platform/graphics/qt/StillImageQt.cpp:
1770         (WebCore::StillImage::StillImage):
1771         (WebCore::StillImage::~StillImage):
1772         (WebCore::StillImage::currentFrameHasAlpha):
1773         (WebCore::StillImage::size):
1774         (WebCore::StillImage::nativeImageForCurrentFrame):
1775         (WebCore::StillImage::draw):
1776         * platform/graphics/qt/StillImageQt.h:
1777         (WebCore::StillImage::create):
1778         (WebCore::StillImage::createForRendering):
1779         (StillImage):
1780         * platform/graphics/qt/TransparencyLayer.h:
1781         (WebCore::TransparencyLayer::TransparencyLayer):
1782         (TransparencyLayer):
1783         * platform/graphics/texmap/TextureMapperGL.cpp:
1784         * platform/graphics/surfaces/qt/GraphicsSurfaceQt.cpp:
1785         (WebCore::GraphicsSurface::createReadOnlyImage):
1786          * platform/qt/ClipboardQt.cpp:
1787         (WebCore::ClipboardQt::createDragImage):
1788         (WebCore::ClipboardQt::declareAndWriteDragImage):
1789         * platform/qt/CursorQt.cpp:
1790         (WebCore::createCustomCursor):
1791         * platform/qt/DragImageQt.cpp:
1792         (WebCore::createDragImageFromImage):
1793         * platform/qt/PasteboardQt.cpp:
1794         (WebCore::Pasteboard::writeImage):
1795
1796 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
1797
1798         Web Inspector: moving forward to the better memory instrumentation API
1799         https://bugs.webkit.org/show_bug.cgi?id=91259
1800
1801         Reviewed by Pavel Feldman.
1802
1803         I'm trying to remove unnecessary complexity of the API
1804         reportInstrumentedObject and reportInstrumentedPointer will be replaced with addInstrumentedMember
1805         The same will happen with reportPointer, reportObject pair.
1806         Also info.report* will be replaced with info.add*
1807
1808         * bindings/js/ScriptWrappable.h:
1809         (WebCore::ScriptWrappable::reportMemoryUsage):
1810         * bindings/v8/DOMDataStore.cpp:
1811         (WebCore::DOMDataStore::reportMemoryUsage):
1812         * bindings/v8/IntrusiveDOMWrapperMap.h:
1813         (WebCore::ChunkedTable::reportMemoryUsage):
1814         * bindings/v8/ScriptProfiler.cpp:
1815         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
1816         * bindings/v8/ScriptWrappable.h:
1817         (WebCore::ScriptWrappable::reportMemoryUsage):
1818         * bindings/v8/V8Binding.cpp:
1819         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
1820         (WebCore::StringCache::reportMemoryUsage):
1821         * bindings/v8/V8DOMMap.h:
1822         * css/StylePropertySet.h:
1823         (WebCore::StylePropertySet::reportMemoryUsage):
1824         * dom/CharacterData.cpp:
1825         (WebCore::CharacterData::reportMemoryUsage):
1826         * dom/ContainerNode.h:
1827         (WebCore::ContainerNode::reportMemoryUsage):
1828         * dom/Document.cpp:
1829         (WebCore::Document::reportMemoryUsage):
1830         * dom/Element.h:
1831         (WebCore::Element::reportMemoryUsage):
1832         * dom/ElementAttributeData.h:
1833         (WebCore::ElementAttributeData::reportMemoryUsage):
1834         * dom/MemoryInstrumentation.h:
1835         (WebCore::MemoryInstrumentation::addInstrumentedMember):
1836         (MemoryInstrumentation):
1837         (WebCore::MemoryInstrumentation::addMember):
1838         (WebCore::MemoryInstrumentation::OwningTraits::addInstrumentedMember):
1839         (WebCore::MemoryInstrumentation::OwningTraits::addMember):
1840         (WebCore::MemoryInstrumentation::addInstrumentedMemberImpl):
1841         (WebCore::MemoryInstrumentation::addMemberImpl):
1842         (WebCore::MemoryClassInfo::addInstrumentedMember):
1843         (WebCore::MemoryClassInfo::addMember):
1844         (WebCore::MemoryClassInfo::addHashMap):
1845         (WebCore::MemoryClassInfo::addHashSet):
1846         (WebCore::MemoryClassInfo::addListHashSet):
1847         (WebCore::MemoryClassInfo::addVector):
1848         (WebCore::MemoryClassInfo::addString):
1849         (WebCore::MemoryInstrumentation::addHashMap):
1850         (WebCore::MemoryInstrumentation::addHashSet):
1851         (WebCore::MemoryInstrumentation::addListHashSet):
1852         (WebCore::MemoryInstrumentation::addVector):
1853         * dom/Node.cpp:
1854         (WebCore::Node::reportMemoryUsage):
1855         * dom/QualifiedName.h:
1856         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
1857         (WebCore::QualifiedName::reportMemoryUsage):
1858         * inspector/InspectorMemoryAgent.cpp:
1859         (WebCore):
1860         * platform/TreeShared.h:
1861         (WebCore::TreeShared::reportMemoryUsage):
1862
1863 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
1864
1865         Unreviewed, rolling out r122714.
1866         http://trac.webkit.org/changeset/122714
1867         https://bugs.webkit.org/show_bug.cgi?id=91380
1868
1869         It broke mac compilation (Requested by loislo on #webkit).
1870
1871         * bindings/js/ScriptWrappable.h:
1872         (WebCore::ScriptWrappable::reportMemoryUsage):
1873         * bindings/v8/DOMDataStore.cpp:
1874         (WebCore::DOMDataStore::reportMemoryUsage):
1875         * bindings/v8/IntrusiveDOMWrapperMap.h:
1876         (WebCore::ChunkedTable::reportMemoryUsage):
1877         * bindings/v8/ScriptProfiler.cpp:
1878         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
1879         * bindings/v8/ScriptWrappable.h:
1880         (WebCore::ScriptWrappable::reportMemoryUsage):
1881         * bindings/v8/V8Binding.cpp:
1882         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
1883         (WebCore::StringCache::reportMemoryUsage):
1884         * bindings/v8/V8DOMMap.h:
1885         * css/StylePropertySet.h:
1886         (WebCore::StylePropertySet::reportMemoryUsage):
1887         * dom/CharacterData.cpp:
1888         (WebCore::CharacterData::reportMemoryUsage):
1889         * dom/ContainerNode.h:
1890         (WebCore::ContainerNode::reportMemoryUsage):
1891         * dom/Document.cpp:
1892         (WebCore::Document::reportMemoryUsage):
1893         * dom/Element.h:
1894         (WebCore::Element::reportMemoryUsage):
1895         * dom/ElementAttributeData.h:
1896         (WebCore::ElementAttributeData::reportMemoryUsage):
1897         * dom/MemoryInstrumentation.h:
1898         (WebCore::MemoryInstrumentation::reportObject):
1899         (MemoryInstrumentation):
1900         (WebCore::MemoryInstrumentation::reportPointer):
1901         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
1902         (WebCore::MemoryClassInfo::reportInstrumentedObject):
1903         (WebCore::MemoryClassInfo::reportPointer):
1904         (WebCore::MemoryClassInfo::reportObject):
1905         (WebCore::MemoryClassInfo::reportHashMap):
1906         (WebCore::MemoryClassInfo::reportHashSet):
1907         (WebCore::MemoryClassInfo::reportListHashSet):
1908         (WebCore::MemoryClassInfo::reportVector):
1909         (MemoryClassInfo):
1910         (WebCore::MemoryClassInfo::reportString):
1911         (WebCore):
1912         (WebCore::MemoryInstrumentation::reportInstrumentedPointer):
1913         (WebCore::MemoryInstrumentation::reportInstrumentedObject):
1914         (WebCore::MemoryInstrumentation::reportHashMap):
1915         (WebCore::MemoryInstrumentation::reportHashSet):
1916         (WebCore::MemoryInstrumentation::reportListHashSet):
1917         (WebCore::MemoryInstrumentation::reportVector):
1918         * dom/Node.cpp:
1919         (WebCore::Node::reportMemoryUsage):
1920         * dom/QualifiedName.h:
1921         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
1922         (WebCore::QualifiedName::reportMemoryUsage):
1923         * inspector/InspectorMemoryAgent.cpp:
1924         (WebCore):
1925         * platform/TreeShared.h:
1926         (WebCore::TreeShared::reportMemoryUsage):
1927
1928 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
1929
1930         Web Inspector: moving forward to the better memory instrumentation API
1931         https://bugs.webkit.org/show_bug.cgi?id=91259
1932
1933         Reviewed by Pavel Feldman.
1934
1935         I'm trying to remove unnecessary complexity of the API
1936         reportInstrumentedObject and reportInstrumentedPointer will be replaced with addInstrumentedMember
1937         The same will happen with reportPointer, reportObject pair.
1938         Also info.report* will be replaced with info.add*
1939
1940         * bindings/js/ScriptWrappable.h:
1941         (WebCore::ScriptWrappable::reportMemoryUsage):
1942         * bindings/v8/DOMDataStore.cpp:
1943         (WebCore::DOMDataStore::reportMemoryUsage):
1944         * bindings/v8/IntrusiveDOMWrapperMap.h:
1945         (WebCore::ChunkedTable::reportMemoryUsage):
1946         * bindings/v8/ScriptProfiler.cpp:
1947         (WebCore::ScriptProfiler::collectBindingMemoryInfo):
1948         * bindings/v8/ScriptWrappable.h:
1949         (WebCore::ScriptWrappable::reportMemoryUsage):
1950         * bindings/v8/V8Binding.cpp:
1951         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
1952         (WebCore::StringCache::reportMemoryUsage):
1953         * bindings/v8/V8DOMMap.h:
1954         * css/StylePropertySet.h:
1955         (WebCore::StylePropertySet::reportMemoryUsage):
1956         * dom/CharacterData.cpp:
1957         (WebCore::CharacterData::reportMemoryUsage):
1958         * dom/ContainerNode.h:
1959         (WebCore::ContainerNode::reportMemoryUsage):
1960         * dom/Document.cpp:
1961         (WebCore::Document::reportMemoryUsage):
1962         * dom/Element.h:
1963         (WebCore::Element::reportMemoryUsage):
1964         * dom/ElementAttributeData.h:
1965         (WebCore::ElementAttributeData::reportMemoryUsage):
1966         * dom/MemoryInstrumentation.h:
1967         (WebCore::MemoryInstrumentation::addInstrumentedMember):
1968         (MemoryInstrumentation):
1969         (WebCore::MemoryInstrumentation::addMember):
1970         (WebCore::MemoryInstrumentation::OwningTraits::addInstrumentedMember):
1971         (WebCore::MemoryInstrumentation::OwningTraits::addMember):
1972         (WebCore::MemoryInstrumentation::addInstrumentedMemberImpl):
1973         (WebCore::MemoryInstrumentation::addMemberImpl):
1974         (WebCore::MemoryClassInfo::addInstrumentedMember):
1975         (WebCore::MemoryClassInfo::addMember):
1976         (WebCore::MemoryClassInfo::addHashMap):
1977         (WebCore::MemoryClassInfo::addHashSet):
1978         (WebCore::MemoryClassInfo::addListHashSet):
1979         (WebCore::MemoryClassInfo::addVector):
1980         (WebCore::MemoryClassInfo::addString):
1981         (WebCore::MemoryInstrumentation::addHashMap):
1982         (WebCore::MemoryInstrumentation::addHashSet):
1983         (WebCore::MemoryInstrumentation::addListHashSet):
1984         (WebCore::MemoryInstrumentation::addVector):
1985         * dom/Node.cpp:
1986         (WebCore::Node::reportMemoryUsage):
1987         * dom/QualifiedName.h:
1988         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
1989         (WebCore::QualifiedName::reportMemoryUsage):
1990         * inspector/InspectorMemoryAgent.cpp:
1991         (WebCore):
1992         * platform/TreeShared.h:
1993         (WebCore::TreeShared::reportMemoryUsage):
1994
1995 2012-07-16  Ilya Tikhonovsky  <loislo@chromium.org>
1996
1997         Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo
1998         https://bugs.webkit.org/show_bug.cgi?id=91227
1999
2000         Reviewed by Pavel Feldman.
2001
2002         void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
2003         {
2004             MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
2005             info.visitBaseClass<ScriptWrappable>(this);
2006
2007             info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference
2008             info.addInstrumentedMember(m_next);
2009             info.addHashSet<MemoryInstrumentation::NonClass>(m_aHash);                // NonClass value_type (report only size of internal template structures)
2010             info.addHashSet<MemoryInstrumentation::NotInstrumentedClass>(m_aHashSet); // not instrumented value_type (use sizeof)
2011             info.addHashSet<MemoryInstrumentation::InstrumentedClass>(m_aHashSet);    // instrumented value_type (call visit)
2012         }
2013
2014         The change is covered by existing tests for native memory snapshot.
2015
2016         * bindings/v8/DOMDataStore.cpp:
2017         (WebCore::DOMDataStore::reportMemoryUsage):
2018         * bindings/v8/IntrusiveDOMWrapperMap.h:
2019         (WebCore::ChunkedTable::reportMemoryUsage):
2020         * bindings/v8/ScriptWrappable.h:
2021         (WebCore::ScriptWrappable::reportMemoryUsage):
2022         * bindings/v8/V8Binding.cpp:
2023         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
2024         (WebCore::StringCache::reportMemoryUsage):
2025         * bindings/v8/V8DOMMap.h:
2026         * css/StylePropertySet.h:
2027         (WebCore::StylePropertySet::reportMemoryUsage):
2028         * dom/CharacterData.cpp:
2029         (WebCore::CharacterData::reportMemoryUsage):
2030         * dom/ContainerNode.h:
2031         (WebCore::ContainerNode::reportMemoryUsage):
2032         * dom/Document.cpp:
2033         (WebCore::Document::reportMemoryUsage):
2034         * dom/Element.h:
2035         (WebCore::Element::reportMemoryUsage):
2036         * dom/ElementAttributeData.h:
2037         (WebCore::ElementAttributeData::reportMemoryUsage):
2038         * dom/MemoryInstrumentation.h:
2039         (MemoryInstrumentation):
2040         (WebCore::MemoryObjectInfo::objectType):
2041         (WebCore::MemoryObjectInfo::objectSize):
2042         (WebCore::MemoryObjectInfo::memoryInstrumentation):
2043         (MemoryObjectInfo):
2044         (WebCore::MemoryObjectInfo::reportObjectInfo):
2045         (WebCore):
2046         (MemoryClassInfo):
2047         (WebCore::MemoryClassInfo::MemoryClassInfo):
2048         (WebCore::MemoryClassInfo::visitBaseClass):
2049         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
2050         (WebCore::MemoryClassInfo::reportInstrumentedObject):
2051         (WebCore::MemoryClassInfo::reportPointer):
2052         (WebCore::MemoryClassInfo::reportObject):
2053         (WebCore::MemoryClassInfo::reportHashMap):
2054         (WebCore::MemoryClassInfo::reportHashSet):
2055         (WebCore::MemoryClassInfo::reportListHashSet):
2056         (WebCore::MemoryClassInfo::reportVector):
2057         (WebCore::MemoryClassInfo::reportString):
2058         * dom/Node.cpp:
2059         (WebCore::Node::reportMemoryUsage):
2060         * dom/QualifiedName.h:
2061         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
2062         (WebCore::QualifiedName::reportMemoryUsage):
2063         * platform/TreeShared.h:
2064         (WebCore::TreeShared::reportMemoryUsage):
2065
2066 2012-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2067
2068         Unreviewed. Fix make distcheck.
2069
2070         * GNUmakefile.am: Add missing idl directory.
2071         * GNUmakefile.list.am: Add missing files to compilation.
2072
2073 2012-07-16  Eugene Klyuchnikov  <eustas.big@gmail.com>
2074
2075         Web Inspector: Implement message loop instrumentation for timeline
2076         https://bugs.webkit.org/show_bug.cgi?id=88325
2077
2078         Reviewed by Pavel Feldman.
2079
2080         Message loop instrumentation will show when the render thread is busy.
2081
2082         * inspector/front-end/Settings.js:
2083         (WebInspector.ExperimentsSettings):
2084         Added new experiment.
2085         * inspector/front-end/TimelineGrid.js:
2086         (WebInspector.TimelineGrid.prototype.get dividersLabelBarElement):
2087         Exposed label bar element.
2088         * inspector/front-end/TimelinePanel.js:
2089         (WebInspector.TimelinePanel):
2090         (WebInspector.TimelinePanel.prototype._resetPanel):
2091         Cleanups recorded tasks.
2092         (WebInspector.TimelinePanel.prototype._refresh):
2093         Updates CPU bar.
2094         (WebInspector.TimelinePanel.prototype._refreshRecords):
2095         Ditto.
2096         (WebInspector.TimelinePanel.prototype._refreshCpuBars.compareEndTime):
2097         Ditto.
2098         (WebInspector.TimelinePanel.prototype._refreshCpuBars):
2099         Ditto.
2100         (WebInspector.TimelinePanel.prototype._enableMainThreadMonitoringExperiment):
2101         Adds CPU bar to UI.
2102         (WebInspector.TimelinePanel.prototype._showPopover):
2103         Fix NPE.
2104         (WebInspector.TimelineCalculator.prototype.computeTime):
2105         Utility for position to time conversion.
2106         (WebInspector.TimelineCalculator.prototype.setDisplayWindow):
2107         Remenbers clientWidth.
2108         * inspector/front-end/TimelinePresentationModel.js:
2109         (WebInspector.TimelinePresentationModel.categories):
2110         Define CPU bar colors.
2111         * inspector/front-end/timelinePanel.css:
2112         (.timeline-cpu-bars):
2113         CPU bar styles.
2114         (.timeline-cpu-bars-label):
2115         Ditto.
2116
2117 2012-07-16  Sheriff Bot  <webkit.review.bot@gmail.com>
2118
2119         Unreviewed, rolling out r122681.
2120         http://trac.webkit.org/changeset/122681
2121         https://bugs.webkit.org/show_bug.cgi?id=91363
2122
2123         Patch introduces crashes in debug builds for GTK and EFL ports
2124         (Requested by zdobersek on #webkit).
2125
2126         * platform/ScrollableArea.cpp:
2127         (WebCore::ScrollableArea::scrollPositionChanged):
2128
2129 2012-07-16  Luke Macpherson  <macpherson@chromium.org>
2130
2131         Compilation failure in StyleResolver.cpp (clang)
2132         https://bugs.webkit.org/show_bug.cgi?id=89892
2133
2134         Reviewed by Ryosuke Niwa.
2135
2136         Patch adds assertions that unreachable code is in fact not reached.
2137
2138         Covered by fast/css/variables tests.
2139
2140         * css/CSSParser.cpp:
2141         (WebCore::CSSParser::parseValue):
2142         * css/StyleResolver.cpp:
2143         (WebCore::StyleResolver::collectMatchingRulesForList):
2144
2145 2012-07-15  Mike Lawther  <mikelawther@chromium.org>
2146
2147         Fix calculation of rgba's alpha in CSS custom text
2148         https://bugs.webkit.org/show_bug.cgi?id=91355
2149
2150         Reviewed by Ryosuke Niwa.
2151
2152         Alpha values are stored as an 8 bit value. To convert this to a float in the
2153         range [0,1], we need to divide by 255, not 256. 
2154
2155         Test: fast/css/rgba-custom-text.html
2156
2157         * css/CSSPrimitiveValue.cpp:
2158         (WebCore::CSSPrimitiveValue::customCssText):
2159
2160 2012-07-15  Jason Liu  <jason.liu@torchmobile.com.cn>
2161
2162         [BlackBerry] We shouldn't call didFinishLoading for the old request when a new request has been sent by notifyAuthReceived.
2163         https://bugs.webkit.org/show_bug.cgi?id=90962
2164
2165         Reviewed by Rob Buis.
2166
2167         We start a new NetworkJob with credentials after receiving 401/407 status.
2168         We should not release resources in webcore when the old job is closed because
2169         they are needed by the new one.
2170         We should do as 3XX.
2171
2172         No new tests. No change in behaviour.
2173
2174         * platform/network/blackberry/NetworkJob.cpp:
2175         (WebCore::NetworkJob::NetworkJob):
2176         (WebCore::NetworkJob::notifyAuthReceived):
2177         (WebCore::NetworkJob::shouldReleaseClientResource):
2178         (WebCore::NetworkJob::handleRedirect):
2179         * platform/network/blackberry/NetworkJob.h:
2180         (NetworkJob):
2181
2182 2012-07-15  Ryosuke Niwa  <rniwa@webkit.org>
2183
2184         REGRESSION(r122660): Cannot iterate over HTMLCollection that contains non-child descendent nodes in some conditions
2185         https://bugs.webkit.org/show_bug.cgi?id=91334
2186
2187         Reviewed by Ojan Vafai.
2188
2189         The bug was caused by using lastChild() as the starting node for traversePreviousNode. Since it's the inverse of
2190         Node::traverseNextNode(), which visits nodes in pre order, we must start our search from the last descendent node,
2191         which is visited traverseNextNode immediately before reaching the root node.
2192
2193         Test: fast/dom/htmlcollection-backwards-subtree-iteration.html
2194
2195         * html/HTMLCollection.cpp:
2196         (WebCore::lastDescendent):
2197         (WebCore):
2198         (WebCore::itemBeforeOrAfter):
2199
2200 2012-07-15  Joseph Pecoraro  <pecoraro@apple.com>
2201
2202         Windowless WebView not firing JavaScript load event if there is a media element
2203         https://bugs.webkit.org/show_bug.cgi?id=91331
2204
2205         Reviewed by Eric Carlson.
2206
2207         In prepareForLoad we start deferring the load event. If we fall into this
2208         clause where the page can not start loading media we bail, potentially
2209         indefinitely waiting until we can start loading media. Since we can not
2210         be certain this will ever happen, we should stop deferring the page's
2211         load event.
2212
2213         Test: WebKit1.WindowlessWebViewWithMedia TestWebKitAPI test. The only
2214         way this path was reachable right now is on the mac port.
2215
2216         * html/HTMLMediaElement.cpp:
2217         (WebCore::HTMLMediaElement::loadInternal):
2218
2219 2012-07-15  Dan Bernstein  <mitz@apple.com>
2220
2221         <rdar://problem/11875795> REGRESSION (tiled drawing): Page’s scroll bars flash with each character you type in a textarea (affects Wikipedia and YouTube)
2222         https://bugs.webkit.org/show_bug.cgi?id=91348
2223
2224         Reviewed by Anders Carlsson.
2225
2226         * platform/ScrollableArea.cpp:
2227         (WebCore::ScrollableArea::scrollPositionChanged): Added an early return if the scroll position
2228         did not, in fact, change. This avoids the call to ScrollAnimator::notifyContentAreaScrolled,
2229         which is what causes the scroll bars to flash.
2230
2231 2012-07-14  Eric Carlson  <eric.carlson@apple.com>
2232
2233         Enable AVCF hardware video decoding
2234         https://bugs.webkit.org/show_bug.cgi?id=90015
2235         <rdar://problem/10770317>
2236
2237         Reviewed by Anders Carlsson.
2238
2239         * html/HTMLMediaElement.cpp:
2240         (WebCore):
2241         (WebCore::HTMLMediaElement::mediaPlayerGraphicsDeviceAdapter): New, return the client's graphics 
2242             device adapter.
2243         * html/HTMLMediaElement.h:
2244
2245         * page/ChromeClient.h:
2246         (WebCore::ChromeClient::graphicsDeviceAdapter): New.
2247
2248         * platform/graphics/MediaPlayer.cpp:
2249         (WebCore::MediaPlayer::graphicsDeviceAdapter): New, ask the media element for the graphics
2250             device adapter.
2251         * platform/graphics/MediaPlayer.h:
2252
2253         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h: Soft-link AVCFPlayerSetDirect3DDevice
2254             and AVCFPlayerEnableHardwareAcceleratedVideoDecoderKey.
2255
2256         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: 
2257         (WebCore::MediaPlayerPrivateAVFoundationCF::createAVAssetForURL): Pass the current d3d9
2258             device interface to the AVFWrapper.
2259         (WebCore::AVFWrapper::createAssetForURL): If the d3d9 device implements IDirect3DDevice9Ex,
2260             tell the AVAsset to enable hardware video decoding.
2261         (WebCore::AVFWrapper::createPlayer): Pass the d3d9 device to the player if it implements IDirect3DDevice9Ex.
2262
2263         * platform/graphics/ca/win/CACFLayerTreeHost.h:
2264         (WebCore::CACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
2265
2266         * platform/graphics/ca/win/LegacyCACFLayerTreeHost.h:
2267         (WebCore::LegacyCACFLayerTreeHost::graphicsDeviceAdapter): New, default implementation.
2268         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2269         (WebCore::WKCACFViewLayerTreeHost::graphicsDeviceAdapter): New.
2270         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
2271
2272         * platform/win/SoftLinking.h: Define SOFT_LINK_DLL_IMPORT_OPTIONAL, SOFT_LINK_LOADED_LIBRARY,
2273             and SOFT_LINK_VARIABLE_DLL_IMPORT_OPTIONAL.
2274
2275 2012-07-14  Ryosuke Niwa  <rniwa@webkit.org>
2276
2277         Fix Chromium Mac build failure after r122670.
2278
2279         * platform/graphics/mac/ComplexTextController.cpp:
2280
2281 2012-07-14  Mark Rowe  <mrowe@apple.com>
2282
2283         Fix the Snow Leopard build.
2284
2285         * platform/LocalizedStrings.cpp:
2286         (WebCore::contextMenuItemTagLookUpInDictionary): Fix a typo in the condition so that Snow Leopard
2287         continues to take the expected path.
2288
2289 2012-07-14  Ryosuke Niwa  <rniwa@webkit.org>
2290
2291         Accessing the last item in children should be a constant time operation
2292         https://bugs.webkit.org/show_bug.cgi?id=91320
2293
2294         Reviewed by Ojan Vafai.
2295
2296         Traverse nodes from the last item when the target offset we're looking for is closer to the last item
2297         than to the cached item. e.g. if the cached item was at offset 0 in the collection and length was 100,
2298         we should not be looking for the item at offset 95 from the cached item.
2299
2300         Note that this trick can be only used in HTML collection that supports itemBefore and when the length
2301         cache is available.
2302
2303         Also broke shouldSearchFromFirstItem into smaller logical pieces to clarify the intents.
2304
2305         Test: perf/htmlcollection-last-item.html
2306
2307         * html/HTMLCollection.cpp:
2308         (WebCore):
2309         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
2310         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
2311         (WebCore::HTMLCollection::item):
2312         * html/HTMLCollection.h:
2313         (HTMLCollection):
2314
2315 2012-07-14  Mark Rowe  <mrowe@apple.com>
2316
2317         Fix the Windows build.
2318
2319         * platform/network/cf/DNSCFNet.cpp: Fix the condition to take Windows in to account.
2320
2321 2012-07-14  Mark Rowe  <mrowe@apple.com>
2322
2323         Make it explicit which code paths iOS should use when doing checks based on OS X versions.
2324
2325         Rubber-stamped by David Kilzer.
2326
2327         * WebCore.exp.in:
2328         * accessibility/AccessibilityList.h:
2329         * accessibility/AccessibilityTable.h:
2330         * accessibility/mac/AXObjectCacheMac.mm:
2331         * editing/mac/EditorMac.mm:
2332         * loader/MainResourceLoader.cpp:
2333         * loader/MainResourceLoader.h:
2334         * page/AlternativeTextClient.h:
2335         * page/mac/SettingsMac.mm:
2336         * platform/LocalizedStrings.cpp:
2337         * platform/MemoryPressureHandler.cpp:
2338         * platform/audio/mac/AudioBusMac.mm:
2339         * platform/graphics/Gradient.h:
2340         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2341         * platform/graphics/ca/GraphicsLayerCA.cpp:
2342         * platform/graphics/ca/PlatformCALayer.h:
2343         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2344         * platform/graphics/ca/mac/TileCache.mm:
2345         * platform/graphics/cg/GraphicsContextCG.cpp:
2346         * platform/graphics/cg/ImageBufferCG.cpp:
2347         * platform/graphics/cg/ImageBufferDataCG.h:
2348         * platform/graphics/cg/ImageCG.cpp:
2349         * platform/graphics/cg/ImageSourceCG.cpp:
2350         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2351         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2352         * platform/graphics/mac/ComplexTextController.cpp:
2353         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2354         * platform/graphics/mac/FontCacheMac.mm:
2355         * platform/graphics/mac/FontCustomPlatformData.cpp:
2356         * platform/graphics/mac/FontMac.mm:
2357         * platform/graphics/mac/GraphicsContextMac.mm:
2358         * platform/graphics/mac/SimpleFontDataMac.mm:
2359         * platform/graphics/mac/WebLayer.h:
2360         * platform/graphics/mac/WebLayer.mm:
2361         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2362         * platform/mac/DisplaySleepDisabler.cpp:
2363         * platform/mac/DisplaySleepDisabler.h:
2364         * platform/mac/HTMLConverter.h:
2365         * platform/mac/HTMLConverter.mm:
2366         * platform/mac/MemoryPressureHandlerMac.mm:
2367         * platform/mac/SharedTimerMac.mm:
2368         * platform/mac/SuddenTermination.mm:
2369         * platform/mac/WebFontCache.mm:
2370         * platform/network/Credential.h:
2371         * platform/network/ResourceHandle.h:
2372         * platform/network/cf/DNSCFNet.cpp:
2373         * platform/network/cf/ProxyServerCFNet.cpp:
2374         * platform/network/cf/ResourceRequest.h:
2375         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2376         * platform/network/mac/AuthenticationMac.mm:
2377         * platform/network/mac/CookieStorageMac.mm:
2378         * platform/network/mac/ResourceHandleMac.mm:
2379         * platform/network/mac/ResourceRequestMac.mm:
2380         * platform/network/mac/WebCoreURLResponse.mm:
2381         * platform/text/TextChecking.h:
2382         * platform/text/cf/HyphenationCF.cpp:
2383         * platform/text/mac/HyphenationMac.mm:
2384         * rendering/RenderLayerBacking.cpp:
2385         * rendering/RenderLayerCompositor.cpp:
2386
2387 2012-07-14  Sheriff Bot  <webkit.review.bot@gmail.com>
2388
2389         Unreviewed, rolling out r122614.
2390         http://trac.webkit.org/changeset/122614
2391         https://bugs.webkit.org/show_bug.cgi?id=91317
2392
2393         Broke performance tests (Requested by rniwa on #webkit).
2394
2395         * bindings/v8/V8Binding.cpp:
2396         (WebCore::StringCache::v8ExternalStringSlow):
2397
2398 2012-07-05  Robert Hogan  <robert@webkit.org>
2399
2400         CSS 2.1 failure: vertical-align-boxes-001 fails
2401         https://bugs.webkit.org/show_bug.cgi?id=90626
2402
2403         Reviewed by Eric Seidel.
2404
2405         Tests: css2.1/20110323/vertical-align-boxes-001.htm
2406
2407         A percentage value vertical-align is always a percentage of the actual line-height rather than
2408         the margin box per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages: 
2409         refer to the 'line-height' of the element itself'.  Confusingly, RenderBox::lineheight() is a
2410         shorthand into the dimensions of the margin box for replaced elements in the other vertical-align
2411         cases, i.e. where it's the margin box that's relevant rather than the 'line-height'. So rather than patch RenderBox's
2412         lineHeight() to somehow consider the percentage cases, just give percentage vertical-align the full computedLineHeight()
2413         rather than lineHeight()'s margin box.
2414
2415         * rendering/RootInlineBox.cpp:
2416         (WebCore::RootInlineBox::verticalPositionForBox):
2417
2418 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
2419
2420         Iterating backwards over HTMLCollection is O(n^2)
2421         https://bugs.webkit.org/show_bug.cgi?id=91306
2422
2423         Reviewed by Anders Carlsson.
2424
2425         Fixed the bug by introducing itemBefore that iterates nodes backwards to complement itemAfter.
2426         Unfortunately, some HTML collections such as HTMLFormCollection and HTMLTableRowsCollection have
2427         its own itemAfter function and writing an equivalent itemBefore is somewhat tricky. For now,
2428         added a new boolean flag indicating whether a given HTML collection supports itemBefore or not,
2429         and left those HTML collections that override itemAfter alone.
2430
2431         This also paves our way to share more code between DynamicNodeList and HTMLCollection.
2432
2433         Test: perf/htmlcollection-backwards-iteration.html
2434
2435         * dom/DynamicNodeList.h:
2436         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Takes ItemBeforeSupportType.
2437         (WebCore::DynamicNodeListCacheBase::supportsItemBefore): Added.
2438         (DynamicNodeListCacheBase):
2439         (WebCore::DynamicNodeListCacheBase::setItemCache): Replaced a FIXME by an assertion now that
2440         we can.
2441         * html/HTMLAllCollection.cpp:
2442         (WebCore::HTMLAllCollection::HTMLAllCollection): Supports itemBefore since it doesn't override
2443         itemAfter.
2444         * html/HTMLCollection.cpp:
2445         (WebCore::HTMLCollection::HTMLCollection):
2446         (WebCore::HTMLCollection::create):
2447         (WebCore::isAcceptableElement): Made it a static local function instead of a static member.
2448         (WebCore::nextNode): Templatized.
2449         (WebCore::itemBeforeOrAfter): Extracted from itemAfter and templatized.
2450         (WebCore::HTMLCollection::itemBefore): Added.
2451         (WebCore::HTMLCollection::itemAfter):
2452         (WebCore::HTMLCollection::shouldSearchFromFirstItem): Added. Determines whether we should reset
2453         the item cache to the first item. We obviously do if the cache is invalid. If the target offset
2454         is after the cached offset, then we shouldn't go back regardless of availability of itemBefore.
2455         Otherwise, we go back to the first item iff itemBefore is not available or the distance from
2456         the cached offset to the target offset is greater than the target offset itself.
2457         (WebCore::HTMLCollection::length):
2458         (WebCore::HTMLCollection::item): Use the term "offset" to match the terminology elsewhere.
2459         (WebCore::HTMLCollection::itemBeforeOrAfterCachedItem): Ditto. Also added the logic to iterate
2460         nodes backwards using itemBefore. Once we're in this branch, we should always find a matching
2461         item since the target offset was less than the cached offset, and offsets are non-negative.
2462         If we had ever reached the end of the loop without finding an item, it indicates that the cache
2463         has been invalid and we have some serious bug elsewhere.
2464         * html/HTMLCollection.h:
2465         (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
2466         (HTMLCollection):
2467         * html/HTMLOptionsCollection.cpp:
2468         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Supports itemBefore since it doesn't
2469         override itemAfter.
2470         * html/HTMLFormCollection.cpp:
2471         (WebCore::HTMLFormCollection::HTMLFormCollection): Doesn't support itemBefore as it overrides
2472         itemAfter.
2473         * html/HTMLNameCollection.cpp:
2474         (WebCore::HTMLNameCollection::HTMLNameCollection): Ditto.
2475         * html/HTMLPropertiesCollection.cpp:
2476         (WebCore::HTMLPropertiesCollection::HTMLPropertiesCollection):
2477         * html/HTMLTableRowsCollection.cpp:
2478         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
2479
2480 2012-07-13  Eric Penner  <epenner@google.com>
2481
2482         [chromium] Add 'self-managed' option to CCPrioritizedTexture to enable render-surface and canvas use cases.
2483         https://bugs.webkit.org/show_bug.cgi?id=91177
2484
2485         Reviewed by Adrienne Walker.
2486
2487         This makes the render-surface memory use case generic as 'self-managed' textures,
2488         as this use case is popping up in other places (eg. canvases). It's exactly the
2489         same idea except we can have as many place-holders as we want at arbitrary
2490         priorities.
2491
2492         This already tested by the render surface unit tests which now also use the 
2493         generic placeholder.
2494
2495         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
2496         (WebCore::CCLayerTreeHost::CCLayerTreeHost):
2497         (WebCore::CCLayerTreeHost::initializeLayerRenderer):
2498         (WebCore::CCLayerTreeHost::updateLayers):
2499         (WebCore::CCLayerTreeHost::setPrioritiesForSurfaces):
2500         (WebCore):
2501         (WebCore::CCLayerTreeHost::setPrioritiesForLayers):
2502         (WebCore::CCLayerTreeHost::prioritizeTextures):
2503         (WebCore::CCLayerTreeHost::calculateMemoryForRenderSurfaces):
2504         (WebCore::CCLayerTreeHost::paintLayerContents):
2505         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
2506         (CCLayerTreeHost):
2507         * platform/graphics/chromium/cc/CCPrioritizedTexture.cpp:
2508         (WebCore::CCPrioritizedTexture::CCPrioritizedTexture):
2509         (WebCore::CCPrioritizedTexture::setToSelfManagedMemoryPlaceholder):
2510         * platform/graphics/chromium/cc/CCPrioritizedTexture.h:
2511         (CCPrioritizedTexture):
2512         (WebCore::CCPrioritizedTexture::setIsSelfManaged):
2513         (WebCore::CCPrioritizedTexture::isSelfManaged):
2514         * platform/graphics/chromium/cc/CCPrioritizedTextureManager.cpp:
2515         (WebCore::CCPrioritizedTextureManager::prioritizeTextures):
2516         (WebCore::CCPrioritizedTextureManager::acquireBackingTextureIfNeeded):
2517         (WebCore::CCPrioritizedTextureManager::destroyBacking):
2518         * platform/graphics/chromium/cc/CCPrioritizedTextureManager.h:
2519         (CCPrioritizedTextureManager):
2520         (WebCore::CCPrioritizedTextureManager::memoryForSelfManagedTextures):
2521
2522 2012-07-13  Kent Tamura  <tkent@chromium.org>
2523
2524         Internals: Clean up the mock PagePopupDriver correctly.
2525         https://bugs.webkit.org/show_bug.cgi?id=91250
2526
2527         Unreviewed, a trivial testing code fix.
2528
2529         * testing/InternalSettings.cpp:
2530         (WebCore::InternalSettings::Backup::restoreTo):
2531         (WebCore::InternalSettings::reset):
2532         Resetting PaePopupDriver here instead of Backup::restoreTo.
2533         Also, close the mock popup before resetting PagePopupDriver by clearing m_pagePopupDriver.
2534         * testing/MockPagePopupDriver.cpp:
2535         (WebCore::MockPagePopupDriver::~MockPagePopupDriver):
2536         Close the popup.
2537
2538 2012-07-13  Tony Payne  <tpayne@chromium.org>
2539
2540         Remove Widget from screenColorProfile
2541         https://bugs.webkit.org/show_bug.cgi?id=91300
2542
2543         Reviewed by Adam Barth.
2544
2545         Chromium, the only platform implementing screenColorProfile, does not
2546         need the Widget, so removing for simplicity.
2547
2548         Covered by existing tests.
2549
2550         * platform/PlatformScreen.h:
2551         (WebCore): Updated comment to remove reference to type param that no
2552         longer exists and removed Widget param.
2553         * platform/blackberry/PlatformScreenBlackBerry.cpp:
2554         (WebCore::screenColorProfile): Removed widget param.
2555         * platform/chromium/PlatformScreenChromium.cpp:
2556         (WebCore::screenColorProfile): Removed widget param.
2557         * platform/efl/PlatformScreenEfl.cpp:
2558         (WebCore::screenColorProfile): Removed widget param.
2559         * platform/gtk/PlatformScreenGtk.cpp:
2560         (WebCore::screenColorProfile): Removed widget param.
2561         * platform/image-decoders/ImageDecoder.h:
2562         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): removed param to
2563         match screenColorProfile()'s new spec.
2564         * platform/mac/PlatformScreenMac.mm:
2565         (WebCore::screenColorProfile): Removed widget param.
2566         * platform/qt/PlatformScreenQt.cpp:
2567         (WebCore::screenColorProfile): Removed widget param.
2568         * platform/win/PlatformScreenWin.cpp:
2569         (WebCore::screenColorProfile): Removed widget param.
2570
2571 2012-07-13  Brian Anderson  <brianderson@chromium.org>
2572
2573         [chromium] Add flushes to CCTextureUpdater::update
2574         https://bugs.webkit.org/show_bug.cgi?id=89035
2575
2576         Reviewed by Adrienne Walker.
2577
2578         Automatic flushes are being removed from the command buffer, so
2579         this moves the flushes into the CCTextureUpdater itself.
2580
2581         CCTextureUpdaterTest added to verify texture upload/flushing patterns.
2582
2583         * platform/graphics/chromium/cc/CCGraphicsContext.h:
2584         (WebCore::CCGraphicsContext::flush):
2585         (CCGraphicsContext):
2586         * platform/graphics/chromium/cc/CCTextureUpdater.cpp:
2587         (WebCore):
2588         (WebCore::CCTextureUpdater::update): Manual flushes added here.
2589
2590 2012-07-13  Kiran Muppala  <cmuppala@apple.com>
2591
2592         REGRESSION: RenderInline boundingBox ignores relative position offset
2593         https://bugs.webkit.org/show_bug.cgi?id=91168
2594
2595         Reviewed by Simon Fraser.
2596
2597         RenderGeometryMap, used for caching the transform to the view,
2598         expects the first mapping pushed, to be that of the view itself.
2599         RenderInline was instead pushing it's own offset first.  Besides
2600         the offset of the view itself was not being pushed.
2601
2602         Relaxed the RenderGeometryMap restriction that the first pushed
2603         step should be of the view.  It is sufficient that the view's mapping
2604         is pushed in the first call to pushMappingsToAncestor.  Modified
2605         RenderInline to push the offset of the view also to the geometry map.
2606
2607         Test: fast/inline/inline-relative-offset-boundingbox.html
2608
2609         * rendering/RenderGeometryMap.cpp:
2610         (WebCore::RenderGeometryMap::pushMappingsToAncestor): Add assertion to
2611         check if mapping to view was pushed in first invocation.
2612         (WebCore::RenderGeometryMap::pushView): Correct assertion that checks
2613         if the view's mapping is the first one to be applied.
2614         (WebCore::RenderGeometryMap::stepInserted): Use isRenderView to check if
2615         a mapping step belongs to a view instead of using mapping size.
2616         (WebCore::RenderGeometryMap::stepRemoved): Ditto.
2617         * rendering/RenderInline.cpp:
2618         (WebCore::(anonymous namespace)::AbsoluteQuadsGeneratorContext::AbsoluteQuadsGeneratorContext):
2619         Push mappings all the way up to and including the view.
2620
2621 2012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
2622
2623         Move WebCore/platform/text/Base64 to WTF/wtf/text
2624         https://bugs.webkit.org/show_bug.cgi?id=91162
2625
2626         Reviewed by Adam Barth.
2627
2628         No new tests. Files moving only.
2629
2630         * CMakeLists.txt:
2631         * GNUmakefile.list.am:
2632         * Modules/websockets/WebSocketHandshake.cpp:
2633         (WebCore::generateSecWebSocketKey):
2634         (WebCore::WebSocketHandshake::getExpectedWebSocketAccept):
2635         * Target.pri:
2636         * WebCore.gypi:
2637         * WebCore.order:
2638         * WebCore.vcproj/WebCore.vcproj:
2639         * WebCore.xcodeproj/project.pbxproj:
2640         * fileapi/FileReaderLoader.cpp:
2641         (WebCore::FileReaderLoader::convertToDataURL):
2642         * inspector/DOMPatchSupport.cpp:
2643         (WebCore::DOMPatchSupport::createDigest):
2644         * inspector/InspectorFileSystemAgent.cpp:
2645         (WebCore):
2646         * inspector/InspectorPageAgent.cpp:
2647         (WebCore::InspectorPageAgent::cachedResourceContent):
2648         (WebCore::InspectorPageAgent::sharedBufferContent):
2649         * loader/archive/mhtml/MHTMLArchive.cpp:
2650         (WebCore::MHTMLArchive::generateMHTMLData):
2651         * loader/archive/mhtml/MHTMLParser.cpp:
2652         (WebCore::MHTMLParser::parseNextPart):
2653         * page/DOMWindow.cpp:
2654         (WebCore::DOMWindow::btoa):
2655         (WebCore::DOMWindow::atob):
2656         * page/Page.cpp:
2657         (WebCore::Page::userStyleSheetLocationChanged):
2658         * platform/graphics/cairo/ImageBufferCairo.cpp:
2659         (WebCore::ImageBuffer::toDataURL):
2660         * platform/graphics/cg/ImageBufferCG.cpp:
2661         (WebCore::CGImageToDataURL):
2662         * platform/graphics/gtk/ImageBufferGtk.cpp:
2663         (WebCore::ImageBuffer::toDataURL):
2664         * platform/graphics/skia/FontCustomPlatformData.cpp:
2665         (WebCore::createUniqueFontName):
2666         * platform/graphics/skia/ImageBufferSkia.cpp:
2667         (WebCore::ImageBuffer::toDataURL):
2668         (WebCore::ImageDataToDataURL):
2669         * platform/graphics/win/FontCustomPlatformData.cpp:
2670         (WebCore::createUniqueFontName):
2671         * platform/graphics/wince/FontCustomPlatformData.cpp:
2672         (WebCore::createUniqueFontName):
2673         * platform/graphics/wince/ImageBufferWinCE.cpp:
2674         * platform/graphics/wx/ImageBufferWx.cpp:
2675         * platform/network/DataURL.cpp:
2676         (WebCore::handleDataURL):
2677         * platform/network/cf/ResourceHandleCFNet.cpp:
2678         (WebCore::applyBasicAuthorizationHeader):
2679         * platform/network/mac/ResourceHandleMac.mm:
2680         (WebCore::applyBasicAuthorizationHeader):
2681         * platform/network/soup/ResourceHandleSoup.cpp:
2682         * platform/win/SSLKeyGeneratorWin.cpp:
2683         (WebCore::WebCore::signedPublicKeyAndChallengeString):
2684
2685 2012-07-13  Xianzhu Wang  <wangxianzhu@chromium.org>
2686
2687         [Chromium] Sometimes bottom of text is truncated when page has a fractional scale
2688         https://bugs.webkit.org/show_bug.cgi?id=88684
2689
2690         Reviewed by Tony Chang.
2691
2692         When the page has a fractional scale, the ascent and descent part of the fonts might be fractional.
2693         If the descent part is rounded down, the bottom of the text might be truncated when displayed
2694         when subpixel text positioning is enabled.
2695         To avoid that, borrow one unit from the ascent when possible.
2696
2697         Test: fast/text/descent-clip-in-scaled-page.html
2698
2699         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
2700         (WebCore::FontPlatformData::setupPaint): Moved NoPreference handling into querySystemForRenderStyle so that fontRenderStyle() can have actual styles without NoPreference.
2701         (WebCore::FontPlatformData::querySystemForRenderStyle): Added NoPreference handling (moved from setupPaint)
2702         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
2703         (FontPlatformData):
2704         (WebCore::FontPlatformData::fontRenderStyle): Added to let SimpleFontDataSkia access the font render styles.
2705         * platform/graphics/skia/SimpleFontDataSkia.cpp:
2706         (WebCore::SimpleFontData::platformInit):
2707
2708 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
2709
2710         Remove an assertion after r122637.
2711
2712         * dom/DynamicNodeList.h:
2713         (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange):
2714
2715 2012-07-13  Pierre Rossi  <pierre.rossi@gmail.com>
2716
2717         [Qt] Improve the mobile theme slightly
2718         https://bugs.webkit.org/show_bug.cgi?id=90806
2719
2720         Reviewed by Kenneth Rohde Christiansen.
2721
2722         Improve drawing of the mobile theme's controls' background.
2723
2724         Ensure the focus ring never appears with the mobile theme, since it
2725         looks bad in combination with the highlights.
2726
2727         No new tests. The painting code from the mobile theme is still
2728         not covered specifically (it will when we revive pixel tests).
2729
2730         * platform/qt/RenderThemeQtMobile.cpp:
2731         (WebCore):
2732         (WebCore::addPointToOctants): Added. This is simply a helper to avoid
2733             doing too much duplicate work in drawControlBackground.
2734         (WebCore::drawControlBackground): Rely on the octant logic added above
2735             and take the opportunity to increase the granularity.
2736         (WebCore::borderPen):
2737         (WebCore::StylePainterMobile::findLineEdit):
2738         (WebCore::RenderThemeQtMobile::adjustTextFieldStyle):
2739         * platform/qt/RenderThemeQtMobile.h:
2740         (RenderThemeQtMobile):
2741         (WebCore::RenderThemeQtMobile::supportsFocusRing):
2742
2743 2012-07-13  Julien Chaffraix  <jchaffraix@webkit.org>
2744
2745         Remove an always-failing table-wrapping check in RenderObject::addChild
2746         https://bugs.webkit.org/show_bug.cgi?id=91286
2747
2748         Reviewed by Eric Seidel.
2749
2750         Due to the structure of the code, this test is always failing (newChild->isTableCell()
2751         is true to get in the branch).
2752
2753         The changeset adding the code didn't add testing so I poundered adding the mentioned test,
2754         which is passing. However the test would need to be blindly changed to be included in our
2755         test harness. I would also expect this code to be exercised by other table tests anyway.
2756
2757         * rendering/RenderObject.cpp:
2758         (WebCore::RenderObject::addChild):
2759         Removed never-reached branch. While at it, removed a 'what' comment in the same file.
2760
2761 2012-07-13  Emil A Eklund  <eae@chromium.org>
2762
2763         Use LayoutBoxExtent for image outsets
2764         https://bugs.webkit.org/show_bug.cgi?id=91166
2765
2766         Reviewed by Tony Chang.
2767
2768         Change RenderStyle and calling code to use LayoutBoxExtent for image
2769         outsets and remove text direction and writing mode versions of the
2770         outline getters from RenderStyle as LayoutBoxExtent provides the same
2771         functionality.
2772
2773         No new tests, no change in functionality.
2774
2775         * platform/graphics/FractionalLayoutBoxExtent.h:
2776         * platform/graphics/FractionalLayoutBoxExtent.cpp:
2777         (WebCore::FractionalLayoutBoxExtent::logicalTop):
2778         (WebCore::FractionalLayoutBoxExtent::logicalBottom):
2779         Add logicalTop and logicalBottom methods to go with the existing
2780         logicalLeft and logicalRight ones.
2781
2782         * platform/graphics/FractionalLayoutRect.h:
2783         (WebCore::FractionalLayoutRect::expand):
2784         Add FractionalLayoutBoxExtent version of expand method.
2785
2786         * rendering/InlineFlowBox.cpp:
2787         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
2788         Change implementation to use the new FractionalLayoutBoxExtent version of
2789         borderImageOutsets and the logicalTop/Bottom/Left/Right methods.
2790         
2791         (WebCore::clipRectForNinePieceImageStrip):
2792         Change implementation to use the new FractionalLayoutBoxExtent version of
2793         borderImageOutsets.
2794         
2795         * rendering/RenderBox.cpp:
2796         (WebCore::RenderBox::maskClipRect):
2797         Change implementation to use the new FractionalLayoutBoxExtent version of
2798         borderImageOutsets and the new FractionalLayoutRect::expand method.
2799         
2800         (WebCore::RenderBox::addVisualEffectOverflow):
2801         Change implementation to use the new FractionalLayoutBoxExtent version of
2802         borderImageOutsets.
2803         
2804         * rendering/RenderBoxModelObject.cpp:
2805         (WebCore::RenderBoxModelObject::paintNinePieceImage):
2806         Change implementation to use the new FractionalLayoutBoxExtent version of
2807         borderImageOutsets and the new FractionalLayoutRect::expand method.
2808
2809         * rendering/style/RenderStyle.h:
2810         * rendering/style/RenderStyle.cpp:
2811         (WebCore::RenderStyle::imageOutsets):
2812         Change getImageOutsets to return a FractionalLayoutBoxExtent object and
2813         rename to imageOutsets to match the webkit naming convention for getters.
2814
2815         Remove getBorderImageHorizontalOutsets, getBorderImageVerticalOutsets,
2816         getBorderImageInlineDirectionOutsets, getImageHorizontalOutsets,
2817         getImageVerticalOutsets and getBorderImageBlockDirectionOutsets methods
2818         as the same functionality is provided by FractionalLayoutBoxExtent.
2819
2820 2012-07-13  David Hyatt  <hyatt@apple.com>
2821
2822         https://bugs.webkit.org/show_bug.cgi?id=91278
2823         Improve block margin estimation function to account for not having a layout and for quirks mode
2824         
2825         Reviewed by Simon Fraser.
2826
2827         * rendering/RenderBlock.cpp:
2828         (WebCore::RenderBlock::marginBeforeEstimateForChild):
2829         Revise marginBeforeEstimateForChild so that it computes block margins for the grandchild before
2830         recurring. This includes the quirks margin information as well. This ensures that the margins are
2831         up-to-date when checked, even before the object has had its first layout.
2832         
2833         * rendering/RenderBlock.h:
2834         (WebCore::RenderBlock::setMarginStartForChild):
2835         (WebCore::RenderBlock::setMarginEndForChild):
2836         (WebCore::RenderBlock::setMarginBeforeForChild):
2837         (WebCore::RenderBlock::setMarginAfterForChild):
2838         * rendering/RenderBox.cpp:
2839         (WebCore::RenderBox::computeBlockDirectionMargins):
2840         * rendering/RenderBox.h:
2841         (RenderBox):
2842         Add consts in order to compile.
2843
2844 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
2845
2846         NodeLists should not invalidate on irreleavnt attribute changes
2847         https://bugs.webkit.org/show_bug.cgi?id=91277
2848
2849         Reviewed by Ojan Vafai.
2850
2851         Explicitely check the invalidation type and the changed attribute in NodeListNodeData::invalidateCaches
2852         and ElementRareData::clearHTMLCollectionCaches to only invalidate node lists affected by the change.
2853
2854         Also merged invalidateNodeListsCacheAfterAttributeChanged and invalidateNodeListsCacheAfterChildrenChanged
2855         as invalidateNodeListCachesInAncestors since they're almost identical after r122498.
2856
2857         In addition, moved shouldInvalidateNodeListForType from Document.cpp to DynamicNodeList.h and renamed it to
2858         shouldInvalidateTypeOnAttributeChange since it needs to called in Node.cpp and ElementRareData.h.
2859
2860         * dom/Attr.cpp:
2861         (WebCore::Attr::setValue):
2862         (WebCore::Attr::childrenChanged):
2863         * dom/ContainerNode.cpp:
2864         (WebCore::ContainerNode::childrenChanged):
2865         * dom/Document.cpp:
2866         (WebCore::Document::registerNodeListCache): Calls isRootedAtDocument() instead of directly comparing
2867         the value of NodeListRootType in order to prepare for the bug 80269.
2868         (WebCore::Document::unregisterNodeListCache): Ditto.
2869         (WebCore): shouldInvalidateNodeListForType is moved to DynamicNodeList.h
2870         (WebCore::Document::shouldInvalidateNodeListCaches):
2871         * dom/DynamicNodeList.h:
2872         (DynamicNodeListCacheBase):
2873         (WebCore::DynamicNodeListCacheBase::shouldInvalidateTypeOnAttributeChange): Moved from Document.cpp.
2874         * dom/Element.cpp: 
2875         (WebCore::Element::attributeChanged):
2876         * dom/ElementRareData.h:
2877         (WebCore::ElementRareData::clearHTMLCollectionCaches): Takes const QualifiedName* to compare against
2878         the invalidation type of HTML collections via shouldInvalidateTypeOnAttributeChange.
2879         * dom/Node.cpp:
2880         (WebCore::Node::invalidateNodeListCachesInAncestors): Merged invalidateNodeListCachesInAncestors and
2881         invalidateNodeListsCacheAfterChildrenChanged. Also pass attrName to clearHTMLCollectionCaches.
2882         (WebCore::NodeListsNodeData::invalidateCaches): Compares attrName against the invalidation type of
2883         node lists via shouldInvalidateTypeOnAttributeChange.
2884         (WebCore):
2885         * dom/Node.h:
2886         (Node):
2887         * dom/NodeRareData.h:
2888         (WebCore::NodeRareData::ensureNodeLists): Merged NodeRareData::createNodeLists.
2889         (WebCore::NodeRareData::clearChildNodeListCache): Moved from Node.cpp.
2890         (NodeRareData):
2891         * html/HTMLCollection.h:
2892         (HTMLCollectionCacheBase):
2893
2894 2012-07-13  Arpita Bahuguna  <arpitabahuguna@gmail.com>
2895
2896         Refactor RenderTable to use the section's iteration functions.
2897         https://bugs.webkit.org/show_bug.cgi?id=89751
2898
2899         Reviewed by Julien Chaffraix.
2900
2901         Removing anti-pattern wherever possible from RenderTable code. Also, modifying
2902         RenderTable sections' iterations to use helper functions.
2903
2904         No new tests required for this change since no change in behavior is expected.
2905
2906         * rendering/RenderTable.cpp:
2907         (WebCore::RenderTable::addOverflowFromChildren):
2908         (WebCore::RenderTable::setCellLogicalWidths):
2909         (WebCore::RenderTable::outerBorderStart):
2910         (WebCore::RenderTable::outerBorderEnd):
2911         Removed anti-patterns involving iterations over RenderObjects.
2912
2913         (WebCore::RenderTable::outerBorderAfter):
2914         Modified RenderTable sections' iteration to use helper functions.
2915
2916 2012-07-13  Enrica Casucci  <enrica@apple.com>
2917
2918         Threadsafety issues in WebScriptObject
2919         https://bugs.webkit.org/show_bug.cgi?id=90849
2920
2921         Reviewed by Geoff Garen.
2922
2923         Updated fix for this bug. The JSC API lock needs to be acquired also in JSObject.
2924
2925         * bindings/objc/WebScriptObject.mm:
2926         (-[WebScriptObject JSObject]):
2927
2928 2012-07-13  Raymond Toy  <rtoy@google.com>
2929
2930         DelayNode doesn't work if delayTime.value == delayTime.maxValue
2931         https://bugs.webkit.org/show_bug.cgi?id=90357
2932
2933         Reviewed by Kenneth Russell.
2934
2935         Increase delay buffer size slightly so that the read and write
2936         pointers don't become equal when the delay and the max delay are
2937         the same.
2938         
2939         Tests: webaudio/delaynode-max-default-delay.html
2940                webaudio/delaynode-max-nondefault-delay.html
2941
2942         * Modules/webaudio/DelayDSPKernel.cpp:
2943         (WebCore): Moved SmoothingTimeConstant to WebCore namespace.
2944         (WebCore::DelayDSPKernel::DelayDSPKernel): Add some additional checks to prevent crashes; use bufferLengthForDelay to compute buffer length.
2945         (WebCore::DelayDSPKernel::bufferLengthForDelay): New function to compute buffer length.
2946         * Modules/webaudio/DelayDSPKernel.h:
2947         (DelayDSPKernel): Declare bufferLengthForDelay. 
2948
2949 2012-07-13  Benjamin Poulain  <bpoulain@apple.com>
2950
2951         Always aggressively preload on iOS
2952         https://bugs.webkit.org/show_bug.cgi?id=91276
2953
2954         Reviewed by Simon Fraser.
2955
2956         * loader/cache/CachedResourceLoader.cpp:
2957         (WebCore::CachedResourceLoader::preload):
2958
2959 2012-07-13  Vineet Chaudhary  <rgf748@motorola.com>
2960
2961         Restructure V8Utilities::extractTransferables() with help of toV8Sequence()
2962         https://bugs.webkit.org/show_bug.cgi?id=91208
2963
2964         Reviewed by Kentaro Hara.
2965
2966         We can remove the specialised check for MessagePort from V8Utilities::extractTransferables()
2967         using toV8Sequence() as it validates the passed object for sequence type per WebIDL spec.
2968
2969         No new test as just refactoring.
2970         Existing tests under fast/dom/Window/window-* fast/dom/events/*
2971         covers tests.
2972
2973         * bindings/v8/V8Utilities.cpp:
2974         (WebCore::extractTransferables):
2975
2976 2012-07-13  Vincent Scheib  <scheib@chromium.org>
2977
2978         Pointer Lock handles disconnected DOM elements
2979         https://bugs.webkit.org/show_bug.cgi?id=77029
2980
2981         Reviewed by Adrienne Walker.
2982
2983         Pointer Lock Controller now checks when elements or documents are
2984         removed, and unlocks if the target element is being removed.
2985
2986         Tests: pointer-lock/locked-element-iframe-removed-from-dom.html
2987                pointer-lock/locked-element-removed-from-dom.html
2988
2989         * dom/Document.cpp:
2990         (WebCore::Document::detach):
2991         * dom/Element.cpp:
2992         (WebCore::Element::removedFrom):
2993         (WebCore::Element::webkitRequestPointerLock):
2994         * page/PointerLockController.cpp:
2995         (WebCore::PointerLockController::requestPointerLock):
2996         (WebCore::PointerLockController::elementRemoved):
2997         (WebCore):
2998         (WebCore::PointerLockController::documentDetached):
2999         (WebCore::PointerLockController::didLosePointerLock):
3000         (WebCore::PointerLockController::enqueueEvent):
3001         * page/PointerLockController.h:
3002         (WebCore):
3003         (PointerLockController):
3004
3005 2012-07-13  Ryosuke Niwa  <rniwa@webkit.org>
3006
3007         HTMLCollection should use DynamicNodeList's invalidation model
3008         https://bugs.webkit.org/show_bug.cgi?id=90326
3009
3010         Reviewed by Anders Carlsson.
3011
3012         Make HTMLCollection invalidated upon attribute and children changes instead of invalidating it on demand
3013         by comparing DOM tree versions. Node that HTMLCollections owned by Document are invalidated with other
3014         document-rooted node lists in m_listsInvalidatedAtDocument for simplicity although this mechanism is
3015         normally used for node lists owned by a non-Document node that contains nodes outside of its subtree.
3016         ItemProperties and FormControls are more "traditional" users of the mechanism.
3017
3018         Also, merged DynamicNodeList::invalidateCache and HTMLCollection::invalidateCache.
3019
3020         * dom/Document.cpp:
3021         (WebCore::Document::registerNodeListCache): Renamed. No longer takes NodeListInvalidationType or
3022         NodeListRootType since they can be obtained from the cache base. Increment the node list counter for
3023         InvalidateOnIdNameAttrChange when a HTMLCollection is passed in since all HTMLCollections need to be
3024         invalidated on id or name content attribute changes due to named getters.
3025         (WebCore::Document::unregisterNodeListCache): Ditto.
3026         (WebCore::shouldInvalidateNodeListForType):
3027         (WebCore::Document::shouldInvalidateNodeListCaches):
3028         (WebCore::Document::clearNodeListCaches):
3029         * dom/Document.h:
3030         (WebCore): Added InvalidateOnIdNameAttrChange, InvalidateOnHRefAttrChange, and InvalidateOnAnyAttrChange.
3031         (Document):
3032         * dom/DynamicNodeList.cpp:
3033         (WebCore::DynamicNodeListCacheBase::invalidateCache): Added. Invalidates caches of both DynamicNodeList
3034         and HTMLCollection. We can't afford to use virtual function calls here because this function is called on
3035         all node lists and HTML collections owned by ancestors of an element under which a node is added, removed,
3036         or its attributes are changed.
3037         (WebCore):
3038         * dom/DynamicNodeList.h:
3039         (WebCore::DynamicNodeListCacheBase::DynamicNodeListCacheBase): Initializes member variables directly
3040         instead of calling clearCache now that DynamicNodeListCacheBase::invalidateCache has become polymorphic.
3041         (DynamicNodeListCacheBase): Increased the number of bits for m_invalidationType since we now have 9
3042         invalidation types.
3043         (WebCore::DynamicSubtreeNodeList::~DynamicSubtreeNodeList):
3044         (WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList):
3045         * dom/ElementRareData.h:
3046         (ElementRareData):
3047         (WebCore::ElementRareData::clearHTMLCollectionCaches): Added.
3048         (WebCore::ElementRareData::adoptTreeScope): Added; similar to NodeRareData::adoptTreeScope.
3049         * dom/Node.cpp:
3050         (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged): Clears HTML collection caches as well as
3051         node list caches.
3052         (WebCore::Node::invalidateNodeListsCacheAfterChildrenChanged): Ditto.
3053         * dom/NodeRareData.h:
3054         (WebCore::NodeListsNodeData::adoptTreeScope):
3055         * dom/TreeScopeAdopter.cpp:
3056         (WebCore::TreeScopeAdopter::moveTreeToNewScope): Calls ElementRareData's adoptTreeScope as well as
3057         NodeRareData's.
3058         * html/HTMLAllCollection.cpp:
3059         (WebCore::HTMLAllCollection::namedItemWithIndex):
3060         * html/HTMLCollection.cpp:
3061         (WebCore::rootTypeFromCollectionType): Added. As mentioned above, treat all Document-owned HTML collection
3062         as if rooted at document for convenience.
3063         (WebCore::invalidationTypeExcludingIdAndNameAttributes): Added. Since all HTML collection requires
3064         invalidation on id and name content attribute changes, which is taken care by the special logic in
3065         Document::registerNodeListCache, exclude those two attributes from consideration.
3066         (WebCore::HTMLCollection::HTMLCollection): Calls Document::registerNodeListCache.
3067         (WebCore::HTMLCollection::~HTMLCollection): Calls Document::unregisterNodeListCache.
3068         (WebCore::HTMLCollection::length):
3069         (WebCore::HTMLCollection::item):
3070         (WebCore::HTMLCollection::namedItem):
3071         (WebCore::HTMLCollection::updateNameCache):
3072         * html/HTMLCollection.h:
3073         (WebCore::HTMLCollectionCacheBase::HTMLCollectionCacheBase):
3074         (HTMLCollectionCacheBase): Removed m_cacheTreeVersion and clearCache since they're no longer used.
3075         (HTMLCollection):
3076         * html/HTMLFormCollection.cpp:
3077         (WebCore::HTMLFormCollection::namedItem):
3078         (WebCore::HTMLFormCollection::updateNameCache):
3079         * html/HTMLOptionsCollection.h:
3080         (HTMLOptionsCollection):
3081         * html/HTMLPropertiesCollection.cpp:
3082         (WebCore::HTMLPropertiesCollection::updateNameCache):
3083         * html/HTMLPropertiesCollection.h:
3084         (WebCore::HTMLPropertiesCollection::invalidateCache):
3085
3086 2012-07-13  Shawn Singh  <shawnsingh@chromium.org>
3087
3088         [chromium] Remove incorrect debug assertion in LayerRendererChromium.cpp
3089         https://bugs.webkit.org/show_bug.cgi?id=91260
3090
3091         Reviewed by Adrienne Walker.
3092
3093         ASSERT(!clipped) was being triggered after skinny almost-degenerate
3094         quads went through anti-aliasing inflation, and then were being
3095         transformed back from device space to local space. It turns out
3096         this assertion is too aggressive, and we don't yet have an obvious
3097         need to change the behavior on the clipped==true case.
3098
3099         No new tests needed, this patch fixes only comments and debug code.
3100
3101         * platform/graphics/chromium/LayerRendererChromium.cpp:
3102         (WebCore::LayerRendererChromium::drawRenderPassQuad):
3103            fixed a comment.
3104
3105         (WebCore::LayerRendererChromium::drawTileQuad):
3106            fixed a similar comment, removed unnecessary assertion.
3107
3108 2012-07-13  Philip Rogers  <pdr@google.com>
3109
3110         Remove assert in localCoordinateSpaceTransform()
3111         https://bugs.webkit.org/show_bug.cgi?id=91189
3112
3113         Reviewed by Nikolas Zimmermann.
3114
3115         The assert in localCoordinateSpaceTransform was added to catch subclasses forgetting
3116         to override the method but it is better to simply return the identity matrix.
3117
3118         This scenario can occur when we break the SVG content model, such as asking for
3119         the CTM of a <g> element inside a <tspan>. This is undefined in the spec because
3120         tspan is not a subclass of SVGLocatable but both Firefox and Opera
3121         implement this by returning the identity matrix.
3122
3123         Test: svg/custom/invalid-ctm.svg
3124
3125         * svg/SVGStyledElement.cpp:
3126         (WebCore::SVGStyledElement::localCoordinateSpaceTransform):
3127
3128 2012-07-13  Kentaro Hara  <haraken@chromium.org>
3129
3130         [V8] String wrappers should be marked Independent
3131         https://bugs.webkit.org/show_bug.cgi?id=91251
3132
3133         Reviewed by Adam Barth.
3134
3135         Currently V8 String wrappers are not marked Independent.
3136         By marking them Independent, they can be reclaimed by the scavenger GC.
3137
3138         I tried to find some cases where this change reduces memory usage,
3139         but couldn't due to sensitive behavior of GC.
3140
3141         No tests. No change in behavior.
3142
3143         * bindings/v8/V8Binding.cpp:
3144         (WebCore::StringCache::v8ExternalStringSlow):
3145
3146 2012-07-13  Peter Beverloo  <peter@chromium.org>
3147
3148         [Chromium] Make the v8 i18n API dependency conditional for Android, disable strict aliasing
3149         https://bugs.webkit.org/show_bug.cgi?id=91240
3150
3151         Reviewed by Adam Barth.
3152
3153         Disable the v8 internationalization API for Chromium Android, as it's
3154         disabled and not always available in checkouts. Furthermore, disable
3155         strict aliasing for the webkit_remaining target, similar to what
3156         x11-based builds are doing (see the webcore_prerequisites target).
3157
3158         * WebCore.gyp/WebCore.gyp:
3159
3160 2012-07-13  Kentaro Hara  <haraken@chromium.org>
3161
3162         [CallWith=XXX] arguments should be placed at the head of method arguments
3163         https://bugs.webkit.org/show_bug.cgi?id=91217
3164
3165         Reviewed by Adam Barth.
3166
3167         The EFL build with the ENABLE_FILE_SYSTEM flag caused a build error,
3168         because CodeGeneratorJS.pm assumes webkitEntries(ScriptExecutionContext*, HTMLInputElement*)
3169         but the actual signature is webkitEntries(HTMLInputElement*, ScriptExecutionContext*) (bug 91185).
3170
3171         Per https://trac.webkit.org/wiki/WebKitIDL#CallWith, [CallWith=XXX] arguments should be placed
3172         at the head of the arguments. (i.e. the behavior of CodeGeneratorJS.pm is correct.)
3173
3174         Thus the correct fix is (1) to change the signature of webkitEntries() and webkitGetAsEntry()
3175         so that ScriptExecutionContext* comes first and (2) to modify CodeGeneratorV8.pm to support the order.
3176
3177         Test: bindings/scripts/test/TestObj.idl
3178
3179         * Modules/filesystem/DataTransferItemFileSystem.h: Placed ScriptExecutionContext* at the head of arguments.
3180         (DataTransferItemFileSystem):
3181         * Modules/filesystem/HTMLInputElementFileSystem.cpp: Ditto.
3182         (WebCore::HTMLInputElementFileSystem::webkitEntries):
3183         * Modules/filesystem/HTMLInputElementFileSystem.h: Ditto.
3184         (HTMLInputElementFileSystem):
3185         * Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp: Ditto.
3186         (WebCore::DataTransferItemFileSystem::webkitGetAsEntry):
3187
3188         * bindings/scripts/CodeGeneratorV8.pm: Modified to support the correct order.
3189         (GenerateNormalAttrGetter):
3190         (GenerateNormalAttrSetter):
3191         (GenerateFunctionCallString):
3192
3193         * bindings/scripts/test/V8/V8TestInterface.cpp: Updated run-bindings-tests results.
3194         (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
3195
3196 2012-07-13  Mary Wu  <mary.wu@torchmobile.com.cn>
3197
3198         [BlackBerry] Some small changes in network code
3199         https://bugs.webkit.org/show_bug.cgi?id=90974
3200
3201         Reviewed by Rob Buis.
3202
3203         1. Set status in NetworkJob/SocketStreamHandleBlackBerry so that
3204         its wrapped stream can also query the stream result.
3205         2. pass download attribute to NetworkRequest.
3206
3207         RIM PR# 171555
3208         Reviewed internally by Lyon Chen and Joe Mason.
3209
3210         * platform/network/blackberry/NetworkJob.cpp:
3211         (WebCore::NetworkJob::handleNotifyClose):
3212         * platform/network/blackberry/NetworkJob.h:
3213         (WebCore::NetworkJob::status):
3214         * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
3215         (WebCore::platformTargetTypeForRequest):
3216         * platform/network/blackberry/SocketStreamHandle.h:
3217         (WebCore::SocketStreamHandle::status):
3218         (SocketStreamHandle):
3219         * platform/network/blackberry/SocketStreamHandleBlackBerry.cpp:
3220         (WebCore::SocketStreamHandle::notifyStatusReceived):
3221         (WebCore::SocketStreamHandle::notifyClose):
3222
3223 2012-07-13  Vsevolod Vlasov  <vsevik@chromium.org>
3224
3225         Web Inspector: Remove uiSourceCode from Resource.
3226         https://bugs.webkit.org/show_bug.cgi?id=91201
3227
3228         Reviewed by Pavel Feldman.
3229
3230         Removed Resource._uiSourceCode field as it is not used anymore.
3231
3232         * inspector/front-end/Resource.js:
3233         (WebInspector.Resource.prototype.isHidden):
3234         * inspector/front-end/UISourceCode.js:
3235         (WebInspector.UISourceCode):
3236
3237 2012-07-13  Sheriff Bot  <webkit.review.bot@gmail.com>
3238
3239         Unreviewed, rolling out r122450 and r122580.
3240         http://trac.webkit.org/changeset/122450
3241         http://trac.webkit.org/changeset/122580
3242         https://bugs.webkit.org/show_bug.cgi?id=91263
3243
3244         Caused multiple regressions on ClusterFuzz (Requested by
3245         inferno-sec on #webkit).
3246
3247         * bindings/js/ScriptWrappable.h:
3248         (WebCore::ScriptWrappable::reportMemoryUsage):
3249         * bindings/v8/DOMDataStore.cpp:
3250         (WebCore::DOMDataStore::reportMemoryUsage):
3251         * bindings/v8/IntrusiveDOMWrapperMap.h:
3252         (WebCore::ChunkedTable::reportMemoryUsage):
3253         * bindings/v8/ScriptWrappable.h:
3254         (WebCore::ScriptWrappable::reportMemoryUsage):
3255         * bindings/v8/V8Binding.cpp:
3256         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
3257         (WebCore::StringCache::reportMemoryUsage):
3258         * bindings/v8/V8DOMMap.h:
3259         * css/PropertySetCSSStyleDeclaration.cpp:
3260         (WebCore::InlineCSSStyleDeclaration::ensureMutablePropertySet):
3261         * css/StylePropertySet.cpp:
3262         * css/StylePropertySet.h:
3263         (WebCore::StylePropertySet::reportMemoryUsage):
3264         * dom/CharacterData.cpp:
3265         (WebCore::CharacterData::reportMemoryUsage):
3266         * dom/ContainerNode.h:
3267         (WebCore::ContainerNode::reportMemoryUsage):
3268         * dom/Document.cpp:
3269         (WebCore::Document::reportMemoryUsage):
3270         * dom/Element.cpp:
3271         (WebCore::Element::detachAttribute):
3272         (WebCore::Element::removeAttribute):
3273         (WebCore::Element::attributes):
3274         (WebCore::Element::setAttributeInternal):
3275         (WebCore::Element::parserSetAttributes):
3276         (WebCore::Element::hasEquivalentAttributes):
3277         (WebCore::Element::createAttributeData):
3278         (WebCore):
3279         (WebCore::Element::setAttributeNode):
3280         (WebCore::Element::removeAttributeNode):
3281         (WebCore::Element::getAttributeNode):
3282         (WebCore::Element::getAttributeNodeNS):
3283         (WebCore::Element::hasAttribute):
3284         (WebCore::Element::hasAttributeNS):
3285         (WebCore::Element::normalizeAttributes):
3286         (WebCore::Element::cloneAttributesFromElement):
3287         * dom/Element.h:
3288         (WebCore::Element::attributeData):
3289         (Element):
3290         (WebCore::Element::reportMemoryUsage):
3291         (WebCore::Element::ensureAttributeData):
3292         (WebCore::Element::updatedAttributeData):
3293         (WebCore::Element::ensureUpdatedAttributeData):
3294         * dom/ElementAttributeData.cpp:
3295         (WebCore::ElementAttributeData::attrIfExists):
3296         (WebCore::ElementAttributeData::ensureAttr):
3297         (WebCore::ElementAttributeData::setAttr):
3298         (WebCore::ElementAttributeData::removeAttr):
3299         (WebCore::ElementAttributeData::setClass):
3300         (WebCore):
3301         (WebCore::ElementAttributeData::ensureInlineStyle):
3302         (WebCore::ElementAttributeData::ensureMutableInlineStyle):
3303         (WebCore::ElementAttributeData::destroyInlineStyle):
3304         (WebCore::ElementAttributeData::addAttribute):
3305         (WebCore::ElementAttributeData::removeAttribute):
3306         (WebCore::ElementAttributeData::isEquivalent):
3307         (WebCore::ElementAttributeData::detachAttrObjectsFromElement):
3308         (WebCore::ElementAttributeData::getAttributeItemIndexSlowCase):
3309         (WebCore::ElementAttributeData::cloneDataFrom):
3310         (WebCore::ElementAttributeData::clearAttributes):
3311         (WebCore::ElementAttributeData::replaceAttribute):
3312         (WebCore::ElementAttributeData::getAttributeNode):
3313         * dom/ElementAttributeData.h:
3314         (WebCore::ElementAttributeData::create):
3315         (ElementAttributeData):
3316         (WebCore::ElementAttributeData::setIdForStyleResolution):
3317         (WebCore::ElementAttributeData::setAttributeStyle):
3318         (WebCore::ElementAttributeData::length):
3319         (WebCore::ElementAttributeData::isEmpty):
3320         (WebCore::ElementAttributeData::attributeItem):
3321         (WebCore::ElementAttributeData::getAttributeItem):
3322         (WebCore::ElementAttributeData::reportMemoryUsage):
3323         (WebCore::ElementAttributeData::ElementAttributeData):
3324         (WebCore::ElementAttributeData::attributeVector):
3325         (WebCore::ElementAttributeData::clonedAttributeVector):
3326         (WebCore::ElementAttributeData::removeAttribute):
3327         (WebCore::ElementAttributeData::getAttributeItemIndex):
3328         * dom/MemoryInstrumentation.h:
3329         (MemoryInstrumentation):
3330         (MemoryObjectInfo):
3331         (WebCore::MemoryObjectInfo::reportInstrumentedPointer):
3332         (WebCore::MemoryObjectInfo::reportPointer):
3333         (WebCore::MemoryObjectInfo::reportInstrumentedObject):
3334         (WebCore::MemoryObjectInfo::reportObject):
3335         (WebCore::MemoryObjectInfo::reportObjectInfo):
3336         (WebCore::MemoryObjectInfo::reportHashMap):
3337         (WebCore::MemoryObjectInfo::reportHashSet):
3338         (WebCore::MemoryObjectInfo::reportListHashSet):
3339         (WebCore::MemoryObjectInfo::reportVector):
3340         (WebCore::MemoryObjectInfo::reportString):
3341         (WebCore::MemoryObjectInfo::objectType):
3342         (WebCore::MemoryObjectInfo::objectSize):
3343         (WebCore::MemoryObjectInfo::memoryInstrumentation):
3344         * dom/Node.cpp:
3345         (WebCore::Node::reportMemoryUsage):
3346         * dom/QualifiedName.h:
3347         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
3348         (WebCore::QualifiedName::reportMemoryUsage):
3349         * dom/StyledElement.cpp:
3350         (WebCore::StyledElement::style):
3351         (WebCore::StyledElement::classAttributeChanged):
3352         (WebCore::StyledElement::setInlineStyleProperty):
3353         (WebCore::StyledElement::removeInlineStyleProperty):
3354         (WebCore::StyledElement::addSubresourceAttributeURLs):
3355         * dom/StyledElement.h:
3356         (WebCore::StyledElement::ensureInlineStyle):
3357         * html/parser/HTMLConstructionSite.cpp:
3358         (WebCore::HTMLConstructionSite::createHTMLElementFromSavedElement):
3359         * platform/TreeShared.h:
3360         (WebCore::TreeShared::reportMemoryUsage):
3361         * xml/parser/XMLDocumentParserQt.cpp:
3362         (WebCore::XMLDocumentParser::XMLDocumentParser):
3363
3364 2012-07-13  Huang Dongsung  <luxtella@company100.net>
3365
3366         Remove down-casting to BitmapImage in GraphicsContext::drawImage.
3367         https://bugs.webkit.org/show_bug.cgi?id=90755
3368
3369         Reviewed by Simon Fraser.
3370
3371         Add a BitmapImage draw method which takes RespectImageOrientationEnum enum as
3372         the last argument for CG. Then we can remove the conditional down-casting in
3373         GraphicsContext::drawImage.
3374
3375         This change is needed for parallel image decoders. Because parallel image
3376         decoders use a Bitmap image wrapper class which extends Image (not Bitmap), the
3377         down-casting above causes the loss of RespectImageOrientationEnum which must be
3378         passed to BitmapImage.
3379
3380         No new tests, no behavior change.
3381
3382         * platform/graphics/BitmapImage.cpp:
3383         * platform/graphics/BitmapImage.h:
3384         * platform/graphics/GraphicsContext.cpp:
3385         (WebCore::GraphicsContext::drawImage):
3386         * platform/graphics/Image.cpp:
3387         (WebCore::Image::draw):
3388         (WebCore):
3389         * platform/graphics/Image.h:
3390         (Image):
3391
3392 2012-07-13  Lauro Neto  <lauro.neto@openbossa.org>
3393
3394         Fix QtWebKit build with OpenGLES after GC3D/E3D refactor
3395         https://bugs.webkit.org/show_bug.cgi?id=91156
3396
3397         Reviewed by Noam Rosenthal.
3398
3399         Adds several build fixes.
3400
3401         * platform/graphics/GraphicsContext3D.h:
3402             Use E3DOpenGLES instead of previously removed E3DQt.
3403
3404         * platform/graphics/OpenGLESShims.h:
3405             Enable defines for Qt.
3406
3407         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
3408         (WebCore::Extensions3DOpenGLES::blitFramebuffer):
3409         (WebCore):
3410         (WebCore::Extensions3DOpenGLES::renderbufferStorageMultisample):
3411         (WebCore::Extensions3DOpenGLES::copyTextureCHROMIUM):
3412             Added pure virtual stubs.
3413
3414         (WebCore::Extensions3DOpenGLES::supportsExtension):
3415             Remove PROC suffix. See bug #91130.
3416
3417         * platform/graphics/opengl/Extensions3DOpenGLES.h:
3418         (Extensions3DOpenGLES):
3419             Added pure virtual stubs.
3420
3421         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
3422         (WebCore::GraphicsContext3D::reshapeFBOs):
3423             Readded missing function after removed in r122250.
3424
3425         (WebCore):
3426             Use PLATFORM(BLACKBERRY) guard around port-specific include.
3427
3428         * platform/graphics/qt/GraphicsContext3DQt.cpp:
3429             Added USE(OPENGL_ES_2) guard instead of always loading the OpenGL extensions.
3430
3431
3432 2012-07-13  Keishi Hattori  <keishi@webkit.org>
3433
3434         Form of FormAssociatedElement is not updated when id target changes.
3435         https://bugs.webkit.org/show_bug.cgi?id=91042
3436
3437         Reviewed by Kent Tamura.
3438
3439         Test: fast/forms/update-form-attribute-element.html
3440
3441         This patch introduces the IdTargetObserver and IdTargetObserverRegistry class.
3442         They can be used to be notified when the element that an id is pointing to (the id target)
3443         changes.
3444
3445         * CMakeLists.txt: Added IdTargetObserverRegistry.{h,cpp} and IdTargetObserver.{h,cpp}
3446         * GNUmakefile.list.am: Ditto.
3447         * Target.pri: Ditto.
3448         * WebCore.gypi: Ditto.
3449         * WebCore.vcproj/WebCore.vcproj: Ditto.
3450         * WebCore.xcodeproj/project.pbxproj: Ditto.
3451         * dom/DOMAllInOne.cpp:
3452         * dom/IdTargetObserver.cpp: Added. When you want notified of changes to an id target, you should create a new class that inherits this.
3453         (WebCore):
3454         (WebCore::IdTargetObserver::IdTargetObserver):
3455         (WebCore::IdTargetObserver::~IdTargetObserver):
3456         * dom/IdTargetObserver.h: Added.
3457         (WebCore):
3458         (IdTargetObserver):
3459         * dom/IdTargetObserverRegistry.cpp: Added.
3460         (WebCore):
3461         (WebCore::IdTargetObserverRegistry::create):
3462         (WebCore::IdTargetObserverRegistry::addObserver): Register an IdTargetObserver to observe an id target.
3463         (WebCore::IdTargetObserverRegistry::removeObserver): Unregisters an IdTargetObserver from observing.
3464         (WebCore::IdTargetObserverRegistry::notifyObserversInternal):
3465         * dom/IdTargetObserverRegistry.h: Added.
3466         (WebCore):
3467         (IdTargetObserverRegistry):
3468         (WebCore::IdTargetObserverRegistry::IdTargetObserverRegistry):
3469         (WebCore::IdTargetObserverRegistry::notifyObservers): Calls idTargetChanged on all observers for an id. Inlining first part of function for performance.
3470         * dom/TreeScope.cpp:
3471         (WebCore::TreeScope::TreeScope):
3472         (WebCore::TreeScope::addElementById): Calls IdTargetObserverRegistry::notifyObservers because the id target might have changed.
3473         (WebCore::TreeScope::removeElementById): Ditto.
3474         * dom/TreeScope.h:
3475         (WebCore):
3476         (WebCore::TreeScope::idTargetObserverRegistry):
3477         (TreeScope):
3478         * html/FormAssociatedElement.cpp: Observer for id targets defined by the form attribute.
3479         (WebCore::FormAssociatedElement::didMoveToNewDocument):
3480         (WebCore::FormAssociatedElement::insertedInto):
3481         (WebCore::FormAssociatedElement::removedFrom):
3482         (WebCore::FormAssociatedElement::formAttributeChanged):
3483         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver): Creates and sets up a new FormAttributeTargetObserver.
3484         (WebCore):
3485         (WebCore::FormAssociatedElement::formAttributeTargetChanged):
3486         (WebCore::FormAttributeTargetObserver::create):
3487         (WebCore::FormAttributeTargetObserver::FormAttributeTargetObserver):
3488         (WebCore::FormAttributeTargetObserver::idTargetChanged):
3489         * html/FormAssociatedElement.h:
3490         (FormAssociatedElement):
3491         * html/FormController.cpp:
3492         * html/FormController.h:
3493         (FormController):
3494         * html/HTMLFormElement.cpp:
3495         (WebCore::HTMLFormElement::removedFrom):
3496         (WebCore::HTMLFormElement::formElementIndexWithFormAttribute): Modified to take a range. It
3497         scans the range and returns the index to insert the element in m_associatedElement.
3498         (WebCore::HTMLFormElement::formElementIndex): Modified to only scan the elements in
3499         m_associatedElement that precede and follow the form element.
3500         * html/HTMLFormElement.h:
3501         (HTMLFormElement):
3502
3503 2012-07-13  Gabor Rapcsanyi  <rgabor@webkit.org>
3504
3505         Optimizing blend filter to ARM-NEON with intrinsics
3506         https://bugs.webkit.org/show_bug.cgi?id=90949
3507
3508         Reviewed by Zoltan Herczeg.
3509
3510         The feBlend SVG filter modes can be greatly fasten up with ARM-NEON since
3511         we are able to calculate with 2 pixels (8 channels) at the same time.
3512         The code is written with NEON intrinsics and it doesn't affect the
3513         general - it has the same behaviour as the original algorithm.
3514         With this NEON optimization the calculation is ~4.5 times faster for each mode.
3515
3516         Existing tests cover this issue.
3517
3518         * CMakeLists.txt:
3519         * GNUmakefile.list.am:
3520         * Target.pri:
3521         * WebCore.gypi:
3522         * WebCore.vcproj/WebCore.vcproj:
3523         * WebCore.xcodeproj/project.pbxproj:
3524         * platform/graphics/filters/FEBlend.cpp:
3525         (WebCore::FEBlend::platformApplyGeneric):
3526         (WebCore):
3527         (WebCore::FEBlend::platformApplySoftware):
3528         * platform/graphics/filters/FEBlend.h:
3529         (FEBlend):
3530         * platform/graphics/filters/arm/FEBlendNEON.h: Added.
3531         (WebCore):
3532         (FEBlendUtilitiesNEON):
3533         (WebCore::FEBlendUtilitiesNEON::div255): integer divison with 255
3534         (WebCore::FEBlendUtilitiesNEON::normal): calculate normal mode blending for two pixels
3535         (WebCore::FEBlendUtilitiesNEON::multiply): calculate multiply mode blending for two pixels
3536         (WebCore::FEBlendUtilitiesNEON::screen): calculate screen mode blending for two pixels
3537         (WebCore::FEBlendUtilitiesNEON::darken): calculate darken mode blending for two pixels
3538         (WebCore::FEBlendUtilitiesNEON::lighten): calculate lighten mode blending for two pixels
3539         (WebCore::FEBlend::platformApplyNEON):
3540
3541 2012-07-13  Ilya Tikhonovsky  <loislo@chromium.org>
3542
3543         Web Inspector: native memory instrumentation: extract instrumentation methods into MemoryClassInfo
3544         https://bugs.webkit.org/show_bug.cgi?id=91227
3545
3546         Reviewed by Pavel Feldman.
3547
3548         void Node::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
3549         {
3550             MemoryClassInfo<Node> info(memoryObjectInfo, this, MemoryInstrumentation::DOM);
3551             info.visitBaseClass<ScriptWrappable>(this);
3552
3553             info.addMember(m_notInstrumentedPointer); // automatically detects poniter/reference
3554             info.addInstrumentedMember(m_next);
3555             info.addHashSet<MemoryInstrumentation::NonClass>(m_aHash);                // NonClass value_type (report only size of internal template structures)
3556             info.addHashSet<MemoryInstrumentation::NotInstrumentedClass>(m_aHashSet); // not instrumented value_type (use sizeof)
3557             info.addHashSet<MemoryInstrumentation::InstrumentedClass>(m_aHashSet);    // instrumented value_type (call visit)
3558         }
3559
3560         The change is covered by existing tests for native memory snapshot.
3561
3562         * bindings/v8/DOMDataStore.cpp:
3563         (WebCore::DOMDataStore::reportMemoryUsage):
3564         * bindings/v8/IntrusiveDOMWrapperMap.h:
3565         (WebCore::ChunkedTable::reportMemoryUsage):
3566         * bindings/v8/ScriptWrappable.h:
3567         (WebCore::ScriptWrappable::reportMemoryUsage):
3568         * bindings/v8/V8Binding.cpp:
3569         (WebCore::V8BindingPerIsolateData::reportMemoryUsage):
3570         (WebCore::StringCache::reportMemoryUsage):
3571         * bindings/v8/V8DOMMap.h:
3572         * css/StylePropertySet.h:
3573         (WebCore::StylePropertySet::reportMemoryUsage):
3574         * dom/CharacterData.cpp:
3575         (WebCore::CharacterData::reportMemoryUsage):
3576         * dom/ContainerNode.h:
3577         (WebCore::ContainerNode::reportMemoryUsage):
3578         * dom/Document.cpp:
3579         (WebCore::Document::reportMemoryUsage):
3580         * dom/Element.h:
3581         (WebCore::Element::reportMemoryUsage):
3582         * dom/ElementAttributeData.h:
3583         (WebCore::ElementAttributeData::reportMemoryUsage):
3584         * dom/MemoryInstrumentation.h:
3585         (MemoryInstrumentation):
3586         (WebCore::MemoryObjectInfo::objectType):
3587         (WebCore::MemoryObjectInfo::objectSize):
3588         (WebCore::MemoryObjectInfo::memoryInstrumentation):
3589         (MemoryObjectInfo):
3590         (WebCore::MemoryObjectInfo::reportObjectInfo):
3591         (WebCore):
3592         (MemoryClassInfo):
3593         (WebCore::MemoryClassInfo::MemoryClassInfo):
3594         (WebCore::MemoryClassInfo::visitBaseClass):
3595         (WebCore::MemoryClassInfo::reportInstrumentedPointer):
3596         (WebCore::MemoryClassInfo::reportInstrumentedObject):
3597         (WebCore::MemoryClassInfo::reportPointer):
3598         (WebCore::MemoryClassInfo::reportObject):
3599         (WebCore::MemoryClassInfo::reportHashMap):
3600         (WebCore::MemoryClassInfo::reportHashSet):
3601         (WebCore::MemoryClassInfo::reportListHashSet):
3602         (WebCore::MemoryClassInfo::reportVector):
3603         (WebCore::MemoryClassInfo::reportString):
3604         * dom/Node.cpp:
3605         (WebCore::Node::reportMemoryUsage):
3606         * dom/QualifiedName.h:
3607         (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
3608         (WebCore::QualifiedName::reportMemoryUsage):
3609         * platform/TreeShared.h:
3610         (WebCore::TreeShared::reportMemoryUsage):
3611
3612 2012-07-13  Pavel Feldman  <pfeldman@chromium.org>
3613
3614         Web Inspector: align scope filters
3615         https://bugs.webkit.org/show_bug.cgi?id=91213
3616
3617         Reviewed by Vsevolod Vlasov.
3618
3619         * inspector/front-end/elementsPanel.css:
3620         (.crumbs):
3621         * inspector/front-end/inspector.css:
3622         (.status-bar > div):
3623         (.scope-bar):
3624         (.scope-bar li):
3625         (.scope-bar li.all):
3626         * inspector/front-end/networkLogView.css:
3627
3628 2012-07-13  Peter Rybin  <peter.rybin@gmail.com>
3629
3630         Web Inspector: too many hardcoded strings in InspectorBackendDispatcher.
3631         https://bugs.webkit.org/show_bug.cgi?id=89198
3632
3633         Reviewed by Yury Semikhatsky.
3634
3635         Instead of generating error message string on every call (mostly for nothing),
3636         error message is generated deeper inside the handler and only command name
3637         is passed every time.
3638
3639         * inspector/CodeGeneratorInspector.py:
3640         (Generator.process_command):
3641
3642 2012-07-13  Joshua Netterfield  <jnetterfield@rim.com>
3643
3644         [BlackBerry] Update about:* pages
3645         https://bugs.webkit.org/show_bug.cgi?id=91121
3646
3647         Reviewed by Yong Li.
3648
3649         Update the about:config pages, and improve the aesthetics of the about:build, about:version, about:credits, about:memory, about:config, and similar pages.
3650
3651         No new tests, because there is no new funtionality.
3652
3653         * platform/network/blackberry/NetworkJob.cpp: Update the aesthetics of about:* pages
3654
3655 2012-07-13  Olivier Blin  <olivier.blin@softathome.com>
3656
3657         Fix checking for optional DeviceOrientationEvent.absolute in JSC bindings
3658         https://bugs.webkit.org/show_bug.cgi?id=91225
3659
3660         Reviewed by Steve Block.
3661
3662         This issue comes from r105036
3663
3664         * bindings/js/JSDeviceOrientationEventCustom.cpp:
3665         (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
3666
3667 2012-07-13  Andrei Bucur  <abucur@adobe.com>
3668         [CSS Regions] Fix build for bug 89000
3669         https://bugs.webkit.org/show_bug.cgi?id=91215
3670
3671         Reviewed by Kentaro Hara.
3672
3673         Remove the unused variable m_state that was a leftover from a previous version of the patch.
3674
3675         Tests: No new tests, build fix.
3676
3677         * dom/WebKitNamedFlow.cpp:
3678         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
3679         * dom/WebKitNamedFlow.h:
3680         (WebKitNamedFlow):
3681
3682 2012-07-13  Kenichi Ishibashi  <bashi@chromium.org>
3683
3684         [Chromium] Fix bugs in HarfBuzzShaper
3685         https://bugs.webkit.org/show_bug.cgi?id=90951
3686
3687         Reviewed by Tony Chang.
3688
3689         The current implementation has following problems:
3690         - Cannot render RTL text if the TextRun is divided into more than two
3691           HarfBuzzRun.
3692         - Script handling in TextRun partitioning is incorrect.
3693         - Inaccurate calculation of selection rect.
3694         - Wrong rendering position when the first glyph of the TextRun have
3695           non-zero offsets in terms of HarfBuzz.
3696
3697         To fix these problems I rewrote HarfBuzzShaper class. Here is the summary:
3698         - Divide the whole range of TextRun first, then shape them in visual
3699           order.
3700         - Divide TextRun in the same way of old-harfbuzz's
3701           hb_utf16_script_run_next().
3702         - Prefer float than int when calculating selection.
3703         - Adjust the drawing point after shaping.
3704
3705         Added tests covers the fix except for the last problem. The last problem will be covered
3706         by fast/text/international/complex-joining-using-gpos.html after chromium linux port switches
3707         to use HarfBuzzShaper.
3708
3709         Tests: fast/text/shaping/shaping-script-order.html
3710                fast/text/shaping/shaping-selection-rect.html
3711
3712         * platform/graphics/harfbuzz/FontHarfBuzz.cpp:
3713         (WebCore::Font::drawComplexText): Adjusts point after shaping.
3714         * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp:
3715         (WebCore::HarfBuzzShaper::HarfBuzzRun::HarfBuzzRun):
3716         (WebCore):
3717         (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Added.
3718         (WebCore::HarfBuzzShaper::HarfBuzzRun::setGlyphAndAdvance): Offsets are no longer needed.
3719         (WebCore::HarfBuzzShaper::HarfBuzzRun::xPositionForOffset): Calculates character offset based on advance.
3720         (WebCore::normalizeCharacters): Added.
3721         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
3722         (WebCore::HarfBuzzShaper::~HarfBuzzShaper):
3723         (WebCore::HarfBuzzShaper::shape): Divides TextRun first, then shapes them.
3724         (WebCore::HarfBuzzShaper::adjustStartPoint): Added.
3725         (WebCore::HarfBuzzShaper::collectHarfBuzzRuns): Added.
3726         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Added.
3727         (WebCore::HarfBuzzShaper::setGlyphPositionsForHarfBuzzRun): Followed other changes.
3728         (WebCore::HarfBuzzShaper::selectionRect): Use float for calculating selection.
3729         * platform/graphics/harfbuzz/ng/HarfBuzzShaper.h:
3730         (HarfBuzzShaper): Holds the start index of character. Removed unnecessary variables.
3731         (WebCore::HarfBuzzShaper::HarfBuzzRun::create): Ditto.
3732         (HarfBuzzRun):
3733         (WebCore::HarfBuzzShaper::HarfBuzzRun::fontData): Added.
3734         (WebCore::HarfBuzzShaper::HarfBuzzRun::startIndex): Ditto.
3735         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Ditto.
3736         (WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto.
3737
3738 2012-07-13  Kentaro Hara  <haraken@chromium.org>
3739
3740         Unreviewed, rolling out r122545.
3741         http://trac.webkit.org/changeset/122545
3742         https://bugs.webkit.org/show_bug.cgi?id=91185
3743
3744         We found that this was a wrong fix
3745
3746         * bindings/scripts/CodeGeneratorJS.pm:
3747         (GenerateImplementation):
3748
3749 2012-07-13  Kentaro Hara  <haraken@chromium.org>
3750
3751         Unreviewed, rolling out r122553.
3752         http://trac.webkit.org/changeset/122553
3753         https://bugs.webkit.org/show_bug.cgi?id=91198
3754
3755         We found that this was a wrong fix
3756
3757         * bindings/scripts/CodeGeneratorJS.pm:
3758         (GenerateImplementation):
3759
3760 2012-07-13  Kent Tamura  <tkent@chromium.org>
3761
3762         Change the timing of form state restore
3763         https://bugs.webkit.org/show_bug.cgi?id=89962
3764
3765         Reviewed by Hajime Morita.
3766
3767         For a preparation to fix a form identification problem (Bug 91209),
3768         restore controls states when the parsing of their owner forms is
3769         completed. For controls without owners, their states are restored when
3770         their parsing is completed as ever.
3771
3772         No new tests. This doesn't change observable behavior.
3773
3774         * html/FormController.cpp:
3775         (WebCore::ownerFormForState):
3776         Added. This code was used in formKey(), and restoreControlState*() use it.
3777         (WebCore::FormKeyGenerator::formKey): Use ownerFormForState(). No behavior change.
3778         (WebCore::FormController::restoreControlStateFor):
3779         Moved some code from HTMLFormControlElementWithState::finishParsingChildren().
3780         The difference is we don't resotre state if this control is owned by a form.
3781         (WebCore::FormController::restoreControlStateIn):
3782         Restore states of associated controls. This is called from
3783         finishParsingChildren() for <form>.
3784         * html/FormController.h:
3785         (FormController):
3786         - Declare restoreControlStateFor() and restoreControlStateIn().
3787         - Make takeStateForFormElement() private.
3788
3789         * html/FormAssociatedElement.cpp:
3790         (WebCore::FormAssociatedElement::isFormControlElementWithState):
3791         Added. The default implementation returns false.
3792         * html/FormAssociatedElement.h:
3793         (FormAssociatedElement):
3794         Added isFormControlElementWithState() for FormController::restoreControlStateIn().
3795         * html/HTMLFormControlElementWithState.cpp:
3796         (WebCore::HTMLFormControlElementWithState::finishParsingChildren):
3797         Some code was moved to FormController:restoreControlStateFor().
3798         (WebCore::HTMLFormControlElementWithState::isFormControlElementWithState):
3799         Added. Returns true.
3800         * html/HTMLFormControlElementWithState.h:
3801         (HTMLFormControlElementWithState): Declare isFormControlElementWithState().
3802         * html/HTMLFormElement.cpp:
3803         (WebCore::HTMLFormElement::finishParsingChildren):
3804         Added. Calls FormController::restoreControlStateIn().
3805         * html/HTMLFormElement.h:
3806         (HTMLFormElement): Declare finishParsingChildren().
3807
3808 2012-07-13  Kent Tamura  <tkent@chromium.org>
3809
3810         Make calendar pickers testable
3811         https://bugs.webkit.org/show_bug.cgi?id=84827
3812
3813         Reviewed by Hajime Morita.
3814
3815         WebCore:
3816         - Add PagePopupDriver, an interface to open/close a PagePopup.
3817         - Add setPagePopupDriver() to ChromeClient in order to inject a
3818         PagePopupDriver for testing.
3819
3820         Internals:
3821         Add MockPagePopupDriver, which creates a MockPagePopup, which creates a
3822         normal <iframe> in the top-level document, and load the popup content on
3823         it. MockPagePopupDriver is enabled by
3824         internals.settings.setEnableMockPagePopup(true).
3825
3826         Test: fast/forms/date/calendar-picker-appearance.html
3827
3828         * WebCore.gypi: Add new files.
3829         * WebCore.xcodeproj/project.pbxproj: Add files to make this buildable.
3830         * page/ChromeClient.h:
3831         (ChromeClient): Add function for PagePopupDriver.
3832         * loader/EmptyClients.h: Add empty implementations for PagePopupDriver functions.
3833         * page/PagePopupDriver.h: Added.
3834         (PagePopupDriver):
3835         (WebCore::PagePopupDriver::~PagePopupDriver):
3836
3837         * testing/InternalSettings.cpp:
3838         (WebCore::InternalSettings::Backup::restoreTo): Reset the mock PagePopupDriver.
3839         (WebCore::InternalSettings::setEnableMockPagePopup):
3840         Register MockPagePopupDriver to ChromeClient.
3841         * testing/InternalSettings.h:
3842         (InternalSettings): Declare setEnableMockPagePopup().
3843         * testing/InternalSettings.idl: ditto.
3844         * testing/MockPagePopupDriver.cpp: Added.
3845         (MockPagePopup): Pseudo PagePopup implementation with the standard <iframe>.
3846         (WebCore::MockPagePopupDriver::MockPagePopupDriver): Added.
3847         (WebCore::MockPagePopupDriver::create): Added.
3848         (WebCore::MockPagePopupDriver::~MockPagePopupDriver): Added.
3849         (WebCore::MockPagePopupDriver::openPagePopup):
3850         Added. An override of PagePopupDriver function. This creates a MockPagePopup.
3851         (WebCore::MockPagePopupDriver::closePagePopup):
3852         Added. An override of PagePopupDriver function. This deletes the MockPagePopup.
3853         * testing/MockPagePopupDriver.h:
3854         (MockPagePopupDriver): Added.
3855
3856         * testing/v8/WebCoreTestSupport.cpp:
3857         (WebCoreTestSupport::injectPagePopupController):
3858         Added. Production code uses per-Page context feature framework. However
3859         MockPagePopup uses the same page as the host page. So we can't use the
3860         framework and need to inject window.pagePopupController manually.
3861         * testing/v8/WebCoreTestSupport.h:
3862         (WebCoreTestSupport): Add injectPagePopupController().
3863
3864 2012-07-12  Pavel Feldman  <pfeldman@chromium.org>
3865
3866         Web Inspector: mute the native looks of the selects in the console.
3867         https://bugs.webkit.org/show_bug.cgi?id=91120
3868
3869         Reviewed by Vsevolod Vlasov.
3870
3871         This is necessary for Mac now that we don't use border images for select.
3872
3873         * inspector/front-end/ConsoleView.js:
3874         (WebInspector.ConsoleView.prototype.get statusBarItems):
3875         (WebInspector.ConsoleView.prototype.addContext):
3876         (WebInspector.ConsoleView.prototype.removeContext):
3877         (WebInspector.ConsoleView.prototype._updateIsolatedWorldSelector):
3878         (WebInspector.ConsoleView.prototype._appendIsolatedContextOption):
3879         (WebInspector.ConsoleView.prototype._currentEvaluationContext):
3880         (WebInspector.ConsoleView.prototype._currentIsolatedContextId):
3881         * inspector/front-end/StatusBarButton.js:
3882         (WebInspector.StatusBarComboBox):
3883         (WebInspector.StatusBarComboBox.prototype.addOption):
3884         (WebInspector.StatusBarComboBox.prototype.removeOption):
3885         (WebInspector.StatusBarComboBox.prototype.removeOptions):
3886         (WebInspector.StatusBarComboBox.prototype.selectedOption):
3887         * inspector/front-end/inspector.css:
3888         (.status-bar-select-container):
3889         (select.status-bar-item):
3890         (.console-context):
3891
3892 2012-07-13  Andrei Bucur  <abucur@adobe.com>
3893
3894         [CSS Regions] Fix the lifecycle for the flow objects and their renderers
3895         https://bugs.webkit.org/show_bug.cgi?id=89000
3896
3897         Reviewed by Eric Seidel.
3898
3899         This patch adds the concept of a NamedFlowCollection, owned by the document, that keeps track of
3900         all the named flows that exist in the Document. This collection contains a ListHashSet of weak references to
3901         all the existing NamedFlows in the document. This is not a managed set because the CREATED flows are referenced from the renderer and
3902         the NULL flows are only cached, they should be destructible.
3903         Two named flows are considered to be equal if they have the same name.
3904         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.
3905         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
3906         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
3907         so when they go back to the CREATED state, the listeners would still be there.
3908
3909         Link to spec: http://www.w3.org/TR/2012/WD-css3-regions-20120503/
3910
3911         Tests: The old tests have been modified to take into account the new behavior
3912
3913         * CMakeLists.txt:
3914         * GNUmakefile.list.am:
3915         * Target.pri:
3916         * WebCore.gypi:
3917         * WebCore.vcproj/WebCore.vcproj:
3918         * WebCore.xcodeproj/project.pbxproj:
3919         * dom/DOMAllInOne.cpp:
3920         * dom/Document.cpp:
3921         (WebCore::Document::~Document):
3922         (WebCore):
3923         (WebCore::Document::webkitGetFlowByName):
3924         (WebCore::Document::namedFlows):
3925         * dom/Document.h:
3926         (WebCore):
3927         (Document):
3928         * dom/WebKitNamedFlow.cpp:
3929         (WebCore::WebKitNamedFlow::WebKitNamedFlow):
3930         (WebCore::WebKitNamedFlow::~WebKitNamedFlow):
3931         (WebCore::WebKitNamedFlow::create):
3932         (WebCore):
3933         (WebCore::WebKitNamedFlow::name):
3934         (WebCore::WebKitNamedFlow::overset):
3935         (WebCore::nodeInFlowThread):
3936         (WebCore::WebKitNamedFlow::getRegionsByContentNode):
3937         (WebCore::WebKitNamedFlow::getContent):
3938         (WebCore::WebKitNamedFlow::setRenderer):
3939         * dom/WebKitNamedFlow.h:
3940         (WebCore):
3941         (WebKitNamedFlow):
3942         (WebCore::WebKitNamedFlow::getFlowState):
3943         (WebCore::WebKitNamedFlow::switchFlowState):
3944         * dom/WebKitNamedFlowCollection.cpp: Added.
3945         (WebCore):
3946         (WebCore::WebKitNamedFlowCollection::WebKitNamedFlowCollection):
3947         (WebCore::WebKitNamedFlowCollection::length): An O(1) operation
3948         (WebCore::WebKitNamedFlowCollection::item): An O(N) operation
3949         (WebCore::WebKitNamedFlowCollection::flowByName): An O(1) operation
3950         (WebCore::WebKitNamedFlowCollection::ensureNamedFlowInCreatedState): An O(1) operation
3951         (WebCore::WebKitNamedFlowCollection::moveNamedFlowToNullState): An O(1) operation
3952         (WebCore::WebKitNamedFlowCollection::discardNamedFlow): An O(1) operation
3953         (WebCore::WebKitNamedFlowCollection::documentDestroyed):
3954         (WebCore::WebKitNamedFlowCollection::NamedFlowHashFunctions::hash):
3955         (WebCore::WebKitNamedFlowCollection::NamedFlowHashFunctions::equal):
3956         (WebKitNamedFlowCollection::NamedFlowHashFunctions):
3957         (WebCore::WebKitNamedFlowCollection::NamedFlowHashTranslator::hash):
3958         (WebCore::WebKitNamedFlowCollection::NamedFlowHashTranslator::equal):
3959         * dom/WebKitNamedFlowCollection.h: Copied from Source/WebCore/dom/WebKitNamedFlow.h.
3960         (WebCore):
3961         (WebKitNamedFlowCollection):
3962         (WebCore::WebKitNamedFlowCollection::create):
3963         (WebCore::WebKitNamedFlowCollection::document):
3964         * rendering/FlowThreadController.cpp:
3965         (WebCore::FlowThreadController::ensureRenderFlowThreadWithName):
3966         (WebCore::FlowThreadController::removeFlowThread):
3967         (WebCore):
3968         * rendering/FlowThreadController.h:
3969         (FlowThreadController):
3970         * rendering/RenderNamedFlowThread.cpp:
3971         (WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
3972         (WebCore):
3973         (WebCore::RenderNamedFlowThread::~RenderNamedFlowThread):
3974         (WebCore::RenderNamedFlowThread::removeRegionFromThread):
3975         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentNode):
3976         (WebCore::RenderNamedFlowThread::flowThreadName):
3977         (WebCore::RenderNamedFlowThread::willBeDestroyed):
3978         * rendering/RenderNamedFlowThread.h:
3979         (RenderNamedFlowThread):
3980         (WebCore::RenderNamedFlowThread::contentNodes):
3981         (WebCore::RenderNamedFlowThread::canBeDestroyed):
3982
3983 2012-07-13  Vineet Chaudhary  <rgf748@motorola.com>
3984
3985         [V8Bindings] Implement generalised method to validates that the passed object is a sequence type.
3986         https://bugs.webkit.org/show_bug.cgi?id=91056
3987
3988         Reviewed by Kentaro Hara.
3989
3990         Currently the V8 implementation validates that the passed object is a sequence type only
3991         for MessagePort in V8Utilities::extractTransferables().