Add invalid bounding box concept to SVG containers
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-03-26  Philip Rogers  <pdr@google.com>
2
3         Add invalid bounding box concept to SVG containers
4         https://bugs.webkit.org/show_bug.cgi?id=81104
5
6         Reviewed by Nikolas Zimmermann.
7
8         An empty <g> element needs to use an invalid bounding box because
9         an empty bounding box isn't the default state. This change
10         introduces the concept of an invalid object bounding box for
11         both RenderSVGContainer and RenderSVGRoot. Code that
12         does not explicitly check that the bounding box is valid
13         should be unaffected by this change. We use this new invalid
14         flag in computeContainerBoundingBoxes so that we do not
15         include invalid bounding boxes.
16
17         This change also contains a small fix in
18         RenderSVGContainer::toRenderSVGContainer which depended on
19         RenderSVGViewportContainer not inheriting from RenderSVGContainer,
20         which it now does.
21
22         Test: svg/custom/getBBox-empty-container.html
23
24         * rendering/svg/RenderSVGContainer.cpp:
25         (WebCore::RenderSVGContainer::RenderSVGContainer):
26         (WebCore::RenderSVGContainer::updateCachedBoundaries):
27         * rendering/svg/RenderSVGContainer.h:
28         (WebCore::RenderSVGContainer::isObjectBoundingBoxValid):
29         (RenderSVGContainer):
30         (WebCore::toRenderSVGContainer):
31         * rendering/svg/RenderSVGRoot.cpp:
32         (WebCore::RenderSVGRoot::RenderSVGRoot):
33         (WebCore::RenderSVGRoot::updateCachedBoundaries):
34         * rendering/svg/RenderSVGRoot.h:
35         (RenderSVGRoot):
36         * rendering/svg/SVGRenderSupport.cpp:
37         (WebCore):
38         (WebCore::updateObjectBoundingBox):
39         (WebCore::SVGRenderSupport::computeContainerBoundingBoxes):
40         * rendering/svg/SVGRenderSupport.h:
41         (SVGRenderSupport):
42
43 2012-03-26  Alexei Filippov  <alexeif@chromium.org>
44
45         Web Inspector: Speed up the retainers build phase.
46         https://bugs.webkit.org/show_bug.cgi?id=81763
47
48         Replacing the edge iterator in retainers building phase
49         makes it run 10 times faster (400 ms vs. 4 sec).
50
51         Reviewed by Yury Semikhatsky.
52
53         * inspector/front-end/HeapSnapshot.js:
54         (WebInspector.HeapSnapshot.prototype._buildRetainers):
55
56 2012-03-22  Alexander Pavlov  <apavlov@chromium.org>
57
58         Web Inspector: Migrate InspectorCSSAgent to strict protocol types
59         https://bugs.webkit.org/show_bug.cgi?id=81923
60
61         Reviewed by Pavel Feldman.
62
63         No new tests, as this is a refactoring.
64
65         * inspector/CodeGeneratorInspector.py:
66         * inspector/InspectorCSSAgent.cpp:
67         (SelectorProfile):
68         (WebCore::SelectorProfile::toInspectorObject):
69         (WebCore::InspectorCSSAgent::clearFrontend):
70         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
71         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
72         (WebCore::InspectorCSSAgent::getComputedStyleForNode):
73         (WebCore::InspectorCSSAgent::getAllStyleSheets):
74         (WebCore::InspectorCSSAgent::getStyleSheet):
75         (WebCore::InspectorCSSAgent::setPropertyText):
76         (WebCore::InspectorCSSAgent::toggleProperty):
77         (WebCore::InspectorCSSAgent::setRuleSelector):
78         (WebCore::InspectorCSSAgent::addRule):
79         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
80         (WebCore::InspectorCSSAgent::stopSelectorProfiler):
81         (WebCore::InspectorCSSAgent::stopSelectorProfilerImpl):
82         (WebCore::InspectorCSSAgent::collectStyleSheets):
83         (WebCore::InspectorCSSAgent::buildArrayForRuleList):
84         (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
85         * inspector/InspectorCSSAgent.h:
86         (InspectorCSSAgent):
87         * inspector/InspectorStyleSheet.cpp:
88         (WebCore::buildSourceRangeObject):
89         (WebCore::buildMediaObject):
90         (WebCore::fillMediaListChain):
91         (WebCore::InspectorStyle::buildObjectForStyle):
92         (WebCore::InspectorStyle::buildArrayForComputedStyle):
93         (WebCore::InspectorStyle::styleWithProperties):
94         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
95         (WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
96         (WebCore::InspectorStyleSheet::buildObjectForRule):
97         (WebCore::InspectorStyleSheet::buildObjectForStyle):
98         * inspector/InspectorStyleSheet.h:
99         (WebCore::InspectorCSSId::asProtocolValue):
100         (InspectorStyle):
101         (InspectorStyleSheet):
102
103 2012-03-26  Alexander Pavlov  <apavlov@chromium.org>
104
105         Web Inspector: [REGRESSION] Workarounds for security checks when retrieving stylesheet rule lists are broken
106         https://bugs.webkit.org/show_bug.cgi?id=82191
107
108         Reviewed by Vsevolod Vlasov.
109
110         Test: http/tests/inspector/modify-cross-domain-rule.html
111
112         * inspector/InspectorStyleSheet.cpp:
113         (WebCore::asCSSRuleList):
114         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
115
116 2012-03-26  Carlos Garcia Campos  <cgarcia@igalia.com>
117
118         Unreviewed. Fix make distcheck.
119
120         * GNUmakefile.list.am: Add missing files.
121
122 2012-03-26  Jason Liu  <jason.liu@torchmobile.com.cn>
123
124         [BlackBerry] Cookies mismatch when login to gmail.
125         https://bugs.webkit.org/show_bug.cgi?id=82165
126
127         Redirection's response can add or update cookies. The cookies of ResourceRequest is dirty
128         in this case. We shouldn't copy the dirty cookie header from ResourceRequest to PlatformRequest
129         for redirection loading.
130
131         This issue didn't happen before because we used m_cookieData not the cookie header.
132         Now we use the cookie header to avoid storing double cookie's data, and m_cookieData is removed.
133
134         Reviewed by George Staikos.
135
136         No new tests. It is a refactoring issue.
137
138         * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
139         (WebCore::ResourceRequest::initializePlatformRequest):
140
141 2012-03-26  Alexis Menard  <alexis.menard@openbossa.org>
142
143         Increase code sharing between StylePropertySet and CSSPropertyLonghand.
144         https://bugs.webkit.org/show_bug.cgi?id=81960
145
146         Reviewed by Antti Koivisto.
147
148         Use longhands declaration from CSSPropertyLonghand in StylePropertySet in order
149         to avoid code duplication.
150
151         No new tests : refactoring only, we shouldn't have any behavior difference.
152
153         * css/CSSPropertyLonghand.cpp:
154         (WebCore::backgroundLonghand):
155         Re-order the array to match the spec default order.
156         (WebCore::webkitMaskLonghand):
157         Re-order to match the original order.
158         (WebCore::webkitTransformOriginLonghand):
159         A LayoutTest shows that a property was missing.
160         * css/StylePropertySet.cpp:
161         (WebCore::StylePropertySet::getPropertyValue):
162         (WebCore::StylePropertySet::borderSpacingValue):
163         (WebCore::StylePropertySet::get4Values):
164         (WebCore::StylePropertySet::getLayeredShorthandValue):
165         (WebCore::StylePropertySet::getShorthandValue):
166         (WebCore::StylePropertySet::getCommonValue):
167         (WebCore::StylePropertySet::asText):
168         * css/StylePropertySet.h:
169         (WebCore):
170         (StylePropertySet):
171
172 2012-03-26  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
173
174         [Qt] Assert in GestureTapHighlighter.
175         https://bugs.webkit.org/show_bug.cgi?id=82187
176
177         Reviewed by Kenneth Rohde Christiansen.
178
179         Adjust the boundaries of the center-rect before performing the intersection test,
180         since adjusting the boundary may cause a new intersection.
181
182         * page/GestureTapHighlighter.cpp:
183
184 2012-03-26  Antti Koivisto  <antti@apple.com>
185
186         Split MediaList into internal and CSSOM types
187         https://bugs.webkit.org/show_bug.cgi?id=82149
188
189         Reviewed by Andread Kling.
190
191         MediaList is a CSSOM type and should not be used internally.
192         
193         - Use new type MediaQuerySet internally to represent a collection of media queries.
194         - Create MediaList wrapper on-demand for CSSOM purposes only.
195         
196         This moves us forward in separating CSSOM from the internal stylesheet implementation.
197         
198         MediaQuerySet really belongs to a file of its own but that is not part of this patch.
199         
200         * css/CSSGrammar.y:
201         * css/CSSImportRule.cpp:
202         (WebCore::CSSImportRule::create):
203         (WebCore):
204         (WebCore::CSSImportRule::CSSImportRule):
205         (WebCore::CSSImportRule::~CSSImportRule):
206         (WebCore::CSSImportRule::media):
207         (WebCore::CSSImportRule::cssText):
208         * css/CSSImportRule.h:
209         (WebCore):
210         (CSSImportRule):
211         (WebCore::CSSImportRule::mediaQueries):
212         * css/CSSMediaRule.cpp:
213         (WebCore::CSSMediaRule::CSSMediaRule):
214         (WebCore::CSSMediaRule::~CSSMediaRule):
215         (WebCore::CSSMediaRule::cssText):
216         * css/CSSMediaRule.h:
217         (WebCore::CSSMediaRule::create):
218         (WebCore::CSSMediaRule::media):
219         (WebCore::CSSMediaRule::mediaQueries):
220         (CSSMediaRule):
221         * css/CSSParser.cpp:
222         (WebCore::CSSParser::parseMediaQuery):
223         (WebCore::CSSParser::createMediaQuerySet):
224         (WebCore::CSSParser::createImportRule):
225         (WebCore::CSSParser::createMediaRule):
226         (WebCore::CSSParser::updateLastMediaLine):
227         * css/CSSParser.h:
228         (WebCore):
229         (CSSParser):
230         * css/CSSStyleSelector.cpp:
231         (WebCore::CSSStyleSelector::collectMatchingRulesForList):
232         * css/CSSStyleSheet.cpp:
233         (WebCore):
234         (WebCore::CSSStyleSheet::media):
235         (WebCore::CSSStyleSheet::setMediaQueries):
236         * css/CSSStyleSheet.h:
237         (WebCore):
238         (CSSStyleSheet):
239         (WebCore::CSSStyleSheet::mediaQueries):
240         * css/MediaList.cpp:
241         (WebCore):
242         (WebCore::MediaQuerySet::MediaQuerySet):
243         (WebCore::MediaQuerySet::~MediaQuerySet):
244         (WebCore::parseMediaDescriptor):
245         (WebCore::MediaQuerySet::parse):
246         (WebCore::MediaQuerySet::add):
247         (WebCore::MediaQuerySet::remove):
248         (WebCore::MediaQuerySet::addMediaQuery):
249         (WebCore::MediaQuerySet::mediaText):
250         (WebCore::MediaQuerySet::ensureMediaList):
251         
252             - Use OwnPtr<> for MediaQuery ownership.
253             - Move the appropriate functions to MediaQuerySet.
254             - Clean up a bit to make this more readable and better aligned to WebKit style.
255         
256         (WebCore::MediaList::MediaList):
257         (WebCore::MediaList::~MediaList):
258         (WebCore::MediaList::setMediaText):
259         (WebCore::MediaList::item):
260         (WebCore::MediaList::deleteMedium):
261         (WebCore::MediaList::appendMedium):
262         * css/MediaList.h:
263         (WebCore):
264         (WebCore::MediaQuerySet::create):
265         (WebCore::MediaQuerySet::createAllowingDescriptionSyntax):
266         (MediaQuerySet):
267         (WebCore::MediaQuerySet::queryVector):
268         (WebCore::MediaQuerySet::lastLine):
269         (WebCore::MediaQuerySet::setLastLine):
270         (MediaList):
271         (WebCore::MediaList::ref):
272         (WebCore::MediaList::deref):
273         (WebCore::MediaList::length):
274         (WebCore::MediaList::mediaText):
275         (WebCore::MediaList::queries):
276         * css/MediaQueryEvaluator.cpp:
277         (WebCore::MediaQueryEvaluator::eval):
278         * css/MediaQueryEvaluator.h:
279         (WebCore):
280         (MediaQueryEvaluator):
281         * css/MediaQueryList.cpp:
282         (WebCore::MediaQueryList::create):
283         (WebCore::MediaQueryList::MediaQueryList):
284         * css/MediaQueryList.h:
285         (WebCore):
286         (MediaQueryList):
287         * css/MediaQueryMatcher.cpp:
288         (WebCore::MediaQueryMatcher::evaluate):
289         (WebCore::MediaQueryMatcher::matchMedia):
290         * css/MediaQueryMatcher.h:
291         (WebCore):
292         (MediaQueryMatcher):
293         * css/StyleMedia.cpp:
294         (WebCore::StyleMedia::matchMedium):
295         * css/StyleSheet.cpp:
296         (WebCore::StyleSheet::~StyleSheet):
297         
298             Move the media query ownership to CSSStyleSheet where it belongs.
299         
300         (WebCore):
301         * css/StyleSheet.h:
302         (WebCore::StyleSheet::media):
303         (StyleSheet):
304         * dom/DOMImplementation.cpp:
305         (WebCore::DOMImplementation::createCSSStyleSheet):
306         * dom/ProcessingInstruction.cpp:
307         (WebCore::ProcessingInstruction::setCSSStyleSheet):
308         * dom/StyleElement.cpp:
309         (WebCore::StyleElement::createSheet):
310         * html/HTMLLinkElement.cpp:
311         (WebCore::HTMLLinkElement::process):
312         (WebCore::HTMLLinkElement::setCSSStyleSheet):
313         * html/HTMLMediaElement.cpp:
314         (WebCore::HTMLMediaElement::selectNextSourceChild):
315         * html/parser/HTMLPreloadScanner.cpp:
316         (WebCore::HTMLNames::PreloadTask::linkMediaAttributeIsScreen):
317         * inspector/InspectorStyleSheet.cpp:
318         (WebCore::buildMediaObject):
319
320 2012-03-26  Zeno Albisser  <zeno@webkit.org>
321
322         [Qt]WK2] TextureMapperShaderManager should query the program map before creating new shader program instances.
323         https://bugs.webkit.org/show_bug.cgi?id=82178
324
325         If TextureMapperShaderManager already has a reference to an instance of the
326         requested shader program type, this instance should be reused instead of
327         creating a new one.
328
329         Reviewed by Noam Rosenthal.
330
331         * platform/graphics/texmap/TextureMapperShaderManager.h:
332         (WebCore::TextureMapperShaderManager::getShaderProgram):
333
334 2012-03-26  Yury Semikhatsky  <yurys@chromium.org>
335
336         [Chromium] Web Inspector: dedicated worker inspector is empty
337         https://bugs.webkit.org/show_bug.cgi?id=82181
338
339         "beforeunload" event for worker inspector front-end is ingnored if the
340         window url is "about:blank" as it is just unload of the default content
341         before the front-end page load.
342
343         Reviewed by Pavel Feldman.
344
345         * inspector/front-end/WorkerManager.js:
346         (WebInspector.WorkerManager.prototype._workerInspectorClosing):
347
348 2012-03-22  Yury Semikhatsky  <yurys@chromium.org>
349
350         Web Inspector: split nodes and containment edges into two different arrays
351         https://bugs.webkit.org/show_bug.cgi?id=81930
352
353         Extract heap profile nodes and edges into two separate arrays. This
354         way we will have a continuous array of the heap graph nodes and can
355         aviod additional mapping between node index and its position in the
356         heap snapshot.
357
358         Reviewed by Pavel Feldman.
359
360         * inspector/front-end/HeapSnapshot.js:
361         (WebInspector.HeapSnapshot.prototype._init):
362         (WebInspector.HeapSnapshot.prototype._buildContinuousNodeArray):
363         (WebInspector.HeapSnapshot.prototype._createOnlyNodesArray):
364         (WebInspector.HeapSnapshot.prototype._restoreNodeTypes):
365         (WebInspector.HeapSnapshot.prototype._createRetainmentEdgesArray):
366         (WebInspector.HeapSnapshot.prototype._createContainmentEdgesArray):
367         * inspector/front-end/HeapSnapshotProxy.js:
368         (WebInspector.HeapSnapshotWorker):
369
370 2012-03-22  Pavel Podivilov  <podivilov@chromium.org>
371
372         Web Inspector: move resource loading logic from SourceMapParser to CompilerScriptMapping.
373         https://bugs.webkit.org/show_bug.cgi?id=81897
374
375         Reviewed by Vsevolod Vlasov.
376
377         SourceMapParser should only deal with payload parsing.
378
379         * inspector/front-end/CompilerScriptMapping.js:
380         (WebInspector.CompilerScriptMapping.prototype.rawLocationToUILocation):
381         (WebInspector.CompilerScriptMapping.prototype.addScript):
382         (WebInspector.CompilerScriptMapping.prototype.loadSourceMapForScript):
383         (WebInspector.SourceMapPayload):
384         (WebInspector.SourceMapParser):
385         (WebInspector.SourceMapParser.prototype.sourceContent):
386         (WebInspector.SourceMapParser.prototype.findEntry):
387         (WebInspector.SourceMapParser.prototype.findEntryReversed):
388         * inspector/front-end/ContentProviders.js:
389         (WebInspector.CompilerSourceMappingContentProvider):
390         (WebInspector.CompilerSourceMappingContentProvider.prototype.requestContent):
391
392 2012-03-26  Ilya Tikhonovsky  <loislo@chromium.org>
393
394         Web Inspector: replace indexOf('a text') === 0 with RegExp because it is much faster.
395         https://bugs.webkit.org/show_bug.cgi?id=82175
396
397         We were using aString.indexOf("Window") but it is not effective from performance point of view.
398         I'm replaced it with RegExp.
399
400         Reviewed by Yury Semikhatsky.
401
402         * inspector/front-end/HeapSnapshot.js:
403         (WebInspector.HeapSnapshotNode.prototype.get isWindow):
404         (WebInspector.HeapSnapshotNode.prototype.get isDetachedDOMTree):
405
406 2012-03-26  Pavel Feldman  <pfeldman@chromium.org>
407
408         Web Inspector: breakpoints should be disabled while live editing JavaScript.
409         https://bugs.webkit.org/show_bug.cgi?id=81947
410
411         Reviewed by Yury Semikhatsky.
412
413         This change disables (removes from the backend) the breakpoints while editing script.
414         Undoing or committing the change restores the breakpoints. Main logic is implemented within
415         JavaScriptSourceFrame, but it required minor tweaking of the text editor: more correct
416         undo/redo wrapper and better detection of the noop opterations.
417
418         * inspector/front-end/JavaScriptSourceFrame.js:
419         (WebInspector.JavaScriptSourceFrame):
420         (WebInspector.JavaScriptSourceFrame.prototype.afterTextChanged):
421         (WebInspector.JavaScriptSourceFrame.prototype.beforeTextChanged):
422         (WebInspector.JavaScriptSourceFrame.prototype.didEditContent):
423         (WebInspector.JavaScriptSourceFrame.prototype.addBreakpoint):
424         (WebInspector.JavaScriptSourceFrame.prototype.removeBreakpoint):
425         (WebInspector.JavaScriptSourceFrame.prototype._onMouseDown):
426         * inspector/front-end/TextEditorModel.js:
427         (WebInspector.TextEditorModel.endsWithBracketRegex.):
428         * inspector/front-end/TextViewer.js:
429         (WebInspector.TextEditorMainPanel.prototype.handleUndoRedo.before):
430         (WebInspector.TextEditorMainPanel.prototype.handleUndoRedo.after):
431         (WebInspector.TextEditorMainPanel.prototype.handleUndoRedo):
432         (WebInspector.TextEditorMainPanel.prototype._applyDomUpdates):
433
434 2012-03-25  Nat Duca  <nduca@chromium.org>
435
436         [chromium] Route willBeginFrame from compositor to WebWidget
437         https://bugs.webkit.org/show_bug.cgi?id=82171
438
439         Reviewed by Darin Fisher.
440
441         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
442         (CCLayerTreeHostClient):
443         (WebCore::CCLayerTreeHost::willBeginFrame):
444         * platform/graphics/chromium/cc/CCThreadProxy.cpp:
445         (WebCore::CCThreadProxy::beginFrame):
446
447 2012-03-25  Hayato Ito  <hayato@chromium.org>
448
449         [Shadow DOM] Add Reified DOM Tree traversal internal APIs.
450         https://bugs.webkit.org/show_bug.cgi?id=79197
451
452         Reviewed by Dimitri Glazkov.
453
454         Add internal APIs which can be used to traverse Reified DOM tree, which is
455         a result of node distribution algorithm explained in Shadow DOM spec.
456         https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
457
458         Every public functions defined in ReifiedTreeTraversal are static
459         functions and are named in a similar way to ones defined in WebCore::Node class.
460         The only difference is that ReifiedTreeTraversal APIs consider shadow
461         hosts and also traverse nodes is Shadow DOM subtrees, crossing shadow's upper and lower boundary
462         transparently.
463
464         There is no actual client which uses these APIs. Follow-up patches for FocusNavigation
465         and EventDispatcher will use the APIs so that they can traverse node in reified tree order.
466
467         Test: fast/dom/shadow/reified-tree-traversal.html
468
469         * CMakeLists.txt:
470         * GNUmakefile.list.am:
471         * Target.pri:
472         * WebCore.exp.in:
473         * WebCore.gypi:
474         * WebCore.vcproj/WebCore.vcproj:
475         * WebCore.xcodeproj/project.pbxproj:
476         * dom/ReifiedTreeTraversal.cpp: Added.
477         (WebCore):
478         (WebCore::isShadowHost):
479         (WebCore::shadowTreeFor):
480         (WebCore::shadowTreeOfParent):
481         (WebCore::ReifiedTreeTraversal::firstChild):
482         (WebCore::ReifiedTreeTraversal::lastChild):
483         (WebCore::ReifiedTreeTraversal::lastChildWithoutCrossingUpperBoundary):
484         (WebCore::ReifiedTreeTraversal::traverseChild):
485         (WebCore::ReifiedTreeTraversal::traverseLightChildren):
486         (WebCore::ReifiedTreeTraversal::traverseNode):
487         (WebCore::ReifiedTreeTraversal::nextSibling):
488         (WebCore::ReifiedTreeTraversal::previousSibling):
489         (WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToInsertionPoint):
490         (WebCore::ReifiedTreeTraversal::traverseSiblingInCurrentTree):
491         (WebCore::ReifiedTreeTraversal::traverseSiblingOrBackToYoungerShadowRoot):
492         (WebCore::ReifiedTreeTraversal::escapeFallbackContentElement):
493         (WebCore::ReifiedTreeTraversal::traverseNodeEscapingFallbackContents):
494         (WebCore::ReifiedTreeTraversal::parentNode):
495         (WebCore::ReifiedTreeTraversal::parentNodeWithoutCrossingUpperBoundary):
496         (WebCore::ReifiedTreeTraversal::parentNodeOrBackToInsertionPoint):
497         (WebCore::ReifiedTreeTraversal::parentNodeInCurrentTree):
498         (WebCore::ReifiedTreeTraversal::parentNodeBackToYoungerShadowRootOrHost):
499         (WebCore::ReifiedTreeTraversal::adjustedParentNode):
500         (WebCore::ReifiedTreeTraversal::traverseNextNode):
501         (WebCore::ReifiedTreeTraversal::traverseNextNodeWithoutCrossingUpperBoundary):
502         (WebCore::ReifiedTreeTraversal::traversePreviousNode):
503         (WebCore::ReifiedTreeTraversal::traversePreviousNodeWithoutCrossingUpperBoundary):
504         * dom/ReifiedTreeTraversal.h: Added.
505         (WebCore):
506         (ReifiedTreeTraversal):
507         * dom/ShadowTree.cpp:
508         (WebCore::ShadowTree::insertionPointFor):
509         (WebCore::ShadowTree::selectionFor):
510         (WebCore):
511         * dom/ShadowTree.h:
512         (WebCore):
513         (ShadowTree):
514         * html/shadow/HTMLContentSelector.cpp:
515         (WebCore::HTMLContentSelector::findFor):
516         * html/shadow/HTMLContentSelector.h:
517         (HTMLContentSelectionSet):
518         (WebCore::HTMLContentSelectionSet::find):
519         (HTMLContentSelector):
520         * html/shadow/InsertionPoint.h:
521         (WebCore::isInsertionPoint):
522         (WebCore::toInsertionPoint):
523         (WebCore):
524         * testing/Internals.cpp:
525         (WebCore::Internals::nextSiblingInReifiedTree):
526         (WebCore):
527         (WebCore::Internals::firstChildInReifiedTree):
528         (WebCore::Internals::lastChildInReifiedTree):
529         (WebCore::Internals::traverseNextNodeInReifiedTree):
530         (WebCore::Internals::traversePreviousNodeInReifiedTree):
531         * testing/Internals.h:
532         (Internals):
533         * testing/Internals.idl:
534
535 2012-03-25  Nikita Vasilyev  <me@elv1s.ru>
536
537         Web Inspector: Indenting fully selected line should not indent the line next to it
538         https://bugs.webkit.org/show_bug.cgi?id=81758
539
540         In the editor, you can select a whole line by moving caret at 0 column
541         position and pressing Shift + Arrow Down/Up. After that, pressing Tab
542         indents 2 lines: fully selected one and the line next to it. The patch
543         changes this behaviour to indent only fully selected line since that is
544         what pretty-match all the other code editors do.
545
546         Reviewed by Pavel Feldman.
547
548         Test: inspector/editor/indentation.html
549
550         * inspector/front-end/TextViewer.js:
551         (WebInspector.TextEditorMainPanel.prototype._indentLines):
552             Do not insert indent at the begging of the last line if a selection
553             ends on its 0 column.
554         (WebInspector.TextEditorMainPanel.prototype._unindentLines):
555             Do not remove indent at the begging of the last line if a selection
556             ends on its 0 column.
557
558 2012-03-25  Abhishek Arya  <inferno@chromium.org>
559
560         Crash in ContainerNode::resumePostAttachCallbacks.
561         https://bugs.webkit.org/show_bug.cgi?id=82159
562
563         Reviewed by Hajime Morita.
564
565         Test: plugins/object-onfocus-mutation-crash.html
566
567         * dom/ContainerNode.cpp:
568         (WebCore::ContainerNode::resumePostAttachCallbacks): dispatching post attach
569         callbacks when our attach depth is 1 can fire mutation events such as onfocus
570         which can blow away |this|. Need to protect it with a RefPtr.
571         * html/HTMLPlugInImageElement.cpp:
572         (WebCore::HTMLPlugInImageElement::attach): add calls to suspend attach callbacks
573         until the function completes.
574
575 2012-03-25  Dana Jansens  <danakj@chromium.org>
576
577         [chromium] Layers with animating transforms should prepaint even if they are not visible yet
578         https://bugs.webkit.org/show_bug.cgi?id=82117
579
580         Reviewed by Adrienne Walker.
581
582         For animating transforms, instead of early-outing when the layer's
583         visible rect is empty, let it prepaint regardless.
584
585         For now, we just only paint the outermost tiles, and only for small
586         layers, with at most 9 tiles.
587
588         This changes the behaviour of ContentLayerChromium's
589         idlePaintContentsIfDirty() so I've guarded the behaviour of the two
590         prepainting functions that it calls to ensure the old behaviour holds
591         without animations, and the new behaviour works with them.
592
593         Unit test: TiledLayerChromiumTest.idlePaintZeroSizedLayer
594                    TiledLayerChromiumTest.idlePaintZeroSizedAnimatingLayer
595                    TiledLayerChromiumTest.idlePaintNonVisibleLayers
596                    TiledLayerChromiumTest.idlePaintNonVisibleAnimatingLayers
597
598         * platform/graphics/chromium/ContentLayerChromium.cpp:
599         (WebCore::ContentLayerChromium::idlePaintContentsIfDirty):
600         * platform/graphics/chromium/TiledLayerChromium.cpp:
601         (WebCore::TiledLayerChromium::prepareToUpdateIdle):
602         (WebCore::TiledLayerChromium::needsIdlePaint):
603         (WebCore::TiledLayerChromium::idlePaintRect):
604         * platform/graphics/chromium/TiledLayerChromium.h:
605         (WebCore::TiledLayerChromium::numPaintedTiles):
606         (TiledLayerChromium):
607
608 2012-03-25  Antti Koivisto  <antti@apple.com>
609
610         Don't use CSSRuleList for child rule ownership
611         https://bugs.webkit.org/show_bug.cgi?id=82127
612
613         Reviewed by Andreas Kling.
614
615         CSSMediaRule, WebKitCSSKeyframesRule and WebKitRegionRule use CSSRuleList for storing children. 
616         They should use a simple rule vector instead. CSSRuleList is a CSSOM type that should be 
617         instantiated on-demand for API purposes only.
618         
619         - Use Vector<RefPtr<CSSRule>> for storing the rule children of CSSMediaRule, WebKitCSSKeyframesRule 
620           and WebKitRegionRule.
621         - Add direct accessors, use internally instead of CSSRuleList.
622         - Make CSSRuleList an abstract base. Add concrete subclasses for dealing with the underlying storage.
623         - Instantiate CSSRuleLists on-demand.
624         - Make CSSStyleSheet.cssRules always return the same object instance. This matches Firefox and the rest
625           of our CSSOM implementation. Tested by fast/dom/gc-9.html.
626           
627         The patch decouples internals from the external API. It simplifies the child rule ownership and reduces 
628         indirection. Memory use of css rules with children is reduced (by a ptr, refcount and heap allocation overhead).
629
630         * css/CSSGrammar.y:
631         * css/CSSMediaRule.cpp:
632         (WebCore::CSSMediaRule::CSSMediaRule):
633         (WebCore::CSSMediaRule::~CSSMediaRule):
634         (WebCore::CSSMediaRule::append):
635         (WebCore::CSSMediaRule::insertRule):
636         (WebCore::CSSMediaRule::deleteRule):
637         (WebCore::CSSMediaRule::cssText):
638         (WebCore::CSSMediaRule::cssRules):
639         * css/CSSMediaRule.h:
640         (WebCore::CSSMediaRule::create):
641         (CSSMediaRule):
642         (WebCore::CSSMediaRule::ruleCount):
643         (WebCore::CSSMediaRule::ruleAt):
644         * css/CSSParser.cpp:
645         (WebCore::CSSParser::createMediaRule):
646         (WebCore::CSSParser::createRuleList):
647         (WebCore::CSSParser::createRegionRule):
648         * css/CSSParser.h:
649         (WebCore):
650         * css/CSSRuleList.cpp:
651         (WebCore):
652         (WebCore::StaticCSSRuleList::StaticCSSRuleList):
653         (WebCore::StaticCSSRuleList::~StaticCSSRuleList):
654         (WebCore::StaticCSSRuleList::deref):
655         (WebCore::StaticCSSRuleList::item):        
656         * css/CSSRuleList.h:
657         (CSSRuleList):
658
659             Turn CSSRuleList into abstract interface.
660                     
661         (StaticCSSRuleList):
662         (WebCore::StaticCSSRuleList::create):
663         (WebCore::StaticCSSRuleList::ref):
664         (WebCore::StaticCSSRuleList::rules):
665         (WebCore::StaticCSSRuleList::styleSheet):
666         (WebCore::StaticCSSRuleList::length):
667         
668             Concrete implementation for fixed list of rules.
669     
670         (WebCore):
671         (LiveCSSRuleList):
672         (WebCore::LiveCSSRuleList::LiveCSSRuleList):
673         (WebCore::LiveCSSRuleList::ref):
674         (WebCore::LiveCSSRuleList::deref):
675         (WebCore::LiveCSSRuleList::length):
676         (WebCore::LiveCSSRuleList::item):
677         (WebCore::LiveCSSRuleList::styleSheet):
678         
679             Concrete implemenation for live list backed by the underlying container rule.
680             LiveCSSRuleList is owned by the underlying rule. Refcount is forwarded. 
681         
682         * css/CSSStyleSelector.cpp:
683         (WebCore::CSSStyleSelector::sortAndTransferMatchedRules):
684         (WebCore::CSSStyleSelector::collectMatchingRulesForList):
685         * css/CSSStyleSelector.h:
686         (CSSStyleSelector):
687         * css/CSSStyleSheet.cpp:
688         
689             The same scheme for CSSStyleSheet.cssRule as with container rules.
690         
691         (StyleSheetCSSRuleList):
692         (WebCore::StyleSheetCSSRuleList::StyleSheetCSSRuleList):
693         (WebCore::StyleSheetCSSRuleList::ref):
694         (WebCore::StyleSheetCSSRuleList::deref):
695         (WebCore::StyleSheetCSSRuleList::length):
696         (WebCore::StyleSheetCSSRuleList::item):
697         (WebCore::StyleSheetCSSRuleList::styleSheet):
698         (WebCore):
699         (WebCore::CSSStyleSheet::rules):
700         (WebCore::CSSStyleSheet::cssRules):
701         * css/CSSStyleSheet.h:
702         (CSSStyleSheet):
703         * css/WebKitCSSKeyframesRule.cpp:
704         (WebCore::WebKitCSSKeyframesRule::WebKitCSSKeyframesRule):
705         (WebCore::WebKitCSSKeyframesRule::~WebKitCSSKeyframesRule):
706         (WebCore):
707         (WebCore::WebKitCSSKeyframesRule::append):
708         (WebCore::WebKitCSSKeyframesRule::deleteRule):
709         (WebCore::WebKitCSSKeyframesRule::findRule):
710         (WebCore::WebKitCSSKeyframesRule::findRuleIndex):
711         (WebCore::WebKitCSSKeyframesRule::cssText):
712         (WebCore::WebKitCSSKeyframesRule::cssRules):
713         * css/WebKitCSSKeyframesRule.h:
714         (WebKitCSSKeyframesRule):
715         (WebCore::WebKitCSSKeyframesRule::ruleCount):
716         (WebCore::WebKitCSSKeyframesRule::ruleAt):
717         (WebCore::WebKitCSSKeyframesRule::length):
718         (WebCore::WebKitCSSKeyframesRule::item):
719         * css/WebKitCSSRegionRule.cpp:
720         (WebCore::WebKitCSSRegionRule::WebKitCSSRegionRule):
721         (WebCore::WebKitCSSRegionRule::~WebKitCSSRegionRule):
722         (WebCore::WebKitCSSRegionRule::cssText):
723         (WebCore::WebKitCSSRegionRule::cssRules):
724         * css/WebKitCSSRegionRule.h:
725         * inspector/InspectorStyleSheet.cpp:
726         (WebCore::asCSSRuleList):
727         (WebCore::InspectorStyleSheet::addRule):
728         (WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
729
730 2012-03-25  Kentaro Hara  <haraken@chromium.org>
731
732         Remove duplicated GenerateConditionalString() from code generators
733         https://bugs.webkit.org/show_bug.cgi?id=82148
734
735         Reviewed by Adam Barth.
736
737         Previously GenerateConditionalString()s were defined in each code generator,
738         and they were doing the same thing. This patch puts GenerateConditionalString()
739         in CodeGenerator.pm and removes duplicated GenerateConditionalString()s.
740
741         No tests. No change in the generated code.
742
743         * bindings/scripts/CodeGenerator.pm:
744         (GenerateConditionalString):
745         * bindings/scripts/CodeGeneratorCPP.pm:
746         (GenerateHeader):
747         (GenerateImplementation):
748         * bindings/scripts/CodeGeneratorGObject.pm:
749         (GenerateProperty):
750         (GenerateProperties):
751         (GenerateFunction):
752         (WriteData):
753         * bindings/scripts/CodeGeneratorJS.pm:
754         (GenerateHeaderContentHeader):
755         (GenerateImplementationContentHeader):
756         (GenerateHeader):
757         (GenerateImplementation):
758         (GenerateCallbackHeader):
759         (GenerateCallbackImplementation):
760         * bindings/scripts/CodeGeneratorObjC.pm:
761         (GenerateHeader):
762         (GenerateImplementation):
763         * bindings/scripts/CodeGeneratorV8.pm:
764         (GenerateHeader):
765         (GenerateNormalAttrGetter):
766         (GenerateNormalAttrSetter):
767         (GenerateOverloadedFunctionCallback):
768         (GenerateFunctionCallback):
769         (GenerateBatchedAttributeData):
770         (GenerateImplementation):
771         (GenerateHeaderContentHeader):
772         (GenerateImplementationContentHeader):
773         (GenerateCallbackHeader):
774         (GenerateCallbackImplementation):
775
776 2012-03-25  Kentaro Hara  <haraken@chromium.org>
777
778         Move DOMWindowSQLDatabase.* to DOMWindowWebDatabase.*, and move WorkerContextSQLDatabase.* to WorkerContextWebDatabase.*
779         https://bugs.webkit.org/show_bug.cgi?id=82146
780
781         Reviewed by Adam Barth.
782
783         Now SQLDatabase is renamed to WebDatabase (See Modules/webdatabase/).
784         We should move DOMWindowSQLDatabase.* to DOMWindowWebDatabase.*,
785         and move WorkerContextSQLDatabase.* to WorkerContextWebDatabase.*.
786         We'll rename the SQL_DATABASE flag to the WEB_DATABASE flag in a follow-up patch.
787
788         No tests. No change in behavior.
789
790         * Modules/webdatabase/DOMWindowWebDatabase.cpp: Renamed from Source/WebCore/Modules/webdatabase/DOMWindowSQLDatabase.cpp.
791         (WebCore):
792         (WebCore::DOMWindowWebDatabase::openDatabase):
793         * Modules/webdatabase/DOMWindowWebDatabase.h: Renamed from Source/WebCore/Modules/webdatabase/DOMWindowSQLDatabase.h.
794         (WebCore):
795         (DOMWindowWebDatabase):
796         (WebCore::DOMWindowWebDatabase::DOMWindowWebDatabase):
797         (WebCore::DOMWindowWebDatabase::~DOMWindowWebDatabase):
798         * Modules/webdatabase/DOMWindowWebDatabase.idl: Renamed from Source/WebCore/Modules/webdatabase/DOMWindowSQLDatabase.idl.
799         * Modules/webdatabase/WorkerContextWebDatabase.cpp: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextSQLDatabase.cpp.
800         (WebCore):
801         (WebCore::WorkerContextWebDatabase::openDatabase):
802         (WebCore::WorkerContextWebDatabase::openDatabaseSync):
803         * Modules/webdatabase/WorkerContextWebDatabase.h: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextSQLDatabase.h.
804         (WebCore):
805         (WorkerContextWebDatabase):
806         (WebCore::WorkerContextWebDatabase::WorkerContextWebDatabase):
807         (WebCore::WorkerContextWebDatabase::~WorkerContextWebDatabase):
808         * Modules/webdatabase/WorkerContextWebDatabase.idl: Renamed from Source/WebCore/Modules/webdatabase/WorkerContextSQLDatabase.idl.
809
810         * DerivedSources.make:
811         * DerivedSources.pri:
812         * GNUmakefile.list.am:
813         * Target.pri:
814         * WebCore.gypi:
815         * WebCore.vcproj/WebCore.vcproj:
816         * WebCore.xcodeproj/project.pbxproj:
817
818 2012-03-25  Philip Rogers  <pdr@google.com>
819
820         Avoid race condition when iterating over pending resources
821         https://bugs.webkit.org/show_bug.cgi?id=82115
822
823         Reviewed by Nikolas Zimmermann.
824
825         We can hit a race condition in SVGStyledElement::buildPendingResourcesIfNeeded
826         where pending elements can become non-pending while we iterate over them.
827
828         This patch cleans up buildPendingResourcesIfNeeded and re-works how pending
829         resources are removed. Because pending resources can be modified while
830         iterating over them, we introduce m_pendingResourcesForRemoval that
831         holds pending resources that are marked for removal. Instead of iterating
832         over this list we simply remove each pending resource from
833         m_pendingResourcesForRemoval; if a pending resource is modified or removed
834         during the processing of another pending resource this list is updated before
835         the next element can be accessed.
836
837         This change also removes removePendingResourceForElement which is no longer
838         referenced.
839
840         Test: http/tests/svg/change-id-with-pending-resources.html
841
842         * svg/SVGDocumentExtensions.cpp:
843         (WebCore::SVGDocumentExtensions::~SVGDocumentExtensions):
844         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources):
845         (WebCore::SVGDocumentExtensions::removePendingResourceForRemoval):
846         (WebCore):
847         (WebCore::SVGDocumentExtensions::markPendingResourcesForRemoval):
848         (WebCore::SVGDocumentExtensions::removeElementFromPendingResourcesForRemoval):
849         * svg/SVGDocumentExtensions.h:
850         (SVGDocumentExtensions):
851         * svg/SVGStyledElement.cpp:
852         (WebCore::SVGStyledElement::buildPendingResourcesIfNeeded):
853
854 2012-03-25  Arvid Nilsson  <anilsson@rim.com>
855
856         [BlackBerry] Accelerated compositing layers fail to render when using WebPageCompositor
857         https://bugs.webkit.org/show_bug.cgi?id=82104
858         RIM PR: 145963
859
860         Reviewed by Rob Buis.
861
862         The embedder may use vertex buffers, which affected the interpretation
863         our vertex array pointers from memory pointers to offsets into a vertex
864         buffer. The resulting geometry often resulted in no visible layers on
865         screen.
866
867         Fixed by getting rid of any bound buffer when we enter
868         LayerRenderer::drawLayers().
869
870         * platform/graphics/blackberry/LayerRenderer.cpp:
871         (WebCore::LayerRenderer::drawLayers):
872
873 2012-03-24  Nat Duca  <nduca@chromium.org>
874
875         [chromium] Instrument gesture animations with async traces
876         https://bugs.webkit.org/show_bug.cgi?id=82076
877
878         Reviewed by Adrienne Walker.
879
880         * platform/ActivePlatformGestureAnimation.cpp:
881         (WebCore::ActivePlatformGestureAnimation::~ActivePlatformGestureAnimation):
882         (WebCore::ActivePlatformGestureAnimation::ActivePlatformGestureAnimation):
883         * platform/PlatformGestureCurve.h:
884         (PlatformGestureCurve):
885         * platform/TouchpadFlingPlatformGestureCurve.h:
886         (WebCore::TouchpadFlingPlatformGestureCurve::debugName):
887         * platform/WheelFlingPlatformGestureCurve.h:
888         (WebCore::WheelFlingPlatformGestureCurve::debugName):
889         * platform/graphics/chromium/cc/CCActiveGestureAnimation.cpp:
890         (WebCore::CCActiveGestureAnimation::CCActiveGestureAnimation):
891         (WebCore::CCActiveGestureAnimation::~CCActiveGestureAnimation):
892         * platform/graphics/chromium/cc/CCGestureCurve.h:
893         (CCGestureCurve):
894
895 2012-03-24  Jeffrey Pfau  <jpfau@apple.com>
896
897         XML error document creation should not fire mutation events
898         https://bugs.webkit.org/show_bug.cgi?id=80765
899
900         Reviewed by Adam Barth.
901
902         Broke two tests that expected the old behavior, which have now been updated.
903
904         * xml/XMLErrors.cpp:
905         (WebCore::createXHTMLParserErrorHeader):
906         (WebCore::XMLErrors::insertErrorMessageBlock):
907
908 2012-03-24  Florin Malita  <fmalita@google.com>
909
910         ForeignObject content is zoomed two times
911         https://bugs.webkit.org/show_bug.cgi?id=76282
912
913         Reviewed by Nikolas Zimmermann.
914
915         Test: svg/zoom/page/zoom-foreign-content.svg
916
917         Reset the effective zoom property for FO-nested content to avoid
918         having the zoom factor applied multiple times (zooming is handled by
919         the top level SVG root element).
920
921         * css/CSSStyleSelector.cpp:
922         (WebCore::CSSStyleSelector::adjustRenderStyle):
923
924 2012-03-24  Chris Fleizach  <cfleizach@apple.com>
925
926         AX: Support solution to handle invalid ax text marker
927         https://bugs.webkit.org/show_bug.cgi?id=82023
928
929         Reviewed by Oliver Hunt.
930
931         This provides methods to better use text markers so that assistive technologies
932         can know when they are valid, and can convert them to and from absolute positions.
933
934         Test: platform/mac/accessibility/textmarker-routines.html
935
936         * accessibility/mac/WebAccessibilityObjectWrapper.mm:
937         (-[WebAccessibilityObjectWrapper accessibilityParameterizedAttributeNames]):
938         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
939         (-[WebAccessibilityObjectWrapper _indexForTextMarker:]):
940         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
941         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
942
943 2012-03-24  Victor Carbune  <vcarbune@adobe.com>
944
945         Quick fix for rendering controls regression.
946         https://bugs.webkit.org/show_bug.cgi?id=82125
947
948         Reviewed by Eric Carlson.
949
950         Only temporary fix. Tests to cover the problem should be added
951
952         * html/shadow/MediaControlElements.cpp:
953         (WebCore::MediaControlPanelElement::makeOpaque): The display:none
954         property should be toggled only by the media element now.
955         (WebCore::MediaControlPanelElement::makeTransparent): The timer
956         that toggles the dispalay:none shouldn't be used now.
957
958 2012-03-24  Kevin Ollivier  <kevino@theolliviers.com>
959
960         [wx] Unreviewed. Add header needed for compilation.
961
962         * html/shadow/TextFieldDecorationElement.cpp:
963
964 2012-03-24  Abhishek Arya  <inferno@chromium.org>
965
966         Crash in ApplyStyleCommand::applyInlineStyleToNodeRange.
967         https://bugs.webkit.org/show_bug.cgi?id=81959
968
969         Reviewed by Ryosuke Niwa.
970
971         Test: editing/execCommand/apply-style-command-crash.html
972
973         * editing/ApplyStyleCommand.cpp:
974         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): RefPtr the weak
975         node iterator |node|.
976         * editing/ApplyStyleCommand.h:
977         (ApplyStyleCommand): convert |startNode| and |pastEndNode| into PassRefPtr.
978
979 2012-03-24  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
980
981         Unreviewed, build fix since we use "-Werror=unused-but-set-variable".
982
983         The variable 'it' was set at TextureMapperShaderManager.h:110 but never used.
984
985         * platform/graphics/texmap/TextureMapperShaderManager.h:
986         (WebCore::TextureMapperShaderManager::getShaderProgram):
987
988 2012-03-24  Zeno Albisser  <zeno@webkit.org>
989
990         [Qt][WK2] Make TextureMapperShaderManager::getShaderProgram() not be a template.
991         https://bugs.webkit.org/show_bug.cgi?id=82049
992
993         Change the getShaderProgram() function to not be a template.
994         This is a workaround for a compiler bug that leads to an assert
995         when compiling in debug mode on mac.
996
997         Reviewed by Noam Rosenthal.
998
999         * platform/graphics/texmap/TextureMapperGL.cpp:
1000         (WebCore::TextureMapperGL::drawTexture):
1001         (WebCore::TextureMapperGL::beginClip):
1002         * platform/graphics/texmap/TextureMapperShaderManager.h:
1003         (TextureMapperShaderProgram):
1004         (WebCore::TextureMapperShaderManager::getShaderProgram):
1005         (TextureMapperShaderManager):
1006
1007 2012-03-23  Shawn Singh  <shawnsingh@chromium.org>
1008
1009         [chromium] Incorrect replica originTransform used in CCDamageTracker
1010         https://bugs.webkit.org/show_bug.cgi?id=82118
1011
1012         Reviewed by Adrienne Walker.
1013
1014         Unit test added to CCDamageTrackerTest.cpp
1015
1016         * platform/graphics/chromium/cc/CCDamageTracker.cpp:
1017         (WebCore::CCDamageTracker::extendDamageForRenderSurface):
1018
1019 2012-03-23  Dana Jansens  <danakj@chromium.org>
1020
1021         [chromium] When prepainting fails, tiles dirty rects may be cleared
1022         https://bugs.webkit.org/show_bug.cgi?id=82107
1023
1024         Reviewed by Adrienne Walker.
1025
1026         When prepainting, if a tile is unable to be reserved due to memory
1027         limits, we bail out of prepareToUpdateTiles. But we would have
1028         cleared the dirty rect of any previous tiles. This leaves them
1029         in a bad state where their textures are reserved, but their textureIds
1030         are set to 0, and they are not marked dirty. This means that they will
1031         not be updated and displayed if they become visible, since it is
1032         assumed that valid textures with zero textureId must have a dirty
1033         region.
1034
1035         We fix this by not clearing the dirty rects until we know we are
1036         going to update the layer.
1037
1038         Unit test: TiledLayerChromiumTest.pushTilesAfterIdlePaintFailed
1039
1040         * platform/graphics/chromium/TiledLayerChromium.cpp:
1041         (WebCore::TiledLayerChromium::prepareToUpdateTiles):
1042         * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
1043         (WebCore::CCTiledLayerImpl::hasTextureIdForTileAt):
1044         (WebCore):
1045         * platform/graphics/chromium/cc/CCTiledLayerImpl.h:
1046         (CCTiledLayerImpl):
1047
1048 2012-03-23  Stephanie Lewis  <slewis@apple.com>
1049
1050         https://bugs.webkit.org/show_bug.cgi?id=81963 WebProcess can get stuck in GC during many low memory signals.
1051         <rdar://problem/11094830> WebProcess appears to get stuck in its GC handler (81963).
1052         Remove the call to garbage collect  in low memory signal handler.  Did some testing with hitting the low memory handler
1053         during Membuster and we would get back at most 100k - 200k.  That isn't enough to help the system, and in 
1054         that state the GC collection can take a substantial amount of time.
1055
1056         Reviewed by Geoff Garen.
1057
1058         Performance Change, no change in behavior.
1059
1060         * platform/mac/MemoryPressureHandlerMac.mm:
1061         (WebCore::MemoryPressureHandler::releaseMemory):
1062
1063 2012-03-23  W. James MacLean  <wjmaclean@chromium.org>
1064
1065         [chromium] CCLayerTreeHostImpl::scrollBegin() should return ScrollFailed for CCInputHandlerClient::Gesture type when wheel handlers found.
1066         https://bugs.webkit.org/show_bug.cgi?id=82106
1067
1068         Reviewed by Adrienne Walker.
1069
1070         Existing unit tests updated.
1071
1072         With gesture scroll events now being handled as mouse wheel events, we should not start a gesture scroll when
1073         wheel handlers are present.
1074
1075         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
1076         (WebCore::CCLayerTreeHostImpl::scrollBegin):
1077
1078 2012-03-23  Adam Barth  <abarth@webkit.org>
1079
1080         Move Notifications APIs from WorkerContext.idl to WorkerContextNotifications.idl
1081         https://bugs.webkit.org/show_bug.cgi?id=79635
1082
1083         Reviewed by Kentaro Hara.
1084
1085         This patch moves the NotificationCenter from WorkerContext to
1086         WorkerContextNotificiations, reducing clutter in WorkerContext.  After
1087         this patch, Notifications are almost entirely contained in the
1088         notifications directory.
1089
1090         * CMakeLists.txt:
1091         * DerivedSources.make:
1092         * DerivedSources.pri:
1093         * GNUmakefile.list.am:
1094         * Target.pri:
1095         * WebCore.gypi:
1096         * WebCore.vcproj/WebCore.vcproj:
1097         * WebCore.xcodeproj/project.pbxproj:
1098         * workers/WorkerContext.cpp:
1099         (WebCore::WorkerContext::~WorkerContext):
1100         * workers/WorkerContext.h:
1101         (WebCore):
1102         (WorkerContext):
1103         * workers/WorkerContext.idl:
1104
1105 2012-03-23  Michal Mocny  <mmocny@google.com>
1106
1107         [chromium] RootLayer was not being checked for null causing segfaults very rarely.
1108         https://bugs.webkit.org/show_bug.cgi?id=82111
1109
1110         Reviewed by Adrienne Walker.
1111
1112         * platform/graphics/chromium/LayerRendererChromium.cpp:
1113         (WebCore::LayerRendererChromium::beginDrawingFrame):
1114         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
1115         (WebCore::CCLayerTreeHostImpl::drawLayers):
1116
1117 2012-03-23  Shawn Singh  <shawnsingh@chromium.org>
1118
1119         [chromium] Fix race bug that clobbers CCLayerImpl updateRect
1120         https://bugs.webkit.org/show_bug.cgi?id=82109
1121
1122         Reviewed by Dirk Pranke.
1123
1124         If the main thread commits twice before the impl thread actually
1125         draws, then the updateRect of the first frame gets lost forever,
1126         and not propagated to the damage tracker.
1127
1128         The solution is to accumulate the updateRect. The CCLayerImpl
1129         updateRect is already being correctly cleared at the appropriate
1130         time after drawing.
1131
1132         Unit test added to LayerChromiumTest.cpp.
1133
1134         * platform/graphics/chromium/LayerChromium.cpp:
1135         (WebCore::LayerChromium::pushPropertiesTo):
1136
1137 2012-03-23  Rafael Weinstein  <rafaelw@chromium.org>
1138
1139         [MutationObservers] attributeFilter should be case sensitive at all times
1140         https://bugs.webkit.org/show_bug.cgi?id=81822
1141
1142         Reviewed by Ryosuke Niwa.
1143
1144         This removes the behavior in MutationObserverRegistration which treats
1145         attributeFilter as case insensitive for HTML elements in HTML documents.
1146
1147         Relevant tests have been updated.
1148
1149         * dom/MutationObserverRegistration.cpp:
1150         (WebCore::MutationObserverRegistration::resetObservation):
1151         (WebCore::MutationObserverRegistration::shouldReceiveMutationFrom):
1152         * dom/MutationObserverRegistration.h:
1153         (MutationObserverRegistration):
1154
1155 2012-03-23  Kentaro Hara  <haraken@chromium.org>
1156
1157         Move WebSocket APIs from WorkerContext.idl to WorkerContextWebSocket.idl
1158         https://bugs.webkit.org/show_bug.cgi?id=79663
1159
1160         Reviewed by Adam Barth.
1161
1162         For WebKit modularization, this patch moves WebSocket APIs from WorkerContext.idl
1163         to WorkerContextWebSocket.idl.
1164
1165         Tests: http/tests/websocket/tests/hybi/workers/* (No change in test results)
1166
1167         * CMakeLists.txt:
1168         * DerivedSources.make:
1169         * DerivedSources.pri:
1170         * GNUmakefile.list.am:
1171         * Modules/websockets/WorkerContextWebSocket.idl: Added.
1172         * WebCore.gypi:
1173         * WebCore.xcodeproj/project.xcodeproj:
1174         * workers/WorkerContext.idl:
1175
1176 2012-03-23  Parag Radke  <parag@motorola.com>
1177
1178         REGRESSION: can select text of an input button
1179         https://bugs.webkit.org/show_bug.cgi?id=13624
1180
1181         Reviewed by Ryosuke Niwa.
1182
1183         Text in a button should never have a selection background of its own painted
1184         but if the button is inside an editable area, then the whole button should
1185         have it's selection background painted.
1186
1187         Test: editing/selection/selection-button-text.html
1188
1189         * rendering/RenderButton.h:
1190         Added implementation for the virtual function canBeSelectionLeaf()
1191         which returns true if the button renderer is editable, false other wise.
1192         * rendering/RenderTextFragment.h:
1193         Added implementation for the virtual function canBeSelectionLeaf()
1194         which returns true if the text fragment renderer is editable, false other wise.
1195
1196 2012-03-23  Eric Carlson  <eric.carlson@apple.com>
1197
1198         Remove unnecessary ASSERT from LoadableTextTrack::trackElementIndex
1199         https://bugs.webkit.org/show_bug.cgi?id=82095
1200
1201         Reviewed by Dan Bernstein.
1202
1203         No new tests, removed a bogus ASSERT that was sometimes triggered by tests.
1204
1205         * html/track/LoadableTextTrack.cpp:
1206         (WebCore::LoadableTextTrack::trackElementIndex): Remove ASSERT.
1207
1208 2012-03-23  Eric Carlson  <eric.carlson@apple.com>
1209
1210         Layout Test media/video-source-load.html is failing
1211         https://bugs.webkit.org/show_bug.cgi?id=82094
1212
1213         Reviewed by Alexey Proskuryakov.
1214
1215         No new tests, tested by media/video-source-load.html.
1216
1217         * html/HTMLMediaElement.cpp:
1218         (WebCore::HTMLMediaElement::sourceWasAdded): Set m_nextChildNodeToConsider when called 
1219             with networkState == NETWORK_EMPTY because the resource selection algorithm has
1220             not started yet.
1221
1222 2012-03-23  Alexey Proskuryakov  <ap@apple.com>
1223
1224         [Mac] No need for platform-specific ENABLE_BLOB values
1225         https://bugs.webkit.org/show_bug.cgi?id=82102
1226
1227         Reviewed by David Kilzer.
1228
1229         * Configurations/FeatureDefines.xcconfig:
1230
1231 2012-03-23  Kent Tamura  <tkent@chromium.org>
1232
1233         Add TextFieldDecorator and TextFieldDecorationElement
1234         https://bugs.webkit.org/show_bug.cgi?id=80580
1235
1236         Reviewed by Dimitri Glazkov.
1237
1238         These classes will be used to add a decoration icon to a text field
1239         <input> from outside of WebCore. We have a plan to use them in Chromium
1240         port. So this patch doesn't add TextFieldDecorationElement.{cpp,h} to
1241         non-Chromium build files.
1242
1243         How it works:
1244         When a shadow subtree for a text field is created, we ask ChromeClient
1245         to decorate it. ChromeClient appends a TextFieldDecorationElement to the
1246         existing shadow subtree or another shadow tree. A TextFieldDecorator is
1247         associated to a TextFieldDecorationElement, and it provides decoration
1248         icon images and a click handler.
1249
1250         No new tests. This patch won't make any behavior change for now.
1251
1252         * WebCore.gypi: Add TextFieldDecorationElement.cpp and TextFieldDecorationElement.h
1253         * dom/Element.h:
1254         (WebCore::Element::isTextFieldDecoration):
1255         * html/TextFieldInputType.cpp:
1256         (WebCore::TextFieldInputType::createShadowSubtree):
1257         Calls ChromeClient::willAddTextFieldDecorationsTo() and addTextFieldDecorationsTo().
1258         * html/shadow/TextFieldDecorationElement.cpp: Added.
1259         (WebCore::TextFieldDecorator::~TextFieldDecorator):
1260         (WebCore::TextFieldDecorationElement::TextFieldDecorationElement):
1261         (WebCore::TextFieldDecorationElement::create):
1262         (WebCore::TextFieldDecorationElement::isTextFieldDecoration):
1263         (WebCore::TextFieldDecorationElement::updateImage):
1264         (WebCore::TextFieldDecorationElement::customStyleForRenderer):
1265         Sets the size to a square of the font-size.
1266         (WebCore::TextFieldDecorationElement::createRenderer):
1267         Always creates a RenderImage.
1268         (WebCore::TextFieldDecorationElement::attach):
1269         Sets an image for appropriate state.
1270         (WebCore::TextFieldDecorationElement::isMouseFocusable):
1271         (WebCore::TextFieldDecorationElement::defaultEventHandler):
1272         Delegate a click event to the corresponding function of TextFieldDecorator.
1273         * html/shadow/TextFieldDecorationElement.h: Added.
1274         (TextFieldDecorator): Added.
1275         (TextFieldDecorationElement): Added.
1276         (WebCore::toTextFieldDecorationElement): Added.
1277         * page/ChromeClient.h:
1278         (WebCore::ChromeClient::willAddTextFieldDecorationsTo): Add an empty implementation.
1279         (WebCore::ChromeClient::addTextFieldDecorationsTo): ditto.
1280
1281 2012-03-23  Adam Klein  <adamk@chromium.org>
1282
1283         Match DOM4 spec with respect to DocumentFragment insertion
1284         https://bugs.webkit.org/show_bug.cgi?id=82089
1285
1286         Reviewed by Ryosuke Niwa.
1287
1288         DOM4 specifies the behavior of appendChild, insertBefore, and replaceChild
1289         in terms of "mutation algorithms":
1290
1291         http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#mutation-algorithms
1292
1293         This change updates WebKit to match, in particular with regard to DocumentFragments.
1294         Previously, ContainerNode would remove nodes one at a time, then add them to the new parent.
1295         When combined with MutationObservers, this results in overly-verbose mutation records.
1296         Now we create as few records as possible, matching the spec as well as Gecko's implementation
1297         of MutationObservers.
1298
1299         Note that we still need to check validity each time through the loop,
1300         since inserting a node may dispatch events. In a future change, I hope
1301         to move these events so that they fire only after all nodes are inserted,
1302         but that's too much to tackle all in one.
1303
1304         Tests: fast/mutation/document-fragment-insertion.html
1305
1306         * dom/ContainerNode.cpp:
1307         (WebCore::collectChildrenAndRemoveFromOldParent): New helper method
1308         combining collectTargetNodes() with the removal of the collected nodes from
1309         their old parent, if any.
1310         (WebCore::ContainerNode::insertBefore): Use new helper method instead
1311         of removing nodes one at a time from the fragment.
1312         (WebCore::ContainerNode::replaceChild): ditto. Also removed some redundant asserts
1313         and moved the "do nothing" check out of the loop.
1314         (WebCore::ContainerNode::appendChild): Use new helper method.
1315
1316 2012-03-23  Stephen White  <senorblanco@chromium.org>
1317
1318         [skia] Switch to Skia's implementation of the feMorphology filter.
1319         https://bugs.webkit.org/show_bug.cgi?id=82085
1320
1321         Reviewed by Dirk Schulze.
1322
1323         Covered by existing tests in svg/filters/.
1324
1325         * WebCore.gypi:
1326         * platform/graphics/filters/FEMorphology.h:
1327         (FEMorphology):
1328         * platform/graphics/filters/skia/FEMorphologySkia.cpp: Added.
1329         (WebCore):
1330         (WebCore::FEMorphology::platformApplySkia):
1331
1332 2012-03-23  Adam Barth  <abarth@webkit.org>
1333
1334         Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl (Part 3)
1335         https://bugs.webkit.org/show_bug.cgi?id=82027
1336
1337         Reviewed by Kentaro Hara.
1338
1339         Rather than watching for willDetachPage, NotificationCenter can just
1340         override ActiveDOMObject::stop directly to be notified when it needs to
1341         stop.
1342
1343         Switching NotificationCenter over to using ActiveDOMObject callbacks
1344         frees DOMWindowNotification to implement reconnectFrame.  However, this
1345         is only really a victory in princple because NotificationCenter always
1346         returns false for canSuspend(), which means we'll never actually use
1347         the reconnectFrame functionality.  However, this patch does move us
1348         closer to the time when NotificationCenter can implement
1349         ActiveDOMObject::suspend/resume to play nice with the PageCache.
1350
1351         * notifications/DOMWindowNotifications.cpp:
1352         (WebCore::DOMWindowNotifications::disconnectFrame):
1353         (WebCore::DOMWindowNotifications::reconnectFrame):
1354         * notifications/DOMWindowNotifications.h:
1355         (DOMWindowNotifications):
1356         * notifications/NotificationCenter.cpp:
1357         (WebCore::NotificationCenter::NotificationCenter):
1358         (WebCore::NotificationCenter::stop):
1359         * notifications/NotificationCenter.h:
1360         (NotificationCenter):
1361
1362 2012-03-23  Daniel Cheng  <dcheng@chromium.org>
1363
1364         [chromium] Support file drag out using DataTransferItemList::add(File)
1365         https://bugs.webkit.org/show_bug.cgi?id=81261
1366
1367         Reviewed by Tony Chang.
1368
1369         Original patch by Varun Jain <varunjain@chromium.org>.
1370         I've updated the original patch to remove 'downloadurl' handling since it's not tested, nor
1371         is it necessary for File objects, since File objects correspond to a native filesystem path.
1372
1373         Test: fast/events/drag-dataTransferItemList-file-handling.html
1374
1375         * platform/chromium/DataTransferItemListChromium.cpp:
1376         (WebCore::DataTransferItemListChromium::add):
1377
1378 2012-03-23  Zan Dobersek  <zandobersek@gmail.com>
1379
1380         [GObject bindings] Supplemental interfaces are not disabled with the "Conditional" attribute
1381         https://bugs.webkit.org/show_bug.cgi?id=80030
1382
1383         Reviewed by Martin Robinson.
1384
1385         Changes in CodeGeneratorGObject.pm:
1386         - group implementation of private helpers and guard them inside
1387         an ifdef if a root conditional attribute is present.
1388         - always define the type of a GObject binding, even if the root
1389         conditional feature is not enabled
1390         - the methods are generated as well, but are simply stubs if the
1391         feature is not enabled, throwing a warning upon interaction.
1392         - if the method itself is guarded by a conditional attribute,
1393         the stub implementation gains one more level of depth, throwing
1394         a warning if the method's conditional feature is not enabled
1395         but the root conditional feature is.
1396         - small style fixes in random places.
1397
1398         Also changed are GObject baselines for binding tests.
1399
1400         No new tests - no new testable functionality.
1401
1402         * bindings/gobject/GNUmakefile.am:
1403         * bindings/scripts/CodeGeneratorGObject.pm:
1404         (HumanReadableConditional):
1405         (GenerateConditionalWarn):
1406         (GenerateProperty):
1407         (GenerateProperties):
1408         (GenerateFunction):
1409         (GenerateFunctions):
1410         (GenerateCFile):
1411         (GenerateEventTargetIface):
1412         (Generate):
1413         (WriteData):
1414         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
1415         (WebKit):
1416         (WebKit::kit):
1417         (WebKit::wrapFloat64Array):
1418         (webkit_dom_float64array_finalize):
1419         (webkit_dom_float64array_foo):
1420         * bindings/scripts/test/GObject/WebKitDOMFloat64ArrayPrivate.h:
1421         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1422         (WebKit):
1423         (WebKit::kit):
1424         (WebKit::wrapTestActiveDOMObject):
1425         (webkit_dom_test_active_dom_object_finalize):
1426         (webkit_dom_test_active_dom_object_exciting_function):
1427         (webkit_dom_test_active_dom_object_post_message):
1428         (webkit_dom_test_active_dom_object_get_exciting_attr):
1429         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h:
1430         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1431         (WebKit):
1432         (WebKit::kit):
1433         (WebKit::core):
1434         (WebKit::wrapTestCallback):
1435         (webkit_dom_test_callback_finalize):
1436         (webkit_dom_test_callback_callback_with_no_param):
1437         (webkit_dom_test_callback_callback_with_class1param):
1438         (webkit_dom_test_callback_callback_with_class2param):
1439         (webkit_dom_test_callback_callback_with_non_bool_return_type):
1440         (webkit_dom_test_callback_callback_with_string_list):
1441         * bindings/scripts/test/GObject/WebKitDOMTestCallbackPrivate.h:
1442         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
1443         (WebKit):
1444         (WebKit::kit):
1445         (WebKit::wrapTestCustomNamedGetter):
1446         (webkit_dom_test_custom_named_getter_finalize):
1447         (webkit_dom_test_custom_named_getter_another_function):
1448         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetterPrivate.h:
1449         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1450         (WebKit):
1451         (WebKit::kit):
1452         (WebKit::wrapTestEventConstructor):
1453         (webkit_dom_test_event_constructor_finalize):
1454         (webkit_dom_test_event_constructor_get_attr1):
1455         (webkit_dom_test_event_constructor_get_attr2):
1456         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructorPrivate.h:
1457         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1458         (WebKit):
1459         (WebKit::core):
1460         (WebKit::wrapTestEventTarget):
1461         (webkit_dom_test_event_target_finalize):
1462         (webkit_dom_test_event_target_item):
1463         (webkit_dom_test_event_target_dispatch_event):
1464         * bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h:
1465         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1466         (WebKit):
1467         (WebKit::kit):
1468         (WebKit::core):
1469         (WebKit::wrapTestInterface):
1470         (webkit_dom_test_interface_finalize):
1471         (webkit_dom_test_interface_supplemental_method1):
1472         (webkit_dom_test_interface_supplemental_method2):
1473         (webkit_dom_test_interface_supplemental_method4):
1474         (webkit_dom_test_interface_get_supplemental_str1):
1475         (webkit_dom_test_interface_get_supplemental_str2):
1476         (webkit_dom_test_interface_set_supplemental_str2):
1477         (webkit_dom_test_interface_get_supplemental_node):
1478         (webkit_dom_test_interface_set_supplemental_node):
1479         * bindings/scripts/test/GObject/WebKitDOMTestInterfacePrivate.h:
1480         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
1481         (WebKit):
1482         (WebKit::kit):
1483         (WebKit::wrapTestMediaQueryListListener):
1484         (webkit_dom_test_media_query_list_listener_finalize):
1485         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListenerPrivate.h:
1486         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
1487         (WebKit):
1488         (WebKit::kit):
1489         (WebKit::wrapTestNamedConstructor):
1490         (webkit_dom_test_named_constructor_finalize):
1491         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructorPrivate.h:
1492         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1493         (WebKit):
1494         (WebKit::kit):
1495         (WebKit::core):
1496         (WebKit::wrapTestObj):
1497         (webkit_dom_test_obj_finalize):
1498         (webkit_dom_test_obj_set_property):
1499         (webkit_dom_test_obj_get_property):
1500         (webkit_dom_test_obj_constructed):
1501         (webkit_dom_test_obj_class_init):
1502         (webkit_dom_test_obj_init):
1503         (webkit_dom_test_obj_void_method):
1504         (webkit_dom_test_obj_void_method_with_args):
1505         (webkit_dom_test_obj_int_method):
1506         (webkit_dom_test_obj_int_method_with_args):
1507         (webkit_dom_test_obj_obj_method):
1508         (webkit_dom_test_obj_obj_method_with_args):
1509         (webkit_dom_test_obj_method_with_sequence_arg):
1510         (webkit_dom_test_obj_method_that_requires_all_args_and_throws):
1511         (webkit_dom_test_obj_serialized_value):
1512         (webkit_dom_test_obj_idb_key):
1513         (webkit_dom_test_obj_options_object):
1514         (webkit_dom_test_obj_method_with_exception):
1515         (webkit_dom_test_obj_with_script_state_void):
1516         (webkit_dom_test_obj_with_script_state_obj):
1517         (webkit_dom_test_obj_with_script_state_void_exception):
1518         (webkit_dom_test_obj_with_script_state_obj_exception):
1519         (webkit_dom_test_obj_with_script_execution_context):
1520         (webkit_dom_test_obj_with_script_execution_context_and_script_state):
1521         (webkit_dom_test_obj_with_script_execution_context_and_script_state_obj_exception):
1522         (webkit_dom_test_obj_with_script_execution_context_and_script_state_with_spaces):
1523         (webkit_dom_test_obj_method_with_optional_arg):
1524         (webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg):
1525         (webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args):
1526         (webkit_dom_test_obj_method_with_optional_string):
1527         (webkit_dom_test_obj_method_with_optional_string_is_undefined):
1528         (webkit_dom_test_obj_method_with_optional_string_is_null_string):
1529         (webkit_dom_test_obj_conditional_method1):
1530         (webkit_dom_test_obj_conditional_method2):
1531         (webkit_dom_test_obj_conditional_method3):
1532         (webkit_dom_test_obj_class_method):
1533         (webkit_dom_test_obj_class_method_with_optional):
1534         (webkit_dom_test_obj_overloaded_method1):
1535         (webkit_dom_test_obj_convert1):
1536         (webkit_dom_test_obj_convert2):
1537         (webkit_dom_test_obj_convert3):
1538         (webkit_dom_test_obj_convert4):
1539         (webkit_dom_test_obj_convert5):
1540         (webkit_dom_test_obj_mutable_point_function):
1541         (webkit_dom_test_obj_immutable_point_function):
1542         (webkit_dom_test_obj_orange):
1543         (webkit_dom_test_obj_strict_function):
1544         (webkit_dom_test_obj_get_read_only_int_attr):
1545         (webkit_dom_test_obj_get_read_only_string_attr):
1546         (webkit_dom_test_obj_get_read_only_test_obj_attr):
1547         (webkit_dom_test_obj_get_short_attr):
1548         (webkit_dom_test_obj_set_short_attr):
1549         (webkit_dom_test_obj_get_unsigned_short_attr):
1550         (webkit_dom_test_obj_set_unsigned_short_attr):
1551         (webkit_dom_test_obj_get_int_attr):
1552         (webkit_dom_test_obj_set_int_attr):
1553         (webkit_dom_test_obj_get_long_long_attr):
1554         (webkit_dom_test_obj_set_long_long_attr):
1555         (webkit_dom_test_obj_get_unsigned_long_long_attr):
1556         (webkit_dom_test_obj_set_unsigned_long_long_attr):
1557         (webkit_dom_test_obj_get_string_attr):
1558         (webkit_dom_test_obj_set_string_attr):
1559         (webkit_dom_test_obj_get_test_obj_attr):
1560         (webkit_dom_test_obj_set_test_obj_attr):
1561         (webkit_dom_test_obj_get_xml_obj_attr):
1562         (webkit_dom_test_obj_set_xml_obj_attr):
1563         (webkit_dom_test_obj_get_create):
1564         (webkit_dom_test_obj_set_create):
1565         (webkit_dom_test_obj_get_reflected_string_attr):
1566         (webkit_dom_test_obj_set_reflected_string_attr):
1567         (webkit_dom_test_obj_get_reflected_integral_attr):
1568         (webkit_dom_test_obj_set_reflected_integral_attr):
1569         (webkit_dom_test_obj_get_reflected_unsigned_integral_attr):
1570         (webkit_dom_test_obj_set_reflected_unsigned_integral_attr):
1571         (webkit_dom_test_obj_get_reflected_boolean_attr):
1572         (webkit_dom_test_obj_set_reflected_boolean_attr):
1573         (webkit_dom_test_obj_get_reflected_url_attr):
1574         (webkit_dom_test_obj_set_reflected_url_attr):
1575         (webkit_dom_test_obj_get_reflected_custom_integral_attr):
1576         (webkit_dom_test_obj_set_reflected_custom_integral_attr):
1577         (webkit_dom_test_obj_get_reflected_custom_boolean_attr):
1578         (webkit_dom_test_obj_set_reflected_custom_boolean_attr):
1579         (webkit_dom_test_obj_get_reflected_custom_url_attr):
1580         (webkit_dom_test_obj_set_reflected_custom_url_attr):
1581         (webkit_dom_test_obj_get_attr_with_getter_exception):
1582         (webkit_dom_test_obj_set_attr_with_getter_exception):
1583         (webkit_dom_test_obj_get_attr_with_setter_exception):
1584         (webkit_dom_test_obj_set_attr_with_setter_exception):
1585         (webkit_dom_test_obj_get_string_attr_with_getter_exception):
1586         (webkit_dom_test_obj_set_string_attr_with_getter_exception):
1587         (webkit_dom_test_obj_get_string_attr_with_setter_exception):
1588         (webkit_dom_test_obj_set_string_attr_with_setter_exception):
1589         (webkit_dom_test_obj_get_with_script_state_attribute):
1590         (webkit_dom_test_obj_set_with_script_state_attribute):
1591         (webkit_dom_test_obj_get_with_script_execution_context_attribute):
1592         (webkit_dom_test_obj_set_with_script_execution_context_attribute):
1593         (webkit_dom_test_obj_get_with_script_state_attribute_raises):
1594         (webkit_dom_test_obj_set_with_script_state_attribute_raises):
1595         (webkit_dom_test_obj_get_with_script_execution_context_attribute_raises):
1596         (webkit_dom_test_obj_set_with_script_execution_context_attribute_raises):
1597         (webkit_dom_test_obj_get_with_script_execution_context_and_script_state_attribute):
1598         (webkit_dom_test_obj_set_with_script_execution_context_and_script_state_attribute):
1599         (webkit_dom_test_obj_get_with_script_execution_context_and_script_state_attribute_raises):
1600         (webkit_dom_test_obj_set_with_script_execution_context_and_script_state_attribute_raises):
1601         (webkit_dom_test_obj_get_with_script_execution_context_and_script_state_with_spaces_attribute):
1602         (webkit_dom_test_obj_set_with_script_execution_context_and_script_state_with_spaces_attribute):
1603         (webkit_dom_test_obj_get_conditional_attr1):
1604         (webkit_dom_test_obj_set_conditional_attr1):
1605         (webkit_dom_test_obj_get_conditional_attr2):
1606         (webkit_dom_test_obj_set_conditional_attr2):
1607         (webkit_dom_test_obj_get_conditional_attr3):
1608         (webkit_dom_test_obj_set_conditional_attr3):
1609         (webkit_dom_test_obj_get_content_document):
1610         (webkit_dom_test_obj_get_mutable_point):
1611         (webkit_dom_test_obj_set_mutable_point):
1612         (webkit_dom_test_obj_get_immutable_point):
1613         (webkit_dom_test_obj_set_immutable_point):
1614         (webkit_dom_test_obj_get_strict_float):
1615         (webkit_dom_test_obj_set_strict_float):
1616         (webkit_dom_test_obj_get_description):
1617         (webkit_dom_test_obj_get_id):
1618         (webkit_dom_test_obj_set_id):
1619         (webkit_dom_test_obj_get_hash):
1620         * bindings/scripts/test/GObject/WebKitDOMTestObjPrivate.h:
1621         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1622         (WebKit):
1623         (WebKit::kit):
1624         (WebKit::core):
1625         (WebKit::wrapTestSerializedScriptValueInterface):
1626         (webkit_dom_test_serialized_script_value_interface_finalize):
1627         (webkit_dom_test_serialized_script_value_interface_accept_transfer_list):
1628         (webkit_dom_test_serialized_script_value_interface_multi_transfer_list):
1629         (webkit_dom_test_serialized_script_value_interface_get_value):
1630         (webkit_dom_test_serialized_script_value_interface_set_value):
1631         (webkit_dom_test_serialized_script_value_interface_get_readonly_value):
1632         (webkit_dom_test_serialized_script_value_interface_get_cached_value):
1633         (webkit_dom_test_serialized_script_value_interface_set_cached_value):
1634         (webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value):
1635         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterfacePrivate.h:
1636
1637 2012-03-23  Dana Jansens  <danakj@chromium.org>
1638
1639         [chromium] Record painted pixel counts for measuring effectiveness of per-tile painting
1640         https://bugs.webkit.org/show_bug.cgi?id=82057
1641
1642         Reviewed by Adrienne Walker.
1643
1644         Adds painted pixel metrics to CCOverdrawMetrics class, and calls in
1645         to report painted areas when updating tiles in the TiledLayerChromium
1646         class.
1647
1648         Unit test: TiledLayerChromiumTest.opaqueContentsRegion
1649                    TiledLayerChromiumTest.pixelsPaintedMetrics
1650
1651         * platform/graphics/chromium/TiledLayerChromium.cpp:
1652         (WebCore::TiledLayerChromium::prepareToUpdateTiles):
1653         * platform/graphics/chromium/cc/CCOverdrawMetrics.cpp:
1654         (WebCore::CCOverdrawMetrics::CCOverdrawMetrics):
1655         (WebCore::CCOverdrawMetrics::didPaint):
1656         (WebCore):
1657         (WebCore::CCOverdrawMetrics::recordMetricsInternal):
1658         * platform/graphics/chromium/cc/CCOverdrawMetrics.h:
1659         (CCOverdrawMetrics):
1660         (WebCore::CCOverdrawMetrics::pixelsPainted):
1661
1662 2012-03-23  Abhishek Arya  <inferno@chromium.org>
1663
1664         Crash in RenderBlock::splitBlocks.
1665         https://bugs.webkit.org/show_bug.cgi?id=81926
1666
1667         Reviewed by Julien Chaffraix.
1668
1669         We are updating the :after content before calling splitFlow. The :after content
1670         gets blown away since it will go to the continuation. beforeChild was earlier
1671         set to the first child. Being the last anonymous block, its children gets pulled
1672         up in collapseAnonymousBoxChild and it gets destroyed. So, we need to update
1673         beforeChild value. 
1674
1675         Test: fast/multicol/span/update-after-content-before-child-crash.html
1676
1677         * rendering/RenderBlock.cpp:
1678         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
1679
1680 2012-03-23  Dana Jansens  <danakj@chromium.org>
1681
1682         [chromium] Improved composited debug borders
1683         https://bugs.webkit.org/show_bug.cgi?id=82071
1684
1685         Reviewed by Adrienne Walker.
1686
1687         Fix the problem with missing debug borders. Since we append quads
1688         to the list front to back now, we draw the quads in the list from
1689         back to front of the list. Which means if the debug quad is added
1690         after the layer it is drawing around, the layer can draw over top
1691         of its debug quad. Reverse the ordering when appending to fix it.
1692
1693         Make the border red around tiles that are checkerboarded. Missing
1694         tiles in non-root layers are drawn clear, so this makes them more
1695         visible.
1696
1697         Put a blue border around each render surface, and a purple border
1698         on their replicas.
1699
1700         No new tests.
1701
1702         * platform/graphics/chromium/cc/CCRenderPass.cpp:
1703         (WebCore):
1704         (WebCore::CCRenderPass::appendQuadsForLayer):
1705         (WebCore::CCRenderPass::appendQuadsForRenderSurfaceLayer):
1706         * platform/graphics/chromium/cc/CCRenderSurface.cpp:
1707         (WebCore::CCRenderSurface::hasReplica):
1708         (WebCore):
1709         (WebCore::CCRenderSurface::createReplicaSharedQuadState):
1710         * platform/graphics/chromium/cc/CCRenderSurface.h:
1711         (CCRenderSurface):
1712         * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
1713         (WebCore):
1714         (WebCore::CCTiledLayerImpl::appendQuads):
1715
1716 2012-03-23  Simon Fraser  <simon.fraser@apple.com>
1717
1718         Move code that calls setAcceleratesDrawing() on GraphicsLayers into RenderLayerBacking
1719         https://bugs.webkit.org/show_bug.cgi?id=82092
1720
1721         Reviewed by Dean Jackson.
1722
1723         A RenderLayerBacking manages several GraphicsLayers, but RenderLayerCompositor
1724         was only calling setAcceleratesDrawing() on the one it knows about. Fix by moving
1725         this setting code down into RenderLayerBacking.
1726         
1727         RenderLayerCompositor now caches the setAcceleratesDrawing setting, as it does
1728         for other compositing-related settings, so that RenderLayerBacking doesn't have
1729         to grovel for Settings every time.
1730
1731         * rendering/RenderLayerBacking.cpp:
1732         (WebCore::RenderLayerBacking::createGraphicsLayer):
1733         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
1734         * rendering/RenderLayerCompositor.cpp:
1735         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1736         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
1737         (WebCore::RenderLayerCompositor::updateBacking):
1738         * rendering/RenderLayerCompositor.h:
1739         (WebCore::RenderLayerCompositor::acceleratedDrawingEnabled):
1740         (RenderLayerCompositor):
1741
1742 2012-03-23  Beth Dakin  <bdakin@apple.com>
1743
1744         https://bugs.webkit.org/show_bug.cgi?id=82083
1745
1746         Rubber-stamped by Simon Fraser.
1747
1748         This patch is just a name change. getExistingScrollAnimator() (which was 
1749         added earlier today) is now existingScrollAnimator().
1750         * loader/FrameLoader.cpp:
1751         (WebCore::FrameLoader::transitionToCommitted):
1752         * page/EventHandler.cpp:
1753         (WebCore::EventHandler::handleGestureTapDown):
1754         * page/FrameView.cpp:
1755         (WebCore::FrameView::setAnimatorsAreActive):
1756         * platform/ScrollView.cpp:
1757         (WebCore::ScrollView::updateScrollbars):
1758         * platform/ScrollableArea.cpp:
1759         (WebCore::ScrollableArea::willStartLiveResize):
1760         (WebCore::ScrollableArea::willEndLiveResize):
1761         (WebCore::ScrollableArea::contentAreaWillPaint):
1762         (WebCore::ScrollableArea::mouseEnteredContentArea):
1763         (WebCore::ScrollableArea::mouseExitedContentArea):
1764         (WebCore::ScrollableArea::mouseMovedInContentArea):
1765         (WebCore::ScrollableArea::contentAreaDidShow):
1766         (WebCore::ScrollableArea::contentAreaDidHide):
1767         (WebCore::ScrollableArea::contentsResized):
1768         (WebCore::ScrollableArea::serviceScrollAnimations):
1769         * platform/ScrollableArea.h:
1770         (WebCore::ScrollableArea::existingScrollAnimator):
1771
1772 2012-03-23  Abhishek Arya  <inferno@chromium.org>
1773
1774         Crash due to accessing removed parent lineboxes when clearing selection.
1775         https://bugs.webkit.org/show_bug.cgi?id=81359
1776
1777         Reviewed by Eric Seidel.
1778
1779         Similar to r110323, adds the canUpdateSelectionOnRootLineBoxes
1780         check to more places.
1781
1782         Test: editing/selection/clear-selection-crash.html
1783
1784         * rendering/RenderObject.cpp:
1785         (WebCore::RenderObject::canUpdateSelectionOnRootLineBoxes):
1786         * rendering/RenderSelectionInfo.h:
1787         (WebCore::RenderSelectionInfo::RenderSelectionInfo):
1788         (WebCore::RenderBlockSelectionInfo::RenderBlockSelectionInfo):
1789
1790 2012-03-23  Beth Dakin  <bdakin@apple.com>
1791
1792         https://bugs.webkit.org/show_bug.cgi?id=82083
1793         Too many ScrollAnimators are allocated on pages with frames
1794
1795         Reviewed by Geoffrey Garen.
1796
1797         This patch adds a new getter to ScrollableArea called 
1798         getExistingScrollAnimator() unlike scrollAnimator() this new function will 
1799         just return null if there is not already a ScrollAnimator. Callers should use 
1800         this new function when they have business with ScrollAnimator that does not 
1801         need to do anything when there are no scrollbars.
1802         * loader/FrameLoader.cpp:
1803         (WebCore::FrameLoader::transitionToCommitted):
1804         * page/EventHandler.cpp:
1805         (WebCore::EventHandler::handleGestureTapDown):
1806         * page/FrameView.cpp:
1807         (WebCore::FrameView::setAnimatorsAreActive):
1808         * platform/ScrollView.cpp:
1809         (WebCore::ScrollView::updateScrollbars):
1810         * platform/ScrollableArea.cpp:
1811         (WebCore::ScrollableArea::willStartLiveResize):
1812         (WebCore::ScrollableArea::willEndLiveResize):
1813         (WebCore::ScrollableArea::contentAreaWillPaint):
1814         (WebCore::ScrollableArea::mouseEnteredContentArea):
1815         (WebCore::ScrollableArea::mouseExitedContentArea):
1816         (WebCore::ScrollableArea::mouseMovedInContentArea):
1817         (WebCore::ScrollableArea::contentAreaDidShow):
1818         (WebCore::ScrollableArea::contentAreaDidHide):
1819         (WebCore::ScrollableArea::willRemoveHorizontalScrollbar):
1820         (WebCore::ScrollableArea::contentsResized):
1821         (WebCore::ScrollableArea::serviceScrollAnimations):
1822         * platform/ScrollableArea.h:
1823         (ScrollableArea):
1824         (WebCore::ScrollableArea::getExistingScrollAnimator):
1825
1826 2012-03-23  Eric Carlson  <eric.carlson@apple.com>
1827
1828         Deal with DOM modifications when evaluating source elements.
1829         https://bugs.webkit.org/show_bug.cgi?id=81163
1830
1831         Reviewed by Alexey Proskuryakov.
1832
1833         Test: media/video-beforeload-remove-source.html
1834
1835         * dom/ContainerNode.cpp: Make NodeVector and collectNodes public, renamed as getChildNodes.
1836         (WebCore::ContainerNode::takeAllChildrenFrom): collectNodes -> getChildNodes.
1837         (WebCore::ContainerNode::willRemove): collectNodes -> getChildNodes.
1838         (WebCore::ContainerNode::willRemoveChildren): collectNodes -> getChildNodes.
1839         (WebCore::ContainerNode::insertedIntoDocument): collectNodes -> getChildNodes.
1840         (WebCore::ContainerNode::removedFromDocument): collectNodes -> getChildNodes.
1841         * dom/ContainerNode.h:
1842         (WebCore::getChildNodes):
1843
1844         * editing/ReplaceSelectionCommand.cpp: Remove unused NodeVector declaration.
1845
1846         * html/HTMLMediaElement.cpp:
1847         (WebCore::HTMLMediaElement::HTMLMediaElement): m_nextChildNodeToConsider and m_currentSourceNode
1848             are now RefPtrs.
1849         (WebCore::HTMLMediaElement::loadTimerFired): Protect HTMLMediaElement from being deleted during
1850             a DOM modification during an event callback.
1851         (WebCore::HTMLMediaElement::load): Ditto.
1852         (WebCore::HTMLMediaElement::selectMediaResource): Set m_nextChildNodeToConsider to the first
1853             child node, it will be the first node considered.
1854         (WebCore::HTMLMediaElement::havePotentialSourceChild): m_nextChildNodeToConsider and m_currentSourceNode
1855             are now RefPtrs.
1856         (WebCore::HTMLMediaElement::selectNextSourceChild): Collect all child nodes in a vector before
1857             looking for <source> nodes because 'beforeload' event handlers can mutate the DOM. Don't
1858             use a <source> that is no longer a child node after 'beforeload'. Use 0 to represent the end
1859             of the child node list because m_nextChildNodeToConsider is now a RefPtr so using the previous 
1860             sentinel, "this", would cause a retain cycle.
1861         (WebCore::HTMLMediaElement::sourceWasAdded):  m_nextChildNodeToConsider and m_currentSourceNode
1862             are now RefPtrs.
1863         (WebCore::HTMLMediaElement::sourceWillBeRemoved): Ditto.
1864         (WebCore::HTMLMediaElement::getPluginProxyParams): Protect HTMLMediaElement from being deleted during
1865             a DOM modification during an event callback.
1866         * html/HTMLMediaElement.h:
1867
1868 2012-03-23  Dean Jackson  <dino@apple.com>
1869
1870         Disable CSS_SHADERS in Apple builds
1871         https://bugs.webkit.org/show_bug.cgi?id=81996
1872
1873         Reviewed by Simon Fraser.
1874
1875         Remove ENABLE_CSS_SHADERS from FeatureDefines. It's now in Platform.h.
1876
1877         * Configurations/FeatureDefines.xcconfig:
1878
1879 2012-03-23  Dave Michael  <dmichael@chromium.org>
1880
1881         Relanding(r111754): HTMLPluginElement is not destroyed on reload or navigation if getNPObject is called
1882         https://bugs.webkit.org/show_bug.cgi?id=80428
1883
1884         Reviewed by Eric Seidel and Ryosuke Niwa.
1885
1886         Make HTMLPluginElement release its m_NPObject in detach() to break a
1887         reference-counting cycle that happens on reload or navigation. With this
1888         change, HTMLPlugInElement::removedFromDocument is unnecessary, so it
1889         was removed. Note that Releasing m_NPObject does not result in a call to
1890         the plugin; it simply releases a reference count on the wrapper object
1891         for this HTMLPlugInElement. (The plugin's NPP_Deallocate is invoked
1892         when the render tree is destroyed, when PluginView calls
1893         PluginPackage::unload.) Thus, it is safe to release m_NPObject in
1894         detach, because it can not result in layout or style changes.
1895
1896         Also added numberOfLiveNodes() and numberOfLiveDocuments() to
1897         window.internals to enable testing.
1898
1899         Test: plugins/netscape-dom-access-and-reload.html
1900
1901         * WebCore.exp.in:
1902         * html/HTMLPlugInElement.cpp:
1903         (WebCore::HTMLPlugInElement::detach):
1904         * html/HTMLPlugInElement.h:
1905         (HTMLPlugInElement):
1906         * testing/Internals.cpp:
1907         (WebCore):
1908         (WebCore::Internals::numberOfLiveNodes):
1909         (WebCore::Internals::numberOfLiveDocuments):
1910         * testing/Internals.h:
1911         (Internals):
1912         * testing/Internals.idl:
1913
1914 2012-03-23  Ryosuke Niwa  <rniwa@webkit.org>
1915
1916         CSSParser doesn't set border-*-width/style/color to initial by border shorthand property
1917         https://bugs.webkit.org/show_bug.cgi?id=82040
1918
1919         Reviewed by Antti Koivisto.
1920
1921         The border shorthand property sets values for border-width, border-style, and border-color shorthand properties.
1922         While CSSParser::parseValue can process these shorthand properties properly and set the longhand properties
1923         such as border-top-width, border-right-width, ... border-left-color, CSSParser::addProperty can't and the
1924         initialization in parseShorthand fails for the border property.
1925
1926         Fixed the bug by explicitly initializing longhand properties.
1927
1928         Changing the behavior here is unlikely to break the Web since our behavior already differs from that of Firefox
1929         and Internet Explorer. Both of those browsers return the actual initial values such as "medium" and "currentColor".
1930         This discrepancy is tracked by https://bugs.webkit.org/show_bug.cgi?id=82078.
1931
1932         Test: fast/css/border-shorthand-initialize-longhands.html
1933
1934         * css/CSSParser.cpp:
1935         (WebCore::CSSParser::parseValue): Uses borderAbridgedLonghand.
1936         (WebCore::CSSParser::parseShorthand): Uses longhand properties for initialization if one is available.
1937         This allows us to initialize multiple properties (e.g. border-*-color) for a single property missing in the set.
1938         * css/CSSPropertyLonghand.cpp:
1939         (WebCore::borderAbridgedLonghand): Added. The longhand here (border-width, border-style, border-color) is
1940         "abridged" in the sense that they're still shorthands.
1941         * css/CSSPropertyLonghand.h:
1942         (WebCore::CSSPropertyLonghand::CSSPropertyLonghand):
1943         (CSSPropertyLonghand): Added the version that takes longhand instances for initialization purposes.
1944         (WebCore::CSSPropertyLonghand::longhandsForInitialization):
1945
1946 2012-03-23  Tony Chang  <tony@chromium.org>
1947
1948         [chromium] rename newwtf target back to wtf
1949         https://bugs.webkit.org/show_bug.cgi?id=82064
1950
1951         Reviewed by Adam Barth.
1952
1953         No new tests, only renaming a build target.
1954
1955         * WebCore.gyp/WebCore.gyp:
1956
1957 2012-03-23  Adrienne Walker  <enne@google.com>
1958
1959         [chromium] Turn off painting of scrollbars on compositor thread for unsupported platforms
1960         https://bugs.webkit.org/show_bug.cgi?id=82066
1961
1962         Reviewed by James Robinson.
1963
1964         With threaded compositing, OSX will crash and Windows will have black
1965         scrollbars. Fix that by reverting to the previosu behavior of updating
1966         scrollbars on the main thread instead.
1967
1968         * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
1969         (WebCore::scrollbarLayerDidChange):
1970
1971 2012-03-23  Dan Bernstein  <mitz@apple.com>
1972
1973         <rdar://problem/7883987> ASSERTION FAILED: ASSERT(input == AnimationStateInputEndTimerFired || input == AnimationStateInputPlayStatePaused) in AnimationBase::updateStateMachine causing multiple "crashes" on Lion Intel Debug WebKit testers
1974         https://bugs.webkit.org/show_bug.cgi?id=81351
1975
1976         Rubber-stamped by Jessie Berlin.
1977
1978         * page/animation/AnimationBase.cpp:
1979         (WebCore::AnimationBase::updateStateMachine): Replaced the assertion with a LOG_ERROR so that
1980         the issue is still noticeable, but it does not automatically make the debug bots red.
1981
1982 2012-03-23  Mike Lawther  <mikelawther@chromium.org>
1983
1984         CSS3 calc: image sizing works with mixed percentage/absolute
1985         https://bugs.webkit.org/show_bug.cgi?id=82017
1986
1987         Reviewed by Ojan Vafai.
1988
1989         Test: css3/calc/img-size-expected.html
1990
1991         * rendering/RenderBox.cpp:
1992         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
1993         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
1994
1995 2012-03-23  Julien Chaffraix  <jchaffraix@webkit.org>
1996
1997         REGRESSION(107971): Google Voice contact list is broken in WebKit due to badly allocating the extra height
1998         https://bugs.webkit.org/show_bug.cgi?id=81826
1999
2000         Reviewed by Tony Chang.
2001
2002         Covered by tables/mozilla/bugs/bug27038-{1|2}.html.
2003
2004         This partly reverts r107971: the extra logical height distribution change was not needed
2005         to fix the bug (it is needed by the test though). We revert to giving all the extra height
2006         to the first tbody and not the first section.
2007
2008         This is broken but unfortunately some websites are relying on that. Getting a real
2009         distribution algorithm is covered by bug 81824. However this is super tricky to get
2010         right and I did not want to add more compatibility risks until I have something solid.
2011
2012         * rendering/RenderTable.cpp:
2013         (WebCore::RenderTable::distributeExtraLogicalHeight):
2014
2015 2012-03-23  Xingnan Wang  <xingnan.wang@intel.com>
2016
2017         Optimize for IPP in DirectConvolver::process()
2018         https://bugs.webkit.org/show_bug.cgi?id=80255
2019
2020         Reviewed by Chris Rogers.
2021
2022         Increase ~2X performance by conv() in IPP.
2023
2024         * platform/audio/DirectConvolver.cpp:
2025         (WebCore::DirectConvolver::DirectConvolver):
2026         (WebCore::DirectConvolver::process):
2027         * platform/audio/DirectConvolver.h:
2028         (DirectConvolver):
2029
2030 2012-03-23  Tommy Widenflycht  <tommyw@google.com>
2031
2032         MediaStream API (JSEP): Introducing PeerConnection00 and IceCallback
2033         https://bugs.webkit.org/show_bug.cgi?id=81657
2034
2035         Reviewed by Adam Barth.
2036
2037         Last major WebCore patch for the JSEP PeerConnection, together with the associated
2038         IceCallback (they both depend on each other and IceCallback has very few lines of real code).
2039
2040         My next patch after this one will do a major overhaul of the existing layout tests
2041         and add a few new ones.
2042
2043         * GNUmakefile.list.am:
2044         * Modules/mediastream/DOMWindowMediaStream.idl:
2045         * Modules/mediastream/IceCallback.h: Added.
2046         (WebCore):
2047         (IceCallback):
2048         (WebCore::IceCallback::~IceCallback):
2049         * Modules/mediastream/IceCallback.idl: Added.
2050         * Modules/mediastream/PeerConnection00.cpp: Added.
2051         (WebCore):
2052         (WebCore::PeerConnection00::create):
2053         (WebCore::PeerConnection00::PeerConnection00):
2054         (WebCore::PeerConnection00::~PeerConnection00):
2055         (WebCore::PeerConnection00::hasLocalAudioTrack):
2056         (WebCore::PeerConnection00::hasLocalVideoTrack):
2057         (WebCore::PeerConnection00::parseMediaHints):
2058         (WebCore::PeerConnection00::createOffer):
2059         (WebCore::PeerConnection00::createAnswer):
2060         (WebCore::PeerConnection00::setLocalDescription):
2061         (WebCore::PeerConnection00::setRemoteDescription):
2062         (WebCore::PeerConnection00::localDescription):
2063         (WebCore::PeerConnection00::remoteDescription):
2064         (WebCore::PeerConnection00::startIce):
2065         (WebCore::PeerConnection00::processIceMessage):
2066         (WebCore::PeerConnection00::readyState):
2067         (WebCore::PeerConnection00::iceState):
2068         (WebCore::PeerConnection00::addStream):
2069         (WebCore::PeerConnection00::removeStream):
2070         (WebCore::PeerConnection00::localStreams):
2071         (WebCore::PeerConnection00::remoteStreams):
2072         (WebCore::PeerConnection00::close):
2073         (WebCore::PeerConnection00::didGenerateIceCandidate):
2074         (WebCore::PeerConnection00::didChangeReadyState):
2075         (WebCore::PeerConnection00::didChangeIceState):
2076         (WebCore::PeerConnection00::didAddRemoteStream):
2077         (WebCore::PeerConnection00::didRemoveRemoteStream):
2078         (WebCore::PeerConnection00::interfaceName):
2079         (WebCore::PeerConnection00::scriptExecutionContext):
2080         (WebCore::PeerConnection00::stop):
2081         (WebCore::PeerConnection00::eventTargetData):
2082         (WebCore::PeerConnection00::ensureEventTargetData):
2083         (WebCore::PeerConnection00::changeReadyState):
2084         (WebCore::PeerConnection00::changeIceState):
2085         * Modules/mediastream/PeerConnection00.h: Added.
2086         (WebCore):
2087         (PeerConnection00):
2088         (WebCore::PeerConnection00::refEventTarget):
2089         (WebCore::PeerConnection00::derefEventTarget):
2090         * Modules/mediastream/PeerConnection00.idl: Added.
2091         * WebCore.gypi:
2092         * bindings/generic/RuntimeEnabledFeatures.h:
2093         (WebCore::RuntimeEnabledFeatures::webkitPeerConnection00Enabled):
2094         * bindings/js/JSPeerConnection00Custom.cpp: Added.
2095         (WebCore):
2096         (WebCore::JSPeerConnection00Constructor::constructJSPeerConnection00):
2097         * dom/EventTargetFactory.in:
2098
2099 2012-03-23  Adrienne Walker  <enne@google.com>
2100
2101         [chromium] Fix scrollbarLayerLostContext flaky test crash on 10.6
2102         https://bugs.webkit.org/show_bug.cgi?id=82062
2103
2104         Reviewed by James Robinson.
2105
2106         * platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
2107         (CCScrollbarLayerImpl):
2108
2109 2012-03-23  Tommy Widenflycht  <tommyw@google.com>
2110
2111         [chromium] MediaStream API (JSEP): Extending WebMediaStreamCenter
2112         https://bugs.webkit.org/show_bug.cgi?id=81924
2113
2114         Reviewed by Adam Barth.
2115
2116         Nothing to test, just moving methods.
2117
2118         * platform/mediastream/MediaStreamCenter.cpp:
2119         (WebCore::MediaStreamCenter::constructSDP):
2120         (WebCore):
2121
2122 2012-03-23  Sami Kyostila  <skyostil@chromium.org>
2123
2124         Reuse buffer allocation if canvas size does not change
2125         https://bugs.webkit.org/show_bug.cgi?id=80871
2126
2127         Reviewed by Stephen White.
2128
2129         If the user changes the width or height attributes of a canvas element,
2130         the contents of the canvas should be cleared and the context state
2131         should be reset. This has become a common idiom to clear the canvas
2132         "efficiently" at the start of a frame.
2133
2134         Previously, this code path triggered a full reallocation of the image
2135         buffer backing the canvas, leading to reduced performance. This patch
2136         implements an optimization where we reuse the previous image buffer
2137         allocation if the size of the canvas did not change. Also, instead of
2138         clearing the canvas every time its dimensions are touched, we only clear
2139         if anything has been drawn into the canvas since it was previously
2140         cleared.
2141
2142         Note that for now this optimization only applies for 2D canvases,
2143         since it is not entirely clear how touching the dimensions of a WebGL
2144         canvas should work.
2145
2146         Test: fast/canvas/canvas-resize-after-paint-without-layout.html +
2147               existing layout tests for canvas resetting.
2148
2149         * html/HTMLCanvasElement.cpp:
2150         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2151         (WebCore::HTMLCanvasElement::reset):
2152         (WebCore::HTMLCanvasElement::createImageBuffer): Save the initial
2153         graphics context state so we can restore it without creating a new
2154         context.
2155         (WebCore::HTMLCanvasElement::clearImageBuffer):
2156         (WebCore):
2157         (WebCore::HTMLCanvasElement::clearCopiedImage):
2158         * html/HTMLCanvasElement.h:
2159         (HTMLCanvasElement):
2160         * html/canvas/CanvasRenderingContext2D.cpp:
2161         (WebCore::CanvasRenderingContext2D::reset): No need to notify the
2162         compositor when the context is reset, because clearing the image buffer
2163         does the same thing. We can also skip the notification if we did not
2164         have an image buffer at the time of the reset, because the reset will
2165         not have any visual impact in this case. Finally, if the canvas size
2166         did change, the notification is also unnecessary because of the call
2167         to RenderObject::repaint() from HTMLCanvasElement::reset().
2168
2169 2012-03-22  Martin Robinson  <mrobinson@igalia.com>
2170
2171         Fix some code generation warnings on GTK+.
2172
2173         Reviewed by Gustavo Noronha Silva.
2174
2175         No new tests. This just fixes warnings.
2176
2177         * GNUmakefile.am: Remove nonexistent directories from the list IDL directories.
2178
2179 2012-03-23  Sheriff Bot  <webkit.review.bot@gmail.com>
2180
2181         Unreviewed, rolling out r111751.
2182         http://trac.webkit.org/changeset/111751
2183         https://bugs.webkit.org/show_bug.cgi?id=82060
2184
2185         caused 15% page cycler regression for chromium-linux
2186         (Requested by eae on #webkit).
2187
2188         * css/CSSStyleSelector.cpp:
2189         (WebCore::CSSStyleSelector::collectMatchingRulesForList):
2190
2191 2012-03-23  Kentaro Hara  <haraken@chromium.org>
2192
2193         Support [ImplementedAs] for attributes
2194         https://bugs.webkit.org/show_bug.cgi?id=81605
2195
2196         Reviewed by Adam Barth.
2197
2198         [ImplementedAs] just supports methods. [ImplementedAs] should support
2199         attributes too.
2200
2201         Explained here: https://trac.webkit.org/wiki/WebKitIDL#ImplementedAs
2202
2203         Test: bindings/scripts/test/TestObj.idl
2204
2205         * bindings/scripts/CodeGenerator.pm: Modified to support [ImplementedAs] for attributes.
2206         (AttributeNameForGetterAndSetter):
2207
2208         * bindings/scripts/test/TestObj.idl: Added a test case.
2209
2210         * bindings/scripts/test/CPP/WebDOMTestObj.cpp: Updated run-bindings-tests results.
2211         (WebDOMTestObj::strawberry):
2212         (WebDOMTestObj::setStrawberry):
2213         * bindings/scripts/test/CPP/WebDOMTestObj.h:
2214         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2215         (webkit_dom_test_obj_get_strawberry):
2216         (webkit_dom_test_obj_set_strawberry):
2217         (webkit_dom_test_obj_get_property):
2218         (webkit_dom_test_obj_class_init):
2219         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2220         * bindings/scripts/test/JS/JSTestObj.cpp:
2221         (WebCore):
2222         (WebCore::jsTestObjStrawberry):
2223         (WebCore::setJSTestObjStrawberry):
2224         * bindings/scripts/test/JS/JSTestObj.h:
2225         (WebCore):
2226         * bindings/scripts/test/ObjC/DOMTestObj.h:
2227         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2228         (-[DOMTestObj strawberry]):
2229         (-[DOMTestObj setStrawberry:]):
2230         * bindings/scripts/test/V8/V8TestObj.cpp:
2231         (WebCore::TestObjInternal::strawberryAttrGetter):
2232         (TestObjInternal):
2233         (WebCore::TestObjInternal::strawberryAttrSetter):
2234         (WebCore):
2235
2236 2012-03-23  Tommy Widenflycht  <tommyw@google.com>
2237
2238         The JSC code generator doesn't generate correct code for Constructors
2239         https://bugs.webkit.org/show_bug.cgi?id=82046
2240
2241         Reviewed by Kentaro Hara.
2242
2243         The main bulk of generated code for constructors uses the name jsConstructor
2244         for the created object, and then calls GenerateParametersCheck which generates
2245         code that uses the name castedThis.
2246
2247         * bindings/scripts/CodeGeneratorJS.pm:
2248         (GenerateConstructorDefinition):
2249         * bindings/scripts/test/JS/JSTestInterface.cpp:
2250         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
2251         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2252         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
2253         * bindings/scripts/test/JS/JSTestObj.cpp:
2254         (WebCore::JSTestObjConstructor::finishCreation):
2255         (WebCore::JSTestObjConstructor::constructJSTestObj):
2256         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2257         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
2258         * bindings/scripts/test/TestObj.idl:
2259         * bindings/scripts/test/V8/V8TestObj.cpp:
2260         (WebCore::V8TestObj::constructorCallback):
2261
2262 2012-03-23  Tommy Widenflycht  <tommyw@google.com>
2263
2264         The JSC code generator can't handle boolean arguments for Callbacks
2265         https://bugs.webkit.org/show_bug.cgi?id=82045
2266
2267         Reviewed by Kentaro Hara.
2268
2269         CodeGeneratorJS.pm only handles DOMStrings and objects as arguments
2270         for a Callback, so I added support for boolean values as well.
2271
2272         * bindings/scripts/CodeGeneratorJS.pm:
2273         (GenerateCallbackImplementation):
2274         * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
2275         (WebDOMTestCallback::callbackWithBoolean):
2276         * bindings/scripts/test/CPP/WebDOMTestCallback.h:
2277         (WebDOMTestCallback):
2278         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
2279         (webkit_dom_test_callback_callback_with_boolean):
2280         * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
2281         * bindings/scripts/test/JS/JSTestCallback.cpp:
2282         (WebCore::JSTestCallback::callbackWithBoolean):
2283         (WebCore):
2284         * bindings/scripts/test/JS/JSTestCallback.h:
2285         (JSTestCallback):
2286         * bindings/scripts/test/ObjC/DOMTestCallback.h:
2287         * bindings/scripts/test/ObjC/DOMTestCallback.mm:
2288         (-[DOMTestCallback callbackWithBoolean:]):
2289         * bindings/scripts/test/TestCallback.idl:
2290         * bindings/scripts/test/V8/V8TestCallback.cpp:
2291         (WebCore::V8TestCallback::callbackWithBoolean):
2292         (WebCore):
2293         * bindings/scripts/test/V8/V8TestCallback.h:
2294         (V8TestCallback):
2295
2296 2012-03-23  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
2297
2298         Touch adjustment forgets some subtarget quads.
2299         https://bugs.webkit.org/show_bug.cgi?id=82044
2300
2301         Reviewed by Kenneth Rohde Christiansen.
2302
2303         Do not uncritically skip all nodes that are ancestors to other test results.
2304         Instead return the inner-most element if multiple nodes have the same distance.
2305
2306         Test: touchadjustment/block-testing.html
2307
2308         * page/TouchAdjustment.cpp:
2309         (WebCore::TouchAdjustment::compileSubtargetList):
2310         (WebCore::TouchAdjustment::findNodeWithLowestDistanceMetric):
2311
2312 2012-03-23  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
2313
2314         TouchAdjustment does not correct for frame position
2315         https://bugs.webkit.org/show_bug.cgi?id=82043
2316
2317         Reviewed by Kenneth Rohde Christiansen.
2318
2319         Convert geometry to window coordinates before calculating distance.
2320
2321         Test: touchadjustment/iframe.html
2322
2323         * page/TouchAdjustment.cpp:
2324         (WebCore::TouchAdjustment::distanceSquaredToTargetCenterLine):
2325
2326 2012-03-23  Vlad Voicu  <vladv@rosedu.org>
2327
2328         Fixed minor WebInspector display issue
2329         Clicking on disabled sections in Styles Sidebar Pane creates new elements.
2330         https://bugs.webkit.org/show_bug.cgi?id=81925
2331
2332         Reviewed by Timothy Hatcher
2333
2334         No new tests should be required.
2335
2336         * inspector/front-end/StylesSidebarPane.js:
2337         (WebInspector.StylePropertiesSection.prototype._handleEmptySpaceClick):
2338         (WebInspector.StylePropertyTreeElement.prototype):
2339
2340 2012-03-23  Kentaro Hara  <haraken@chromium.org>
2341
2342         Unreviewed, rebaselined run-bindings-tests results.
2343
2344         * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
2345         * bindings/scripts/test/CPP/WebDOMTestObj.h:
2346         * bindings/scripts/test/JS/JSTestObj.cpp:
2347         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
2348         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
2349         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
2350         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
2351         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
2352         * bindings/scripts/test/V8/V8TestObj.cpp:
2353         (WebCore::TestObjInternal::methodWithCallbackArgCallback):
2354         (WebCore::TestObjInternal::methodWithNonCallbackArgAndCallbackArgCallback):
2355         (WebCore::TestObjInternal::methodWithCallbackAndOptionalArgCallback):
2356         (WebCore::TestObjInternal::overloadedMethod5Callback):
2357         (WebCore::TestObjInternal::overloadedMethodCallback):
2358
2359 2012-03-23  Ryosuke Niwa  <rniwa@webkit.org>
2360
2361         cssText should use StringBuilder
2362         https://bugs.webkit.org/show_bug.cgi?id=82028
2363
2364         Reviewed by Hajime Morita.
2365
2366         Make StylePropertySet::asText more efficient by deploying StringBuilder;
2367         avoids heap churn by String::operator+ and String::operator+=.
2368
2369         * css/StylePropertySet.cpp:
2370         (WebCore::StylePropertySet::asText):
2371
2372 2012-03-23  Ryosuke Niwa  <rniwa@webkit.org>
2373
2374         REGRESSION(r111754): plugins/reloadplugins-and-pages.html fails on all platforms
2375         https://bugs.webkit.org/show_bug.cgi?id=82035
2376
2377         Rollout r111754 since it caused a test to fail and the test added by the patch
2378         is failing on Mac WebKit 2.
2379
2380         * WebCore.exp.in:
2381         * html/HTMLPlugInElement.cpp:
2382         (WebCore::HTMLPlugInElement::detach):
2383         (WebCore):
2384         (WebCore::HTMLPlugInElement::removedFromDocument):
2385         * html/HTMLPlugInElement.h:
2386         (HTMLPlugInElement):
2387         * testing/Internals.cpp:
2388         * testing/Internals.h:
2389         (Internals):
2390         * testing/Internals.idl:
2391
2392 2012-03-23  Adam Barth  <abarth@webkit.org>
2393
2394         Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl (Part 2)
2395         https://bugs.webkit.org/show_bug.cgi?id=82026
2396
2397         Reviewed by Kentaro Hara.
2398
2399         This patch removes DOMWindow::resetNotifications, which was unneeded
2400         special-case logic for clearing the notifications center.  The previous
2401         patch that tried to accomplish the same thing did not override
2402         willDetachPage, which is why it caused crashes.
2403
2404         There's actually a cleaner way to handle these cases, which will let us
2405         implement reconnectFrame, but that will need to wait for the next
2406         patch.
2407
2408         * notifications/DOMWindowNotifications.cpp:
2409         (WebCore::DOMWindowNotifications::DOMWindowNotifications):
2410         (WebCore::DOMWindowNotifications::from):
2411         (WebCore::DOMWindowNotifications::webkitNotifications):
2412         (WebCore):
2413         (WebCore::DOMWindowNotifications::disconnectFrame):
2414         (WebCore::DOMWindowNotifications::willDetachPage):
2415         (WebCore::DOMWindowNotifications::reset):
2416         * notifications/DOMWindowNotifications.h:
2417         (DOMWindowNotifications):
2418         * page/DOMWindow.cpp:
2419         (WebCore::DOMWindow::willDetachPage):
2420         (WebCore::DOMWindow::disconnectDOMWindowProperties):
2421         (WebCore::DOMWindow::clearDOMWindowProperties):
2422         * page/DOMWindow.h:
2423         (DOMWindow):
2424         * page/Frame.cpp:
2425         (WebCore::Frame::willDetachPage):
2426
2427 2012-03-22  Adam Barth  <abarth@webkit.org>
2428
2429         Move Notifications APIs from DOMWindow.idl to DOMWindowNotifications.idl (Part 1)
2430         https://bugs.webkit.org/show_bug.cgi?id=82015
2431
2432         Reviewed by Kentaro Hara.
2433
2434         This patch moves DOMWindow.webkitNotifications from DOMWindow.idl to
2435         DOMWindowNotificiations.idl in preparation for moving notificiations
2436         into Modules.
2437
2438         A future patch will remove DOMWindow::resetNotificaitions in favor of
2439         more general mechanisms.
2440
2441         * CMakeLists.txt:
2442         * DerivedSources.make:
2443         * DerivedSources.pri:
2444         * GNUmakefile.list.am:
2445         * Target.pri:
2446         * WebCore.gypi:
2447         * WebCore.vcproj/WebCore.vcproj:
2448         * WebCore.xcodeproj/project.pbxproj:
2449         * notifications/DOMWindowNotifications.cpp: Added.
2450         (WebCore):
2451         (WebCore::DOMWindowNotifications::DOMWindowNotifications):
2452         (WebCore::DOMWindowNotifications::~DOMWindowNotifications):
2453         (WebCore::DOMWindowNotifications::from):
2454         (WebCore::DOMWindowNotifications::webkitNotifications):
2455         (WebCore::DOMWindowNotifications::reset):
2456         (WebCore::DOMWindowNotifications::supplementName):
2457         * notifications/DOMWindowNotifications.h: Added.
2458         (WebCore):
2459         (DOMWindowNotifications):
2460         * notifications/DOMWindowNotifications.idl: Added.
2461         * page/DOMWindow.cpp:
2462         (WebCore::DOMWindow::~DOMWindow):
2463         (WebCore):
2464         (WebCore::DOMWindow::resetNotifications):
2465         * page/DOMWindow.h:
2466         (WebCore):
2467         (DOMWindow):
2468         * page/DOMWindow.idl:
2469
2470 2012-03-22  Li Yin  <li.yin@intel.com>
2471
2472         A client MUST close a connection if it detects a masked frame
2473         https://bugs.webkit.org/show_bug.cgi?id=81361
2474
2475         Reviewed by Kent Tamura.
2476
2477         A server must not mask any frames that it sends to the client.
2478         Change the test case, not mask the frames from server to client.
2479         
2480         Test: http/tests/websocket/tests/hybi/invalid-masked-frames-from-server.html
2481
2482         * Modules/websockets/WebSocketChannel.cpp:
2483         (WebCore::WebSocketChannel::processFrame):
2484
2485 2012-03-22  Li Yin  <li.yin@intel.com>
2486
2487         [WebSocket]The minimal number of bytes MUST be used to encode the length
2488         https://bugs.webkit.org/show_bug.cgi?id=81443
2489
2490         Reviewed by Kent Tamura.
2491
2492         From RFC 6455 http://tools.ietf.org/html/rfc6455#section-5.2
2493         the minimal number of bytes MUST be used to encode the length
2494         
2495         New test case : http/tests/websocket/tests/hybi/invalid-encode-length.html
2496
2497         * Modules/websockets/WebSocketChannel.cpp:
2498         (WebCore::WebSocketChannel::parseFrame):
2499
2500 2012-03-22  Adam Barth  <abarth@webkit.org>
2501
2502         Unreviewed.  Sort xcodeproj file.
2503
2504         * WebCore.xcodeproj/project.pbxproj:
2505
2506 2012-03-22  Mao Yujie  <yujie.mao@intel.com>
2507
2508         Implement strict testing criterion for callback function definition
2509         https://bugs.webkit.org/show_bug.cgi?id=80005
2510
2511         Reviewed by Adam Barth.
2512
2513         Callback function should be defined as the function type instead of
2514         the object type.
2515
2516         LayoutTest: fast/dom/MediaStream/argument-types.html
2517
2518         * bindings/scripts/CodeGeneratorJS.pm:
2519         (GenerateParametersCheckExpression):
2520         (GenerateParametersCheck):
2521         * bindings/scripts/CodeGeneratorV8.pm:
2522         (GenerateParametersCheckExpression):
2523         (GenerateParametersCheck):
2524
2525 2012-03-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2526
2527         Convert hasGrammarMarker to use Internals interface
2528         https://bugs.webkit.org/show_bug.cgi?id=82004
2529
2530         Reviewed by Ryosuke Niwa.
2531
2532         Remove hasGrammarMarker functions, because it is able to work in the
2533         cross-port way through the Internals interface.
2534
2535         No new tests, since we are improving here the infra-structure
2536         for testing a specific method.
2537
2538         * testing/Internals.cpp:
2539         (WebCore::Internals::hasGrammarMarker):
2540         (WebCore):
2541         * testing/Internals.h:
2542         (Internals):
2543         * testing/Internals.idl:
2544
2545 2012-03-22  Xingnan Wang  <xingnan.wang@intel.com>
2546
2547         Add exception for the setter of "fftSize" in RealtimeAnalyserNode
2548         https://bugs.webkit.org/show_bug.cgi?id=81748
2549
2550         Reviewed by Chris Rogers.
2551
2552         * Modules/webaudio/RealtimeAnalyser.cpp:
2553         (WebCore::RealtimeAnalyser::setFftSize):
2554         * Modules/webaudio/RealtimeAnalyser.h:
2555         (RealtimeAnalyser):
2556         * Modules/webaudio/RealtimeAnalyserNode.cpp:
2557         (WebCore::RealtimeAnalyserNode::setFftSize):
2558         (WebCore):
2559         * Modules/webaudio/RealtimeAnalyserNode.h:
2560         (RealtimeAnalyserNode):
2561         * Modules/webaudio/RealtimeAnalyserNode.idl:
2562
2563 2012-03-22  Leo Yang  <leo.yang@torchmobile.com.cn>
2564
2565         [BlackBerry] Add HistoryItemViewState for BlackBerry port
2566         https://bugs.webkit.org/show_bug.cgi?id=81867
2567
2568         Reviewed by Rob Buis.
2569
2570         HistoryItemViewState is the blackberry specific field of HistoryItem.
2571         It's used to maintain the porting specific view state.
2572
2573         No new test because the port can't be built yet.
2574
2575         * history/HistoryItem.h:
2576         (HistoryItem):
2577         (WebCore::HistoryItem::viewState):
2578
2579 2012-03-22  SravanKumar Sandela  <ssandela@innominds.com>
2580
2581         Fieldset unexpectedly stretches to minimum intrinsic width
2582         https://bugs.webkit.org/show_bug.cgi?id=79128
2583
2584         Reviewed by Julien Chaffraix.
2585
2586         Fieldset element width will now check if css width is specified explicitly
2587         before stretching to minimum intrinsic width. The reference
2588         can be taken from IE9, instead of FF(FF acknowledged the broken behavior). 
2589
2590         Tests: fast/forms/fieldset-width-nostretch-ifspecified-expected.html
2591                fast/forms/fieldset-width-nostretch-ifspecified.html
2592
2593         * rendering/RenderFieldset.cpp:
2594         (WebCore::RenderFieldset::stretchesToMinIntrinsicLogicalWidth):
2595         (WebCore):
2596         * rendering/RenderFieldset.h:
2597         (RenderFieldset):
2598
2599 2012-03-22  Shawn Singh  <shawnsingh@chromium.org>
2600
2601         [chromium] Target surface should be damaged for a new layers even when layer had no changes
2602         https://bugs.webkit.org/show_bug.cgi?id=81879
2603
2604         Reviewed by Adrienne Walker.
2605
2606         Unit test added to CCDamageTrackerTest.
2607
2608         * platform/graphics/chromium/cc/CCDamageTracker.cpp:
2609         (WebCore::CCDamageTracker::removeRectFromCurrentFrame): added a
2610         boolean arg to detect if the layer is new on this update.
2611
2612         (WebCore::CCDamageTracker::extendDamageForLayer): added logic that
2613         damages the target surface if the layer is new.
2614
2615         (WebCore::CCDamageTracker::extendDamageForRenderSurface): added
2616         logic that damages the target surface if the descendant surface is
2617         new; similar logic for the surface's replica if the replica is new.
2618
2619         * platform/graphics/chromium/cc/CCDamageTracker.h:
2620         (CCDamageTracker):
2621
2622 2012-03-22  Charles Wei  <charles.wei@torchmobile.com.cn>
2623
2624         [BlackBerry] Need to store the meta info of a page in the ViewState of the history
2625         https://bugs.webkit.org/show_bug.cgi?id=82000
2626
2627         Reviewed by Rob Buis.
2628
2629         Internally reviewed by George Staikos.
2630
2631         No new tests, BlackBerry porting doesn't build yet upstreaming.
2632
2633         * history/blackberry/HistoryItemViewState.h:
2634         (WebCore::HistoryItemViewState::HistoryItemViewState):
2635         (HistoryItemViewState):
2636
2637 2012-03-22  Adam Klein  <adamk@chromium.org>
2638
2639         [v8] wrapSlow methods should ref underlying object before creating wrapper
2640         https://bugs.webkit.org/show_bug.cgi?id=81919
2641
2642         Reviewed by Adam Barth.
2643
2644         Because instatiating the wrapper can trigger GC, it's important that
2645         wrapSlow() hold a reference to an object when creating a wrapper for
2646         that object. Once the V8 wrapper exists and is associated with the object,
2647         the reference can be handed off (via leakRef) to be handled by the normal
2648         binding code logic (where derefObject is called if the handle is GCed).
2649
2650         Binding tests have been updated to reflect this change.
2651
2652         Testing the change directly is hard. Any test landed today would only
2653         be a valid test until V8's logic about when to GC changes, at which point
2654         it would become dead weight. So I don't think it's worth landing a
2655         layout test along with this.
2656
2657         * bindings/scripts/CodeGeneratorV8.pm:
2658         (GenerateHeader): Make wrapSlow take a PassRefPtr for RefCounted objects.
2659         (GenerateToV8Converters): Get rid of the explicit call to ref() and
2660         instead call leakRef() when adding a RefCounted object to the DOM map.
2661         (GetPassRefPtrType): Helper to generate "PassRefPtr<T>", or "PassRefPtr<T<U> >" as appropriate.
2662         * bindings/scripts/test/V8/V8Float64Array.cpp:
2663         (WebCore::V8Float64Array::wrapSlow):
2664         * bindings/scripts/test/V8/V8Float64Array.h:
2665         (V8Float64Array):
2666         * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
2667         (WebCore::V8TestActiveDOMObject::wrapSlow):
2668         * bindings/scripts/test/V8/V8TestActiveDOMObject.h:
2669         (V8TestActiveDOMObject):
2670         * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
2671         (WebCore::V8TestCustomNamedGetter::wrapSlow):
2672         * bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
2673         (V8TestCustomNamedGetter):
2674         * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
2675         (WebCore::V8TestEventConstructor::wrapSlow):
2676         * bindings/scripts/test/V8/V8TestEventConstructor.h:
2677         (V8TestEventConstructor):
2678         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
2679         (WebCore::V8TestEventTarget::wrapSlow):
2680         * bindings/scripts/test/V8/V8TestEventTarget.h:
2681         (V8TestEventTarget):
2682         * bindings/scripts/test/V8/V8TestInterface.cpp:
2683         (WebCore::V8TestInterface::wrapSlow):
2684         * bindings/scripts/test/V8/V8TestInterface.h:
2685         (V8TestInterface):
2686         * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
2687         (WebCore::V8TestMediaQueryListListener::wrapSlow):
2688         * bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
2689         (V8TestMediaQueryListListener):
2690         * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
2691         (WebCore::V8TestNamedConstructor::wrapSlow):
2692         * bindings/scripts/test/V8/V8TestNamedConstructor.h:
2693         (V8TestNamedConstructor):
2694         * bindings/scripts/test/V8/V8TestObj.cpp:
2695         (WebCore::V8TestObj::wrapSlow):
2696         * bindings/scripts/test/V8/V8TestObj.h:
2697         (V8TestObj):
2698         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
2699         (WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
2700         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
2701         (V8TestSerializedScriptValueInterface):
2702
2703 2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
2704
2705         [BlackBerry] add interface clearCredentials() and clearNeverRememberSites()
2706         https://bugs.webkit.org/show_bug.cgi?id=81887
2707
2708         Reviewed by Rob Buis.
2709
2710         Fixed SQL issue when clearing table logins and table never_remember.
2711
2712         No new tests.
2713
2714         * platform/network/blackberry/CredentialBackingStore.cpp:
2715         (WebCore::CredentialBackingStore::clearLogins):
2716         (WebCore::CredentialBackingStore::clearNeverRemember):
2717
2718 2012-03-22  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
2719
2720         [BlackBerry] http authenticate dialog popup only once no matter authentication pass or fail
2721         https://bugs.webkit.org/show_bug.cgi?id=80135
2722
2723         Reviewed by Rob Buis.
2724
2725         Modified the interface function authenticationChallenge() in class
2726         PageClientBlackBerry, moved Credential from return value to the
2727         function's reference parameter, and returned a bool to indicate if
2728         user pressed Ok button or not.
2729         Removed the logic which checks m_currentWebChallenge not null,
2730         because we should challenge user again if the last provided credential
2731         is not valid; also added the logic that will popup challenge
2732         dialog again immediately if user press Ok buttton directly without
2733         inputting anything.
2734
2735         No new tests.
2736
2737         * platform/blackberry/PageClientBlackBerry.h:
2738         * platform/network/blackberry/NetworkJob.cpp:
2739         (WebCore::NetworkJob::handleAuthHeader):
2740         (WebCore::NetworkJob::sendRequestWithCredentials):
2741
2742 2012-03-22  Jason Liu  <jason.liu@torchmobile.com.cn>
2743
2744         [BlackBerry] Synchronize platform/network/blackberry
2745         https://bugs.webkit.org/show_bug.cgi?id=81874
2746
2747         We changed a lot in these files locally. But the changes are not upstreamed.
2748         It is not convenient to do the other upstreaming work based on these differences.
2749         So upstream these changes.
2750
2751         Reviewed by Rob Buis.
2752
2753         No new tests. Just synchronize codes.
2754
2755         * platform/network/blackberry/NetworkJob.cpp:
2756         (WebCore::NetworkJob::NetworkJob):
2757         (WebCore::NetworkJob::initialize):
2758         (WebCore::NetworkJob::handleNotifyHeaderReceived):
2759         (WebCore::NetworkJob::handleNotifyDataReceived):
2760         (WebCore::NetworkJob::sendResponseIfNeeded):
2761         (WebCore::NetworkJob::sendRequestWithCredentials):
2762         (WebCore::NetworkJob::handleAbout):
2763         * platform/network/blackberry/NetworkJob.h:
2764         (WebCore::NetworkJob::isError):
2765         (NetworkJob):
2766         * platform/network/blackberry/NetworkManager.cpp:
2767         (WebCore::NetworkManager::startJob):
2768         * platform/network/blackberry/ResourceRequest.h:
2769         (WebCore::ResourceRequest::ResourceRequest):
2770         * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
2771         (WebCore::platformTargetTypeForRequest):
2772
2773 2012-03-22  Tom Sepez  <tsepez@chromium.org>
2774
2775         XSS Auditor bypass via script tag src=data:, URLS.
2776         https://bugs.webkit.org/show_bug.cgi?id=81948
2777
2778         Reviewed by Adam Barth.
2779
2780         This change fixes an XSSAuditor bypass wherby a script with a data: URL src
2781         attribute could evade detection by using characters from the page to create
2782         a snippet for matching not found in the URL's reflected vector.  This change 
2783         terminates the snippet for matching earlier in these cases.
2784         
2785         Test: http/tests/security/xssAuditor/script-tag-with-source-data-url2.html
2786
2787         * html/parser/XSSAuditor.cpp:
2788         (WebCore::XSSAuditor::decodedSnippetForAttribute):
2789
2790 2012-03-22  Dana Jansens  <danakj@chromium.org>
2791
2792         [chromium] Incorrect assert on animating opacity for a surface
2793         https://bugs.webkit.org/show_bug.cgi?id=81994
2794
2795         Reviewed by Adrienne Walker.
2796
2797         Draw opacity and animation state match on the surface itself. A
2798         surface with animating opacity always has an owning layer without
2799         animation, as the surface does the animation for it.
2800
2801         * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
2802         (WebCore::CCLayerTreeHost::paintLayerContents):
2803
2804 2012-03-22  Dana Jansens  <danakj@chromium.org>
2805
2806         [chromium] Skip frames when checkerboarding an animation
2807         https://bugs.webkit.org/show_bug.cgi?id=81716
2808
2809         Reviewed by Adrienne Walker.
2810
2811         This will stop drawing frames when prepareToDraw fails, if the draw is
2812         not forced. The expected behaviour is outlined below by the unit tests.
2813
2814         When a draw fails, we:
2815         1. Set m_needsRedraw to try again next vsync
2816         2. Set m_needsCommit because we need more data from webkit to succeed
2817         3. Set m_drawIfPossibleFailed. This allows us to try draw again within
2818         the same vsync *if* a commit finishes during this time.
2819
2820         Unit test: CCSchedulerTest.RequestRedrawInsideFailedDraw
2821                    CCSchedulerTest.RequestCommitInsideFailedDraw
2822                    CCSchedulerTest.NoBeginFrameWhenDrawFails
2823                    CCSchedulerStateMachineTest.TestFailedDrawSetsNeedsCommitAndDoesNotDrawAgain
2824                    CCSchedulerStateMachineTest.TestSetNeedsRedrawDuringFailedDrawDoesNotRemoveNeedsRedraw
2825                    CCSchedulerStateMachineTest.TestCommitAfterFailedDrawAllowsDrawInSameFrame
2826                    CCSchedulerStateMachineTest.TestCommitAfterFailedAndSuccessfulDrawDoesNotAllowDrawInSameFrame
2827                    CCSchedulerStateMachineTest.TestFailedDrawIsRetriedNextVSync
2828
2829         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
2830         (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
2831         (WebCore::CCLayerTreeHostImpl::prepareToDraw):
2832         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
2833         (CCLayerTreeHostImpl):
2834         * platform/graphics/chromium/cc/CCScheduler.cpp:
2835         (WebCore::CCScheduler::processScheduledActions):
2836         * platform/graphics/chromium/cc/CCScheduler.h:
2837         (CCSchedulerClient):
2838         * platform/graphics/chromium/cc/CCSchedulerStateMachine.cpp:
2839         (WebCore::CCSchedulerStateMachine::CCSchedulerStateMachine):
2840         (WebCore::CCSchedulerStateMachine::nextAction):
2841         (WebCore::CCSchedulerStateMachine::updateState):
2842         (WebCore::CCSchedulerStateMachine::didDrawIfPossibleCompleted):
2843         (WebCore):
2844         * platform/graphics/chromium/cc/CCSchedulerStateMachine.h:
2845         (CCSchedulerStateMachine):
2846         * platform/graphics/chromium/cc/CCThreadProxy.cpp:
2847         (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
2848         (WebCore):
2849         (WebCore::CCThreadProxy::scheduledActionDrawAndSwapIfPossible):
2850         (WebCore::CCThreadProxy::scheduledActionDrawAndSwapForced):
2851         * platform/graphics/chromium/cc/CCThreadProxy.h:
2852         (CCThreadProxy):
2853
2854 2012-03-22  W. James MacLean  <wjmaclean@chromium.org>
2855
2856         [chromium] Force update of nonFastScrollableRegion if target CCLayerImpl has been freshly created.
2857         https://bugs.webkit.org/show_bug.cgi?id=81968
2858
2859         Reviewed by Adrienne Walker.
2860
2861         Added unit test to existing tests for TreeSynchronizer.
2862
2863         When creating a new CCLayerImpl during tree synchronization, make sure we transfer the nonFastScrollableRegion as
2864         the new CCLayerImpl will default to an empty region.
2865
2866         * platform/graphics/chromium/LayerChromium.h:
2867         (WebCore::LayerChromium::nonFastScrollableRegion):
2868         (WebCore::LayerChromium::setNonFastScrollableRegionChanged):
2869         * platform/graphics/chromium/TreeSynchronizer.cpp:
2870         (WebCore::TreeSynchronizer::reuseOrCreateCCLayerImpl):
2871
2872 2012-03-22  Raphael Kubo da Costa  <rakuco@FreeBSD.org>
2873
2874         [CMake] Unreviewed build fix after r111778.
2875
2876         * CMakeLists.txt: Replace ${JAVASCRIPTCORE_DIR}/wtf includes with
2877         ${WTF_DIR}/wtf ones.
2878
2879 2012-03-22  Tony Chang  <tony@chromium.org>
2880
2881         Unreviewed, fix chromium build after wtf move.
2882
2883         Only use newwtf, remove references to wtf.
2884
2885         * WebCore.gyp/WebCore.gyp:
2886
2887 2012-03-22  Benjamin Poulain  <bpoulain@apple.com>
2888
2889         Remove an obsolete comment regarding magic frames from Geolocation
2890         https://bugs.webkit.org/show_bug.cgi?id=81871
2891
2892         Reviewed by Alexey Proskuryakov.
2893
2894         Moving a frame into another document is no longer possible after r111361. The comment
2895         is now irrelevant.
2896
2897         * Modules/geolocation/Geolocation.cpp:
2898         (WebCore::Geolocation::stop):
2899
2900 2012-03-22  Csaba Osztrogon√°c  <ossy@webkit.org>
2901
2902         Actually move WTF files to their new home
2903         https://bugs.webkit.org/show_bug.cgi?id=81844
2904
2905         [Qt] Unreviewed buildfix after r111778.
2906
2907         * Target.pri:
2908
2909 2012-03-22  Kentaro Hara  <haraken@chromium.org>
2910
2911         run-bindings-tests output a lot of errors in TestSerializedScriptValueInterface.idl
2912         https://bugs.webkit.org/show_bug.cgi?id=81852
2913
2914         Reviewed by Adam Barth.
2915
2916         run-bindings-tests output a lot of errors in TestSerializedScriptValueInterface.idl:
2917
2918         Use of uninitialized value in string eq at WebCore/bindings/scripts/CodeGeneratorJS.pm line 2743.
2919         Use of uninitialized value $name in substitution (s///) at WebCore/bindings/scripts/CodeGenerator.pm line 119.
2920         Use of uninitialized value $type in string eq at WebCore/bindings/scripts/CodeGeneratorJS.pm line 2969.
2921         Use of uninitialized value $type in string eq at WebCore/bindings/scripts/CodeGeneratorJS.pm line 2972.
2922         Use of uninitialized value $type in hash element at WebCore/bindings/scripts/CodeGenerator.pm line 367.
2923         Use of uninitialized value $type in hash element at WebCore/bindings/scripts/CodeGenerator.pm line 368.
2924         ...
2925
2926         This is because [Constructor(...)] does not yet support [Optional] arguments.
2927         It just supports [Optional=DefaultIsUndefined] and [Optional=DefaultIsNullString] arguments:
2928         https://trac.webkit.org/wiki/WebKitIDL#Constructor
2929
2930         This patch replaces [Optional] with [Optional=DefaultIsUndefined]
2931         in TestSerializedScriptValueInterface.idl.
2932
2933         Test: bindings/scripts/test/TestSerializedScriptValueInterface.idl
2934
2935         * bindings/scripts/CodeGeneratorJS.pm:
2936         (GenerateConstructorDefinition):
2937         * bindings/scripts/CodeGeneratorV8.pm:
2938         (GenerateConstructorCallback):
2939         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2940         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface):
2941         * bindings/scripts/test/TestSerializedScriptValueInterface.idl:
2942         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
2943         (WebCore::V8TestSerializedScriptValueInterface::constructorCallback):
2944
2945 2012-03-22  Michal Mocny  <mmocny@google.com>
2946
2947         [chromium] LayerRendererChromium should use GpuMemoryAllocationChanged callback to explicitly manage framebuffer.
2948         https://bugs.webkit.org/show_bug.cgi?id=81823
2949
2950         Reviewed by Adrienne Walker.
2951
2952         New UnitTests: LayerRendererChromiumTest
2953
2954         * platform/graphics/chromium/LayerRendererChromium.cpp:
2955         (LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
2956         (WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::create):
2957         (WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::~LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
2958         (WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::onGpuMemoryAllocationChanged):
2959         (WebCore::LayerRendererGpuMemoryAllocationChangedCallbackAdapter::LayerRendererGpuMemoryAllocationChangedCallbackAdapter):
2960         (WebCore):
2961         (WebCore::LayerRendererChromium::LayerRendererChromium):
2962         (WebCore::LayerRendererChromium::initialize):
2963         (WebCore::LayerRendererChromium::~LayerRendererChromium):
2964         (WebCore::LayerRendererChromium::setVisible):
2965         (WebCore::LayerRendererChromium::swapBuffers):
2966         (WebCore::LayerRendererChromium::discardFramebuffer):
2967         (WebCore::LayerRendererChromium::ensureFramebuffer):
2968         * platform/graphics/chromium/LayerRendererChromium.h:
2969         (WebCore):
2970         (LayerRendererChromiumClient):
2971         (LayerRendererChromium):
2972         (WebCore::LayerRendererChromium::isFramebufferDiscarded):
2973         (ScopedEnsureFramebufferAllocation):
2974         (WebCore::ScopedEnsureFramebufferAllocation::ScopedEnsureFramebufferAllocation):
2975         (WebCore::ScopedEnsureFramebufferAllocation::~ScopedEnsureFramebufferAllocation):
2976         * platform/graphics/chromium/cc/CCLayerTreeHost.h:
2977         (WebCore::LayerRendererCapabilities::LayerRendererCapabilities):
2978         (LayerRendererCapabilities):
2979         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
2980         (WebCore::CCLayerTreeHostImpl::setVisible):
2981         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
2982         (CCLayerTreeHostImpl):
2983         * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
2984         (WebCore::CCSingleThreadProxy::compositeAndReadback):
2985         * platform/graphics/chromium/cc/CCThreadProxy.cpp:
2986         (WebCore::CCThreadProxy::compositeAndReadback):
2987
2988 2012-03-22  Adam Barth  <abarth@webkit.org>
2989
2990         ContainerNode::insertedIntoTree and removedFromTree use weak iteration patterns
2991         https://bugs.webkit.org/show_bug.cgi?id=80570
2992
2993         Reviewed by Ryosuke Niwa.
2994
2995         These functions use weak iteration patterns, but as far as I can tell,
2996         we never execute script below these functions.  This patch adds ASSERTs
2997         to help us avoid adding events in the future.
2998
2999         * dom/ContainerNode.cpp:
3000         (WebCore::ContainerNode::insertedIntoTree):
3001         (WebCore::ContainerNode::removedFromTree):
3002         * html/HTMLMediaElement.cpp:
3003         (WebCore::HTMLMediaElement::loadInternal):
3004             - There's a somewhat complex call chain from insertedIntoTree into
3005               HTMLMediaElement, and somewhat complex control flow below
3006               loadInternal that eventually leads to the BeforeLoad event being
3007               fired.  In studying this code, I don't see a way for the
3008               BeforeLoad event to be fired during insertedIntoTree, but I've
3009               added this assert here to make sure we don't call loadInternal
3010               when we're not supposed to dispatch events.  This ASSERT should
3011               help us catch these BeforeLoad errors more quickly.
3012
3013 2012-03-22  Raphael Kubo da Costa  <rakuco@FreeBSD.org>
3014
3015         Crash in fast/dom/navigator-detached-nocrash.html
3016         https://bugs.webkit.org/show_bug.cgi?id=81773
3017
3018         Reviewed by Adam Barth.
3019
3020         BatteryManager::create() blindly assumes the Navigator* it
3021         receives has a valid Frame, which is not always the case, as made
3022         evident by the crashing test.
3023
3024         Follow abarth's suggestion and just stop
3025         NavigatorBattery::webkitBattery() before it reaches the call to
3026         BatteryManager::create() if that's the case.
3027
3028         No new tests, covered by fast/dom/navigator-detached-nocrash.html.
3029
3030         * Modules/battery/NavigatorBattery.cpp:
3031         (WebCore::NavigatorBattery::webkitBattery):
3032
3033 2012-03-22  Emil A Eklund  <eae@chromium.org>
3034
3035         Unreviewed, add missing include statement for CSSValueList.h.
3036
3037         * css/CSSStyleSelector.h:
3038
3039 2012-03-22  Tony Chang  <tony@chromium.org>
3040
3041         flexbox flexing implementation should match the spec
3042         https://bugs.webkit.org/show_bug.cgi?id=70796
3043
3044         Reviewed by Ojan Vafai.
3045
3046         Match the algorithm in the spec. Handling min/max constraints are slightly improved.
3047         http://dev.w3.org/csswg/css3-flexbox/#resolve-the-flexible-lengths
3048
3049         New test cases in css3/flexbox/flex-algorithm-min-max.html.
3050
3051         * rendering/RenderFlexibleBox.cpp:
3052         (WebCore::adjustFlexSizeForMinAndMax): Step 5 of resolving flexible lengths.
3053         (WebCore):
3054         (WebCore::RenderFlexibleBox::Violation::Violation):
3055         (RenderFlexibleBox::Violation):
3056         (WebCore::RenderFlexibleBox::freezeViolations): Used by step 6.
3057         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
3058         * rendering/RenderFlexibleBox.h:
3059
3060 2012-03-22  Emil A Eklund  <eae@chromium.org>
3061
3062         Unreviewed, add missing import.
3063
3064         * rendering/RenderThemeMac.mm:
3065
3066 2012-03-22  Anders Carlsson  <andersca@apple.com>
3067
3068         ASSERT(!needsLayout) in RenderView.cpp when visiting http://www.panic.com/blog/
3069         https://bugs.webkit.org/show_bug.cgi?id=81953
3070         <rdar://problem/11086998>
3071
3072         Reviewed by Sam Weinig.
3073
3074         If a page ends up creating CATiledLayers, CA transactions can be committed outside of the normal
3075         CA run loop observer, so we can't call setNeedsDisplay on tile cache layers directly because then
3076         we'll end up calling into painting code before all the layers have been flushed.
3077
3078         Fix this by adding a list of dirty rects to platformCALayerDidCreateTiles and change GraphicsLayerCA to
3079         mark them as dirty. This ensures that any CA transaction commits won't cause newly added layers to be painted.
3080
3081         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3082         (WebCore::LayerClient::platformCALayerDidCreateTiles):
3083         * platform/graphics/ca/GraphicsLayerCA.cpp:
3084         (WebCore::GraphicsLayerCA::platformCALayerDidCreateTiles):
3085         * platform/graphics/ca/GraphicsLayerCA.h:
3086         (GraphicsLayerCA):
3087         * platform/graphics/ca/PlatformCALayerClient.h:
3088         (PlatformCALayerClient):
3089         * platform/graphics/ca/mac/TileCache.mm:
3090         (WebCore::TileCache::setScale):
3091         (WebCore::TileCache::revalidateTiles):
3092         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
3093         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDidCreateTiles):
3094
3095 2012-03-19  Robert Hogan  <robert@webkit.org>
3096
3097         Text should overflow when list item height set to 0
3098         https://bugs.webkit.org/show_bug.cgi?id=78726
3099
3100         Reviewed by Julien Chaffraix.
3101
3102         Tests: css2.1/20110323/height-applies-to-010a-expected.html
3103                fast/css/heightless-list-item-expected.html
3104                fast/css/heightless-list-item.html
3105
3106         * rendering/RenderListItem.cpp:
3107         (WebCore::RenderListItem::paint):
3108            If the list item has height:0, only paint it if the list item allows any block or inline content 
3109            to overflow unclipped. The zero-height check is a shortcut to avoid unnecessary painting and 
3110            this seems to be the only case where there's something to do.
3111
3112 2012-03-22  Dave Michael  <dmichael@chromium.org>
3113
3114         HTMLPluginElement is not destroyed on reload or navigation if getNPObject is called
3115         https://bugs.webkit.org/show_bug.cgi?id=80428
3116
3117         Reviewed by Eric Seidel.
3118
3119         Make HTMLPluginElement release its m_NPObject in detach() to break a
3120         reference-counting cycle that happens on reload or navigation. With this
3121         change, HTMLPlugInElement::removedFromDocument is unnecessary, so it
3122         was removed. Note that Releasing m_NPObject does not result in a call to
3123         the plugin; it simply releases a reference count on the wrapper object
3124         for this HTMLPlugInElement. (The plugin's NPP_Deallocate is invoked
3125         when the render tree is destroyed, when PluginView calls
3126         PluginPackage::unload.) Thus, it is safe to release m_NPObject in
3127         detach, because it can not result in layout or style changes.
3128
3129         Also added numberOfLiveNodes() and numberOfLiveDocuments() to
3130         window.internals to enable testing.
3131
3132         Test: plugins/netscape-dom-access-and-reload.html
3133
3134         * WebCore.exp.in:
3135         * html/HTMLPlugInElement.cpp:
3136         (WebCore::HTMLPlugInElement::detach):
3137         * html/HTMLPlugInElement.h:
3138         (HTMLPlugInElement):
3139         * testing/Internals.cpp:
3140         (WebCore::Internals::numberOfLiveDocuments):
3141         (WebCore::Internals::numberOfLiveNodes):
3142         (WebCore):
3143         * testing/Internals.h:
3144         (Internals):
3145         * testing/Internals.idl:
3146
3147 2012-03-22  Shawn Singh  <shawnsingh@chromium.org>
3148
3149         [chromium] Make CCDamageTracker robust to empty layer lists
3150         https://bugs.webkit.org/show_bug.cgi?id=81831
3151
3152         Reviewed by Adrienne Walker.
3153
3154         Added a unit test in CCDamageTrackerTest that causes a crash in
3155         the old code. With this patch applied, the crash will not occur.
3156         In theory, that crash should never occur anyway, unless there is a
3157         bug outside the damage tracker, but for robustness it's
3158         appropriate to handle it properly.
3159
3160         In addition to this fix, performed some trivial maintenance on the
3161         damage tracker code.
3162
3163         * platform/graphics/chromium/cc/CCDamageTracker.cpp:
3164         (WebCore::CCDamageTracker::updateDamageTrackingState): removed
3165         unclean code that accessed the targetSurface to get necessary
3166         information. Instead, we now pass those args through the damage
3167         tracker's API.
3168
3169         * platform/graphics/chromium/cc/CCDamageTracker.h:
3170         (CCDamageTracker): modified args passed to damage tracker on update.
3171
3172         * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
3173         (WebCore::CCLayerTreeHostImpl::trackDamageForAllSurfaces):
3174         modified args passed to damage tracker on update.
3175
3176 2012-03-22  Julien Chaffraix  <jchaffraix@webkit.org>
3177
3178         Enable style sharing for elements with a style attribute
3179         https://bugs.webkit.org/show_bug.cgi?id=81523
3180
3181         Reviewed by Antti Koivisto.
3182
3183         Memory improvement change only.
3184
3185         Overall, this is a performance wash (some benchmarks may regress a bit due to the increase in time taken
3186         by CSSStyleSelector::locateSharedStyle as we try more nodes, others increase their performance due to style sharing).
3187
3188         Instrumenting our style sharing, this should give us some nice memory shavings on some benchmarks:
3189         - HTML5 isn't impacted as it doesn't use much inline style
3190         - page cyclers' intl1 showed a 6% increase in style sharing.
3191
3192         * css/CSSStyleSelector.cpp:
3193         (WebCore::CSSStyleSelector::canShareStyleWithElement):
3194         This method now handles inline style like presentation attributes on the element.
3195
3196         (WebCore::CSSStyleSelector::collectMatchingRulesForList):
3197         (WebCore::CSSStyleSelector::locateSharedStyle):
3198         Don't bail out for an element with an inline style declaration.
3199
3200         (WebCore::CSSStyleSelector::stylesEqual):
3201         Generalized attributeStylesEqual to share the logic between attribute and
3202         inline style property set. This means that attribute checks are actually
3203         doing a little extra more work but that didn't impact our benchmarks.
3204
3205 2012-03-22  Kevin Ollivier  <kevino@theolliviers.com>
3206
3207         [wx] Unreviewed. WebDOM build fix after array type changes.
3208
3209         * bindings/scripts/CodeGeneratorCPP.pm:
3210         (ShouldSkipType):
3211
3212 2012-03-22  Pavel Feldman  <pfeldman@chromium.org>
3213
3214         Web Inspector: text gutter decorations should move upon edits.
3215         https://bugs.webkit.org/show_bug.cgi?id=81932
3216
3217         Reviewed by Vsevolod Vlasov.
3218
3219         Decorations set by the line number now shift as editing inserts / removes lines.
3220
3221         * inspector/front-end/TextViewer.js:
3222         (WebInspector.TextViewer.prototype._syncLineHeight):
3223         (WebInspector.TextEditorGutterPanel):
3224         (WebInspector.TextEditorGutterPanel.prototype.textChanged):
3225         (WebInspector.TextEditorGutterPanel.prototype.syncClientHeight):
3226         (WebInspector.TextEditorGutterPanel.prototype.addDecoration):
3227         (WebInspector.TextEditorGutterPanel.prototype.removeDecoration):
3228
3229 2012-03-21  Robert Hogan  <robert@webkit.org>
3230
3231         CSS 2.1 failure: fixed-table-layout-006 fails
3232         https://bugs.webkit.org/show_bug.cgi?id=78412
3233
3234         Reviewed by Julien Chaffraix.
3235
3236         Tests: css2.1/20110323/fixed-table-layout-006.htm
3237                fast/css/fixed-table-layout-cell-padding.htm
3238
3239         In fixed tables, positive width specified on a column should include borders and padding.
3240         See the thread at http://lists.w3.org/Archives/Public/www-style/2011Oct/0502.html. The discussion
3241         there resulted in a whole new set of tests for section 17.5.2.1 in the CSS 2.1 spec. See 
3242         http://test.csswg.org/harness/test/CSS21_DEV/section/17.5.2.1/. This patch allows WebKit
3243         to pass all of them, and all tests for the 17.5.2.1 section as a whole. I'll land them all separately.
3244     
3245         * rendering/FixedTableLayout.cpp:
3246         (WebCore::FixedTableLayout::calcWidthArray): Include border width and cell padding in the width of the column.
3247          Note that borderAndPaddingLogicalWidth() returns the border width for separate and collapsed borders as appropriate.
3248
3249 2012-03-22  Simon Fraser  <simon.fraser@apple.com>
3250
3251         Factor compositing layer updates after scroll into a new method
3252         https://bugs.webkit.org/show_bug.cgi?id=81943
3253
3254         Reviewed by Dean Jackson.
3255
3256         Move some code that updates compositing layers after scrolling
3257         into its own method, for cleanliness.
3258
3259         * rendering/RenderLayer.cpp:
3260         (WebCore::RenderLayer::scrollTo):
3261         (WebCore::RenderLayer::updateCompositingLayersAfterScroll):
3262         (WebCore):
3263         * rendering/RenderLayer.h:
3264         (RenderLayer):
3265
3266 2012-03-22  Gavin Barraclough  <barraclough@apple.com>
3267
3268         Add JSValue::isFunction
3269         https://bugs.webkit.org/show_bug.cgi?id=81935
3270
3271         Reviewed by Geoff Garen.
3272
3273         This would be useful in the WebCore bindings code.
3274         Also, remove asFunction, replace with jsCast<JSFunction*>.
3275
3276         * bindings/js/JSInjectedScriptHostCustom.cpp:
3277         (WebCore::JSInjectedScriptHost::functionDetails):
3278         * bindings/js/ScriptCallStackFactory.cpp:
3279         (WebCore::createScriptCallStack):
3280
3281 2012-03-22  Jocelyn Turcotte  <jocelyn.turcotte@nokia.com>
3282
3283         TiledBackingStore: Fix test regressions that appeared with r111560.
3284         https://bugs.webkit.org/show_bug.cgi?id=81519
3285
3286         Reviewed by Kenneth Rohde Christiansen.
3287
3288         The visible rect wasn't intersected with the contents rect anymore which
3289         could lead to an astronomical layer size to check for intersecting tiles.
3290
3291         Add a visibleContentsRect that doesn't do the conversion and use it
3292         in visibleAreaIsCovered.
3293
3294         * platform/graphics/TiledBackingStore.cpp:
3295         (WebCore::TiledBackingStore::visibleContentsRect):
3296         (WebCore):
3297         (WebCore::TiledBackingStore::visibleRect):
3298         (WebCore::TiledBackingStore::visibleAreaIsCovered):
3299         * platform/graphics/TiledBackingStore.h:
3300         (TiledBackingStore):
3301
3302 2012-03-22  Joe Thomas  <joethomas@motorola.com>
3303
3304         Make Length Calculation functions non-inline
3305         https://bugs.webkit.org/show_bug.cgi?id=81733
3306
3307         Currently length calculation functions in LengthFunctions.h are inline. These functions are pretty big to be inline.
3308         And these functions are expected to grow again when new length units will be introduced in bug 27160.
3309
3310         A decent rule of thumb is to not inline a function if it is more than 10 lines long. Also it's typically not cost effective to inline
3311         functions with loops or switch statements. (Reference: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Inline_Functions).
3312
3313         Ran PerformanceTests/Parser/html5-full-render.html on Mac Snow-Leopard with and without the patch and did not see much performance difference.
3314
3315         Reviewed by Antti Koivisto.
3316
3317         * CMakeLists.txt:
3318         * GNUmakefile.list.am:
3319         * Target.pri:
3320         * WebCore.gypi:
3321         * WebCore.vcproj/WebCore.vcproj:
3322         * WebCore.xcodeproj/project.pbxproj:
3323         * css/LengthFunctions.cpp: Added.
3324         (WebCore):
3325         (WebCore::miminumValueForLength):
3326         (WebCore::valueForLength):
3327         (WebCore::floatValueForLength):
3328         * css/LengthFunctions.h:
3329         (WebCore):
3330
3331 2012-03-22  Alexis Menard  <alexis.menard@openbossa.org>
3332
3333         Increase code sharing between CSSParser and CSSPropertyLonghand.
3334         https://bugs.webkit.org/show_bug.cgi?id=81587
3335
3336         Reviewed by Antti Koivisto.
3337
3338         Expose the longhands declaration for a given shorthand in CSSPropertyLonghand and
3339         make CSSParser use them. It will make the declaration of longhands in one place only.
3340         Remove the map of CSSPropertyLonghand and replace it by a regular switch/case.
3341         The map doesn't bring much here and it's cleaner and faster to use the switch.
3342         It also shows a little performance improvement in CSS/CSSPropertySetterGetter.html.
3343
3344         No new tests : no behavior change.
3345
3346         * css/CSSParser.cpp:
3347         (WebCore::CSSParser::parseValue):
3348         (WebCore::CSSParser::parseAnimationShorthand):
3349         (WebCore::CSSParser::parseTransitionShorthand):
3350         (WebCore::CSSParser::parseShorthand):
3351         Modify the prototype of this function to directly use the CSSPropertyLonghand.
3352         * css/CSSParser.h:
3353         (WebCore):
3354         (CSSParser):
3355         * css/CSSPropertyLonghand.cpp:
3356         (WebCore):
3357         (WebCore::backgroundLonghand):
3358         (WebCore::backgroundPositionLonghand):
3359         (WebCore::backgroundRepeatLonghand):
3360         (WebCore::borderLonghand):
3361         (WebCore::borderBottomLonghand):
3362         (WebCore::borderColorLonghand):
3363         (WebCore::borderImageLonghand):
3364         (WebCore::borderLeftLonghand):
3365         (WebCore::borderRadiusLonghand):
3366         (WebCore::borderRightLonghand):
3367         (WebCore::borderSpacingLonghand):
3368         (WebCore::borderStyleLonghand):
3369         (WebCore::borderTopLonghand):
3370         (WebCore::borderWidthLonghand):
3371         (WebCore::listStyleLonghand):
3372         (WebCore::fontLonghand):
3373         (WebCore::marginLonghand):
3374         (WebCore::outlineLonghand):
3375         (WebCore::overflowLonghand):
3376         (WebCore::paddingLonghand):
3377         (WebCore::webkitAnimationLonghand):
3378         (WebCore::webkitBorderAfterLonghand):
3379         (WebCore::webkitBorderBeforeLonghand):
3380         (WebCore::webkitBorderEndLonghand):
3381         (WebCore::webkitBorderStartLonghand):
3382         (WebCore::webkitColumnsLonghand):
3383         (WebCore::webkitColumnRuleLonghand):
3384         (WebCore::webkitFlexFlowLonghand):
3385         (WebCore::webkitMarginCollapseLonghand):
3386         (WebCore::webkitMarqueeLonghand):
3387         (WebCore::webkitMaskLonghand):
3388         (WebCore::webkitMaskPositionLonghand):
3389         (WebCore::webkitMaskRepeatLonghand):
3390         (WebCore::webkitTextEmphasisLonghand):
3391         (WebCore::webkitTextStrokeLonghand):
3392         (WebCore::webkitTransitionLonghand):
3393         (WebCore::webkitTransformOriginLonghand):
3394         (WebCore::webkitWrapLonghand):
3395         (WebCore::longhandForProperty):
3396         * css/CSSPropertyLonghand.h:
3397         (WebCore):
3398
3399 2012-03-22  Emil A Eklund  <eae@chromium.org>
3400
3401         Unreviewed, touching file to force bots to pick up CSS_SHADERS flag change. 
3402
3403         * css/CSSStyleSelector.h:
3404         (CSSStyleSelector):
3405
3406 2012-03-22  Xingnan Wang  <xingnan.wang@intel.com>
3407
3408         ReverbConvolver::latencyFrames() should return 0.
3409         https://bugs.webkit.org/show_bug.cgi?id=81806
3410
3411         Reviewed by Chris Rogers.
3412
3413         * platform/audio/ReverbConvolver.cpp:
3414         (WebCore::ReverbConvolver::latencyFrames):
3415
3416 2012-03-22  Tony Chang  <tony@chromium.org>
3417
3418         refactor flexbox in preparation for flex-line-pack
3419         https://bugs.webkit.org/show_bug.cgi?id=81843
3420
3421         Reviewed by Ojan Vafai.
3422
3423         Replace WrapReverseContext with a vector of LineContexts that contain
3424         the same information, plus values needed for flex-align.
3425
3426         alignChildren has been moved to after all the lines have been
3427         positioned. We want to align children after flex-line-pack has changed
3428         the size of each line to avoid unnecessary layouts.
3429
3430         Take 2: Remove the assert. If there are no children, then there are no
3431         flex lines. Instead, assert that child is not null.
3432
3433         No new tests, just refactoring.
3434
3435         * rendering/RenderFlexibleBox.cpp:
3436         (WebCore::RenderFlexibleBox::LineContext::LineContext): New struct,
3437         holds information needed for wrap-reverse and aligning children.
3438         (RenderFlexibleBox::LineContext):
3439         (WebCore::RenderFlexibleBox::layoutFlexItems): alignChildren after layout out all the lines rather than after each line.
3440         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): don't alignChildren
3441         (WebCore::RenderFlexibleBox::alignChildren): align all flex items, not just a line at a time.
3442         (WebCore::RenderFlexibleBox::flipForWrapReverse): Update to use LineContext
3443         * rendering/RenderFlexibleBox.h:
3444
3445 2012-03-22  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
3446
3447         Event dispatching in XMLHttpRequestProgressEventThrottle should go through XMLHttpRequestProgressEventThrottle::dispatchEvent
3448         https://bugs.webkit.org/show_bug.cgi?id=46743
3449
3450         Reviewed by Julien Chaffraix
3451         Based on original patch by Anton D'Auria
3452
3453         In preparation for platform-specific queuing of XMLHttpRequest events,
3454         this patch changes all calls to m_target->dispatchEvent to
3455         XMLHttpRequestProgressEventThrottle::dispatchEvent.
3456         Currently, we queue only one progress event on suspend() if we have
3457         throttled progress events. We should be able to queue all XHR events
3458         that can be generated after suspend(), if the platform network layer
3459         continues to receive data.
3460         XMLHttpRequest uses XMLHttpRequestProgressEventThrottle to dispatch only
3461         download events, so this doesn't change behavior of upload events, which
3462         aren't throttled or queued.
3463
3464         * xml/XMLHttpRequest.cpp:
3465         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
3466         * xml/XMLHttpRequestProgressEventThrottle.cpp:
3467         (WebCore::XMLHttpReque