a49faa1d84f123519d3d5c6f9d1b37bd4d7acdc5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-02-15  Rik Cabanier  <cabanier@adobe.com>
2
3         Add platform support for -webkit-background-blend-mode to CG context
4         https://bugs.webkit.org/show_bug.cgi?id=108549
5
6         Reviewed by Dean Jackson.
7
8         Tests: css3/compositing/effect-background-blend-mode-stacking.html
9                css3/compositing/effect-background-blend-mode.html
10
11         This patch adds support for blending on background images to the Core Graphics port of WebKit.
12
13         * platform/graphics/CrossfadeGeneratedImage.cpp: Added interface change for blending.
14         (WebCore::CrossfadeGeneratedImage::drawPattern):
15         * platform/graphics/CrossfadeGeneratedImage.h: Added interface change for blending.
16         (CrossfadeGeneratedImage):
17         * platform/graphics/GeneratedImage.h: Added interface change for blending.
18         (GeneratedImage):
19         * platform/graphics/GeneratorGeneratedImage.cpp: Added interface change for blending.
20         (WebCore::GeneratorGeneratedImage::drawPattern):
21         * platform/graphics/GeneratorGeneratedImage.h: Added interface change for blending.
22         (GeneratorGeneratedImage):
23         * platform/graphics/GraphicsContext.cpp: Added interface change for blending and passes blend mode to image object.
24         (WebCore::GraphicsContext::drawTiledImage):
25         (WebCore::GraphicsContext::blendModeOperation):
26         (WebCore):
27         * platform/graphics/GraphicsContext.h: Added interface change for blending.
28         (GraphicsContext):
29         * platform/graphics/Image.cpp: Added interface change for blending and passed it to graphics layer.
30         (WebCore::Image::drawTiled):
31         * platform/graphics/Image.h: Added interface change for blending.
32         (Image):
33         * platform/graphics/cg/ImageCG.cpp: Added interface change for blending and passed it to OS.
34         (WebCore::Image::drawPattern):
35         * rendering/RenderBoxModelObject.cpp: Passed blend mode when drawing background images.
36         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
37         * platform/graphics/cairo/ImageCairo.cpp: Added interface change for blending.
38         (WebCore::Image::drawPattern):
39         * platform/graphics/qt/ImageQt.cpp: Added interface change for blending.
40         (WebCore::Image::drawPattern):
41         * platform/graphics/skia/ImageSkia.cpp: Added interface change for blending.
42         (WebCore::Image::drawPattern):
43         * rendering/RenderBoxModelObject.cpp: Added interface change for blending.
44         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
45         * svg/graphics/SVGImageForContainer.cpp: Added interface change for blending.
46         (WebCore::SVGImageForContainer::drawPattern):
47         * svg/graphics/SVGImageForContainer.h: Added interface change for blending.
48
49 2013-02-14  Emil A Eklund  <eae@chromium.org>
50
51         Clamp span value in RenderTableCell::parse[Col|Row]SpanFromDOM
52         https://bugs.webkit.org/show_bug.cgi?id=109878
53
54         Reviewed by Abhishek Arya.
55
56         Test: fast/table/colspan-huge-number.html
57         
58         Clamp colspan and rowspan values to their respective maximum
59         supported values.
60
61         * rendering/RenderTableCell.cpp:
62         (WebCore::RenderTableCell::parseColSpanFromDOM):
63         (WebCore::RenderTableCell::parseRowSpanFromDOM):
64
65 2013-02-15  Andreas Kling  <akling@apple.com>
66
67         ShareableElementData should use zero-length array for storage.
68         <http://webkit.org/b/109959>
69
70         Reviewed by Anders Carlsson.
71
72         Use a zero-length Attribute array instead of always casting from void* to an array.
73         It was done this way originally because I didn't know we could sidestep the MSVC
74         build error with some #pragma hackery.
75
76         * dom/DocumentSharedObjectPool.cpp:
77         (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
78         * dom/Element.cpp:
79         (WebCore::sizeForShareableElementDataWithAttributeCount):
80         (WebCore::ShareableElementData::ShareableElementData):
81         (WebCore::ShareableElementData::~ShareableElementData):
82         (WebCore::UniqueElementData::UniqueElementData):
83         * dom/Element.h:
84         (ShareableElementData):
85         (WebCore::ElementData::attributeItem):
86
87 2013-02-14  Ojan Vafai  <ojan@chromium.org>
88
89         Implement RenderGrid::computeIntrinsicLogicalWidths
90         https://bugs.webkit.org/show_bug.cgi?id=109881
91
92         Reviewed by Tony Chang.
93
94         For now this is not observable due to the FIXMEs for unimplemented bits
95         of computePreferredLogicalWidths. But, soon, I'll be removing the computePreferredLogicalWidths
96         override entirely and instead use RenderBlock's, which will also address the
97         RenderGrid FIXMEs.
98
99         * rendering/RenderGrid.cpp:
100         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
101         const_cast the usages of m_grid. Alternately, we could stack allocate it, but there's disagreement on
102         whether that's the right choice. See https://bugs.webkit.org/show_bug.cgi?id=109880.
103
104         (WebCore::RenderGrid::computePreferredLogicalWidths):
105         * rendering/RenderGrid.h:
106
107
108 2013-02-15  Xueqing Huang  <huangxueqing@baidu.com>
109
110         Flexbox should ignore firstLine pseudo element.
111         https://bugs.webkit.org/show_bug.cgi?id=104485
112
113         Reviewed by Tony Chang.
114
115         Spec[1] said that "None of the properties defined in this module
116         apply to '::first-line' or '::first-letter' pseudo-elements." and
117         css2[2] define "The :first-line pseudo-element can only be attached
118         to a block container element." 
119         [1]http://dev.w3.org/csswg/css3-flexbox/#display-flex
120         [2]http://www.w3.org/TR/CSS2/selector.html#first-line-pseudo
121
122         tests:
123         css3/flexbox/flexbox-ignore-firstLine.html
124         css3/flexbox/flexitem-firstLine-valid.html
125         css3/flexbox/inline-flexbox-ignore-firstLine.html 
126
127         * rendering/RenderBlock.cpp:
128         (WebCore::RenderBlock::firstLineBlock):
129
130 2013-02-15  Alec Flett  <alecflett@chromium.org>
131
132         IndexedDB: Implement SharedBuffer version of put()
133         https://bugs.webkit.org/show_bug.cgi?id=109092
134
135         Reviewed by Adam Barth.
136
137         Switch IDBDatabaseBackendInterface::put over
138         to SharedBuffer, to avoid buffer copies of the value.
139
140         No new tests, this is a refactor.
141
142         * Modules/indexeddb/IDBBackingStore.cpp:
143         (WebCore::IDBBackingStore::putRecord):
144         * Modules/indexeddb/IDBBackingStore.h:
145         (WebCore):
146         (IDBBackingStore):
147         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
148         (WebCore::PutOperation::create):
149         (WebCore::PutOperation::PutOperation):
150         (PutOperation):
151         (WebCore::IDBDatabaseBackendImpl::put):
152         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
153         (IDBDatabaseBackendImpl):
154         * Modules/indexeddb/IDBDatabaseBackendInterface.h:
155         (WebCore):
156         * Modules/indexeddb/IDBObjectStore.cpp:
157         (WebCore::IDBObjectStore::put):
158
159 2013-02-15  Anders Carlsson  <andersca@apple.com>
160
161         Implement StorageAreaProxy::length
162         https://bugs.webkit.org/show_bug.cgi?id=109962
163
164         Reviewed by Andreas Kling.
165
166         Export a symbol needed by WebKit2.
167
168         * WebCore.exp.in:
169
170 2013-02-15  Anders Carlsson  <andersca@apple.com>
171
172         Remove const from a bunch of StorageArea member functions
173         https://bugs.webkit.org/show_bug.cgi?id=109957
174
175         Reviewed by Beth Dakin.
176
177         StorageArea is an abstract base class, and its subclasses might want to mutate the object
178         when certain member functions are called so remove const from all member functions.
179
180         * storage/StorageArea.h:
181         (WebCore):
182         (StorageArea):
183         (WebCore::StorageArea::~StorageArea):
184         (WebCore::StorageArea::incrementAccessCount):
185         (WebCore::StorageArea::decrementAccessCount):
186         (WebCore::StorageArea::closeDatabaseIfIdle):
187         * storage/StorageAreaImpl.cpp:
188         (WebCore::StorageAreaImpl::canAccessStorage):
189         (WebCore::StorageAreaImpl::length):
190         (WebCore::StorageAreaImpl::key):
191         (WebCore::StorageAreaImpl::getItem):
192         (WebCore::StorageAreaImpl::contains):
193         (WebCore::StorageAreaImpl::memoryBytesUsedByCache):
194         * storage/StorageAreaImpl.h:
195         (StorageAreaImpl):
196
197 2013-02-13  Ryosuke Niwa  <rniwa@webkit.org>
198
199         DeleteButtonController::enable and disable should be called via a RAII object
200         https://bugs.webkit.org/show_bug.cgi?id=109550
201
202         Reviewed by Enrica Casucci.
203
204         Added DeleteButtonControllerDisableScope, a friend class of DeleteButtonController,
205         and made DeleteButtonController::enable/disable private.
206
207         * dom/ContainerNode.cpp:
208         * editing/CompositeEditCommand.cpp:
209         (WebCore::EditCommandComposition::unapply):
210         (WebCore::EditCommandComposition::reapply):
211         (WebCore::CompositeEditCommand::apply):
212         * editing/DeleteButtonController.h:
213         (WebCore):
214         (DeleteButtonController):
215         (DeleteButtonControllerDisableScope):
216         (WebCore::DeleteButtonControllerDisableScope::DeleteButtonControllerDisableScope):
217         (WebCore::DeleteButtonControllerDisableScope::~DeleteButtonControllerDisableScope):
218         * editing/markup.cpp:
219         (WebCore::createMarkup):
220         (WebCore::createFragmentFromNodes):
221
222 2013-02-15  Max Vujovic  <mvujovic@adobe.com>
223
224         Add code from other branch.
225
226         [CSS Shaders] Parse src property in @-webkit-filter at-rules
227         https://bugs.webkit.org/show_bug.cgi?id=109770
228
229         Reviewed by Dean Jackson.
230
231         This patch implements the parsing for the CSS src property in @-webkit-filter at-rules.
232
233         The Filter Effects spec [1] specifies its syntax:
234             src: [ <uri> [format(<string>)]?]#
235
236         In practice, it can look like:
237             src: url(shader.vs) format('x-shader/x-vertex'),
238                  url(shader.fs) format('x-shader/x-fragment');
239
240         This src property is similar to the src property in CSS font-face rules, but a little
241         different. The CSS Fonts spec [2] specifies:
242             src: [ <uri> [format(<string>#)]? | <font-face-name> ]#
243             The syntax for a <font-face-name> is a unique font face name enclosed by "local("
244             and ")".
245
246         Unlike the filter src property, the font face src property accepts the local function
247         [e.g. src: local("SomeFont");]. Also, the font face src property accepts a list of strings
248         instead of just one string in its format function.
249
250         [1]: https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#custom-filter-src
251         [2]: http://www.w3.org/TR/css3-fonts/#src-desc
252
253         Tests: css3/filters/custom-with-at-rule-syntax/parsing-src-property-invalid.html
254                css3/filters/custom-with-at-rule-syntax/parsing-src-property-valid.html
255
256         * css/CSSGrammar.y.in:
257             Set (and unset) a flag called "m_inFilterRule", which tells us if we are in a
258             @-webkit-filter at-rule or in a @font-face at-rule when we encounter a src property.
259             We parse the two variants of the src property separately so that we can create different
260             objects (WebKitCSSShaderValue vs. CSSFontFaceSrcValue) and because their syntax is a
261             little different.
262         * css/CSSParser.cpp:
263         (WebCore::CSSParser::CSSParser):
264         (WebCore::CSSParser::parseValue):
265         (WebCore::CSSParser::parseFilterRuleSrcUriAndFormat):
266             Parses a URI and format pair found in the @-webkit-filter src property.
267         (WebCore::CSSParser::parseFilterRuleSrc):
268             Parse the @-webkit-filter src property.
269         * css/CSSParser.h:
270         (CSSParser):
271         * css/WebKitCSSShaderValue.cpp:
272         (WebCore::WebKitCSSShaderValue::customCssText):
273             WebKitCSSShaderValue now has an m_format member, which needs to be included in its
274             cssText.
275         (WebCore::WebKitCSSShaderValue::reportDescendantMemoryUsage):
276         * css/WebKitCSSShaderValue.h:
277         (WebCore::WebKitCSSShaderValue::format):
278         (WebCore::WebKitCSSShaderValue::setFormat):
279         (WebKitCSSShaderValue):
280
281 2013-02-15  Eric Carlson  <eric.carlson@apple.com>
282
283         Crash occurs at WebCore::TextTrackList::length() when enabling closed captions in movie
284         https://bugs.webkit.org/show_bug.cgi?id=109886
285
286         Reviewed by Dean Jackson.
287
288         No new tests, media/media-captions.html does not crash with this change.
289
290         * html/HTMLMediaElement.cpp:
291         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Early return when
292             m_textTracks is NULL.
293
294 2013-02-15  Adam Barth  <abarth@webkit.org>
295
296         TokenPreloadScanner should be able to scan CompactHTMLTokens
297         https://bugs.webkit.org/show_bug.cgi?id=109861
298
299         Reviewed by Eric Seidel.
300
301         This patch moves the main scanning logic for the TokenPreloadScanner to
302         a templated scanCommon routine that can scan either an HTMLToken or a
303         CompactHTMLToken. This patch will let the BackgroundHTMLParser preload
304         scan its CompactHTMLTokens.
305
306         * html/parser/CSSPreloadScanner.cpp:
307         (WebCore):
308         (WebCore::CSSPreloadScanner::scanCommon):
309         (WebCore::CSSPreloadScanner::scan):
310         * html/parser/CSSPreloadScanner.h:
311         (CSSPreloadScanner):
312             - Tweak the CSSPreloadScanner API slightly to make it easier to
313               call from templated code.
314         * html/parser/HTMLPreloadScanner.cpp:
315         (WebCore::TokenPreloadScanner::tagIdFor):
316         (WebCore):
317         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
318         (TokenPreloadScanner::StartTagScanner):
319         (WebCore::TokenPreloadScanner::scan):
320         (WebCore::TokenPreloadScanner::scanCommon):
321         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
322         (WebCore::HTMLPreloadScanner::scan):
323         * html/parser/HTMLPreloadScanner.h:
324         (TokenPreloadScanner):
325
326 2013-02-15  Alexis Menard  <alexis@webkit.org>
327
328         WebKit shouldn't accept "none, none" in transition shorthand property.
329         https://bugs.webkit.org/show_bug.cgi?id=108751
330
331         Reviewed by Dean Jackson.
332
333         http://dev.w3.org/csswg/css3-transitions/#transition-shorthand-property
334         specifies that if there is more than one transition defined in the
335         shorthand and any of them has a value of 'none' then the declaration is
336         invalid. This patch fixes the problem by passing a parsing context to
337         track if a keyword has been set for the transition-property and if so
338         then use it to invalidate or not the declaration.
339
340         Test: transitions/transitions-parsing.html
341
342         * css/CSSParser.cpp:
343         (AnimationParseContext):
344         (WebCore::AnimationParseContext::AnimationParseContext):
345         (WebCore::AnimationParseContext::commitFirstAnimation): track whether
346         it's the first <single-transition/animation> or not defined in the
347         shorthand.
348         (WebCore::AnimationParseContext::hasCommittedFirstAnimation):
349         (WebCore::AnimationParseContext::commitAnimationPropertyKeywordInShorthand):
350         In the shorthand as soon as a keyword has been found then the parsing
351         is 'finished', if any other animation/transition declaration part of
352         the shorthand are with a keyword then it's invalid.
353         (WebCore::AnimationParseContext::animationPropertyKeywordInShorthandAllowed):
354         (WebCore::AnimationParseContext::hasSeenAnimationPropertyKeyword):
355         (WebCore::AnimationParseContext::sawAnimationPropertyKeyword):
356         (WebCore):
357         (WebCore::CSSParser::parseValue):
358         (WebCore::CSSParser::parseAnimationShorthand):
359         (WebCore::CSSParser::parseTransitionShorthand):
360         (WebCore::CSSParser::parseAnimationProperty):
361         * css/CSSParser.h:
362         (WebCore):
363
364 2013-02-15  Andreas Kling  <akling@apple.com>
365
366         ElementData: Move leafy things out of the base class.
367         <http://webkit.org/b/109888>
368
369         Reviewed by Antti Koivisto.
370
371         - Moved functions for mutating/adding/removing attributes into UniqueElementData.
372           Attempts to modify shared element data will now fail at compile-time.
373
374         - Removed mutableAttributeVector() and have call sites access the vector directly.
375
376         - Move immutableAttributeArray() to ShareableElementData.
377
378         - Move some function bodies from Element.h to Element.cpp since all clients are in there.
379
380         * dom/Element.cpp:
381         (WebCore::Element::addAttributeInternal):
382         (WebCore::ShareableElementData::ShareableElementData):
383         (WebCore::UniqueElementData::makeShareableCopy):
384         (WebCore::UniqueElementData::addAttribute):
385         (WebCore::UniqueElementData::removeAttribute):
386         (WebCore::ElementData::reportMemoryUsage):
387         (WebCore::UniqueElementData::getAttributeItem):
388         (WebCore::UniqueElementData::attributeItem):
389         * dom/Element.h:
390         (ElementData):
391         (WebCore::ShareableElementData::immutableAttributeArray):
392         (ShareableElementData):
393         (UniqueElementData):
394         (WebCore::ElementData::length):
395         (WebCore::ElementData::attributeItem):
396
397 2013-02-15  Hans Muller  <hmuller@adobe.com>
398
399         [CSS Exclusions] Enable shape-inside support for circles
400         https://bugs.webkit.org/show_bug.cgi?id=109713
401
402         Reviewed by Dirk Schulze.
403
404         Removed the test that disabled circle values for shape-inside.
405         The remaining support for circles, which is based on rounded rectangles
406         whose width/height is equal to their radiusX/radiusY, has not changed.
407
408         Test: fast/exclusions/shape-inside/shape-inside-circle.html
409
410         * rendering/ExclusionShapeInsideInfo.h:
411         (WebCore::ExclusionShapeInsideInfo::isEnabledFor): Now only disallows ellipse.
412
413 2013-02-15  Christophe Dumez  <ch.dumez@sisa.samsung.com>
414
415         [Soup] Leverage new soup_cookie_jar_get_cookie_list() API
416         https://bugs.webkit.org/show_bug.cgi?id=109931
417
418         Reviewed by Kenneth Rohde Christiansen.
419
420         In several cases, the CookieJarSoup implementation was retrieving / copying ALL the
421         cookies using soup_cookie_jar_all_cookies() and then using soup_cookie_applies_to_uri()
422         to filter out cookies it is not interested in. This was inefficient.
423
424         In libsoup 2.40, soup_cookie_jar_get_cookie_list() was introduced to retrieve only the
425         cookies that apply to a given URI. This patch leverages this new API in CookieJarSoup's
426         getRawCookies() and deleteCookie(). This way, only the cookies we are interested in
427         are retrieved and copied. Libsoup does not need to iterate over all the cookies itself
428         because it keeps the cookies in a hash table using the host names as key.
429
430         No new tests, no behavior change.
431
432         * platform/network/soup/CookieJarSoup.cpp:
433         (WebCore::getRawCookies):
434         (WebCore::deleteCookie):
435
436 2013-02-15  Vladislav Kaznacheev  <kaznacheev@chromium.org>
437
438         Web Inspector: Added an option to split Elements and Sources sidebars in two panes.
439         https://bugs.webkit.org/show_bug.cgi?id=109298.
440
441         Reviewed by Vsevolod Vlasov.
442
443         Introduced the "Split sidebar" context menu option that splits the horizontal sidebar into two panes.
444         The width split ratio is 1:1 by default and is preserved when the Inspector window is resized.
445         Elements sidebar is split into two tabbed panes, Sources sidebar is split into a pane stack and a tabbed pane.
446
447         No new tests.
448
449         * inspector/front-end/DOMBreakpointsSidebarPane.js:
450         (WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype._reattachBody):
451         * inspector/front-end/ElementsPanel.js:
452         (WebInspector.ElementsPanel.get this):
453         (WebInspector.ElementsPanel):
454         (WebInspector.ElementsPanel.prototype._sidebarContextMenuEventFired):
455         (WebInspector.ElementsPanel.prototype._populateContextMenuForSidebar.toggleSetting):
456         (WebInspector.ElementsPanel.prototype.get _arrangeSidebarPanes.get this):
457         (WebInspector.ElementsPanel.prototype.addExtensionSidebarPane):
458         * inspector/front-end/ExtensionServer.js:
459         (WebInspector.ExtensionServer.prototype._onCreateSidebarPane):
460         * inspector/front-end/ScriptsPanel.js:
461         (WebInspector.ScriptsPanel):
462         (WebInspector.ScriptsPanel.prototype._appendUISourceCodeItems):
463         (WebInspector.ScriptsPanel.prototype._contextMenuEventFired):
464         (WebInspector.ScriptsPanel.prototype._sidebarContextMenuEventFired):
465         (WebInspector.ScriptsPanel.prototype._populateContextMenuForSidebar.toggleSetting):
466         (WebInspector.ScriptsPanel.prototype.get _arrangeSidebarPanes.get this):
467         * inspector/front-end/SidebarPane.js:
468         (WebInspector.SidebarPane):
469         (WebInspector.SidebarPane.prototype.expand):
470         (WebInspector.SidebarPane.prototype.onContentReady):
471         (WebInspector.SidebarPane.prototype._setExpandCallback):
472         (WebInspector.SidebarPane.prototype.wasShown):
473         (WebInspector.SidebarPaneTitle):
474         (WebInspector.SidebarPaneTitle.prototype._expand):
475         (WebInspector.SidebarPaneTitle.prototype._collapse):
476         (WebInspector.SidebarPaneTitle.prototype._toggleExpanded):
477         (WebInspector.SidebarPaneTitle.prototype._onTitleKeyDown):
478         (WebInspector.SidebarPaneStack):
479         (WebInspector.SidebarPaneStack.prototype.addPane):
480         (WebInspector.SidebarTabbedPane):
481         (WebInspector.SidebarTabbedPane.prototype.addPane):
482         * inspector/front-end/SidebarView.js:
483         * inspector/front-end/SplitView.js:
484         (WebInspector.SplitView):
485         (WebInspector.SplitView.prototype.get mainElement):
486         (WebInspector.SplitView.prototype.get sidebarElement):
487
488 2013-02-15  Vsevolod Vlasov  <vsevik@chromium.org>
489
490         Web Inspector: Several consecutive Backspace or Delete strikes should not be marked as undoable state.
491         https://bugs.webkit.org/show_bug.cgi?id=109915
492
493         Reviewed by Pavel Feldman.
494
495         Extracted _isEditRangeUndoBoundary() and _isEditRangeAdjacentToLastCommand() in TextEditorModel
496         to detect if markUndoableState() call is needed before and after editRange.
497
498         * inspector/front-end/TextEditorModel.js:
499         (WebInspector.TextRange.prototype.immediatelyPrecedes):
500         (WebInspector.TextRange.prototype.immediatelyFollows):
501         (WebInspector.TextEditorModel.endsWithBracketRegex.):
502
503 2013-02-15  Andrey Adaikin  <aandrey@chromium.org>
504
505         Fix inconsistency in WebGLRenderingContext.idl for getAttribLocation
506         https://bugs.webkit.org/show_bug.cgi?id=109892
507
508         Reviewed by Kentaro Hara.
509
510         * html/canvas/WebGLRenderingContext.idl:
511
512 2013-02-15  Andrey Adaikin  <aandrey@chromium.org>
513
514         Web Inspector: [Canvas] show replay log grouped by draw calls
515         https://bugs.webkit.org/show_bug.cgi?id=109592
516
517         Reviewed by Pavel Feldman.
518
519         Show canvas capturing log grouped by drawing calls.
520         Drive-by: extended Array.prototype with a handy peekLast function.
521         Drive-by: removed code dups in few places.
522
523         * inspector/front-end/CanvasProfileView.js:
524         (WebInspector.CanvasProfileView):
525         (WebInspector.CanvasProfileView.prototype.dispose):
526         (WebInspector.CanvasProfileView.prototype._onReplayStepClick):
527         (WebInspector.CanvasProfileView.prototype._onReplayDrawingCallClick):
528         (WebInspector.CanvasProfileView.prototype._onReplayLastStepClick):
529         (WebInspector.CanvasProfileView.prototype._replayTraceLog.didReplayTraceLog):
530         (WebInspector.CanvasProfileView.prototype._replayTraceLog):
531         (WebInspector.CanvasProfileView.prototype._didReceiveTraceLog):
532         (WebInspector.CanvasProfileView.prototype._selectedCallIndex):
533         (WebInspector.CanvasProfileView.prototype._selectedDrawCallGroupIndex):
534         (WebInspector.CanvasProfileView.prototype._appendCallNode):
535         * inspector/front-end/DataGrid.js:
536         (WebInspector.DataGrid.prototype.setColumnVisible):
537         (WebInspector.DataGridNode.prototype.set hasChildren):
538         (WebInspector.DataGridNode.prototype.set revealed):
539         (WebInspector.DataGridNode.prototype.get leftPadding):
540         * inspector/front-end/externs.js:
541         (Array.prototype.peekLast):
542         * inspector/front-end/utilities.js:
543
544 2013-02-15  Yury Semikhatsky  <yurys@chromium.org>
545
546         Web Inspector: highlight record revealed in Timeline
547         https://bugs.webkit.org/show_bug.cgi?id=109930
548
549         Reviewed by Pavel Feldman.
550
551         Revealed timeline record is now highlighted with yellow background
552         that fades out in 2 seconds.
553
554         * inspector/front-end/TimelinePanel.js:
555         (WebInspector.TimelinePanel.prototype._revealRecord):
556         (WebInspector.TimelinePanel.prototype._refreshRecords):
557         (WebInspector.TimelinePanel.prototype._clearRecordHighlight):
558         * inspector/front-end/timelinePanel.css:
559         (.highlighted-timeline-record):
560         (@-webkit-keyframes timeline_record_highlight):
561         (to):
562
563 2013-02-15  Vsevolod Vlasov  <vsevik@chromium.org>
564
565         Web Inspector: Pass original selection to textModel to correctly restore it after undo.
566         https://bugs.webkit.org/show_bug.cgi?id=109911
567
568         Reviewed by Pavel Feldman.
569
570         We can distinguish backspace pressed with and without selection now.
571
572         * inspector/front-end/DefaultTextEditor.js:
573         (WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
574         (WebInspector.DefaultTextEditor.WordMovementController.prototype._handleCtrlBackspace):
575         * inspector/front-end/TextEditorModel.js:
576         (WebInspector.TextEditorCommand):
577         (WebInspector.TextEditorModel.endsWithBracketRegex.):
578
579 2013-02-15  Joe Mason  <jmason@rim.com>
580
581         [BlackBerry] Remove redundant requireAuth parameter of NetworkJob::notifyAuthReceived
582         https://bugs.webkit.org/show_bug.cgi?id=109855
583
584         Reviewed by Yong Li.
585
586         Internal PR: 296697
587         Internally Reviewed By: Leo Yang
588
589         Code cleanup: The requireAuth parameter of NetworkJob::notifyAuthReceived is redundant as its value
590         can be determined from "result" - if result is AuthResultRetry, requireAuth is false, otherwise it
591         is true.
592
593         No new tests as there is no behaviour change.
594
595         * platform/network/blackberry/NetworkJob.cpp:
596         (WebCore::NetworkJob::notifyAuthReceived):
597         * platform/network/blackberry/NetworkJob.h:
598         (NetworkJob):
599
600 2013-02-15  Vsevolod Vlasov  <vsevik@chromium.org>
601
602         Web Inspector: Redo in text editor should always collapse selection to end.
603         https://bugs.webkit.org/show_bug.cgi?id=109907
604
605         Reviewed by Pavel Feldman.
606
607         * inspector/front-end/TextEditorModel.js:
608         (WebInspector.TextEditorModel.endsWithBracketRegex.):
609
610 2013-02-15  Dan Carney  <dcarney@google.com>
611
612         [v8] persistent handle dispose before last use
613         https://bugs.webkit.org/show_bug.cgi?id=109927
614
615         Reviewed by Jochen Eisinger.
616
617         No new tests. No change in functionality.
618
619         * bindings/v8/ScriptWrappable.h:
620         (WebCore::ScriptWrappable::weakCallback):
621
622 2013-02-15  Keishi Hattori  <keishi@webkit.org>
623
624         PagePopupController.formatMonth should support short month format
625         https://bugs.webkit.org/show_bug.cgi?id=109530
626
627         Reviewed by Kent Tamura.
628
629         PagePopupController.formatMonth should support short month format so we
630         can use it in the new calendar picker.
631
632         Tested by LocaleMacTest::formatMonth.
633
634         * page/PagePopupController.cpp:
635         (WebCore::PagePopupController::formatMonth): Take an extra bool argument to switch to short month format.
636         * page/PagePopupController.h:
637         (PagePopupController):
638         * page/PagePopupController.idl:
639         * platform/text/LocaleICU.cpp:
640         (WebCore::LocaleICU::shortMonthFormat):
641         (WebCore):
642         * platform/text/LocaleICU.h:
643         (LocaleICU):
644         * platform/text/LocaleNone.cpp:
645         (WebCore::shortMonthFormat):
646         (WebCore):
647         * platform/text/PlatformLocale.cpp:
648         (WebCore::DateTimeStringBuilder::visitField):
649         (WebCore::Locale::formatDateTime):
650         * platform/text/PlatformLocale.h:
651         (Locale):
652         * platform/text/mac/LocaleMac.h:
653         (LocaleMac):
654         * platform/text/mac/LocaleMac.mm:
655         (WebCore::LocaleMac::shortMonthFormat):
656         (WebCore):
657         * platform/text/win/LocaleWin.cpp:
658         (WebCore::LocaleWin::shortMonthFormat): Windows doesn't have a short
659         month format so we just replace MMMM with MMM.
660         (WebCore):
661         * platform/text/win/LocaleWin.h:
662         (LocaleWin):
663
664 2013-02-15  Keishi Hattori  <keishi@webkit.org>
665
666         Add setValue and closePopup methods to PagePopupController
667         https://bugs.webkit.org/show_bug.cgi?id=109897
668
669         Reviewed by Kent Tamura.
670
671         The new calendar picker (Bug 109439) needs to set a value without
672         closing the popup. We can't do that with the existing
673         setValueAndClosePopup.
674
675         No new tests. Existing calendar picker and color suggestion picker tests
676         that closing and setting values work properly.
677
678         * Resources/pagepopups/pickerCommon.js:
679         (Picker.prototype.submitValue): Stop using setValueAndClosePopup.
680         (Picker.prototype.handleCancel): Ditto.
681         * page/PagePopupClient.h:
682         (PagePopupClient):
683         * page/PagePopupController.cpp:
684         (WebCore::PagePopupController::setValue): Sets value to element without closing popup.
685         (WebCore):
686         (WebCore::PagePopupController::closePopup): Just closes popup.
687         * page/PagePopupController.h:
688         (PagePopupController):
689         * page/PagePopupController.idl:
690
691 2013-02-15  Mihnea Ovidenie  <mihnea@adobe.com>
692
693         [CSS Regions] RenderRegion should inherit from RenderBlock
694         https://bugs.webkit.org/show_bug.cgi?id=74132
695
696         Reviewed by Julien Chaffraix.
697
698         Change the base class for RenderRegion to be RenderBlock instead of RenderReplaced.
699         Per spec http://dev.w3.org/csswg/css3-regions/#the-flow-from-property, a region is a non-replaced block container.
700         This change is covered by the existing regions tests (in fast/region and fast/repaint).
701
702         The RenderFlowThread object is a self-painting layer (it requires layer and is positioned).
703         Because of that, the RenderFlowThread object is responsible for painting its children,
704         the collected objects. When the RenderRegion::paintObject is called during paint, it delegates painting
705         of content collected inside the flow thread to the associated RenderFlowThread object.
706         Since we do not want to paint the flow thread content multiple times (for each paint phase
707         in which the RenderRegion::paintObject is called), we allow RenderFlowThread painting only for
708         selection and foreground paint phases.
709
710         * rendering/RenderBox.cpp: Clean-up the code from regions specific stuff, now that the regions are render blocks.
711         (WebCore::RenderBox::computePositionedLogicalWidth):
712         (WebCore::RenderBox::computePositionedLogicalHeight):
713         * rendering/RenderLayerBacking.cpp: A region should always render content from its associated flow thread,
714         even when it does not have children of its own.
715         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
716         * rendering/RenderMultiColumnSet.cpp: Make changes to match the new inheritance for RenderRegion.
717         (WebCore::RenderMultiColumnSet::paint):
718         (WebCore::RenderMultiColumnSet::paintColumnRules):
719         * rendering/RenderMultiColumnSet.h:
720         * rendering/RenderRegion.cpp:
721         (WebCore::RenderRegion::RenderRegion):
722         (WebCore::RenderRegion::paintObject):
723         (WebCore::RenderRegion::styleDidChange):
724         (WebCore::RenderRegion::layoutBlock):
725         (WebCore::RenderRegion::insertedIntoTree):
726         (WebCore::RenderRegion::willBeRemovedFromTree):
727         (WebCore::RenderRegion::computePreferredLogicalWidths): Use this method instead of min/maxPreferredLogicalWidth.
728         (WebCore::RenderRegion::updateLogicalHeight):
729         * rendering/RenderRegion.h: For now, assume the region is not allowed to have children.
730         When we will implement the processing model for pseudo-elements http://dev.w3.org/csswg/css3-regions/#processing-model,
731         we will have to remove this function. By having this function return false i was able to leave some tests unchanged.
732
733 2013-02-15  Andrey Lushnikov  <lushnikov@chromium.org>
734
735         Web Inspector: implement smart braces functionality
736         https://bugs.webkit.org/show_bug.cgi?id=109200
737
738         Reviewed by Pavel Feldman.
739
740         - implement SmartBraceController which will handle character insertions
741         and override them if brace character was inserted. Additionally it
742         should handle Backspace key and override it if a cursor is located
743         inside of a bracket pair.
744         - guard smart brace functionality via experiment checkbox.
745
746         New test: inspector/editor/text-editor-smart-braces.html
747
748         * inspector/front-end/DefaultTextEditor.js:
749         (WebInspector.TextEditorMainPanel):
750         (WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
751         (WebInspector.TextEditorMainPanel.prototype._handleKeyPress):
752         (WebInspector.TextEditorMainPanel.SmartBraceController):
753         (WebInspector.TextEditorMainPanel.SmartBraceController.prototype.registerShortcuts):
754         (WebInspector.TextEditorMainPanel.SmartBraceController.prototype.registerCharOverrides):
755         (WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleBackspace):
756         (WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleBracePairInsertion):
757         (WebInspector.TextEditorMainPanel.SmartBraceController.prototype._handleClosingBraceOverride):
758         * inspector/front-end/Settings.js:
759         (WebInspector.ExperimentsSettings):
760
761 2013-02-15  Andrei Bucur  <abucur@adobe.com>
762
763         [CSS Regions][Mac] fast/regions/full-screen-video-from-region.html hits an assertion in RenderFlowThread::removeRenderBoxRegionInfo
764         https://bugs.webkit.org/show_bug.cgi?id=106075
765
766         Reviewed by Tony Chang.
767
768         The crash is caused by two issues.
769
770         The first problem is how a block inside a flow thread determines if the children needs relayout or not.
771         When the region chain is invalidated, the information is lost so we need to return true, even for the
772         enclosing RenderFlowThread. Because the video renderer is the first child of the flow thread this doesn't
773         happen.
774
775         The patch implements this behaviour by inspecting both if the region chain has changed and
776         if the block has no range computed yet.
777
778         The second problem is RenderMedia not inheriting from RenderBlock. The logic of child relayout doesn't apply
779         to it. In the test case, when the full screen button is pressed, the region changes width to fill the viewport,
780         the chain is invalidated and the box info hash map is cleared. When the video is laid out again (after fixing
781         the first issue) it has the same size so the controls don't do a layout. They remain without box info inside
782         the flow thread, thus causing the assertion.
783
784         The patch forces the controls to relayout if the region chain was invalidated. We can't use the
785         logicalWidthChangedInRegions method because it is block specific. This will be fixed in a later patch.
786
787         Tests: No new tests. fast/regions/full-screen-video-from-region.html no longer crashes.
788
789         * rendering/RenderBlock.cpp:
790         (WebCore::RenderBlock::checkForPaginationLogicalHeightChange):
791         * rendering/RenderFlowThread.cpp:
792         (WebCore::RenderFlowThread::RenderFlowThread):
793         (WebCore::RenderFlowThread::layout):
794         (WebCore::RenderFlowThread::logicalWidthChangedInRegions):
795         * rendering/RenderFlowThread.h: Renamed pageLogicalHeightChanged to pageLogicalSizeChanged.
796         * rendering/RenderMedia.cpp:
797         (WebCore::RenderMedia::layout):
798
799 2013-02-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
800
801         [CoordGfx] Regression from r135212: big layers with transform animations sometime fail to render tiles
802         https://bugs.webkit.org/show_bug.cgi?id=109179
803
804         Reviewed by Jocelyn Turcotte.
805
806         Fix adjustForContentsRect logic for AC layers that are higher or wider than the visible rect.
807
808         Force updates of the visible rect while it is animating, and until we have done one last update after
809         it stops animating.
810
811         Test: compositing/transitions/transform-on-large-layer.html
812
813         * platform/graphics/TiledBackingStore.cpp:
814         (WebCore::TiledBackingStore::adjustForContentsRect):
815         (WebCore::TiledBackingStore::computeCoverAndKeepRect):
816         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
817         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
818         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
819         (WebCore::CoordinatedGraphicsLayer::computePixelAlignment):
820         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
821         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
822         (CoordinatedGraphicsLayer):
823
824 2013-02-15  Sheriff Bot  <webkit.review.bot@gmail.com>
825
826         Unreviewed, rolling out r142876.
827         http://trac.webkit.org/changeset/142876
828         https://bugs.webkit.org/show_bug.cgi?id=109920
829
830         Broke relative URL linkification in the computed styles pane
831         (Requested by apavlov on #webkit).
832
833         * inspector/front-end/StylesSidebarPane.js:
834         (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules):
835
836 2013-02-15  Allan Sandfeld Jensen  <allan.jensen@digia.com>
837
838         Simplify hitTestResultAtPoint and nodesFromRect APIs
839         https://bugs.webkit.org/show_bug.cgi?id=95720
840
841         Reviewed by Julien Chaffraix.
842
843         The existing API was overloaded and could be simplified by passing all the bool arguments in 
844         a HitTestRequest argument. This should also help clarify the call as the enum values explicitely
845         state what they do.
846
847         * WebCore.exp.in:
848         * WebCore.order:
849         * dom/Document.cpp:
850         (WebCore::Document::nodesFromRect):
851         * dom/Document.h:
852         (Document):
853         * page/ContextMenuController.cpp:
854         (WebCore::ContextMenuController::createContextMenu):
855         * page/DragController.cpp:
856         (WebCore::DragController::canProcessDrag):
857         (WebCore::DragController::startDrag):
858         * page/EventHandler.cpp:
859         (WebCore::EventHandler::hitTestResultAtPoint):
860         (WebCore::EventHandler::handleMousePressEvent):
861         (WebCore::EventHandler::handleGestureEvent):
862         (WebCore::EventHandler::handleGestureForTextSelectionOrContextMenu):
863         (WebCore::EventHandler::bestClickableNodeForTouchPoint):
864         (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
865         (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
866         (WebCore::EventHandler::handleTouchEvent):
867         * page/EventHandler.h:
868         (WebCore):
869         (EventHandler):
870         * page/FocusController.cpp:
871         (WebCore::updateFocusCandidateIfNeeded):
872         * page/Frame.cpp:
873         (WebCore::Frame::visiblePositionForPoint):
874         (WebCore::Frame::documentAtPoint):
875         * page/TouchDisambiguation.cpp:
876         (WebCore::findGoodTouchTargets):
877         * rendering/HitTestRequest.h:
878         (WebCore::HitTestRequest::allowsFrameScrollbars):
879         * testing/Internals.cpp:
880         (WebCore::Internals::nodesFromRect):
881
882 2013-02-14  Pavel Feldman  <pfeldman@chromium.org>
883
884         Web Inspector: make component-based compile-front-end happy
885         https://bugs.webkit.org/show_bug.cgi?id=109798
886
887         Reviewed by Vsevolod Vlasov.
888
889         * inspector/Inspector.json:
890         * inspector/InspectorDebuggerAgent.cpp:
891         (WebCore::InspectorDebuggerAgent::setVariableValue):
892         * inspector/InspectorDebuggerAgent.h:
893         (InspectorDebuggerAgent):
894         * inspector/compile-front-end.py:
895         * inspector/front-end/AuditResultView.js:
896         * inspector/front-end/CPUProfileView.js:
897         * inspector/front-end/DataGrid.js:
898         * inspector/front-end/InspectorFrontendAPI.js:
899         (InspectorFrontendAPI.loadTimelineFromURL):
900
901 2013-02-14  Alexander Pavlov  <apavlov@chromium.org>
902
903         Web Inspector: Implement tracking of active stylesheets in the frontend
904         https://bugs.webkit.org/show_bug.cgi?id=105828
905
906         Reviewed by Pavel Feldman.
907
908         - This change introduces the CSS.styleSheetAdded() and CSS.styleSheetRemoved() events
909         that update the frontend with all active stylesheet changes in the inspected page.
910         As such, fetching stylesheet headers from the backend manually is no longer needed,
911         and many asynchronous methods have been turned into normal accessors.
912         - One notable change to the stylesheet binding process is that when a via-inspector stylesheet
913         is created, it is instantly reported through the instrumentation, and the viaInspectorStyleSheet() method
914         is [indirectly] called recursively from bindStyleSheet(). Thus, the actual creation and registration
915         of the respective InspectorStyleSheet have been moved into bindStyleSheet(),
916         which relies upon the m_creatingViaInspectorStyleSheet flag.
917
918         Test: inspector/styles/stylesheet-tracking.html
919
920         * dom/DocumentStyleSheetCollection.cpp:
921         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Instrumented.
922         * inspector/Inspector.json: Add events, update the CSS domain description.
923         * inspector/InspectorCSSAgent.cpp:
924         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
925         (WebCore::InspectorCSSAgent::clearFrontend):
926         (WebCore::InspectorCSSAgent::enable): Push all existing stylesheet headers into the frontend.
927         (WebCore::InspectorCSSAgent::activeStyleSheetsUpdated): Push added/removed stylesheet into the frontend.
928         (WebCore::InspectorCSSAgent::getAllStyleSheets): Slightly refactored to make use of collectAllStyleSheets().
929         (WebCore::InspectorCSSAgent::collectAllStyleSheets): Added to collect InspectorStyleSheets rather than headers.
930         (WebCore::InspectorCSSAgent::collectStyleSheets):
931         (WebCore::InspectorCSSAgent::bindStyleSheet): Binds via-inspector stylesheets, too.
932         (WebCore::InspectorCSSAgent::unbindStyleSheet): Now we can unbind stylesheets upon their removal from the document.
933         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet): Modifies m_creatingViaInspectorStyleSheet when necessary.
934         (WebCore::InspectorCSSAgent::detectOrigin): Modified to make use of m_creatingViaInspectorStyleSheet.
935         (WebCore::InspectorCSSAgent::buildObjectForRule): Removed extraneous bound InspectorStyleSheet 0-check.
936         * inspector/InspectorCSSAgent.h:
937         * inspector/InspectorInstrumentation.cpp: Instrumentation of active stylesheet set updates.
938         (WebCore::InspectorInstrumentation::activeStyleSheetsUpdatedImpl):
939         * inspector/InspectorInstrumentation.h: Ditto.
940         (WebCore::InspectorInstrumentation::activeStyleSheetsUpdated):
941         * inspector/front-end/CSSStyleModel.js:
942         (WebInspector.CSSStyleModel.prototype.styleSheetHeaders):
943         (WebInspector.CSSStyleModel.prototype._styleSheetAdded): Added.
944         (WebInspector.CSSStyleModel.prototype._styleSheetRemoved): Added.
945         (WebInspector.CSSStyleModel.prototype.viaInspectorResourceForRule):
946         (WebInspector.CSSStyleModelResourceBinding.prototype._setHeaderForStyleSheetId):
947         (WebInspector.CSSStyleModelResourceBinding.prototype.resourceURLForStyleSheetId):
948         (WebInspector.CSSStyleModelResourceBinding.prototype.styleSheetIdForResource):
949         (WebInspector.CSSStyleModelResourceBinding.prototype._headerKey): Calculate the (frameID + URL) key for CSSStyleSheetHeader.
950         (WebInspector.CSSStyleModelResourceBinding.prototype._createInspectorResource):
951         (WebInspector.CSSStyleModelResourceBinding.prototype._inspectorResource):
952         (WebInspector.CSSStyleModelResourceBinding.prototype._reset):
953         (WebInspector.CSSDispatcher.prototype.styleSheetAdded): Added.
954         (WebInspector.CSSDispatcher.prototype.styleSheetRemoved): Added.
955         * inspector/front-end/SASSSourceMapping.js: Get rid of async implementations.
956         (WebInspector.SASSSourceMapping.prototype._styleSheetChanged):
957         * inspector/front-end/StylesSidebarPane.js: Ditto.
958         (WebInspector.StylePropertiesSection.prototype._createRuleOriginNode):
959         * inspector/front-end/StylesSourceMapping.js: Ditto.
960         (WebInspector.StyleContentBinding.prototype._innerStyleSheetChanged):
961
962 2013-02-15  Andrei Bucur  <abucur@adobe.com>
963
964         Implement the -webkit-margin-collapse properties correct rendering
965         https://bugs.webkit.org/show_bug.cgi?id=108168
966
967         Reviewed by David Hyatt.
968
969         The patch implements the correct behavior for the -webkit-margin-collapse properties:
970         - a value of "discard" on a margin will truncate all the margins collapsing with it;
971         - a value of "separate" will prevent the margin to collapse;
972         - a value of "collapse" is the default collapse behavior.
973
974         The implementation is aware of multiple writing-modes:
975         - if the writing mode of a child is parallel with the writing mode of the container and has the same direction,
976         the -webkit-margin-collapse properties on the child are left as is;
977         - if the writing mode of a child is parallel with the writing mode of the container but has a different direction,
978         the -webkit-margin-collapse properties on the child are reversed;
979         - if the writing mode of a child is perpendicular on the writing mode of the container,
980         the -webkit-margin-collapse properties on the child are ignored;
981
982         I. The "discard" value implementation
983         There are two new bits (before and after) added on the RenderBlockRareData structure specifying if the margins
984         of the block will be discarded or not. We can't rely only on the value from style() because
985         it's possible a block to discard it's margins because it has collapsed with a children that
986         specified "discard" for -webkit-margin-collapse. However, the bits are set only if it is
987         required.
988         Another bit is added on the MarginInfo structure specifying if the margin has to be discarded or not. When
989         collapsing at the before side of a block it will hold information if the container block needs to discard
990         or not. If the collapsing happens between siblings/with after side of the container it will tell if the previous
991         child discards the margin or not. The self collapsing blocks are a special case. If any of its margins
992         discards then both its margins discard and all the other margins collapsing with it.
993         To ensure an optimal behavior it is asserted margin values can't be set on the MarginInfo object if the
994         discard flag is active. If this happens it may indicate someone ignored the possibility of the margin being
995         discarded altogether and incorrectly updated the margin values.
996         Float clearing also needs to change because it may force margins to stop collapsing. If this happens the discard
997         flags and margins needs to be restored to their values before the collapse.
998
999         II. The "separate" value implementation
1000         The implementation for separate was not changed too much. I've added new accessor methods for the property
1001         that take writing mode into consideration and I've removed some code that didn't work correctly in layoutBlockChild.
1002         The problem was the marginInfo structure was cleared if the child was specifying the "separate" value for before.
1003         This is wrong because you lose the margin information of the previous child/before side.
1004
1005         Tests: fast/block/margin-collapse/webkit-margin-collapse-container.html
1006                fast/block/margin-collapse/webkit-margin-collapse-floats.html
1007                fast/block/margin-collapse/webkit-margin-collapse-siblings-bt.html
1008                fast/block/margin-collapse/webkit-margin-collapse-siblings.html
1009
1010         * rendering/RenderBlock.cpp:
1011         (WebCore::RenderBlock::MarginInfo::MarginInfo):
1012         (WebCore::RenderBlock::layoutBlock):
1013         (WebCore::RenderBlock::collapseMargins):
1014         (WebCore::RenderBlock::clearFloatsIfNeeded):
1015         (WebCore::RenderBlock::marginBeforeEstimateForChild):
1016         (WebCore::RenderBlock::estimateLogicalTopPosition):
1017         (WebCore::RenderBlock::setCollapsedBottomMargin):
1018         (WebCore::RenderBlock::handleAfterSideOfBlock):
1019         (WebCore::RenderBlock::layoutBlockChild):
1020         (WebCore::RenderBlock::setMustDiscardMarginBefore):
1021         (WebCore):
1022         (WebCore::RenderBlock::setMustDiscardMarginAfter):
1023         (WebCore::RenderBlock::mustDiscardMarginBefore):
1024         (WebCore::RenderBlock::mustDiscardMarginAfter):
1025         (WebCore::RenderBlock::mustDiscardMarginBeforeForChild):
1026         (WebCore::RenderBlock::mustDiscardMarginAfterForChild):
1027         (WebCore::RenderBlock::mustSeparateMarginBeforeForChild):
1028         (WebCore::RenderBlock::mustSeparateMarginAfterForChild):
1029         * rendering/RenderBlock.h:
1030         (RenderBlock):
1031         (WebCore::RenderBlock::initMaxMarginValues):
1032         (MarginInfo):
1033         (WebCore::RenderBlock::MarginInfo::setPositiveMargin):
1034         (WebCore::RenderBlock::MarginInfo::setNegativeMargin):
1035         (WebCore::RenderBlock::MarginInfo::setPositiveMarginIfLarger):
1036         (WebCore::RenderBlock::MarginInfo::setNegativeMarginIfLarger):
1037         (WebCore::RenderBlock::MarginInfo::setMargin):
1038         (WebCore::RenderBlock::MarginInfo::setCanCollapseMarginAfterWithChildren):
1039         (WebCore::RenderBlock::MarginInfo::setDiscardMargin):
1040         (WebCore::RenderBlock::MarginInfo::discardMargin):
1041         (WebCore::RenderBlock::RenderBlockRareData::RenderBlockRareData):
1042         (WebCore::RenderBlock::RenderBlockRareData::positiveMarginBeforeDefault):
1043         (RenderBlockRareData):
1044         * rendering/style/RenderStyle.h:
1045
1046 2013-02-14  Yury Semikhatsky  <yurys@chromium.org>
1047
1048         Web Inspector: always show memory size in Mb on the native memory graph
1049         https://bugs.webkit.org/show_bug.cgi?id=109813
1050
1051         Reviewed by Pavel Feldman.
1052
1053         Memory size vlue is alway shown in Mb on the native memory graph.
1054
1055         * inspector/front-end/NativeMemoryGraph.js:
1056         (WebInspector.NativeMemoryCounterUI.prototype.updateCurrentValue):
1057
1058 2013-02-14  Andrey Adaikin  <aandrey@chromium.org>
1059
1060         Use GL typedefs in WebGLRenderingContext.idl
1061         https://bugs.webkit.org/show_bug.cgi?id=109060
1062
1063         Reviewed by Kenneth Russell.
1064
1065         Use GL typedefs in WebGLRenderingContext.idl according to the specs.
1066         Added a FIXME about inconsistency with the current WebGL spec for getAttribLocation.
1067
1068         Tested manually that generators V8, JS, ObjC, GObject, CPP produce same output.
1069
1070         * html/canvas/WebGLRenderingContext.idl:
1071
1072 2013-02-14  Vsevolod Vlasov  <vsevik@chromium.org>
1073
1074         Web Inspector: Copy-pasting selected text over itself should be an undoable state.
1075         https://bugs.webkit.org/show_bug.cgi?id=109830
1076
1077         Reviewed by Pavel Feldman.
1078
1079         * inspector/front-end/TextEditorModel.js:
1080         (WebInspector.TextEditorModel.endsWithBracketRegex.):
1081
1082 2013-02-14  Sheriff Bot  <webkit.review.bot@gmail.com>
1083
1084         Unreviewed, rolling out r142889.
1085         http://trac.webkit.org/changeset/142889
1086         https://bugs.webkit.org/show_bug.cgi?id=109891
1087
1088         It caused an assertion failure in scrollbars/overflow-
1089         scrollbar-combinations.html (Requested by tkent on #webkit).
1090
1091         * rendering/RenderBox.cpp:
1092         (WebCore::borderWidthChanged):
1093         (WebCore::RenderBox::styleDidChange):
1094
1095 2013-02-14  Arpita Bahuguna  <arpitabahuguna@gmail.com>
1096
1097         Caret positioned at the end of a text line (followed by an empty block) in vertical writing mode disappears when pressing the right/down arrow key.
1098         https://bugs.webkit.org/show_bug.cgi?id=106452
1099
1100         Reviewed by Ryosuke Niwa.
1101
1102         Pressing the down or the right arrow key at the end of a text line in
1103         vertical writing mode would make the caret dissapear. This occurs only
1104         when the text line is followed by an empty block.
1105
1106         When trying to compute the next position for placing the caret (for
1107         down/right key), we try to ascertain whether the renderer (in this
1108         case the empty block) is a valid candidate or not. For blockFlow
1109         elements we check against their height.
1110         In vertical writing mode though we would fail such a check since we
1111         should instead be comparing against the renderer's width and not
1112         it's height. Thus, a valid position for the placement of the caret
1113         was not found in such a case.
1114
1115         Test: editing/selection/caret-at-end-of-text-line-followed-by-empty-block-in-vertical-mode.html
1116
1117         * dom/Position.cpp:
1118         (WebCore::Position::isCandidate):
1119         * dom/PositionIterator.cpp:
1120         (WebCore::PositionIterator::isCandidate):
1121         Instead of checking against the height(), check against the
1122         logicalHeight() of the renderer has been added. logicalHeight()
1123         on blockFlow renderer's returns a value in accordance with
1124         the writing mode.
1125
1126 2013-02-14  Ryosuke Niwa  <rniwa@webkit.org>
1127
1128         Windows build fix after r142957.
1129
1130         * dom/DOMAllInOne.cpp:
1131
1132 2013-02-14  Ryosuke Niwa  <rniwa@webkit.org>
1133
1134         Fix a typo introduced in r142705.
1135
1136         Without this fix, text-input-controller.html can fail when DeleteButtonController is enabled.
1137         e.g. "run-webkit-tests platform/mac/editing/deleting/deletionUI-single-instance.html
1138             platform/mac/editing/input/text-input-controller.html --child-processes=1"
1139
1140         * editing/Editor.cpp:
1141         (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
1142
1143 2013-02-14  Hayato Ito  <hayato@chromium.org>
1144
1145         Factor Event retargeting code.
1146         https://bugs.webkit.org/show_bug.cgi?id=109156
1147
1148         Reviewed by Dimitri Glazkov.
1149
1150         To supoort Touch event retargeting (bug 107800), we have to factor
1151         event retargeting code so that it can support not only MouseEvent,
1152         but also other events.
1153
1154         New class, EventRetargeter, was introduced. From now,
1155         EventDispatchMediator (and its subclasses) should call, if event
1156         retargeting is required, an appropriate function provided in
1157         EventRetargeter rather than calling
1158         EventDispatcher::adjustRelatedTarget(), which was removed in this
1159         patch.
1160
1161         No tests. No change in behavior.
1162
1163         * CMakeLists.txt:
1164         * GNUmakefile.list.am:
1165         * Target.pri:
1166         * WebCore.gypi:
1167         * WebCore.xcodeproj/project.pbxproj:
1168         * dom/EventDispatchMediator.cpp:
1169         * dom/EventDispatcher.cpp:
1170         (WebCore):
1171         (WebCore::EventDispatcher::ensureEventPath): Changed to return an EventPath, which will be used by EventRetargeter.
1172         (WebCore::EventDispatcher::dispatchScopedEvent):
1173         (WebCore::EventDispatcher::dispatchEvent):
1174         (WebCore::EventDispatcher::dispatchEventPostProcess):
1175         * dom/EventDispatcher.h:
1176         (WebCore):
1177         (EventDispatcher):
1178         * dom/EventRetargeter.cpp: Added.
1179         (WebCore):
1180         (WebCore::inTheSameScope):
1181         (WebCore::determineDispatchBehavior):
1182         (WebCore::EventRetargeter::calculateEventPath): Factored out from EventDispatcher::ensureEventPath().
1183         (WebCore::EventRetargeter::adjustForMouseEvent):
1184         (WebCore::EventRetargeter::adjustForFocusEvent):
1185         (WebCore::EventRetargeter::adjustForRelatedTarget):
1186         (WebCore::EventRetargeter::calculateAdjustedNodes): Factored out from EventRelatedTargetAjuster::adjustRelatedTarget().
1187         (WebCore::EventRetargeter::buildRelatedNodeMap): Factored out from EventRelatedTargetAjuster::adjustRelatedTarget().
1188         (WebCore::EventRetargeter::findRelatedNode):
1189         * dom/EventRetargeter.h: Added.
1190         (WebCore):
1191         (EventRetargeter):
1192         (WebCore::EventRetargeter::eventTargetRespectingTargetRules):
1193         * dom/FocusEvent.cpp:
1194         (WebCore::FocusEventDispatchMediator::dispatchEvent): Changed to call EventRetargeter::adjustForFocusEvent().
1195         (WebCore::BlurEventDispatchMediator::dispatchEvent): Ditto.
1196         (WebCore::FocusInEventDispatchMediator::dispatchEvent): Ditto.
1197         (WebCore::FocusOutEventDispatchMediator::dispatchEvent): Ditto.
1198         * dom/MouseEvent.cpp:
1199         (WebCore::MouseEventDispatchMediator::dispatchEvent): Changed to call EventRetargeter::adjustForMouseEvent().
1200
1201 2013-02-14  Simon Fraser  <simon.fraser@apple.com>
1202
1203         Reverting r142861. Hit testing inside of style recalc is fundamentally wrong
1204
1205         * page/EventHandler.cpp:
1206         (WebCore::EventHandler::selectCursor):
1207         (WebCore::EventHandler::handleMouseMoveEvent):
1208         * page/EventHandler.h:
1209         * rendering/RenderObject.cpp:
1210         (WebCore::RenderObject::setStyle):
1211         (WebCore::areNonIdenticalCursorListsEqual):
1212         (WebCore::areCursorsEqual):
1213         (WebCore::RenderObject::styleDidChange):
1214
1215 2013-02-14  Florin Malita  <fmalita@chromium.org>
1216
1217         [SVG] Cached filter results are not invalidated on repaint rect change
1218         https://bugs.webkit.org/show_bug.cgi?id=106221
1219
1220         Reviewed by Dean Jackson.
1221
1222         Since the cached filter results are not invalidated for different repaint rects, we need
1223         to render the content of the whole filter region upfront (otherwise elements not visible
1224         during the initial paint due to scrolling/window size/etc. are never redrawn).
1225
1226         Tests: svg/filters/filter-hidden-content-expected.svg
1227                svg/filters/filter-hidden-content.svg
1228
1229         * rendering/svg/RenderSVGResourceFilter.cpp:
1230         (WebCore::RenderSVGResourceFilter::applyResource):
1231         (WebCore::RenderSVGResourceFilter::drawingRegion):
1232         (WebCore):
1233         * rendering/svg/RenderSVGResourceFilter.h:
1234         (FilterData):
1235         (RenderSVGResourceFilter):
1236         Track the filter drawing region in FilterData.
1237
1238         * rendering/svg/SVGRenderingContext.cpp:
1239         (WebCore::SVGRenderingContext::~SVGRenderingContext):
1240         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1241         * rendering/svg/SVGRenderingContext.h:
1242         Update paintInfo.rect to cover the whole drawing region while rendering filter content, and
1243         restore it when done.
1244
1245 2013-02-14  Jinwoo Song  <jinwoo7.song@samsung.com>
1246
1247         [EFL] Correct the mismatched cursor map
1248         https://bugs.webkit.org/show_bug.cgi?id=109655
1249
1250         Reviewed by Laszlo Gombos.
1251
1252         Correct the mismatched ECORE_X_CURSOR values in the cursor map.
1253
1254         * platform/efl/EflScreenUtilities.cpp:
1255         (WebCore::CursorMap::CursorMap):
1256
1257 2013-02-14  Kentaro Hara  <haraken@chromium.org>
1258
1259         Unreviewed. Rebaselined run-bindings-tests.
1260
1261         * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
1262         (WebDOMTestObj::anyAttribute):
1263         (WebDOMTestObj::setAnyAttribute):
1264         * bindings/scripts/test/CPP/WebDOMTestObj.h:
1265         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1266         (webkit_dom_test_obj_get_any_attribute):
1267         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1268         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1269         * bindings/scripts/test/V8/V8TestTypedefs.cpp:
1270         (WebCore::TestTypedefsV8Internal::funcWithClampCallback):
1271
1272 2013-02-14  Christian Biesinger  <cbiesinger@chromium.org>
1273
1274         Convert media controls from DeprecatedFlexibleBox to FlexibleBox
1275         https://bugs.webkit.org/show_bug.cgi?id=109775
1276
1277         Reviewed by Ojan Vafai.
1278
1279         Covered by existing tests in media/.
1280
1281         * css/mediaControls.css:
1282         * css/mediaControlsBlackBerry.css:
1283         * css/mediaControlsChromium.css:
1284         * css/mediaControlsChromiumAndroid.css:
1285         * css/mediaControlsEfl.css:
1286         * css/mediaControlsGtk.css:
1287         * css/mediaControlsQt.css:
1288         * css/mediaControlsQuickTime.css:
1289         Automated search and replace of old flexbox CSS rules to new ones.
1290         Minor tuning of the chromium rules.
1291
1292         * rendering/RenderMediaControlElements.cpp:
1293         (WebCore::RenderMediaControlTimeDisplay::RenderMediaControlTimeDisplay):
1294         (WebCore::RenderMediaControlTimeDisplay::layout):
1295         * rendering/RenderMediaControlElements.h:
1296         Make media controls inherit from RenderFlexibleBox
1297
1298 2013-02-14  Roger Fong  <roger_fong@apple.com>
1299
1300         Build fix for Windows.
1301
1302         * Modules/webdatabase/SQLTransactionStateMachine.cpp:
1303         (WebCore::nameForSQLTransactionState):
1304
1305 2013-02-14  Dean Jackson  <dino@apple.com>
1306
1307         Inspector doesn't show rules from pluginsStyleSheet
1308         https://bugs.webkit.org/show_bug.cgi?id=109872
1309
1310         Reviewed by Darin Adler.
1311
1312         Make sure getWrapperForRuleInSheets collects the rules
1313         from CSSDefaultStyleSheets::plugInsStyleSheet.
1314
1315         Making a test for this is difficult because the rules in
1316         this sheet only apply to snapshotted plugins at the moment,
1317         which are disabled in DRT, and would require a fairly long
1318         timeout in the test.
1319
1320         * css/InspectorCSSOMWrappers.cpp:
1321         (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
1322
1323 2013-02-14  Hayato Ito  <hayato@chromium.org>
1324
1325         Recover edge names used in MemoryInstrumentation for DocumentRuleSets.
1326         https://bugs.webkit.org/show_bug.cgi?id=109800
1327
1328         Reviewed by Hajime Morita.
1329
1330         This is a following patch for r142573.
1331         r142563 accidentally removes edge names for MemoryInstrumentation. We should recover edge names.
1332
1333         No tests. No change in behavior.
1334
1335         * css/DocumentRuleSets.cpp:
1336         (WebCore::DocumentRuleSets::reportMemoryUsage):
1337
1338 2013-02-14  Hajime Morrita  <morrita@google.com>
1339
1340         [V8] Assertion failure on an exception is thrown
1341         https://bugs.webkit.org/show_bug.cgi?id=109129
1342
1343         An assertion in V8AbstractEventListener is wrong. This change turns it into an error check.
1344
1345         Reviewed by Kentaro Hara.
1346
1347         Test: fast/events/onerror-no-constructor.html
1348
1349         * bindings/v8/V8AbstractEventListener.cpp:
1350         (WebCore::V8AbstractEventListener::handleEvent):
1351
1352 2013-02-14  Kentaro Hara  <haraken@chromium.org>
1353
1354         [V8] CodeGeneratorV8.pm can assume that DOMWindow has [CheckSecurity]
1355         https://bugs.webkit.org/show_bug.cgi?id=109788
1356
1357         Reviewed by Adam Barth.
1358
1359         There is code like this:
1360
1361           if ($extendedAttr{"CheckSecurity"} || $interfaceName eq "DOMWindow")
1362
1363         This check is redundant. DOMWindow has [CheckSecurity]. We can remove the
1364         DOMWindow check.
1365
1366         No tests. No change in behavior.
1367
1368         * bindings/scripts/CodeGeneratorV8.pm:
1369         (GenerateReplaceableAttrSetter):
1370         (GenerateFunctionCallback):
1371         (GenerateNonStandardFunction):
1372         (GenerateImplementation):
1373
1374 2013-02-14  Joshua Bell  <jsbell@chromium.org>
1375
1376         [V8] IndexedDB: Remove unused creationContext paramter from idbKeyToV8Value
1377         https://bugs.webkit.org/show_bug.cgi?id=109870
1378
1379         Reviewed by Kentaro Hara.
1380
1381         This parameter was left over from when the function was toV8(IDBKey). Remove it.
1382
1383         No new tests - just removing dead code.
1384
1385         * bindings/v8/IDBBindingUtilities.cpp:
1386         (WebCore::idbKeyToV8Value): Remove unused parameter.
1387         (WebCore::injectIDBKeyIntoScriptValue): No need for dummy handle.
1388         (WebCore::idbKeyToScriptValue): No need for dummy handle.
1389
1390 2013-02-14  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1391
1392         [WebGL][Qt] regression:r142786 Qt Build fix for Arm and Windows.
1393         https://bugs.webkit.org/show_bug.cgi?id=109797
1394
1395         Reviewed by Csaba Osztrogon√°c.
1396
1397         After r142786, we use OpenGLShims to load necessary GL functions
1398         exposed by ARB_vertex_array_object extension. Qt uses OpenGLShims
1399         to load functions with GLES too. This patch adds support for loading the
1400         equivalent functions on GLES exposed by OES_vertex_array_object.
1401         
1402         * platform/graphics/OpenGLShims.cpp:
1403         (WebCore::initializeOpenGLShims):
1404         * platform/graphics/OpenGLShims.h:
1405
1406 2013-02-14  Alexey Proskuryakov  <ap@apple.com>
1407
1408         <rdar://problem/13210723> CORS preflight broken with NetworkProcess
1409         https://bugs.webkit.org/show_bug.cgi?id=109753
1410
1411         Reviewed by Brady Eidson.
1412
1413         * loader/DocumentThreadableLoader.h:
1414         * loader/DocumentThreadableLoader.cpp:
1415         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1416         (WebCore::DocumentThreadableLoader::cancel):
1417         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1418         (WebCore::DocumentThreadableLoader::dataReceived):
1419         (WebCore::DocumentThreadableLoader::didReceiveData):
1420         (WebCore::DocumentThreadableLoader::notifyFinished):
1421         (WebCore::DocumentThreadableLoader::didFinishLoading):
1422         (WebCore::DocumentThreadableLoader::didFail):
1423         (WebCore::DocumentThreadableLoader::preflightFailure): Notify InspectorInstrumentation
1424         immediately. In addition to keeping up eith other changes, this means that an accurate
1425         error will be passed now, not a cancellation.
1426         (WebCore::DocumentThreadableLoader::loadRequest):
1427         Get rid of m_preflightRequestIdentifier. Every loader has an identifier, and tracking
1428         identifiers twice is wrong.
1429         Pass identifier explicitly to more internal functions, so that they would not have to
1430         second-guess callers.
1431
1432         * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::willSendRequest):
1433         Create an identifier for all loaders, not just those that we expect to have client
1434         callbacks about. Both Inspector and NetworkProcess need identifiers everywhere.
1435
1436         * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
1437         * loader/TextTrackLoader.h:
1438         * loader/cache/CachedResourceClient.h:
1439         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
1440         * loader/cache/CachedTextTrack.cpp: (WebCore::CachedTextTrack::data):
1441         Renamed didReceiveData to avoid conflict with the new DocumentThreadableLoader::didReceiveData.
1442         And we should really get rid of this CachedResourceClient function anyway.
1443
1444 2013-02-14  Kentaro Hara  <haraken@chromium.org>
1445
1446         Replace 'DOMObject' with 'any'
1447         https://bugs.webkit.org/show_bug.cgi?id=109793
1448
1449         Reviewed by Dimitri Glazkov.
1450
1451         In the Web IDL spec, there is no type named 'DOMObject'.
1452         It should be 'any'. We should replace all 'DOMObject's in WebKit IDLs with 'any's.
1453
1454         * Modules/webdatabase/SQLResultSetRowList.idl:
1455         * bindings/scripts/CodeGeneratorCPP.pm:
1456         (GetClassName):
1457         (AddIncludesForType):
1458         * bindings/scripts/CodeGeneratorGObject.pm:
1459         (GenerateFunction):
1460         * bindings/scripts/CodeGeneratorJS.pm:
1461         (AddIncludesForType):
1462         (GenerateImplementation):
1463         (JSValueToNative):
1464         (NativeToJSValue):
1465         * bindings/scripts/CodeGeneratorV8.pm:
1466         (GetNativeType):
1467         (JSValueToNative):
1468         (GetV8HeaderName):
1469         * dom/CustomEvent.idl:
1470         * dom/MessageEvent.idl:
1471         * dom/PopStateEvent.idl:
1472         * fileapi/FileReader.idl:
1473         * html/HTMLCanvasElement.idl:
1474         * html/HTMLElement.idl:
1475         * html/canvas/DataView.idl:
1476         * inspector/InjectedScriptHost.idl:
1477         * inspector/InspectorFrontendHost.idl:
1478         * inspector/JavaScriptCallFrame.idl:
1479         * page/DOMWindow.idl:
1480         * page/Location.idl:
1481
1482 2013-02-14  Kentaro Hara  <haraken@chromium.org>
1483
1484         [V8] Remove GenerateEventListenerCallback() from CodeGeneratorV8.pm
1485         https://bugs.webkit.org/show_bug.cgi?id=109786
1486
1487         Reviewed by Adam Barth.
1488
1489         Some code is duplicated between GenerateEventListenerCallback()
1490         and GenerateFunctionCallback(). By inlining GenerateEventListenerCallback()
1491         into GenerateFunctionCallback(), we can remove the duplication.
1492
1493         No tests. No change in behavior.
1494
1495         * bindings/scripts/CodeGeneratorV8.pm:
1496         (GenerateFunctionCallback):
1497
1498 2013-02-14  Ojan Vafai  <ojan@chromium.org>
1499
1500         Intrinsic and preferred widths on replaced elements are wrong in many cases
1501         https://bugs.webkit.org/show_bug.cgi?id=109859
1502
1503         Reviewed by Levi Weintraub.
1504
1505         Test: fast/replaced/preferred-widths.html
1506
1507         * rendering/RenderReplaced.cpp:
1508         (WebCore::RenderReplaced::computeIntrinsicLogicalWidths):
1509         Separate out computing the intrinsic widths. Eventually,
1510         we should be able to share computePreferredLogicalWidth implementations
1511         for all replaced elements and form controls since only the intrinsic width
1512         changes.
1513
1514         (WebCore::RenderReplaced::computePreferredLogicalWidths):
1515         -Apply min-width and max-width constraints and then add borderAndPaddingLogicalWidth
1516         at the end to make sure it's always applied. This matches all our other
1517         computePreferredLogicalWidths override and makes use match Gecko's/Opera's rendering.
1518         -Only set the minPreferredLogicalWidth to 0 if the width or max-width is a percent value.
1519         Doing it for height values and for min-width doesn't make any sense and doesn't
1520         match other browsers. Doing this for max-width still doesn't match other browsers,
1521         but it sounds like Gecko at least would like to change that.
1522
1523         * rendering/RenderReplaced.h:
1524         (WebCore::RenderReplaced::hasRelativeIntrinsicLogicalWidth):
1525         * rendering/svg/RenderSVGRoot.cpp:
1526         (WebCore::RenderSVGRoot::hasRelativeIntrinsicLogicalWidth):
1527         Add a way to check if the logicalWidth is relative so that we only check
1528         the width in computePreferredLogicalWidths instead of also checking the height.
1529
1530         * rendering/svg/RenderSVGRoot.h:
1531
1532 2013-02-14  Stephen Chenney  <schenney@chromium.org>
1533
1534         Crash when selecting a HarfBuzz text run with SVG fonts included
1535         https://bugs.webkit.org/show_bug.cgi?id=109833
1536
1537         Reviewed by Tony Chang.
1538
1539         There is an assert in SimpleFontData::applyTransforms that should not
1540         be there, as the code is valid for SVG fonts. If we get past this,
1541         then the HarfBuzz text run shaping code assumes that font data has a
1542         SkTypeface member, and SVG fonts do not. So we crash there too.
1543
1544         For now, we fix the crashes. This still leaves incorrect selection
1545         rectangles in this situation, on all platforms, tracked in
1546         https://bugs.webkit.org/show_bug.cgi?id=108133
1547
1548         Test: svg/css/font-face-crash.html
1549
1550         * platform/graphics/SimpleFontData.h:
1551         (WebCore::SimpleFontData::applyTransforms): Remove ASSERT_NOT_REACHED as the code can legally be reached for SVG fonts.
1552         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1553         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Check for SVG fonts in the text run, and abort if we find them.
1554
1555 2013-02-13 Joe Mason <jmason@rim.com>
1556
1557         [BlackBerry] Notify platform layer of failing to get authentication credentials
1558         https://bugs.webkit.org/show_bug.cgi?id=109751
1559
1560         Reviewed by Yong Li.
1561         Reviewed internally by Leo Yang
1562         Internal PR: 181302
1563
1564         The BlackBerry platform network layer needs to know if a stream failed to get authentication credentials.
1565         This patch is using newly added stream API to do it.
1566
1567         No functionality changed no new tests.
1568
1569         * platform/network/blackberry/NetworkJob.cpp:
1570         (WebCore::NetworkJob::notifyAuthReceived):
1571         (WebCore::NetworkJob::sendRequestWithCredentials):
1572         (WebCore::NetworkJob::notifyChallengeResult):
1573         * platform/network/blackberry/NetworkJob.h:
1574         * platform/network/blackberry/NetworkManager.cpp:
1575         (WebCore::protectionSpaceToPlatformAuth):
1576         (WebCore):
1577         (WebCore::setAuthCredentials):
1578         * platform/network/blackberry/NetworkManager.h:
1579         (WebCore):
1580
1581 2013-02-14  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1582
1583         [GTK] Fix indentation in GNUmakefile.list.am.
1584         https://bugs.webkit.org/show_bug.cgi?id=109854
1585
1586         Reviewed by Martin Robinson.
1587
1588         This patch fixes indentation in GNUmakefile.list.am.
1589
1590         * GNUmakefile.list.am:
1591
1592 2013-02-14  Tony Chang  <tony@chromium.org>
1593
1594         Unreviewed, set svn:eol-style native for .sln, .vcproj, and .vsprops files.
1595         https://bugs.webkit.org/show_bug.cgi?id=96934
1596
1597         * WebCore.vcproj/WebCore.sln: Modified property svn:eol-style.
1598         * WebCore.vcproj/WebCore.submit.sln: Modified property svn:eol-style.
1599
1600 2013-02-14  Abhishek Arya  <inferno@chromium.org>
1601
1602         Bad cast in RenderBlock::splitBlocks.
1603         https://bugs.webkit.org/show_bug.cgi?id=108691
1604
1605         Reviewed by Levi Weintraub.
1606
1607         Test: fast/multicol/remove-child-split-flow-crash.html
1608
1609         * rendering/RenderBlock.cpp:
1610         (WebCore):
1611         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks): rename gIsInColumnFlowSplit to gColumnFlowSplitEnabled
1612         and use it to decide when to do the column flow split or not.
1613         (WebCore::RenderBlock::removeChild): Do not allow column flow split inside removeChild
1614         since we might be merging anonymous blocks.
1615
1616 2013-02-14  Mark Lam  <mark.lam@apple.com>
1617
1618         Split SQLTransaction work between the frontend and backend.
1619         https://bugs.webkit.org/show_bug.cgi?id=104750.
1620
1621         Reviewed by Sam Weinig.
1622
1623         This is part of the webdatabase refactoring for webkit2.
1624
1625         1. Changed how transactions are created.
1626
1627            - Database::runTransaction() first creates a SQLTransaction frontend
1628              which encapsulates the 3 script callbacks. It then passes the
1629              SQLTransaction to the backend database to create the
1630              SQLTransactionBackend.
1631            - The SQLTransactionBackend manages all SQLiteTransaction work.
1632
1633         2. Introduced SQLTransactionState and SQLTransactionStateMachine.
1634
1635            - Instead of tracking the transaction phases as "steps" in m_nextStep,
1636              we now use m_nextState which is of enum class SQLTransactionState.
1637              Unlike m_nextStep which is a pointer to a "step" function,
1638              m_nextState is a state variable which is used to index into a
1639              state dispatch table.
1640
1641            - Both SQLTransaction and SQLTransactionBackend now extends
1642              SQLTransactionStateMachine, and uses its dispatch mechanism based on
1643              the SQLTransactionState.
1644
1645            - Instead of having 1 state machine instances, there are 2: 1 in the
1646              frontend, and 1 in the backend. The 2 have mirrored states, and
1647              transfers work to the other state machine when needed.
1648
1649            - Previously, state functions can be called inline from other states.
1650              They are now only called from the state machines runStateMachine()
1651              method. This makes it possible to isolate the state transition
1652              mechanism going between the sides (frontend and backend) to 2
1653              functions only: SQLTransaction::sendToBackendState() and
1654              SQLTransactionBackend::sendToFrontendState().
1655
1656         3. Consolidated cleanup work (mostly) to a unified cleanup function.
1657
1658         4. Changed the frontend Database::runTransaction() to use a
1659            ChangeVersionData* (instead of a ChangeVersionWrapper ref ptr).
1660
1661            - This is necessary because ChangeVersionWrapper contains functionality
1662              used in processing a transaction (to be invoked in the backend).
1663              Instead, what we want is to simply pass the 2 old and new version
1664              strings to the backend. The new ChangeVersionData simply packages up
1665              these 2 strings.
1666            - This makes ChangeVersionData easy to serialize for IPC messaging later.
1667
1668         5. Moved some transaction functions back to the frontend SQLTransaction
1669            because they belong there.
1670
1671         6. Moved some Database functions to its DatabaseBackendAsync backend
1672            now that the transaction has been split up.
1673
1674            - This is driven naturally by those functions being used exclusively
1675              in the backend for transaction work.
1676            - SQLTransactionClient, SQLTransactionCoordinator, and
1677              SQLTransactionWrapper are now exclusively backend data structures.
1678              SQLTransactionClient still has some frontend "pollution" that I'll
1679              fix later.
1680
1681         7. Made the few database report functions used only by Chromium conditional
1682            on PLATFORM(chromium).
1683
1684            - The report functions gets re-routed to Chromium's DatabaseObserver
1685              which further routes them elsewhere. It is unclear how Chromium uses
1686              these routed messages, and I am therefore not able to determine how
1687              they should work in a frontend/backend world. So, I'm #ifdef'ing
1688              them out. They still work like in the old way for Chromium.
1689
1690         8. Added new files to the build / project files.
1691
1692         9. Updated / added comments about how the transaction and its states work.
1693
1694         No new tests.
1695
1696         * CMakeLists.txt:
1697         * GNUmakefile.list.am:
1698         * Modules/webdatabase/AbstractDatabaseServer.h:
1699         * Modules/webdatabase/ChangeVersionData.h: Added.
1700         (ChangeVersionData):
1701         (WebCore::ChangeVersionData::ChangeVersionData):
1702         (WebCore::ChangeVersionData::oldVersion):
1703         (WebCore::ChangeVersionData::newVersion):
1704         * Modules/webdatabase/ChangeVersionWrapper.cpp:
1705         (WebCore::ChangeVersionWrapper::performPreflight):
1706         (WebCore::ChangeVersionWrapper::performPostflight):
1707         (WebCore::ChangeVersionWrapper::handleCommitFailedAfterPostflight):
1708         * Modules/webdatabase/ChangeVersionWrapper.h:
1709         (ChangeVersionWrapper):
1710         * Modules/webdatabase/Database.cpp:
1711         (WebCore::Database::Database):
1712         (WebCore::Database::close):
1713         (WebCore::Database::changeVersion):
1714         (WebCore::Database::transaction):
1715         (WebCore::Database::readTransaction):
1716         (WebCore::Database::runTransaction):
1717         (WebCore::Database::reportStartTransactionResult):
1718         (WebCore::Database::reportCommitTransactionResult):
1719         (WebCore::Database::reportExecuteStatementResult):
1720         * Modules/webdatabase/Database.h:
1721         (WebCore::Database::databaseContext):
1722         (Database):
1723         (WebCore::Database::reportStartTransactionResult):
1724         (WebCore::Database::reportCommitTransactionResult):
1725         (WebCore::Database::reportExecuteStatementResult):
1726         * Modules/webdatabase/DatabaseBackend.cpp:
1727         * Modules/webdatabase/DatabaseBackend.h:
1728         (DatabaseBackend):
1729         (WebCore::DatabaseBackend::reportOpenDatabaseResult):
1730         (WebCore::DatabaseBackend::reportChangeVersionResult):
1731         (WebCore::DatabaseBackend::reportStartTransactionResult):
1732         (WebCore::DatabaseBackend::reportCommitTransactionResult):
1733         (WebCore::DatabaseBackend::reportExecuteStatementResult):
1734         (WebCore::DatabaseBackend::reportVacuumDatabaseResult):
1735         * Modules/webdatabase/DatabaseBackendAsync.cpp:
1736         (WebCore::DatabaseBackendAsync::DatabaseBackendAsync):
1737         (WebCore::DatabaseBackendAsync::runTransaction):
1738         (WebCore::DatabaseBackendAsync::inProgressTransactionCompleted): Moved from frontend.
1739         (WebCore::DatabaseBackendAsync::scheduleTransaction): Moved from frontend.
1740         (WebCore::DatabaseBackendAsync::scheduleTransactionStep): Moved from frontend.
1741         (WebCore::DatabaseBackendAsync::transactionClient): Moved from frontend.
1742         (WebCore::DatabaseBackendAsync::transactionCoordinator): Moved from frontend.
1743         * Modules/webdatabase/DatabaseBackendAsync.h:
1744         (DatabaseBackendAsync):
1745         * Modules/webdatabase/DatabaseBackendContext.cpp:
1746         (WebCore::DatabaseBackendContext::frontend):
1747         * Modules/webdatabase/DatabaseBackendContext.h:
1748         (DatabaseBackendContext):
1749         * Modules/webdatabase/DatabaseManager.cpp:
1750         * Modules/webdatabase/DatabaseManager.h:
1751         (DatabaseManager):
1752         * Modules/webdatabase/DatabaseServer.cpp:
1753         * Modules/webdatabase/DatabaseServer.h:
1754         * Modules/webdatabase/DatabaseTask.cpp:
1755         (WebCore::DatabaseBackendAsync::DatabaseTransactionTask::doPerformTask):
1756         * Modules/webdatabase/SQLTransaction.cpp:
1757         (WebCore::SQLTransaction::create):
1758         (WebCore::SQLTransaction::SQLTransaction):
1759         (WebCore::SQLTransaction::setBackend):
1760         (WebCore::SQLTransaction::stateFunctionFor):
1761         (WebCore::SQLTransaction::requestTransitToState):
1762         (WebCore::SQLTransaction::nextStateForTransactionError):
1763             - was handleTransactionError(). There's also a backend version.
1764         (WebCore::SQLTransaction::deliverTransactionCallback): Moved from backend.
1765         (WebCore::SQLTransaction::deliverTransactionErrorCallback): Moved from backend.
1766         (WebCore::SQLTransaction::deliverStatementCallback): Moved from backend.
1767         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback): Moved from backend.
1768         (WebCore::SQLTransaction::deliverSuccessCallback): Moved from backend.
1769         (WebCore::SQLTransaction::unreachableState):
1770         (WebCore::SQLTransaction::sendToBackendState):
1771         (WebCore::SQLTransaction::performPendingCallback): Moved from backend.
1772         (WebCore::SQLTransaction::executeSQL): Moved from backend.
1773         (WebCore::SQLTransaction::checkAndHandleClosedOrInterruptedDatabase):
1774         (WebCore::SQLTransaction::clearCallbackWrappers):
1775         * Modules/webdatabase/SQLTransaction.h:
1776         (SQLTransaction):
1777         (WebCore::SQLTransaction::database):
1778         (WebCore::SQLTransaction::hasCallback):
1779         (WebCore::SQLTransaction::hasSuccessCallback):
1780         (WebCore::SQLTransaction::hasErrorCallback):
1781         * Modules/webdatabase/SQLTransactionBackend.cpp:
1782         (WebCore::SQLTransactionBackend::create):
1783         (WebCore::SQLTransactionBackend::SQLTransactionBackend):
1784         (WebCore::SQLTransactionBackend::doCleanup):
1785         (WebCore::SQLTransactionBackend::transactionError):
1786         (WebCore::SQLTransactionBackend::setShouldRetryCurrentStatement):
1787         (WebCore::SQLTransactionBackend::stateFunctionFor):
1788         (WebCore::SQLTransactionBackend::enqueueStatement):
1789         (WebCore::SQLTransactionBackend::checkAndHandleClosedOrInterruptedDatabase):
1790         (WebCore::SQLTransactionBackend::performNextStep):
1791         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown):
1792         (WebCore::SQLTransactionBackend::acquireLock):
1793         (WebCore::SQLTransactionBackend::lockAcquired):
1794         (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
1795         (WebCore::SQLTransactionBackend::runStatements):
1796         (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
1797             - was runCurrentStatement().
1798         (WebCore::SQLTransactionBackend::nextStateForCurrentStatementError):
1799             - was handleCurrentStatementError().
1800         (WebCore::SQLTransactionBackend::postflightAndCommit):
1801         (WebCore::SQLTransactionBackend::cleanupAndTerminate):
1802         (WebCore::SQLTransactionBackend::nextStateForTransactionError):
1803             - was handleTransactionError(). There's also a frontend version.
1804         (WebCore::SQLTransactionBackend::cleanupAfterTransactionErrorCallback):
1805         (WebCore::SQLTransactionBackend::requestTransitToState):
1806         (WebCore::SQLTransactionBackend::unreachableState):
1807         (WebCore::SQLTransactionBackend::sendToFrontendState):
1808         * Modules/webdatabase/SQLTransactionBackend.h:
1809         (SQLTransactionWrapper):
1810         (SQLTransactionBackend):
1811         (WebCore::SQLTransactionBackend::database):
1812         * Modules/webdatabase/SQLTransactionClient.cpp:
1813         (WebCore::SQLTransactionClient::didCommitWriteTransaction):
1814         (WebCore::SQLTransactionClient::didExecuteStatement):
1815         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1816         (WebCore::getDatabaseIdentifier):
1817         * Modules/webdatabase/SQLTransactionState.h: Added.
1818         * Modules/webdatabase/SQLTransactionStateMachine.cpp: Added.
1819         (WebCore::nameForSQLTransactionState):
1820             - was debugStepName().
1821         * Modules/webdatabase/SQLTransactionStateMachine.h: Added.
1822         (SQLTransactionStateMachine):
1823         (WebCore::SQLTransactionStateMachine::~SQLTransactionStateMachine):
1824         (WebCore::::SQLTransactionStateMachine):
1825         (WebCore::::setStateToRequestedState):
1826         (WebCore::::runStateMachine):
1827         * Target.pri:
1828         * WebCore.gypi:
1829         * WebCore.vcproj/WebCore.vcproj:
1830         * WebCore.vcxproj/WebCore.vcxproj:
1831         * WebCore.vcxproj/WebCore.vcxproj.filters:
1832         * WebCore.xcodeproj/project.pbxproj:
1833         * inspector/InspectorDatabaseAgent.cpp:
1834
1835 2013-02-14  Jer Noble  <jer.noble@apple.com>
1836
1837         EME: replace MediaKeySession.addKey() -> update()
1838         https://bugs.webkit.org/show_bug.cgi?id=109461
1839
1840         Reviewed by Eric Carlson.
1841
1842         No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html test.
1843
1844         In the latest draft of the Encrypted Media Spec, the addKeys() method has been replaced
1845         with update().
1846
1847         * Modules/encryptedmedia/CDM.h:
1848         * Modules/encryptedmedia/MediaKeySession.cpp:
1849         (WebCore::MediaKeySession::update):
1850         (WebCore::MediaKeySession::addKeyTimerFired):
1851         * Modules/encryptedmedia/MediaKeySession.h:
1852         * Modules/encryptedmedia/MediaKeySession.idl:
1853         * html/HTMLMediaElement.cpp:
1854         (WebCore::HTMLMediaElement::webkitAddKey):
1855         * testing/MockCDM.cpp:
1856         (WebCore::MockCDMSession::update):
1857
1858 2013-02-14  Tony Chang  <tony@chromium.org>
1859
1860         Unreviewed, set svn:eol-style CRLF for .sln files.
1861
1862         * WebCore.vcproj/WebCore.sln: Modified property svn:eol-style.
1863         * WebCore.vcproj/WebCore.submit.sln: Modified property svn:eol-style.
1864
1865 2013-02-14  Eric Carlson  <eric.carlson@apple.com>
1866
1867         [Mac] adjust caption color user preference calculation
1868         https://bugs.webkit.org/show_bug.cgi?id=109840
1869
1870         Reviewed by Dean Jackson.
1871
1872         No new tests, it isn't possible to test this with DRT.
1873
1874         * page/CaptionUserPreferencesMac.mm:
1875         (WebCore::CaptionUserPreferencesMac::captionsWindowCSS): The color is "important" if either the
1876             color or opacity are supposed to override.
1877         (WebCore::CaptionUserPreferencesMac::captionsBackgroundCSS): Ditto.
1878         (WebCore::CaptionUserPreferencesMac::captionsTextColor): Ditto.
1879
1880         * WebCore.vcproj/WebCore.sln: Modified property svn:eol-style.
1881         * WebCore.vcproj/WebCore.submit.sln: Modified property svn:eol-style.
1882
1883 2013-02-14  Cosmin Truta  <ctruta@rim.com>
1884
1885         Numeric identifiers of events are not guaranteed to be unique
1886         https://bugs.webkit.org/show_bug.cgi?id=103259
1887
1888         Reviewed by Alexey Proskuryakov.
1889
1890         The results of setTimeout, setInterval and navigator.geolocation.watchPosition
1891         are positive integer values extracted from a simple circular sequential number
1892         generator, whose uniqueness can be guaranteed for no more than 2^31 calls to
1893         any of these functions. In order to provide this guarantee beyond this limit,
1894         we repeatedly ask for the next sequential id until we get one that's not used
1895         already.
1896
1897         This solution works instantly under normal circumstances, when there are few
1898         live timeout ids or geolocation ids at any given moment. Handling millions of
1899         live ids will require another solution.
1900
1901         No new tests. Brief tests of uniqueness already exist.
1902         Moreover, reproducing this particular issue would require 2^31 set/clear
1903         function calls, which is prohibitively expensive.
1904
1905         * Modules/geolocation/Geolocation.cpp:
1906         (WebCore::Geolocation::Watchers::add): Rename from Watchers::set; return false if watch id already exists.
1907         (WebCore::Geolocation::watchPosition): Repeat until the new watch id is unique.
1908         * Modules/geolocation/Geolocation.h:
1909         (Watchers): Rename Watchers::set to Watchers::add.
1910         * Modules/geolocation/Geolocation.idl: Rename the argument of Geolocation::clearWatch to WatchID.
1911         * dom/ScriptExecutionContext.cpp:
1912         (WebCore::ScriptExecutionContext::ScriptExecutionContext): Update initialization.
1913         (WebCore::ScriptExecutionContext::circularSequentialID): Rename from newUniqueID; remove FIXME note.
1914         * dom/ScriptExecutionContext.h:
1915         (ScriptExecutionContext): Rename ScriptExecutionContext::newUniqueID to ScriptExecutionContext::circularSequentialID.
1916         (WebCore::ScriptExecutionContext::addTimeout): Return false (do not assert) if timeout id already exists.
1917         * page/DOMTimer.cpp:
1918         (WebCore::DOMTimer::DOMTimer): Repeat until the new timeout id is unique.
1919
1920 2013-02-14  Sheriff Bot  <webkit.review.bot@gmail.com>
1921
1922         Unreviewed, rolling out r142825.
1923         http://trac.webkit.org/changeset/142825
1924         https://bugs.webkit.org/show_bug.cgi?id=109856
1925
1926         Causes some inspector tests to time out (Requested by anttik
1927         on #webkit).
1928
1929         * platform/mac/SharedTimerMac.mm:
1930         (WebCore):
1931         (WebCore::PowerObserver::restartSharedTimer):
1932         (WebCore::setSharedTimerFireInterval):
1933         (WebCore::stopSharedTimer):
1934
1935 2013-02-14  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
1936
1937         Support the ch unit from css3-values
1938         https://bugs.webkit.org/show_bug.cgi?id=85755
1939
1940         Reviewed by David Hyatt.
1941
1942         Original patch by Sumedha Widyadharma <sumedha.widyadharma@basyskom.com>.
1943
1944         Test: fast/css/css3-ch-unit.html
1945
1946         * css/CSSCalculationValue.cpp:
1947         (WebCore::unitCategory):
1948         * css/CSSGrammar.y.in:
1949         * css/CSSParser.cpp:
1950         (WebCore::CSSParser::validUnit):
1951         (WebCore::CSSParser::createPrimitiveNumericValue):
1952         (WebCore::CSSParser::parseValidPrimitive):
1953         (WebCore::CSSParser::detectNumberToken):
1954         * css/CSSParserValues.cpp:
1955         (WebCore::CSSParserValue::createCSSValue):
1956         * css/CSSPrimitiveValue.cpp:
1957         (WebCore::isValidCSSUnitTypeForDoubleConversion):
1958         (WebCore::CSSPrimitiveValue::cleanup):
1959         (WebCore::CSSPrimitiveValue::computeLengthDouble):
1960         (WebCore::CSSPrimitiveValue::customCssText):
1961         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
1962         * css/CSSPrimitiveValue.h:
1963         (WebCore::CSSPrimitiveValue::isFontRelativeLength):
1964         (WebCore::CSSPrimitiveValue::isLength):
1965         * platform/graphics/FontMetrics.h:
1966         (WebCore::FontMetrics::FontMetrics):
1967         (WebCore::FontMetrics::zeroWidth):
1968         (WebCore::FontMetrics::setZeroWidth):
1969         (FontMetrics):
1970         (WebCore::FontMetrics::hasZeroWidth):
1971         (WebCore::FontMetrics::setHasZeroWidth):
1972         * platform/graphics/SimpleFontData.cpp:
1973         (WebCore::SimpleFontData::platformGlyphInit):
1974         * platform/graphics/SimpleFontData.h:
1975         (WebCore::SimpleFontData::zeroGlyph):
1976         (WebCore::SimpleFontData::setZeroGlyph):
1977         (SimpleFontData):
1978         * platform/graphics/qt/SimpleFontDataQt.cpp:
1979         (WebCore::SimpleFontData::platformInit):
1980
1981 2013-02-14  David Kilzer  <ddkilzer@apple.com>
1982
1983         [Mac] Clean up WARNING_CFLAGS
1984         <http://webkit.org/b/109747>
1985         <rdar://problem/13208373>
1986
1987         Reviewed by Mark Rowe.
1988
1989         * Configurations/Base.xcconfig: Use
1990         GCC_WARN_64_TO_32_BIT_CONVERSION to enable and disable
1991         -Wshorten-64-to-32 rather than WARNING_CFLAGS.
1992
1993 2013-02-14  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1994
1995         Add addHTTPHeaderField() method to ResourceResponse
1996         https://bugs.webkit.org/show_bug.cgi?id=109844
1997
1998         Reviewed by Adam Barth.
1999
2000         ResourceRequestBase provides both setHTTPHeaderField() and addHTTPHeaderField(). However,
2001         ResourceResponseBase only provides setHTTPHeaderField(). This is a bit inconsistent. As a
2002         result, the addHTTPHeaderField() functionality's implementation is duplicated in several
2003         ports (at least chromium and soup).
2004
2005         This patch introduces addHTTPHeaderField() to ResourceResponseBase and makes use of it
2006         in Chromium and Soup backends.
2007
2008         No new tests, no behavior change.
2009
2010         * platform/chromium/support/WebURLResponse.cpp:
2011         (WebKit::WebURLResponse::addHTTPHeaderField): Use ResourceResponseBase::addHTTPHeaderField().
2012         * platform/network/ResourceResponseBase.cpp:
2013         (WebCore::ResourceResponseBase::updateHeaderParsedState): Move headers' parsed state update code
2014         from setHTTPHeaderField() to a new updateHeaderParsedState() method to avoid code duplication.
2015         (WebCore):
2016         (WebCore::ResourceResponseBase::setHTTPHeaderField):
2017         (WebCore::ResourceResponseBase::addHTTPHeaderField):
2018         * platform/network/ResourceResponseBase.h:
2019         (ResourceResponseBase):
2020         * platform/network/soup/ResourceResponseSoup.cpp:
2021         (WebCore::ResourceResponse::updateFromSoupMessageHeaders): Use ResourceResponseBase::addHTTPHeaderField().
2022
2023 2013-02-14  Philip Rogers  <pdr@google.com>
2024
2025         Prevent inconsistent firstChild during document destruction
2026         https://bugs.webkit.org/show_bug.cgi?id=106530
2027
2028         Reviewed by Abhishek Arya.
2029
2030         During document destruction, addChildNodesToDeletionQueue can allow a container
2031         node to have an invalid first child, causing a crash. This patch updates
2032         addChildNodesToDeletionQueue to maintain a valid value for firstChild() even
2033         while updating its children.
2034
2035         Test: svg/custom/animateMotion-path-change-crash.svg
2036
2037         * dom/ContainerNodeAlgorithms.h:
2038         (WebCore::Private::addChildNodesToDeletionQueue):
2039             To ensure prevoiusSibling() is also valid, this code was slightly refactored
2040             to call setPreviousSibling(0) on the next node instead of the current node.
2041
2042 2013-02-14  Julien Chaffraix  <jchaffraix@webkit.org>
2043
2044         [CSS Grid Layout] Add an internal 2D grid representation to RenderGrid
2045         https://bugs.webkit.org/show_bug.cgi?id=109714
2046
2047         Reviewed by Ojan Vafai.
2048
2049         This change introduces a 2D grid representation of the grid areas. Our implementation
2050         is a straight Vector of Vectors for the grid areas, each grid area able to hold an
2051         arbitrary number of RenderBox* so they hold a Vector of RenderBoxes. As an optimization,
2052         each grid area has enough inline storage to hold one grid item which should cover
2053         most cases.
2054
2055         In order to keep the code readable, a GridIterator was introduced to hide the new grid.
2056
2057         Refactoring, covered by existing tests.
2058
2059         * rendering/RenderGrid.cpp:
2060         (RenderGrid::GridIterator):
2061         (WebCore::RenderGrid::GridIterator::GridIterator):
2062         (WebCore::RenderGrid::GridIterator::nextGridItem):
2063         Added a mono-directional iterator. In order to be more aligned with the rest of the code,
2064         this iterator actually walks orthogonally to the |direction| (ie fixing the |direction|'s track).
2065
2066         * rendering/RenderGrid.cpp:
2067         (WebCore::RenderGrid::computePreferredLogicalWidths):
2068         (WebCore::RenderGrid::layoutGridItems):
2069         Updated these 2 functions to place the items on the grid and clear it at the end.
2070
2071         (WebCore::RenderGrid::computePreferredTrackWidth):
2072         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2073         Updated to use the GridIterator to walk over the rows / columns.
2074
2075         (WebCore::RenderGrid::placeItemsOnGrid):
2076         Added this function that inserts the grid items into the right grid area.
2077
2078         * rendering/RenderGrid.h:
2079         (WebCore::RenderGrid::gridColumnCount):
2080         (WebCore::RenderGrid::gridRowCount):
2081         Added these helper functions.
2082
2083 2013-02-14  Sheriff Bot  <webkit.review.bot@gmail.com>
2084
2085         Unreviewed, rolling out r141990.
2086         http://trac.webkit.org/changeset/141990
2087         https://bugs.webkit.org/show_bug.cgi?id=109850
2088
2089         ~5% regression on intl2 page cycler (Requested by kling on
2090         #webkit).
2091
2092         * platform/graphics/GlyphPage.h:
2093         (WebCore::GlyphPage::create):
2094         (WebCore::GlyphPage::glyphDataForCharacter):
2095         (WebCore::GlyphPage::glyphDataForIndex):
2096         (WebCore::GlyphPage::fontDataForCharacter):
2097         (WebCore::GlyphPage::setGlyphDataForIndex):
2098         (GlyphPage):
2099         (WebCore::GlyphPage::copyFrom):
2100         (WebCore::GlyphPage::clear):
2101         (WebCore::GlyphPage::clearForFontData):
2102         (WebCore::GlyphPage::GlyphPage):
2103         * platform/graphics/GlyphPageTreeNode.cpp:
2104         (WebCore::GlyphPageTreeNode::initializePage):
2105         * rendering/svg/SVGTextRunRenderingContext.cpp:
2106         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
2107
2108 2013-02-14  Mark Pilgrim  <pilgrim@chromium.org>
2109
2110         [Chromium] Move PlatformMessagePortChannel to WebCore
2111         https://bugs.webkit.org/show_bug.cgi?id=109845
2112
2113         Reviewed by Adam Barth.
2114
2115         Part of a larger refactoring series; see tracking bug 106829.
2116
2117         * WebCore.gyp/WebCore.gyp:
2118         * WebCore.gypi:
2119         * dom/default/chromium: Added.
2120         * dom/default/chromium/PlatformMessagePortChannelChromium.cpp: Added.
2121         (WebCore):
2122         (WebCore::MessagePortChannel::create):
2123         (WebCore::MessagePortChannel::createChannel):
2124         (WebCore::MessagePortChannel::MessagePortChannel):
2125         (WebCore::MessagePortChannel::~MessagePortChannel):
2126         (WebCore::MessagePortChannel::entangleIfOpen):
2127         (WebCore::MessagePortChannel::disentangle):
2128         (WebCore::MessagePortChannel::postMessageToRemote):
2129         (WebCore::MessagePortChannel::tryGetMessageFromRemote):
2130         (WebCore::MessagePortChannel::close):
2131         (WebCore::MessagePortChannel::isConnectedTo):
2132         (WebCore::MessagePortChannel::hasPendingActivity):
2133         (WebCore::MessagePortChannel::locallyEntangledPort):
2134         (WebCore::PlatformMessagePortChannel::create):
2135         (WebCore::PlatformMessagePortChannel::PlatformMessagePortChannel):
2136         (WebCore::PlatformMessagePortChannel::~PlatformMessagePortChannel):
2137         (WebCore::PlatformMessagePortChannel::createChannel):
2138         (WebCore::PlatformMessagePortChannel::messageAvailable):
2139         (WebCore::PlatformMessagePortChannel::entangleIfOpen):
2140         (WebCore::PlatformMessagePortChannel::disentangle):
2141         (WebCore::PlatformMessagePortChannel::postMessageToRemote):
2142         (WebCore::PlatformMessagePortChannel::tryGetMessageFromRemote):
2143         (WebCore::PlatformMessagePortChannel::close):
2144         (WebCore::PlatformMessagePortChannel::isConnectedTo):
2145         (WebCore::PlatformMessagePortChannel::hasPendingActivity):
2146         (WebCore::PlatformMessagePortChannel::setEntangledChannel):
2147         (WebCore::PlatformMessagePortChannel::webChannelRelease):
2148         * dom/default/chromium/PlatformMessagePortChannelChromium.h: Added.
2149         (WebKit):
2150         (WebCore):
2151         (PlatformMessagePortChannel):
2152
2153 2013-02-14  Chris Fleizach  <cfleizach@apple.com>
2154
2155         Remove Leopard Accessibility support from WebCore (now that no port builds on Leopard)
2156         https://bugs.webkit.org/show_bug.cgi?id=90250
2157
2158         Reviewed by Eric Seidel.
2159
2160         The Leopard era checks for accessibility lists and accessibility tables can be removed now.
2161
2162         * accessibility/AccessibilityARIAGrid.cpp:
2163         (WebCore):
2164         * accessibility/AccessibilityARIAGrid.h:
2165         (AccessibilityARIAGrid):
2166         (WebCore::AccessibilityARIAGrid::isTableExposableThroughAccessibility):
2167         * accessibility/AccessibilityList.cpp:
2168         (WebCore::AccessibilityList::computeAccessibilityIsIgnored):
2169         * accessibility/AccessibilityList.h:
2170         * accessibility/AccessibilityTable.cpp:
2171         (WebCore::AccessibilityTable::AccessibilityTable):
2172         (WebCore::AccessibilityTable::init):
2173         * accessibility/AccessibilityTable.h:
2174         (AccessibilityTable):
2175         * accessibility/mac/AXObjectCacheMac.mm:
2176         (WebCore::AXObjectCache::postPlatformNotification):
2177         * accessibility/mac/WebAccessibilityObjectWrapper.mm:
2178         (createAccessibilityRoleMap):
2179
2180 2013-02-14  Bear Travis  <betravis@adobe.com>
2181
2182         Make outside-shape the default value for shape-inside
2183         https://bugs.webkit.org/show_bug.cgi?id=109605
2184
2185         Reviewed by Levi Weintraub.
2186
2187         Creating a single reference outside-shape value and setting it as the default
2188         for shape-inside.
2189
2190         Existing tests cover the default value, just updating them to use outside-shape.
2191
2192         * rendering/style/RenderStyle.cpp:
2193         (WebCore::RenderStyle::initialShapeInside): Define a local static outside-shape
2194         value.
2195         (WebCore):
2196         * rendering/style/RenderStyle.h: Move the initialShapeInside method to the .cpp
2197         file.
2198
2199 2013-02-14  Min Qin  <qinmin@chromium.org>
2200
2201         Passing alpha to DeferredImageDecoder once decoding completes
2202         https://bugs.webkit.org/show_bug.cgi?id=108892
2203
2204         Reviewed by Stephen White.
2205
2206         We should pass hasAlpha value back to the DeferredImageDecoder once decoding is completed
2207         Added unit tests in ImageFrameGeneratorTest.
2208
2209         * platform/graphics/chromium/DeferredImageDecoder.cpp:
2210         (WebCore::DeferredImageDecoder::frameHasAlphaAtIndex):
2211         * platform/graphics/chromium/ImageFrameGenerator.cpp:
2212         (WebCore::ImageFrameGenerator::tryToScale):
2213         (WebCore::ImageFrameGenerator::decode):
2214         * platform/graphics/chromium/LazyDecodingPixelRef.cpp:
2215         (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
2216         (WebCore::LazyDecodingPixelRef::onUnlockPixels):
2217         * platform/graphics/chromium/LazyDecodingPixelRef.h:
2218         (WebCore::LazyDecodingPixelRef::hasAlpha):
2219         (LazyDecodingPixelRef):
2220         * platform/graphics/chromium/ScaledImageFragment.cpp:
2221         (WebCore::ScaledImageFragment::ScaledImageFragment):
2222         * platform/graphics/chromium/ScaledImageFragment.h:
2223         (WebCore::ScaledImageFragment::create):
2224         (ScaledImageFragment):
2225         (WebCore::ScaledImageFragment::hasAlpha):
2226
2227 2013-02-14  David Grogan  <dgrogan@chromium.org>
2228
2229         IndexedDB: Add a few more histogram calls
2230         https://bugs.webkit.org/show_bug.cgi?id=109762
2231
2232         Reviewed by Tony Chang.
2233
2234         A few places where commits could fail weren't being logged.
2235
2236         * Modules/indexeddb/IDBBackingStore.cpp:
2237         (WebCore::IDBBackingStore::deleteDatabase):
2238         (WebCore::IDBBackingStore::Transaction::commit):
2239
2240 2013-02-14  Tony Chang  <tony@chromium.org>
2241
2242         Padding and border changes doesn't trigger relayout of children
2243         https://bugs.webkit.org/show_bug.cgi?id=109639
2244
2245         Reviewed by Kent Tamura.
2246
2247         In RenderBlock::layoutBlock, we only relayout our children if our logical width
2248         changes. This misses cases where our logical width doesn't change (i.e., padding
2249         or border changes), but our content width does change.
2250
2251         This is a more general case of bug 104997.
2252
2253         Test: fast/block/dynamic-padding-border.html
2254
2255         * rendering/RenderBox.cpp:
2256         (WebCore::borderOrPaddingLogicalWidthChanged): Only check if the logical width changed.
2257         (WebCore::RenderBox::styleDidChange): Drop the border-box condition since this can happen
2258         even without border-box box sizing.
2259
2260 2013-02-14  Peter Rybin  <prybin@chromium.org>
2261
2262         Web Inspector: fix closure compilation warnings caused by setVariableValue change
2263         https://bugs.webkit.org/show_bug.cgi?id=109488
2264
2265         Reviewed by Pavel Feldman.
2266
2267         Annotations are fixed as required by closure compiler.
2268         Parameters in Inspector.json are reordered as required.
2269
2270         * inspector/InjectedScriptExterns.js:
2271         (InjectedScriptHost.prototype.setFunctionVariableValue):
2272         (JavaScriptCallFrame.prototype.setVariableValue):
2273         * inspector/InjectedScriptSource.js:
2274         (.):
2275         * inspector/Inspector.json:
2276         * inspector/InspectorDebuggerAgent.cpp:
2277         (WebCore::InspectorDebuggerAgent::setVariableValue):
2278         * inspector/InspectorDebuggerAgent.h:
2279         (InspectorDebuggerAgent):
2280
2281 2013-02-14  Tommy Widenflycht  <tommyw@google.com>
2282
2283         MediaStream API: RTCDataChannel triggers a use-after-free
2284         https://bugs.webkit.org/show_bug.cgi?id=109806
2285
2286         Reviewed by Adam Barth.
2287
2288         Making sure RTCPeerConnection::stop() is always called at least once.
2289         Also making sure that RTCDataChannels state gets set to Closed correctly.
2290
2291         Hard to test in WebKit but covered by Chromium tests.
2292
2293         * Modules/mediastream/RTCDataChannel.cpp:
2294         (WebCore::RTCDataChannel::stop):
2295         * Modules/mediastream/RTCPeerConnection.cpp:
2296         (WebCore::RTCPeerConnection::~RTCPeerConnection):
2297         (WebCore::RTCPeerConnection::stop):
2298
2299 2013-02-14  Vsevolod Vlasov  <vsevik@chromium.org>
2300
2301         Web Inspector: [Regression] When several consecutive characters are typed each of them is marked as undoable state.
2302         https://bugs.webkit.org/show_bug.cgi?id=109823
2303
2304         Reviewed by Pavel Feldman.
2305
2306         * inspector/front-end/TextEditorModel.js:
2307         (WebInspector.TextEditorModel.endsWithBracketRegex.):
2308
2309 2013-02-14  Sheriff Bot  <webkit.review.bot@gmail.com>
2310
2311         Unreviewed, rolling out r142820.
2312         http://trac.webkit.org/changeset/142820
2313         https://bugs.webkit.org/show_bug.cgi?id=109839
2314
2315         Causing crashes on chromium canaries (Requested by atwilson_
2316         on #webkit).
2317
2318         * dom/Document.cpp:
2319         (WebCore::Document::updateLayout):
2320         (WebCore::Document::implicitClose):
2321         * rendering/RenderQuote.h:
2322         (RenderQuote):
2323         * rendering/RenderView.cpp:
2324         * rendering/RenderView.h:
2325
2326 2013-02-14  Mario Sanchez Prada  <mario.prada@samsung.com>
2327
2328         [GTK] Missing call to g_object_ref while retrieving accessible table cells
2329         https://bugs.webkit.org/show_bug.cgi?id=106903
2330
2331         Reviewed by Martin Robinson.
2332
2333         Add missing extra ref to implementation of atk_table_ref_at().
2334
2335         Test: accessibility/table-cell-for-column-and-row-crash.html
2336
2337         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2338         (webkitAccessibleTableRefAt): This method transfers full ownership
2339         over the returned AtkObject, so an extra reference is needed here.
2340
2341 2013-02-14  Mike Fenton  <mifenton@rim.com>
2342
2343         [BlackBerry] Update keyboard event details to match platform details.
2344         https://bugs.webkit.org/show_bug.cgi?id=109693
2345
2346         Reviewed by Yong Li.
2347
2348         PR 220170.
2349
2350         Update the keyboard event details to match the
2351         platform details available.
2352
2353         Rename helper function to better describe the conversion.
2354
2355         Reviewed Internally by Nima Ghanavatian and Gen Mak.
2356
2357         * platform/blackberry/PlatformKeyboardEventBlackBerry.cpp:
2358         (WebCore::windowsKeyCodeForBlackBerryKeycode):
2359         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2360
2361 2013-02-08  Andrey Kosyakov  <caseq@chromium.org>
2362
2363         Web Inspector: expose did{Begin,Cancel}Frame() and {will,did}Composite() on WebDebToolsAgent
2364         https://bugs.webkit.org/show_bug.cgi?id=109192
2365
2366         Reviewed by Pavel Feldman.
2367
2368         - remove frame and compositing instrumentation methods from InspectorInstrumentation;
2369         - expose those methods on InspectorController instead.
2370
2371         * WebCore.exp.in:
2372         * inspector/InspectorController.cpp:
2373         (WebCore::InspectorController::didBeginFrame):
2374         (WebCore):
2375         (WebCore::InspectorController::didCancelFrame):
2376         (WebCore::InspectorController::willComposite):
2377         (WebCore::InspectorController::didComposite):
2378         * inspector/InspectorController.h:
2379         (InspectorController):
2380         * inspector/InspectorInstrumentation.cpp:
2381         (WebCore):
2382         * inspector/InspectorInstrumentation.h:
2383         (InspectorInstrumentation):
2384         * testing/Internals.cpp:
2385         (WebCore::Internals::emitInspectorDidBeginFrame):
2386         (WebCore::Internals::emitInspectorDidCancelFrame):
2387
2388 2013-02-14  Vladislav Kaznacheev  <kaznacheev@chromium.org>
2389
2390         Web Inspector: Fixed a layout regression in CanvasProfileView.
2391         https://bugs.webkit.org/show_bug.cgi?id=109835
2392
2393         Reviewed by Pavel Feldman.
2394
2395         Changed splitView.css to supported nested SplitView instances.
2396
2397         * inspector/front-end/splitView.css:
2398         (.split-view-vertical > .split-view-contents):
2399         (.split-view-vertical > .split-view-contents-first):
2400         (.split-view-vertical > .split-view-contents-first.maximized):
2401         (.split-view-vertical > .split-view-contents-second):
2402         (.split-view-vertical > .split-view-contents-second.maximized):
2403         (.split-view-horizontal > .split-view-contents):
2404         (.split-view-horizontal > .split-view-contents-first):
2405         (.split-view-horizontal > .split-view-contents-first.maximized):
2406         (.split-view-horizontal > .split-view-contents-second):
2407         (.split-view-horizontal > .split-view-contents-second.maximized):
2408         (.split-view-vertical > .split-view-sidebar.split-view-contents-first:not(.maximized)):
2409         (.split-view-vertical > .split-view-sidebar.split-view-contents-second:not(.maximized)):
2410         (.split-view-horizontal > .split-view-sidebar.split-view-contents-first:not(.maximized)):
2411         (.split-view-horizontal > .split-view-sidebar.split-view-contents-second:not(.maximized)):
2412         (.split-view-vertical > .split-view-resizer):
2413         (.split-view-horizontal > .split-view-resizer):
2414
2415 2013-02-14  Vladislav Kaznacheev  <kaznacheev@chromium.org>
2416
2417         Web Inspector: Color picker should not be available in Computed Styles pane.
2418         https://bugs.webkit.org/show_bug.cgi?id=109697
2419
2420         Reviewed by Alexander Pavlov.
2421
2422         Changed the parentPane parameter of WebInspector.ComputedStylePropertiesSection to the correct value
2423         (the ComputedStyleSidebarPane instance).
2424
2425         * inspector/front-end/StylesSidebarPane.js:
2426         (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules):
2427
2428 2013-02-14  Yury Semikhatsky  <yurys@chromium.org>
2429
2430         Web Inspector: don't create static local string for program literal in InspectorTimelineAgent
2431         https://bugs.webkit.org/show_bug.cgi?id=109811
2432
2433         Reviewed by Pavel Feldman.
2434
2435         Use const char* constant value instead of creating String from it in thread-unsafe
2436         static local variable.
2437
2438         * inspector/InspectorTimelineAgent.cpp:
2439         (WebCore::InspectorTimelineAgent::innerAddRecordToTimeline):
2440
2441 2013-02-14  Pan Deng  <pan.deng@intel.com>
2442
2443         [Web Inspector] Fix initiator name issue in reload scenario for Network Panel.
2444         https://bugs.webkit.org/show_bug.cgi?id=108746.
2445
2446         Reviewed by Vsevolod Vlasov.
2447
2448         WebInspector.displayNameForURL() does not work as expected in the reload scenario,
2449         for example, "http://www.yahoo.com/" was trimed to "/" at one time, but at another,
2450         the full host name will be displayed.
2451         This fix return host + "/" in the issue scenario, and keep with get displayName() in ParsedURL.
2452
2453         No new tests.
2454
2455         * inspector/front-end/ParsedURL.js:
2456         (WebInspector.ParsedURL.prototype.get displayName): append "/" in the display host scenario.
2457         * inspector/front-end/ResourceUtils.js:
2458         (WebInspector.displayNameForURL): add host in the head if url trimed as a "/".
2459
2460 2013-02-14  Alexei Filippov  <alph@chromium.org>
2461
2462         Web Inspector: fix to record button remaining red after heap snapshot is taken
2463         https://bugs.webkit.org/show_bug.cgi?id=109804
2464
2465         Reviewed by Yury Semikhatsky.
2466
2467         Revert part of r142243 fix. Namely heap snapshot taking button made
2468         stateless as it was before.
2469
2470         * inspector/front-end/HeapSnapshotView.js:
2471         (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
2472         * inspector/front-end/ProfilesPanel.js:
2473         (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
2474
2475 2013-02-14  Alexander Pavlov  <apavlov@chromium.org>
2476
2477         Web Inspector: Consistently use SecurityOrigin::toRawString() for serialization across the backend code
2478         https://bugs.webkit.org/show_bug.cgi?id=109801
2479
2480         Reviewed by Yury Semikhatsky.
2481
2482         No new tests, as existing tests cover the change.
2483
2484         * inspector/InspectorAgent.cpp:
2485         (WebCore::InspectorAgent::didClearWindowObjectInWorld):
2486         * inspector/InspectorIndexedDBAgent.cpp:
2487         (WebCore::InspectorIndexedDBAgent::requestDatabaseNamesForFrame):
2488         * inspector/InspectorPageAgent.cpp:
2489         (WebCore::InspectorPageAgent::buildObjectForFrame):
2490         * inspector/PageRuntimeAgent.cpp:
2491         (WebCore::PageRuntimeAgent::notifyContextCreated):
2492
2493 2013-02-14  Sergio Villar Senin  <svillar@igalia.com>
2494
2495         Add logging support to IndexedDB for non-Chromium platforms
2496         https://bugs.webkit.org/show_bug.cgi?id=109809
2497
2498         Reviewed by Kentaro Hara.
2499
2500         Enable logging of IndexedDB through the StorageAPI log channel for
2501         non-Chromium architectures.
2502
2503         No new tests required, we're just enabling logging for IndexedDB
2504         using the currently available logging framework.
2505
2506         * Modules/indexeddb/IDBTracing.h:
2507
2508 2013-02-14  Vsevolod Vlasov  <vsevik@chromium.org>
2509
2510         Web Inspector: Remove uriForFile and fileForURI methods from FileSystemMapping.
2511         https://bugs.webkit.org/show_bug.cgi?id=109704
2512
2513         Reviewed by Alexander Pavlov.
2514
2515         Replaced this methods with one line implementation on the only call site.
2516
2517         * inspector/front-end/FileSystemMapping.js:
2518         * inspector/front-end/FileSystemProjectDelegate.js:
2519         (WebInspector.FileSystemProjectDelegate.prototype._filePathForURI):
2520         (WebInspector.FileSystemProjectDelegate.prototype.setFileContent):
2521         (WebInspector.FileSystemProjectDelegate.prototype._populate.filesLoaded):
2522         (WebInspector.FileSystemProjectDelegate.prototype._populate):
2523
2524 2013-02-14  Anton Vayvod  <avayvod@chromium.org>
2525
2526         [Text Autosizing] Process narrow descendants with the same multiplier for the font size.
2527         https://bugs.webkit.org/show_bug.cgi?id=109573
2528
2529         Reviewed by Julien Chaffraix.
2530
2531         Combine narrow descendants of the same autosizing cluster into a group that is autosized
2532         with the same multiplier.
2533
2534         For example, on sites with a sidebar, sometimes the paragraphs next to the sidebar will have
2535         a large margin individually applied (via a CSS selector), causing them all to individually
2536         appear narrower than their enclosing blockContainingAllText. Rather than making each of
2537         these paragraphs into a separate cluster, we want them all to share the same multiplier, as
2538         if they were a single cluster.
2539
2540         Test: fast/text-autosizing/narrow-descendants-combined.html
2541
2542         * rendering/TextAutosizer.cpp:
2543         (WebCore::TextAutosizer::processClusterInternal):
2544
2545             Common implementation for processCluster() and processCompositeCluster that accepts the
2546             text width and whether the cluster should be autosized as parameters instead of
2547             calculating it inline.
2548
2549         (WebCore::TextAutosizer::processCluster):
2550
2551             Calculates the text width for a single cluster and whether it should be autosized, then
2552             calls processClusterInternal() to apply the multiplier and process the cluster's
2553             descendants.
2554
2555         (WebCore::TextAutosizer::processCompositeCluster):
2556
2557             Calculates the text width for a group of renderers and if the group should be autosized,
2558             then calls processClusterInternal() repeatedly with the same multiplier to apply it and
2559             process all the descendants of the group.
2560
2561         (WebCore::TextAutosizer::clusterShouldBeAutosized):
2562
2563             Calls the multiple renderers version to avoid code duplication.
2564
2565         (WebCore::TextAutosizer::compositeClusterShouldBeAutosized):
2566
2567             The multiple renderers version of clusterShouldBeAutosized.
2568
2569         * rendering/TextAutosizer.h:
2570
2571             Updated method declarations.
2572
2573 2013-02-14  Andrey Adaikin  <aandrey@chromium.org>
2574
2575         Look into possibilities of typedef in webkit idl files
2576         https://bugs.webkit.org/show_bug.cgi?id=52340
2577
2578         Reviewed by Kentaro Hara.
2579
2580         Add typedef support for WebKit IDL parser.
2581         Drive by: fixed a bug of generating "unrestrictedfloat" without a space.
2582
2583         Added a new IDL test TestTypedefs.idl. The results were generated without typedefs.
2584
2585         * bindings/scripts/IDLParser.pm:
2586         (assertNoExtendedAttributesInTypedef):
2587         (parseDefinitions):
2588         (applyTypedefs):
2589         (applyTypedefsForSignature):
2590         (parseTypedef):
2591         (parseUnrestrictedFloatType):
2592         * bindings/scripts/test/CPP/WebDOMTestTypedefs.cpp: Added.
2593         (WebDOMTestTypedefs::WebDOMTestTypedefsPrivate::WebDOMTestTypedefsPrivate):
2594         (WebDOMTestTypedefs::WebDOMTestTypedefsPrivate):
2595         (WebDOMTestTypedefs::WebDOMTestTypedefs):
2596         (WebDOMTestTypedefs::operator=):
2597         (WebDOMTestTypedefs::impl):
2598         (WebDOMTestTypedefs::~WebDOMTestTypedefs):
2599         (WebDOMTestTypedefs::unsignedLongLongAttr):
2600         (WebDOMTestTypedefs::setUnsignedLongLongAttr):
2601         (WebDOMTestTypedefs::immutableSerializedScriptValue):
2602         (WebDOMTestTypedefs::setImmutableSerializedScriptValue):
2603         (WebDOMTestTypedefs::func):
2604         (WebDOMTestTypedefs::multiTransferList):
2605         (WebDOMTestTypedefs::setShadow):
2606         (WebDOMTestTypedefs::nullableArrayArg):
2607         (WebDOMTestTypedefs::immutablePointFunction):
2608         (toWebCore):
2609         (toWebKit):
2610         * bindings/scripts/test/CPP/WebDOMTestTypedefs.h: Added.
2611         (WebCore):
2612         (WebDOMTestTypedefs):
2613         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp: Added.
2614         (_WebKitDOMTestTypedefsPrivate):
2615         (WebKit):
2616         (WebKit::kit):
2617         (WebKit::core):
2618         (WebKit::wrapTestTypedefs):
2619         (webkit_dom_test_typedefs_finalize):
2620         (webkit_dom_test_typedefs_set_property):
2621         (webkit_dom_test_typedefs_get_property):
2622         (webkit_dom_test_typedefs_constructor):
2623         (webkit_dom_test_typedefs_class_init):
2624         (webkit_dom_test_typedefs_init):
2625         (webkit_dom_test_typedefs_func):
2626         (webkit_dom_test_typedefs_multi_transfer_list):
2627         (webkit_dom_test_typedefs_set_shadow):
2628         (webkit_dom_test_typedefs_nullable_array_arg):
2629         (webkit_dom_test_typedefs_immutable_point_function):
2630         (webkit_dom_test_typedefs_string_array_function):
2631         (webkit_dom_test_typedefs_get_unsigned_long_long_attr):
2632         (webkit_dom_test_typedefs_set_unsigned_long_long_attr):
2633         (webkit_dom_test_typedefs_get_immutable_serialized_script_value):
2634         (webkit_dom_test_typedefs_set_immutable_serialized_script_value):
2635         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h: Added.
2636         (_WebKitDOMTestTypedefs):
2637         (_WebKitDOMTestTypedefsClass):
2638         * bindings/scripts/test/GObject/WebKitDOMTestTypedefsPrivate.h: Added.
2639         (WebKit):
2640         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added.
2641         (WebCore):
2642         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
2643         (WebCore::JSTestTypedefsConstructor::JSTestTypedefsConstructor):
2644         (WebCore::JSTestTypedefsConstructor::finishCreation):
2645         (WebCore::JSTestTypedefsConstructor::getOwnPropertySlot):
2646         (WebCore::JSTestTypedefsConstructor::getOwnPropertyDescriptor):
2647         (WebCore::JSTestTypedefsConstructor::getConstructData):
2648         (WebCore::JSTestTypedefsPrototype::self):
2649         (WebCore::JSTestTypedefsPrototype::getOwnPropertySlot):
2650         (WebCore::JSTestTypedefsPrototype::getOwnPropertyDescriptor):
2651         (WebCore::JSTestTypedefs::JSTestTypedefs):
2652         (WebCore::JSTestTypedefs::finishCreation):
2653         (WebCore::JSTestTypedefs::createPrototype):
2654         (WebCore::JSTestTypedefs::destroy):
2655         (WebCore::JSTestTypedefs::~JSTestTypedefs):
2656         (WebCore::JSTestTypedefs::getOwnPropertySlot):
2657         (WebCore::JSTestTypedefs::getOwnPropertyDescriptor):
2658         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
2659         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
2660         (WebCore::jsTestTypedefsConstructorTestSubObj):
2661         (WebCore::jsTestTypedefsConstructor):
2662         (WebCore::JSTestTypedefs::put):
2663         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
2664         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
2665         (WebCore::JSTestTypedefs::getConstructor):
2666         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
2667         (WebCore::jsTestTypedefsPrototypeFunctionMultiTransferList):
2668         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
2669         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
2670         (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
2671         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
2672         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
2673         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
2674         (WebCore::isObservable):
2675         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2676         (WebCore::JSTestTypedefsOwner::finalize):
2677         (WebCore::toJS):
2678         (WebCore::toTestTypedefs):
2679         * bindings/scripts/test/JS/JSTestTypedefs.h: Added.
2680         (WebCore):
2681         (JSTestTypedefs):
2682         (WebCore::JSTestTypedefs::create):
2683         (WebCore::JSTestTypedefs::createStructure):
2684         (WebCore::JSTestTypedefs::impl):
2685         (WebCore::JSTestTypedefs::releaseImpl):
2686         (WebCore::JSTestTypedefs::releaseImplIfNotNull):
2687         (JSTestTypedefsOwner):
2688         (WebCore::wrapperOwner):
2689         (WebCore::wrapperContext):
2690         (JSTestTypedefsPrototype):
2691         (WebCore::JSTestTypedefsPrototype::create):
2692         (WebCore::JSTestTypedefsPrototype::createStructure):
2693         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
2694         (JSTestTypedefsConstructor):
2695         (WebCore::JSTestTypedefsConstructor::create):
2696         (WebCore::JSTestTypedefsConstructor::createStructure):
2697         * bindings/scripts/test/ObjC/DOMTestTypedefs.h: Added.
2698         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: Added.
2699         (-[DOMTestTypedefs dealloc]):
2700         (-[DOMTestTypedefs finalize]):
2701         (-[DOMTestTypedefs unsignedLongLongAttr]):
2702         (-[DOMTestTypedefs setUnsignedLongLongAttr:]):
2703         (-[DOMTestTypedefs immutableSerializedScriptValue]):
2704         (-[DOMTestTypedefs setImmutableSerializedScriptValue:]):
2705         (-[DOMTestTypedefs multiTransferList:tx:second:txx:]):
2706         (-[DOMTestTypedefs setShadow:height:blur:color:alpha:]):
2707         (-[DOMTestTypedefs immutablePointFunction]):
2708         (core):
2709         (kit):
2710         * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: Added.
2711         (WebCore):
2712         * bindings/scripts/test/TestTypedefs.idl: Added.
2713         * bindings/scripts/test/V8/V8TestTypedefs.cpp: Added.
2714         (WebCore):
2715         (WebCore::checkTypeOrDieTrying):
2716         (TestTypedefsV8Internal):
2717         (WebCore::TestTypedefsV8Internal::V8_USE):
2718         (WebCore::TestTypedefsV8Internal::unsignedLongLongAttrAttrGetter):
2719         (WebCore::TestTypedefsV8Internal::unsignedLongLongAttrAttrSetter):
2720         (WebCore::TestTypedefsV8Internal::immutableSerializedScriptValueAttrGetter):
2721         (WebCore::TestTypedefsV8Internal::immutableSerializedScriptValueAttrSetter):
2722         (WebCore::TestTypedefsV8Internal::TestTypedefsConstructorGetter):
2723         (WebCore::TestTypedefsV8Internal::TestTypedefsReplaceableAttrSetter):
2724         (WebCore::TestTypedefsV8Internal::funcCallback):
2725         (WebCore::TestTypedefsV8Internal::multiTransferListCallback):
2726         (WebCore::TestTypedefsV8Internal::setShadowCallback):
2727         (WebCore::TestTypedefsV8Internal::methodWithSequenceArgCallback):
2728         (WebCore::TestTypedefsV8Internal::nullableArrayArgCallback):
2729         (WebCore::TestTypedefsV8Internal::funcWithClampCallback):
2730         (WebCore::TestTypedefsV8Internal::immutablePointFunctionCallback):
2731         (WebCore::TestTypedefsV8Internal::stringArrayFunctionCallback):
2732         (WebCore::V8TestTypedefs::constructorCallback):
2733         (WebCore::ConfigureV8TestTypedefsTemplate):
2734         (WebCore::V8TestTypedefs::GetRawTemplate):
2735         (WebCore::V8TestTypedefs::GetTemplate):
2736         (WebCore::V8TestTypedefs::HasInstance):
2737         (WebCore::V8TestTypedefs::createWrapper):
2738         (WebCore::V8TestTypedefs::derefObject):
2739         * bindings/scripts/test/V8/V8TestTypedefs.h: Added.
2740         (WebCore):
2741         (V8TestTypedefs):
2742         (WebCore::V8TestTypedefs::toNative):
2743         (WebCore::V8TestTypedefs::installPerContextProperties):
2744         (WebCore::V8TestTypedefs::installPerContextPrototypeProperties):
2745         (WebCore::wrap):
2746         (WebCore::toV8):
2747         (WebCore::toV8Fast):
2748
2749 2013-02-13  Kentaro Hara  <haraken@chromium.org>
2750
2751         [V8] Rename XXXAccessorGetter() to XXXAttrGetterCustom(),
2752         and XXXAccessorSetter() to XXXAttrSetterCustom()
2753         https://bugs.webkit.org/show_bug.cgi?id=109679
2754
2755         Reviewed by Adam Barth.
2756
2757         For naming consistency and clarification.
2758
2759         No tests. No change in behavior.
2760
2761         * bindings/scripts/CodeGeneratorV8.pm:
2762         (GenerateHeader):
2763         (GenerateHeaderCustomCall):
2764         (GenerateNormalAttrGetter):
2765         (GenerateNormalAttrSetter):
2766         (GenerateImplementation):
2767         * bindings/scripts/test/V8/V8TestInterface.cpp:
2768         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
2769         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
2770         * bindings/scripts/test/V8/V8TestObj.cpp:
2771         (WebCore::TestObjV8Internal::customAttrAttrGetter):
2772         (WebCore::TestObjV8Internal::customAttrAttrSetter):
2773         * bindings/scripts/test/V8/V8TestObj.h:
2774         (V8TestObj):
2775         * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
2776         (WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):
2777         * bindings/v8/custom/V8BiquadFilterNodeCustom.cpp:
2778         (WebCore::V8BiquadFilterNode::typeAttrSetterCustom):
2779         * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
2780         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrGetterCustom):
2781         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrSetterCustom):
2782         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrGetterCustom):
2783         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrSetterCustom):
2784         * bindings/v8/custom/V8ClipboardCustom.cpp:
2785         (WebCore::V8Clipboard::typesAttrGetterCustom):
2786         * bindings/v8/custom/V8CoordinatesCustom.cpp:
2787         (WebCore::V8Coordinates::altitudeAttrGetterCustom):
2788         (WebCore::V8Coordinates::altitudeAccuracyAttrGetterCustom):
2789         (WebCore::V8Coordinates::headingAttrGetterCustom):
2790         (WebCore::V8Coordinates::speedAttrGetterCustom):
2791         * bindings/v8/custom/V8CustomEventCustom.cpp:
2792         (WebCore::V8CustomEvent::detailAttrGetterCustom):
2793         * bindings/v8/custom/V8DOMWindowCustom.cpp:
2794         (WebCore::V8DOMWindow::eventAttrGetterCustom):
2795         (WebCore::V8DOMWindow::eventAttrSetterCustom):
2796         (WebCore::V8DOMWindow::locationAttrSetterCustom):
2797         (WebCore::V8DOMWindow::openerAttrSetterCustom):
2798         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
2799         (WebCore::V8DeviceMotionEvent::accelerationAttrGetterCustom):
2800         (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAttrGetterCustom):
2801         (WebCore::V8DeviceMotionEvent::rotationRateAttrGetterCustom):
2802         (WebCore::V8DeviceMotionEvent::intervalAttrGetterCustom):
2803         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
2804         (WebCore::V8DeviceOrientationEvent::alphaAttrGetterCustom):
2805         (WebCore::V8DeviceOrientationEvent::betaAttrGetterCustom):
2806         (WebCore::V8DeviceOrientationEvent::gammaAttrGetterCustom):
2807         (WebCore::V8DeviceOrientationEvent::absoluteAttrGetterCustom):
2808         * bindings/v8/custom/V8DocumentLocationCustom.cpp:
2809         (WebCore::V8Document::locationAttrGetterCustom):
2810         (WebCore::V8Document::locationAttrSetterCustom):
2811         * bindings/v8/custom/V8EventCustom.cpp:
2812         (WebCore::V8Event::dataTransferAttrGetterCustom):
2813         (WebCore::V8Event::clipboardDataAttrGetterCustom):
2814         * bindings/v8/custom/V8FileReaderCustom.cpp:
2815         (WebCore::V8FileReader::resultAttrGetterCustom):
2816         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
2817         (WebCore::V8HTMLDocument::allAttrSetterCustom):
2818         * bindings/v8/custom/V8HTMLElementCustom.cpp:
2819         (WebCore::V8HTMLElement::itemValueAttrGetterCustom):
2820         (WebCore::V8HTMLElement::itemValueAttrSetterCustom):
2821         * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
2822         (WebCore::V8HTMLFrameElement::locationAttrSetterCustom):
2823         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
2824         (WebCore::V8HTMLInputElement::selectionStartAttrGetterCustom):
2825         (WebCore::V8HTMLInputElement::selectionStartAttrSetterCustom):
2826         (WebCore::V8HTMLInputElement::selectionEndAttrGetterCustom):
2827         (WebCore::V8HTMLInputElement::selectionEndAttrSetterCustom):
2828         (WebCore::V8HTMLInputElement::selectionDirectionAttrGetterCustom):
2829         (WebCore::V8HTMLInputElement::selectionDirectionAttrSetterCustom):
2830         * bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
2831         (WebCore::V8HTMLLinkElement::sizesAttrGetterCustom):
2832         (WebCore::V8HTMLLinkElement::sizesAttrSetterCustom):
2833         * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
2834         (WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):
2835         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
2836         (WebCore::V8HTMLOptionsCollection::lengthAttrSetterCustom):
2837         * bindings/v8/custom/V8HistoryCustom.cpp:
2838         (WebCore::V8History::stateAttrGetterCustom):
2839         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
2840         (WebCore::V8JavaScriptCallFrame::scopeChainAttrGetterCustom):
2841         (WebCore::V8JavaScriptCallFrame::thisObjectAttrGetterCustom):
2842         (WebCore::V8JavaScriptCallFrame::typeAttrGetterCustom):
2843         * bindings/v8/custom/V8LocationCustom.cpp:
2844         (WebCore::V8Location::hashAttrSetterCustom):
2845         (WebCore::V8Location::hostAttrSetterCustom):
2846         (WebCore::V8Location::hostnameAttrSetterCustom):
2847         (WebCore::V8Location::hrefAttrSetterCustom):
2848         (WebCore::V8Location::pathnameAttrSetterCustom):
2849         (WebCore::V8Location::portAttrSetterCustom):
2850         (WebCore::V8Location::protocolAttrSetterCustom):
2851         (WebCore::V8Location::searchAttrSetterCustom):
2852         (WebCore::V8Location::reloadAttrGetterCustom):
2853         (WebCore::V8Location::replaceAttrGetterCustom):
2854         (WebCore::V8Location::assignAttrGetterCustom):
2855         * bindings/v8/custom/V8MessageEventCustom.cpp:
2856         (WebCore::V8MessageEvent::dataAttrGetterCustom):
2857         (WebCore::V8MessageEvent::portsAttrGetterCustom):
2858         * bindings/v8/custom/V8OscillatorNodeCustom.cpp:
2859         (WebCore::V8OscillatorNode::typeAttrSetterCustom):
2860         * bindings/v8/custom/V8PannerNodeCustom.cpp:
2861         (WebCore::V8PannerNode::panningModelAttrSetterCustom):
2862         (WebCore::V8PannerNode::distanceModelAttrSetterCustom):
2863         * bindings/v8/custom/V8PopStateEventCustom.cpp:
2864         (WebCore::V8PopStateEvent::stateAttrGetterCustom):
2865         * bindings/v8/custom/V8SVGLengthCustom.cpp:
2866         (WebCore::V8SVGLength::valueAttrGetterCustom):
2867         (WebCore::V8SVGLength::valueAttrSetterCustom):
2868         * bindings/v8/custom/V8TrackEventCustom.cpp:
2869         (WebCore::V8TrackEvent::trackAttrGetterCustom):
2870         * bindings/v8/custom/V8WebKitAnimationCustom.cpp:
2871         (WebCore::V8WebKitAnimation::iterationCountAttrGetterCustom):
2872         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
2873         (WebCore::V8XMLHttpRequest::responseTextAttrGetterCustom):
2874         (WebCore::V8XMLHttpRequest::responseAttrGetterCustom):
2875
2876 2013-02-14  Yury Semikhatsky  <yurys@chromium.org>
2877
2878         Web Inspector: extract DOM counters graph implementation into its own class
2879         https://bugs.webkit.org/show_bug.cgi?id=109796
2880
2881         Reviewed by Alexander Pavlov.
2882
2883         Extracted DOM counters graph implementation into DOMCountersGraph.js leaving
2884         in MemoryStatistics.js only common parts shared with NativeMemoryGraph.js
2885         Added some closure annotations and converted object literals into classes
2886         with named constructors.
2887
2888         * WebCore.gypi:
2889         * WebCore.vcproj/WebCore.vcproj:
2890         * inspector/compile-front-end.py:
2891         * inspector/front-end/DOMCountersGraph.js: Added.
2892         (WebInspector.DOMCountersGraph):
2893         (WebInspector.DOMCounterUI):
2894         (WebInspector.DOMCountersGraph.Counter):
2895         (WebInspector.DOMCounterUI.prototype.setRange):
2896         (WebInspector.DOMCounterUI.prototype.updateCurrentValue):
2897         (WebInspector.DOMCounterUI.prototype.clearCurrentValueAndMarker):
2898         (WebInspector.DOMCounterUI.prototype.saveImageUnderMarker):
2899         (WebInspector.DOMCounterUI.prototype.restoreImageUnderMarker):
2900         (WebInspector.DOMCounterUI.prototype.discardImageUnderMarker):
2901         (WebInspector.DOMCountersGraph.prototype._createCurrentValuesBar):
2902         (WebInspector.DOMCountersGraph.prototype._createCounterUIList):
2903         (WebInspector.DOMCountersGraph.prototype._createCounterUIList.getNodeCount):
2904         (WebInspector.DOMCountersGraph.prototype._createCounterUIList.getListenerCount):
2905         (WebInspector.DOMCountersGraph.prototype._canvasHeight):
2906         (WebInspector.DOMCountersGraph.prototype._onRecordAdded):
2907         (WebInspector.DOMCountersGraph.prototype._draw):
2908         (WebInspector.DOMCountersGraph.prototype._restoreImageUnderMarker):
2909         (WebInspector.DOMCountersGraph.prototype._saveImageUnderMarker):
2910         (WebInspector.DOMCountersGraph.prototype._drawMarker):
2911         (WebInspector.DOMCountersGraph.prototype._drawGraph):
2912         (WebInspector.DOMCountersGraph.prototype._discardImageUnderMarker):
2913         * inspector/front-end/MemoryStatistics.js:
2914         (WebInspector.MemoryStatistics):
2915         (WebInspector.MemoryStatistics.Counter):
2916         (WebInspector.MemoryStatistics.prototype._createCurrentValuesBar):
2917         (WebInspector.MemoryStatistics.prototype._createCounterUIList):
2918         (WebInspector.MemoryStatistics.prototype.setTopPosition):
2919         (WebInspector.MemoryStatistics.prototype._canvasHeight):
2920         (WebInspector.MemoryStatistics.prototype._onRecordAdded):
2921         (WebInspector.MemoryStatistics.prototype._draw):
2922         (WebInspector.MemoryStatistics.prototype._onClick):
2923         (WebInspector.MemoryStatistics.prototype._onMouseOut):
2924         (WebInspector.MemoryStatistics.prototype._onMouseOver):
2925         (WebInspector.MemoryStatistics.prototype._onMouseMove):
2926         (WebInspector.MemoryStatistics.prototype._restoreImageUnderMarker):
2927         (WebInspector.MemoryStatistics.prototype._drawMarker):
2928         (WebInspector.MemoryStatistics.prototype._discardImageUnderMarker):
2929         * inspector/front-end/NativeMemoryGraph.js:
2930         (WebInspector.NativeMemoryGraph.Counter):
2931         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics):
2932         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded):
2933         (WebInspector.NativeMemoryGraph.prototype._draw):
2934         * inspector/front-end/TimelinePanel.js:
2935         * inspector/front-end/WebKit.qrc:
2936
2937 2013-02-13  Ilya Tikhonovsky  <loislo@chromium.org>
2938
2939         Web Inspector: Native Memory Instrumentation: Report child nodes as direct members of a container node to make them look like a tree in the snapshot.
2940         https://bugs.webkit.org/show_bug.cgi?id=109703
2941
2942         Also we need to traverse the tree from the top root element down to the leaves.
2943
2944         Reviewed by Yury Semikhatsky.
2945
2946         * dom/ContainerNode.cpp:
2947         (WebCore::ContainerNode::reportMemoryUsage):
2948         * dom/Node.cpp:
2949         (WebCore::Node::reportMemoryUsage):
2950         * inspector/InspectorMemoryAgent.cpp:
2951         (WebCore):
2952
2953 2013-02-13  Hayato Ito  <hayato@chromium.org>
2954
2955         [Shadow DOM] Implements a '::distributed()' pseudo element.
2956         https://bugs.webkit.org/show_bug.cgi?id=82169
2957
2958         Reviewed by Dimitri Glazkov.
2959
2960         Implements a '::distributed()' pseudo element.
2961         See the Shadow DOM specification and the filed bug for the detail.
2962
2963         - http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#selecting-nodes-distributed-to-insertion-points
2964         - https://www.w3.org/Bugs/Public/show_bug.cgi?id=19684
2965
2966         For example, suppose we are given the following DOM tree and shadow tree:
2967
2968         - <A>
2969           - <B>
2970             - <C>
2971
2972         [A's ShadowRoot]
2973           <D>
2974           - <style>
2975               E content::distributed(B C) { color: green; }
2976           - <E>
2977             - <content>  (Node B is distributed to this insertion point.)
2978
2979         In this case, the style rule defined in the shadow tree matches node 'C'.
2980
2981         A '::distributed()' pseudo element can not be a pseudo class since
2982         an intersection between matched_elements(some_selector) and
2983         matched_elements(some_selector::distributed(...)) is always an
2984         empty set. A '::distributed()' pseudo element is the first-ever
2985         *functional* pseudo element which takes a parameter, which can be
2986         a selector.
2987
2988         This rule crosses the shadow boundary from a shadow tree to the
2989         tree of its shadow host. That means a rule which includes
2990         '::distributed()' pseudo element is defined in shadow tree, but
2991         the node which is matched in the rule, the subject of the
2992         selector, is outside of the shadow tree. Therefore, we cannot
2993         predict where the subject of the selector will be beforehand.
2994         Current CSS implementation assumes the subject of the selector
2995         must exist in the current scope.
2996
2997         To overcome this issue, DocumentRuleSets now has a instance of
2998         ShadowDistributedRules class.  A style rule will be stored in this
2999         instance if the rule includes a '::distributed()' pseudo element.
3000         This class also keeps track of each RuleSet by mapping it with a
3001         scope where the rule was originally defined. In the example, the
3002         scope is A's ShadowRoot.  The scope is used to check whether the
3003         left-most matched element (in the example, it's a node 'E') exists
3004         in the scope.
3005
3006         Internally, a '::distributed' pseudo element is represented by a
3007         newly introduced 'ShadowDistributed' relation.  That makes an
3008         implementation of SelectorChecker::checkSelector() much simpler.
3009         A transformation from a distributed pseudo element to a
3010         ShadowDistributed is done in parsing stage of CSS.
3011
3012         Since '::distributed()' is an experimental feature, it's actually
3013         prefixed with '-webkit-' and guarded by SHADOW_DOM flag.
3014
3015         Tests: fast/dom/shadow/distributed-pseudo-element-for-shadow-element.html
3016                fast/dom/shadow/distributed-pseudo-element-match-all.html
3017                fast/dom/shadow/distributed-pseudo-element-match-descendant.html
3018                fast/dom/shadow/distributed-pseudo-element-nested.html
3019                fast/dom/shadow/distributed-pseudo-element-no-match.html
3020                fast/dom/shadow/distributed-pseudo-element-reprojection.html
3021                fast/dom/shadow/distributed-pseudo-element-scoped.html
3022                fast/dom/shadow/distributed-pseudo-element-support-selector.html
3023                fast/dom/shadow/distributed-pseudo-element-used-in-selector-list.html
3024                fast/dom/shadow/distributed-pseudo-element-with-any.html
3025                fast/dom/shadow/distributed-pseudo-element.html
3026
3027         * css/CSSGrammar.y.in:
3028         CSS Grammar was updated to support '::distrbuted(selector)'.
3029         This pseudo element is the first pseudo element which can take a selector as a parameter.
3030         * css/CSSParser.cpp:
3031         (WebCore::CSSParser::detectDashToken):
3032         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
3033         (WebCore::CSSParser::rewriteSpecifiersWithElementName):
3034         Here we are converting a '::distributed' pseudo element into a
3035         ShadowDistributed relation internally.  To support the conversion,
3036         these rewriteSpecifiersXXX functions (formally called
3037         updateSpecifiersXXX) now return the specifiers which may be
3038         converted.
3039         (WebCore::CSSParser::rewriteSpecifiers):
3040         * css/CSSParser.h:
3041         * css/CSSParserValues.cpp:
3042         (WebCore::CSSParserSelector::CSSParserSelector):
3043         * css/CSSParserValues.h:
3044         (CSSParserSelector):
3045         (WebCore::CSSParserSelector::functionArgumentSelector):
3046         To hold an intermediate selector which appears at the position of an argument in
3047         functional pseudo element when parsing CSS.
3048         (WebCore::CSSParserSelector::setFunctionArgumentSelector):
3049         (WebCore::CSSParserSelector::isDistributedPseudoElement):
3050         * css/CSSSelector.cpp:
3051         Add new pseudo element, PseudoDistributed, and its internal representation, ShadowDistributed relation.
3052         (WebCore::CSSSelector::pseudoId):
3053         (WebCore::nameToPseudoTypeMap):
3054         (WebCore::CSSSelector::extractPseudoType):
3055         (WebCore::CSSSelector::selectorText):
3056         * css/CSSSelector.h:
3057         (CSSSelector):
3058         (WebCore):
3059         (WebCore::CSSSelector::isDistributedPseudoElement):
3060         (WebCore::CSSSelector::isShadowDistributed):
3061         * css/CSSSelectorList.cpp:
3062         (WebCore):
3063         (SelectorHasShadowDistributed):
3064         (WebCore::SelectorHasShadowDistributed::operator()):
3065         (WebCore::CSSSelectorList::hasShadowDistributedAt):
3066         * css/CSSSelectorList.h:
3067         (CSSSelectorList):
3068         * css/DocumentRuleSets.cpp:
3069         (WebCore):
3070         (WebCore::ShadowDistributedRules::addRule):
3071         Every CSS rule which includes '::distributed(...)' should be managed by calling this function.
3072         (WebCore::ShadowDistributedRules::collectMatchRequests):
3073         (WebCore::DocumentRuleSets::resetAuthorStyle):
3074         * css/DocumentRuleSets.h:
3075         (WebCore):
3076         (ShadowDistributedRules):
3077         (WebCore::ShadowDistributedRules::clear):
3078         (DocumentRuleSets):
3079         (WebCore::DocumentRuleSets::shadowDistributedRules)
3080         DocumentRuleSets owns an instance of ShadowDistributedRules.
3081         * css/RuleSet.cpp:
3082         (WebCore::RuleSet::addChildRules):
3083         Updated to check whether the rule contains '::distributed()' or not.
3084         * css/SelectorChecker.cpp:
3085         (WebCore::SelectorChecker::match):
3086         Support ShadowDistributed relation. Check all possible insertion points where a node is distributed.
3087         * css/SelectorChecker.h:
3088         (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext):
3089         Adds enum of BehaviorAtBoundary. '::distributed()' is the only
3090         rule which uses 'CrossedBoundary' since it is the only rule which
3091         crosses shadow boundaries.
3092         (SelectorCheckingContext):
3093         * css/SelectorFilter.cpp:
3094         (WebCore::SelectorFilter::collectIdentifierHashes):
3095         * css/StyleResolver.cpp:
3096         (WebCore::StyleResolver::collectMatchingRules):
3097         (WebCore::StyleResolver::matchAuthorRules):
3098         (WebCore::StyleResolver::collectMatchingRulesForList):
3099         (WebCore::StyleResolver::ruleMatches):
3100         * css/StyleResolver.h:
3101         (MatchRequest):
3102         (WebCore::MatchRequest::MatchRequest): Add behaviorAtBoundary field.
3103         (WebCore):
3104         (StyleResolver):
3105         * html/shadow/InsertionPoint.cpp:
3106         (WebCore::collectInsertionPointsWhereNodeIsDistributed):
3107         (WebCore):
3108         * html/shadow/InsertionPoint.h:
3109         (WebCore):
3110
3111 2013-02-13  Kentaro Hara  <haraken@chromium.org>
3112
3113         [V8] Generate wrapper methods for custom methods
3114         https://bugs.webkit.org/show_bug.cgi?id=109678
3115
3116         Reviewed by Adam Barth.
3117
3118         Currently V8 directly calls back custom methods written
3119         in custom binding files. This makes it impossible for code
3120         generators to hook custom methods (e.g. Code generators cannot
3121         insert a code for FeatureObservation into custom methods).
3122         To solve the problem, we should generate wrapper methods for
3123         custom methods.
3124
3125         No tests. No change in behavior.
3126
3127         * page/DOMWindow.idl: Removed overloaded methods. The fact that methods in an IDL
3128         file are overloaded but they are not overloaded in custom bindings confuses code
3129         generators. (For some reason, this problem hasn't appeared before this change.)
3130         * xml/XMLHttpRequest.idl: Ditto.
3131
3132         * bindings/scripts/CodeGeneratorV8.pm:
3133         (GenerateHeader):
3134         (GenerateDomainSafeFunctionGetter):
3135         (GenerateEventListenerCallback):
3136         (GenerateFunctionCallback):
3137         (GenerateNonStandardFunction):
3138         (GenerateImplementation):
3139         * bindings/scripts/test/V8/V8TestInterface.cpp:
3140         (WebCore::TestInterfaceV8Internal::supplementalMethod3Callback):
3141         (TestInterfaceV8Internal):
3142         (WebCore):
3143         * bindings/scripts/test/V8/V8TestObj.cpp:
3144         (WebCore::TestObjV8Internal::customMethodCallback):
3145         (TestObjV8Internal):
3146         (WebCore::TestObjV8Internal::customMethodWithArgsCallback):
3147         (WebCore::TestObjV8Internal::classMethod2Callback):
3148         (WebCore):
3149         (WebCore::ConfigureV8TestObjTemplate):
3150         * bindings/scripts/test/V8/V8TestObj.h:
3151         (V8TestObj):
3152         * bindings/v8/custom/V8ClipboardCustom.cpp:
3153         (WebCore::V8Clipboard::clearDataCallbackCustom):
3154         (WebCore::V8Clipboard::setDragImageCallbackCustom):
3155         * bindings/v8/custom/V8ConsoleCustom.cpp:
3156         (WebCore::V8Console::traceCallbackCustom):
3157         (WebCore::V8Console::assertCallbackCustom):
3158         (WebCore::V8Console::profileCallbackCustom):
3159         (WebCore::V8Console::profileEndCallbackCustom):
3160         * bindings/v8/custom/V8CryptoCustom.cpp:
3161         (WebCore::V8Crypto::getRandomValuesCallbackCustom):
3162         * bindings/v8/custom/V8DOMFormDataCustom.cpp:
3163         (WebCore::V8DOMFormData::appendCallbackCustom):
3164         * bindings/v8/custom/V8DOMWindowCustom.cpp:
3165         (WebCore::V8DOMWindow::addEventListenerCallbackCustom):
3166         (WebCore::V8DOMWindow::removeEventListenerCallbackCustom):
3167         (WebCore::V8DOMWindow::postMessageCallbackCustom):
3168         (WebCore::V8DOMWindow::toStringCallbackCustom):
3169         (WebCore::V8DOMWindow::releaseEventsCallbackCustom):
3170         (WebCore::V8DOMWindow::captureEventsCallbackCustom):
3171         (WebCore::V8DOMWindow::showModalDialogCallbackCustom):
3172         (WebCore::V8DOMWindow::openCallbackCustom):
3173         (WebCore::V8DOMWindow::setTimeoutCallbackCustom):
3174         (WebCore::V8DOMWindow::setIntervalCallbackCustom):
3175         * bindings/v8/custom/V8DataViewCustom.cpp:
3176         (WebCore::V8DataView::getInt8CallbackCustom):
3177         (WebCore::V8DataView::getUint8CallbackCustom):
3178         (WebCore::V8DataView::setInt8CallbackCustom):
3179         (WebCore::V8DataView::setUint8CallbackCustom):
3180         * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
3181         (WebCore::V8DedicatedWorkerContext::postMessageCallbackCustom):
3182         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
3183         (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallbackCustom):
3184         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
3185         (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallbackCustom):
3186         * bindings/v8/custom/V8DocumentCustom.cpp:
3187         (WebCore::V8Document::evaluateCallbackCustom):
3188         (WebCore::V8Document::createTouchListCallbackCustom):
3189         * bindings/v8/custom/V8GeolocationCustom.cpp:
3190         (WebCore::V8Geolocation::getCurrentPositionCallbackCustom):
3191         (WebCore::V8Geolocation::watchPositionCallbackCustom):
3192         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
3193         (WebCore::V8HTMLAllCollection::itemCallbackCustom):
3194         (WebCore::V8HTMLAllCollection::namedItemCallbackCustom):
3195         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
3196         (WebCore::V8HTMLCanvasElement::getContextCallbackCustom):
3197         (WebCore::V8HTMLCanvasElement::toDataURLCallbackCustom):
3198         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
3199         (WebCore::V8HTMLDocument::writeCallbackCustom):
3200         (WebCore::V8HTMLDocument::writelnCallbackCustom):
3201         (WebCore::V8HTMLDocument::openCallbackCustom):
3202         * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp:
3203         (WebCore::V8HTMLFormControlsCollection::namedItemCallbackCustom):
3204         * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
3205         (WebCore::v8HTMLImageElementConstructorCallbackCustom):
3206         (WebCore::V8HTMLImageElementConstructor::GetTemplate):
3207         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
3208         (WebCore::V8HTMLInputElement::setSelectionRangeCallbackCustom):
3209         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
3210         (WebCore::V8HTMLOptionsCollection::namedItemCallbackCustom):
3211         (WebCore::V8HTMLOptionsCollection::removeCallbackCustom):
3212         (WebCore::V8HTMLOptionsCollection::addCallbackCustom):
3213         * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
3214         (WebCore::V8HTMLSelectElement::removeCallbackCustom):
3215         * bindings/v8/custom/V8HistoryCustom.cpp:
3216         (WebCore::V8History::pushStateCallbackCustom):
3217         (WebCore::V8History::replaceStateCallbackCustom):
3218         * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
3219         (WebCore::V8InjectedScriptHost::inspectedObjectCallbackCustom):
3220         (WebCore::V8InjectedScriptHost::internalConstructorNameCallbackCustom):
3221         (WebCore::V8InjectedScriptHost::isHTMLAllCollectionCallbackCustom):
3222         (WebCore::V8InjectedScriptHost::typeCallbackCustom):
3223         (WebCore::V8InjectedScriptHost::functionDetailsCallbackCustom):
3224         (WebCore::V8InjectedScriptHost::getInternalPropertiesCallbackCustom):
3225         (WebCore::V8InjectedScriptHost::getEventListenersCallbackCustom):
3226         (WebCore::V8InjectedScriptHost::inspectCallbackCustom):
3227         (WebCore::V8InjectedScriptHost::databaseIdCallbackCustom):
3228         (WebCore::V8InjectedScriptHost::storageIdCallbackCustom):
3229         (WebCore::V8InjectedScriptHost::evaluateCallbackCustom):
3230         (WebCore::V8InjectedScriptHost::setFunctionVariableValueCallbackCustom):
3231         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
3232         (WebCore::V8InspectorFrontendHost::platformCallbackCustom):
3233         (WebCore::V8InspectorFrontendHost::portCallbackCustom):
3234         (WebCore::V8InspectorFrontendHost::showContextMenuCallbackCustom):
3235         (WebCore::V8InspectorFrontendHost::recordActionTakenCallbackCustom):
3236         (WebCore::V8InspectorFrontendHost::recordPanelShownCallbackCustom):
3237         (WebCore::V8InspectorFrontendHost::recordSettingChangedCallbackCustom):
3238         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
3239         (WebCore::V8JavaScriptCallFrame::evaluateCallbackCustom):
3240         (WebCore::V8JavaScriptCallFrame::restartCallbackCustom):
3241         (WebCore::V8JavaScriptCallFrame::setVariableValueCallbackCustom):
3242         (WebCore::V8JavaScriptCallFrame::scopeTypeCallbackCustom):
3243         * bindings/v8/custom/V8LocationCustom.cpp:
3244         (WebCore::V8Location::reloadAccessorGetter):
3245         (WebCore::V8Location::replaceAccessorGetter):
3246         (WebCore::V8Location::assignAccessorGetter):
3247         (WebCore::V8Location::reloadCallbackCustom):
3248         (WebCore::V8Location::replaceCallbackCustom):
3249         (WebCore::V8Location::assignCallbackCustom):
3250         (WebCore::V8Location::valueOfCallbackCustom):
3251         (WebCore::V8Location::toStringCallbackCustom):
3252         * bindings/v8/custom/V8MessageEventCustom.cpp:
3253         (WebCore::V8MessageEvent::initMessageEventCallbackCustom):
3254         (WebCore::V8MessageEvent::webkitInitMessageEventCallbackCustom):
3255         * bindings/v8/custom/V8MessagePortCustom.cpp:
3256         (WebCore::V8MessagePort::postMessageCallbackCustom):
3257         * bindings/v8/custom/V8NodeCustom.cpp:
3258         (WebCore::V8Node::insertBeforeCallbackCustom):
3259         (WebCore::V8Node::replaceChildCallbackCustom):
3260         (WebCore::V8Node::removeChildCallbackCustom):
3261         (WebCore::V8Node::appendChildCallbackCustom):
3262         * bindings/v8/custom/V8NotificationCenterCustom.cpp:
3263         (WebCore::V8NotificationCenter::requestPermissionCallbackCustom):
3264         * bindings/v8/custom/V8NotificationCustom.cpp:
3265         (WebCore::V8Notification::requestPermissionCallbackCustom):
3266         * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
3267         (WebCore::V8SQLResultSetRowList::itemCallbackCustom):
3268         * bindings/v8/custom/V8SQLTransactionCustom.cpp:
3269         (WebCore::V8SQLTransaction::executeSqlCallbackCustom):
3270         * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
3271         (WebCore::V8SQLTransactionSync::executeSqlCallbackCustom):
3272         * bindings/v8/custom/V8SVGLengthCustom.cpp:
3273         (WebCore::V8SVGLength::convertToSpecifiedUnitsCallbackCustom):
3274         * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
3275         (WebCore::V8WebGLRenderingContext::getAttachedShadersCallbackCustom):
3276         (WebCore::V8WebGLRenderingContext::getBufferParameterCallbackCustom):
3277         (WebCore::V8WebGLRenderingContext::getExtensionCallbackCustom):
3278         (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallbackCustom):
3279         (WebCore::V8WebGLRenderingContext::getParameterCallbackCustom):
3280         (WebCore::V8WebGLRenderingContext::getProgramParameterCallbackCustom):
3281         (WebCore::V8WebGLRenderingContext::getRenderbufferParameterCallbackCustom):
3282         (WebCore::V8WebGLRenderingContext::getShaderParameterCallbackCustom):
3283         (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallbackCustom):
3284         (WebCore::V8WebGLRenderingContext::getTexParameterCallbackCustom):
3285         (WebCore::V8WebGLRenderingContext::getUniformCallbackCustom):
3286         (WebCore::V8WebGLRenderingContext::getVertexAttribCallbackCustom):
3287         (WebCore::V8WebGLRenderingContext::uniform1fvCallbackCustom):
3288         (WebCore::V8WebGLRenderingContext::uniform1ivCallbackCustom):
3289         (WebCore::V8WebGLRenderingContext::uniform2fvCallbackCustom):
3290         (WebCore::V8WebGLRenderingContext::uniform2ivCallbackCustom):
3291         (WebCore::V8WebGLRenderingContext::uniform3fvCallbackCustom):
3292         (WebCore::V8WebGLRenderingContext::uniform3ivCallbackCustom):
3293         (WebCore::V8WebGLRenderingContext::uniform4fvCallbackCustom):
3294         (WebCore::V8WebGLRenderingContext::uniform4ivCallbackCustom):
3295         (WebCore::V8WebGLRenderingContext::uniformMatrix2fvCallbackCustom):
3296         (WebCore::V8WebGLRenderingContext::uniformMatrix3fvCallbackCustom):
3297         (WebCore::V8WebGLRenderingContext::uniformMatrix4fvCallbackCustom):
3298         (WebCore::V8WebGLRenderingContext::vertexAttrib1fvCallbackCustom):
3299         (WebCore::V8WebGLRenderingContext::vertexAttrib2fvCallbackCustom):
3300         (WebCore::V8WebGLRenderingContext::vertexAttrib3fvCallbackCustom):
3301         (WebCore::V8WebGLRenderingContext::vertexAttrib4fvCallbackCustom):
3302         * bindings/v8/custom/V8WorkerContextCustom.cpp:
3303         (WebCore::V8WorkerContext::importScriptsCallbackCustom):
3304         (WebCore::V8WorkerContext::setTimeoutCallbackCustom):
3305         (WebCore::V8WorkerContext::setIntervalCallbackCustom):
3306         * bindings/v8/custom/V8WorkerCustom.cpp:
3307         (WebCore::V8Worker::postMessageCallbackCustom):
3308         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
3309         (WebCore::V8XMLHttpRequest::openCallbackCustom):
3310         (WebCore::V8XMLHttpRequest::sendCallbackCustom):
3311         * bindings/v8/custom/V8XSLTProcessorCustom.cpp:
3312         (WebCore::V8XSLTProcessor::setParameterCallbackCustom):
3313         (WebCore::V8XSLTProcessor::getParameterCallbackCustom):
3314         (WebCore::V8XSLTProcessor::removeParameterCallbackCustom):
3315
3316 2013-02-13  Praveen R Jadhav  <praveen.j@samsung.com>
3317
3318         JSObject for ChannelSplitterNode and ChannelMergerNode are not created.
3319         https://bugs.webkit.org/show_bug.cgi?id=109542
3320
3321         Reviewed by Kentaro Hara.
3322
3323         "JSGenerateToJSObject" should be included in IDL files
3324         of ChannelSplitterNode and ChannelMergerNode in WebAudio.
3325         This ensures html files to access corresponding objects.
3326
3327         * Modules/webaudio/ChannelMergerNode.idl:
3328         * Modules/webaudio/ChannelSplitterNode.idl:
3329
3330 2013-02-13   Vineet Chaudhary  <rgf748@motorola.com>
3331
3332         [Regression] After r142831  collection-null-like-arguments.html layout test failing
3333         https://bugs.webkit.org/show_bug.cgi?id=109780
3334
3335         Reviewed by Kentaro Hara.
3336
3337         No new tests. LayoutTests/fast/dom/collection-null-like-arguments.html
3338         Should pass now.
3339
3340         * bindings/js/JSHTMLAllCollectionCustom.cpp: Return null for namedItem() only.
3341         (WebCore::getNamedItems):
3342         (WebCore::JSHTMLAllCollection::namedItem):
3343         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Ditto.
3344         (WebCore::getNamedItems):
3345         (WebCore::JSHTMLFormControlsCollection::namedItem):
3346         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Ditto.
3347         (WebCore::getNamedItems):
3348         (WebCore::JSHTMLOptionsCollection::namedItem):
3349
3350 2013-02-13  Soo-Hyun Choi  <sh9.choi@samsung.com>
3351
3352         Fix indentation error in MediaPlayerPrivateGStreamer.h
3353         https://bugs.webkit.org/show_bug.cgi?id=109768
3354
3355         Reviewed by Kentaro Hara.
3356
3357         No new tests as this patch just changes indentation style.
3358
3359         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3360         (MediaPlayerPrivateGStreamer):
3361         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
3362         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
3363         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
3364         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
3365
3366 2013-02-13  Adam Barth  <abarth@webkit.org>
3367
3368         TokenPreloadScanner should be (mostly!) thread-safe
3369         https://bugs.webkit.org/show_bug.cgi?id=109760
3370
3371         Reviewed by Eric Seidel.
3372
3373         This patch makes the bulk of TokenPreloadScanner thread-safe.  The one
3374         remaining wart is processPossibleBaseTag because it wants to grub
3375         around in the base tag's attributes. I have a plan for that, but it's
3376         going to need to wait for the next patch.
3377
3378         * html/parser/HTMLPreloadScanner.cpp:
3379         (WebCore::isStartTag):
3380         (WebCore::isStartOrEndTag):
3381         (WebCore::TokenPreloadScanner::identifierFor):
3382         (WebCore::TokenPreloadScanner::inititatorFor):
3383         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
3384         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3385         (TokenPreloadScanner::StartTagScanner):
3386         (WebCore::TokenPreloadScanner::processPossibleTemplateTag):
3387         (WebCore::TokenPreloadScanner::processPossibleStyleTag):
3388         (WebCore::TokenPreloadScanner::processPossibleBaseTag):
3389         (WebCore::TokenPreloadScanner::scan):
3390         (WebCore::HTMLPreloadScanner::scan):
3391         * html/parser/HTMLPreloadScanner.h:
3392         (WebCore):
3393
3394 2013-02-13  Adam Barth  <abarth@webkit.org>
3395
3396         StartTagScanner should be thread-safe
3397         https://bugs.webkit.org/show_bug.cgi?id=109750
3398
3399         Reviewed by Eric Seidel.
3400
3401         This patch weens the StartTagScanner off AtomicString using two
3402         techniques:
3403
3404         1) This patch creates an enum to represent the four tag names that the
3405            StartTagScanner needs to understand. Using an enum is better than
3406            using an AtomicString because we can use the enum on both the main
3407            thread and on the background thread.
3408
3409         2) For attributes, this patch uses threadSafeMatch. We're not able to
3410            use threadSafeMatch everywhere due to performance, but using it for
3411            attributes appears to be ok becaues we only call threadSafeMatch on
3412            the attributes of "interesting" tags.
3413
3414         I tested the performance of this patch using
3415         PerformanceTests/Parser/html-parser.html and did not see any slowdown.
3416         (There actually appeared to be a <1% speedup, but I'm attributing that
3417         to noise.)
3418
3419         * html/parser/HTMLPreloadScanner.cpp:
3420         (WebCore::identifierFor):
3421         (WebCore):
3422         (WebCore::inititatorFor):
3423         (WebCore::StartTagScanner::StartTagScanner):
3424         (WebCore::StartTagScanner::processAttributes):
3425         (StartTagScanner):
3426         (WebCore::StartTagScanner::createPreloadRequest):
3427         (WebCore::StartTagScanner::processAttribute):
3428         (WebCore::StartTagScanner::charset):
3429         (WebCore::StartTagScanner::resourceType):
3430         (WebCore::StartTagScanner::shouldPreload):
3431         (WebCore::HTMLPreloadScanner::processToken):
3432
3433 2013-02-13  Huang Dongsung  <luxtella@company100.net>
3434
3435         Coordinated Graphics: a long page is scaled vertically while loading.
3436         https://bugs.webkit.org/show_bug.cgi?id=109645
3437
3438         Reviewed by Noam Rosenthal.
3439
3440         When loading http://www.w3.org/TR/xpath-datamodel/, Coordinated Graphics draws
3441         vertically scaled contents. It is because there is the difference between the
3442         size of a layer and the size of CoordinatedBackingStore.
3443
3444         Currently, CoordinatedGraphicsScene notifies the size to CoordinatedBackingStore
3445         at the moment of creating, updating and removing a tile. However, it is not
3446         necessary to send tile-related messages when the size of layer is changed.
3447         So this patch resets the size of CoordinatedBackingStore when receiving the
3448         message that is created when the size is changed: SyncLayerState.
3449
3450         There is no current way to reliably test flicker issues.
3451
3452         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
3453           Add m_pendingSize to set m_size at the moment of flushing.
3454           After http://webkit.org/b/108294, m_pendingSize will be removed
3455           because the bug makes CoordinatedGraphicsScene execute all messages at
3456           the moment of flushing.
3457         (WebCore::CoordinatedBackingStore::setSize):
3458         (WebCore::CoordinatedBackingStore::commitTileOperations):
3459         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
3460         (CoordinatedBackingStore):
3461         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
3462         (WebCore::CoordinatedGraphicsScene::prepareContentBackingStore):
3463         (WebCore::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
3464         (WebCore::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
3465         (WebCore::CoordinatedGraphicsScene::createTile):
3466         (WebCore::CoordinatedGraphicsScene::removeTile):
3467         (WebCore::CoordinatedGraphicsScene::updateTile):
3468
3469 2013-02-13  Kentaro Hara  <haraken@chromium.org>
3470
3471         [V8] Rename XXXAccessorGetter() to XXXAttrGetterCustom(),
3472         and XXXAccessorSetter() to XXXAttrSetterCustom()
3473         https://bugs.webkit.org/show_bug.cgi?id=109679
3474
3475         Reviewed by Adam Barth.
3476
3477         For naming consistency and clarification.
3478
3479         No tests. No change in behavior.
3480
3481         * bindings/scripts/CodeGeneratorV8.pm:
3482         (GenerateHeader):
3483         (GenerateHeaderCustomCall):
3484         (GenerateNormalAttrGetter):
3485         (GenerateNormalAttrSetter):
3486         (GenerateImplementation):
3487         * bindings/scripts/test/V8/V8TestInterface.cpp:
3488         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
3489         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
3490         * bindings/scripts/test/V8/V8TestObj.cpp:
3491         (WebCore::TestObjV8Internal::customAttrAttrGetter):
3492         (WebCore::TestObjV8Internal::customAttrAttrSetter):
3493         * bindings/scripts/test/V8/V8TestObj.h:
3494         (V8TestObj):
3495         * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
3496         (WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):
3497         * bindings/v8/custom/V8BiquadFilterNodeCustom.cpp:
3498         (WebCore::V8BiquadFilterNode::typeAttrSetterCustom):
3499         * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
3500         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrGetterCustom):
3501         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrSetterCustom):
3502         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrGetterCustom):
3503         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrSetterCustom):
3504         * bindings/v8/custom/V8ClipboardCustom.cpp:
3505         (WebCore::V8Clipboard::typesAttrGetterCustom):
3506         * bindings/v8/custom/V8CoordinatesCustom.cpp:
3507         (WebCore::V8Coordinates::altitudeAttrGetterCustom):
3508         (WebCore::V8Coordinates::altitudeAccuracyAttrGetterCustom):
3509         (WebCore::V8Coordinates::headingAttrGetterCustom):
3510         (WebCore::V8Coordinates::speedAttrGetterCustom):
3511         * bindings/v8/custom/V8CustomEventCustom.cpp:
3512         (WebCore::V8CustomEvent::detailAttrGetterCustom):
3513         * bindings/v8/custom/V8DOMWindowCustom.cpp:
3514         (WebCore::V8DOMWindow::eventAttrGetterCustom):
3515         (WebCore::V8DOMWindow::eventAttrSetterCustom):
3516         (WebCore::V8DOMWindow::locationAttrSetterCustom):
3517         (WebCore::V8DOMWindow::openerAttrSetterCustom):
3518         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
3519         (WebCore::V8DeviceMotionEvent::accelerationAttrGetterCustom):
3520         (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAttrGetterCustom):
3521         (WebCore::V8DeviceMotionEvent::rotationRateAttrGetterCustom):
3522         (WebCore::V8DeviceMotionEvent::intervalAttrGetterCustom):
3523         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
3524         (WebCore::V8DeviceOrientationEvent::alphaAttrGetterCustom):
3525         (WebCore::V8DeviceOrientationEvent::betaAttrGetterCustom):
3526         (WebCore::V8DeviceOrientationEvent::gammaAttrGetterCustom):
3527         (WebCore::V8DeviceOrientationEvent::absoluteAttrGetterCustom):
3528         * bindings/v8/custom/V8DocumentLocationCustom.cpp:
3529         (WebCore::V8Document::locationAttrGetterCustom):
3530         (WebCore::V8Document::locationAttrSetterCustom):
3531         * bindings/v8/custom/V8EventCustom.cpp:
3532         (WebCore::V8Event::dataTransferAttrGetterCustom):
3533         (WebCore::V8Event::clipboardDataAttrGetterCustom):
3534         * bindings/v8/custom/V8FileReaderCustom.cpp:
3535         (WebCore::V8FileReader::resultAttrGetterCustom):
3536         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
3537         (WebCore::V8HTMLDocument::allAttrSetterCustom):
3538         * bindings/v8/custom/V8HTMLElementCustom.cpp:
3539         (WebCore::V8HTMLElement::itemValueAttrGetterCustom):
3540         (WebCore::V8HTMLElement::itemValueAttrSetterCustom):
3541         * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
3542         (WebCore::V8HTMLFrameElement::locationAttrSetterCustom):
3543         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
3544         (WebCore::V8HTMLInputElement::selectionStartAttrGetterCustom):
3545         (WebCore::V8HTMLInputElement::selectionStartAttrSetterCustom):
3546         (WebCore::V8HTMLInputElement::selectionEndAttrGetterCustom):
3547         (WebCore::V8HTMLInputElement::selectionEndAttrSetterCustom):
3548         (WebCore::V8HTMLInputElement::selectionDirectionAttrGetterCustom):
3549         (WebCore::V8HTMLInputElement::selectionDirectionAttrSetterCustom):
3550         * bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
3551         (WebCore::V8HTMLLinkElement::sizesAttrGetterCustom):
3552         (WebCore::V8HTMLLinkElement::sizesAttrSetterCustom):
3553         * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
3554         (WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):
3555         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
3556         (WebCore::V8HTMLOptionsCollection::lengthAttrSetterCustom):
3557         * bindings/v8/custom/V8HistoryCustom.cpp:
3558         (WebCore::V8History::stateAttrGetterCustom):
3559         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
3560         (WebCore::V8JavaScriptCallFrame::scopeChainAttrGetterCustom):
3561         (WebCore::V8JavaScriptCallFrame::thisObjectAttrGetterCustom):
3562         (WebCore::V8JavaScriptCallFrame::typeAttrGetterCustom):
3563         * bindings/v8/custom/V8LocationCustom.cpp:
3564         (WebCore::V8Location::hashAttrSetterCustom):
3565         (WebCore::V8Location::hostAttrSetterCustom):
3566         (WebCore::V8Location::hostnameAttrSetterCustom):
3567         (WebCore::V8Location::hrefAttrSetterCustom):
3568         (WebCore::V8Location::pathnameAttrSetterCustom):
3569         (WebCore::V8Location::portAttrSetterCustom):
3570         (WebCore::V8Location::protocolAttrSetterCustom):
3571         (WebCore::V8Location::searchAttrSetterCustom):
3572         (WebCore::V8Location::reloadAttrGetterCustom):
3573         (WebCore::V8Location::replaceAttrGetterCustom):
3574         (WebCore::V8Location::assignAttrGetterCustom):
3575         * bindings/v8/custom/V8MessageEventCustom.cpp:
3576         (WebCore::V8MessageEvent::dataAttrGetterCustom):
3577         (WebCore::V8MessageEvent::portsAttrGetterCustom):
3578         * bindings/v8/custom/V8OscillatorNodeCustom.cpp:
3579         (WebCore::V8OscillatorNode::typeAttrSetterCustom):
3580         * bindings/v8/custom/V8PannerNodeCustom.cpp:
3581         (WebCore::V8PannerNode::panningModelAttrSetterCustom):
3582         (WebCore::V8PannerNode::distanceModelAttrSetterCustom):
3583         * bindings/v8/custom/V8PopStateEventCustom.cpp:
3584         (WebCore::V8PopStateEvent::stateAttrGetterCustom):
3585         * bindings/v8/custom/V8SVGLengthCustom.cpp:
3586         (WebCore::V8SVGLength::valueAttrGetterCustom):
3587         (WebCore::V8SVGLength::valueAttrSetterCustom):
3588         * bindings/v8/custom/V8TrackEventCustom.cpp:
3589         (WebCore::V8TrackEvent::trackAttrGetterCustom):
3590         * bindings/v8/custom/V8WebKitAnimationCustom.cpp:
3591         (WebCore::V8WebKitAnimation::iterationCountAttrGetterCustom):
3592         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
3593         (WebCore::V8XMLHttpRequest::responseTextAttrGetterCustom):
3594         (WebCore::V8XMLHttpRequest::responseAttrGetterCustom):
3595
3596 2013-02-12  Kentaro Hara  <haraken@chromium.org>
3597
3598         [V8] Generate wrapper methods for custom getters/setters
3599         https://bugs.webkit.org/show_bug.cgi?id=109666
3600
3601         Reviewed by Adam Barth.
3602
3603         Currently V8 directly calls back custom getters/setters written
3604         in custom binding files. This makes it impossible for code generators
3605         to hook custom getters/setters (e.g. Code generators cannot insert a code
3606         for FeatureObservation into custom getters/setters). To solve the problem,
3607         we should generate wrapper methods for custom getters/setters.
3608
3609         No tests. No change in behavior.
3610
3611         * bindings/scripts/CodeGeneratorV8.pm:
3612         (GenerateNormalAttrGetter):
3613         (GenerateNormalAttrSetter):
3614         (GenerateSingleBatchedAttribute):
3615         (GenerateImplementation):
3616         * bindings/scripts/test/V8/V8TestInterface.cpp:
3617         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
3618         (TestInterfaceV8Internal):
3619         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
3620         (WebCore):
3621         * bindings/scripts/test/V8/V8TestObj.cpp:
3622         (WebCore::TestObjV8Internal::customAttrAttrGetter):
3623         (TestObjV8Internal):
3624         (WebCore::TestObjV8Internal::customAttrAttrSetter):
3625         (WebCore):
3626
3627 2013-02-13   Vineet Chaudhary  <rgf748@motorola.com>
3628
3629         HTMLCollections namedItem() methods should return null than undefined for empty collections.
3630         https://bugs.webkit.org/show_bug.cgi?id=104096
3631
3632         Reviewed by Kentaro Hara.
3633
3634         As per specification namedItem() should return null if collection is empty.
3635         Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
3636
3637         Test: fast/dom/htmlcollection-namedItem.html
3638
3639         * bindings/js/JSHTMLAllCollectionCustom.cpp: Returning null.
3640         (WebCore::getNamedItems):
3641         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Ditto.
3642         (WebCore::getNamedItems):
3643         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Ditto.
3644         (WebCore::getNamedItems):
3645         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp: Ditto.
3646         (WebCore::V8HTMLAllCollection::namedItemCallback):
3647         * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp: Ditto.
3648         (WebCore::V8HTMLFormControlsCollection::namedItemCallback):
3649         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: Ditto.
3650         (WebCore::V8HTMLOptionsCollection::namedItemCallback):
3651
3652 2013-02-13  Tony Gentilcore  <tonyg@chromium.org>
3653
3654         Fix svg/in-html/script-write.html with threaded HTML parser
3655         https://bugs.webkit.org/show_bug.cgi?id=109495
3656
3657         Reviewed by Eric Seidel.
3658
3659         This patch makes the background parser's simulateTreeBuilder() more realistic.
3660         1. The HTMLTreeBuilder does not call the updateStateFor() setState()s when in foreign content mode so we shouldn't do it when simulating the tree builder.
3661         2. HTMLTreeBuilder::processTokenInForeignContent has a list of tags which exit foreign content mode. We need to respect those.
3662         3. Support the <foreignObject> tag which enters and leaves foreign content mode.
3663         4. The tree builder sets state to DataState upon a </script> tag when not in foreign content mode. We need to do the same.
3664
3665         This involved creating a namespace stack where we push upon entering each namespace and pop upon leaving.
3666         We are in foreign content if the topmost namespace is SVG or MathML.
3667
3668         This fixes svg/in-html/script-write.html and likely others.
3669
3670         * html/parser/BackgroundHTMLParser.cpp:
3671         (WebCore::BackgroundHTMLParser::simulateTreeBuilder):
3672         * html/parser/BackgroundHTMLParser.h:
3673         (BackgroundHTMLParser):
3674         * html/parser/CompactHTMLToken.cpp:
3675         (WebCore::CompactHTMLToken::getAttributeItem): Returns the attribute of the given name. Necessary to test for <font> attributes in simulateTreeBuilder.
3676         (WebCore):
3677         * html/parser/CompactHTMLToken.h:
3678         (WebCore):
3679         (CompactHTMLToken):
3680
3681 2013-02-13  Andreas Kling  <akling@apple.com>
3682
3683         Remove Element::getAttributeItem() overload that returned a mutable Attribute*.
3684         <http://webkit.org/b/109756>
3685
3686         Reviewed by Antti Koivisto.
3687
3688         Remove this to prevent callers from accidentally causing elements to convert to UniqueElementData.
3689         There are two call sites (Attr and HTMLSelectElement) that legitimately need to mutate Attribute
3690         objects in-place, they now use Element::ensureUniqueElementData()->getAttributeItem() directly instead.
3691
3692         Small progression on Membuster3, mostly for peace of mind.
3693
3694         * dom/Attr.cpp:
3695         (WebCore::Attr::elementAttribute):
3696         * dom/Element.h:
3697         (Element):
3698         * html/HTMLInputElement.cpp:
3699         (WebCore::HTMLInputElement::updateType):
3700         * html/HTMLSelectElement.cpp:
3701         (WebCore::HTMLSelectElement::parseAttribute):
3702         * svg/SVGStyledElement.cpp:
3703         (WebCore::SVGStyledElement::getPresentationAttribute):
3704
3705 2013-02-13  Andreas Kling  <akling@apple.com>
3706
3707         Stronger ElementData pointer typing.
3708         <http://webkit.org/b/109752>
3709
3710         Reviewed by Antti Koivisto.
3711
3712         Use ShareableElementData/UniqueElementData pointers instead of generic ElementData pointers
3713         where possible. Moved some methods from base class into leaf classes that don't make sense
3714         for both classes.
3715
3716         * dom/DocumentSharedObjectPool.cpp:
3717         (WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry):
3718         (ShareableElementDataCacheEntry):
3719         (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
3720         * dom/DocumentSharedObjectPool.h:
3721         (DocumentSharedObjectPool):
3722         * dom/Element.cpp:
3723         (WebCore::Element::parserSetAttributes):
3724         (WebCore::Element::setAttributeNode):
3725         (WebCore::Element::removeAttributeInternal):
3726         (WebCore::Element::cloneAttributesFromElement):
3727         (WebCore::Element::createUniqueElementData):
3728         (WebCore::ShareableElementData::createWithAttributes):
3729         (WebCore::UniqueElementData::create):
3730         (WebCore::ElementData::makeUniqueCopy):
3731         (WebCore::UniqueElementData::makeShareableCopy):
3732         * dom/Element.h:
3733         (ElementData):
3734         (ShareableElementData):
3735         (UniqueElementData):
3736         (Element):
3737         (WebCore::Element::ensureUniqueElementData):
3738         * dom/StyledElement.cpp:
3739         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
3740
3741 2013-02-13  Antti Koivisto  <antti@apple.com>
3742
3743         Reschedule shared CFRunLoopTimer instead of reconstructing it
3744         https://bugs.webkit.org/show_bug.cgi?id=109765
3745
3746         Reviewed by Andreas Kling and Anders Carlsson.
3747
3748         Using CFRunLoopTimerSetNextFireDate is over 2x faster than deleting and reconstructing timers.
3749
3750         * platform/mac/SharedTimerMac.mm:
3751         (WebCore):
3752         (WebCore::PowerObserver::restartSharedTimer):
3753         (WebCore::sharedTimer):
3754         (WebCore::setSharedTimerFireInterval):
3755         (WebCore::stopSharedTimer):
3756
3757 2013-02-13  Emil A Eklund  <eae@chromium.org>
3758
3759         getComputedStyle returns truncated value for margin-right
3760         https://bugs.webkit.org/show_bug.cgi?id=109759
3761
3762         Reviewed by Tony Chang.
3763         
3764         Due to an unfortunate cast in CSSComputedStyleDeclaration::
3765         getPropertyCSSValue getComputedStyle returns truncated styles
3766         for margin-right in cases where it isn't set to a specific pixel
3767         value.
3768
3769         Test: fast/sub-pixel/computedstylemargin.html
3770
3771         * css/CSSComputedStyleDeclaration.cpp:
3772         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
3773         Change type of temporary value variable to float to prevent loss of precision.
3774
3775 2013-02-13  Max Vujovic  <mvujovic@adobe.com>
3776
3777         [CSS Filters] Refactor filter outsets into a class
3778         https://bugs.webkit.org/show_bug.cgi?id=109330
3779
3780         Reviewed by Dean Jackson.
3781
3782         In filters related code, we're often operating on 4 ints representing the top, right,
3783         bottom, and left filter outsets. These outsets come from a filter like blur or drop-shadow.
3784         This patch packages those ints and their related operations into a class called
3785         IntRectExtent.
3786
3787         Here are some signs that we should make a class to hold those 4 ints:
3788         1) In RenderLayer.cpp, we have a expandRectForFilterOutsets function, which looks like
3789            feature envy.
3790         2) RenderStyle and other classes have methods like getFilterOutsets which set the 4 ints by
3791            reference. The calling code has to define 4 ints, which looks bloated.
3792         3) To fix bug 109098, we will need to check if filter outsets changed, which sounds like a
3793            nice job for an inequality operator. (https://bugs.webkit.org/show_bug.cgi?id=109098)
3794
3795         No new tests. No change in behavior. Just refactoring.
3796
3797         * GNUmakefile.list.am:
3798         * Target.pri:
3799         * WebCore.gypi:
3800         * WebCore.xcodeproj/project.pbxproj:
3801         * platform/graphics/IntRectExtent.h: Added.
3802         (WebCore):
3803         (IntRectExtent):
3804         (WebCore::IntRectExtent::IntRectExtent):
3805         (WebCore::IntRectExtent::top):
3806         (WebCore::IntRectExtent::setTop):
3807         (WebCore::IntRectExtent::right):
3808         (WebCore::IntRectExtent::setRight):
3809         (WebCore::IntRectExtent::bottom):
3810         (WebCore::IntRectExtent::setBottom):
3811         (WebCore::IntRectExtent::left):
3812         (WebCore::IntRectExtent::setLeft):
3813         (WebCore::IntRectExtent::expandRect):
3814         (WebCore::IntRectExtent::isZero):
3815         (WebCore::operator==):
3816         (WebCore::operator!=):
3817         (WebCore::operator+=):
3818         * platform/graphics/filters/FilterOperations.cpp:
3819         (WebCore::FilterOperations::outsets):
3820         * platform/graphics/filters/FilterOperations.h:
3821         (FilterOperations):
3822         * platform/graphics/texmap/TextureMapperLayer.cpp:
3823         (WebCore::TextureMapperLayer::intermediateSurfaceRect):
3824         * rendering/FilterEffectRenderer.cpp:
3825         (WebCore::FilterEffectRenderer::FilterEffectRenderer):
3826         (WebCore::FilterEffectRenderer::build):
3827         (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect):
3828         * rendering/FilterEffectRenderer.h:
3829         (FilterEffectRenderer):
3830         * rendering/RenderLayer.cpp:
3831         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
3832         (WebCore::transparencyClipBox):
3833         (WebCore::RenderLayer::calculateLayerBounds):
3834         * rendering/style/RenderStyle.h:
3835
3836 2013-02-13  Adam Barth  <abarth@webkit.org>
3837
3838         Factor HTMLTokenScanner out of HTMLPreloadScanner
3839         https://bugs.webkit.org/show_bug.cgi?id=109754
3840
3841         Reviewed by Eric Seidel.
3842
3843         This patch is just a mechanical separation of the per-token "scanning"
3844         logic from HTMLPreloadScanner into a separate class.
3845         HTMLPreloadScanner's job is now to keep track of the input stream and
3846         to pump the tokenizer.
3847
3848         This factorization class will let us use HTMLTokenScanner on the
3849         background thread (once we finish making it thread-safe). In a follow
3850         up patch, I'll move HTMLTokenScanner to its own file.
3851
3852         * html/parser/HTMLPreloadScanner.cpp:
3853         (WebCore::HTMLTokenScanner::HTMLTokenScanner):
3854         (WebCore::HTMLTokenScanner::~HTMLTokenScanner):
3855         (WebCore::HTMLTokenScanner::processPossibleTemplateTag):
3856         (WebCore::HTMLTokenScanner::processPossibleStyleTag):
3857         (WebCore::HTMLTokenScanner::processPossibleBaseTag):
3858         (WebCore::HTMLTokenScanner::scan):
3859         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
3860         (WebCore):
3861         (WebCore::HTMLPreloadScanner::~HTMLPreloadScanner):
3862         (WebCore::HTMLPreloadScanner::appendToEnd):
3863         (WebCore::HTMLPreloadScanner::scan):
3864         * html/parser/HTMLPreloadScanner.h:
3865         (HTMLTokenScanner):
3866         (WebCore::HTMLTokenScanner::setPredictedBaseElementURL):
3867         (HTMLPreloadScanner):
3868         (WebCore):
3869
3870 2013-02-13  Elliott Sprehn  <esprehn@chromium.org>
3871
3872         ASSERT(!renderer()->needsLayout()) when calling Element::focus() with generated content
3873         https://bugs.webkit.org/show_bug.cgi?id=109616
3874
3875         Reviewed by Julien Chaffraix.
3876
3877         Test: fast/css-generated-content/quote-layout-focus-crash.html
3878
3879         In some cases RenderQuote may mark itself and containing blocks as needing layout
3880         during a layout, but then one of it's containing blocks will mark itself as having
3881         finished layout so the RenderQuote and potentially some of it's ancestor renderers
3882         needLayout(), but the ancestors above those do not.
3883
3884         Until we have proper pre-layout tasks we should just walk the list of quotes
3885         right before layout and mark all their ancestors as needing layout if the quote
3886         needs layout.
3887
3888         * dom/Document.cpp:
3889         (WebCore::Document::updateLayout): Call markQuoteContainingBlocksForLayoutIfNeeded.
3890         (WebCore::Document::implicitClose): Call markQuoteContainingBlocksForLayoutIfNeeded.
3891         * rendering/RenderQuote.h:
3892         (WebCore::RenderQuote::next): Added.
3893         * rendering/RenderView.cpp:
3894         (WebCore::RenderView::markQuoteContainingBlocksForLayoutIfNeeded): Added.
3895         * rendering/RenderView.h:
3896         (RenderView):
3897
3898 2013-02-13  Jer Noble  <jer.noble@apple.com>
3899
3900         EME: MediaPlayer::keyNeede() should return a bool indicating whether an event listener was triggered.
3901         https://bugs.webkit.org/show_bug.cgi?id=109701
3902
3903         Reviewed by Eric Carlson.
3904
3905         Clients of MediaPlayer may need to do cleanup if calling keyNeeded()
3906         results in no event listener being triggered. Return a bool (like the
3907         v1 equivalent keyNeeded method) to indicate this.
3908
3909         * html/HTMLMediaElement.cpp:
3910         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3911         * html/HTMLMediaElement.h:
3912         * platform/graphics/MediaPlayer.cpp:
3913         (WebCore::MediaPlayer::keyNeeded):
3914         * platform/graphics/MediaPlayer.h:
3915         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
3916
3917 2013-02-13  Abhishek Arya  <inferno@chromium.org>
3918
3919         ASSERTION FAILED: !object || object->isBox(), Bad cast in RenderBox::computeLogicalHeight
3920         https://bugs.webkit.org/show_bug.cgi?id=107748
3921
3922         Reviewed by Levi Weintraub.
3923
3924         Make sure that body renderer is not an inline-block display
3925         when determining that it stretches to viewport or when paginated
3926         content needs base height.
3927
3928         Test: fast/block/body-inline-block-crash.html
3929
3930         * rendering/RenderBox.cpp:
3931         (WebCore::RenderBox::computeLogicalHeight):
3932         * rendering/RenderBox.h:
3933         (WebCore::RenderBox::stretchesToViewport):
3934
3935 2013-02-13  Shawn Singh  <shawnsingh@chromium.org>
3936
3937         Fix debug assertion being triggered because we may access dirty normalFlowList.
3938         https://bugs.webkit.org/show_bug.cgi?id=109740
3939
3940         A debug assertion in RenderLayer.h is being hit when trying to
3941         access the normalFlowList when it is dirty.  This is caused by a
3942         new recursion that I added in RenderLayerBacking::hasVisibleNonCompositingDescendant(),
3943         but I overlooked the need to call updateLayerListsIfNeeded()
3944         recursively as well.
3945
3946         Reviewed by Simon Fraser.
3947
3948         No test, because there's no reliable way to test this (same as bug 85512).
3949
3950         * rendering/RenderLayerBacking.cpp:
3951         (WebCore::hasVisibleNonCompositingDescendant):
3952         (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):
3953
3954 2013-02-13  Antti Koivisto  <antti@apple.com>
3955
3956         Don't restart shared timer if both the current and the new fire time are in the past
3957         https://bugs.webkit.org/show_bug.cgi?id=109731
3958
3959         Reviewed by Andreas Kling.
3960
3961         In 40-50% of cases we reschedule the shared timer both the old and the new fire time have already passed. This can happen at least when rescheduling 
3962         a zero duration timer and when stopping a timer that was ready to fire.
3963
3964         We can skip rescheduling in this case, the shared timer will fire immediately anyway.
3965         
3966         Scheduling timers calls into platform layer and can be slow. This about halves the time under setSharedTimerFireInterval in PLT3
3967         for ~0.1% total CPU time reduction.
3968
3969         * platform/ThreadTimers.cpp:
3970         (WebCore::ThreadTimers::ThreadTimers):
3971         (WebCore::ThreadTimers::setSharedTimer):
3972         (WebCore::ThreadTimers::updateSharedTimer):
3973         (WebCore::ThreadTimers::sharedTimerFiredInternal):
3974         * platform/ThreadTimers.h:
3975         (ThreadTimers):
3976
3977 2013-02-13  Zan Dobersek  <zdobersek@igalia.com>
3978
3979         The 'global isinf/isnan' compiler quirk required when using clang with libstdc++
3980         https://bugs.webkit.org/show_bug.cgi?id=109325
3981
3982         Reviewed by Anders Carlsson.
3983
3984         Prefix calls to the isinf and isnan methods with std::, declaring we want to use the
3985         two methods as they're provided by the C++ standard library being used.
3986
3987         No new tests as there's no change in functionality.
3988
3989         * Modules/mediasource/MediaSource.cpp:
3990         (WebCore::MediaSource::setDuration):
3991         * Modules/webaudio/AudioBufferSourceNode.cpp:
3992         (WebCore::AudioBufferSourceNode::totalPitchRate):