Changing id, className, or attribute should invalidate distribution
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-11-19  Shinya Kawanaka  <shinyak@chromium.org>
2
3         Changing id, className, or attribute should invalidate distribution
4         https://bugs.webkit.org/show_bug.cgi?id=100738
5
6         Reviewed by Dimitri Glazkov.
7
8         When id, className, or attribute is changed, we might have to invalidate distribution.
9         However, we don't want to do useless invalidation. So we consult with the RuleFeatureSet of ElementShadow
10         to invalidate distribution only if necessary.
11
12         For the code that className is changed, we can share a lot of code between invalidating distribution and
13         invalidating style. So we made checkNeedsStyleInvalidationForClassChange a template method, and share it.
14
15         Since attributeChanged() is a hot method, we don't want to make it slow. So we made one function to determine
16         whether we have to invalidate distribution, and make it called only if necessary. Also, we've optimized
17         shadowOfParentForDistribution() by making isInsertionPoint() de-virtualed. We consuded NodeFlags (IsInsertionPointFlag)
18         for this purpose.
19
20         We've measured how this patch makes changing attribute slow. I've measured each code 3 times.
21         DOM/ModifyAttribute.html is a micro benchmark which changes attribute a lot of times. The result of this benchmark
22         will be the most affected by this patch. However, it's only 2% performance regression.
23
24         DOM/ModifyAttribute.html
25         Before this patch:
26                 median  stdev    min    max    [ms]
27           1st    494.0   3.36  490.0  502.0
28           2nd    503.5   3.44  497.0  512.0
29           3rd    494.0   3.48  488.0  499.0
30
31         After this patch:
32                 median  stdev  min      max    [ms]
33           1st    504.0   2.00  501.0  509.0
34           2nd    505.5   3.08  500.0  513.0
35           3rd    507.0   2.32  502.0  510.0
36
37         Tests: fast/dom/shadow/distribution-attribute-modified.html
38                fast/dom/shadow/distribution-className-modified.html
39                fast/dom/shadow/distribution-id-modified.html
40                fast/dom/shadow/reprojection-attribute-modified.html
41                fast/dom/shadow/reprojection-className-modified.html
42                fast/dom/shadow/reprojection-id-modified.html
43
44         * dom/Element.cpp:
45         (WebCore::Element::attributeChanged):
46         (WebCore::HasSelectorForClassStyleFunctor::HasSelectorForClassStyleFunctor):
47         (HasSelectorForClassStyleFunctor):
48         (WebCore::HasSelectorForClassStyleFunctor::operator()): Returns true if StyleResolver::hasSelectorForClass returns true.
49         (WebCore):
50         (WebCore::HasSelectorForClassDistributionFunctor::HasSelectorForClassDistributionFunctor):
51         (HasSelectorForClassDistributionFunctor):
52         (WebCore::HasSelectorForClassDistributionFunctor::operator()): Returns true if ElementShadow::hasSelectForClass returns true.
53         (WebCore::checkFunctorForClassChange):
54         (WebCore::checkNeedsStyleInvalidationForClassChange):
55         (WebCore::checkNeedsDistributionInvalidationForClassChange): Extracted the implementation to checkFunctorForClassChange.
56         (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
57         * dom/Element.h:
58         (Element):
59         * dom/Node.h:
60         (WebCore::Node::isInsertionPoint):
61         * html/HTMLElement.h:
62         (HTMLElement):
63         * html/shadow/InsertionPoint.cpp:
64         (WebCore::InsertionPoint::InsertionPoint):
65         * html/shadow/InsertionPoint.h:
66         (InsertionPoint):
67         (WebCore::isInsertionPoint):
68         (WebCore::shadowOfParentForDistribution):
69         (WebCore::resolveReprojection):
70
71 2012-11-19  Nate Chapin  <japhet@chromium.org>
72
73         Move empty loading to DocumentLoader, simplify FrameLoader::init()
74         https://bugs.webkit.org/show_bug.cgi?id=101512
75
76         Reviewed by Adam Barth.
77
78         No new tests, though several outputs changed because we no longer send resource
79             load callbacks for empty loads.
80
81         * loader/DocumentLoader.cpp:
82         (WebCore::DocumentLoader::DocumentLoader):
83         (WebCore::DocumentLoader::~DocumentLoader):
84         (WebCore::DocumentLoader::finishedLoading):
85         (WebCore::DocumentLoader::clearMainResourceLoader):
86         (WebCore::DocumentLoader::isLoadingInAPISense):
87         (WebCore::DocumentLoader::isLoadingMainResource):
88         (WebCore::DocumentLoader::maybeLoadEmpty):
89         (WebCore):
90         (WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
91              loads directly here.
92         * loader/DocumentLoader.h:
93         (DocumentLoader):
94         * loader/FrameLoader.cpp:
95         (WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
96             were previously being reset in init(). Given that the FrameLoader is in
97             an inconsistent state before init() is called anyway, there doesn't seem
98             to be a disadvantage to just initializing them to their post-init() values.
99         (WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
100             doing a bunch of direct calls to functions FrameLoader shouldn't know about.
101         * loader/FrameLoaderStateMachine.cpp:
102         (WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
103         * loader/FrameLoaderStateMachine.h:
104         * loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
105         (WebCore::MainResourceLoader::loadNow): This only returned true when an empty
106             load got deferred, which won't happen now. Return void and always treat
107             as returning false.
108         * loader/MainResourceLoader.h:
109         (MainResourceLoader):
110
111 2012-11-19  Erik Arvidsson  <arv@chromium.org>
112
113         Update DOMException name: TimeoutError
114         https://bugs.webkit.org/show_bug.cgi?id=102513
115
116         Reviewed by Kentaro Hara.
117
118         Patch 23 of 25 to update DOMException name to match the spec and Firefox.
119
120         No code uses DOMException TimeoutError. We do use TIMEOUT_ERR for XMLHttpRequestException. See bug 102506.
121
122         * dom/DOMCoreException.cpp:
123
124 2012-11-19  Erik Arvidsson  <arv@chromium.org>
125
126         Update DOMException name: DataCloneError
127         https://bugs.webkit.org/show_bug.cgi?id=102521
128
129         Reviewed by Kentaro Hara.
130
131         Patch 25 of 25 to update DOMException name to match the spec and Firefox.
132
133         Updated existing tests.
134
135         * dom/DOMCoreException.cpp:
136
137 2012-11-19  Tom Hudson  <tomhudson@chromium.org>
138
139         Improve performance of RenderBoxModelObject::paintTranslucentBorderSides()
140         https://bugs.webkit.org/show_bug.cgi?id=98660
141
142         Reviewed by Simon Fraser.
143
144         Accumulate edges[i].shouldRender() in a flag field and pass that to paintBorderSides()
145         and paintTranslucentBorderSides() so that we don't do unnecessary work.
146
147         If we can avoid setting up and tearing down an unnecessary transparent layer we save
148         30ms on some mobile platforms.
149
150         * rendering/RenderBoxModelObject.h:
151         * rendering/RenderBoxModelObject.cpp:
152         (WebCore::RenderBoxModelObject::paintBorder):
153         (WebCore::RenderBoxModelObject::paintTranslucentBorderSides):
154
155 2012-11-19  Hans Muller  <hmuller@adobe.com>
156
157         [CSS Exclusions] remove null exclusion shape check from ExclusionShape::createExclusionShape
158         https://bugs.webkit.org/show_bug.cgi?id=100765
159
160         Reviewed by Dirk Schulze.
161
162         ExclusionShape::createExclusionShape now ASSERTs that its basicShape argument
163         isn't null, since the caller is expected to ensure as much.  No new tests were
164         needed since this is a near-trivial cleanup.
165
166         * rendering/ExclusionShape.cpp:
167         (WebCore::ExclusionShape::createExclusionShape): This method no longer defends against a null basicShape argument by returning null.
168
169 2012-11-19  Sami Kyostila  <skyostil@chromium.org>
170
171         Use device scale factor instead of physical screen DPI for screen DPI
172         https://bugs.webkit.org/show_bug.cgi?id=101769
173
174         Reviewed by Adam Barth.
175
176         Media queries call WebCore::Screen::{horizontal,vertical}DPI() to determine
177         the dots per CSS inch[1] value for the "screen" media type. On Chromium these
178         functions currently return the physical screen DPI, which is wrong. To fix
179         this, we remove both of these functions entirely and make media queries use
180         the device scale factor multiplied by 96 on all ports.
181
182         [1] http://www.w3.org/TR/css3-mediaqueries/#resolution0
183
184         * page/Screen.cpp:
185         (WebCore::Screen::horizontalDPI):
186         (WebCore::Screen::verticalDPI):
187         * platform/PlatformScreen.h:
188         (WebCore):
189         * platform/blackberry/PlatformScreenBlackBerry.cpp:
190         * platform/chromium/PlatformScreenChromium.cpp:
191         * platform/efl/PlatformScreenEfl.cpp:
192         * platform/gtk/PlatformScreenGtk.cpp:
193         * platform/mac/PlatformScreenMac.mm:
194         * platform/qt/PlatformScreenQt.cpp:
195         * platform/win/PlatformScreenWin.cpp:
196         * platform/wx/ScreenWx.cpp:
197
198 2012-11-19  Julien Chaffraix  <jchaffraix@webkit.org>
199
200         Computed grid items' positions shouldn't be using Length
201         https://bugs.webkit.org/show_bug.cgi?id=102537
202
203         Reviewed by Tony Chang.
204
205         This change refactors how we store the grid items' position to use
206         a new type GridPosition. Length was a temporary type as it supported
207         'auto' | <integer> but it was starting to get more and more confusing
208         as we were implementing the layout routines.
209
210         No change in behavior.
211
212         * GNUmakefile.list.am:
213         * WebCore.gypi:
214         * WebCore.vcproj/WebCore.vcproj:
215         * WebCore.xcodeproj/project.pbxproj:
216         Added the new file to the build systems.
217
218         * rendering/style/RenderStyle.h:
219         Updated after the type change. Also made some getters
220         return a const reference instead of forcing a copy.
221
222         * rendering/style/StyleGridItemData.h:
223         (StyleGridItemData):
224         Ditto, also removed a comment about adding a new type.
225
226         * css/CSSComputedStyleDeclaration.cpp:
227         (WebCore::valueForGridPosition):
228         * css/StyleResolver.cpp:
229         (WebCore::createGridPosition):
230         (WebCore::StyleResolver::applyProperty):
231         * rendering/RenderGrid.cpp:
232         (WebCore::RenderGrid::resolveGridPosition):
233         Updated these sites after switching to GridPosition.
234
235         * rendering/RenderGrid.h:
236         Changed resolveGridPosition signature: it now takes a GridPosition.
237
238         * rendering/style/GridPosition.h: Added.
239         (WebCore::GridPosition::GridPosition):
240         Default constructor, creates an 'auto' position.
241
242         (WebCore::GridPosition::isPositive):
243         (WebCore::GridPosition::type):
244         (WebCore::GridPosition::isAuto):
245         (WebCore::GridPosition::setIntegerPosition):
246         (WebCore::GridPosition::integerPosition):
247         Helper functions.
248
249         (WebCore::GridPosition::operator==):
250         Required comparison operator for StyleGridItemData.
251
252 2012-11-19  Thiago Marcos P. Santos  <thiago.santos@intel.com>
253
254         Apply the resolved viewport rules
255         https://bugs.webkit.org/show_bug.cgi?id=95964
256
257         Reviewed by Kenneth Rohde Christiansen.
258
259         This patch implements the CSS Device Adaptation specification. The
260         WebKit implementation relies on the already implemented Viewport Meta
261         infrastructure to notify the browser of viewport changes.
262
263         The implementation was tests with success on the Qt and EFL ports, but
264         basically every port supporting Viewport Meta should be fine.
265
266         The usage of @-webkit-viewport inside media queries (more tests coming
267         to map all the corner cases) is currently limited when the media query
268         depends on the viewport dimensions itself. Defining the width and height
269         based on screen size will fail on ports reporting the screen
270         size as the size of the browser window instead of the device screen.
271
272         Tests: css3/device-adapt/opera/cascading-001.xhtml
273                css3/device-adapt/opera/cascading-002.xhtml
274                css3/device-adapt/opera/cascading-003.xhtml
275                css3/device-adapt/opera/cascading-004.xhtml
276                css3/device-adapt/opera/constrain-001.xhtml
277                css3/device-adapt/opera/constrain-002.xhtml
278                css3/device-adapt/opera/constrain-003.xhtml
279                css3/device-adapt/opera/constrain-004.xhtml
280                css3/device-adapt/opera/constrain-005.xhtml
281                css3/device-adapt/opera/constrain-006.xhtml
282                css3/device-adapt/opera/constrain-007.xhtml
283                css3/device-adapt/opera/constrain-008.xhtml
284                css3/device-adapt/opera/constrain-009.xhtml
285                css3/device-adapt/opera/constrain-010.xhtml
286                css3/device-adapt/opera/constrain-011.xhtml
287                css3/device-adapt/opera/constrain-012.xhtml
288                css3/device-adapt/opera/constrain-013.xhtml
289                css3/device-adapt/opera/constrain-014.xhtml
290                css3/device-adapt/opera/constrain-015.xhtml
291                css3/device-adapt/opera/constrain-016.xhtml
292                css3/device-adapt/opera/constrain-017.xhtml
293                css3/device-adapt/opera/constrain-020.xhtml
294                css3/device-adapt/opera/syntax-001.xhtml
295                css3/device-adapt/opera/syntax-002.xhtml
296                css3/device-adapt/opera/syntax-003.xhtml
297
298         * CMakeLists.txt:
299         * GNUmakefile.list.am:
300         * Target.pri:
301         * WebCore.gypi:
302         * WebCore.vcproj/WebCore.vcproj:
303         * WebCore.xcodeproj/project.pbxproj:
304         * css/CSSAllInOne.cpp:
305         * css/RuleSet.cpp:
306         (WebCore::RuleSet::addRulesFromSheet):
307         * css/StyleResolver.cpp:
308         (WebCore::StyleResolver::StyleResolver):
309         (WebCore::StyleResolver::appendAuthorStyleSheets):
310         (WebCore::StyleResolver::~StyleResolver):
311         * css/StyleResolver.h:
312         (StyleResolver):
313         (WebCore::StyleResolver::viewportStyleResolver):
314         * css/ViewportStyleResolver.cpp: Added.
315         (WebCore):
316         (WebCore::ViewportStyleResolver::ViewportStyleResolver):
317         (WebCore::ViewportStyleResolver::addViewportRule):
318         (WebCore::ViewportStyleResolver::clearDocument):
319         (WebCore::ViewportStyleResolver::resolve):
320         (WebCore::ViewportStyleResolver::getViewportArgumentValue):
321         * css/ViewportStyleResolver.h: Added.
322         (WebCore):
323         (ViewportStyleResolver):
324         (WebCore::ViewportStyleResolver::create):
325         * dom/Document.h:
326         (WebCore::Document::setViewportArguments):
327         * dom/ViewportArguments.cpp:
328         (WebCore::compareIgnoringAuto):
329         (WebCore):
330         (WebCore::ViewportArguments::resolve):
331         * dom/ViewportArguments.h:
332         (ViewportAttributes):
333         (WebCore::ViewportArguments::ViewportArguments):
334         (ViewportArguments):
335         (WebCore::ViewportArguments::operator==):
336
337 2012-11-19  Erik Arvidsson  <arv@chromium.org>
338
339         Update DOMException name: SecurityError
340         https://bugs.webkit.org/show_bug.cgi?id=102437
341
342         Reviewed by Kentaro Hara.
343
344         Patch 18 of 25 to update DOMException name to match the spec and Firefox.
345
346         Updated existing tests.
347
348         * dom/DOMCoreException.cpp:
349
350 2012-11-19  Erik Arvidsson  <arv@chromium.org>
351
352         Update DOMException name: URLMismatchError
353         https://bugs.webkit.org/show_bug.cgi?id=102511
354
355         Reviewed by Kentaro Hara.
356
357         Patch 21 of 25 to update DOMException name to match the spec and Firefox.
358
359         Updated existing tests.
360
361         * dom/DOMCoreException.cpp:
362         (WebCore):
363
364 2012-11-19  Kihong Kwon  <kihong.kwon@samsung.com>
365
366         Add PROXIMITY_EVENTS feature
367         https://bugs.webkit.org/show_bug.cgi?id=102658
368
369         Reviewed by Kentaro Hara.
370
371         Add PROXIMITY_EVENTS feature to xcode project for WebCorei and GNU make.
372
373         No new tests. Just add a new feature.
374
375         * Configurations/FeatureDefines.xcconfig:
376         * GNUmakefile.features.am:
377
378 2012-11-19  Alexei Filippov  <alph@chromium.org>
379
380         Web Inspector: Dim a component's subitems' color in NMI snapshot
381         https://bugs.webkit.org/show_bug.cgi?id=102224
382
383         Reviewed by Yury Semikhatsky.
384
385         * inspector/front-end/NativeMemorySnapshotView.js:
386         (WebInspector.NativeSnapshotNode.prototype._createSizeCell):
387         * inspector/front-end/nativeMemoryProfiler.css:
388         (.native-snapshot-view .data-grid .dimmed div.size-bar):
389
390 2012-11-19  Erik Arvidsson  <arv@chromium.org>
391
392         Update DOMException name: NetworkError
393         https://bugs.webkit.org/show_bug.cgi?id=102503
394
395         Reviewed by Kentaro Hara.
396
397         Patch 19 of 25 to update DOMException name to match the spec and Firefox.
398
399         No code uses DOMException NetworkError. We do use NETWORK_ERR for XMLHttpRequestException. See bug 102506.
400
401         * dom/DOMCoreException.cpp:
402
403 2012-11-19  Ilya Tikhonovsky  <loislo@chromium.org>
404
405         webaudio: clean-up. Replace AudioContext::m_document member with ContextDestructionObserver::scriptExecutionContext().
406         https://bugs.webkit.org/show_bug.cgi?id=102649
407
408         Reviewed by Adam Barth.
409
410         AudioContext uses m_document only as a pointer to ScriptExecutionContext.
411         It could be safely replaced with ContextDestructionObserver::m_scriptExecutionContext.
412         The lifetime of m_scriptExecutionContext is slightly different but it could be adjusted by m_isStopScheduled flag.
413
414         No new tests as there is no new functionality.
415
416         * Modules/webaudio/AudioBufferSourceNode.cpp:
417         (WebCore::AudioBufferSourceNode::looping):
418         (WebCore::AudioBufferSourceNode::setLooping):
419         * Modules/webaudio/AudioContext.cpp:
420         (WebCore::AudioContext::AudioContext):
421         (WebCore::AudioContext::stop):
422         (WebCore::AudioContext::scriptExecutionContext):
423         (WebCore::AudioContext::fireCompletionEvent):
424         (WebCore::AudioContext::reportMemoryUsage):
425         * Modules/webaudio/AudioContext.h:
426         (AudioContext):
427         * Modules/webaudio/ScriptProcessorNode.cpp:
428         (WebCore::ScriptProcessorNode::fireProcessEvent):
429         (WebCore::ScriptProcessorNode::scriptExecutionContext):
430
431 2012-11-19  Ilya Tikhonovsky  <loislo@chromium.org>
432
433         webaudio: leak: AudioContext objects are leaking. They retain 36mb of shared data.
434         https://bugs.webkit.org/show_bug.cgi?id=102356
435
436         Reviewed by Adam Barth.
437
438         A clean-up code was moved from uninitialize to clear method.
439         AudioContext marks itself as hasPendingActivity in method constructCommon and unmarks itself in method clear.
440         m_isStopScheduled filters out second ActiveDOMObject::stop call.
441         markForDeletion appends AudioNode pointer to m_nodesToDelete array if there is no active audio thread.
442         adoptRef was added in createOfflineContext method.
443         A guard was added into deleteMarkedNodes.
444
445         Test: inspector-protocol/nmi-webaudio-leak-test.html
446
447         * Modules/webaudio/AudioContext.cpp:
448         (WebCore::AudioContext::createOfflineContext):
449         (WebCore::AudioContext::AudioContext):
450         (WebCore::AudioContext::constructCommon):
451         (WebCore::AudioContext::~AudioContext):
452         (WebCore::AudioContext::clear):
453         (WebCore::AudioContext::uninitialize):
454         (WebCore::AudioContext::stopDispatch):
455         (WebCore::AudioContext::stop):
456         (WebCore::AudioContext::markForDeletion):
457         (WebCore::AudioContext::scheduleNodeDeletion):
458         (WebCore::AudioContext::deleteMarkedNodes):
459         * Modules/webaudio/AudioContext.h:
460         (AudioContext):
461         * bindings/v8/custom/V8AudioContextCustom.cpp:
462         (WebCore::V8AudioContext::constructorCallback):
463         * inspector/InspectorMemoryAgent.cpp:
464         (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
465         * platform/PlatformMemoryInstrumentation.cpp:
466         (WebCore::PlatformMemoryInstrumentation::reportMemoryUsage):
467         (WebCore):
468         * platform/PlatformMemoryInstrumentation.h:
469         (PlatformMemoryInstrumentation):
470         (WebCore):
471
472 2012-11-19  Erik Arvidsson  <arv@chromium.org>
473
474         Update DOMException name: QuotaExceededError
475         https://bugs.webkit.org/show_bug.cgi?id=102512
476
477         Reviewed by Kentaro Hara.
478
479         Patch 22 of 25 to update DOMException name to match the spec and Firefox.
480
481         Updated existing tests.
482
483         * dom/DOMCoreException.cpp:
484
485 2012-11-19  Erik Arvidsson  <arv@chromium.org>
486
487         Update DOMException name: AbortError
488         https://bugs.webkit.org/show_bug.cgi?id=102508
489
490         Reviewed by Kentaro Hara.
491
492         Patch 20 of 25 to update DOMException name to match the spec and Firefox.
493
494         No code uses DOMException AbortError. We do use ABORT_ERR for XMLHttpRequestException. See bug 102506.
495
496         * dom/DOMCoreException.cpp:
497
498 2012-11-19  Kentaro Hara  <haraken@chromium.org>
499
500         Unreviewed, rolling out r135111.
501         http://trac.webkit.org/changeset/135111
502         https://bugs.webkit.org/show_bug.cgi?id=102356
503
504         The patch caused crashes in several layout tests
505
506         * Modules/webaudio/AudioContext.cpp:
507         (WebCore::AudioContext::createOfflineContext):
508         (WebCore::AudioContext::AudioContext):
509         (WebCore::AudioContext::constructCommon):
510         (WebCore::AudioContext::~AudioContext):
511         (WebCore::AudioContext::uninitialize):
512         (WebCore::AudioContext::uninitializeDispatch):
513         (WebCore::AudioContext::stop):
514         (WebCore::AudioContext::markForDeletion):
515         (WebCore::AudioContext::scheduleNodeDeletion):
516         (WebCore::AudioContext::deleteMarkedNodes):
517         * Modules/webaudio/AudioContext.h:
518         (AudioContext):
519         * bindings/v8/custom/V8AudioContextCustom.cpp:
520         (WebCore::V8AudioContext::constructorCallback):
521         * inspector/InspectorMemoryAgent.cpp:
522         (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
523         * platform/PlatformMemoryInstrumentation.cpp:
524         (WebCore):
525         * platform/PlatformMemoryInstrumentation.h:
526
527 2012-11-19  Kentaro Hara  <haraken@chromium.org>
528
529         Unreviewed, rolling out r135116.
530         http://trac.webkit.org/changeset/135116
531         https://bugs.webkit.org/show_bug.cgi?id=102649
532
533         Revert this patch to revert r135111, which caused crashes in
534         several layout tests
535
536         * Modules/webaudio/AudioBufferSourceNode.cpp:
537         (WebCore::AudioBufferSourceNode::looping):
538         (WebCore::AudioBufferSourceNode::setLooping):
539         * Modules/webaudio/AudioContext.cpp:
540         (WebCore::AudioContext::AudioContext):
541         (WebCore::AudioContext::stop):
542         (WebCore::AudioContext::document):
543         (WebCore):
544         (WebCore::AudioContext::hasDocument):
545         (WebCore::AudioContext::scriptExecutionContext):
546         (WebCore::AudioContext::fireCompletionEvent):
547         (WebCore::AudioContext::reportMemoryUsage):
548         * Modules/webaudio/AudioContext.h:
549         (AudioContext):
550         * Modules/webaudio/ScriptProcessorNode.cpp:
551         (WebCore::ScriptProcessorNode::fireProcessEvent):
552         (WebCore::ScriptProcessorNode::scriptExecutionContext):
553
554 2012-11-19  Eugene Klyuchnikov  <eustas.bug@gmail.com>
555
556         Web Inspector: Refine JsDoc in DebuggerScriptMapping.js
557         https://bugs.webkit.org/show_bug.cgi?id=102673
558
559         Reviewed by Vsevolod Vlasov.
560
561         DebuggerScriptMapping calls public method "addScript" not defined
562         in SourceMapping interface.
563
564         To make things clear I've added ScriptSourceMapping interface that
565         extends SourceMapping interface by adding "addScript" method.
566
567         * inspector/front-end/SourceMapping.js: Added "ScriptSourceMapping".
568         * inspector/front-end/CompilerScriptMapping.js:
569         Updated "@implements" to ScriptSourceMapping.
570         * inspector/front-end/ResourceScriptMapping.js: Ditto.
571         * inspector/front-end/ScriptSnippetModel.js: Ditto.
572         * inspector/front-end/DebuggerScriptMapping.js: Updated signatures.
573         Removed useless code.
574
575 2012-11-19  Tim Horton  <timothy_horton@apple.com>
576
577         Unreviewed, untested build fix.
578
579         * bindings/scripts/IDLParser.pm:
580         (parseModule):
581
582 2012-11-19  Dongwoo Joshua Im  <dw.im@samsung.com>
583
584         [CSS3] Move CSSPropertyWebkitTextAlignLast into isValidKeywordPropertyAndValue function
585         https://bugs.webkit.org/show_bug.cgi?id=102303
586
587         Reviewed by Alexis Menard.
588
589         Move the part which check whether CSSPropertyWebkitTextAlignLast has available value
590         into the isValidKeywordPropertyAndValue function, like the same kind of properties.
591         This will help speed wise in JS.
592
593         No new functionality, no new tests.
594
595         * css/CSSParser.cpp:
596         (WebCore::isValidKeywordPropertyAndValue):
597         (WebCore::isKeywordPropertyID):
598         (WebCore::CSSParser::parseValue):
599
600 2012-11-19  Keishi Hattori  <keishi@webkit.org>
601
602         REGRESSION (r133565): Calendar picker isn't animating when changing month by pressing 't'
603         https://bugs.webkit.org/show_bug.cgi?id=102660
604
605         Reviewed by Kent Tamura.
606
607         The calendar picker used to animate when you press 't'.
608
609         No new tests.
610
611         * Resources/pagepopups/calendarPicker.js:
612         (DaysTable.prototype.selectRange):
613
614 2012-11-19  Kent Tamura  <tkent@chromium.org>
615
616         input.value="" should clear date/time input elements with partial values
617         https://bugs.webkit.org/show_bug.cgi?id=102645
618
619         Reviewed by Kentaro Hara.
620
621         Tests: fast/forms/date-multiple-fields/date-multiple-fields-value-set-empty.html
622                fast/forms/datetime-multiple-fields/datetime-multiple-fields-value-set-empty.html
623                fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-value-set-empty.html
624                fast/forms/month-multiple-fields/month-multiple-fields-value-set-empty.html
625                fast/forms/time-multiple-fields/time-multiple-fields-value-set-empty.html
626                fast/forms/week-multiple-fields/week-multiple-fields-value-set-empty.html
627
628         * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
629         (WebCore::BaseMultipleFieldsDateAndTimeInputType::setValue):
630         If the new value is an empty string and sub-fields has values, we should
631         update the UI value to the empty state.
632         * html/DateTimeFieldsState.h:
633         (WebCore::DateTimeFieldsState::hasAnyValue):
634         Added. It returns true if one or more sub-fields are not empty.
635
636 2012-11-19  Andrey Adaikin  <aandrey@chromium.org>
637
638         Web Inspector: [Canvas] if many canvases are being instrumented show the screenshot of the first one
639         https://bugs.webkit.org/show_bug.cgi?id=102522
640
641         Reviewed by Yury Semikhatsky.
642
643         When many canvases are being instrumented we'll want to show replay screenshots for each canvas.
644         Meanwhile, show the screenshot of the first one (instead of the last one), as it's likely to be the "main" canvas.
645         Drive-by: add more typification for the JS compiler.
646         Drive-by: create a new canvas for WebGL replay every time (similar to 2D replay) to avoid problems with resetting the context state.
647
648         * inspector/InjectedScriptCanvasModuleSource.js:
649         (.):
650
651 2012-11-19  Kentaro Hara  <haraken@chromium.org>
652
653         Remove IDLStructure.pm
654         https://bugs.webkit.org/show_bug.cgi?id=102642
655
656         Reviewed by Adam Barth.
657
658         Previously IDLStructure.pm was full of regular expressions to
659         parse IDL files. Now a new IDL parser is implemented, IDLStructure.pm
660         just contains several data structures for the IDL parser. We can
661         move them to IDLParser.pm and thus remove IDLStructure.pm.
662
663         No tests. No change in generated code.
664
665         * CMakeLists.txt:
666         * DerivedSources.make:
667         * DerivedSources.pri:
668         * GNUmakefile.am:
669         * WebCore.gyp/WebCore.gyp:
670         * WebCore.vcproj/MigrateScripts:
671         * WebCore.vcproj/WebCore.vcproj:
672         * WebCore.xcodeproj/project.pbxproj:
673         * bindings/scripts/IDLParser.pm:
674         (Parse):
675         (parseInterface):
676         (parseException):
677         (parseConst):
678         (parseAttributeRest):
679         (parseOperationRest):
680         (parseOptionalOrRequiredArgument):
681         (parseExceptionField):
682         (parseInterfaceOld):
683         (parseExceptionOld):
684         (parseAttributeRestOld):
685         (applyExtendedAttributeList):
686         * bindings/scripts/IDLStructure.pm: Removed.
687
688 2012-11-19  Alexei Filippov  <alph@chromium.org>
689
690         Web Inspector: refine time and bytes output formatting
691         https://bugs.webkit.org/show_bug.cgi?id=102265
692
693         Reviewed by Yury Semikhatsky.
694
695         Add a space between number and unit, otherwise it's hard to read things like 88B.
696         Reduce a number of decimal digits in KB and MB formats. 1023.45KB seems to be too detailed.
697
698         * English.lproj/localizedStrings.js:
699         * inspector/front-end/CookiesTable.js:
700         (WebInspector.CookiesTable.prototype._createGridNode):
701         * inspector/front-end/UIUtils.js:
702         (Number.secondsToString):
703         (Number.bytesToString):
704
705 2012-11-19  Eugene Klyuchnikov  <eustas.bug@gmail.com>
706
707         Web Inspector: Timeline: DomContentLoaded event labeled incorrectly
708         https://bugs.webkit.org/show_bug.cgi?id=102383
709
710         Reviewed by Yury Semikhatsky.
711
712         Fixed string presentation of event.
713
714         * inspector/front-end/TimelinePresentationModel.js: Fixed string.
715
716 2012-11-19  Kentaro Hara  <haraken@chromium.org>
717
718         Remove IDLStructure.pm
719         https://bugs.webkit.org/show_bug.cgi?id=102642
720
721         Reviewed by Adam Barth.
722
723         Previously IDLStructure.pm was full of regular expressions to
724         parse IDL files. Now a new IDL parser is implemented, IDLStructure.pm
725         just contains several data structures for the IDL parser. We can
726         move them to IDLParser.pm and thus remove IDLStructure.pm.
727
728         No tests. No change in generated code.
729
730         * CMakeLists.txt:
731         * DerivedSources.make:
732         * DerivedSources.pri:
733         * GNUmakefile.am:
734         * WebCore.gyp/WebCore.gyp:
735         * WebCore.vcproj/MigrateScripts:
736         * WebCore.vcproj/WebCore.vcproj:
737         * WebCore.xcodeproj/project.pbxproj:
738         * bindings/scripts/IDLParser.pm:
739         (Parse):
740         (parseInterface):
741         (parseException):
742         (parseConst):
743         (parseAttributeRest):
744         (parseOperationRest):
745         (parseOptionalOrRequiredArgument):
746         (parseExceptionField):
747         (parseInterfaceOld):
748         (parseExceptionOld):
749         (parseAttributeRestOld):
750         (applyExtendedAttributeList):
751         * bindings/scripts/IDLStructure.pm: Removed.
752
753 2012-11-19  Alexei Filippov  <alph@chromium.org>
754
755         Web Inspector: refine time and bytes output formatting
756         https://bugs.webkit.org/show_bug.cgi?id=102265
757
758         Reviewed by Yury Semikhatsky.
759
760         Add a space between number and unit, otherwise it's hard to read things like 88B.
761         Reduce a number of decimal digits in KB and MB formats. 1023.45KB seems to be too detailed.
762
763         * English.lproj/localizedStrings.js:
764         * inspector/front-end/CookiesTable.js:
765         (WebInspector.CookiesTable.prototype._createGridNode):
766         * inspector/front-end/UIUtils.js:
767         (Number.secondsToString):
768         (Number.bytesToString):
769
770 2012-11-19  Eugene Klyuchnikov  <eustas.bug@gmail.com>
771
772         Web Inspector: Timeline: DomContentLoaded event labeled incorrectly
773         https://bugs.webkit.org/show_bug.cgi?id=102383
774
775         Reviewed by Yury Semikhatsky.
776
777         Fixed string presentation of event.
778
779         * inspector/front-end/TimelinePresentationModel.js: Fixed string.
780
781 2012-11-19  Kentaro Hara  <haraken@chromium.org>
782
783         Unreviewed, rolling out r135114.
784         http://trac.webkit.org/changeset/135114
785         https://bugs.webkit.org/show_bug.cgi?id=102642
786
787         it broke Qt build
788
789         * CMakeLists.txt:
790         * DerivedSources.make:
791         * DerivedSources.pri:
792         * GNUmakefile.am:
793         * WebCore.gyp/WebCore.gyp:
794         * WebCore.vcproj/MigrateScripts:
795         * WebCore.vcproj/WebCore.vcproj:
796         * WebCore.xcodeproj/project.pbxproj:
797         * bindings/scripts/IDLParser.pm:
798         (Parse):
799         (parseInterface):
800         (parseException):
801         (parseConst):
802         (parseAttributeRest):
803         (parseOperationRest):
804         (parseOptionalOrRequiredArgument):
805         (parseExceptionField):
806         (parseInterfaceOld):
807         (parseExceptionOld):
808         (parseAttributeRestOld):
809         (applyExtendedAttributeList):
810         * bindings/scripts/IDLStructure.pm: Added.
811
812 2012-11-19  Vsevolod Vlasov  <vsevik@chromium.org>
813
814         Unreviewed inspector closure compilation fix.
815
816         * inspector/front-end/ObjectPropertiesSection.js:
817         * inspector/front-end/externs.js:
818
819 2012-11-18  Ilya Tikhonovsky  <loislo@chromium.org>
820
821         webaudio: clean-up. Replace AudioContext::m_document member with ContextDestructionObserver::scriptExecutionContext().
822         https://bugs.webkit.org/show_bug.cgi?id=102649
823
824         Reviewed by Adam Barth.
825
826         AudioContext uses m_document only as a pointer to ScriptExecutionContext.
827         It could be safely replaced with ContextDestructionObserver::m_scriptExecutionContext.
828         The lifetime of m_scriptExecutionContext is slightly different but it could be adjusted by m_isStopScheduled flag.
829
830         No new tests as there is no new functionality.
831
832         * Modules/webaudio/AudioBufferSourceNode.cpp:
833         (WebCore::AudioBufferSourceNode::looping):
834         (WebCore::AudioBufferSourceNode::setLooping):
835         * Modules/webaudio/AudioContext.cpp:
836         (WebCore::AudioContext::AudioContext):
837         (WebCore::AudioContext::stop):
838         (WebCore::AudioContext::fireCompletionEvent):
839         (WebCore::AudioContext::reportMemoryUsage):
840         * Modules/webaudio/AudioContext.h:
841         (WebCore::AudioContext::scriptExecutionContext):
842         (AudioContext):
843         * Modules/webaudio/ScriptProcessorNode.cpp:
844         (WebCore::ScriptProcessorNode::fireProcessEvent):
845         (WebCore::ScriptProcessorNode::scriptExecutionContext):
846
847 2012-11-18  Kentaro Hara  <haraken@chromium.org>
848
849         [V8] Remove unused variables from CodeGeneratorV8.pm
850         https://bugs.webkit.org/show_bug.cgi?id=102648
851
852         Reviewed by Adam Barth.
853
854         No tests. No change in generated code.
855
856         * bindings/scripts/CodeGeneratorV8.pm:
857         (GenerateInterface):
858         (GenerateHeader):
859         (GetInternalFields):
860         (GenerateNormalAttrGetter):
861         (GenerateSingleBatchedAttribute):
862         (GenerateImplementationCustomCall):
863         (GenerateFunctionCallString):
864         (CreateCustomSignature):
865         (GetContextEnableFunction):
866
867 2012-11-18  Kentaro Hara  <haraken@chromium.org>
868
869         Remove IDLStructure.pm
870         https://bugs.webkit.org/show_bug.cgi?id=102642
871
872         Reviewed by Adam Barth.
873
874         Previously IDLStructure.pm was full of regular expressions to
875         parse IDL files. Now a new IDL parser is implemented, IDLStructure.pm
876         just contains several data structures for the IDL parser. We can
877         move them to IDLParser.pm and thus remove IDLStructure.pm.
878
879         No tests. No change in generated code.
880
881         * CMakeLists.txt:
882         * DerivedSources.make:
883         * DerivedSources.pri:
884         * GNUmakefile.am:
885         * WebCore.gyp/WebCore.gyp:
886         * WebCore.vcproj/MigrateScripts:
887         * WebCore.vcproj/WebCore.vcproj:
888         * WebCore.xcodeproj/project.pbxproj:
889         * bindings/scripts/IDLParser.pm:
890         (Parse):
891         (parseInterface):
892         (parseException):
893         (parseConst):
894         (parseAttributeRest):
895         (parseOperationRest):
896         (parseOptionalOrRequiredArgument):
897         (parseExceptionField):
898         (parseInterfaceOld):
899         (parseExceptionOld):
900         (parseAttributeRestOld):
901         (applyExtendedAttributeList):
902         * bindings/scripts/IDLStructure.pm: Removed.
903
904 2012-11-18  Kentaro Hara  <haraken@chromium.org>
905
906         [V8] Make more use of $v8Interface in CodeGeneratorV8.pm
907         https://bugs.webkit.org/show_bug.cgi?id=102639
908
909         Reviewed by Adam Barth.
910
911         We can replace hard-coded "V8${interfaceName}" with $v8Interface.
912
913         No tests. No change in generated code.
914
915         * bindings/scripts/CodeGeneratorV8.pm:
916         (GenerateNormalAttrGetter):
917         (GenerateNormalAttrSetter):
918         (GenerateFunctionCallback):
919         (GenerateNamedConstructorCallback):
920         (GenerateImplementationIndexer):
921         (GenerateImplementationNamedPropertyGetter):
922         (GenerateImplementation):
923
924 2012-11-16  Ilya Tikhonovsky  <loislo@chromium.org>
925
926         webaudio: leak: AudioContext objects are leaking. They retain 36mb of shared data.
927         https://bugs.webkit.org/show_bug.cgi?id=102356
928
929         Reviewed by Adam Barth.
930
931         A clean-up code was moved from uninitialize to clear method.
932         AudioContext marks itself as hasPendingActivity in method constructCommon and unmarks itself in method clear.
933         m_isStopScheduled filters out second ActiveDOMObject::stop call.
934         markForDeletion appends AudioNode pointer to m_nodesToDelete array if there is no active audio thread.
935         adoptRef was added in createOfflineContext method.
936
937         Test: inspector-protocol/nmi-webaudio-leak-test.html
938
939         * Modules/webaudio/AudioContext.cpp:
940         (WebCore::AudioContext::createOfflineContext):
941         (WebCore::AudioContext::AudioContext):
942         (WebCore::AudioContext::constructCommon):
943         (WebCore::AudioContext::~AudioContext):
944         (WebCore::AudioContext::clear):
945         (WebCore::AudioContext::uninitialize):
946         (WebCore::AudioContext::stopDispatch):
947         (WebCore::AudioContext::stop):
948         (WebCore::AudioContext::markForDeletion):
949         (WebCore::AudioContext::scheduleNodeDeletion):
950         (WebCore::AudioContext::deleteMarkedNodes):
951         * Modules/webaudio/AudioContext.h:
952         (AudioContext):
953         * bindings/v8/custom/V8AudioContextCustom.cpp:
954         (WebCore::V8AudioContext::constructorCallback):
955         * inspector/InspectorMemoryAgent.cpp:
956         (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
957         * platform/PlatformMemoryInstrumentation.cpp:
958         (WebCore::PlatformMemoryInstrumentation::reportMemoryUsage):
959         (WebCore):
960         * platform/PlatformMemoryInstrumentation.h:
961         (PlatformMemoryInstrumentation):
962         (WebCore):
963
964 2012-11-18  Kunihiko Sakamoto  <ksakamoto@chromium.org>
965
966         min/max/step support for calendar picker on datetime/datetime-local
967         https://bugs.webkit.org/show_bug.cgi?id=102628
968
969         Reviewed by Kent Tamura.
970
971         Gray out dates with no allowed values on calendar picker for datetime/datetime-local
972         when values are limited by min/max/step attributes.
973
974         Test: platform/chromium/fast/forms/calendar-picker/calendar-picker-datetime-with-step.html
975
976         * Resources/pagepopups/calendarPicker.js:
977         (CalendarPicker.prototype._stepMismatch):
978         Returns true iff there are any allowed values in the given day.
979
980 2012-11-18  Laszlo Gombos  <l.gombos@samsung.com>
981
982         Remove non-existent directories from the make system
983         https://bugs.webkit.org/show_bug.cgi?id=102632
984
985         Reviewed by Adam Barth.
986
987         Remove (non-existent) symbian references from the exclude list in gyp project files.
988
989         No new tests as there is no new functionality.
990
991         * WebCore.gyp/WebCore.gyp:
992
993 2012-11-18  Patrick Gansterer  <paroga@webkit.org>
994
995         [WIN] Add a IMLangFontLinkType typedef
996         https://bugs.webkit.org/show_bug.cgi?id=102584
997
998         Reviewed by Brent Fulgham.
999
1000         Add a central typedef for IMLangFontLink(2) to get rid of a bunch of ifdefs.
1001
1002         * platform/graphics/FontCache.h:
1003         (WebCore):
1004         * platform/graphics/win/FontCacheWin.cpp:
1005         (WebCore::FontCache::getFontLinkInterface):
1006         (WebCore::getCJKCodePageMasks):
1007         (WebCore::createMLangFont):
1008         (WebCore::FontCache::getFontDataForCharacters):
1009         * platform/graphics/win/SimpleFontDataWin.cpp:
1010         (WebCore::SimpleFontData::containsCharacters):
1011         * platform/graphics/wince/FontCacheWinCE.cpp:
1012         (WebCore):
1013         (WebCore::FontCache::getFontLinkInterface):
1014         (WebCore::getCJKCodePageMasks):
1015         (WebCore::FontCache::getFontDataForCharacters):
1016         * platform/graphics/wince/FontPlatformData.cpp:
1017         (WebCore::FontFamilyCodePageInfo::codePages):
1018         (WebCore::FixedSizeFontData::create):
1019         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp:
1020         (WebCore::GlyphPage::fill):
1021
1022 2012-11-18  Mike West  <mkwst@chromium.org>
1023
1024         Web Inspector: Remove unused ConsoleMessage constructor.
1025         https://bugs.webkit.org/show_bug.cgi?id=102590
1026
1027         Reviewed by Brent Fulgham.
1028
1029         We currently have a ConsoleMessage constructor that's unused. Let's
1030         kill it.
1031
1032         * inspector/ConsoleMessage.cpp:
1033         * inspector/ConsoleMessage.h:
1034         (ConsoleMessage):
1035             Removing an unused constructor variant.
1036
1037 2012-11-18  Andreas Kling  <akling@apple.com>
1038
1039         StyledElement: Make handling the "style" attribute a litte faster.
1040         <http://webkit.org/b/102623>
1041
1042         Reviewed by Ojan Vafai.
1043
1044         We know that "style" is never a presentation attribute, so avoid the virtual call to isPresentationAttribute()
1045         by hoisting the parseAttribute() logic up into attributeChanged().
1046         Did the same thing with Element::parseAttribute() for consistency.
1047
1048         Knocks ~0.6% of samples off of the DOM/CreateNodes performance test.
1049
1050         * dom/Element.cpp:
1051         (WebCore::Element::attributeChanged):
1052         * dom/Element.h:
1053         (WebCore::Element::parseAttribute):
1054         * dom/StyledElement.cpp:
1055         (WebCore::StyledElement::attributeChanged):
1056         * dom/StyledElement.h:
1057         (StyledElement):
1058
1059 2012-11-18  Laszlo Gombos  <l.gombos@samsung.com>
1060
1061         [CMake] Consolidate common input files
1062         https://bugs.webkit.org/show_bug.cgi?id=101632
1063
1064         Reviewed by Rob Buis.
1065
1066         Consolidate and sort the list of files, move common source files
1067         into CMakeLists.txt from the port specific files.
1068
1069         No new tests as there is no new functionality.
1070
1071         * CMakeLists.txt:
1072         * PlatformBlackBerry.cmake:
1073         * PlatformEfl.cmake:
1074         * PlatformWinCE.cmake:
1075
1076 2012-11-18  Andreas Kling  <akling@apple.com>
1077
1078         Tighten small SharedBuffers by reserving the exact amount of space needed.
1079         <http://webkit.org/b/102625>
1080
1081         Reviewed by Anders Carlsson.
1082
1083         When adding the first chunk to a small (<4096 bytes) SharedBuffer, reserve the exact
1084         amount of space needed instead of leaving it to Vector<char>::append().
1085
1086         1.86MB progression on Membuster3.
1087
1088         * platform/SharedBuffer.cpp:
1089         (WebCore::SharedBuffer::append):
1090
1091 2012-11-18  Ryosuke Niwa  <rniwa@webkit.org>
1092
1093         Make namedItem return a node list only in HTMLFormControlsCollection and HTMLOptionsCollection
1094         https://bugs.webkit.org/show_bug.cgi?id=101311
1095
1096         Reviewed by Darin Adler.
1097
1098         Introduce two new interfaces HTMLFormControlsCollection and HTMLOptionsCollection to be used by form.elements
1099         and select.options. These two interfaces have the named getter and namedItem that returns a live NodeList when
1100         there are multiple matches. Introducing these two interfaces allow us to make "regular" HTMLCollection's named
1101         getter and namedItem return exactly one node or null as specified in HTML5:
1102         http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#collections-0
1103
1104         Unfortunately, HTMLOptionsCollection still has a bug that its named getter and namedItem returns
1105         a static NodeList instead of a live NodeList (DynamicNodeList) at the moment.
1106
1107         Also got rid of Document::objects since it's not exposed in IDL or called anywhere.
1108
1109         Test: fast/dom/html-collections-namedItem.html
1110
1111         * CMakeLists.txt:
1112         * DerivedSources.cpp:
1113         * DerivedSources.make:
1114         * DerivedSources.pri:
1115         * GNUmakefile.list.am:
1116         * Target.pri:
1117         * UseJSC.cmake:
1118         * UseV8.cmake:
1119         * WebCore.gypi:
1120         * WebCore.vcproj/WebCore.vcproj:
1121         * WebCore.xcodeproj/project.pbxproj:
1122         * bindings/js/JSBindingsAllInOne.cpp:
1123         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1124         (WebCore::getNamedItems):
1125         * bindings/js/JSHTMLCollectionCustom.cpp:
1126         (WebCore::JSHTMLCollection::nameGetter): Now returns exactly one node or null.
1127         (WebCore::toJS):
1128         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Added.
1129         (WebCore::getNamedItems): Returns RadioNodeList when there are multiple matches.
1130         (WebCore::JSHTMLFormControlsCollection::canGetItemsForName):
1131         (WebCore::JSHTMLFormControlsCollection::nameGetter):
1132         (WebCore::JSHTMLFormControlsCollection::namedItem):
1133         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1134         (WebCore::getNamedItems): Returns a static NodeList when there are multiple matches.
1135         This is a bug. It should be a live NodeList instead.
1136         (WebCore::JSHTMLOptionsCollection::canGetItemsForName):
1137         (WebCore::JSHTMLOptionsCollection::nameGetter):
1138         (WebCore::JSHTMLOptionsCollection::namedItem):
1139         * bindings/js/CodeGeneratorJS.pm: Include JSNode.js for all HTML*Collection interfaces for simplicity.
1140         * bindings/js/CodeGeneratorV8.pm: HTMLOptionsCollection now inherits from HTMLCollection. See
1141         http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmloptionscollection
1142         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp: Pass in isolate when we can.
1143         (WebCore::getNamedItems): Added a comment about how we should be returning
1144         a HTMLCollection when there are multiple matches.
1145         (WebCore::getItem):
1146         (WebCore::V8HTMLAllCollection::namedPropertyGetter):
1147         (WebCore::V8HTMLAllCollection::namedItemCallback):
1148         * bindings/v8/custom/V8HTMLCollectionCustom.cpp: Now returns exactly one node or null.
1149         (WebCore::V8HTMLCollection::namedPropertyGetter):
1150         (WebCore::toV8):
1151         * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp: Added.
1152         (WebCore::getNamedItems): Returns RadioNodeList when there are multiple matches.
1153         (WebCore::V8HTMLFormControlsCollection::namedPropertyGetter):
1154         (WebCore::V8HTMLFormControlsCollection::namedItemCallback):
1155         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
1156         (WebCore::getNamedItems): Returns a static NodeList when there are multiple matches.
1157         This is a bug. It should be a live NodeList instead.
1158         (WebCore::V8HTMLOptionsCollection::namedPropertyGetter):
1159         (WebCore::V8HTMLOptionsCollection::namedItemCallback):
1160         * dom/Document.cpp: Removed Document::objects since it was not used anywhere.
1161         * dom/Document.h:
1162         (Document):
1163         * dom/Element.cpp:
1164         (WebCore::ElementRareData::ensureCachedHTMLCollection): form.elements should instantiate
1165         a HTMLFormControlsCollection instead of a HTMLCollection.
1166         * html/CollectionType.h:
1167         * html/HTMLCollection.idl: Removed [Custom] since namedItem is a regular function call now.
1168         * html/HTMLFieldSetElement.cpp:
1169         * html/HTMLFieldSetElement.h:
1170         * html/HTMLFormCollection.cpp: Removed.
1171         * html/HTMLFormCollection.h: Removed.
1172         * html/HTMLFormControlsCollection.cpp: Copied from Source/WebCore/html/HTMLFormCollection.cpp.
1173         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
1174         (WebCore::HTMLFormControlsCollection::create):
1175         (WebCore::HTMLFormControlsCollection::~HTMLFormControlsCollection):
1176         (WebCore::HTMLFormControlsCollection::formControlElements):
1177         (WebCore::HTMLFormControlsCollection::formImageElements):
1178         (WebCore::HTMLFormControlsCollection::virtualItemAfter):
1179         (WebCore::HTMLFormControlsCollection::namedItem):
1180         (WebCore::HTMLFormControlsCollection::updateNameCache):
1181         * html/HTMLFormControlsCollection.h: Copied from Source/WebCore/html/HTMLFormCollection.h.
1182         (HTMLFormControlsCollection):
1183         * html/HTMLFormControlsCollection.idl: Added.
1184         * html/HTMLFormElement.cpp:
1185         * html/HTMLFormElement.h:
1186         * html/HTMLOptionsCollection.idl:
1187
1188 2012-11-18  Kentaro Hara  <haraken@chromium.org>
1189
1190         [V8] Rename $className to $v8InterfaceName
1191         https://bugs.webkit.org/show_bug.cgi?id=102487
1192
1193         Reviewed by Adam Barth.
1194
1195         In CodeGeneratorV8.pm, $className is always "V8$interfaceName".
1196         We should rename $className to $v8InterfaceName. Also we can
1197         remove GetCallbackClassName().
1198
1199         No tests. No change in behavior.
1200
1201         * bindings/scripts/CodeGeneratorV8.pm:
1202         (GenerateHeader):
1203         (GetHeaderClassInclude):
1204         (GenerateDomainSafeFunctionGetter):
1205         (GenerateDomainSafeFunctionSetter):
1206         (GenerateParametersCheck):
1207         (GenerateImplementation):
1208         (GenerateHeaderContentHeader):
1209         (GenerateImplementationContentHeader):
1210         (GenerateCallbackHeader):
1211         (GenerateCallbackImplementation):
1212         (GenerateToV8Converters):
1213         (GetPassRefPtrType):
1214
1215 2012-11-18  Kentaro Hara  <haraken@chromium.org>
1216
1217         [V8] Remove GetTypeFromSignature() from CodeGeneratorV8.pm
1218         https://bugs.webkit.org/show_bug.cgi?id=102499
1219
1220         Reviewed by Adam Barth.
1221
1222         No tests. No change in behavior.
1223
1224         * bindings/scripts/CodeGeneratorV8.pm:
1225         (GenerateNormalAttrGetter):
1226         (GenerateNormalAttrSetter):
1227         (GenerateParametersCheckExpression):
1228         (GenerateParametersCheck):
1229         (GenerateFunctionCallString):
1230         (GetNativeTypeFromSignature):
1231         (TranslateParameter):
1232         (TypeCanFailConversion):
1233         (JSValueToNative):
1234         (NativeToJSValue):
1235
1236 2012-11-18  Kentaro Hara  <haraken@chromium.org>
1237
1238         Remove GenerateModule() from all code generators
1239         https://bugs.webkit.org/show_bug.cgi?id=102490
1240
1241         Reviewed by Adam Barth.
1242
1243         WebKit IDL files no longer support modules. The Web IDL spec
1244         no longer supports modules. We can remove it from code generators.
1245
1246         No tests. No change in behavior.
1247
1248         * bindings/scripts/CodeGenerator.pm:
1249         (ProcessDocument):
1250         * bindings/scripts/CodeGeneratorCPP.pm:
1251         * bindings/scripts/CodeGeneratorGObject.pm:
1252         * bindings/scripts/CodeGeneratorJS.pm:
1253         * bindings/scripts/CodeGeneratorObjC.pm:
1254         * bindings/scripts/CodeGeneratorV8.pm:
1255
1256 2012-11-18  Kentaro Hara  <haraken@chromium.org>
1257
1258         [V8] Get rid of unused functions and inline redundant functions in CodeGeneratorV8.pm
1259         https://bugs.webkit.org/show_bug.cgi?id=102497
1260
1261         Reviewed by Adam Barth.
1262
1263         No tests. No change in behavior.
1264
1265         * bindings/scripts/CodeGeneratorV8.pm:
1266         (GenerateDomainSafeFunctionGetter):
1267         (GenerateNormalAttrGetter):
1268         (GenerateFunctionCallString):
1269
1270 2012-11-18  Sheriff Bot  <webkit.review.bot@gmail.com>
1271
1272         Unreviewed, rolling out r135074.
1273         http://trac.webkit.org/changeset/135074
1274         https://bugs.webkit.org/show_bug.cgi?id=102619
1275
1276         Made most layout tests crash. (Requested by rakuco on
1277         #webkit).
1278
1279         * PlatformEfl.cmake:
1280         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1281         (WebCore::GraphicsContext3D::create):
1282         (WebCore::GraphicsContext3D::GraphicsContext3D):
1283         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1284         (WebCore::GraphicsContext3D::makeContextCurrent):
1285         (WebCore::GraphicsContext3D::setContextLostCallback):
1286         * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
1287         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
1288         (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
1289         (WebCore::GraphicsContext3DPrivate::createSurface):
1290         (WebCore::GraphicsContext3DPrivate::setCurrentGLContext):
1291         (WebCore::GraphicsContext3DPrivate::platformGraphicsContext3D):
1292         (WebCore::GraphicsContext3DPrivate::makeContextCurrent):
1293         (WebCore::GraphicsContext3DPrivate::createGraphicsSurfaces):
1294         (WebCore::GraphicsContext3DPrivate::copyToGraphicsSurface):
1295         (WebCore::GraphicsContext3DPrivate::graphicsSurfaceToken):
1296         * platform/graphics/efl/GraphicsContext3DPrivate.h:
1297         (GraphicsContext3DPrivate):
1298         * platform/graphics/opengl/GLDefs.h: Removed.
1299         * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
1300         * platform/graphics/opengl/GLPlatformContext.h: Removed.
1301         * platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
1302         * platform/graphics/opengl/GLPlatformSurface.h: Removed.
1303         * platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
1304         * platform/graphics/surfaces/glx/GLXContext.h: Removed.
1305         * platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
1306         * platform/graphics/surfaces/glx/GLXSurface.h: Removed.
1307
1308 2012-11-18  Antti Koivisto  <antti@apple.com>
1309
1310         REGRESSION(r129644): User StyleSheet not applying
1311         https://bugs.webkit.org/show_bug.cgi?id=102110
1312
1313         Reviewed by Andreas Kling.
1314
1315         Injected stylesheets added as UserStyleAuthorLevel fail to apply. r129644 implicitly assumed that
1316         such things don't exists but on Chromium addUserStyleSheet() confusingly uses them.
1317         
1318         The patch adds injected author stylesheets to DocumentStyleSheetCollection::activeStyleSheets().
1319         It also generally cleans up the code around injected and user stylesheets.
1320
1321         Tests: userscripts/user-script-and-stylesheet.html
1322                userscripts/user-stylesheet-invalidate.html
1323
1324         * css/StyleResolver.cpp:
1325         (WebCore::StyleResolver::StyleResolver):
1326         (WebCore::StyleResolver::collectRulesFromUserStyleSheets):
1327         (WebCore::collectCSSOMWrappers):
1328         * css/StyleResolver.h:
1329         (StyleResolver):
1330         * dom/Document.cpp:
1331         (WebCore::Document::setCompatibilityMode):
1332         * dom/DocumentStyleSheetCollection.cpp:
1333         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
1334         (WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
1335         (WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets):
1336         (WebCore):
1337         (WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets):
1338         (WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache):
1339         (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache):
1340         (WebCore::DocumentStyleSheetCollection::addUserSheet):
1341         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
1342         (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
1343         * dom/DocumentStyleSheetCollection.h:
1344         (WebCore::DocumentStyleSheetCollection::documentUserStyleSheets):
1345         (DocumentStyleSheetCollection):
1346         * page/PageGroup.cpp:
1347         (WebCore::PageGroup::addUserStyleSheetToWorld):
1348         (WebCore::PageGroup::removeUserStyleSheetFromWorld):
1349         (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
1350         (WebCore::PageGroup::removeAllUserContent):
1351         (WebCore::PageGroup::invalidatedInjectedStyleSheetCacheInAllFrames):
1352         * page/PageGroup.h:
1353         (PageGroup):
1354
1355 2012-11-18  Adam Barth  <abarth@webkit.org>
1356
1357         Unreviewed.
1358
1359         Update run-bindings-tests baselines after
1360         http://trac.webkit.org/changeset/135063
1361
1362         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1363         (JSTestActiveDOMObjectOwner):
1364         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1365         (JSTestCustomNamedGetterOwner):
1366         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1367         (JSTestEventConstructorOwner):
1368         * bindings/scripts/test/JS/JSTestEventTarget.h:
1369         (JSTestEventTargetOwner):
1370         * bindings/scripts/test/JS/JSTestException.h:
1371         (JSTestExceptionOwner):
1372         * bindings/scripts/test/JS/JSTestInterface.h:
1373         (JSTestInterfaceOwner):
1374         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1375         (JSTestMediaQueryListListenerOwner):
1376         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1377         (JSTestNamedConstructorOwner):
1378         * bindings/scripts/test/JS/JSTestObj.h:
1379         (JSTestObjOwner):
1380         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1381         (JSTestOverloadedConstructorsOwner):
1382         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1383         (JSTestSerializedScriptValueInterfaceOwner):
1384
1385 2012-11-18  Simon Fraser  <simon.fraser@apple.com>
1386
1387         Make convertToLayerCoords iterative, rather than recursive
1388         https://bugs.webkit.org/show_bug.cgi?id=102618
1389
1390         Reviewed by Antti Koivisto.
1391
1392         RenderLayer::convertToLayerCoords() is a hot function on profiles.
1393         Change it to be iterative, rather than recursive, so that the
1394         bulk of the function can be inlined.
1395         
1396         Was tested with assertions against the old code during development.
1397
1398         * rendering/RenderLayer.cpp:
1399         (WebCore::accumulateOffsetTowardsAncestor):
1400         (WebCore::RenderLayer::convertToLayerCoords):
1401
1402 2012-11-18  Andreas Kling  <akling@apple.com>
1403
1404         Inline the StyledElement constructor.
1405         <http://webkit.org/b/102615>
1406
1407         Reviewed by Antti Koivisto.
1408
1409         StyledElement sits between Element and HTMLElement in the inheritance chain, and both of those are inline. 
1410         Knocks ~0.4% of samples off of the DOM/CreateNodes performance test.
1411
1412         * dom/StyledElement.cpp:
1413         * dom/StyledElement.h:
1414         (WebCore::StyledElement::StyledElement):
1415
1416 2012-11-18  Andreas Kling  <akling@apple.com>
1417
1418         HTMLMediaElement: Skip unnecessary attribute lookup in parsing of "src" attribute.
1419         <http://webkit.org/b/102614>
1420
1421         Reviewed by Anders Carlsson.
1422
1423         When parsing the "src" attribute, we don't need to look it up with fastHasAttribute()
1424         to know if it's present. If it's not present, 'value' argument will be null.
1425
1426         * html/HTMLMediaElement.cpp:
1427         (WebCore::HTMLMediaElement::parseAttribute):
1428
1429 2012-11-18  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1430
1431         [EFL] Refactor GraphicsContext3DEFL.
1432         https://bugs.webkit.org/show_bug.cgi?id=101291.
1433
1434         Reviewed by Kenneth Rohde Christiansen.
1435
1436         GraphicsContext3DEfl creates GraphicsContext3DPrivate, which acts as its platform Layer.
1437         GraphicsContext3DPrivate needs to handle the following cases:
1438         1) To provide an off-screen buffer for accelerated composition.
1439         2) Render to a current context.
1440         3) To render directly to host window. (currently not supported.)
1441
1442         Before this patch Evas was used to provide us an off-screen context and buffer. GLX was used in
1443         the other supported case. Evas acts as a glue layer to provide us with appropriate
1444         GL bindings (OpenGL functions), GL context and drawable (surface/offscreenbuffer).
1445         However, primitive rendering is handled by TextureMapper and OpenGLShims is used to load the needed GL functions.
1446
1447         It would be for our advantage to be able to take in to use any optimisations/extensions
1448         provided by underlying drivers, specific to a platform (e.g. GLX_MESA_copy_sub_buffer etc.).
1449         This patch introduces an abstraction layer to make it easy to add support for any GL backend (GLX, EGL etc.)
1450         and do any platform specific optimizations as needed without complicating GraphicsContext3DPrivate class.
1451         Two new classes are added with this implementation, GLPlatformContext and GLPlatformSurface.
1452         GraphicsContext3DPrivate would create and own a GLPlatformContext and GLPlatformSurface.
1453
1454         GLPlatformContext encapsulates an OpenGL context hiding any platform specific management.
1455         It uses GL extension ARB_robustness (when available) to detect driver resets.
1456         It defines a simple interface for things that need to be handled by the context. Support
1457         for multi-threaded usage and shared context-group would be added later.
1458
1459         GLPlatformSurface encapsulates an OpenGL drawable hiding any platform specific management.
1460         It defines a simple interface for things that need to be handled by the surface.
1461         It creates an off-screen rendering area. Any GLPlatformContext (compatible with the surface)
1462         can be used to render into this off-screen area.
1463
1464         This patch also adds GLX implementation. To keep the patch to minimum EGL support would be added in another changeset.
1465
1466         * PlatformEfl.cmake:
1467         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1468         (WebCore::GraphicsContext3D::create):
1469         (WebCore::GraphicsContext3D::GraphicsContext3D):
1470         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1471         (WebCore::GraphicsContext3D::makeContextCurrent):
1472         (WebCore::GraphicsContext3D::setContextLostCallback):
1473         * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
1474         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
1475         (GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
1476         (GraphicsContext3DPrivate::releaseResources):
1477         (GraphicsContext3DPrivate::setContextLostCallback):
1478         (GraphicsContext3DPrivate::platformGraphicsContext3D):
1479         (GraphicsContext3DPrivate::makeContextCurrent):
1480         (GraphicsContext3DPrivate::createGraphicsSurfaces):
1481         (GraphicsContext3DPrivate::copyToGraphicsSurface):
1482         (GraphicsContext3DPrivate::graphicsSurfaceToken):
1483         * platform/graphics/efl/GraphicsContext3DPrivate.h:
1484         (GraphicsContext3DPrivate):
1485         * platform/graphics/opengl/GLDefs.h: Added.
1486         (WebCore):
1487         * platform/graphics/opengl/GLPlatformContext.cpp: Added.
1488         (WebCore):
1489         (WebCore::GLPlatformContext::createContext):
1490         (WebCore::GLPlatformContext::createOffScreenContext):
1491         (WebCore::GLPlatformContext::createCurrentContextWrapper):
1492         (WebCore::GLPlatformContext::GLPlatformContext):
1493         (WebCore::GLPlatformContext::~GLPlatformContext):
1494         (WebCore::GLPlatformContext::makeCurrent):
1495         (WebCore::GLPlatformContext::isValid):
1496         (WebCore::GLPlatformContext::releaseCurrent):
1497         (WebCore::GLPlatformContext::handle):
1498         (WebCore::GLPlatformContext::isCurrentContext):
1499         (WebCore::GLPlatformContext::initialize):
1500         (WebCore::GLPlatformContext::getCurrent):
1501         (WebCore::GLPlatformContext::platformMakeCurrent):
1502         (WebCore::GLPlatformContext::platformReleaseCurrent):
1503         (WebCore::GLPlatformContext::destroy):
1504         * platform/graphics/opengl/GLPlatformContext.h: Added.
1505         (WebCore):
1506         (GLPlatformContext):
1507         * platform/graphics/opengl/GLPlatformSurface.cpp: Added.
1508         (WebCore):
1509         (WebCore::GLPlatformSurface::createOffscreenSurface):
1510         (WebCore::GLPlatformSurface::createTransportSurface):
1511         (WebCore::GLPlatformSurface::GLPlatformSurface):
1512         (WebCore::GLPlatformSurface::~GLPlatformSurface):
1513         (WebCore::GLPlatformSurface::handle):
1514         (WebCore::GLPlatformSurface::geometry):
1515         (WebCore::GLPlatformSurface::sharedDisplay):
1516         (WebCore::GLPlatformSurface::configuration):
1517         (WebCore::GLPlatformSurface::swapBuffers):
1518         (WebCore::GLPlatformSurface::copyTexture):
1519         (WebCore::GLPlatformSurface::updateContents):
1520         (WebCore::GLPlatformSurface::setGeometry):
1521         (WebCore::GLPlatformSurface::destroy):
1522         * platform/graphics/opengl/GLPlatformSurface.h: Added.
1523         (WebCore):
1524         (GLPlatformSurface):
1525             GLXOffScreenContext creates an off-screen context. This is used when
1526             renderstyle is RenderOffscreen.
1527             It uses GL extension GLX_ARB_create_context (when available)
1528             to create a context else falls back to use glXCreateNewContext.
1529         * platform/graphics/surfaces/glx/GLXContext.cpp: Added.
1530         (WebCore):
1531         (WebCore::initializeARBExtensions):
1532         (WebCore::GLXOffScreenContext::GLXOffScreenContext):
1533         (WebCore::GLXOffScreenContext::initialize):
1534         (WebCore::GLXOffScreenContext::~GLXOffScreenContext):
1535         (WebCore::GLXOffScreenContext::isCurrentContext):
1536         (WebCore::GLXOffScreenContext::platformMakeCurrent):
1537         (WebCore::GLXOffScreenContext::platformReleaseCurrent):
1538         (WebCore::GLXOffScreenContext::freeResources):
1539         (WebCore::GLXOffScreenContext::destroy):
1540             GLXCurrentContextWrapper acts as a wrapper for current context.
1541             This is used when renderstyle is RenderToCurrentGLContext.
1542         * platform/graphics/surfaces/glx/GLXContext.h: Added.
1543         (WebCore):
1544         (GLXCurrentContextWrapper):
1545         (WebCore::GLXCurrentContextWrapper::GLXCurrentContextWrapper):
1546         (WebCore::GLXCurrentContextWrapper::~GLXCurrentContextWrapper):
1547         (GLXOffScreenContext):
1548         * platform/graphics/surfaces/glx/GLXSurface.cpp: Added.
1549         (WebCore):
1550         (WebCore::GLXSurface::GLXSurface):
1551         (WebCore::GLXSurface::~GLXSurface):
1552         (WebCore::GLXSurface::visualInfo):
1553         (WebCore::GLXSurface::xWindow):
1554         (WebCore::GLXSurface::pBufferConfiguration):
1555         (WebCore::GLXSurface::transportSurfaceConfiguration):
1556         (WebCore::GLXSurface::isXRenderExtensionSupported):
1557             GLXTransportSurface creates Window and uses it as an off-screen surface.
1558             Any GLContext that was created with respect to configuration can be used
1559             to render into this.
1560             This is used when contents of the buffer are to be provided to UI Process
1561             for display.
1562         (WebCore::GLXTransportSurface::GLXTransportSurface):
1563         (WebCore::GLXTransportSurface::~GLXTransportSurface):
1564         (WebCore::GLXTransportSurface::configuration):
1565         (WebCore::GLXTransportSurface::swapBuffers):
1566         (WebCore::GLXTransportSurface::setGeometry):
1567         (WebCore::GLXTransportSurface::initialize):
1568         (WebCore::GLXTransportSurface::destroy):
1569         (WebCore::GLXTransportSurface::freeResources):
1570            GLXPBuffer, Creates a GL surface (PBuffer) used for offscreen rendering.
1571            Any GLContext that was created with respect to configuration can be used
1572            to render into this.
1573         (WebCore::GLXPBuffer::GLXPBuffer):
1574         (WebCore::GLXPBuffer::~GLXPBuffer):
1575         (WebCore::GLXPBuffer::initialize):
1576         (WebCore::GLXPBuffer::configuration):
1577         (WebCore::GLXPBuffer::destroy):
1578         (WebCore::GLXPBuffer::freeResources):
1579         * platform/graphics/surfaces/glx/GLXSurface.h: Added.
1580         (WebCore):
1581             Creates X resources which are shared between surface and context.
1582         (SharedX11Resources):
1583         (WebCore::SharedX11Resources::create):
1584         (WebCore::SharedX11Resources::deref):
1585         (WebCore::SharedX11Resources::getXWindow):
1586         (WebCore::SharedX11Resources::display):
1587         (WebCore::SharedX11Resources::visualInfo):
1588         (WebCore::SharedX11Resources::createConfig):
1589         (WebCore::SharedX11Resources::pBufferContextConfig):
1590         (WebCore::SharedX11Resources::surfaceContextConfig):
1591         (WebCore::SharedX11Resources::isXRenderExtensionSupported):
1592         (WebCore::SharedX11Resources::SharedX11Resources):
1593         (WebCore::SharedX11Resources::~SharedX11Resources):
1594         (GLXSurface):
1595         (GLXTransportSurface):
1596         (GLXPBuffer):
1597
1598 2012-11-18  Andreas Kling  <akling@apple.com>
1599
1600         Element::parseAttribute() should take name & value as separate arguments.
1601         <http://webkit.org/b/102608>
1602
1603         Reviewed by Antti Koivisto.
1604
1605         Update the signature of parseAttribute() to take a QualifiedName/AtomicString combo instead
1606         of an Attribute. This lets us pass avoid refcount churn in Element::attributeChanged() since
1607         creating a temporary Attribute is no longer necessary.
1608
1609         This was surprisingly hot (~1%) on the DOM/CreateNodes performance test.
1610
1611         * bindings/js/ScriptEventListener.cpp:
1612         (WebCore::createAttributeEventListener):
1613         * bindings/js/ScriptEventListener.h:
1614         (WebCore):
1615         * bindings/v8/ScriptEventListener.cpp:
1616         (WebCore::createAttributeEventListener):
1617         * bindings/v8/ScriptEventListener.h:
1618         (WebCore):
1619         * dom/Element.cpp:
1620         (WebCore::Element::attributeChanged):
1621         (WebCore::Element::parseAttribute):
1622         * dom/Element.h:
1623         (Element):
1624         * dom/StyledElement.cpp:
1625         (WebCore::StyledElement::parseAttribute):
1626         * dom/StyledElement.h:
1627         (StyledElement):
1628         * html/HTMLAnchorElement.cpp:
1629         (WebCore::HTMLAnchorElement::parseAttribute):
1630         * html/HTMLAnchorElement.h:
1631         (HTMLAnchorElement):
1632         * html/HTMLAppletElement.cpp:
1633         (WebCore::HTMLAppletElement::parseAttribute):
1634         * html/HTMLAppletElement.h:
1635         (HTMLAppletElement):
1636         * html/HTMLAreaElement.cpp:
1637         (WebCore::HTMLAreaElement::parseAttribute):
1638         * html/HTMLAreaElement.h:
1639         (HTMLAreaElement):
1640         * html/HTMLBaseElement.cpp:
1641         (WebCore::HTMLBaseElement::parseAttribute):
1642         * html/HTMLBaseElement.h:
1643         (HTMLBaseElement):
1644         * html/HTMLBodyElement.cpp:
1645         (WebCore::HTMLBodyElement::parseAttribute):
1646         * html/HTMLBodyElement.h:
1647         (HTMLBodyElement):
1648         * html/HTMLButtonElement.cpp:
1649         (WebCore::HTMLButtonElement::parseAttribute):
1650         * html/HTMLButtonElement.h:
1651         * html/HTMLCanvasElement.cpp:
1652         (WebCore::HTMLCanvasElement::parseAttribute):
1653         * html/HTMLCanvasElement.h:
1654         (HTMLCanvasElement):
1655         * html/HTMLDetailsElement.cpp:
1656         (WebCore::HTMLDetailsElement::parseAttribute):
1657         * html/HTMLDetailsElement.h:
1658         (HTMLDetailsElement):
1659         * html/HTMLElement.cpp:
1660         (WebCore::HTMLElement::parseAttribute):
1661         (WebCore::HTMLElement::dirAttributeChanged):
1662         * html/HTMLElement.h:
1663         (HTMLElement):
1664         * html/HTMLEmbedElement.cpp:
1665         (WebCore::HTMLEmbedElement::parseAttribute):
1666         * html/HTMLEmbedElement.h:
1667         (HTMLEmbedElement):
1668         * html/HTMLFormControlElement.cpp:
1669         (WebCore::HTMLFormControlElement::parseAttribute):
1670         * html/HTMLFormControlElement.h:
1671         (HTMLFormControlElement):
1672         * html/HTMLFormElement.cpp:
1673         (WebCore::HTMLFormElement::parseAttribute):
1674         * html/HTMLFormElement.h:
1675         (HTMLFormElement):
1676         * html/HTMLFrameElement.cpp:
1677         (WebCore::HTMLFrameElement::parseAttribute):
1678         * html/HTMLFrameElement.h:
1679         (HTMLFrameElement):
1680         * html/HTMLFrameElementBase.cpp:
1681         (WebCore::HTMLFrameElementBase::parseAttribute):
1682         * html/HTMLFrameElementBase.h:
1683         (HTMLFrameElementBase):
1684         * html/HTMLFrameSetElement.cpp:
1685         (WebCore::HTMLFrameSetElement::parseAttribute):
1686         * html/HTMLFrameSetElement.h:
1687         (HTMLFrameSetElement):
1688         * html/HTMLIFrameElement.cpp:
1689         (WebCore::HTMLIFrameElement::parseAttribute):
1690         * html/HTMLIFrameElement.h:
1691         (HTMLIFrameElement):
1692         * html/HTMLImageElement.cpp:
1693         (WebCore::HTMLImageElement::parseAttribute):
1694         * html/HTMLImageElement.h:
1695         (HTMLImageElement):
1696         * html/HTMLInputElement.cpp:
1697         (WebCore::HTMLInputElement::parseAttribute):
1698         (WebCore::HTMLInputElement::parseMaxLengthAttribute):
1699         * html/HTMLInputElement.h:
1700         (HTMLInputElement):
1701         * html/HTMLKeygenElement.cpp:
1702         (WebCore::HTMLKeygenElement::parseAttribute):
1703         * html/HTMLKeygenElement.h:
1704         (HTMLKeygenElement):
1705         * html/HTMLLIElement.cpp:
1706         (WebCore::HTMLLIElement::parseAttribute):
1707         * html/HTMLLIElement.h:
1708         (HTMLLIElement):
1709         * html/HTMLLinkElement.cpp:
1710         (WebCore::HTMLLinkElement::parseAttribute):
1711         * html/HTMLLinkElement.h:
1712         (HTMLLinkElement):
1713         * html/HTMLMapElement.cpp:
1714         (WebCore::HTMLMapElement::parseAttribute):
1715         * html/HTMLMapElement.h:
1716         (HTMLMapElement):
1717         * html/HTMLMediaElement.cpp:
1718         (WebCore::HTMLMediaElement::parseAttribute):
1719         * html/HTMLMediaElement.h:
1720         * html/HTMLMetaElement.cpp:
1721         (WebCore::HTMLMetaElement::parseAttribute):
1722         * html/HTMLMetaElement.h:
1723         (HTMLMetaElement):
1724         * html/HTMLMeterElement.cpp:
1725         (WebCore::HTMLMeterElement::parseAttribute):
1726         * html/HTMLMeterElement.h:
1727         (HTMLMeterElement):
1728         * html/HTMLOListElement.cpp:
1729         (WebCore::HTMLOListElement::parseAttribute):
1730         * html/HTMLOListElement.h:
1731         (HTMLOListElement):
1732         * html/HTMLObjectElement.cpp:
1733         (WebCore::HTMLObjectElement::parseAttribute):
1734         * html/HTMLObjectElement.h:
1735         (HTMLObjectElement):
1736         * html/HTMLOptGroupElement.cpp:
1737         (WebCore::HTMLOptGroupElement::parseAttribute):
1738         * html/HTMLOptGroupElement.h:
1739         * html/HTMLOptionElement.cpp:
1740         (WebCore::HTMLOptionElement::parseAttribute):
1741         * html/HTMLOptionElement.h:
1742         (HTMLOptionElement):
1743         * html/HTMLOutputElement.cpp:
1744         (WebCore::HTMLOutputElement::parseAttribute):
1745         * html/HTMLOutputElement.h:
1746         (HTMLOutputElement):
1747         * html/HTMLProgressElement.cpp:
1748         (WebCore::HTMLProgressElement::parseAttribute):
1749         * html/HTMLProgressElement.h:
1750         * html/HTMLScriptElement.cpp:
1751         (WebCore::HTMLScriptElement::parseAttribute):
1752         * html/HTMLScriptElement.h:
1753         (HTMLScriptElement):
1754         * html/HTMLSelectElement.cpp:
1755         (WebCore::HTMLSelectElement::parseAttribute):
1756         (WebCore::HTMLSelectElement::parseMultipleAttribute):
1757         * html/HTMLSelectElement.h:
1758         * html/HTMLStyleElement.cpp:
1759         (WebCore::HTMLStyleElement::parseAttribute):
1760         * html/HTMLStyleElement.h:
1761         (HTMLStyleElement):
1762         * html/HTMLTableCellElement.cpp:
1763         (WebCore::HTMLTableCellElement::parseAttribute):
1764         * html/HTMLTableCellElement.h:
1765         (HTMLTableCellElement):
1766         * html/HTMLTableColElement.cpp:
1767         (WebCore::HTMLTableColElement::parseAttribute):
1768         * html/HTMLTableColElement.h:
1769         (HTMLTableColElement):
1770         * html/HTMLTableElement.cpp:
1771         (WebCore::HTMLTableElement::parseAttribute):
1772         * html/HTMLTableElement.h:
1773         (HTMLTableElement):
1774         * html/HTMLTextAreaElement.cpp:
1775         (WebCore::HTMLTextAreaElement::parseAttribute):
1776         * html/HTMLTextAreaElement.h:
1777         (HTMLTextAreaElement):
1778         * html/HTMLTextFormControlElement.cpp:
1779         (WebCore::HTMLTextFormControlElement::parseAttribute):
1780         * html/HTMLTextFormControlElement.h:
1781         (HTMLTextFormControlElement):
1782         * html/HTMLTrackElement.cpp:
1783         (WebCore::HTMLTrackElement::parseAttribute):
1784         * html/HTMLTrackElement.h:
1785         (HTMLTrackElement):
1786         * html/HTMLVideoElement.cpp:
1787         (WebCore::HTMLVideoElement::parseAttribute):
1788         * html/HTMLVideoElement.h:
1789         (HTMLVideoElement):
1790         * html/shadow/HTMLContentElement.cpp:
1791         (WebCore::HTMLContentElement::parseAttribute):
1792         * html/shadow/HTMLContentElement.h:
1793         (HTMLContentElement):
1794         * mathml/MathMLElement.cpp:
1795         (WebCore::MathMLElement::parseAttribute):
1796         * mathml/MathMLElement.h:
1797         (MathMLElement):
1798         * svg/SVGAElement.cpp:
1799         (WebCore::SVGAElement::parseAttribute):
1800         * svg/SVGAElement.h:
1801         (SVGAElement):
1802         * svg/SVGAnimateMotionElement.cpp:
1803         (WebCore::SVGAnimateMotionElement::parseAttribute):
1804         * svg/SVGAnimateMotionElement.h:
1805         (SVGAnimateMotionElement):
1806         * svg/SVGAnimateTransformElement.cpp:
1807         (WebCore::SVGAnimateTransformElement::parseAttribute):
1808         * svg/SVGAnimateTransformElement.h:
1809         (SVGAnimateTransformElement):
1810         * svg/SVGAnimationElement.cpp:
1811         (WebCore::SVGAnimationElement::parseAttribute):
1812         * svg/SVGAnimationElement.h:
1813         (SVGAnimationElement):
1814         * svg/SVGCircleElement.cpp:
1815         (WebCore::SVGCircleElement::parseAttribute):
1816         * svg/SVGCircleElement.h:
1817         (SVGCircleElement):
1818         * svg/SVGClipPathElement.cpp:
1819         (WebCore::SVGClipPathElement::parseAttribute):
1820         * svg/SVGClipPathElement.h:
1821         (SVGClipPathElement):
1822         * svg/SVGComponentTransferFunctionElement.cpp:
1823         (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
1824         * svg/SVGComponentTransferFunctionElement.h:
1825         (SVGComponentTransferFunctionElement):
1826         * svg/SVGCursorElement.cpp:
1827         (WebCore::SVGCursorElement::parseAttribute):
1828         * svg/SVGCursorElement.h:
1829         (SVGCursorElement):
1830         * svg/SVGElement.cpp:
1831         (WebCore::SVGElement::reportAttributeParsingError):
1832         (WebCore::SVGElement::parseAttribute):
1833         * svg/SVGElement.h:
1834         (SVGElement):
1835         * svg/SVGEllipseElement.cpp:
1836         (WebCore::SVGEllipseElement::parseAttribute):
1837         * svg/SVGEllipseElement.h:
1838         (SVGEllipseElement):
1839         * svg/SVGExternalResourcesRequired.cpp:
1840         (WebCore::SVGExternalResourcesRequired::parseAttribute):
1841         * svg/SVGExternalResourcesRequired.h:
1842         (SVGExternalResourcesRequired):
1843         * svg/SVGFEBlendElement.cpp:
1844         (WebCore::SVGFEBlendElement::parseAttribute):
1845         * svg/SVGFEBlendElement.h:
1846         (SVGFEBlendElement):
1847         * svg/SVGFEColorMatrixElement.cpp:
1848         (WebCore::SVGFEColorMatrixElement::parseAttribute):
1849         * svg/SVGFEColorMatrixElement.h:
1850         (SVGFEColorMatrixElement):
1851         * svg/SVGFEComponentTransferElement.cpp:
1852         (WebCore::SVGFEComponentTransferElement::parseAttribute):
1853         * svg/SVGFEComponentTransferElement.h:
1854         (SVGFEComponentTransferElement):
1855         * svg/SVGFECompositeElement.cpp:
1856         (WebCore::SVGFECompositeElement::parseAttribute):
1857         * svg/SVGFECompositeElement.h:
1858         (SVGFECompositeElement):
1859         * svg/SVGFEConvolveMatrixElement.cpp:
1860         (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
1861         * svg/SVGFEConvolveMatrixElement.h:
1862         (SVGFEConvolveMatrixElement):
1863         * svg/SVGFEDiffuseLightingElement.cpp:
1864         (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
1865         * svg/SVGFEDiffuseLightingElement.h:
1866         (SVGFEDiffuseLightingElement):
1867         * svg/SVGFEDisplacementMapElement.cpp:
1868         (WebCore::SVGFEDisplacementMapElement::parseAttribute):
1869         * svg/SVGFEDisplacementMapElement.h:
1870         (SVGFEDisplacementMapElement):
1871         * svg/SVGFEDropShadowElement.cpp:
1872         (WebCore::SVGFEDropShadowElement::parseAttribute):
1873         * svg/SVGFEDropShadowElement.h:
1874         (SVGFEDropShadowElement):
1875         * svg/SVGFEGaussianBlurElement.cpp:
1876         (WebCore::SVGFEGaussianBlurElement::parseAttribute):
1877         * svg/SVGFEGaussianBlurElement.h:
1878         (SVGFEGaussianBlurElement):
1879         * svg/SVGFEImageElement.cpp:
1880         (WebCore::SVGFEImageElement::parseAttribute):
1881         * svg/SVGFEImageElement.h:
1882         (SVGFEImageElement):
1883         * svg/SVGFELightElement.cpp:
1884         (WebCore::SVGFELightElement::parseAttribute):
1885         * svg/SVGFELightElement.h:
1886         (SVGFELightElement):
1887         * svg/SVGFEMergeNodeElement.cpp:
1888         (WebCore::SVGFEMergeNodeElement::parseAttribute):
1889         * svg/SVGFEMergeNodeElement.h:
1890         (SVGFEMergeNodeElement):
1891         * svg/SVGFEMorphologyElement.cpp:
1892         (WebCore::SVGFEMorphologyElement::parseAttribute):
1893         * svg/SVGFEMorphologyElement.h:
1894         (SVGFEMorphologyElement):
1895         * svg/SVGFEOffsetElement.cpp:
1896         (WebCore::SVGFEOffsetElement::parseAttribute):
1897         * svg/SVGFEOffsetElement.h:
1898         (SVGFEOffsetElement):
1899         * svg/SVGFESpecularLightingElement.cpp:
1900         (WebCore::SVGFESpecularLightingElement::parseAttribute):
1901         * svg/SVGFESpecularLightingElement.h:
1902         (SVGFESpecularLightingElement):
1903         * svg/SVGFETileElement.cpp:
1904         (WebCore::SVGFETileElement::parseAttribute):
1905         * svg/SVGFETileElement.h:
1906         (SVGFETileElement):
1907         * svg/SVGFETurbulenceElement.cpp:
1908         (WebCore::SVGFETurbulenceElement::parseAttribute):
1909         * svg/SVGFETurbulenceElement.h:
1910         (SVGFETurbulenceElement):
1911         * svg/SVGFilterElement.cpp:
1912         (WebCore::SVGFilterElement::parseAttribute):
1913         * svg/SVGFilterElement.h:
1914         (SVGFilterElement):
1915         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1916         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1917         * svg/SVGFilterPrimitiveStandardAttributes.h:
1918         (SVGFilterPrimitiveStandardAttributes):
1919         * svg/SVGFitToViewBox.h:
1920         (WebCore::SVGFitToViewBox::parseAttribute):
1921         * svg/SVGFontFaceElement.cpp:
1922         (WebCore::SVGFontFaceElement::parseAttribute):
1923         * svg/SVGFontFaceElement.h:
1924         (SVGFontFaceElement):
1925         * svg/SVGFontFaceUriElement.cpp:
1926         (WebCore::SVGFontFaceUriElement::parseAttribute):
1927         * svg/SVGFontFaceUriElement.h:
1928         (SVGFontFaceUriElement):
1929         * svg/SVGForeignObjectElement.cpp:
1930         (WebCore::SVGForeignObjectElement::parseAttribute):
1931         * svg/SVGForeignObjectElement.h:
1932         (SVGForeignObjectElement):
1933         * svg/SVGGElement.cpp:
1934         (WebCore::SVGGElement::parseAttribute):
1935         * svg/SVGGElement.h:
1936         (SVGGElement):
1937         * svg/SVGGlyphElement.cpp:
1938         (WebCore::SVGGlyphElement::parseAttribute):
1939         * svg/SVGGlyphElement.h:
1940         (SVGGlyphElement):
1941         * svg/SVGGlyphRefElement.cpp:
1942         (WebCore::SVGGlyphRefElement::parseAttribute):
1943         * svg/SVGGlyphRefElement.h:
1944         * svg/SVGGradientElement.cpp:
1945         (WebCore::SVGGradientElement::parseAttribute):
1946         * svg/SVGGradientElement.h:
1947         * svg/SVGImageElement.cpp:
1948         (WebCore::SVGImageElement::parseAttribute):
1949         * svg/SVGImageElement.h:
1950         (SVGImageElement):
1951         * svg/SVGLangSpace.cpp:
1952         (WebCore::SVGLangSpace::parseAttribute):
1953         * svg/SVGLangSpace.h:
1954         (SVGLangSpace):
1955         * svg/SVGLineElement.cpp:
1956         (WebCore::SVGLineElement::parseAttribute):
1957         * svg/SVGLineElement.h:
1958         (SVGLineElement):
1959         * svg/SVGLinearGradientElement.cpp:
1960         (WebCore::SVGLinearGradientElement::parseAttribute):
1961         * svg/SVGLinearGradientElement.h:
1962         (SVGLinearGradientElement):
1963         * svg/SVGMPathElement.cpp:
1964         (WebCore::SVGMPathElement::parseAttribute):
1965         * svg/SVGMPathElement.h:
1966         (SVGMPathElement):
1967         * svg/SVGMarkerElement.cpp:
1968         (WebCore::SVGMarkerElement::parseAttribute):
1969         * svg/SVGMarkerElement.h:
1970         (SVGMarkerElement):
1971         * svg/SVGMaskElement.cpp:
1972         (WebCore::SVGMaskElement::parseAttribute):
1973         * svg/SVGMaskElement.h:
1974         (SVGMaskElement):
1975         * svg/SVGPathElement.cpp:
1976         (WebCore::SVGPathElement::parseAttribute):
1977         * svg/SVGPathElement.h:
1978         (SVGPathElement):
1979         * svg/SVGPatternElement.cpp:
1980         (WebCore::SVGPatternElement::parseAttribute):
1981         * svg/SVGPatternElement.h:
1982         (SVGPatternElement):
1983         * svg/SVGPolyElement.cpp:
1984         (WebCore::SVGPolyElement::parseAttribute):
1985         * svg/SVGPolyElement.h:
1986         (SVGPolyElement):
1987         * svg/SVGRadialGradientElement.cpp:
1988         (WebCore::SVGRadialGradientElement::parseAttribute):
1989         * svg/SVGRadialGradientElement.h:
1990         (SVGRadialGradientElement):
1991         * svg/SVGRectElement.cpp:
1992         (WebCore::SVGRectElement::parseAttribute):
1993         * svg/SVGRectElement.h:
1994         (SVGRectElement):
1995         * svg/SVGSVGElement.cpp:
1996         (WebCore::SVGSVGElement::parseAttribute):
1997         * svg/SVGSVGElement.h:
1998         (SVGSVGElement):
1999         * svg/SVGScriptElement.cpp:
2000         (WebCore::SVGScriptElement::parseAttribute):
2001         * svg/SVGScriptElement.h:
2002         (SVGScriptElement):
2003         * svg/SVGStopElement.cpp:
2004         (WebCore::SVGStopElement::parseAttribute):
2005         * svg/SVGStopElement.h:
2006         (SVGStopElement):
2007         * svg/SVGStyleElement.cpp:
2008         (WebCore::SVGStyleElement::parseAttribute):
2009         * svg/SVGStyleElement.h:
2010         (SVGStyleElement):
2011         * svg/SVGStyledElement.cpp:
2012         (WebCore::SVGStyledElement::parseAttribute):
2013         * svg/SVGStyledElement.h:
2014         (SVGStyledElement):
2015         * svg/SVGStyledTransformableElement.cpp:
2016         (WebCore::SVGStyledTransformableElement::parseAttribute):
2017         * svg/SVGStyledTransformableElement.h:
2018         (SVGStyledTransformableElement):
2019         * svg/SVGSymbolElement.cpp:
2020         (WebCore::SVGSymbolElement::parseAttribute):
2021         * svg/SVGSymbolElement.h:
2022         (SVGSymbolElement):
2023         * svg/SVGTRefElement.cpp:
2024         (WebCore::SVGTRefElement::parseAttribute):
2025         * svg/SVGTRefElement.h:
2026         (SVGTRefElement):
2027         * svg/SVGTests.cpp:
2028         (WebCore::SVGTests::parseAttribute):
2029         * svg/SVGTests.h:
2030         (SVGTests):
2031         * svg/SVGTextContentElement.cpp:
2032         (WebCore::SVGTextContentElement::parseAttribute):
2033         * svg/SVGTextContentElement.h:
2034         (SVGTextContentElement):
2035         * svg/SVGTextElement.cpp:
2036         (WebCore::SVGTextElement::parseAttribute):
2037         * svg/SVGTextElement.h:
2038         (SVGTextElement):
2039         * svg/SVGTextPathElement.cpp:
2040         (WebCore::SVGTextPathElement::parseAttribute):
2041         * svg/SVGTextPathElement.h:
2042         * svg/SVGTextPositioningElement.cpp:
2043         (WebCore::SVGTextPositioningElement::parseAttribute):
2044         * svg/SVGTextPositioningElement.h:
2045         (SVGTextPositioningElement):
2046         * svg/SVGURIReference.cpp:
2047         (WebCore::SVGURIReference::parseAttribute):
2048         * svg/SVGURIReference.h:
2049         (SVGURIReference):
2050         * svg/SVGUseElement.cpp:
2051         (WebCore::SVGUseElement::parseAttribute):
2052         * svg/SVGUseElement.h:
2053         (SVGUseElement):
2054         * svg/SVGViewElement.cpp:
2055         (WebCore::SVGViewElement::parseAttribute):
2056         * svg/SVGViewElement.h:
2057         (SVGViewElement):
2058         * svg/SVGZoomAndPan.h:
2059         (WebCore::SVGZoomAndPan::parseAttribute):
2060         * svg/animation/SVGSMILElement.cpp:
2061         (WebCore::SVGSMILElement::parseAttribute):
2062         * svg/animation/SVGSMILElement.h:
2063         (SVGSMILElement):
2064
2065 2012-11-18  Andreas Kling  <akling@apple.com>
2066
2067         StyleResolver: No need to compare "cellpadding" attributes when evaluating style sharing candidates.
2068         <http://webkit.org/b/102596>
2069
2070         Reviewed by Antti Koivisto.
2071
2072         Differences in the cellpadding attribute is caught by comparing additionalPresentationAttributeStyle()
2073         later on in canShareStyleWithElement() and we shouldn't waste time on comparing them.
2074
2075         * css/StyleResolver.cpp:
2076         (WebCore::haveIdenticalStyleAffectingAttributes):
2077
2078 2012-11-17  Jon Lee  <jonlee@apple.com>
2079
2080         Simulated mouse events should return an accurate offset
2081         https://bugs.webkit.org/show_bug.cgi?id=102606
2082         <rdar://problem/12725627>
2083
2084         Reviewed by Brady Eidson.
2085
2086         A check to see if the event is simulated prior to calculating the offset has existed for a
2087         long time (since at least r14916). Back then the check was needed because the offset was
2088         incrementally adjusted when the target was assigned (through
2089         MouseRelatedEvent::receivedTarget()).
2090
2091         Since r82225, we started calculating the offset only when needed, and calculating the offset
2092         from scratch rather than incrementally adjusting it. Since we recalculate from scratch,
2093         the isSimulated check is irrelevant, and we should remove it.
2094
2095         Tests are not possible because all uses of simulated mouse events provide no underlying
2096         event, so the offset is never recalculated.
2097
2098         * dom/MouseRelatedEvent.cpp:
2099         (WebCore::MouseRelatedEvent::computeRelativePosition): Remove the m_isSimulated check.
2100
2101 2012-11-17  Simon Fraser  <simon.fraser@apple.com>
2102
2103         Don't say there are dirty overlay scrollbars when they are clipped out
2104         https://bugs.webkit.org/show_bug.cgi?id=102609
2105
2106         Reviewed by Brady Eidson.
2107
2108         Painting overlay scrollbars involves a second painting pass over the entire
2109         RenderLayer subtree for a compositing layer, which can be very expensive.
2110         
2111         Avoid this when possible by detecting when overflow controls are not in
2112         the damage rect.
2113
2114         * rendering/RenderLayer.cpp:
2115         (WebCore::RenderLayer::rectForHorizontalScrollbar): Compute a local rect
2116         for the horizontal scrollbar.
2117         (WebCore::RenderLayer::rectForVerticalScrollbar): Compute a local rect
2118         for the vertical scrollbar.
2119         (WebCore::RenderLayer::positionOverflowControls): Use rectForHorizontalScrollbar()
2120         and rectForVerticalScrollbar().
2121         (WebCore::RenderLayer::overflowControlsIntersectRect): Return true if any
2122         of the present overflow controls intersect the given local rect.
2123         (WebCore::RenderLayer::paintOverflowControls): Bail if the damage rect
2124         doesn't intersect any of the overflow controls.
2125         * rendering/RenderLayer.h:
2126         (RenderLayer):
2127
2128 2012-11-17  Adam Barth  <abarth@webkit.org>
2129
2130         REGRESSION (r133633): ASSERTION FAILED: m_wrapper || !m_jsFunction
2131         https://bugs.webkit.org/show_bug.cgi?id=101428
2132
2133         Reviewed by Geoffrey Garen.
2134
2135         JSNodeOwner has some smarts that wrappers of subclasses of Node need to
2136         call during garbage collection. This patch teaches subclasses of Node
2137         to have their JSMumbleOwner objects inherit from JSNodeOwner.
2138
2139         The immediate benefit of this patch is that we correctly avoid
2140         collecting wrappers for HTMLAudioElements when they are reachable from
2141         the DOM.
2142
2143         * bindings/scripts/CodeGeneratorJS.pm:
2144         (GenerateHeader):
2145         (GenerateImplementation):
2146
2147 2012-11-17  Elliott Sprehn  <esprehn@chromium.org>
2148
2149         Expose JSObject::removeDirect and PrivateName to WebCore
2150         https://bugs.webkit.org/show_bug.cgi?id=102546
2151
2152         Reviewed by Geoffrey Garen.
2153
2154         Add forwarding header for PrivateName, so JSDependentRetained works.
2155
2156         No new tests, just adding headers.
2157
2158         * ForwardingHeaders/runtime/PrivateName.h: Added.
2159
2160 2012-11-17  Simon Fraser  <simon.fraser@apple.com>
2161
2162         Reduce the crazy number of parameters to RenderLayer clip-rect functions
2163         https://bugs.webkit.org/show_bug.cgi?id=102604
2164
2165         Reviewed by Dan Bernstein.
2166
2167         Many of the RenderLayer member functions related to clip rect computation
2168         took a long list of similar parameters. Gather these into a struct, ClipRectsContext,
2169         that we pass to these functions
2170         
2171         No functional changes.
2172
2173         * rendering/RenderLayer.cpp:
2174         (WebCore::RenderLayer::paintLayer):
2175         (WebCore::RenderLayer::paintLayerContents):
2176         (WebCore::RenderLayer::hitTestLayer):
2177         (WebCore::RenderLayer::updateClipRects):
2178         (WebCore::RenderLayer::calculateClipRects):
2179         (WebCore::RenderLayer::parentClipRects):
2180         (WebCore::RenderLayer::backgroundClipRect):
2181         (WebCore::RenderLayer::calculateRects):
2182         (WebCore::RenderLayer::childrenClipRect):
2183         (WebCore::RenderLayer::selfClipRect):
2184         (WebCore::RenderLayer::localClipRect):
2185         * rendering/RenderLayer.h:
2186         (WebCore::RenderLayer::ClipRectsContext::ClipRectsContext):
2187         (ClipRectsContext):
2188         (RenderLayer):
2189         (WebCore::RenderLayer::clipRects):
2190         * rendering/RenderLayerBacking.cpp:
2191         (WebCore::RenderLayerBacking::updateCompositedBounds):
2192         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
2193         * rendering/RenderLayerCompositor.cpp:
2194         (WebCore::RenderLayerCompositor::addToOverlapMap):
2195         (WebCore::RenderLayerCompositor::clippedByAncestor):
2196         * rendering/RenderTreeAsText.cpp:
2197         (WebCore::writeLayers):
2198
2199 2012-11-17  Simon Fraser  <simon.fraser@apple.com>
2200
2201         Simplify bounds computation for the RenderView's layer
2202         https://bugs.webkit.org/show_bug.cgi?id=102597
2203
2204         Reviewed by Anders Carlsson.
2205
2206         Computing the bounds of the main layer (that of the RenderView) used to do
2207         a full RenderLayer walk, taking the union of the bounds of all the sublayers,
2208         which is very expensive on large pages.
2209         
2210         For the RenderView we can avoid that entirely and just use the RenderView's
2211         document rect. Since page scaling happens as a transform on this layer,
2212         we want the unscaled document rect.
2213
2214         * rendering/RenderLayer.cpp:
2215         (WebCore::RenderLayer::calculateLayerBounds):
2216
2217 2012-11-17  Eric Seidel  <eric@webkit.org>
2218
2219         Add ScriptWrappable to more WebCore classes which are commonly JS-wrapped
2220         https://bugs.webkit.org/show_bug.cgi?id=102601
2221
2222         Reviewed by Adam Barth.
2223
2224         From my investigations all of these classes exist only to be exposed
2225         to the web (via JavaScript) and are not used internally by WebCore.
2226         I beleive all of them always have wrappers.
2227         These were found using this code:
2228         https://bugs.webkit.org/show_bug.cgi?id=102539#c2
2229
2230         Geolocation -- navigator.geolocation
2231         WebKitCSSMatrix -- represent matrixes in JS through various APIs
2232         DOMStringMap, NamedNodeMap, NodeIterator, TreeWalker -- exclusively for the DOM API
2233         Blob, FileList - used by the File, Clipboard and XHR, also exclusively as API
2234         ValidityState -- formControl.validity
2235         CanvasRenderingContext -- canvas.getContext()
2236         DOMApplicationCache -- window.appcache
2237         Screen -- window.screen
2238         DOMMimeTypeArray -- navigator.mimetypes
2239         DOMPlugin -- navigator.plugins[0]
2240         DOMPluginArray -- navigator.plugins
2241
2242         * Modules/geolocation/Geolocation.h:
2243         * css/WebKitCSSMatrix.h:
2244         * dom/DOMStringMap.h:
2245         * dom/NamedNodeMap.h:
2246         * dom/NodeIterator.h:
2247         * dom/TreeWalker.h:
2248         * fileapi/Blob.h:
2249         * fileapi/FileList.h: (had to un-indent to make check-webkit-style happy)
2250         (FileList):
2251         (WebCore::FileList::create):
2252         (WebCore::FileList::length):
2253         (WebCore::FileList::isEmpty):
2254         (WebCore::FileList::clear):
2255         (WebCore::FileList::append):
2256         * html/ValidityState.h:
2257         * html/canvas/CanvasRenderingContext.h:
2258         * loader/appcache/DOMApplicationCache.h:
2259         * page/Screen.h:
2260         * platform/graphics/wince/MediaPlayerProxy.cpp:
2261         (WebCore::WebMediaPlayerProxy::initEngine): This code was wrong, fixed to use internal APIs.
2262         * plugins/DOMMimeTypeArray.h:
2263         * plugins/DOMPlugin.h:
2264         * plugins/DOMPluginArray.h:
2265
2266 2012-11-17  Alexandru Chiculita  <achicu@adobe.com>
2267
2268         [Texmap][CSS Shaders] Reuse the precompiled shader for custom filters in TextureMapperGL
2269         https://bugs.webkit.org/show_bug.cgi?id=101801
2270
2271         Reviewed by Noam Rosenthal.
2272
2273         Added a HashMap in TextureMapperGL to store the precompiled versions of the shaders.
2274         Also added a new API on TextureMapper that receives a notification when the shader
2275         is no longer needed.
2276
2277         No new tests, the code is tested by existing tests.
2278
2279         * platform/graphics/filters/CustomFilterOperation.h:
2280         (WebCore::CustomFilterOperation::setProgram):
2281         (CustomFilterOperation): Made the constructor protected, so that we can overwrite the class in WK2.
2282         * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
2283         (WebCore::CustomFilterValidatedProgram::validatedProgramInfo):
2284         (WebCore):
2285         * platform/graphics/filters/CustomFilterValidatedProgram.h:
2286         (CustomFilterValidatedProgram):
2287         * platform/graphics/texmap/TextureMapper.h:
2288         (WebCore):
2289         (TextureMapper):
2290         (WebCore::TextureMapper::removeCachedCustomFilterProgram):
2291         Function to be called by the platform code, when the shader is no longer
2292         needed. This implementation is empty and overridden in TextureMapperGL.
2293         * platform/graphics/texmap/TextureMapperGL.cpp:
2294         (WebCore::TextureMapperGL::removeCachedCustomFilterProgram):
2295         Removes the compiled shader from the cache. This is called from WK2 when the compiled shader
2296         is no longer needed.
2297         (WebCore):
2298         (WebCore::TextureMapperGL::drawUsingCustomFilter): The first time it uses a new
2299         shader it will cache the compiled version until removeCachedCustomFilterProgram is called.
2300         * platform/graphics/texmap/TextureMapperGL.h:
2301         (WebCore):
2302         (TextureMapperGL):
2303
2304 2012-11-17  Brady Eidson  <beidson@apple.com>
2305
2306         Add an integer identifier field to AuthenticationChallengeBase.
2307         https://bugs.webkit.org/show_bug.cgi?id=102593
2308
2309         Reviewed by Darin Adler.
2310
2311         This is to support linking two different challenges that might not compare as equal but that 
2312         represent the same logical authentication challenge.
2313
2314         One example is in an IPC environment where the platform challenge can only exist in one process.
2315
2316         No new tests (Platform support, no effect in tested configs).
2317
2318         * WebCore.exp.in:
2319
2320         * platform/network/AuthenticationChallengeBase.cpp:
2321         (WebCore::AuthenticationChallengeBase::AuthenticationChallengeBase):
2322         * platform/network/AuthenticationChallengeBase.h:
2323         (WebCore::AuthenticationChallengeBase::identifier):
2324
2325         * platform/network/cf/AuthenticationChallenge.h:
2326         * platform/network/mac/AuthenticationMac.mm:
2327         (WebCore::generateUniqueIdentifier):
2328         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Generate a new unique identifier whenever
2329           constructing a challenge from an NSURLAuthenticationChallenge.
2330
2331         * platform/network/cf/AuthenticationCF.cpp:
2332         (WebCore::generateUniqueIdentifier):
2333         (WebCore::AuthenticationChallenge::AuthenticationChallenge): Generate a new unique identifier whenever
2334           constructing a challenge from a CFURLAuthChallengeRef.
2335
2336         Implement the new constructor form for ports relevant to WebKit2:
2337         * platform/network/qt/AuthenticationChallenge.h:
2338         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2339         * platform/network/soup/AuthenticationChallenge.h:
2340         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2341         * platform/network/win/AuthenticationChallenge.h:
2342         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2343
2344 2012-11-17  Simon Fraser  <simon.fraser@apple.com>
2345
2346         Dump the tile cache extent in layout tests
2347         https://bugs.webkit.org/show_bug.cgi?id=102600
2348
2349         Reviewed by Anders Carlsson.
2350
2351         When dumping tiled layer stats in layout tests, also dump the extent
2352         of the tile grid. This will allow us to detect issues related
2353         to zooming, which is not possible with the existing tile coverage rect,
2354         which is dumped in layer (not tile) coordinates.
2355
2356         * platform/graphics/TiledBacking.h: Added tileGridExtent().
2357         * platform/graphics/ca/GraphicsLayerCA.cpp:
2358         (WebCore::GraphicsLayerCA::dumpAdditionalProperties): Dump the tile grid extent.
2359         * platform/graphics/ca/mac/TileCache.h: tileCoverageRect() should be OVERRIDE.
2360         * platform/graphics/ca/mac/TileCache.mm:
2361         (WebCore::TileCache::getTileIndexRangeForRect):
2362         (WebCore::TileCache::tileGridExtent): Return a rect with the size of
2363         the grid as top,left width,height.
2364
2365 2012-11-17  Andreas Kling  <akling@apple.com>
2366
2367         Avoid full style recalc when 'style' attribute changes.
2368         <http://webkit.org/b/78718>
2369
2370         Reviewed by Anders Carlsson.
2371
2372         Use setNeedsStyleRecalc(InlineStyleChange) when the 'style' attribute changes
2373         to reduce the amount of work done in recalcStyle().
2374
2375         * dom/StyledElement.cpp:
2376         (WebCore::StyledElement::styleAttributeChanged):
2377
2378 2012-11-17  Li Yin  <li.yin@intel.com>
2379
2380         Remove coneGain and distanceGain attributes from PannerNode.idl
2381         https://bugs.webkit.org/show_bug.cgi?id=102343
2382
2383         Reviewed by Chris Rogers.
2384
2385         Removing .coneGain and .distanceGain as publicly accessible values,
2386         since normally they only need to be calculated internally.
2387
2388         No changes to tests, since these attributes were not tested and are being removed.
2389
2390         * Modules/webaudio/PannerNode.idl:
2391
2392 2012-11-17  Balazs Kelemen  <kbalazs@webkit.org>
2393
2394         [Coordinated Graphics] Resumed animations leave an obsolate GraphicsLayerAnimation behind
2395         https://bugs.webkit.org/show_bug.cgi?id=102530
2396
2397         Reviewed by Noam Rosenthal.
2398
2399         GraphicsLayer::addAnimation is called no only when a new animation is created
2400         but also when resuming a paused animation. If this is a resumed animation we
2401         should remove the obsolate GraphicsLayerAnimation object.
2402
2403         Tested by animations tests.
2404
2405         * platform/graphics/GraphicsLayerAnimation.cpp:
2406         (WebCore::GraphicsLayerAnimations::add):
2407
2408 2012-11-17  Martin Robinson  <mrobinson@igalia.com>
2409
2410         [Soup] CredentialStorage should only be used for HTTP-family requests
2411         https://bugs.webkit.org/show_bug.cgi?id=102582
2412
2413         Reviewed by Gustavo Noronha Silva.
2414
2415         Do not use CredentialStorage when handling non-HTTP family requests. CredentialStorage
2416         only expects to handle requests in the HTTP family.
2417
2418         No new tests. This is covered by existing tests.
2419
2420         * platform/network/ResourceHandle.h:
2421         (ResourceHandle): Add a shouldUseCredentialStorage helper to ResourceHandle. This
2422         helper returns false when firstRequest() is a non-HTTP family request.
2423         * platform/network/soup/ResourceHandleSoup.cpp:
2424         (WebCore::applyAuthenticationToRequest): Use the new helper.
2425         (WebCore::createSoupRequestAndMessageForHandle): Ditto.
2426         (WebCore::ResourceHandle::start): Ditto.
2427         (WebCore::ResourceHandle::shouldUseCredentialStorage): Ditto.
2428         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
2429         (WebCore::ResourceHandle::receivedCredential): Ditto.
2430
2431 2012-11-16  Patrick Gansterer  <paroga@webkit.org>
2432
2433         Build fix for !USE(ACCELERATED_COMPOSITING) after r135029.
2434
2435         * rendering/RenderLayer.cpp:
2436         (WebCore::RenderLayer::paintOverflowControls):
2437
2438 2012-11-16  Benjamin Poulain  <bpoulain@apple.com>
2439
2440         Improve the performance of rect transform
2441         https://bugs.webkit.org/show_bug.cgi?id=101828
2442
2443         Reviewed by Simon Fraser.
2444
2445         Mapping a rect and a quad by a transform is a common operation because
2446         we use it to recompute the repaint rect, overflow rect, etc.
2447
2448         The way it was done, is by transforming through mapRect()->mapQuad()->4 times mapPoint().
2449         Each of those functions tests isIdentityOrTranslation() which has to read the whole matrix
2450         and perform many comparison.
2451         Because of that, the simple mapping of a rect was loading and checking the matrix 5 times
2452         too many.
2453
2454         This patch just cut the intermediary calls.
2455
2456         On ARM, putting the operation together also has the advantage of loading the matrix
2457         only once in registers and reusing it for every point.
2458
2459         * platform/graphics/transforms/TransformationMatrix.cpp:
2460         (WebCore::TransformationMatrix::mapPoint):
2461         (WebCore::TransformationMatrix::mapRect):
2462         * platform/graphics/transforms/TransformationMatrix.h:
2463         (WebCore):
2464         (WebCore::TransformationMatrix::mapPointImpl): New convenience function to perform the
2465         point project without doing isIdentityOrTranslation().
2466
2467 2012-11-16  Simon Fraser  <simon.fraser@apple.com>
2468
2469         Avoid calling the virtual isBlockFlow() in RenderBox::computeRectForRepaint()
2470         https://bugs.webkit.org/show_bug.cgi?id=102581
2471
2472         Reviewed by Dan Bernstein.
2473
2474         isBlockFlow() is a virtual function call, and shows up in profiles of
2475         Facebook pages as called from RenderBox::computeRectForRepaint().
2476         
2477         It's faster to do the hasColumns() bit-check first. Also replace
2478         a call to layer() with the hasLayer() bit-check.        
2479
2480         * rendering/RenderBox.cpp:
2481         (WebCore::RenderBox::computeRectForRepaint):
2482
2483 2012-11-16  Sheriff Bot  <webkit.review.bot@gmail.com>
2484
2485         Unreviewed, rolling out r134817.
2486         http://trac.webkit.org/changeset/134817
2487         https://bugs.webkit.org/show_bug.cgi?id=102576
2488
2489         Broke iframes and causing tons of crashes on ClusterFuzz
2490         (Requested by inferno-sec on #webkit).
2491
2492         * dom/ContainerNode.cpp:
2493         (WebCore::willRemoveChildren):
2494         * dom/ContainerNodeAlgorithms.cpp:
2495         (WebCore::ChildFrameDisconnector::collectDescendant):
2496         * dom/ContainerNodeAlgorithms.h:
2497         (WebCore::ChildFrameDisconnector::ChildFrameDisconnector):
2498         (WebCore::ChildFrameDisconnector::~ChildFrameDisconnector):
2499         (ChildFrameDisconnector):
2500         (WebCore::ChildFrameDisconnector::collectDescendant):
2501         (WebCore::ChildFrameDisconnector::disconnect):
2502         * dom/Node.cpp:
2503         * dom/Node.h:
2504         (Node):
2505         * dom/NodeRareData.h:
2506         (WebCore::NodeRareData::NodeRareData):
2507         (NodeRareData):
2508         * html/HTMLFrameOwnerElement.cpp:
2509         (WebCore::HTMLFrameOwnerElement::setContentFrame):
2510         (WebCore::HTMLFrameOwnerElement::disconnectContentFrame):
2511
2512 2012-11-16  Simon Fraser  <simon.fraser@apple.com>
2513
2514         Fix overlay scrollbar painting in compositing layers
2515         https://bugs.webkit.org/show_bug.cgi?id=102442
2516
2517         Reviewed by Beth Dakin.
2518
2519         There were two issues with overlay scrollbar painting in
2520         compositing layers.
2521         
2522         First, we'd only ever call setContainsDirtyOverlayScrollbars()
2523         on the RenderView's layer, even when encountering an overlay scrollbar
2524         in some descendant compositing layer. This meant that we'd never
2525         run the paintOverlayScrollbars() code for those child compositing
2526         layers, so sometimes scrollbars were missing there.
2527         
2528         Even after fixing that, we would fail to render scrollbars that
2529         were not in the composited RenderLayer itself. This happened because
2530         we called into RenderLayer::paintOverlayScrollbars(), which called
2531         paintLayer() with flags that only said to paint the overlay scrollbars
2532         but not any descendants, so this paint path would not walk child
2533         RenderLayers.
2534         
2535         Also remove the containsScrollableAreaWithOverlayScrollbars() flag on
2536         ScrollView which is no longer used.
2537
2538         * platform/ScrollView.cpp:
2539         (WebCore::ScrollView::ScrollView): Remove containsScrollableAreaWithOverlayScrollbars().
2540         (WebCore::ScrollView::paint): Remove setting of m_containsScrollableAreaWithOverlayScrollbars.
2541         * platform/ScrollView.h:
2542         * rendering/RenderLayer.cpp:
2543         (WebCore::RenderLayer::paintOverflowControls): Call setContainsDirtyOverlayScrollbars()
2544         on the compositing ancestor or the root.
2545         Remove call to setContainsScrollableAreaWithOverlayScrollbars().
2546         (WebCore::RenderLayer::paintOverlayScrollbars): When painting overlay
2547         scrollbars, no need to say we have transparency, and no need to use 
2548         temporary clip rects.
2549         (WebCore::RenderLayer::paintLayer): The PaintLayerPaintingOverlayScrollbars
2550         check here was only needed because the compositing entrypoint to painting
2551         overlay scrollbars went via paintLayer(), which isn't normally used as
2552         a composited painting entry point. Now that we no longer call that, we
2553         don't need this special check.
2554         * rendering/RenderLayerBacking.cpp:
2555         (WebCore::RenderLayerBacking::paintIntoLayer): Jump into overlay scrollbar
2556         painting via paintLayerContents(), not paintOverlayScrollbars(), since
2557         the latter does not traverse sublayers.
2558
2559 2012-11-16  Joshua Bell  <jsbell@chromium.org>
2560
2561         IndexedDB: Assert hit when getting non-existent object store in version change transaction
2562         https://bugs.webkit.org/show_bug.cgi?id=102547
2563
2564         Reviewed by Tony Chang.
2565
2566         Code did not account for the not-found case in "versionchange" transactions, where all
2567         object stores are implicitly in scope.
2568
2569         Test: storage/indexeddb/object-lookups-in-versionchange.html
2570
2571         * Modules/indexeddb/IDBTransaction.cpp:
2572         (WebCore::IDBTransaction::objectStore):
2573
2574 2012-11-12  Simon Fraser  <simon.fraser@apple.com>
2575
2576         Eliminate ancestor tree walk computing outlineBoundsForRepaint() when updating layer positions
2577         https://bugs.webkit.org/show_bug.cgi?id=101874
2578
2579         Reviewed by Dave Hyatt.
2580
2581         RenderLayer::updateLayerPositions() and updateLayerPositionsAfterScroll() spend a
2582         lot of time in computeRepaintRects(), which does two ancestor tree walks, once
2583         for clippedOverflowRectForRepaint(), and one for outlineBoundsForRepaint().
2584
2585         Eliminate the ancestor tree walk in outlineBoundsForRepaint() by maintaining
2586         a RenderGeometryMap as we traverse the layer tree, and then using it to map
2587         the outline bounds to the repaint container. Replace the hokey cached offsetFromRoot
2588         now that the RenderGeometryMap can do a better job.
2589         
2590         The clipped overflow rect cannot be mapped simply, so cannot yet make use of
2591         the geometry map.
2592         
2593         Modify the RenderGeometryMap to support mapping to some repaintContainer ancestor.
2594         Add a RenderObject walk that is necessary to detect flipped writing mode blocks.
2595         
2596         Pass the RenderGeometryMap as an optional parameter to outlineBoundsForRepaint.
2597         
2598         * page/FrameView.cpp:
2599         (WebCore::FrameView::layout): Make a RenderGeometryMap and pass it down
2600         to updateLayerPositions(). For partial layouts, we have to push layers
2601         between the root and the enclosing layer of the layout subtree.
2602         The geometry map used for repainting does not use SnapOffsetForTransforms,
2603         so initialize it explicitly with just the UseTransforms flag.
2604         (WebCore::FrameView::repaintFixedElementsAfterScrolling): Make a RenderGeometryMap
2605         to pass along to updateLayerPositionsAfterScroll().
2606         * rendering/RenderBox.cpp:
2607         (WebCore::RenderBox::outlineBoundsForRepaint): Replace the optional cachedOffsetToRepaintContainer
2608         parameter with an optional RenderGeometryMap, and it use to map the compute rect to
2609         repaintContainer coordinates.
2610         * rendering/RenderBox.h:
2611         * rendering/RenderGeometryMap.cpp:
2612         (WebCore::RenderGeometryMap::RenderGeometryMap): This now has to store the mapping
2613         flags to use, so that its behavior can match that of mapLocalToContainer(). The
2614         pertinent flag is the confusingly named SnapOffsetForTransforms.
2615         (WebCore::RenderGeometryMap::absolutePoint): Call the new mapToContainer() with
2616         a null container.
2617         (WebCore::RenderGeometryMap::absoluteRect): Ditto.
2618         (WebCore::RenderGeometryMap::mapToContainer): Map to the supplied container,
2619         asserting that we found it. Add point- and rect-based mapping methods
2620         akin to the old absoluteRect/absolutePoint.
2621         (WebCore::canMapViaLayer): We need to test for isRenderFlowThread() here too.
2622         (WebCore::RenderGeometryMap::pushMappingsToAncestor): When mapping via
2623         layers, ensure that the RenderView is pushed as the first step.
2624         * rendering/RenderGeometryMap.h:
2625         (RenderGeometryMap):
2626         * rendering/RenderLayer.cpp:
2627         (WebCore::RenderLayer::updateLayerPositionsAfterLayout): New wrapper for updateLayerPositions()
2628         that makes the geometry map.
2629         (WebCore::RenderLayer::updateLayerPositionsAfterScroll): New wrapper for updateLayerPositionsAfterScroll
2630         that makes the geometry map.
2631         (WebCore::RenderLayer::updateLayerPositions): Now takes an optional RenderGeometryMap.
2632         Remove the old offsetFromRoot code. Push and pop layers to/from the geometry map. Use
2633         the geometry map to get the offsetFromRoot as needed by overflow controls. Pass
2634         it to computeRepaintRects().
2635         (WebCore::RenderLayer::computeRepaintRects): Pass the geometry map to outlineBoundsForRepaint().
2636         (WebCore::RenderLayer::updateLayerPositionsAfterScroll): Push and pop to/from the
2637         geometry map, and pass it to computeRepaintRects().
2638         (WebCore::RenderLayer::removeOnlyThisLayer): Remove the offsetFromRootBeforeMove
2639         computation; this could use a geometry map in future if it is shown to be a bottleneck.
2640         * rendering/RenderLayer.h:
2641         (WebCore::RenderLayer::canUseConvertToLayerCoords): It was thought that the isComposited()
2642         was there because the older cached offsetFromRoot logic was sensitive to compositing,
2643         but convertToLayerCoords() is not affected by compositing so this check is not needed,
2644         and actually harmful.
2645         * rendering/RenderLayerCompositor.cpp:
2646         (WebCore::RenderLayerCompositor::OverlapMap::OverlapMap): The geometry map
2647         used for overlap testing should not use SnapOffsetForTransforms, so initialize
2648         it explicitly with just the UseTransforms flag.
2649         * rendering/RenderObject.h:
2650         (WebCore::RenderObject::outlineBoundsForRepaint):
2651         * rendering/svg/RenderSVGModelObject.cpp:
2652         (WebCore::RenderSVGModelObject::outlineBoundsForRepaint):
2653         * rendering/svg/RenderSVGModelObject.h:
2654         (RenderSVGModelObject):
2655
2656 2012-11-16  Alec Flett  <alecflett@chromium.org>
2657
2658         Add tests for explicit serialization values
2659         https://bugs.webkit.org/show_bug.cgi?id=96818
2660
2661         Reviewed by Adam Barth.
2662
2663         Expose direct access to the serialization/deserialization mechanisms
2664         of SerializedScriptValue to DumpRenderTree.
2665
2666         * testing/Internals.cpp:
2667         (WebCore::Internals::serializeObject):
2668         (WebCore):
2669         (WebCore::Internals::deserializeBuffer):
2670         * testing/Internals.h:
2671         (WebCore):
2672         * testing/Internals.idl:
2673
2674 2012-11-16  Andreas Kling  <akling@apple.com>
2675
2676         Exploit shared attribute data to avoid parsing identical "style" attributes.
2677         <http://webkit.org/b/101163>
2678
2679         Reviewed by Antti Koivisto.
2680
2681         Track the "inline style dirty" state on ElementAttributeData instead of in a Node flag.
2682         This allows us to avoid duplicate work for ElementAttributeData that are shared between multiple elements,
2683         since the state is no longer per-Element.
2684
2685         * css/StyleResolver.cpp:
2686         (WebCore::isCacheableInMatchedPropertiesCache):
2687
2688             Disable the matched properties cache for styles with non-standard writing-mode.
2689             This is necessary because some CSS properties have different meaning depending on context -
2690             properties handled by CSSProperty::resolveDirectionAwareProperty().
2691
2692             Now that multiple elements may have identical inlineStyle() pointers, this is necessary to
2693             avoid mapping StylePropertySets with direction-aware properties to RenderStyles with differing
2694             writing-modes in the matched properties cache.
2695
2696         * dom/Node.h:
2697         * dom/ElementAttributeData.cpp:
2698         (WebCore::ElementAttributeData::ElementAttributeData):
2699         * dom/ElementAttributeData.h:
2700         (WebCore::ElementAttributeData::ElementAttributeData):
2701         (ElementAttributeData):
2702         * dom/Element.h:
2703         (WebCore::Element::updateInvalidAttributes):
2704         * dom/Element.cpp:
2705         (WebCore::Element::getAttribute):
2706         (WebCore::Element::removeAttribute):
2707         * dom/StyledElement.h:
2708         (WebCore::StyledElement::invalidateStyleAttribute):
2709         * dom/StyledElement.cpp:
2710         (WebCore::StyledElement::updateStyleAttribute):
2711
2712             Move "style attribute dirty" flag to ElementAttributeData.
2713
2714         (WebCore::Element::cloneAttributesFromElement):
2715
2716             Remove ugly optimization to avoid reparsing inline style when cloning elements. This now happens
2717             automagically since cloning nodes just refs the original attribute data.
2718
2719         * dom/StyledElement.cpp:
2720         (WebCore::StyledElement::updateStyleAttribute):
2721         (WebCore::StyledElement::setInlineStyleFromString):
2722         (WebCore::StyledElement::styleAttributeChanged):
2723         (WebCore::StyledElement::inlineStyleChanged):
2724
2725             Avoid reparsing the inline style if the element's attribute data is immutable and already has
2726             a parsed inlineStyle(). Split the set-inline-style-from-string code out of styleAttributeChanged()
2727             to make the code more understandable.
2728
2729 2012-11-16  Simon Fraser  <simon.fraser@apple.com>
2730
2731         Don't update layer positions on scrolling if we're in the middle of layout
2732         https://bugs.webkit.org/show_bug.cgi?id=102556
2733
2734         Reviewed by Dan Bernstein.
2735
2736         RenderLayer::scrollTo() can be called in the middle of layout. When
2737         that happens we should not waste time updating layer positions,
2738         compositing layers, or widget positions, because we'll do those at the
2739         end of layout anyway.
2740         
2741         This prevents us from having inconsistent RenderLayer state, which
2742         hinders future optimizations in this area.
2743
2744         * rendering/RenderLayer.cpp:
2745         (WebCore::RenderLayer::scrollTo):
2746
2747 2012-11-16  Tony Chang  <tony@chromium.org>
2748
2749         Remove ENABLE_CSS_HIERARCHIES since it's no longer in use
2750         https://bugs.webkit.org/show_bug.cgi?id=102554
2751
2752         Reviewed by Andreas Kling.
2753
2754         As mentioned in https://bugs.webkit.org/show_bug.cgi?id=79939#c41 ,
2755         we're going to revist this feature once additional vendor support is
2756         achieved.
2757
2758         No new tests, just removing an unused define.
2759
2760         * Configurations/FeatureDefines.xcconfig:
2761         * GNUmakefile.features.am:
2762
2763 2012-11-16  Mark Pilgrim  <pilgrim@chromium.org>
2764
2765         [Chromium] Remove cookie-related functions from PlatformSupport
2766         https://bugs.webkit.org/show_bug.cgi?id=99340
2767
2768         Reviewed by Adam Barth.
2769
2770         Move cookie-related functions out of PlatformSupport and implement
2771         new PlatformCookieJar interface via NetworkContext.
2772
2773         * WebCore.gyp/WebCore.gyp:
2774         * WebCore.gypi:
2775         * loader/CookieJar.cpp:
2776         * loader/chromium/CookieJarChromium.cpp: Removed.
2777         * platform/chromium/PlatformSupport.h:
2778         (WebCore):
2779         (PlatformSupport):
2780         * platform/network/NetworkingContext.h:
2781         (WebKit):
2782         (NetworkingContext):
2783         * platform/network/chromium/CookieJarChromium.cpp: Copied from Source/WebCore/loader/chromium/CookieJarChromium.cpp.
2784         (WebCore::setCookiesFromDOM):
2785         (WebCore::cookiesForDOM):
2786         (WebCore::cookieRequestHeaderFieldValue):
2787         (WebCore::cookiesEnabled):
2788         (WebCore::getRawCookies):
2789         (WebCore::deleteCookie):
2790         (WebCore::getHostnamesWithCookies):
2791         (WebCore::deleteCookiesForHostname):
2792         (WebCore::deleteAllCookies):
2793
2794 2012-11-16  Pablo Flouret  <pablof@motorola.com>
2795
2796         [JSC] Don't sanitize window.onerror information on crossorigin-enabled scripts
2797         https://bugs.webkit.org/show_bug.cgi?id=70574
2798
2799         Reviewed by Geoffrey Garen.
2800
2801         For scripts that use CORS (via the crossorigin attribute in this case),
2802         don't sanitize the information passed to the window's onerror handler (i.e.
2803         message, url, and line number). Useful for scripts hosted on CDNs.
2804
2805         Tests: http/tests/security/script-crossorigin-onerror-information.html
2806                http/tests/security/script-no-crossorigin-onerror-should-be-sanitized.html
2807
2808         * WebCore.exp.in:
2809         * WebCore.order:
2810
2811         * bindings/js/JSDOMBinding.cpp:
2812         (WebCore::reportException):
2813         * bindings/js/JSDOMBinding.h:
2814         (WebCore):
2815         * bindings/js/ScriptController.cpp:
2816         (WebCore::ScriptController::evaluateInWorld):
2817         * bindings/js/ScriptSourceCode.h:
2818         (WebCore::ScriptSourceCode::ScriptSourceCode):
2819         (WebCore::ScriptSourceCode::cachedScript):
2820         (ScriptSourceCode):
2821         * bindings/js/WorkerScriptController.cpp:
2822         (WebCore::WorkerScriptController::evaluate):
2823             Keep a reference to the cached script in the ScriptSourceCode, so
2824             that it can be passed around and be available when reporting the
2825             exception.
2826
2827         * dom/ScriptExecutionContext.cpp:
2828         (WebCore::ScriptExecutionContext::sanitizeScriptError):
2829         (WebCore::ScriptExecutionContext::reportException):
2830         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2831         * dom/ScriptExecutionContext.h:
2832         (WebCore):
2833         (ScriptExecutionContext):
2834             Check if the script passes the access control checks, and if so,
2835             don't sanitize the error information.
2836
2837         * html/parser/HTMLPreloadScanner.cpp:
2838         (WebCore::PreloadTask::processAttributes):
2839         (WebCore::PreloadTask::preload):
2840         (PreloadTask):
2841         (WebCore::PreloadTask::crossOriginModeAllowsCookies):
2842             When preloading script elements, check for the crossorigin attribute
2843             and adjust the request's allowCookies value accordingly. Otherwise
2844             when the script is loaded from the cache later on, the cross origin mode
2845             (anonymous/use-credentials) will be effectively ignored.
2846
2847 2012-11-16  Jon Lee  <jonlee@apple.com>
2848
2849         Change visual look of placeholder
2850         https://bugs.webkit.org/show_bug.cgi?id=102149
2851         <rdar://problem/12695566>
2852
2853         Reviewed by Darin Adler.
2854
2855         Move the button to the lower-right corner. Move the theming into
2856         RenderSnapshottedPlugin for now. Eventually we will want to migrate to using the
2857         shadow DOM instead, and the metrics of the button are needed for click passthrough.
2858
2859         * Resources/startButton.png: Added.
2860         * Resources/startButton@2x.png: Added.
2861         * Resources/startButtonPressed.png: Added.
2862         * Resources/startButtonPressed@2x.png: Added.
2863         * WebCore.xcodeproj/project.pbxproj: Add button images.
2864
2865         Maintain variables to track whether the mouse is over the button, and the rect
2866         for the button. If the user clicks in the rect, we render a pressed button.
2867         * rendering/RenderSnapshottedPlugIn.cpp:
2868         (WebCore): Add named constant for bottom and right padding of the button.
2869         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
2870         (WebCore::RenderSnapshottedPlugIn::paintReplaced):
2871         (WebCore::startButtonImage): Returns button image.
2872         (WebCore::startButtonPressedImage): Returns pressed button image.
2873         (WebCore::RenderSnapshottedPlugIn::paintButton): Draw the button image in the
2874         lower right hand corner, but only if we are active or hovered.
2875         (WebCore::RenderSnapshottedPlugIn::repaintButton): Stubbed to call repaint().
2876         (WebCore::RenderSnapshottedPlugIn::handleEvent): Repaint the button if we are
2877         hovering over the plugin rect. With a mouse down event, calculate whether the
2878         mouse position is within the button rect.
2879         (WebCore::RenderSnapshottedPlugIn::layout): Cache the rect representing the button
2880         contents.
2881         * rendering/RenderSnapshottedPlugIn.h:
2882
2883         Remove theming function for now.
2884         * rendering/RenderTheme.h:
2885         (RenderTheme):
2886         * rendering/RenderThemeMacShared.h:
2887         * rendering/RenderThemeMacShared.mm:
2888
2889 2012-11-16  Eric Seidel  <eric@webkit.org>
2890
2891         Deploy ScriptWrappable to more always-wrapped objects
2892         https://bugs.webkit.org/show_bug.cgi?id=102539
2893
2894         Reviewed by Adam Barth.
2895
2896         Add the ScriptWrappable baseclass to:
2897         CSSStyleDeclaration (anttik tells me these should only be used from JS, even though some old Editing code used to use them)
2898         ClientRect (element.getBoundingClientRects)
2899         Event (Not all events end up wrapped, but any which live past dispatch do)
2900         NodeList (this covers Static and Dynamic node list types, like document.all)
2901         HTMLCollection (separate from NodeList, for things like table.rows)
2902         Storage (for window.storage, always wrapped)
2903         XMLHttpRequest (always wrapped, created from JS)
2904
2905         This should be a small memory savings as the inline pointer is only 4-8 bytes
2906         instead of the hashmap entry which would be 8-16.  This may also show up
2907         on benchmarks which repeatedly access these objects (like window.storage).
2908
2909         These were found by adding a couple lines of logging-code to
2910         WebCore::createWrapper when we were in the main world, but took the
2911         HashMap (instead of inline) storage path. I used sort and uniq -c
2912         to find the most-frequently wrapped objects (while surfing
2913         a few common sites) and came up with this list.  There are still a few
2914         more complicated objects (like CSSStyleDeclaration) which may benifit
2915         from inline-wrapper-access and will be covered in a later patch.
2916
2917         * css/CSSStyleDeclaration.h:
2918         * dom/ClientRect.h:
2919         * dom/Event.h:
2920         * dom/NodeList.h:
2921         * html/HTMLCollection.h:
2922         * storage/Storage.h:
2923         * xml/XMLHttpRequest.h:
2924
2925 2012-11-16  Jon Lee  <jonlee@apple.com>
2926
2927         Simulated events instances do not all have the same underlying event
2928         https://bugs.webkit.org/show_bug.cgi?id=102468
2929         <rdar://problem/12716331>
2930
2931         Reviewed by Alexey Proskuryakov.
2932
2933         The PassRefPtr with the underlying event is included as an argument for the mouse
2934         down, up, and click events. But the PassRefPtr loses its underlying pointer after
2935         the first simulated mouse down event because it gets assigned to that event's
2936         private m_underlyingEvent variable. We therefore send NULL to the other events.
2937
2938         The fix is for this and related functions to pass the raw pointer.
2939
2940         A layout test is not possible to put together because the call sites that use simulated
2941         events with an underlying event do not send mouse events, and those that send mouse
2942         events have a NULL underlying event.
2943
2944         * dom/EventDispatcher.cpp:
2945         (WebCore::EventDispatcher::dispatchSimulatedClick): Require passing in the raw pointer.
2946         * dom/EventDispatcher.h:
2947         * dom/Node.cpp:
2948         (WebCore::Node::dispatchSimulatedClick): Ditto.
2949         * dom/Node.h:
2950
2951 2012-11-16  Patrick Gansterer  <paroga@webkit.org>
2952
2953         Build fix for WinCE after r134936.
2954
2955         * platform/network/win/CookieJarWin.cpp:
2956         (WebCore::cookieRequestHeaderFieldValue):
2957
2958 2012-11-16  Dimitri Glazkov  <dglazkov@chromium.org>
2959
2960         Unreviewed, rolling out r134986.
2961         http://trac.webkit.org/changeset/134986
2962         https://bugs.webkit.org/show_bug.cgi?id=102110
2963
2964         Triggered ASSERT in fast/frames/seamless/seamless-inherited-
2965         origin.html.
2966
2967         * css/StyleResolver.cpp:
2968         (WebCore::StyleResolver::StyleResolver):
2969         (WebCore::StyleResolver::addAuthorRulesAndCollectUserRulesFromSheets):
2970         (WebCore::collectCSSOMWrappers):
2971         * css/StyleResolver.h:
2972         (StyleResolver):
2973         * dom/Document.cpp:
2974         (WebCore::Document::setCompatibilityMode):
2975         * dom/DocumentStyleSheetCollection.cpp:
2976         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
2977         (WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
2978         (WebCore::DocumentStyleSheetCollection::pageGroupUserSheets):
2979         (WebCore):
2980         (WebCore::DocumentStyleSheetCollection::clearPageGroupUserSheets):
2981         (WebCore::DocumentStyleSheetCollection::updatePageGroupUserSheets):
2982         (WebCore::DocumentStyleSheetCollection::addUserSheet):
2983         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
2984         (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
2985         * dom/DocumentStyleSheetCollection.h:
2986         (DocumentStyleSheetCollection):
2987         (WebCore::DocumentStyleSheetCollection::documentUserSheets):
2988         * page/PageGroup.cpp:
2989         (WebCore::PageGroup::addUserStyleSheetToWorld):
2990         (WebCore::PageGroup::removeUserStyleSheetFromWorld):
2991         (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
2992         (WebCore::PageGroup::removeAllUserContent):
2993         (WebCore::PageGroup::resetUserStyleCacheInAllFrames):
2994         * page/PageGroup.h:
2995         (PageGroup):
2996
2997 2012-11-16  Michael Pruett  <michael@68k.org>
2998
2999         IndexedDB: Propagate DOMRequestState to IndexedDB binding utility functions
3000         https://bugs.webkit.org/show_bug.cgi?id=102430
3001
3002         Reviewed by Adam Barth.
3003
3004         DOMRequestState is currently propagated to some but not all of
3005         the IndexedDB binding utility functions. In order to implement
3006         these functions for JSC, this state must be propagated to all
3007         of the utility functions.
3008
3009         Tests: storage/indexeddb/*
3010
3011         * Modules/indexeddb/IDBCursor.cpp:
3012         (WebCore::IDBCursor::update):
3013         (WebCore::IDBCursor::setValueReady):
3014         * Modules/indexeddb/IDBObjectStore.cpp:
3015         (WebCore::generateIndexKeysForValue):
3016         (WebCore::IDBObjectStore::put):
3017         (WebCore):
3018         * Modules/indexeddb/IDBRequest.cpp:
3019         (WebCore::IDBRequest::onSuccess):
3020         (WebCore::IDBRequest::dispatchEvent):
3021         * Modules/indexeddb/IDBRequest.h:
3022         (WebCore::IDBRequest::requestState):
3023         (IDBRequest):
3024         * bindings/v8/IDBBindingUtilities.cpp:
3025         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
3026         (WebCore::serializeIDBValue):
3027         (WebCore::injectIDBKeyIntoScriptValue):
3028         * bindings/v8/IDBBindingUtilities.h:
3029         (WebCore):
3030
3031 2012-11-16  Byungwoo Lee  <bw80.lee@samsung.com>
3032
3033         Rebaselined run-bindings-tests.
3034         https://bugs.webkit.org/show_bug.cgi?id=102523
3035
3036         Reviewed by Dimitri Glazkov.
3037
3038         Expected results need to be updated after r134931
3039
3040         * bindings/scripts/test/JS/JSTestObj.cpp:
3041         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
3042         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
3043         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack):
3044         * bindings/scripts/test/V8/V8TestObj.cpp:
3045         (WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrGetter):
3046         (WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrSetter):
3047         (WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackCallback):
3048
3049 2012-11-16  Pratik Solanki  <psolanki@apple.com>
3050
3051         For single element arrays use the pointer into the CFDataRef instead of copying data
3052         https://bugs.webkit.org/show_bug.cgi?id=102306
3053         <rdar://problem/12267471>
3054
3055         Reviewed by Alexey Proskuryakov.
3056
3057         We generally copy the data received from CFNetwork into our own buffers. But if the
3058         CFArrayRef has exactly one CFDataRef inside it, then we can just hold on to the CFDataRef
3059         and access its memory directly and avoid making a copy.
3060
3061         This also moves the creation of PurgeableBuffer from CachedResource to SharedBuffer.
3062         SharedBuffer::createPurgeableBuffer() will avoid creating PurgeableBuffer when the
3063         SharedBuffer is backed by a NSData/CFDataRef and when we want to optimize and directly use
3064         the memory in the data array.
3065
3066         No new tests because no change in functionality.
3067
3068         * loader/ResourceBuffer.cpp:
3069         (WebCore::ResourceBuffer::createPurgeableBuffer): Added.
3070         * loader/ResourceBuffer.h:
3071         * loader/cache/CachedResource.cpp:
3072         (WebCore::CachedResource::makePurgeable):
3073         * platform/SharedBuffer.cpp:
3074         (WebCore::SharedBuffer::createPurgeableBuffer): Added.
3075         (WebCore::SharedBuffer::data):
3076         * platform/SharedBuffer.h:
3077         * platform/cf/SharedBufferCF.cpp:
3078         (WebCore::SharedBuffer::platformData): Use reinterpret_cast instead of C-style cast.
3079         (WebCore::SharedBuffer::maybeTransferPlatformData): Use reinterpret_cast instead of C-style cast.
3080         (WebCore::SharedBuffer::singleDataArrayBuffer): Added.
3081
3082 2012-11-16  Antti Koivisto  <antti@apple.com>
3083
3084         REGRESSION(r129644): User StyleSheet not applying
3085         https://bugs.webkit.org/show_bug.cgi?id=102110
3086
3087         Reviewed by Andreas Kling.
3088
3089         Injected stylesheets added as UserStyleAuthorLevel fail to apply. r129644 implicitly assumed that
3090         such things don't exists but on Chromium addUserStyleSheet() confusingly uses them.
3091         
3092         The patch adds injected author stylesheets to DocumentStyleSheetCollection::activeStyleSheets().
3093         It also generally cleans up the code around injected and user stylesheets.
3094
3095         Tests: userscripts/user-script-and-stylesheet.html
3096                userscripts/user-stylesheet-invalidate.html
3097
3098         * css/StyleResolver.cpp:
3099         (WebCore::StyleResolver::StyleResolver):
3100         (WebCore::StyleResolver::collectRulesFromUserStyleSheets):
3101         (WebCore::collectCSSOMWrappers):
3102         * css/StyleResolver.h:
3103         (StyleResolver):
3104         * dom/Document.cpp:
3105         (WebCore::Document::setCompatibilityMode):
3106         * dom/DocumentStyleSheetCollection.cpp:
3107         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
3108         (WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
3109         (WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets):
3110         (WebCore):
3111         (WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets):
3112         (WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache):
3113         (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache):
3114         (WebCore::DocumentStyleSheetCollection::addUserSheet):
3115         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
3116         (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
3117         * dom/DocumentStyleSheetCollection.h:
3118         (WebCore::DocumentStyleSheetCollection::documentUserStyleSheets):
3119         (DocumentStyleSheetCollection):
3120         * page/PageGroup.cpp:
3121         (WebCore::PageGroup::addUserStyleSheetToWorld):
3122         (WebCore::PageGroup::removeUserStyleSheetFromWorld):
3123         (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
3124         (WebCore::PageGroup::removeAllUserContent):
3125         (WebCore::PageGroup::invalidatedInjectedStyleSheetCacheInAllFrames):
3126         * page/PageGroup.h:
3127         (PageGroup):
3128
3129 2012-11-16  Andreas Kling  <akling@apple.com>
3130
3131         StyleResolver: Only input elements need equal "readonly" attribute for style sharing.
3132         <http://webkit.org/b/102536>
3133
3134         Reviewed by Antti Koivisto.
3135
3136         Move the comparison of the "readonly" attribute into canShareStyleWithControl() since it's only
3137         relevant for sharing style between <input> elements.
3138
3139         Also skip attribute comparisons for form control elements that share the same ElementAttributeData.
3140
3141         * css/StyleResolver.cpp:
3142         (WebCore::StyleResolver::canShareStyleWithControl):
3143         (WebCore::haveIdenticalStyleAffectingAttributes):
3144
3145 2012-11-16  Sheriff Bot  <webkit.review.bot@gmail.com>
3146
3147         Unreviewed, rolling out r134867.
3148         http://trac.webkit.org/changeset/134867
3149         https://bugs.webkit.org/show_bug.cgi?id=102544
3150
3151         Broke security fuzzier test (heap-buffer-overflow) (Requested
3152         by bfulgham on #webkit).
3153
3154         * platform/audio/Biquad.cpp:
3155         (WebCore::Biquad::process):
3156
3157 2012-11-16  Tommy Widenflycht  <tommyw@google.com>
3158
3159         MediaStream API: Update RTCPeerConnection states to match the latest editors draft
3160         https://bugs.webkit.org/show_bug.cgi?id=102382
3161
3162         Reviewed by Adam Barth.
3163
3164         Updating readyState & iceState, and adding iceGatheringState.
3165         Also safeguarding the event timer callback.
3166
3167         Patch covered by existing tests.
3168
3169         * Modules/mediastream/RTCPeerConnection.cpp:
3170         (WebCore::RTCPeerConnection::RTCPeerConnection):
3171         (WebCore::RTCPeerConnection::createOffer):
3172         (WebCore::RTCPeerConnection::createAnswer):
3173         (WebCore::RTCPeerConnection::setLocalDescription):
3174         (WebCore::RTCPeerConnection::localDescription):
3175         (WebCore::RTCPeerConnection::setRemoteDescription):
3176         (WebCore::RTCPeerConnection::remoteDescription):
3177         (WebCore::RTCPeerConnection::updateIce):
3178         (WebCore::RTCPeerConnection::addIceCandidate):
3179         (WebCore::RTCPeerConnection::readyState):
3180         (WebCore::RTCPeerConnection::iceGatheringState):
3181         (WebCore):
3182         (WebCore::RTCPeerConnection::iceState):
3183         (WebCore::RTCPeerConnection::addStream):
3184         (WebCore::RTCPeerConnection::close):
3185         (WebCore::RTCPeerConnection::didChangeIceGatheringState):
3186         (WebCore::RTCPeerConnection::stop):
3187         (WebCore::RTCPeerConnection::changeReadyState):
3188         (WebCore::RTCPeerConnection::scheduledEventTimerFired):
3189         * Modules/mediastream/RTCPeerConnection.h:
3190         (RTCPeerConnection):
3191         * Modules/mediastream/RTCPeerConnection.idl:
3192         * dom/EventNames.h:
3193         (WebCore):
3194         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
3195         (RTCPeerConnectionHandlerClient):
3196         * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
3197         (WebCore::RTCPeerConnectionHandlerChromium::didChangeICEGatheringState):
3198         (WebCore):
3199         * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
3200         (RTCPeerConnectionHandlerChromium):
3201
3202 2012-11-16  Dimitri Glazkov  <dglazkov@chromium.org>
3203
3204         Unreviewed, rolling out r134973.
3205         http://trac.webkit.org/changeset/134973
3206         https://bugs.webkit.org/show_bug.cgi?id=99340
3207
3208         Broke compile on at least Mac and Linux.
3209
3210         * WebCore.gyp/WebCore.gyp:
3211         * WebCore.gypi:
3212         * loader/CookieJar.cpp:
3213         * loader/chromium/CookieJarChromium.cpp: Renamed from Source/WebKit/chromium/src/FrameNetworkingContextImpl.cpp.
3214         (WebCore):
3215         (WebCore::setCookies):
3216         (WebCore::cookies):
3217         (WebCore::cookieRequestHeaderFieldValue):
3218         (WebCore::cookiesEnabled):
3219         (WebCore::getRawCookies):
3220         (WebCore::deleteCookie):
3221         (WebCore::getHostnamesWithCookies):
3222         (WebCore::deleteCookiesForHostname):
3223         (WebCore::deleteAllCookies):
3224         * platform/chromium/PlatformSupport.h:
3225         (WebCore):
3226         (PlatformSupport):
3227         * platform/network/NetworkingContext.h:
3228         * platform/network/chromium/CookieJarChromium.cpp: Removed.
3229
3230 2012-11-16  Martin Robinson  <mrobinson@igalia.com>
3231
3232         [GTK] [WebKit2] Move GtkAuthenticationDialog to the UIProcess
3233         https://bugs.webkit.org/show_bug.cgi?id=101843
3234
3235         Reviewed by Gustavo Noronha Silva.
3236
3237         Make GtkAuthenticationDialog more general, so that it can be subclassed in 
3238         WebKit2. We cannot use the WebCore authentication-related classes directly there.
3239
3240         No new tests. This patch does not change behavior.
3241
3242         * platform/gtk/GtkAuthenticationDialog.cpp:
3243         (WebCore::GtkAuthenticationDialog::GtkAuthenticationDialog): Remove an unused include and reorder
3244         some field initializers.
3245         (WebCore::GtkAuthenticationDialog::authenticate): Now handle both the okay and cancel case here. This
3246         makes it simpler to subclass.
3247         (WebCore::GtkAuthenticationDialog::authenticationDialogResponseCallback): Handle fetching the username
3248         and password here, so that it can be shared with subclasses.
3249         * platform/gtk/GtkAuthenticationDialog.h: Make some methods virtual and protected so they can be
3250         subclasses.
3251
3252 2012-11-16  Mark Pilgrim  <pilgrim@chromium.org>
3253
3254         [Chromium] Remove cookie-related functions from PlatformSupport
3255         https://bugs.webkit.org/show_bug.cgi?id=99340
3256
3257         Reviewed by Adam Barth.
3258
3259         Move cookie-related functions out of PlatformSupport and implement
3260         new PlatformCookieJar interface via NetworkContext.
3261
3262         * WebCore.gyp/WebCore.gyp:
3263         * WebCore.gypi:
3264         * loader/CookieJar.cpp:
3265         * loader/chromium/CookieJarChromium.cpp: Removed.
3266         * platform/chromium/PlatformSupport.h:
3267         (WebCore):
3268         (PlatformSupport):
3269         * platform/network/NetworkingContext.h:
3270         (WebKit):
3271         (NetworkingContext):
3272         * platform/network/chromium/CookieJarChromium.cpp: Copied from Source/WebCore/loader/chromium/CookieJarChromium.cpp.
3273         (WebCore::setCookiesFromDOM):
3274         (WebCore::cookiesForDOM):
3275         (WebCore::cookieRequestHeaderFieldValue):
3276         (WebCore::cookiesEnabled):
3277         (WebCore::getRawCookies):
3278         (WebCore::deleteCookie):
3279         (WebCore::getHostnamesWithCookies):
3280         (WebCore::deleteCookiesForHostname):
3281         (WebCore::deleteAllCookies):
3282
3283 2012-11-16  Byungwoo Lee  <bw80.lee@samsung.com>
3284
3285         Fix assertion bug of build fix r134961
3286         https://bugs.webkit.org/show_bug.cgi?id=102533
3287
3288         Reviewed by Martin Robinson.
3289
3290         Assertion condition should be '!d->m_currentWebChallenge.isNull()'
3291
3292         * platform/network/soup/ResourceHandleSoup.cpp:
3293         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
3294
3295 2012-11-16  Tommy Widenflycht  <tommyw@google.com>
3296
3297         [chromium] MediaStream API: Add missing WebRTCPeerConnectionHandlerClient::didAddRemoteDataChannel
3298         https://bugs.webkit.org/show_bug.cgi?id=102386
3299
3300         Reviewed by Adam Barth.
3301
3302         Existing tests expanded to cover patch.
3303
3304         * platform/mediastream/RTCDataChannelDescriptor.cpp:
3305         (WebCore::RTCDataChannelDescriptor::RTCDataChannelDescriptor):
3306         (WebCore::RTCDataChannelDescriptor::readyStateChanged):
3307         * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.cpp:
3308         (WebCore::RTCPeerConnectionHandlerChromium::didAddRemoteDataChannel):
3309         (WebCore):
3310         * platform/mediastream/chromium/RTCPeerConnectionHandlerChromium.h:
3311         (WebKit):
3312         (RTCPeerConnectionHandlerChromium):
3313
3314 2012-11-16  Scott Violet  <sky@chromium.org>
3315
3316         [chromium] Copy linux theme related files to default
3317         https://bugs.webkit.org/show_bug.cgi?id=102403
3318
3319         Reviewed by Tony Chang
3320
3321         Transitional patch that copies linux WebThemeEngine to default directory.
3322
3323         No new tests, refactoring only.
3324
3325         * WebCore.gyp/WebCore.gyp: Update compile rules when use_default_render_theme is set.
3326         * WebCore.gypi: Adds new files.
3327         * platform/chromium/PlatformSupport.h:
3328         * platform/chromium/PlatformThemeChromiumDefault.cpp: Copied from Source/WebCore/platform/chromium/PlatformThemeChromiumLinux.cpp.
3329         * platform/chromium/PlatformThemeChromiumDefault.h: Copied from Source/WebCore/platform/chromium/PlatformThemeChromiumLinux.h.
3330         * platform/chromium/ScrollbarThemeChromiumDefault.cpp: Copied from Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp.
3331         * platform/chromium/ScrollbarThemeChromiumDefault.h: Copied from Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.h.
3332         * rendering/RenderThemeChromiumDefault.cpp: Copied from Source/WebCore/rendering/RenderThemeChromiumLinux.cpp.
3333         * rendering/RenderThemeChromiumDefault.h: Copied from Source/WebCore/rendering/RenderThemeChromiumLinux.h.
3334
3335 2012-11-16  Alec Flett  <alecflett@chromium.org>
3336
3337         IndexedDB: add missing 'explicit' and fix backing store release
3338         https://bugs.webkit.org/show_bug.cgi?id=102450
3339
3340         Reviewed by Tony Chang.
3341
3342         A inconsequential regression was introduced in http://trac.webkit.org/changeset/134129
3343         which resulted in objects sticking around a bit longer than
3344         expected. This makes sure the LevelDBTransaction is released
3345         at the moment of commit/rollback rather than when IDBTransactionBackendImpl
3346         is destroyed.
3347
3348         No new tests, this is just internal state that will affect
3349         some future refactoring.
3350
3351         * Modules/indexeddb/IDBBackingStore.h:
3352         (Cursor):
3353         (Transaction):
3354         (WebCore::IDBBackingStore::Transaction::reset):
3355         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
3356         (WebCore::IDBTransactionBackendImpl::abort):
3357         (WebCore::IDBTransactionBackendImpl::commit):
3358
3359 2012-11-16  Dimitri Glazkov  <dglazkov@chromium.org>
3360
3361         [Chromium] One last tweak to WebCore.gypi to make Win build not sad.
3362
3363         * WebCore.gypi: Removed one last mention of accessibility/gtk file.
3364
3365 2012-11-16  Robert Flack  <flackr@chromium.org>
3366
3367         Handle gesture events on scrollbars.
3368         https://bugs.webkit.org/show_bug.cgi?id=101516
3369
3370         Reviewed by Antonio Gomes.
3371
3372         Adds a gesture event handler to scrollbars and sends gestures beginning
3373         over a scrollbar to this handler to allow touch scrolling scrollbars.
3374
3375         Test: fast/events/touch/gesture/gesture-scrollbar.html
3376
3377         * page/EventHandler.cpp:
3378         (WebCore::EventHandler::clear):
3379         (WebCore::EventHandler::handleGestureEvent):
3380         (WebCore::EventHandler::isScrollbarHandlingGestures):
3381         (WebCore):
3382         * page/EventHandler.h:
3383         (EventHandler):
3384         * platform/Scrollbar.cpp:
3385         (WebCore::Scrollbar::Scrollbar):
3386         (WebCore):
3387         (WebCore::Scrollbar::gestureEvent):
3388         (WebCore::Scrollbar::mouseMoved):
3389         (WebCore::Scrollbar::mouseUp):
3390         (WebCore::Scrollbar::mouseDown):
3391         * platform/Scrollbar.h:
3392         (WebCore):
3393         (Scrollbar):
3394         * platform/ScrollbarTheme.h:
3395         (WebCore::ScrollbarTheme::hitTest):
3396         * platform/ScrollbarThemeComposite.cpp:
3397         (WebCore::ScrollbarThemeComposite::hitTest):
3398         * platform/ScrollbarThemeComposite.h:
3399         (ScrollbarThemeComposite):
3400         * platform/qt/ScrollbarThemeQStyle.cpp:
3401         (WebCore::ScrollbarThemeQStyle::hitTest):
3402         * platform/qt/ScrollbarThemeQStyle.h:
3403         (ScrollbarThemeQStyle):
3404
3405 2012-11-16  Xianzhu Wang  <wangxianzhu@chromium.org>
3406
3407         [Chromium-Android] Stack overflow in MediaControlsChromiumAndroid.cpp
3408         https://bugs.webkit.org/show_bug.cgi?id=102444
3409
3410         Reviewed by Adam Barth.
3411
3412         No new tests. Have been covered by many existing layout tests.
3413
3414         * html/shadow/MediaControlsChromiumAndroid.cpp:
3415         (WebCore::MediaControls::create): Calls createControls instead of itself.
3416
3417 2012-11-16  Andreas Kling  <akling@apple.com>
3418
3419         StyleResolver: Optimize sharing candidate evaluation for elements with shared attribute data.
3420         <http://webkit.org/b/102507>
3421
3422         Reviewed by Antti Koivisto.
3423
3424         When evaluating two elements as potential style sharing candidate, we have a whole bunch of code
3425         comparing the various attributes that would prevent sharing.
3426
3427         If the two elements both share the same ElementAttributeData, we can skip all those checks
3428         since they are guaranteed to have equal attributes.
3429
3430         Cuts the time spent in canShareStyleWithElement() by 25% on the HTML5 spec at <http://whatwg.org/c>.
3431
3432         * css/StyleResolver.cpp:
3433         (WebCore::haveIdenticalStyleAffectingAttributes):
3434         (WebCore::StyleResolver::canShareStyleWithElement):
3435
3436 2012-11-16  Byungwoo Lee  <bw80.lee@samsung.com>
3437
3438         [EFL][GTK] Build fix after r134955
3439         https://bugs.webkit.org/show_bug.cgi?id=102527
3440
3441         Reviewed by Martin Robinson.
3442
3443         Fix the EFL,GTK debug bulid fails after r134955.
3444
3445         * platform/network/soup/ResourceHandleSoup.cpp:
3446         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
3447
3448 2012-11-15  Alexey Proskuryakov  <ap@apple.com>
3449
3450         Private Browsing is a per-page setting that sets a global value
3451         https://bugs.webkit.org/show_bug.cgi?id=67870
3452
3453         Reviewed by Sam Weinig.
3454
3455         Make ResourceHandle{Mac,CFNet} use context to access storage session.
3456
3457         * WebCore.exp.in: We track less session state in WebCore now, so we need fewer
3458         exports.
3459
3460         * loader/FrameNetworkingContext.h: Added an OVERRIDE.
3461
3462         * page/Settings.cpp: (WebCore::Settings::setPrivateBrowsingEnabled): WebCore
3463         no longer keeps track of a globally enabled private CFNetwork storage session.
3464