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