Source/WebCore: IndexedDB: Propagate more leveldb errors to IDBIndex and IDBObjectStore
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-12-04  David Grogan  <dgrogan@chromium.org>
2
3         IndexedDB: Propagate more leveldb errors to IDBIndex and IDBObjectStore
4         https://bugs.webkit.org/show_bug.cgi?id=103782
5
6         Reviewed by Tony Chang.
7
8         index.get[Key]() and objectStore.get() will receive more error events.
9
10         * Modules/indexeddb/IDBBackingStore.cpp:
11         (WebCore::IDBBackingStore::getRecord):
12         (WebCore::versionExists):
13         (WebCore::IDBBackingStore::findKeyInIndex):
14         (WebCore::IDBBackingStore::getPrimaryKeyViaIndex):
15         (WebCore::IDBBackingStore::keyExistsInIndex):
16         * Modules/indexeddb/IDBBackingStore.h:
17         (IDBBackingStore):
18         * Modules/indexeddb/IDBIndexBackendImpl.cpp:
19         (WebCore::IDBIndexBackendImpl::getInternal):
20         (WebCore::IDBIndexBackendImpl::getKeyInternal):
21         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
22         (WebCore::IDBObjectStoreBackendImpl::getInternal):
23         (WebCore):
24
25 2012-12-04  Kentaro Hara  <haraken@chromium.org>
26
27         [V8] Remove IntegerCache::m_initialized
28         https://bugs.webkit.org/show_bug.cgi?id=103978
29
30         Reviewed by Adam Barth.
31
32         Thanks to r136479, we can now initialize V8 integers in IntegerCache's
33         constructor. We can remove IntegerCache::m_initialized, which slightly
34         improves performance.
35
36         [Bindings/scroll-top.html in Chromium/Linux]
37         Before this patch: 285 runs/sec, 281 runs/sec, 281 runs/sec, 280 runs/sec
38         After this patch : 290 runs/sec, 291 runs/sec, 297 runs/sec, 291 runs/sec
39
40         No tests. No change in behavior.
41
42         * bindings/v8/V8ValueCache.cpp:
43         (WebCore::IntegerCache::IntegerCache):
44         (WebCore::IntegerCache::~IntegerCache):
45         * bindings/v8/V8ValueCache.h:
46         (IntegerCache):
47         (WebCore::IntegerCache::v8Integer):
48         (WebCore::IntegerCache::v8UnsignedInteger):
49         (WebCore):
50
51 2012-12-04  Kentaro Hara  <haraken@chromium.org>
52
53         [V8] Replace String::New("symbol") with String::NewSymbol("symbol")
54         https://bugs.webkit.org/show_bug.cgi?id=103989
55
56         Reviewed by Adam Barth.
57
58         In V8, a symbol lookup is faster than a string lookup. We should use
59         String::NewSymbol("symbol") for symbols.
60
61         No tests. No change in behavior.
62
63         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
64         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
65         (WebCore::V8HTMLCanvasElement::getContextCallback):
66         * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
67         (WebCore::V8InjectedScriptHost::typeCallback):
68         (WebCore::V8InjectedScriptHost::functionDetailsCallback):
69         (WebCore::getJSListenerFunctions):
70         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
71         (WebCore::populateContextMenuItems):
72
73 2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
74
75         [CSS Grid Layout] Implement CSS parsing and handling for <track-minmax>
76         https://bugs.webkit.org/show_bug.cgi?id=103799
77
78         Reviewed by Tony Chang.
79
80         This change adds support for:
81         <track-minmax> => minmax( <track-breadth> , <track-breadth> ) | auto | <track-breadth>
82         (note that we already supported auto | <track-breadth>).
83
84         The change is mostly mechanical, the only newness is that GridTrackSize was updated to
85         hold 2 Lengths internally and we map the single Length case to 2 by duplicating the value
86         as this matches the rendering algorithm in the spec.
87
88         Tests: fast/css-grid-layout/grid-columns-rows-get-set-multiple.html
89                fast/css-grid-layout/resources/grid-columns-rows-get-set-multiple.js
90
91         * css/CSSComputedStyleDeclaration.cpp:
92         (WebCore::valueForGridTrackBreadth):
93         Changed the function to do the conversion of one track breadth (one Length).
94         This was forgotten in the preparatory change in bug 103703.
95
96         (WebCore::valueForGridTrackMinMax):
97         Convert the value back using valueForGridTrackBreadth.
98
99         * css/CSSFunctionValue.cpp:
100         (WebCore::CSSFunctionValue::CSSFunctionValue):
101         * css/CSSFunctionValue.h:
102         (WebCore::CSSFunctionValue::create):
103         (CSSFunctionValue):
104         Added a new constructor. This enables us to return minmax(..., ...) when queried
105         from JavaScript. I couldn't find a better way to serialize inside CSSComputedStyleDeclaration
106         so that it properly match the function output.
107
108         * css/CSSParser.cpp:
109         (WebCore::CSSParser::parseGridTrackMinMax):
110         Added parsing for the new syntax. We convert the 2 values into a Pair if we manage to
111         parse both values correctly.
112
113         * css/StyleResolver.cpp:
114         (WebCore::createGridTrackMinMax):
115         Updated to handle a Pair - for minmax - and set the 2 values on GridTrackSize.
116
117         * rendering/RenderGrid.cpp:
118         (WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
119         Updated to check the style. For now, we don't handle minmax values.
120
121         * rendering/style/GridTrackSize.h:
122         (WebCore::GridTrackSize::GridTrackSize):
123         (WebCore::GridTrackSize::length):
124         (WebCore::GridTrackSize::setLength):
125         (WebCore::GridTrackSize::minTrackBreadth):
126         (WebCore::GridTrackSize::maxTrackBreadth):
127         (WebCore::GridTrackSize::setMinMax):
128         (WebCore::GridTrackSize::operator==):
129         Updated the class to handle minmax values. This means that we now always store
130         2 values (the <length> case being a subset of minmax, however we kept the distinction
131         to be able to reconstruct a <length> for getComputedStyle).
132
133 2012-12-04  Elliott Sprehn  <esprehn@chromium.org>
134
135         parser* methods in ContainerNode should not support DocumentFragment
136         https://bugs.webkit.org/show_bug.cgi?id=103965
137
138         Reviewed by Darin Adler.
139
140         Only parserInsertBefore ever supported DocumentFragment and this feature
141         is never used. It appears this code ended up in parserInsertBefore when
142         it was created as a copy of insertBefore that didn't fire events. This
143         patch removes that code and adds assertions that we never pass
144         DocumentFragments since doing so would cause a corrupted tree as we never
145         check checkAcceptChild or do other validation in the parser methods.
146
147         No new tests, just refactoring.
148
149         * dom/ContainerNode.cpp:
150         (WebCore::ContainerNode::parserInsertBefore):
151         (WebCore::ContainerNode::parserRemoveChild):
152         (WebCore::ContainerNode::parserAppendChild):
153
154 2012-12-04  Elliott Sprehn  <esprehn@gmail.com>
155
156         Simplify ShadowRoot::cloneNode(bool,ExceptionCode)
157         https://bugs.webkit.org/show_bug.cgi?id=103928
158
159         Reviewed by Dimitri Glazkov.
160
161         ShadowRoot can never be cloned and ShadowRoot::cloneNode(bool) always
162         returns null so there's no reason to have code in the cloneNode method
163         for script that acts as if it may not return null.
164
165         * dom/ShadowRoot.cpp:
166         (WebCore::ShadowRoot::cloneNode):
167
168 2012-12-04  Elliott Sprehn  <esprehn@chromium.org>
169
170         setIsInTopLayer is not really a setter
171         https://bugs.webkit.org/show_bug.cgi?id=103912
172
173         Reviewed by Eric Seidel.
174
175         Element::setInTopLayer isn't just a setter, it also adds the element
176         to the top layer vector in the document which changes it's display and
177         causes a reattach.
178
179         To make this more obvious make HTMLDialogElement use the methods on
180         Document and make those update the state boolean.
181
182         There also doesn't seem to be any reason for setInTopLayer
183         or isInTopLayer to be virtual, it appears it was a typo.
184
185         No new tests, just refactoring.
186
187         * dom/Document.cpp:
188         (WebCore::Document::addToTopLayer):
189         (WebCore::Document::removeFromTopLayer):
190         * dom/Element.cpp:
191         (WebCore::Element::setIsInTopLayer):
192         * dom/Element.h:
193         * html/HTMLDialogElement.cpp:
194         (WebCore::HTMLDialogElement::close):
195         (WebCore::HTMLDialogElement::showModal):
196
197 2012-12-04  Elliott Sprehn  <esprehn@chromium.org>
198
199         Automatically handle suspend and resume of post attach callbacks
200         https://bugs.webkit.org/show_bug.cgi?id=103910
201
202         Reviewed by Eric Seidel.
203
204         Use RAII to handle suspend and resume of post attach callbacks since
205         they should always be called in pairs.
206
207         No new tests, just refactoring.
208
209         * dom/ContainerNode.h:
210         (PostAttachCallbackDisabler):
211         (WebCore::PostAttachCallbackDisabler::PostAttachCallbackDisabler):
212         (WebCore::PostAttachCallbackDisabler::~PostAttachCallbackDisabler):
213         (ContainerNode):
214         * dom/Document.cpp:
215         (WebCore::Document::recalcStyle):
216         * dom/Element.cpp:
217         (WebCore::Element::attach):
218         * html/HTMLFormControlElement.cpp:
219         (WebCore::HTMLFormControlElement::attach):
220         * html/HTMLInputElement.cpp:
221         (WebCore::HTMLInputElement::attach):
222         * html/HTMLPlugInImageElement.cpp:
223         (WebCore::HTMLPlugInImageElement::attach):
224         (WebCore):
225
226 2012-12-04  Elliott Sprehn  <esprehn@chromium.org>
227
228         createRareData should return a PassOwnPtr
229         https://bugs.webkit.org/show_bug.cgi?id=103851
230
231         Reviewed by Eric Seidel.
232
233         createRareData should return a PassOwnPtr, not an OwnPtr since it's
234         transfering ownership.
235
236         * dom/Element.cpp:
237         (WebCore::Element::createRareData):
238         * dom/Element.h:
239         (Element):
240         * dom/Node.cpp:
241         (WebCore::Node::createRareData):
242         * dom/Node.h:
243
244 2012-12-04  Filip Pizlo  <fpizlo@apple.com>
245
246         Rename Profiler to LegacyProfiler
247         https://bugs.webkit.org/show_bug.cgi?id=104031
248
249         Rubber stamped by Mark Hahnenberg
250
251         Just renaming, no new tests.
252
253         * ForwardingHeaders/profiler/LegacyProfiler.h: Copied from Source/WebCore/ForwardingHeaders/profiler/Profiler.h.
254         * ForwardingHeaders/profiler/Profiler.h: Removed.
255         * bindings/js/ScriptProfiler.cpp:
256         (WebCore::ScriptProfiler::start):
257         (WebCore::ScriptProfiler::stop):
258
259 2012-12-04  James Simonsen  <simonjam@chromium.org>
260
261         [User Timing] Fix clang build by removing need for exit time destructor
262         https://bugs.webkit.org/show_bug.cgi?id=104036
263
264         Reviewed by Tony Gentilcore.
265
266         Modeled after r99588.
267
268         No new tests. No change in functionality.
269
270         * page/PerformanceUserTiming.cpp:
271         (WebCore::UserTiming::UserTiming):
272         (WebCore::UserTiming::mark):
273         (WebCore::UserTiming::findExistingMarkStartTime):
274         * page/PerformanceUserTiming.h:
275         (UserTiming):
276
277 2012-12-04  James Simonsen  <simonjam@chromium.org>
278
279         [User Timing] Fix negative durations
280         https://bugs.webkit.org/show_bug.cgi?id=104038
281
282         Reviewed by Tony Gentilcore.
283
284         At some point, we went from passing in a duration to passing in the end time. User Timing
285         wasn't updated.
286
287         Tests: http/tests/w3c/webperf/submission/Intel/user-timing
288
289         * page/PerformanceMark.h:
290         (WebCore::PerformanceMark::PerformanceMark):
291         * page/PerformanceUserTiming.cpp:
292         (WebCore::UserTiming::measure):
293
294 2012-12-04  Abhishek Arya  <inferno@chromium.org>
295
296         Heap-use-after-free in WebCore::StyleCachedImageSet::cssValue
297         https://bugs.webkit.org/show_bug.cgi?id=100621
298
299         Reviewed by Eric Seidel.
300
301         r115639 fixed a memory leak caused by reference cycle between StyleCachedImageSet
302         and its owner CSSImageSetValue. The fix caused StyleCachedImageSet to maintain
303         a weak pointer to CSSImageSetValue. This patch makes sure that the weak pointer
304         is cleared when CSSImageSetValue is going away.
305
306         Test: fast/css/image-set-value-not-removed-crash.html
307
308         * css/CSSImageSetValue.cpp:
309         (WebCore::CSSImageSetValue::~CSSImageSetValue):
310         * rendering/style/StyleCachedImageSet.h:
311         (WebCore::StyleCachedImageSet::clearImageSetValue):
312         (StyleCachedImageSet):
313
314 2012-12-04  Adam Barth  <abarth@webkit.org>
315
316         NodeFilter leaks memory in V8
317         https://bugs.webkit.org/show_bug.cgi?id=104027
318
319         Reviewed by Eric Seidel.
320
321         NodeFilter holds a RefPtr to NodeFilterCondition, which holds a
322         ScopedPersistent to its callback function. If the callback function can
323         see the NodeFilter wrapper, we have a cycle and a leak.
324
325         This patch makes the NodeFilterCondition hold a weak pointer to the
326         callback function and ties the lifetime of that callback function to
327         the NodeFilter wrapper (so they live and die together).
328
329         * bindings/v8/V8GCController.cpp:
330         * bindings/v8/V8NodeFilterCondition.cpp:
331         (WebCore::V8NodeFilterCondition::V8NodeFilterCondition):
332         (WebCore::V8NodeFilterCondition::weakCallback):
333         (WebCore):
334         (WebCore::V8NodeFilterCondition::acceptNode):
335         * bindings/v8/V8NodeFilterCondition.h:
336         (WebCore::V8NodeFilterCondition::create):
337         (V8NodeFilterCondition):
338         (WebCore::V8NodeFilterCondition::callback):
339         * dom/NodeFilter.h:
340         (WebCore::NodeFilter::condition):
341
342 2012-12-04  Abhishek Arya  <inferno@chromium.org>
343
344         Crash in CachedResource::checkNotify due to -webkit-crossfade.
345         https://bugs.webkit.org/show_bug.cgi?id=98068
346
347         Reviewed by Nate Chapin.
348
349         Make sure to not re-add the same client again for |m_cachedFromImage|
350         and |m_cachedToImage|. This would otherwise cause the CSSCrossfadeValue
351         client to not get removed from its cached image resource (when it is
352         going away).
353
354         Test: fast/images/crossfade-client-not-removed-crash.html
355
356         * css/CSSCrossfadeValue.cpp:
357         (WebCore::CSSCrossfadeValue::loadSubimages):
358
359 2012-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
360
361         Heap-use-after-free in WebCore::RenderLayer::paintList [MathML]
362         https://bugs.webkit.org/show_bug.cgi?id=100764
363
364         Reviewed by Eric Seidel.
365
366         Test: mathml/mfenced-root-layer.html
367
368         * rendering/RenderLayer.cpp:
369         (WebCore::RenderLayer::stackingContext):
370         Fixed this function to ensure that it always returns a stacking context, the bug
371         was that the document element's layer wasn't guaranteed to be a stacking context.
372
373 2012-12-04  Adam Barth  <abarth@webkit.org>
374
375         [V8] GetNativeType in CodeGeneratorV8.pm needs a bath
376         https://bugs.webkit.org/show_bug.cgi?id=104022
377
378         Reviewed by Eric Seidel.
379
380         This change shouldn't have any effect on the generated code.
381
382         * bindings/scripts/CodeGeneratorV8.pm:
383         (GetNativeType):
384             - DOMUserData was removed in 2005. There's no need for the code
385               generator to still know about it.
386         (JSValueToNative):
387         (ConvertToV8StringResource):
388
389 2012-12-04  Adam Barth  <abarth@webkit.org>
390
391         [V8] EventTarget shouldn't be a special snowflake
392         https://bugs.webkit.org/show_bug.cgi?id=104018
393
394         Reviewed by Eric Seidel.
395
396         Previously we special-cased the toV8 operation for event targets.
397         There's no need for that. We can use IDL attribute to handle
398         EventTarget using the same general-purpose code that we use for other
399         interfaces.
400
401         * WebCore.gypi:
402         * bindings/scripts/CodeGeneratorV8.pm:
403         (NativeToJSValue):
404         * bindings/v8/V8AbstractEventListener.cpp:
405         (WebCore::V8AbstractEventListener::getReceiverObject):
406         * bindings/v8/V8DOMWrapper.cpp:
407         * bindings/v8/V8DOMWrapper.h:
408         (V8DOMWrapper):
409         * bindings/v8/V8WorkerContextEventListener.cpp:
410         (WebCore::V8WorkerContextEventListener::getReceiverObject):
411         * bindings/v8/custom/V8EventTargetCustom.cpp: Added.
412         (WebCore):
413         (WebCore::toV8):
414         * dom/EventTarget.idl:
415
416 2012-12-04  Florin Malita  <fmalita@chromium.org>
417
418         Stale SVGUseElement reference in CachedResource::checkNotify()
419         https://bugs.webkit.org/show_bug.cgi?id=104004
420
421         Reviewed by Eric Seidel.
422
423         SVGUseElement tracks one CachedSVGDocument at a time (for external references), but when
424         the href attribute is updated it fails to unregister with the current CachedSVGDocument
425         and only updates its CachedSVGDocument with the new instance. This leaves an untracked
426         reference with the original CachedSVGDocument.
427
428         The patch adds the missing removeClient() call on href change, and encapsulates the
429         CachedSVGDocument manipulation in a helper method which handles the necessary cleanup.
430
431         Test: svg/custom/use-href-update-crash.svg
432
433         * svg/SVGUseElement.cpp:
434         (WebCore::SVGUseElement::~SVGUseElement):
435         (WebCore::SVGUseElement::svgAttributeChanged):
436         (WebCore::SVGUseElement::setCachedDocument):
437         (WebCore):
438         * svg/SVGUseElement.h:
439         (SVGUseElement):
440
441 2012-12-04  Yury Semikhatsky  <yurys@chromium.org>
442
443         Web Inspector: Can't take a heap snapshot in chromium ("Uncaught ReferenceError")
444         https://bugs.webkit.org/show_bug.cgi?id=103997
445
446         Reviewed by Pavel Feldman.
447
448         utilities.js used in both page and worker contexts should not access window
449         object as there is no one in case of workers. NonLeakingMutationObserver implementation
450         has moved to DOMExtension.js
451
452         * inspector/front-end/DOMExtension.js:
453         (NonLeakingMutationObserver.NonLeakingMutationObserver._unloadListener):
454         (NonLeakingMutationObserver):
455         (NonLeakingMutationObserver.prototype.observe):
456         (NonLeakingMutationObserver.prototype.disconnect):
457         * inspector/front-end/utilities.js:
458
459 2012-12-04  Sheriff Bot  <webkit.review.bot@gmail.com>
460
461         Unreviewed, rolling out r136509.
462         http://trac.webkit.org/changeset/136509
463         https://bugs.webkit.org/show_bug.cgi?id=104015
464
465         broke layout tests (Requested by eae on #webkit).
466
467         * platform/graphics/IntSize.h:
468         (WebCore::IntSize::scale):
469
470 2012-12-04  Antoine Quint  <graouts@apple.com>
471
472         INVALID_STATE_ERR error upon calling .addCue() for an already-in-use cue
473         https://bugs.webkit.org/show_bug.cgi?id=103264
474
475         Reviewed by Eric Carlson.
476
477         Adhere to the latest spec for TextTrack's .addCue() method. This also fixes
478         https://bugs.webkit.org/show_bug.cgi?id=103265 and we've removed
479         media/track/opera/interfaces/TextTrack/addCue.html from the Skipped list.
480
481         * html/track/TextTrack.cpp:
482         (WebCore::TextTrack::addCue):
483         * html/track/TextTrack.h:
484         (TextTrack):
485         * html/track/TextTrack.idl:
486
487 2012-12-04  Mike West  <mkwst@chromium.org>
488
489         Log to console when forms and popups are blocked by 'sandbox'.
490         https://bugs.webkit.org/show_bug.cgi?id=103615
491
492         Reviewed by Adam Barth.
493
494         Adds two console messages to cover form submissions blocked by a
495         sandboxed frame lacking the 'allow-forms' permission, and window
496         creation blocked by a sandboxed frame lacking the 'allow-popups'
497         permission.
498
499         * loader/FrameLoader.cpp:
500         (WebCore::FrameLoader::submitForm):
501             Log a warning when form submission is blocked by sandboxing flags.
502         (WebCore::createWindow):
503             Log a warning when window.open is blocked due to sandboxing flags.
504
505 2012-12-04  Kentaro Hara  <haraken@chromium.org>
506
507         [V8] Make v8::Null(isolate) faster by caching the value in V8 bindings
508         https://bugs.webkit.org/show_bug.cgi?id=103862
509
510         Reviewed by Adam Barth.
511
512         Performance comparison between V8 and JSC revealed that DOM attributes
513         that return v8::Null(isolate) are much slower than JSC.
514         (https://docs.google.com/a/chromium.org/spreadsheet/ccc?key=0AlobCOyvTnPKdDg5S0dMdGRGRTRSaW53V1ppVzh6eXc#gid=2)
515
516         We can optimize v8::Null(isolate) by caching the value to V8PerIsolateData.
517         (Although I don't like the optimization, it looks difficult to optimize
518         v8::Null(isolate) more.)
519
520         [Bindings/undefined-first-child.html]
521         Before: 969 runs/sec, 970 runs/sec, 962 runs/sec
522         After:  1086 runs/sec, 1085 runs/sec, 1086 runs/sec
523
524         No tests. No change in behavior.
525
526         * bindings/scripts/CodeGeneratorV8.pm:
527         (GenerateHeader):
528         (GenerateNormalAttrGetter):
529         (GenerateFunctionCallback):
530         (NativeToJSValue):
531         * bindings/scripts/test/V8/V8TestNode.h:
532         (WebCore::toV8Fast):
533         * bindings/scripts/test/V8/V8TestObj.cpp:
534         (WebCore::TestObjV8Internal::contentDocumentAttrGetter):
535         (WebCore::TestObjV8Internal::getSVGDocumentCallback):
536         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
537         (WebCore::TestSerializedScriptValueInterfaceV8Internal::valueAttrGetter):
538         (WebCore::TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttrGetter):
539         (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter):
540         (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter):
541         * bindings/v8/V8Binding.h:
542         (WebCore):
543         (WebCore::v8Null):
544         (WebCore::v8NullWithCheck):
545         * bindings/v8/V8PerIsolateData.cpp:
546         (WebCore::V8PerIsolateData::V8PerIsolateData):
547         * bindings/v8/V8PerIsolateData.h:
548         (WebCore::V8PerIsolateData::v8Null):
549         (V8PerIsolateData):
550
551 2012-12-04  Alexis Menard  <alexis@webkit.org>
552
553         Add an helper function in CSSParser to check for '/' character.
554         https://bugs.webkit.org/show_bug.cgi?id=104009
555
556         Reviewed by Ryosuke Niwa.
557
558         Remove unwanted null check from r136525
559
560         No new tests : just a refactor, existing tests should cover.
561
562         * css/CSSParser.cpp:
563         (WebCore::isForwardSlashOperator):
564
565 2012-12-04  Alexis Menard  <alexis@webkit.org>
566
567         Add an helper function in CSSParser to check for '/' character.
568         https://bugs.webkit.org/show_bug.cgi?id=104009
569
570         Reviewed by Ryosuke Niwa.
571
572         I'm about to add the same pattern in a following patch. Let's do an
573         helper function first. We also did that for the comma. The slash
574         character is pretty used in shorthands definitions.
575
576         No new tests : just a refactor, existing tests should cover.
577
578         * css/CSSParser.cpp:
579         (WebCore::isForwardSlashOperator):
580         (WebCore):
581         (WebCore::CSSParser::parseFillShorthand):
582         (WebCore::CSSParser::parseFont):
583         (WebCore::CSSParser::parseBorderImage):
584         (WebCore::CSSParser::parseAspectRatio):
585
586 2012-12-04  Ken Kania  <kkania@chromium.org>
587
588         Inspector: Introduce Input.dispatchKeyEvent and DOM.focus for typing simulation.
589         https://bugs.webkit.org/show_bug.cgi?id=103530
590
591         Reviewed by Yury Semikhatsky.
592
593         Input.dispatchKeyEvent simply calls EventHandler::keyEvent with the key event data
594         from the command parameters. The client will be responsible for providing proper
595         events to simulate desired typing behavior.
596         DOM.focus calls focus on a dom element.
597
598         Tests: inspector-protocol/dom-focus.html
599                inspector-protocol/input-dispatchKeyEvent.html
600
601         * CMakeLists.txt:
602         * GNUmakefile.list.am:
603         * Target.pri:
604         * WebCore.gypi:
605         * WebCore.vcproj/WebCore.vcproj:
606         * WebCore.xcodeproj/project.pbxproj:
607         * inspector/Inspector.json:
608         * inspector/InspectorAllInOne.cpp:
609         * inspector/InspectorController.cpp:
610         (WebCore::InspectorController::InspectorController):
611         * inspector/InspectorDOMAgent.cpp:
612         (WebCore::InspectorDOMAgent::focus):
613         (WebCore):
614         (WebCore::InspectorDOMAgent::resolveNode):
615         * inspector/InspectorDOMAgent.h:
616         (InspectorDOMAgent):
617         * inspector/InspectorInputAgent.cpp: Added.
618         (WebCore):
619         (WebCore::InspectorInputAgent::InspectorInputAgent):
620         (WebCore::InspectorInputAgent::~InspectorInputAgent):
621         (WebCore::InspectorInputAgent::dispatchKeyEvent):
622         * inspector/InspectorInputAgent.h: Added.
623         (WebCore):
624         (InspectorInputAgent):
625         (WebCore::InspectorInputAgent::create):
626
627 2012-12-04  Dan Bernstein  <mitz@apple.com>
628
629         FontPlatformData has unnecessary m_textOrientation member
630         https://bugs.webkit.org/show_bug.cgi?id=103971
631
632         Reviewed by Darin Adler.
633
634         Nothing in SimpleFontData depends on the FontPlatformData’s textOrientation, so we don’t
635         need separate data for vertical-right and upright. We simply choose between
636         verticalRightOrientationFontData() and uprightOrientationFontData() based on the
637         textOrientation in the FontDescription.
638
639         * WebCore.exp.in: Updated FontPlatformData constructor exports.
640
641         * css/CSSFontFaceSource.cpp:
642         (WebCore::CSSFontFaceSource::getFontData): Removed the text orientation bit from the hash key,
643         and updated for the removal of the TextOrientation parameter to
644         CachedFont::platformDataFromCustomData().
645
646         * loader/cache/CachedFont.cpp:
647         (WebCore::CachedFont::platformDataFromCustomData): Removed the TextOrientation parameter.
648         * loader/cache/CachedFont.h:
649
650         * platform/graphics/FontCache.cpp:
651         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey): Removed the TextOrientation
652         parameter and initializer.
653         (WebCore::FontPlatformDataCacheKey::operator==): Updated for removal of m_textOrientation
654         member variable.
655         (FontPlatformDataCacheKey): Removed m_textOrientation member variable.
656         (WebCore::computeHash): Removed text orientation bit from the hash.
657         (WebCore::FontCache::getCachedFontPlatformData): Updated for FontPlatformDataCacheKey
658         change.
659
660         * platform/graphics/FontPlatformData.cpp:
661         (WebCore::FontPlatformData::FontPlatformData): Removed TextOrientation parameters and
662         initializers.
663         (WebCore::FontPlatformData::operator=): Updated for removal of m_textOrientation
664         member variable.
665         * platform/graphics/FontPlatformData.h:
666         (FontPlatformData): Removed m_textOrientation member variable, removed TextOrientation
667         parameters from constructors.
668         (WebCore::FontPlatformData::hash): Removed text orientation bit.
669         (WebCore::FontPlatformData::operator==): Updated for removed member variable.
670
671         * platform/graphics/cairo/FontCustomPlatformData.h:
672         (FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
673
674         * platform/graphics/chromium/FontCacheAndroid.cpp:
675         (WebCore::FontCache::createFontPlatformData): Updated for FontPlatformData change.
676
677         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
678         (WebCore::FontPlatformData::FontPlatformData): Removed TextOrientation parameter and
679         initializer.
680
681         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
682         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
683         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
684         (WebCore::FontPlatformData::FontPlatformData): Removed TextOrientation parameter and
685         initializers.
686         (WebCore::FontPlatformData::operator=): Updated for removed member variable.
687         (WebCore::FontPlatformData::operator==): Ditto.
688         (WebCore::FontPlatformData::hash): Removed text orientation bit.
689
690         * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.h:
691         (FontPlatformData): Removed TextOrientation parameter from the constructor declaration.
692
693         * platform/graphics/mac/FontCacheMac.mm:
694         (WebCore::FontCache::createFontPlatformData): Updated for FontPlatformData change.
695
696         * platform/graphics/mac/FontCustomPlatformData.cpp:
697         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
698
699         * platform/graphics/mac/FontCustomPlatformData.h:
700         (FontCustomPlatformData): Removed TextOrientation parameter from declaration of
701         fontPlatformData().
702
703         * platform/graphics/mac/SimpleFontDataMac.mm:
704         (WebCore::SimpleFontData::getCompositeFontReferenceFontData): Updated for FontPlatformData
705         change.
706
707         * platform/graphics/pango/FontCustomPlatformDataPango.cpp:
708         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
709         * platform/graphics/qt/FontCustomPlatformData.h:
710
711         * platform/graphics/qt/FontCustomPlatformDataQt.cpp:
712         (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
713
714         * platform/graphics/skia/FontCacheSkia.cpp:
715         (WebCore::FontCache::createFontPlatformData): Updated for FontPlatformData change.
716
717         * platform/graphics/skia/FontCustomPlatformData.cpp:
718         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
719         * platform/graphics/skia/FontCustomPlatformData.h:
720
721         * platform/graphics/win/FontCustomPlatformData.cpp:
722         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
723         * platform/graphics/win/FontCustomPlatformData.h:
724
725         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
726         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
727         * platform/graphics/win/FontCustomPlatformDataCairo.h:
728
729         * platform/graphics/win/FontPlatformDataCGWin.cpp:
730         (WebCore::FontPlatformData::FontPlatformData): Removed m_textOrientation initializer.
731
732         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
733         (WebCore::FontPlatformData::FontPlatformData): Ditto.
734
735         * platform/graphics/win/FontPlatformDataWin.cpp:
736         (WebCore::FontPlatformData::FontPlatformData): Ditto.
737
738         * platform/graphics/wince/FontCustomPlatformData.cpp:
739         (WebCore::FontCustomPlatformData::fontPlatformData): Removed TextOrientation parameter.
740         * platform/graphics/wince/FontCustomPlatformData.h:
741
742 2012-12-04  Charlie Reis  <creis@chromium.org>
743
744         Add FrameLoaderClient::didDisownOpener
745         https://bugs.webkit.org/show_bug.cgi?id=103789
746
747         Reviewed by Darin Fisher.
748
749         Adds a didDisownOwner notification when a frame's opener is cleared,
750         so that FrameLoaderClients can react.
751
752         No new tests.
753
754         * loader/FrameLoader.cpp:
755         (WebCore::FrameLoader::setOpener): Calls didDisownOpener if opener is cleared.
756         * loader/FrameLoaderClient.h:
757         (FrameLoaderClient):
758         (WebCore::FrameLoaderClient::didDisownOpener):
759
760 2012-12-04  Robert Hogan  <robert@webkit.org>
761
762         Redrawing issue with inserting new inline element between existing inline elements
763         https://bugs.webkit.org/show_bug.cgi?id=50315
764
765         Reviewed by Levi Weintraub.
766
767         When inserting an element such as '<span>text<br></span>' between two lineboxes, the second of which has leading space
768         collapsed away after a line-break, dirtyLinesFromChangeChild() needs to ensure that the linebox the fragment is inserted into (the second 
769         of the two lineboxes) gets dirtied. 
770         
771         Since the element has been inserted before the first element in the linebox, but after the collapsed leading
772         space, the search for the new element's linebox will go past the leading space to the previous linebox and select that
773         one by mistake.
774         
775         So in order to ensure the element's linebox is dirtied make sure its previous sibling is not the line-break object of the
776         linebox we selected when searching for a linebox to dirty. If the previous sibling is the linebox's line-break object then
777         the element is in the one after the one we selected and we should dirty that linebox too. 
778
779         Test: fast/inline/layout-after-inserting-nested-br.html
780
781         * rendering/RenderLineBoxList.cpp:
782         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
783
784 2012-12-04  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
785
786         IntSize::scale() should return rounded value
787         https://bugs.webkit.org/show_bug.cgi?id=103984
788
789         Reviewed by Kenneth Rohde Christiansen.
790
791         IntSize::scale() is now rounding float value to the nearest integer instead of blind type casting.
792
793         Test: css3/device-adapt/viewport-width-not-affecting-next-page.html
794
795         * platform/graphics/IntSize.h:
796         (WebCore::IntSize::scale):
797
798 2012-12-04  Adam Bergkvist  <adam.bergkvist@ericsson.com>
799
800         Add support for generic types in arrays and sequences to the code generators
801         https://bugs.webkit.org/show_bug.cgi?id=103642
802
803         Reviewed by Kentaro Hara.
804
805         Updated the bindings generators to support arrays and sequences of host objects.
806
807         - Arrays and sequences of host objects are mapped to Vector<RefPtr<%RefPtrType%> >.
808         - Fixed issue where "sequence<String>" was used in IDL files instead of "sequence<DOMString>".
809
810         Updated existing test results.
811
812         * Modules/indexeddb/IDBDatabase.idl:
813         * Modules/indexeddb/IDBObjectStore.idl:
814         * Modules/mediastream/RTCStatsElement.idl:
815         * Modules/websockets/WebSocket.idl:
816         * bindings/js/JSDOMBinding.h:
817         (WebCore::toRefPtrNativeArray):
818         (WebCore):
819         * bindings/scripts/CodeGenerator.pm:
820         (IsRefPtrType):
821         * bindings/scripts/CodeGeneratorJS.pm:
822         (AddIncludesForType):
823         (GetNativeType):
824         (GetNativeVectorInnerType):
825         (JSValueToNative):
826         (NativeToJSValue):
827         * bindings/scripts/CodeGeneratorV8.pm:
828         (GenerateNormalAttrGetter):
829         (GenerateNormalAttrSetter):
830         (GenerateParametersCheckExpression):
831         (GenerateFunctionCallString):
832         (GetNativeType):
833         (JSValueToNative):
834         (CreateCustomSignature):
835         (NativeToJSValue):
836         * bindings/scripts/test/JS/JSTestObj.cpp:
837         (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
838         * bindings/scripts/test/V8/V8TestObj.cpp:
839         (WebCore::TestObjV8Internal::longLongAttrAttrSetter):
840         (WebCore::TestObjV8Internal::unsignedLongLongAttrAttrSetter):
841         (WebCore::TestObjV8Internal::methodWithSequenceArgCallback):
842         (WebCore::TestObjV8Internal::overloadedMethod10Callback):
843         * bindings/v8/V8Binding.h:
844         (WebCore::toRefPtrNativeArray):
845         * testing/Internals.idl:
846
847 2012-12-04  Antoine Quint  <graouts@apple.com>
848
849         TextTrack's .kind property should return lower-case values
850         https://bugs.webkit.org/show_bug.cgi?id=103411
851
852         Reviewed by Eric Carlson.
853
854         While the HTML "kind" attribute on the <track> element allows upper-case values, the related APIs
855         on HTMLMediaElement and TextTrack expect only to deal with lower-case values. As such, we're updating
856         TextTrack::isValidKindKeyword() to be case-sensitive and ensure that values fed from the DOM (the values
857         read from HTML attributes) are lower-case'd.
858
859         Thanks to this fix, we're no longer skipping media/track/opera/interfaces/TextTrack/kind.html and
860         media/track/opera/interfaces/HTMLElement/HTMLMediaElement/addTextTrack.html 
861
862         This patch also fixes https://bugs.webkit.org/show_bug.cgi?id=103256.
863
864         * html/HTMLTrackElement.cpp:
865         (WebCore::HTMLTrackElement::parseAttribute):
866         (WebCore::HTMLTrackElement::ensureTrack):
867         * html/track/TextTrack.cpp:
868         (WebCore::TextTrack::isValidKindKeyword):
869
870 2012-12-04  Sheriff Bot  <webkit.review.bot@gmail.com>
871
872         Unreviewed, rolling out r136498.
873         http://trac.webkit.org/changeset/136498
874         https://bugs.webkit.org/show_bug.cgi?id=103992
875
876         Patch causes a lot of tests to crash in GTK+ bots (Requested
877         by KaL on #webkit).
878
879         * bindings/scripts/CodeGeneratorGObject.pm:
880         (GenerateProperties):
881         (GenerateHeader):
882         (GenerateCFile):
883         (GenerateEventTargetIface):
884         (WriteData):
885         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
886         (WebKit::core):
887         (WebKit::wrapFloat64Array):
888         (webkit_dom_float64array_finalize):
889         (webkit_dom_float64array_class_init):
890         (webkit_dom_float64array_init):
891         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.h:
892         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
893         (WebKit::core):
894         (WebKit::wrapTestActiveDOMObject):
895         (webkit_dom_test_active_dom_object_finalize):
896         (webkit_dom_test_active_dom_object_class_init):
897         (webkit_dom_test_active_dom_object_init):
898         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h:
899         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
900         (WebKit::core):
901         (WebKit::wrapTestCallback):
902         (webkit_dom_test_callback_finalize):
903         (webkit_dom_test_callback_class_init):
904         (webkit_dom_test_callback_init):
905         * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
906         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
907         (WebKit::core):
908         (WebKit::wrapTestCustomNamedGetter):
909         (webkit_dom_test_custom_named_getter_finalize):
910         (webkit_dom_test_custom_named_getter_class_init):
911         (webkit_dom_test_custom_named_getter_init):
912         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.h:
913         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
914         (WebKit::core):
915         (WebKit::wrapTestEventConstructor):
916         (webkit_dom_test_event_constructor_finalize):
917         (webkit_dom_test_event_constructor_class_init):
918         (webkit_dom_test_event_constructor_init):
919         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
920         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
921         (WebKit::core):
922         (WebKit::wrapTestEventTarget):
923         (webkit_dom_test_event_target_dispatch_event):
924         (webkit_dom_test_event_target_add_event_listener):
925         (webkit_dom_test_event_target_remove_event_listener):
926         (webkit_dom_test_event_target_finalize):
927         (webkit_dom_test_event_target_class_init):
928         (webkit_dom_test_event_target_init):
929         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h:
930         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
931         (WebKit::core):
932         (WebKit::wrapTestException):
933         (webkit_dom_test_exception_finalize):
934         (webkit_dom_test_exception_class_init):
935         (webkit_dom_test_exception_init):
936         * bindings/scripts/test/GObject/WebKitDOMTestException.h:
937         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
938         (WebKit::core):
939         (WebKit::wrapTestInterface):
940         (webkit_dom_test_interface_finalize):
941         (webkit_dom_test_interface_class_init):
942         (webkit_dom_test_interface_init):
943         * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
944         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
945         (WebKit::core):
946         (WebKit::wrapTestMediaQueryListListener):
947         (webkit_dom_test_media_query_list_listener_finalize):
948         (webkit_dom_test_media_query_list_listener_class_init):
949         (webkit_dom_test_media_query_list_listener_init):
950         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h:
951         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
952         (WebKit::core):
953         (WebKit::wrapTestNamedConstructor):
954         (webkit_dom_test_named_constructor_finalize):
955         (webkit_dom_test_named_constructor_class_init):
956         (webkit_dom_test_named_constructor_init):
957         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.h:
958         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
959         (WebKit::core):
960         (WebKit::wrapTestNode):
961         (webkit_dom_test_node_dispatch_event):
962         (webkit_dom_test_node_add_event_listener):
963         (webkit_dom_test_node_remove_event_listener):
964         (webkit_dom_test_node_finalize):
965         (webkit_dom_test_node_class_init):
966         (webkit_dom_test_node_init):
967         * bindings/scripts/test/GObject/WebKitDOMTestNode.h:
968         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
969         (WebKit::core):
970         (WebKit::wrapTestObj):
971         (webkit_dom_test_obj_finalize):
972         (webkit_dom_test_obj_class_init):
973         (webkit_dom_test_obj_init):
974         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
975         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.cpp:
976         (WebKit::core):
977         (WebKit::wrapTestOverloadedConstructors):
978         (webkit_dom_test_overloaded_constructors_finalize):
979         (webkit_dom_test_overloaded_constructors_class_init):
980         (webkit_dom_test_overloaded_constructors_init):
981         * bindings/scripts/test/GObject/WebKitDOMTestOverloadedConstructors.h:
982         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
983         (WebKit::core):
984         (WebKit::wrapTestSerializedScriptValueInterface):
985         (webkit_dom_test_serialized_script_value_interface_finalize):
986         (webkit_dom_test_serialized_script_value_interface_class_init):
987         (webkit_dom_test_serialized_script_value_interface_init):
988         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
989
990 2012-12-04  Markus Heintz  <markusheintz@chromium.org>
991
992         Web Inspector: Viewport console warnings cleanup.
993         https://bugs.webkit.org/show_bug.cgi?id=102890
994
995         Reviewed by Jochen Eisinger.
996
997         Improve the console message text for a viewport console warning and
998         change the log level to warning.
999
1000         No new tests added, as this change is covered by updates to existing
1001         test expectations.
1002
1003         * dom/ViewportArguments.cpp:
1004         (WebCore::viewportErrorMessageTemplate):
1005             Improve the console message text for invalid values.
1006         (WebCore::viewportErrorMessageLevel):
1007             Upgraded the TruncatedViewportArgumentValueError and the
1008             TargetDensityDpiUnsupported messages's MessageLeval to warning.
1009         (WebCore::reportViewportWarning):
1010             Adding only a comment for a FIXIT reminder.
1011
1012 2012-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1013
1014         [GTK] Use a private struct and placement new syntax in GObject DOM bindings
1015         https://bugs.webkit.org/show_bug.cgi?id=101074
1016
1017         Reviewed by Xan Lopez.
1018
1019         It allows to use RefPtr for the wrapped object and it simplifies
1020         the code.
1021
1022         * bindings/scripts/CodeGeneratorGObject.pm:
1023         (GenerateProperties):
1024         (GenerateHeader):
1025         (GenerateCFile):
1026         (GenerateEventTargetIface):
1027         (WriteData):
1028         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
1029         (_WebKitDOMFloat64ArrayPrivate):
1030         (WebKit::core):
1031         (WebKit::wrapFloat64Array):
1032         (webkit_dom_float64array_finalize):
1033         (webkit_dom_float64array_constructor):
1034         (webkit_dom_float64array_class_init):
1035         (webkit_dom_float64array_init):
1036         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.h:
1037         (_WebKitDOMFloat64Array):
1038         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1039         (_WebKitDOMTestActiveDOMObjectPrivate):
1040         (WebKit::core):
1041         (WebKit::wrapTestActiveDOMObject):
1042         (webkit_dom_test_active_dom_object_finalize):
1043         (webkit_dom_test_active_dom_object_constructor):
1044         (webkit_dom_test_active_dom_object_class_init):
1045         (webkit_dom_test_active_dom_object_init):
1046         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h:
1047         (_WebKitDOMTestActiveDOMObject):
1048         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1049         (_WebKitDOMTestCallbackPrivate):
1050         (WebKit::core):
1051         (WebKit::wrapTestCallback):
1052         (webkit_dom_test_callback_finalize):
1053         (webkit_dom_test_callback_constructor):
1054         (webkit_dom_test_callback_class_init):
1055         (webkit_dom_test_callback_init):
1056         * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
1057         (_WebKitDOMTestCallback):
1058         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
1059         (_WebKitDOMTestCustomNamedGetterPrivate):
1060         (WebKit::core):
1061         (WebKit::wrapTestCustomNamedGetter):
1062         (webkit_dom_test_custom_named_getter_finalize):
1063         (webkit_dom_test_custom_named_getter_constructor):
1064         (webkit_dom_test_custom_named_getter_class_init):
1065         (webkit_dom_test_custom_named_getter_init):
1066         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.h:
1067         (_WebKitDOMTestCustomNamedGetter):
1068         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1069         (_WebKitDOMTestEventConstructorPrivate):
1070         (WebKit::core):
1071         (WebKit::wrapTestEventConstructor):
1072         (webkit_dom_test_event_constructor_finalize):
1073         (webkit_dom_test_event_constructor_constructor):
1074         (webkit_dom_test_event_constructor_class_init):
1075         (webkit_dom_test_event_constructor_init):
1076         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
1077         (_WebKitDOMTestEventConstructor):
1078         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1079         (_WebKitDOMTestEventTargetPrivate):
1080         (WebKit::core):
1081         (WebKit::wrapTestEventTarget):
1082         (webkit_dom_test_event_target_dispatch_event):
1083         (webkit_dom_test_event_target_add_event_listener):
1084         (webkit_dom_test_event_target_remove_event_listener):
1085         (webkit_dom_test_event_target_finalize):
1086         (webkit_dom_test_event_target_constructor):
1087         (webkit_dom_test_event_target_class_init):
1088         (webkit_dom_test_event_target_init):
1089         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h:
1090         (_WebKitDOMTestEventTarget):
1091         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
1092         (_WebKitDOMTestExceptionPrivate):
1093         (WebKit::core):
1094         (WebKit::wrapTestException):
1095         (webkit_dom_test_exception_finalize):
1096         (webkit_dom_test_exception_constructor):
1097         (webkit_dom_test_exception_class_init):
1098         (webkit_dom_test_exception_init):
1099         * bindings/scripts/test/GObject/WebKitDOMTestException.h:
1100         (_WebKitDOMTestException):
1101         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1102         (_WebKitDOMTestInterfacePrivate):
1103         (WebKit::core):
1104         (WebKit::wrapTestInterface):
1105         (webkit_dom_test_interface_finalize):
1106         (webkit_dom_test_interface_constructor):
1107         (webkit_dom_test_interface_class_init):
1108         (webkit_dom_test_interface_init):
1109         * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
1110         (_WebKitDOMTestInterface):
1111         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
1112         (_WebKitDOMTestMediaQueryListListenerPrivate):
1113         (WebKit::core):
1114         (WebKit::wrapTestMediaQueryListListener):
1115         (webkit_dom_test_media_query_list_listener_finalize):
1116         (webkit_dom_test_media_query_list_listener_constructor):
1117         (webkit_dom_test_media_query_list_listener_class_init):
1118         (webkit_dom_test_media_query_list_listener_init):
1119         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.h:
1120         (_WebKitDOMTestMediaQueryListListener):
1121         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
1122         (_WebKitDOMTestNamedConstructorPrivate):
1123         (WebKit::core):
1124         (WebKit::wrapTestNamedConstructor):
1125         (webkit_dom_test_named_constructor_finalize):
1126         (webkit_dom_test_named_constructor_constructor):
1127         (webkit_dom_test_named_constructor_class_init):
1128         (webkit_dom_test_named_constructor_init):
1129         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.h:
1130         (_WebKitDOMTestNamedConstructor):
1131         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
1132         (_WebKitDOMTestNodePrivate):
1133         (WebKit::core):
1134         (WebKit::wrapTestNode):
1135         (webkit_dom_test_node_dispatch_event):
1136         (webkit_dom_test_node_add_event_listener):
1137         (webkit_dom_test_node_remove_event_listener):
1138         (webkit_dom_test_node_finalize):
1139         (webkit_dom_test_node_constructor):
1140         (webkit_dom_test_node_class_init):
1141         (webkit_dom_test_node_init):
1142         * bindings/scripts/test/GObject/WebKitDOMTestNode.h:
1143         (_WebKitDOMTestNode):
1144         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1145         (_WebKitDOMTestObjPrivate):
1146         (WebKit::core):
1147         (WebKit::wrapTestObj):
1148         (webkit_dom_test_obj_finalize):
1149         (webkit_dom_test_obj_constructor):
1150         (webkit_dom_test_obj_class_init):
1151         (webkit_dom_test_obj_init):
1152         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1153         (_WebKitDOMTestObj):
1154         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1155         (_WebKitDOMTestSerializedScriptValueInterfacePrivate):
1156         (WebKit::core):
1157         (WebKit::wrapTestSerializedScriptValueInterface):
1158         (webkit_dom_test_serialized_script_value_interface_finalize):
1159         (webkit_dom_test_serialized_script_value_interface_constructor):
1160         (webkit_dom_test_serialized_script_value_interface_class_init):
1161         (webkit_dom_test_serialized_script_value_interface_init):
1162         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
1163         (_WebKitDOMTestSerializedScriptValueInterface):
1164
1165 2012-12-04  David Grogan  <dgrogan@chromium.org>
1166
1167         IndexedDB: Make leveldb histogram entries more fine-grained
1168         https://bugs.webkit.org/show_bug.cgi?id=103688
1169
1170         Reviewed by Tony Chang.
1171
1172         Allow us better insight into which functions the IO errors originate
1173         from.
1174
1175         * Modules/indexeddb/IDBBackingStore.cpp:
1176         (WebCore::setUpMetadata):
1177         (WebCore::IDBBackingStore::getIDBDatabaseMetaData):
1178         (WebCore::IDBBackingStore::getObjectStores):
1179         (WebCore::IDBBackingStore::getRecord):
1180         (WebCore::IDBBackingStore::getKeyGeneratorCurrentNumber):
1181         (WebCore::IDBBackingStore::keyExistsInObjectStore):
1182         (WebCore::IDBBackingStore::getIndexes):
1183         (WebCore::IDBBackingStore::findKeyInIndex):
1184         (WebCore::ObjectStoreKeyCursorImpl::loadCurrentRow):
1185         (WebCore::ObjectStoreCursorImpl::loadCurrentRow):
1186         (WebCore::IndexKeyCursorImpl::loadCurrentRow):
1187         (WebCore::IndexCursorImpl::loadCurrentRow):
1188
1189 2012-12-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1190
1191         [GTK] Avoid unnecessary heap allocations during drag and drop operations
1192         https://bugs.webkit.org/show_bug.cgi?id=87938
1193
1194         Reviewed by Martin Robinson.
1195
1196         * platform/gtk/GtkDragAndDropHelper.cpp:
1197         (WebCore::GtkDragAndDropHelper::handleDragMotion): Return a
1198         pointer to the DataObjectGtk so that the caller can create the
1199         DragData object in the stack.
1200         (WebCore::GtkDragAndDropHelper::handleDragDataReceived): Ditto.
1201         (WebCore::GtkDragAndDropHelper::handleDragDrop): Ditto.
1202         * platform/gtk/GtkDragAndDropHelper.h:
1203
1204 2012-12-04  Alexander Pavlov  <apavlov@chromium.org>
1205
1206         Web Inspector: [Overrides] Add ability to override the page CSS media type
1207         https://bugs.webkit.org/show_bug.cgi?id=103752
1208
1209         Reviewed by Pavel Feldman.
1210
1211         This change emulates the CSS media types through the instrumentation of FrameView::mediaType().
1212         Even though it already checks the associated FrameLoaderClient::overrideMediaType(), instrumenting
1213         every single platform FrameLoaderClient implementation out there seems wrong.
1214
1215         Test: inspector/styles/media-emulation.html
1216
1217         * English.lproj/localizedStrings.js:
1218         * inspector/Inspector.json: Add Page.setEmulatedMedia().
1219         * inspector/InspectorInstrumentation.cpp:
1220         (WebCore::InspectorInstrumentation::applyEmulatedMediaImpl): Added.
1221         * inspector/InspectorInstrumentation.h:
1222         (WebCore::InspectorInstrumentation::applyEmulatedMedia): Added.
1223         * inspector/InspectorPageAgent.cpp:
1224         (WebCore::InspectorPageAgent::restore): Restores the media emulation state.
1225         (WebCore::InspectorPageAgent::disable): Resets the media emulation state.
1226         (WebCore::InspectorPageAgent::setEmulatedMedia): Added.
1227         (WebCore::InspectorPageAgent::applyEmulatedMedia): Applies the emulated CSS media if needed.
1228         * inspector/InspectorPageAgent.h:
1229         * inspector/front-end/CSSStyleModel.js: Add the list of media types.
1230         * inspector/front-end/OverridesView.js: Add the CSS media type override UI.
1231         (WebInspector.OverridesView):
1232         (WebInspector.OverridesView.prototype._createMediaEmulationElement): Builds the UI.
1233         (WebInspector.OverridesView.prototype._emulateMediaChanged): Handles the control value changes.
1234         * inspector/front-end/Settings.js: Add the "emulatedCSSMedia" setting.
1235         * page/FrameView.cpp:
1236         (WebCore::FrameView::mediaType):
1237           Uses InspectorInstrumentation::applyEmulatedMedia() to provide the emulated value.
1238
1239 2012-12-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1240
1241         [GTK] Simplify GObject DOM bindings code for handling properties
1242         https://bugs.webkit.org/show_bug.cgi?id=101072
1243
1244         Reviewed by Xan Lopez.
1245
1246         Do not override GObjectClass::set_property if the wrapped object
1247         doesn't have writable properties, and don't override
1248         GObjectClass::get_property if the wrapped object doesn't have
1249         properties at all. It reduces some GObject boilerplate in
1250         generated code for some objects.
1251
1252         * bindings/scripts/CodeGeneratorGObject.pm:
1253         (GenerateProperties):
1254         * bindings/scripts/test/GObject/WebKitDOMFloat64Array.cpp:
1255         (webkit_dom_float64array_class_init):
1256         * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
1257         (webkit_dom_test_active_dom_object_class_init):
1258         * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
1259         (webkit_dom_test_callback_class_init):
1260         * bindings/scripts/test/GObject/WebKitDOMTestCustomNamedGetter.cpp:
1261         (webkit_dom_test_custom_named_getter_class_init):
1262         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1263         (webkit_dom_test_event_constructor_class_init):
1264         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
1265         (webkit_dom_test_event_target_class_init):
1266         * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
1267         (webkit_dom_test_exception_class_init):
1268         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
1269         (webkit_dom_test_interface_class_init):
1270         * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
1271         (webkit_dom_test_media_query_list_listener_class_init):
1272         * bindings/scripts/test/GObject/WebKitDOMTestNamedConstructor.cpp:
1273         (webkit_dom_test_named_constructor_class_init):
1274         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
1275         (webkit_dom_test_node_class_init):
1276         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1277         (webkit_dom_test_obj_class_init):
1278         * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
1279         (webkit_dom_test_serialized_script_value_interface_class_init):
1280
1281 2012-12-04  Kentaro Hara  <haraken@chromium.org>
1282
1283         Unreviewed. Rebaselined run-bindings-tests.
1284
1285         * bindings/scripts/test/JS/JSTestNode.cpp:
1286         (WebCore::JSTestNode::visitChildren):
1287         (WebCore):
1288
1289 2012-12-03  Alexander Pavlov  <apavlov@chromium.org>
1290
1291         Web Inspector: [REGRESSION] [Styles] Rule disappears if edited selector does not affect selected node
1292         https://bugs.webkit.org/show_bug.cgi?id=103059
1293
1294         Reviewed by Pavel Feldman.
1295
1296         This change effectively turns WebInspector.cssModel.setRuleSelector() into a _userOperation
1297         (in terms of StylesSidebarPane), which finishes upon the _finishOperationAndMoveEditor() invocation.
1298
1299         * inspector/front-end/CSSStyleModel.js:
1300         (WebInspector.CSSRule): Fix selectorText now that r136370 has landed.
1301         * inspector/front-end/StylesSidebarPane.js:
1302         (WebInspector.StylePropertiesSection.prototype.update): Update the selector text from the model.
1303         (WebInspector.StylePropertiesSection.prototype._markSelectorMatches): Set the "selector" className regardless of the matched selectors presence.
1304         (WebInspector.StylePropertiesSection.prototype.successCallback): Make use of the _userOperation flag.
1305         (WebInspector.StylePropertiesSection.prototype.finishOperationAndMoveEditor): Delete the _userOperation flag.
1306         (WebInspector.StylePropertiesSection.prototype.editingSelectorCommitted): Make use of the _userOperation flag.
1307         (WebInspector.BlankStylePropertiesSection.prototype.editingSelectorCommitted): Mark selector matches.
1308         (WebInspector.BlankStylePropertiesSection.prototype.editingSelectorCancelled): Delete the _userOperation flag.
1309
1310 2012-12-04  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1311
1312         [EFL][WK2][AC] USE_GRAPHICS_SURFACE should be enabled only if Xcomposite and Xrender extensions are found.
1313         https://bugs.webkit.org/show_bug.cgi?id=103710.
1314
1315         Reviewed by Kenneth Rohde Christiansen.
1316
1317         When using GLX back-end we are dependent on GLX support, Xcomposite and Xrender extensions.
1318         In this case, GraphicsSurface usage depends on Xcomposite and Xrender extensions. 
1319         USE_GRAPHICS_SURFACE should be enabled only if Xcomposite and Xrender extensions are found.
1320
1321         * platform/graphics/opengl/GLPlatformSurface.cpp:
1322         (WebCore::GLPlatformSurface::createTransportSurface):
1323         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1324         (WebCore):
1325         * platform/graphics/surfaces/glx/GLXSurface.h:
1326         (WebCore::SharedX11Resources::createConfig):
1327         (SharedX11Resources):
1328
1329 2012-12-04  Michael Pruett  <michael@68k.org>
1330
1331         [JSC] Generate visitChildren() for uncustomized EventTarget interfaces
1332         https://bugs.webkit.org/show_bug.cgi?id=103908
1333
1334         Reviewed by Geoffrey Garen.
1335
1336         CodeGeneratorJS.pm should automatically generate visitChildren()
1337         for EventTarget interfaces without custom mark functions even if
1338         those interfaces have no functions or cached attributes.
1339
1340         This change is needed for IDBOpenDBRequest and IDBVersionChangeRequest.
1341
1342         No new tests. Covered by existing tests.
1343
1344         * bindings/scripts/CodeGeneratorJS.pm:
1345         (GenerateImplementation):
1346
1347 2012-12-04  Kentaro Hara  <haraken@chromium.org>
1348
1349         Change ChildNodeInsertionNotifier::m_postInsertionsNotificationTargets from a Vector to an OwnPtr
1350         https://bugs.webkit.org/show_bug.cgi?id=103868
1351
1352         Reviewed by Darin Adler.
1353
1354         ChildNodeInsertionNotifier::m_postInsertionsNotificationTargets is
1355         used for HTMLFrameElement and HTMLBodyElement only, which would be
1356         a cold path. We can change it from a Vector to an OwnPtr<Vector>
1357         so that ChildNodeInsertionNotifier can be allocated faster. This patch
1358         optimizes Dromaeo/dom-modify by 1.4%.
1359
1360         [Dromaeo/dom-modify in Chromium/Linux]
1361         Before: 4532 runs/sec, 4545 runs/sec, 4530 runs/sec, 4536 runs/sec
1362         After:  4595 runs/sec, 4606 runs/sec, 4597 runs/sec, 4602 runs/sec
1363
1364         No tests. No change in behavior.
1365
1366         * dom/ContainerNodeAlgorithms.h:
1367         (ChildNodeInsertionNotifier):
1368         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
1369         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree):
1370         (WebCore::ChildNodeInsertionNotifier::notify):
1371
1372 2012-12-03  Rafael Weinstein  <rafaelw@chromium.org>
1373
1374         Unreviewed build fix after r136467
1375
1376         The template element patch added asserts in parserAppendChild and parserInsertBefore which should be valid, but DOMImplementation::createDocument() calls parserAppendChild with docType without regard to its owner. This patch removes the assert and adds a FIXME.
1377
1378         * dom/ContainerNode.cpp:
1379         (WebCore::ContainerNode::parserInsertBefore):
1380         (WebCore::ContainerNode::parserAppendChild):
1381
1382 2012-12-03  Kentaro Hara  <haraken@chromium.org>
1383
1384         [V8] Enter an Isolate before initializing PerIsolateData
1385         https://bugs.webkit.org/show_bug.cgi?id=103949
1386
1387         Reviewed by Adam Barth.
1388
1389         Currently we initialize PerIsolateData before entering an Isolate,
1390         which prevents us from using an Isolate in the PerIsolateData
1391         constructor. We should enter an Isolate first and then initialize
1392         PerIsolateData.
1393
1394         No tests. No change in behavior.
1395
1396         * bindings/v8/WorkerScriptController.cpp:
1397         (WebCore::WorkerScriptController::WorkerScriptController):
1398
1399 2012-12-03  Sergio Villar Senin  <svillar@igalia.com>
1400
1401         [GTK] Add WebKitDOMShadowRoot.h to the list of public API headers after r135693
1402         https://bugs.webkit.org/show_bug.cgi?id=103909
1403
1404         Reviewed by Martin Robinson.
1405
1406         WebKitDOMShadowRoot was added in r135693. As it is added to
1407         webkitdom.h we have to export the include file, otherwise clients
1408         will fail to build due to the missing file.
1409
1410         * bindings/gobject/GNUmakefile.am:
1411
1412 2012-12-03  Joshua Bell  <jsbell@chromium.org>
1413
1414         IndexedDB: Correct database version after aborted upgrade
1415         https://bugs.webkit.org/show_bug.cgi?id=103763
1416
1417         Reviewed by Tony Chang.
1418
1419         After an aborted "versionchange" transaction, the IDBDatabase would fetch a fresh snapshot
1420         of the metadata from the back end. If the back end had already started a new "versionchange"
1421         transaction the snapshot would be bogus. Instead, save a copy of the IDBDatabase's metadata
1422         and roll back to that, as is done for IDBObjectStore.
1423
1424         Tests: storage/indexeddb/intversion-abort-in-initial-upgradeneeded.html
1425                storage/indexeddb/mozilla/versionchange-abort.html
1426                storage/indexeddb/unblocked-version-changes.html
1427
1428         * Modules/indexeddb/IDBDatabase.cpp:
1429         (WebCore::IDBDatabase::IDBDatabase):
1430         (WebCore::IDBDatabase::transactionCreated):
1431         * Modules/indexeddb/IDBDatabase.h:
1432         (WebCore::IDBDatabase::setMetadata): Let IDBOpenDBRequest and IDBTransaction tinker.
1433         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1434         (WebCore::IDBOpenDBRequest::onUpgradeNeeded): Fetch new and compute old metadata.
1435         (WebCore::IDBOpenDBRequest::onSuccess): Fetch new metadata, in case upgrade changed it.
1436         * Modules/indexeddb/IDBTransaction.cpp:
1437         (WebCore::IDBTransaction::create): Stash the old metadata, in case of rollback.
1438         (WebCore::IDBTransaction::IDBTransaction):
1439         (WebCore::IDBTransaction::onAbort): Revert the database as well as the stores.
1440         * Modules/indexeddb/IDBTransaction.h:
1441         (IDBTransaction):
1442
1443 2012-12-03  Rafael Weinstein  <rafaelw@chromium.org>
1444
1445         Implement HTMLTemplateElement
1446         https://bugs.webkit.org/show_bug.cgi?id=86031
1447
1448         Reviewed by Adam Barth.
1449
1450         Initial implementation. This patch includes the parser changes, new IDL and element implementation for <template>.
1451
1452         Spec: http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html
1453
1454         Tests: fast/dom/HTMLTemplateElement/cloneNode.html
1455                fast/dom/HTMLTemplateElement/inertContents.html
1456                fast/dom/HTMLTemplateElement/innerHTML.html
1457                fast/dom/HTMLTemplateElement/ownerDocument.html
1458                html5lib/run-template.html
1459
1460         * WebCore.gypi:
1461         * css/html.css:
1462         (template):
1463         * dom/Document.cpp:
1464         (WebCore):
1465         (WebCore::Document::templateContentsOwnerDocument):
1466         * dom/Document.h:
1467         (Document):
1468         * editing/MarkupAccumulator.cpp:
1469         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1470         * html/HTMLElement.h:
1471         (HTMLElement):
1472         * html/HTMLElementsAllInOne.cpp:
1473         * html/HTMLTagNames.in:
1474         * html/HTMLTemplateElement.cpp: Added.
1475         (WebCore):
1476         (WebCore::HTMLTemplateElement::HTMLTemplateElement):
1477         (WebCore::HTMLTemplateElement::setInnerHTML):
1478         (WebCore::HTMLTemplateElement::~HTMLTemplateElement):
1479         (WebCore::HTMLTemplateElement::create):
1480         (WebCore::HTMLTemplateElement::content):
1481         (WebCore::HTMLTemplateElement::setContent):
1482         (WebCore::toHTMLTemplateElement):
1483         * html/HTMLTemplateElement.h: Added.
1484         (WebCore):
1485         (HTMLTemplateElement):
1486         (WebCore::toHTMLTemplateElement):
1487         * html/HTMLTemplateElement.idl: Added.
1488         * html/parser/HTMLConstructionSite.cpp:
1489         (WebCore::executeTask):
1490         (WebCore::HTMLConstructionSite::insertComment):
1491         (WebCore::HTMLConstructionSite::insertTextNode):
1492         (WebCore::HTMLConstructionSite::createElement):
1493         (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode):
1494         (WebCore):
1495         (WebCore::HTMLConstructionSite::createHTMLElement):
1496         (WebCore::HTMLConstructionSite::findFosterSite):
1497         * html/parser/HTMLConstructionSite.h:
1498         (HTMLConstructionSite):
1499         * html/parser/HTMLElementStack.cpp:
1500         (WebCore):
1501         (WebCore::HTMLElementStack::hasTemplateInHTMLScope):
1502         * html/parser/HTMLElementStack.h:
1503         (HTMLElementStack):
1504         * html/parser/HTMLTreeBuilder.cpp:
1505         (WebCore::HTMLTreeBuilder::constructTreeFromToken):
1506         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1507         (WebCore):
1508         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
1509         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
1510         (WebCore::HTMLTreeBuilder::processStartTag):
1511         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
1512         (WebCore::HTMLTreeBuilder::resetInsertionModeAppropriately):
1513         (WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
1514         (WebCore::HTMLTreeBuilder::processEndTagForInRow):
1515         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
1516         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
1517         (WebCore::HTMLTreeBuilder::processTrEndTagForInRow):
1518         (WebCore::HTMLTreeBuilder::processTableEndTagForInTable):
1519         (WebCore::HTMLTreeBuilder::processEndTag):
1520         (WebCore::HTMLTreeBuilder::processCharacterBuffer):
1521         (WebCore::HTMLTreeBuilder::processEndOfFile):
1522         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
1523         * html/parser/HTMLTreeBuilder.h:
1524         (HTMLTreeBuilder):
1525         (WebCore::HTMLTreeBuilder::isParsingTemplateContents):
1526         (WebCore::HTMLTreeBuilder::isParsingFragmentOrTemplateContents):
1527         * page/DOMWindow.idl:
1528
1529 2012-12-03  Sheriff Bot  <webkit.review.bot@gmail.com>
1530
1531         Unreviewed, rolling out r136460.
1532         http://trac.webkit.org/changeset/136460
1533         https://bugs.webkit.org/show_bug.cgi?id=103958
1534
1535         This patch caused compile error when building DumpRenderTree
1536         (Requested by tasak on #webkit).
1537
1538         * WebCore.gyp/WebCore.gyp:
1539         * WebCore.gypi:
1540         * platform/chromium/PlatformThemeChromiumLinux.cpp: Added.
1541         (WebCore):
1542         (WebCore::PlatformThemeChromiumLinux::setScrollbarColors):
1543         (WebCore::clamp):
1544         (WebCore::PlatformThemeChromiumLinux::saturateAndBrighten):
1545         (WebCore::PlatformThemeChromiumLinux::outlineColor):
1546         (WebCore::PlatformThemeChromiumLinux::paintArrowButton):
1547         * platform/chromium/PlatformThemeChromiumLinux.h: Added.
1548         (WebCore):
1549         (PlatformThemeChromiumLinux):
1550         (WebCore::PlatformThemeChromiumLinux::thumbInactiveColor):
1551         (WebCore::PlatformThemeChromiumLinux::thumbActiveColor):
1552         (WebCore::PlatformThemeChromiumLinux::trackColor):
1553         (WebCore::PlatformThemeChromiumLinux::PlatformThemeChromiumLinux):
1554         * platform/chromium/ScrollbarThemeChromiumLinux.cpp: Added.
1555         (WebCore):
1556         (WebCore::ScrollbarTheme::nativeTheme):
1557         (WebCore::ScrollbarThemeChromiumLinux::scrollbarThickness):
1558         (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
1559         (WebCore::ScrollbarThemeChromiumLinux::paintButton):
1560         (WebCore::ScrollbarThemeChromiumLinux::paintThumb):
1561         (WebCore::ScrollbarThemeChromiumLinux::shouldCenterOnThumb):
1562         (WebCore::ScrollbarThemeChromiumLinux::buttonSize):
1563         (WebCore::ScrollbarThemeChromiumLinux::minimumThumbLength):
1564         * platform/chromium/ScrollbarThemeChromiumLinux.h: Added.
1565         (ScrollbarThemeChromiumLinux):
1566         * rendering/RenderThemeChromiumAndroid.cpp:
1567         (WebCore::RenderThemeChromiumAndroid::extraDefaultStyleSheet):
1568         * rendering/RenderThemeChromiumAndroid.h:
1569         * rendering/RenderThemeChromiumLinux.cpp: Added.
1570         (WebCore):
1571         (WebCore::getWebThemeState):
1572         (WebCore::RenderThemeChromiumLinux::create):
1573         (WebCore::RenderTheme::themeForPage):
1574         (WebCore::RenderThemeChromiumLinux::RenderThemeChromiumLinux):
1575         (WebCore::RenderThemeChromiumLinux::~RenderThemeChromiumLinux):
1576         (WebCore::RenderThemeChromiumLinux::systemColor):
1577         (WebCore::RenderThemeChromiumLinux::extraDefaultStyleSheet):
1578         (WebCore::RenderThemeChromiumLinux::controlSupportsTints):
1579         (WebCore::RenderThemeChromiumLinux::activeListBoxSelectionBackgroundColor):
1580         (WebCore::RenderThemeChromiumLinux::activeListBoxSelectionForegroundColor):
1581         (WebCore::RenderThemeChromiumLinux::inactiveListBoxSelectionBackgroundColor):
1582         (WebCore::RenderThemeChromiumLinux::inactiveListBoxSelectionForegroundColor):
1583         (WebCore::RenderThemeChromiumLinux::platformActiveSelectionBackgroundColor):
1584         (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionBackgroundColor):
1585         (WebCore::RenderThemeChromiumLinux::platformActiveSelectionForegroundColor):
1586         (WebCore::RenderThemeChromiumLinux::platformInactiveSelectionForegroundColor):
1587         (WebCore::RenderThemeChromiumLinux::sliderTickSize):
1588         (WebCore::RenderThemeChromiumLinux::sliderTickOffsetFromTrackCenter):
1589         (WebCore::RenderThemeChromiumLinux::adjustSliderThumbSize):
1590         (WebCore::RenderThemeChromiumLinux::supportsControlTints):
1591         (WebCore::RenderThemeChromiumLinux::setCaretBlinkInterval):
1592         (WebCore::RenderThemeChromiumLinux::caretBlinkIntervalInternal):
1593         (WebCore::RenderThemeChromiumLinux::setSelectionColors):
1594         (WebCore::RenderThemeChromiumLinux::paintCheckbox):
1595         (WebCore::RenderThemeChromiumLinux::setCheckboxSize):
1596         (WebCore::RenderThemeChromiumLinux::paintRadio):
1597         (WebCore::RenderThemeChromiumLinux::setRadioSize):
1598         (WebCore::RenderThemeChromiumLinux::paintButton):
1599         (WebCore::RenderThemeChromiumLinux::paintTextField):
1600         (WebCore::RenderThemeChromiumLinux::paintMenuList):
1601         (WebCore::RenderThemeChromiumLinux::paintSliderTrack):
1602         (WebCore::RenderThemeChromiumLinux::paintSliderThumb):
1603         (WebCore::RenderThemeChromiumLinux::adjustInnerSpinButtonStyle):
1604         (WebCore::RenderThemeChromiumLinux::paintInnerSpinButton):
1605         (WebCore::RenderThemeChromiumLinux::paintProgressBar):
1606         (WebCore::RenderThemeChromiumLinux::shouldOpenPickerWithF4Key):
1607         * rendering/RenderThemeChromiumLinux.h: Added.
1608         (WebCore):
1609         (RenderThemeChromiumLinux):
1610
1611 2012-12-03  Julien Chaffraix  <jchaffraix@webkit.org>
1612
1613         [CSS Grid Layout] Support paddings and margins on grid items
1614         https://bugs.webkit.org/show_bug.cgi?id=103677
1615
1616         Reviewed by Tony Chang.
1617
1618         After bug 102968, we properly resolve grid items' width and height against the
1619         grid areas' sizes. However we didn't check for paddings and margins, which is
1620         what this change fixes..
1621
1622         Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html
1623
1624         * rendering/RenderBox.cpp:
1625         (WebCore::RenderBox::computeLogicalWidthInRegion):
1626         Don't stretch the end margin to match the containing block's extent.
1627         The fix is similar to what was done for flex-box in bug 65887.
1628
1629         * rendering/RenderBoxModelObject.cpp:
1630         (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
1631         Added a comment about not using containingBlockLogicalWidthForContent.
1632
1633         (WebCore::RenderBoxModelObject::computedCSSPaddingTop):
1634         (WebCore::RenderBoxModelObject::computedCSSPaddingBottom):
1635         (WebCore::RenderBoxModelObject::computedCSSPaddingLeft):
1636         (WebCore::RenderBoxModelObject::computedCSSPaddingRight):
1637         (WebCore::RenderBoxModelObject::computedCSSPaddingBefore):
1638         (WebCore::RenderBoxModelObject::computedCSSPaddingAfter):
1639         (WebCore::RenderBoxModelObject::computedCSSPaddingStart):
1640         (WebCore::RenderBoxModelObject::computedCSSPaddingEnd):
1641         Updated these functions to use containingBlockLogicalWidthForContent.
1642
1643         * rendering/RenderGrid.h:
1644         * rendering/RenderObject.h:
1645         (WebCore::RenderObject::isRenderGrid):
1646         Added isRenderGrid.
1647
1648 2012-12-03  Scott Violet  <sky@chromium.org>
1649
1650         [chromium] Remove linux theme related files and switch to default
1651         https://bugs.webkit.org/show_bug.cgi?id=103897
1652
1653         Reviewed by Darin Fisher.
1654
1655         linux theme related files are now named default. This removes
1656         linux theme files, updates build files and removes ifdefs.
1657
1658         Code cleanup, no new tests.
1659
1660         * WebCore.gyp/WebCore.gyp: Update build rules
1661         * WebCore.gypi: Update build rules
1662         * platform/chromium/PlatformThemeChromiumLinux.cpp: Removed.
1663         * platform/chromium/PlatformThemeChromiumLinux.h: Removed.
1664         * platform/chromium/ScrollbarThemeChromiumLinux.cpp: Removed.
1665         * platform/chromium/ScrollbarThemeChromiumLinux.h: Removed.
1666         * rendering/RenderThemeChromiumAndroid.h: Change superclass
1667         * rendering/RenderThemeChromiumAndroid.cpp: Change call to superclass
1668         * rendering/RenderThemeChromiumLinux.cpp: Removed.
1669         * rendering/RenderThemeChromiumLinux.h: Removed.
1670
1671 2012-12-03  Pierre Rossi  <pierre.rossi@digia.com>
1672
1673         [Qt] Unreviewed build fix after r136410
1674
1675         When building without libjpeg, take JPEGImageDecoder's header out, since it now includes libjpeg.h.
1676
1677         * Target.pri: conditionally add JPEGImageDecoder.h to HEADERS
1678         * platform/image-decoders/ImageDecoder.cpp: guard JPEGImageDecoder.h's include
1679
1680 2012-12-03  Kenneth Rohde Christiansen  <kenneth@webkit.org>
1681
1682         [EFL][Qt][WK2] Fixed position elements are not always fixed
1683         https://bugs.webkit.org/show_bug.cgi?id=103452
1684
1685         Reviewed by Simon Fraser.
1686
1687         The code figuring out whether fixed position layers are inside
1688         the visible viewport, assumes that the visible viewport is always
1689         the size of the layout viewport. This assumption doesn't hold with
1690         how the Qt and EFL tiled backing store and coordinated graphics
1691         works, so instead using the visibleContentsRect(), which provides
1692         the right values in all cases.
1693
1694         * rendering/RenderLayerCompositor.cpp:
1695         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1696
1697             Use visibleContentsRect instead of scrollOffsetForFixedPosition().
1698
1699             scrollOffsetForFixedPosition() is needed sometimes in the Mac code
1700             because visibleContentRect() will return negative offsets when you
1701             are in the rubber-band phase of a scroll on the Mac.
1702
1703             However that is not an issue here.
1704
1705 2012-12-03  Sheriff Bot  <webkit.review.bot@gmail.com>
1706
1707         Unreviewed, rolling out r135271.
1708         http://trac.webkit.org/changeset/135271
1709         https://bugs.webkit.org/show_bug.cgi?id=103940
1710
1711         Some user stylesheet API clients broken (Requested by anttik
1712         on #webkit).
1713
1714         * css/StyleResolver.cpp:
1715         (WebCore::StyleResolver::StyleResolver):
1716         (WebCore::StyleResolver::collectRulesFromUserStyleSheets):
1717         (WebCore::collectCSSOMWrappers):
1718         * css/StyleResolver.h:
1719         (StyleResolver):
1720         * dom/Document.cpp:
1721         (WebCore::Document::setCompatibilityMode):
1722         * dom/DocumentStyleSheetCollection.cpp:
1723         (WebCore::DocumentStyleSheetCollection::~DocumentStyleSheetCollection):
1724         (WebCore::DocumentStyleSheetCollection::pageUserSheet):
1725         (WebCore::DocumentStyleSheetCollection::clearPageUserSheet):
1726         (WebCore::DocumentStyleSheetCollection::updatePageUserSheet):
1727         (WebCore::collectActiveCSSStyleSheetsFromSeamlessParents):
1728         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
1729         (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
1730         * dom/DocumentStyleSheetCollection.h:
1731         (DocumentStyleSheetCollection):
1732         (WebCore::DocumentStyleSheetCollection::documentUserStyleSheets):
1733         * page/Page.cpp:
1734         (WebCore::Page::userStyleSheetLocationChanged):
1735
1736 2012-11-30  Andrey Kosyakov  <caseq@chromium.org>
1737
1738         Web Inspector: make it possible to fliter out messages from console.{time,timeEnd}()
1739         https://bugs.webkit.org/show_bug.cgi?id=103781
1740
1741         Reviewed by Yury Semikhatsky.
1742
1743         - make console messages produced by console.timeEnd() TimingMessageType & DebugMessageLevel;
1744         - add console filter for Debug messages;
1745
1746         * inspector/ConsoleMessage.cpp:
1747         (WebCore::messageTypeValue):
1748         * inspector/Inspector.json:
1749         * inspector/InspectorConsoleAgent.cpp:
1750         (WebCore::InspectorConsoleAgent::stopTiming):
1751         * inspector/front-end/ConsoleMessage.js:
1752         (WebInspector.ConsoleMessageImpl.prototype.toMessageElement):
1753         * inspector/front-end/ConsoleView.js:
1754         (WebInspector.ConsoleView.prototype.):
1755         (WebInspector.ConsoleView.prototype.filter):
1756         * inspector/front-end/inspector.css:
1757         (.console-warning-level, .console-error-level, .console-log-level, .console-debug-level):
1758         (.filter-all .console-debug-level, .filter-debug .console-debug-level):
1759         (.filter-all .console-debug-level.repeated-message, .filter-debug .console-debug-level.repeated-message):
1760         * page/ConsoleTypes.h:
1761
1762 2012-12-03  Sheriff Bot  <webkit.review.bot@gmail.com>
1763
1764         Unreviewed, rolling out r136444.
1765         http://trac.webkit.org/changeset/136444
1766         https://bugs.webkit.org/show_bug.cgi?id=103938
1767
1768         broke chromium build (Requested by zhenyao_wfh on #webkit).
1769
1770         * Target.pri:
1771         * platform/image-decoders/ImageDecoder.cpp:
1772
1773 2012-12-03  Pierre Rossi  <pierre.rossi@digia.com>
1774
1775         [Qt] Unreviewed build fix after r136410
1776
1777         When building without libjpeg, take JPEGImageDecoder's header out, since it now includes libjpeg.h.
1778
1779         * Target.pri: conditionally add JPEGImageDecoder.h to HEADERS
1780         * platform/image-decoders/ImageDecoder.cpp: guard JPEGImageDecoder.h's include
1781
1782 2012-11-30  James Simonsen  <simonjam@chromium.org>
1783
1784         [Resource Timing] Record and report initiator
1785         https://bugs.webkit.org/show_bug.cgi?id=103777
1786
1787         Reviewed by Nate Chapin.
1788
1789         This will start populating the Resource Timing buffer with entries. The initiator will be
1790         recorded for each CachedResourceLoader. This should match the next update of the spec.
1791
1792         Tests: http/tests/w3c/webperf/submission/resource-timing
1793
1794         * css/CSSFontSelector.cpp:
1795         (WebCore::CSSFontSelector::beginLoadTimerFired):
1796         * loader/ResourceLoadNotifier.cpp: Always record timing information if ENABLE(RESOURCE_TIMING).
1797         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1798         * loader/SubresourceLoader.cpp:
1799         (WebCore::SubresourceLoader::releaseResources): Report the actual resource that called loadDone().
1800         * loader/cache/CachedResourceLoader.cpp:
1801         (WebCore::CachedResourceLoader::loadResource): Record the initiator.
1802         (WebCore::CachedResourceLoader::loadDone): Record the entry in Resource Timing.
1803         * loader/cache/CachedResourceLoader.h:
1804         (CachedResourceLoader):
1805         (InitiatorInfo):
1806
1807 2012-12-03  Florin Malita  <fmalita@chromium.org>
1808
1809         [Skia] Deferred SkCanvas save()
1810         https://bugs.webkit.org/show_bug.cgi?id=102272
1811
1812         Reviewed by Stephen White.
1813
1814         Implement a lazy save() strategy: instead of delegating to the canvas upfront, defer and
1815         only commit when a clip/matrix mutation is observed.
1816
1817         The patch yields a 1-20% SkCanvas save/restore reduction for heavy pages, with much larger
1818         gains observed for deeply nested SVG content.
1819
1820         No new tests: no behaviour changes, coverage provided by existing tests.
1821
1822         * platform/graphics/skia/GraphicsContextSkia.cpp:
1823         (WebCore::GraphicsContext::canvasClip):
1824         * platform/graphics/skia/PlatformContextSkia.cpp:
1825         (WebCore):
1826         (WebCore::PlatformContextSkia::DeferredSaveState::DeferredSaveState):
1827         (PlatformContextSkia::DeferredSaveState):
1828         (WebCore::PlatformContextSkia::PlatformContextSkia):
1829         (WebCore::PlatformContextSkia::save):
1830         (WebCore::PlatformContextSkia::saveLayer):
1831         (WebCore::PlatformContextSkia::beginLayerClippedToImage):
1832         (WebCore::PlatformContextSkia::restore):
1833         (WebCore::PlatformContextSkia::applyClipFromImage):
1834         * platform/graphics/skia/PlatformContextSkia.h:
1835         (PlatformContextSkia):
1836         (WebCore::PlatformContextSkia::realizeSave):
1837         (WebCore):
1838         (WebCore::PlatformContextSkia::canvas):
1839         (WebCore::PlatformContextSkia::clipPath):
1840         (WebCore::PlatformContextSkia::clipRect):
1841         (WebCore::PlatformContextSkia::setMatrix):
1842         (WebCore::PlatformContextSkia::concat):
1843         (WebCore::PlatformContextSkia::rotate):
1844         (WebCore::PlatformContextSkia::scale):
1845         (WebCore::PlatformContextSkia::translate):
1846
1847 2012-12-03  Simon Fraser  <simon.fraser@apple.com>
1848
1849         When animating mask-postion on a composited layer, element renders incorrectly
1850         https://bugs.webkit.org/show_bug.cgi?id=103700
1851
1852         Reviewed by Tim Horton.
1853
1854         When a composited layer has a mask, we clipped the layer bounds to the
1855         size of the mask. This caused problems when animating the mask origin,
1856         which is considered a 'repaint' style change and so should not require
1857         layout or compositing geometry changes.
1858         
1859         Fix by ignoring the mask when computing the bounds of the compositing
1860         layer.
1861
1862         Test: compositing/masks/mask-layer-size.html
1863
1864         * rendering/RenderLayer.cpp:
1865         (WebCore::RenderLayer::localBoundingBox):
1866         (WebCore::RenderLayer::calculateLayerBounds):
1867         * rendering/RenderLayer.h:
1868         (RenderLayer):
1869         * rendering/RenderLayerCompositor.cpp:
1870         (WebCore::RenderLayerCompositor::calculateCompositedBounds):
1871
1872 2012-12-03  Xan Lopez  <xan@igalia.com>
1873
1874         [CSS Grid Layout] Support <percentage> and viewport-relative breadth sizes
1875         https://bugs.webkit.org/show_bug.cgi?id=103335
1876
1877         Reviewed by Julien Chaffraix.
1878
1879         Test: fast/css-grid-layout/breadth-size-resolution-grid.html
1880
1881         * css/CSSComputedStyleDeclaration.cpp:
1882         (WebCore::valueForGridTrackBreadth): Support the new types.
1883         (WebCore::valueForGridTrackMinMax): Modify the call to previous
1884         method, since the signature has changed.
1885         (WebCore::valueForGridTrackGroup): Ditto.
1886         (WebCore::valueForGridTrackList): Ditto.
1887         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto.
1888         * rendering/RenderGrid.cpp:
1889         (WebCore::RenderGrid::computedUsedBreadthOfGridTracks): Suport
1890         percent and viewport relative types, calc() will be supported in a
1891         follow up (see bug #103761)
1892
1893 2012-12-03  Peter Rybin  <prybin@chromium.org>
1894
1895         Web Inspector: make ASSERTION FAILED: foundPropertiesCount == object->size() more useful
1896         https://bugs.webkit.org/show_bug.cgi?id=103254
1897
1898         Reviewed by Pavel Feldman.
1899
1900         Assert code generation is slightly changed so that it dumped JSON object text before crashing.
1901
1902         * inspector/CodeGeneratorInspector.py:
1903
1904 2012-12-03  Max Vujovic  <mvujovic@adobe.com>
1905
1906         [CSS Shaders] Do not clamp indirect array indices during CSS Shaders ANGLE validation pass
1907         https://bugs.webkit.org/show_bug.cgi?id=102731
1908
1909         Reviewed by Dean Jackson.
1910
1911         Before this patch, we validated all shaders with the compile flag
1912         SH_CLAMP_INDIRECT_ARRAY_BOUNDS in ANGLEWebKitBridge. This would insert a GLSL function
1913         "webgl_int_clamp" in validated CSS shaders. However, when validated CSS shaders would pass
1914         through ANGLE again at the GC3D level, ANGLE would reject them because they would contain
1915         the "webgl_" restricted prefix.
1916
1917         Now, we only pass the compile flag SH_CLAMP_INDIRECT_ARRAY_BOUNDS at the GC3D level.
1918
1919         Test: css3/filters/custom/custom-filter-array-uniform-indirect-index.html
1920
1921         * platform/graphics/ANGLEWebKitBridge.cpp:
1922         (WebCore::ANGLEWebKitBridge::compileShaderSource):
1923             Remove the SH_CLAMP_INDIRECT_ARRAY_BOUNDS compile flag.
1924         * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
1925         (WebCore::CustomFilterValidatedProgram::compiledProgram):
1926             Add an assert that validated programs compile at the GC3D or platform level to help us
1927             catch validation and rewriting issues.
1928         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1929         (WebCore::Extensions3DOpenGLCommon::getTranslatedShaderSourceANGLE):
1930             Pass the SH_CLAMP_INDIRECT_ARRAY_BOUNDS to compileShaderSource.
1931
1932 2012-12-03  Eugene Klyuchnikov  <eustas@chromium.org>
1933
1934         Web Inspector: Make main-thread monitoring go through InspectorController
1935         https://bugs.webkit.org/show_bug.cgi?id=103550
1936
1937         Reviewed by Pavel Feldman.
1938
1939         InspectorInstrumentation was a wrong path.
1940
1941         * inspector/InspectorClient.h: Remove start/stop methods.
1942         * inspector/InspectorController.cpp:
1943         Dispatch main thread activity notifications.
1944         * inspector/InspectorController.h: Ditto.
1945         * inspector/InspectorInstrumentation.cpp: Remove dispatchng.
1946         * inspector/InspectorInstrumentation.h: Ditto.
1947         * inspector/InspectorTimelineAgent.cpp:
1948         Do not subscribe for notifications explicitly.
1949
1950 2012-12-03  Philip Rogers  <pdr@google.com>
1951
1952         Invalidate SVG width on width attribute changes.
1953         https://bugs.webkit.org/show_bug.cgi?id=103304
1954
1955         Reviewed by Dirk Schulze.
1956
1957         An inline SVG element's replaced width can depend on both attributes and style properties.
1958         After r105513, we invalidated this width on style changes but not attribute changes. With
1959         this patch we invalidate the replaced width on width attribute changes too. Note that height
1960         is handled differently for replaced elements so only the width attribute needs this handling
1961         (the added test covers this too).
1962
1963         Test: svg/custom/root-size-attribute-changes.html
1964
1965         * svg/SVGSVGElement.cpp:
1966         (WebCore::SVGSVGElement::svgAttributeChanged):
1967
1968 2012-12-03  Alec Flett  <alecflett@chromium.org>
1969
1970         IndexedDB: remove IDBDatabaseBackendInterface::transaction()
1971         https://bugs.webkit.org/show_bug.cgi?id=102733
1972
1973         Reviewed by Darin Fisher.
1974
1975         Part 3 of a refactor, remove the old transaction() method.
1976
1977         No new tests as this is just post-refactor cleanup.
1978
1979         * Modules/indexeddb/IDBDatabaseBackendInterface.h:
1980         (IDBDatabaseBackendInterface):
1981
1982 2012-12-03  Andrey Adaikin  <aandrey@chromium.org>
1983
1984         Web Inspector: [Canvas] show replay screenshot of the last call's canvas
1985         https://bugs.webkit.org/show_bug.cgi?id=103739
1986
1987         Reviewed by Pavel Feldman.
1988
1989         When many canvases are being instrumented we'll want to show replay screenshots for each canvas.
1990         Meanwhile, show the screenshot of the last-touched canvas during the current replay.
1991
1992         * inspector/InjectedScriptCanvasModuleSource.js:
1993         (.):
1994
1995 2012-12-03  Joshua Bell  <jsbell@chromium.org>
1996
1997         IndexedDB: Rename exception enum members from UGLY_ERR to PrettyError
1998         https://bugs.webkit.org/show_bug.cgi?id=103759
1999
2000         Reviewed by Darin Fisher.
2001
2002         Now that IDBDatabaseException isn't exposed to script with constants, the exception types
2003         can be renamed to match the much friendlier names used in newer iterations of the spec. Also
2004         remove the legacy/unused types.
2005
2006         No new tests, just constant renames.
2007
2008         * Modules/indexeddb/IDBCursor.cpp:
2009         (WebCore::IDBCursor::update):
2010         (WebCore::IDBCursor::advance):
2011         (WebCore::IDBCursor::continueFunction):
2012         (WebCore::IDBCursor::deleteFunction):
2013         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
2014         (WebCore::IDBCursorBackendImpl::continueFunction):
2015         (WebCore::IDBCursorBackendImpl::advance):
2016         (WebCore::IDBCursorBackendImpl::prefetchContinue):
2017         * Modules/indexeddb/IDBDatabase.cpp:
2018         (WebCore::IDBDatabase::createObjectStore):
2019         (WebCore::IDBDatabase::deleteObjectStore):
2020         (WebCore::IDBDatabase::transaction):
2021         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2022         (WebCore::IDBDatabaseBackendImpl::createObjectStore):
2023         (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
2024         (WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
2025         (WebCore::IDBDatabaseBackendImpl::transactionFinishedAndAbortFired):
2026         (WebCore::IDBDatabaseBackendImpl::openConnection):
2027         (WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
2028         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
2029         (WebCore::IDBDatabaseBackendImpl::close):
2030         * Modules/indexeddb/IDBDatabaseException.cpp: Tidying and renaming.
2031         (WebCore):
2032         (WebCore::getErrorEntry):
2033         * Modules/indexeddb/IDBDatabaseException.h:
2034         * Modules/indexeddb/IDBFactory.cpp:
2035         (WebCore::IDBFactory::cmp):
2036         * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
2037         (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
2038         (WebCore::IDBFactoryBackendImpl::deleteDatabase):
2039         (WebCore::IDBFactoryBackendImpl::open):
2040         * Modules/indexeddb/IDBIndex.cpp:
2041         (WebCore::IDBIndex::openCursor):
2042         (WebCore::IDBIndex::count):
2043         (WebCore::IDBIndex::openKeyCursor):
2044         (WebCore::IDBIndex::get):
2045         (WebCore::IDBIndex::getKey):
2046         * Modules/indexeddb/IDBIndexBackendImpl.cpp:
2047         (WebCore::IDBIndexBackendImpl::openCursor):
2048         (WebCore::IDBIndexBackendImpl::openKeyCursor):
2049         (WebCore::IDBIndexBackendImpl::count):
2050         (WebCore::IDBIndexBackendImpl::get):
2051         (WebCore::IDBIndexBackendImpl::getKey):
2052         * Modules/indexeddb/IDBKeyRange.cpp:
2053         (WebCore::IDBKeyRange::only):
2054         (WebCore::IDBKeyRange::lowerBound):
2055         (WebCore::IDBKeyRange::upperBound):
2056         (WebCore::IDBKeyRange::bound):
2057         * Modules/indexeddb/IDBObjectStore.cpp:
2058         (WebCore::IDBObjectStore::get):
2059         (WebCore::IDBObjectStore::put):
2060         (WebCore::IDBObjectStore::deleteFunction):
2061         (WebCore::IDBObjectStore::clear):
2062         (WebCore):
2063         (WebCore::IDBObjectStore::createIndex):
2064         (WebCore::IDBObjectStore::index):
2065         (WebCore::IDBObjectStore::deleteIndex):
2066         (WebCore::IDBObjectStore::openCursor):
2067         (WebCore::IDBObjectStore::count):
2068         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
2069         (WebCore::IDBObjectStoreBackendImpl::get):
2070         (WebCore::IDBObjectStoreBackendImpl::put):
2071         (WebCore):
2072         (WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
2073         (WebCore::IDBObjectStoreBackendImpl::ObjectStoreStorageOperation::perform):
2074         (WebCore::IDBObjectStoreBackendImpl::deleteFunction):
2075         (WebCore::IDBObjectStoreBackendImpl::clear):
2076         (WebCore::IDBObjectStoreBackendImpl::createIndex):
2077         (WebCore::IDBObjectStoreBackendImpl::deleteIndex):
2078         (WebCore::IDBObjectStoreBackendImpl::openCursor):
2079         (WebCore::IDBObjectStoreBackendImpl::count):
2080         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2081         (WebCore::IDBOpenDBRequest::dispatchEvent):
2082         * Modules/indexeddb/IDBRequest.cpp:
2083         (WebCore::IDBRequest::result):
2084         (WebCore::IDBRequest::error):
2085         (WebCore::IDBRequest::errorCode):
2086         (WebCore::IDBRequest::webkitErrorMessage):
2087         (WebCore::IDBRequest::abort):
2088         (WebCore::IDBRequest::dispatchEvent):
2089         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
2090         * Modules/indexeddb/IDBTransaction.cpp:
2091         (WebCore::IDBTransaction::objectStore):
2092         (WebCore::IDBTransaction::abort):
2093         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
2094         (WebCore::IDBTransactionBackendImpl::objectStore):
2095         (WebCore::IDBTransactionBackendImpl::abort):
2096         (WebCore::IDBTransactionBackendImpl::commit):
2097
2098 2012-12-03  Alexis Menard  <alexis@webkit.org>
2099
2100         [Mac] Enable CSS3 background-position offset by default.
2101         https://bugs.webkit.org/show_bug.cgi?id=103905
2102
2103         Reviewed by Simon Fraser.
2104
2105         Turn the flag on by default.
2106
2107         No new tests : covered by tests landed previously.
2108
2109         * Configurations/FeatureDefines.xcconfig:
2110         * css/CSSToStyleMap.cpp:
2111         (WebCore::CSSToStyleMap::mapFillXPosition): Build fix in release on Mac with unused variable.
2112         (WebCore::CSSToStyleMap::mapFillYPosition): Ditto.
2113
2114 2012-12-03  Jan Keromnes  <janx@linux.com>
2115
2116         Web Inspector: Implement context menus in CodeMirrorTextEditor
2117         https://bugs.webkit.org/show_bug.cgi?id=94062
2118
2119         Reviewed by Pavel Feldman.
2120
2121         Listen for contextmenu events in the editor and handle them differently
2122         if triggered on gutter line number or in text body. This adds controls
2123         for breakpoints (including disabled / conditional), debugger navigation
2124         and text input methods.
2125
2126         * inspector/front-end/CodeMirrorTextEditor.js:
2127         (WebInspector.CodeMirrorTextEditor):
2128         (WebInspector.CodeMirrorTextEditor.prototype._contextMenu):
2129
2130 2012-12-03  Nate Chapin  <japhet@chromium.org>
2131
2132         Make MainResourceLoader not use m_frame directly.
2133         https://bugs.webkit.org/show_bug.cgi?id=103907
2134
2135         Reviewed by Darin Adler.
2136
2137         MainResourceLoader will soon cease to be a ResourceLoader subclass.  It currently
2138         makes extensively use of both m_documentLoader and m_frame from ResourceLoader.
2139         By moving everything over to going through m_documentLoader, we reduce the number
2140         of members we have to add to MainResourceLoader in https://bugs.webkit.org/show_bug.cgi?id=49246.
2141
2142         No new tests, refactor only.
2143
2144         * loader/DocumentLoader.cpp:
2145         (WebCore::DocumentLoader::startLoadingMainResource):
2146         * loader/MainResourceLoader.cpp:
2147         (WebCore::MainResourceLoader::MainResourceLoader):
2148         (WebCore::MainResourceLoader::create):
2149         (WebCore::MainResourceLoader::receivedError):
2150         (WebCore::MainResourceLoader::willSendRequest):
2151         (WebCore::MainResourceLoader::continueAfterContentPolicy):
2152         (WebCore::MainResourceLoader::didReceiveResponse):
2153         (WebCore::MainResourceLoader::didReceiveData):
2154         (WebCore::MainResourceLoader::startDataLoadTimer):
2155         * loader/MainResourceLoader.h:
2156         (MainResourceLoader):
2157
2158 2012-12-03  Anton Vayvod  <avayvod@chromium.org>
2159
2160         Text Autosizing: don't autosize horizontal menu items implemented via floating list items
2161         https://bugs.webkit.org/show_bug.cgi?id=103840
2162
2163         Reviewed by Kenneth Rohde Christiansen.
2164
2165         Floating list items are often used to implement horizontal menus. Currently, text autosizing 
2166         disregards such elements as autosizing containers. List items are often then autosized as part
2167         of a bigger cluster (usually the whole page) and look too big.
2168         This change turns floating list items into autosizing clusters so they are autosized separately
2169         resulting in no font size multiplication for menu items implemented in this manner.
2170
2171         Test: fast/text-autosizing/cluster-list-item.html
2172
2173         * rendering/TextAutosizer.cpp:
2174         (WebCore::TextAutosizer::isAutosizingContainer): Returns true for floating list items; split the
2175         condition logically.
2176
2177 2012-12-03  Viatcheslav Ostapenko  <v.ostapenko@samsung.com>
2178
2179         Optimization in image decoding
2180         https://bugs.webkit.org/show_bug.cgi?id=88424
2181
2182         Reviewed by Brent Fulgham.
2183
2184         Replace int with J_COLOR_SPACE in parameters of templates setPixel and
2185         outputScanlines to avoid casting from int to enum. It required move 
2186         inclusion of jpeglib.h and related #if to JPEGImageDecoder.h .
2187
2188         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2189         (WebCore):
2190         (WebCore::setPixel):
2191         (WebCore::JPEGImageDecoder::outputScanlines):
2192         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2193         (JPEGImageDecoder):
2194
2195 2012-12-03  Tony Chang  <tony@chromium.org>
2196
2197         [mathml] Improve performance of nested sup or sub elements
2198         https://bugs.webkit.org/show_bug.cgi?id=103665
2199
2200         Reviewed by Darin Adler.
2201
2202         Reduce the number of extra layouts. Since RenderMathMLSubSup calls
2203         layout twice, this can lead to an exponential number of layouts. Avoid
2204         extra layouts.
2205
2206         Test: mathml/presentation/sup-nested.html - Should not time out.
2207
2208         * css/mathml.css:
2209         (msup): Stretching children also causes extra layouts. Avoid this by aligning to the top.
2210         (msub): Same as msup, but align to the bottom.
2211         * rendering/mathml/RenderMathMLSubSup.cpp:
2212         (WebCore::RenderMathMLSubSup::layout): Only do the second layout if the padding changed.
2213         Also fix up the calls to setNeedsLayout (since we're calling it on this) and
2214         setChildNeedsLayout (since we're calling it on a child).
2215
2216 2012-12-03  Konrad Piascik  <kpiascik@rim.com>
2217
2218         Web Inspector: free Page resources on inspector disconnect
2219         https://bugs.webkit.org/show_bug.cgi?id=103888
2220
2221         Reviewed by Yury Semikhatsky.
2222
2223         We don't need to keep the page around and can free up memory when disconnecting web inspector.
2224
2225         Not testable.
2226
2227         * inspector/InspectorController.cpp:
2228         (WebCore::InspectorController::disconnectFrontend):
2229         * inspector/InspectorOverlay.cpp:
2230         (WebCore::InspectorOverlay::freePage):
2231         (WebCore):
2232         * inspector/InspectorOverlay.h:
2233         (InspectorOverlay):
2234
2235 2012-12-03  Alexis Menard  <alexis@webkit.org>
2236
2237         [GTK] Enable CSS3 background-background position offset by default.
2238         https://bugs.webkit.org/show_bug.cgi?id=103903
2239
2240         Reviewed by Philippe Normand.
2241
2242         Turn the feature on by default.
2243
2244         No new tests : covered by tests already landed.
2245
2246         * GNUmakefile.features.am:
2247
2248 2012-12-03  Hajime Morrita  <morrita@google.com>
2249
2250         Corrupted DOM tree during appendChild/insertBefore
2251         https://bugs.webkit.org/show_bug.cgi?id=103601
2252
2253         Reviewed by Abhishek Arya.
2254
2255         There are some missing protection in appendChild() and insertBefore().
2256         This change added these.
2257
2258         Dromaeo dom-modify shows no speed regression (5445run/s before vs 5351run/s after)
2259
2260         Tests: fast/events/mutation-during-append-child.html
2261                fast/events/mutation-during-insert-before.html
2262
2263         * dom/ContainerNode.cpp:
2264         (WebCore::checkAcceptChildGuaranteedNodeTypes):
2265         (WebCore):
2266         (WebCore::ContainerNode::insertBefore):
2267         (WebCore::ContainerNode::appendChild):
2268
2269 2012-12-03  Jocelyn Turcotte  <jocelyn.turcotte@digia.com>
2270
2271         Document::initSecurityContext() fails to call securityOrigin().grantLoadLocalResources()
2272         https://bugs.webkit.org/show_bug.cgi?id=68711
2273
2274         Reviewed by Adam Barth.
2275
2276         It currently fails since Document::loader() will return 0 until
2277         Frame::setDocument is called and we are doing this check before it happens.
2278
2279         Delay the check and let the FrameLoader take care of doing grantLoadLocalResources()
2280         on the Document along with other header checks in FrameLoader::didBeginDocument.
2281
2282         * dom/Document.cpp:
2283         (WebCore::Document::initSecurityContext):
2284         * loader/FrameLoader.cpp:
2285         (WebCore::FrameLoader::didBeginDocument):
2286
2287 2012-12-03  Yong Li  <yoli@rim.com>
2288
2289         ENABLE(IMAGE_DECODER_DOWN_SAMPLING): Should use TURBO_JPEG_RGB_SWIZZLE fast path for non-scaled images
2290         https://bugs.webkit.org/show_bug.cgi?id=103749
2291
2292         Reviewed by Rob Buis.
2293
2294         Replace !ENABLE(IMAGE_DECODER_DOWN_SAMPLING) with !m_scaled.
2295
2296         No new tests as existing jpegs are good with IMAGE_DECODER_DOWN_SAMPLING set up.
2297
2298         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2299         (WebCore::JPEGImageDecoder::outputScanlines):
2300
2301 2012-12-03  Tommy Widenflycht  <tommyw@google.com>
2302
2303         Speech Recognition API: Update SpeechRecognitionEvent to match the specification
2304         https://bugs.webkit.org/show_bug.cgi?id=103407
2305
2306         Reviewed by Kentaro Hara.
2307
2308         Specification for the Speech Recognition API:
2309         http://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html
2310
2311         This patch does the following:
2312         o Adds results, and removing result, on SpeechRecognitionEvent
2313         o Renaming SpeechRecognitionResult::final to isFinal
2314         o Removing emma from SpeechRecognitionResult
2315
2316         The emma attribute is supposed to move from SpeechRecognitionResult to the SpeechRecognitionEvent,
2317         but that caused GC issues for unrelated code so it will be added later when properly fixed.
2318
2319         Existing tests updated to test the new API.
2320
2321         * Modules/speech/SpeechRecognition.cpp:
2322         (WebCore::SpeechRecognition::start):
2323         (WebCore::SpeechRecognition::didReceiveResults):
2324         (WebCore):
2325         * Modules/speech/SpeechRecognition.h:
2326         (SpeechRecognition):
2327         * Modules/speech/SpeechRecognitionEvent.cpp:
2328         (WebCore::SpeechRecognitionEvent::createResult):
2329         (WebCore):
2330         (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent):
2331         (WebCore::SpeechRecognitionEvent::~SpeechRecognitionEvent):
2332         * Modules/speech/SpeechRecognitionEvent.h:
2333         (SpeechRecognitionEventInit):
2334         (SpeechRecognitionEvent):
2335         (WebCore::SpeechRecognitionEvent::resultIndex):
2336         (WebCore::SpeechRecognitionEvent::results):
2337         * Modules/speech/SpeechRecognitionEvent.idl:
2338         * Modules/speech/SpeechRecognitionResult.cpp:
2339         * Modules/speech/SpeechRecognitionResult.h:
2340         (WebCore::SpeechRecognitionResult::isFinal):
2341         (SpeechRecognitionResult):
2342         * Modules/speech/SpeechRecognitionResult.idl:
2343         * WebCore.gypi:
2344         * bindings/js/JSDictionary.cpp:
2345         (WebCore::JSDictionary::convertValue):
2346         (WebCore):
2347         * bindings/js/JSDictionary.h:
2348         * bindings/v8/Dictionary.cpp:
2349         (WebCore::Dictionary::get):
2350         (WebCore):
2351         * bindings/v8/Dictionary.h:
2352         (Dictionary):
2353         * bindings/v8/custom/V8SpeechRecognitionResultCustom.cpp: Removed.
2354
2355 2012-12-03  Sheriff Bot  <webkit.review.bot@gmail.com>
2356
2357         Unreviewed, rolling out r136377.
2358         http://trac.webkit.org/changeset/136377
2359         https://bugs.webkit.org/show_bug.cgi?id=103881
2360
2361         Causes crashes on debug builds that use JSC. (Requested by
2362         mkwst on #webkit).
2363
2364         * Modules/websockets/WebSocket.cpp:
2365         (WebCore::WebSocket::connect):
2366         * Modules/websockets/WebSocketChannel.cpp:
2367         (WebCore::WebSocketChannel::didFailSocketStream):
2368         * css/MediaList.cpp:
2369         (WebCore::addResolutionWarningMessageToConsole):
2370         * dom/Document.cpp:
2371         (WebCore::Document::logExceptionToConsole):
2372         (WebCore::Document::processHttpEquiv):
2373         * dom/Document.h:
2374         (Document):
2375         * dom/ScriptExecutionContext.h:
2376         (ScriptExecutionContext):
2377         * dom/ViewportArguments.cpp:
2378         (WebCore):
2379         (WebCore::parserLineNumber):
2380         (WebCore::reportViewportWarning):
2381         * html/HTMLFormElement.cpp:
2382         (WebCore::HTMLFormElement::validateInteractively):
2383         * html/HTMLIFrameElement.cpp:
2384         (WebCore::HTMLIFrameElement::parseAttribute):
2385         * html/canvas/WebGLRenderingContext.cpp:
2386         (WebCore):
2387         (WebCore::WebGLRenderingContext::printWarningToConsole):
2388         * inspector/ConsoleMessage.cpp:
2389         (WebCore::ConsoleMessage::ConsoleMessage):
2390         * inspector/ConsoleMessage.h:
2391         (ConsoleMessage):
2392         * inspector/InspectorConsoleAgent.cpp:
2393         (WebCore::InspectorConsoleAgent::enable):
2394         (WebCore::InspectorConsoleAgent::addMessageToConsole):
2395         (WebCore::InspectorConsoleAgent::count):
2396         * loader/FrameLoader.cpp:
2397         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2398         * loader/MainResourceLoader.cpp:
2399         (WebCore::MainResourceLoader::didReceiveResponse):
2400         * page/Console.cpp:
2401         * page/Console.h:
2402         (Console):
2403         * page/DOMWindow.cpp:
2404         (WebCore::DOMWindow::printErrorMessage):
2405         * svg/SVGDocumentExtensions.cpp:
2406         (WebCore):
2407         (WebCore::parserLineNumber):
2408         (WebCore::reportMessage):
2409         * workers/WorkerContext.cpp:
2410         * workers/WorkerContext.h:
2411         (WorkerContext):
2412
2413 2012-12-03  Kihong Kwon  <kihong.kwon@samsung.com>
2414
2415         Remove useless included header and change position of Proximity Events test cases
2416         https://bugs.webkit.org/show_bug.cgi?id=103871
2417
2418         Reviewed by Antonio Gomes.
2419
2420         Remove useless included header from DeviceProximityEvent.cpp.
2421
2422         No new tests, It is just code refactoring.
2423
2424         * Modules/proximity/DeviceProximityEvent.cpp:
2425
2426 2012-12-03  Jussi Kukkonen  <jussi.kukkonen@intel.com>
2427
2428         [GStreamer] initial volume events on media elements should happen earlier
2429         https://bugs.webkit.org/show_bug.cgi?id=96912
2430
2431         Reviewed by Philippe Normand.
2432
2433         Update mediaelement volume and mute properties to whatever values
2434         playbin has as soon as possible (when the playbin reaches PAUSED state).
2435         This will improve user experience as the volume visuals won't suddenly
2436         change when user clicks play.
2437
2438         No new tests: media/event-attributes.html already tests media events.
2439         Unfortunately this test is flaky on EFL and GTK (more specifically
2440         it is flaky on pulseaudio-using gstreamer platforms: http://webkit.org/b/83704).
2441
2442         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2443         (WebCore::MediaPlayerPrivateGStreamer::load):
2444         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2445         (MediaPlayerPrivateGStreamer):
2446
2447 2012-12-03  Alexis Menard  <alexis@webkit.org>
2448
2449         Unreviewed build fix after r136378.
2450
2451         * css/CSSPrimitiveValueMappings.h:
2452         (WebCore):
2453         (WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin):
2454
2455 2012-12-03  Alexis Menard  <alexis@webkit.org>
2456
2457         [CSS3 Backgrounds and Borders] Implement CSS3 background-position offsets rendering.
2458         https://bugs.webkit.org/show_bug.cgi?id=103440
2459
2460         Reviewed by Julien Chaffraix.
2461
2462         Add the rendering bits of the new background-position offsets. It adds
2463         new bits in FillLayer to store the edges used to position the
2464         background. The old x and y members are used the same way as before, to
2465         store the value of the offset.
2466
2467         Test: fast/backgrounds/background-position-rendering.html
2468
2469         * css/CSSComputedStyleDeclaration.cpp:
2470         (WebCore::createPositionListForLayer): Refactor into a function the
2471         code duplicated in getPropertyCSSValue to avoid more code
2472         duplication.
2473         (WebCore):
2474         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2475         * css/CSSPrimitiveValueMappings.h:
2476         (WebCore):
2477         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2478         Add implicit conversion from the enums used in the rendering code to
2479         CSS values.
2480         (WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin):
2481         * css/CSSToStyleMap.cpp:
2482         (WebCore::CSSToStyleMap::mapFillXPosition):
2483         (WebCore::CSSToStyleMap::mapFillYPosition):
2484         * rendering/RenderBoxModelObject.cpp:
2485         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Add
2486         support for the new positioning and refactor a little naming of the
2487         variables for better readability.
2488         * rendering/style/FillLayer.cpp:
2489         (SameSizeAsFillLayer):
2490         (WebCore::FillLayer::FillLayer):
2491         (WebCore::FillLayer::operator=):
2492         (WebCore::FillLayer::operator==):
2493         (WebCore::FillLayer::fillUnsetProperties):
2494         (WebCore::FillLayer::fillUnsetProperties): When filling the layer with
2495         unset properties make sure we also set the x and y origins of the
2496         background in case they were set.
2497         * rendering/style/FillLayer.h:
2498         (WebCore::FillLayer::backgroundXOrigin):
2499         (WebCore::FillLayer::backgroundYOrigin):
2500         (WebCore::FillLayer::isBackgroundOriginSet):
2501         (FillLayer):
2502         (WebCore::FillLayer::setBackgroundXOrigin):
2503         (WebCore::FillLayer::setBackgroundYOrigin):
2504         (WebCore::FillLayer::clearPositionX):
2505         (WebCore::FillLayer::clearPositionY):
2506         * rendering/style/RenderStyleConstants.h:
2507
2508 2012-12-03  Mike West  <mkwst@chromium.org>
2509
2510         Web Inspector: Autogenerate stack traces and line numbers when possible.
2511         https://bugs.webkit.org/show_bug.cgi?id=100650
2512
2513         Reviewed by Yury Semikhatsky.
2514
2515         Console messages generated in WebCore generally are asked to do a bit of
2516         work in order to provide a developer with a detailed report. We ask the
2517         caller to either generate stack traces, or pass in a url/line number
2518         pair, which can be a bit of work. Predictably, most callers don't pass
2519         in what we'd like to see.
2520
2521         This patch creates a new, simpler console message generation API that we
2522         expect most call sites to use. Source, type, level, and message are
2523         required, and an optional request ID can be passed in. Everything else
2524         will be autogenerated inside ConsoleMessage when appropriate.
2525
2526         In a subsequent patch, we expect to be able to trim down more of the
2527         external call sites (ContentSecurityPolicy springs to mind) in order to
2528         further consolidate the external interface. Simple is good.
2529
2530         * Modules/websockets/WebSocket.cpp:
2531         (WebCore::WebSocket::connect):
2532         * Modules/websockets/WebSocketChannel.cpp:
2533         (WebCore::WebSocketChannel::didFailSocketStream):
2534             Drop the now-redundant URL parameter from various WebSocket errors.
2535         * css/MediaList.cpp:
2536         (WebCore::addResolutionWarningMessageToConsole):
2537             Switch to Document::addConsoleMessage, which means that we can move
2538             line-number generation out of MediaList.
2539         * dom/Document.cpp:
2540         (WebCore::Document::logExceptionToConsole):
2541             Use the long-form 'addMessage()' rather than the public interface.
2542         (WebCore::Document::processHttpEquiv):
2543             Drop the URL parameter, as it's now autogenerated.
2544         (WebCore::Document::addConsoleMessage):
2545         (WebCore):
2546         * dom/Document.h:
2547         (Document):
2548             Override the pure virtual method on ScriptExecutionContext, and pass
2549             the call through to the new Console::addMessage, which accepts a
2550             pointer to the Document in order to do line-number generation.
2551         * dom/ScriptExecutionContext.h:
2552         (ScriptExecutionContext):
2553             Add a pure virtual variant of addConsoleMessage which accepts only
2554             bare minimum data, and expects autogeneration of the rest.
2555             Additionally, ensure that the other variants always have either a
2556             URL/line number, or a stack trace.
2557         * dom/ViewportArguments.cpp:
2558         (WebCore::reportViewportWarning):
2559             Drop line numbers and URLs from Viewport warnings. We can generate
2560             these now.
2561         * html/HTMLFormElement.cpp:
2562         (WebCore::HTMLFormElement::validateInteractively):
2563             Drop the URL from form autofocus warnings
2564         * html/HTMLIFrameElement.cpp:
2565         (WebCore::HTMLIFrameElement::parseAttribute):
2566             Drop the URL and line from sandbox attribute warnings.
2567         * html/canvas/WebGLRenderingContext.cpp:
2568         (WebCore):
2569         (WebCore::WebGLRenderingContext::printWarningToConsole):
2570             Drop the URL from WebGL warnings.
2571         * inspector/ConsoleMessage.cpp:
2572         (WebCore::ConsoleMessage::ConsoleMessage):
2573             Call 'autogenerateMetadata' to ensure that a stack trace is
2574             generated if one isn't provided. Create a new constructor that
2575             accepts a ScriptState/ScriptArguments pair, and use it for console
2576             API calls.
2577         (WebCore):
2578         (WebCore::ConsoleMessage::autogenerateMetadata):
2579             Generate a stack trace given whatever information we've got.
2580         * inspector/ConsoleMessage.h:
2581         (ConsoleMessage):
2582             Create a new constructor that accepts a ScriptState/ScriptArguments
2583             pair, and use it for console API calls.
2584         * inspector/InspectorConsoleAgent.cpp:
2585         (WebCore::InspectorConsoleAgent::enable):
2586             Use the short-form ConsoleMessage constructor.
2587         (WebCore::InspectorConsoleAgent::addMessageToConsole):
2588             Use the stack-only constructor, or the ScriptState
2589             constructor, as appropriate.
2590         (WebCore::InspectorConsoleAgent::count):
2591             We generated a stack, pass it in.
2592         * loader/FrameLoader.cpp:
2593         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2594         * loader/MainResourceLoader.cpp:
2595         (WebCore::MainResourceLoader::didReceiveResponse):
2596             Drop the URL parameter from the console message for X-Frame-Options
2597             parsing errors.
2598         * page/Console.cpp:
2599         (WebCore::Console::addMessage):
2600             When given a Document*, generate a line number if: 1) the document
2601             is still being parsed, 2) the document is not in document.write(),
2602             3) the parser isn't waiting for script, and 4) the parser isn't
2603             executing script. Many callsites didn't check all of these, which
2604             is why the SVG rebaseline (for example) drops lots and lots of line
2605             numbers which point at a closing '</script>' tag.
2606         (WebCore):
2607         * page/Console.h:
2608         (WebCore):
2609         (Console):
2610             Update the public API to accept a Document* and little else.
2611         * page/DOMWindow.cpp:
2612         (WebCore::DOMWindow::printErrorMessage):
2613             Don't generate a stack here. We can do it later.
2614         * svg/SVGDocumentExtensions.cpp:
2615         (WebCore::reportMessage):
2616             Drop the URL and line number. We'll generate them. It'll be sweet.
2617         * workers/WorkerContext.cpp:
2618         (WebCore::WorkerContext::addConsoleMessage):
2619             Generate a stack here, as we likely won't have the context to do
2620             so later. Pass it through.
2621         (WebCore):
2622         * workers/WorkerContext.h:
2623         (WorkerContext):
2624             Implement the new addConsoleMessage variant.
2625
2626 2012-12-03  Gabor Rapcsanyi  <rgabor@webkit.org>
2627
2628         [Qt] Remove an unnecessary masking from swapBgrToRgb()
2629         https://bugs.webkit.org/show_bug.cgi?id=103630
2630
2631         Reviewed by Zoltan Herczeg.
2632
2633         Get rid of a masking command in swapBgrToRgb() to speed up a little bit.
2634
2635         * platform/graphics/qt/GraphicsContext3DQt.cpp:
2636         (WebCore::swapBgrToRgb):
2637
2638 2012-12-03  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
2639
2640         CSS Device Adaptation: window.innerWidth returns wrong value if CSS viewport descriptors are applied
2641         https://bugs.webkit.org/show_bug.cgi?id=103737
2642
2643         Reviewed by Kenneth Rohde Christiansen.
2644
2645         ViewportStyleResolver used frame view visibleContentRect size as initial viewport size.
2646         This however caused a problem when page enabled/disabled CSS stylesheets, having viewport
2647         descriptors. Viewport descriptors from new stylesheet were applied to the visibleContentRect
2648         affected already by the viewport descriptors from the previous stylesheet.
2649
2650         New 'initialViewportSize' property (http://dev.w3.org/csswg/css-device-adapt/#initial-viewport)
2651         was added to frame view so that viewport descriptors can always be applied to the reliable
2652         viewport size.
2653
2654         Test: css3/device-adapt/viewport-width-check-window-innerwidth-correct.html
2655
2656         * css/ViewportStyleResolver.cpp:
2657         (WebCore::ViewportStyleResolver::ViewportStyleResolver):
2658         (WebCore::ViewportStyleResolver::getViewportArgumentValue):
2659         * css/ViewportStyleResolver.h:
2660         (ViewportStyleResolver):
2661         * dom/Document.cpp:
2662         (WebCore):
2663         (WebCore::Document::initialViewportSize):
2664         * dom/Document.h:
2665         (Document):
2666         * page/FrameView.h:
2667         (FrameView):
2668         (WebCore::FrameView::initialViewportSize):
2669         (WebCore::FrameView::setInitialViewportSize):
2670
2671 2012-12-03  Alexander Pavlov  <apavlov@chromium.org>
2672
2673         Web Inspector: [Styles] Retain selector case as written in the source code
2674         https://bugs.webkit.org/show_bug.cgi?id=103118
2675
2676         Reviewed by Antti Koivisto.
2677
2678         This change:
2679         - adds parsing of selector group components in the CSSParser;
2680         - builds the SelectorList.selectors based on the source code whenever possible.
2681           Strips [multiline] comments and whitespace;
2682         - adds the MultilineMode to RegularExpression.
2683
2684         Test: inspector/styles/selector-list.html
2685
2686         * WebCore.exp.in: Update the exported symbol.
2687         * css/CSSGrammar.y.in: Add invocations for CSSParser::markSelector[Start|End]() as required.
2688         * css/CSSParser.cpp:
2689         (WebCore::CSSParser::markSelectorStart): Gets invoked to mark a selector group item start offset.
2690         (WebCore::CSSParser::markSelectorEnd): Ditto for the end offset.
2691         * css/CSSParser.h: Add new methods and a SourceRange tracking field.
2692         * css/CSSPropertySourceData.h: Add SelectorRangeList to the CSSRuleSourceData.
2693         * inspector/InspectorStyleSheet.cpp:
2694         (WebCore::selectorsFromSource): Builds the SelectorList based on the underlying source data.
2695         Strips comments and whitespace from selectors.
2696         (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
2697         Builds SelectorList based on the availability of the source code.
2698         * inspector/front-end/StylesSidebarPane.js:
2699         (WebInspector.StylePropertiesSection.prototype._markSelectorMatches):
2700         Update selectors in all cases to make use of the source-based information whenever possible.
2701         * platform/text/RegularExpression.cpp:
2702         Add the MultilineMode parameter into the constructor/factory method and ultimately pass it into YarrPattern.
2703         (WebCore::RegularExpression::Private::create): See above.
2704         (WebCore::RegularExpression::Private::Private): See above.
2705         (WebCore::RegularExpression::Private::compile): See above.
2706         (WebCore::RegularExpression::RegularExpression): See above.
2707         * platform/text/RegularExpression.h:
2708         Add enum MultilineMode, modify constructor and factory method signatures accordingly.
2709
2710 2012-12-02  Noel Gordon  <noel.gordon@gmail.com>
2711
2712         ImageOrientation::transformFromDefault() case labels should be in numerical order
2713         https://bugs.webkit.org/show_bug.cgi?id=101596
2714
2715         Reviewed by Simon Fraser.
2716
2717         Place the orientation case labels in numerical order to better match the EXIF2.2 spec
2718         definitions of orientation values and their ImageOrientation.h enumeration.
2719
2720         No change in behavior. Covered by existing tests:
2721            fast/images/exif-orientation-css.html
2722            fast/images/exif-orientation-image-document.html
2723            fast/images/exif-orientation.html
2724
2725         * platform/graphics/ImageOrientation.cpp:
2726         (WebCore::ImageOrientation::transformFromDefault): Numerically order the orientation 
2727         case statement labels.
2728
2729 2012-12-02  Mary Wu  <mary.wu@torchmobile.com.cn>
2730
2731         should sniff it if mimetype don't contain a slash.
2732         https://bugs.webkit.org/show_bug.cgi?id=102778
2733
2734         Reviewed by George Staikos.
2735
2736         Based on http://mimesniff.spec.whatwg.org/, a valid media type
2737         is the string represented by concatenating type, the string "/",
2738         and subtype. So if the mimetype don't contain slash, we should
2739         possible get sniffed type from the content like Firefox/chrome/safari.
2740
2741         RIM Bug# 219590, internally reviewed by Liam Quinn.
2742
2743         No new tests, the patch only impact qt/blackberry porting to be consistent
2744         with chrome, other portings have their own behavior.
2745
2746         * platform/network/MIMESniffing.cpp:
2747         (std::isUnknownType):
2748
2749 2012-12-02  Otto Derek Cheung  <otcheung@rim.com>
2750
2751         [BlackBerry] Adding checks for null when checking cookie status in CookieJarBlackBerry
2752         https://bugs.webkit.org/show_bug.cgi?id=103748
2753
2754         Reviewed by Rob Buis.
2755
2756         The logic is flipped in the previous patch.
2757
2758         * loader/blackberry/CookieJarBlackBerry.cpp:
2759         (WebCore::cookiesEnabled):
2760
2761 2012-12-02  Robert Hogan  <robert@webkit.org>
2762
2763         Bad rendering of web page because of image's height is set to 100%
2764         https://bugs.webkit.org/show_bug.cgi?id=28035
2765
2766         Reviewed by Eric Seidel.
2767
2768         Call computeReplacedLogicalHeight() to get the correct logical height of a replaced element
2769         for calculating the element's width. RenderBox::computeLogicalHeightUsing() is a helper function designed for finding
2770         the min and max height values and is not the way to find the actual used height of a replaced element.
2771
2772         WebKit's quirks-mode behaviour for the test case is unaffected by this change.
2773
2774         Tests: fast/css/computed-image-width-with-percent-height-quirksmode.html
2775                fast/css/computed-image-width-with-percent-height.html
2776
2777         * rendering/RenderReplaced.cpp:
2778         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2779
2780 2012-12-02  Mihnea Ovidenie  <mihnea@adobe.com>
2781
2782         [CSS Regions] regionlayoutupdate event fires continuously
2783         https://bugs.webkit.org/show_bug.cgi?id=102101
2784
2785         Reviewed by David Hyatt.
2786
2787         According to the CSSRegions spec, http://dev.w3.org/csswg/css3-regions/#region-flow-layout-events, the regionlayoutupdate event
2788         should be dispatched when there is a possible layout change in the region chain.
2789         In the current implementation, regionlayoutupdate is dispatched when:
2790         1. a region from region chain changed its regionOverset value
2791         2. a region from region chain has regionOverset = fit| overset
2792
2793         In the case of a named flow having an auto-height region with regionOverset = fit, the second step of layout was done
2794         also when there was not required, therefore the regionlayoutuodate was unnecessary triggered.
2795
2796         We should proceed with the 2-pass layout only if the flow-thread having auto-height regions in region chain needs layout.
2797
2798         Test: fast/regions/autoheight-regionlayoutupdate-multipletimes.html
2799
2800         * rendering/FlowThreadController.cpp:
2801         (WebCore::FlowThreadController::hasRenderNamedFlowThreadsNeedingLayout):
2802         * rendering/FlowThreadController.h:
2803         * rendering/RenderView.cpp:
2804         (WebCore::RenderView::layout):
2805
2806 2012-12-02  Rik Cabanier  <cabanier@adobe.com>
2807
2808         Extend JavaScript support for blending in canvas
2809         https://bugs.webkit.org/show_bug.cgi?id=101804
2810
2811         Reviewed by Dirk Schulze.
2812
2813         Added parsing code and variables to support additional canvas blend modes
2814         see spec: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#canvascompositingandblending
2815
2816         Test: canvas/philip/tests/2d.composite.globalComposite.html
2817
2818         * html/HTMLImageElement.cpp:
2819         (WebCore::HTMLImageElement::parseAttribute):
2820         * html/canvas/CanvasRenderingContext2D.cpp:
2821         (WebCore::CanvasRenderingContext2D::State::State):
2822         (WebCore::CanvasRenderingContext2D::State::operator=):
2823         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
2824         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
2825         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
2826         * html/canvas/CanvasRenderingContext2D.h:
2827         (State):
2828         * platform/graphics/GraphicsTypes.cpp:
2829         (WebCore):
2830         (WebCore::parseCompositeAndBlendOperator):
2831         (WebCore::compositeOperatorName):
2832         * platform/graphics/GraphicsTypes.h:
2833
2834 2012-12-02  KyungTae Kim  <ktf.kim@samsung.com>
2835
2836         [EFL] Fix build warning in GraphicsContext3DEfl.cpp
2837         https://bugs.webkit.org/show_bug.cgi?id=103807
2838
2839         Reviewed by Laszlo Gombos.
2840
2841         Because GraphicsContext3D::ImageExtractor::extractImage is not implemented yet, 
2842         comment out the parameter names for removing -Wunused-parameter warnings.
2843
2844         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
2845         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
2846
2847 2012-12-02  Andreas Kling  <akling@apple.com>
2848
2849         Keep ElementAttributeData sharing cache open for a while after document parsing finishes.
2850         <http://webkit.org/b/103720>
2851
2852         Reviewed by Antti Koivisto.
2853
2854         Allow web pages that generate content dynamically to benefit more from the ElementAttributeData sharing
2855         cache by keeping it open for 10 seconds after document parsing finishes. This enables elements constructed
2856         from HTML fragments to share attribute data with other identical elements.
2857
2858         Elements created via Document.createElement are still unsupported since we don't know the list of attributes
2859         at the time of construction.
2860
2861         401kB progression on Membuster3.
2862
2863         Document now holds on to a DocumentSharedObjectPool, accessible via Document::sharedObjectPool().
2864         It is non-null during parsing and for some time afterwards, and can be used to implement additional
2865         caches that are not worth holding on to permanently.
2866
2867         * CMakeLists.txt:
2868         * GNUmakefile.list.am:
2869         * Target.pri:
2870         * WebCore.gypi:
2871         * WebCore.xcodeproj/project.pbxproj:
2872         * WebCore.vcproj/WebCore.vcproj:
2873
2874             Add new class DocumentSharedObjectPool.
2875
2876         * dom/Document.cpp:
2877         (WebCore::Document::Document):
2878         (WebCore::Document::setParsing):
2879         (WebCore::Document::finishedParsing):
2880         (WebCore::Document::sharedObjectPoolClearTimerFired):
2881         * dom/Document.h:
2882         (WebCore::Document::sharedObjectPool):
2883
2884             Create DocumentSharedObjectPool when parsing starts, kill it on a 10s timer after parsing finishes.
2885
2886         * dom/DocumentSharedObjectPool.cpp: Added.
2887         (ImmutableElementAttributeDataCacheKey):
2888         (WebCore::ImmutableElementAttributeDataCacheKey::ImmutableElementAttributeDataCacheKey):
2889         (WebCore::ImmutableElementAttributeDataCacheKey::operator!=):
2890         (WebCore::ImmutableElementAttributeDataCacheKey::hash):
2891         (ImmutableElementAttributeDataCacheEntry):
2892         (WebCore::ImmutableElementAttributeDataCacheEntry::ImmutableElementAttributeDataCacheEntry):
2893         (WebCore::DocumentSharedObjectPool::cachedImmutableElementAttributeData):
2894         (WebCore::DocumentSharedObjectPool::DocumentSharedObjectPool):
2895         (WebCore::DocumentSharedObjectPool::~DocumentSharedObjectPool):
2896         * dom/DocumentSharedObjectPool.h: Added.
2897         (DocumentSharedObjectPool):
2898         (WebCore::DocumentSharedObjectPool::create):
2899         * dom/Element.cpp:
2900         (WebCore::Element::parserSetAttributes):
2901
2902             Moved the ElementAttributeData cache to DocumentSharedObjectPool.
2903
2904 2012-12-02  John Bauman  <jbauman@chromium.org>
2905
2906         [chromium] Let Pepper Flash use integrated GPU
2907         https://bugs.webkit.org/show_bug.cgi?id=103800
2908
2909         Reviewed by Kenneth Russell.
2910
2911         Pepper Flash uses the SharedGraphicsContext3D as a parent, so don't
2912         require that to use the discrete GPU. This means that accelerated
2913         canvas will use the integrated GPU, but that will save battery life
2914         and seems acceptable. 
2915
2916         * platform/graphics/gpu/SharedGraphicsContext3D.cpp:
2917         (WebCore::SharedGraphicsContext3DImpl::createContext):
2918
2919 2012-12-02  Elliott Sprehn  <esprehn@gmail.com>
2920
2921         documentElement should not always get a renderer
2922         https://bugs.webkit.org/show_bug.cgi?id=103475
2923
2924         Reviewed by Ojan Vafai.
2925
2926         Only SVG documents need a renderer on the documentElement when it's
2927         display: none. This behavior is wrong, but there's assumptions in
2928         FrameView and SVGImage that depend on a RenderSVGRoot existing for all
2929         loaded SVG document and images.
2930
2931         The current code has logic that makes it appear as if we always create
2932         a renderer for the documentElement even when it's display: none, but
2933         because HTMLElement::createRenderer doesn't call super we end up with
2934         HTMLElement::rendererIsNeeded returning true for display: none, but
2935         HTMLElement::createRenderer returning null.
2936
2937         Instead of this generic documentElement logic only special case SVG
2938         until someone can fix Bug 103493 so we don't need it.
2939
2940         Test: fast/css/display-none-documentElement.html
2941
2942         * dom/Element.cpp:
2943         (WebCore::Element::rendererIsNeeded):
2944         (WebCore::Element::createRenderer):
2945         * svg/SVGSVGElement.cpp:
2946         (WebCore::SVGSVGElement::rendererIsNeeded):
2947         * svg/SVGSVGElement.h:
2948         (SVGSVGElement):
2949
2950 2012-12-02  Pan Deng  <pan.deng@intel.com>
2951
2952         [Resource Timing] implementation of cross origin resouce timing restrictions.
2953         https://bugs.webkit.org/show_bug.cgi?id=84886.
2954
2955         Reviewed by Tony Gentilcore.
2956
2957         This patch implemented resource timing behaviors of cross origin. By default, detailed timing info is hided in cross origin resource timing, only startTime, duration, fetchStart and responseEnd can be observed. Exceptions are, server side allow its origin can be timing by another through a header with "timing-allow-origin" field.
2958
2959         Tests: http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_cross_origin_resource_request.html
2960                http/tests/w3c/webperf/submission/Intel/resource-timing/test_resource_timing_timing_allow_cross_origin_resource_request.html
2961
2962         * page/Performance.cpp:
2963         (WebCore::passesTimingAllowCheck):
2964         (WebCore):
2965         (WebCore::Performance::addResourceTiming):
2966         * page/Performance.h:
2967         (WebCore):
2968         (Performance):
2969         * page/PerformanceResourceTiming.cpp:
2970         (WebCore):
2971         * page/PerformanceResourceTiming.h:
2972         (WebCore::PerformanceResourceTiming::create):
2973         (PerformanceResourceTiming):
2974
2975 2012-12-02  Elliott Sprehn  <esprehn@gmail.com>
2976
2977         Simplify treeScope and setTreeScope
2978         https://bugs.webkit.org/show_bug.cgi?id=103708
2979
2980         Reviewed by Hajime Morita.
2981
2982         By making the default treeScope in NodeRareData the document and then
2983         moving the m_treeScope field to NodeRareDataBase we can make treeScope
2984         inline and make setTreeScope much simpler.
2985
2986         There's also no reason to save calls to rareData() now that the map has
2987         been eliminated by r133372 so we can eliminate the return value from
2988         setTreeScope.
2989
2990         No new tests, just refactoring.
2991
2992         * WebCore.exp.in:
2993         * dom/Document.h:
2994         (WebCore::Node::treeScope):
2995         (WebCore):
2996         * dom/Element.cpp:
2997         (WebCore::Element::createRareData):
2998         * dom/ElementRareData.h:
2999         (ElementRareData):
3000         (WebCore::ElementRareData::ElementRareData):
3001         * dom/Node.cpp:
3002         (WebCore::Node::setTreeScope):
3003         (WebCore::Node::createRareData):
3004         * dom/Node.h:
3005         (NodeRareDataBase):
3006         (WebCore::NodeRareDataBase::treeScope):
3007         (WebCore::NodeRareDataBase::setTreeScope):
3008         (WebCore::NodeRareDataBase::NodeRareDataBase):
3009         (Node):
3010         * dom/NodeRareData.cpp:
3011         (WebCore::NodeRareData::reportMemoryUsage):
3012         * dom/NodeRareData.h:
3013         (WebCore::NodeRareData::NodeRareData):
3014         (NodeRareData):
3015         * dom/TreeScopeAdopter.cpp:
3016         (WebCore::TreeScopeAdopter::moveTreeToNewScope):
3017
3018 2012-12-02  Justin Novosad  <junov@google.com>
3019
3020         Fix occlusion culling logic to handle css background layer clipping
3021         https://bugs.webkit.org/show_bug.cgi?id=103276
3022
3023         Reviewed by Simon Fraser.
3024
3025         Bug was introduced by r135629
3026         This patch fixes it by verifying layer clip.  A fill layer must
3027         not be treated as if it occludes the layers under it unless it has
3028         a larger or equal clip setting than the layers under it.
3029
3030         Test: fast/backgrounds/background-opaque-clipped-gradients.html
3031
3032         * rendering/RenderBox.cpp:
3033         (WebCore::RenderBox::paintFillLayers):
3034         * rendering/style/FillLayer.cpp:
3035         (WebCore::clipMax):
3036         (WebCore::FillLayer::computeClipMax):
3037         (WebCore::FillLayer::clipOccludesNextLayers):
3038         * rendering/style/FillLayer.h:
3039         (FillLayer):
3040
3041 2012-12-02  Tony Chang  <tony@chromium.org>
3042
3043         Avoid a second layout of flex items in layoutAndPlaceChildren()
3044         https://bugs.webkit.org/show_bug.cgi?id=102352
3045
3046         Reviewed by Ojan Vafai.
3047
3048         Avoid doing a second layout if we're going to get the same size as before.
3049         This prevents us from doing an exponential number of layouts in some
3050         common cases.
3051
3052         Test: css3/flexbox/stretch-after-sibling-size-change.html
3053
3054         * html/shadow/SliderThumbElement.cpp:
3055         (WebCore::RenderSliderContainer::layout): Force a layout of the track, which positions the thumb.
3056         * rendering/RenderFlexibleBox.cpp:
3057         (WebCore::RenderFlexibleBox::needToStretchChild): Determine if a child is going to stretch.
3058         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis): Makes sure we're in a consistent state before
3059         we apply auto margins.
3060         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
3061         * rendering/RenderFlexibleBox.h: Add needToStretchChild.
3062
3063 2012-12-02  Yongjun Zhang  <yongjun_zhang@apple.com>
3064
3065         Need a method to close all idle localstorage databases immediately.
3066         https://bugs.webkit.org/show_bug.cgi?id=103469
3067
3068         Reviewed by David Kilzer.
3069
3070         Add a new PageGroup method closeIdleLocalStorageDatabases, which walks through
3071         all local storage areas that don't have document referencing to them and closes
3072         their underlying databases.
3073
3074         Test: storage/domstorage/localstorage/close-idle-localstorage-databases-immediately.html
3075
3076         * WebCore.exp.in:
3077         * page/PageGroup.cpp:
3078         (WebCore::PageGroup::clearLocalStorageForOrigin):
3079         (WebCore):
3080         (WebCore::PageGroup::closeIdleLocalStorageDatabases): walking through all idle local storages and
3081             closing their databases.
3082         * page/PageGroup.h:
3083         (PageGroup):
3084         * storage/StorageArea.h:
3085         (WebCore::StorageArea::closeDatabaseIfIdle):
3086         * storage/StorageAreaImpl.cpp:
3087         (WebCore::StorageAreaImpl::closeDatabaseIfIdle): close the database if it is idle.
3088         (WebCore):
3089         * storage/StorageAreaImpl.h:
3090         (StorageAreaImpl):
3091         * storage/StorageNamespace.h:
3092         (StorageNamespace):
3093         * storage/StorageNamespaceImpl.cpp:
3094         (WebCore::StorageNamespaceImpl::closeIdleLocalStorageDatabases):
3095         (WebCore):
3096         * storage/StorageNamespaceImpl.h:
3097         (StorageNamespaceImpl):
3098
3099 2012-12-02  Otto Derek Cheung  <otcheung@rim.com>
3100
3101         [BlackBerry] Adding checks for null when checking cookie status in CookieJarBlackBerry
3102         https://bugs.webkit.org/show_bug.cgi?id=103748
3103
3104         Reviewed by Rob Buis.
3105
3106         Updating CookieJarBlackBerry::cookieEnabled and have other methods in the class call that
3107         method. Also, adding null checks for document->settings().
3108
3109         No change in behaviour.
3110
3111         * loader/blackberry/CookieJarBlackBerry.cpp:
3112         (WebCore::cookies):
3113         (WebCore::setCookies):
3114         (WebCore::cookiesEnabled):
3115         (WebCore::getRawCookies):
3116         (WebCore::deleteCookie):
3117         (WebCore::cookieRequestHeaderFieldValue):
3118
3119 2012-12-02  Sheriff Bot  <webkit.review.bot@gmail.com>
3120
3121         Unreviewed, rolling out r136236.
3122         http://trac.webkit.org/changeset/136236
3123         https://bugs.webkit.org/show_bug.cgi?id=103833
3124
3125         [chromium] Flakey crashes in SpeechRecognitionEvent::emma
3126         during GC. (Requested by mkwst on #webkit).
3127
3128         * Modules/speech/SpeechRecognition.cpp:
3129         (WebCore::SpeechRecognition::start):
3130         * Modules/speech/SpeechRecognition.h:
3131         (SpeechRecognition):
3132         * Modules/speech/SpeechRecognitionEvent.cpp:
3133         (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent):
3134         * Modules/speech/SpeechRecognitionEvent.h:
3135         (SpeechRecognitionEventInit):
3136         (SpeechRecognitionEvent):
3137         (WebCore::SpeechRecognitionEvent::resultIndex):
3138         * Modules/speech/SpeechRecognitionEvent.idl:
3139         * Modules/speech/SpeechRecognitionResult.cpp:
3140         (WebCore::emmaQualifiedName):
3141         (WebCore):
3142         (WebCore::SpeechRecognitionResult::emma):
3143         * Modules/speech/SpeechRecognitionResult.h:
3144         (WebCore):
3145         (WebCore::SpeechRecognitionResult::final):
3146         (SpeechRecognitionResult):
3147         * Modules/speech/SpeechRecognitionResult.idl:
3148         * WebCore.gypi:
3149         * bindings/v8/custom/V8SpeechRecognitionResultCustom.cpp: Renamed from Source/WebCore/bindings/v8/custom/V8SpeechRecognitionEventCustom.cpp.
3150         (WebCore):
3151         (WebCore::V8SpeechRecognitionResult::opaqueRootForGC):
3152
3153 2012-12-01  Sheriff Bot  <webkit.review.bot@gmail.com>
3154
3155         Unreviewed, rolling out r136015.
3156         http://trac.webkit.org/changeset/136015
3157         https://bugs.webkit.org/show_bug.cgi?id=103821
3158
3159         Did not heal performance bot and caused other performance
3160         regressions (Requested by abarth on #webkit).
3161
3162         * bindings/scripts/CodeGeneratorV8.pm:
3163         (GenerateHeader):
3164
3165 2012-12-01  Xiaobo Wang  <xiaobo.wang@torchmobile.com.cn>
3166
3167         DRT - crashed in WebCore::SearchFieldCancelButtonElement::defaultEventHandler
3168         https://bugs.webkit.org/show_bug.cgi?id=103592
3169
3170         Reviewed by Kent Tamura.
3171
3172         The crash happened when the search field cancel button handles mouseout
3173         event after the search input was detached. When it happens the input
3174         element returned from shadowHost() is null, need to check the pointer
3175         before dereferencing.
3176         InputFieldSpeechButton and SearchFieldResultsButtonElement have the
3177         similar issue.
3178
3179         No new tests. The patch fixes the following test on BlackBerry platform.
3180         Test: fast/forms/search-delete-while-cancel-button-clicked.html
3181
3182         * html/shadow/TextControlInnerElements.cpp:
3183         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
3184         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
3185         (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents):
3186         (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
3187         (WebCore::InputFieldSpeechButtonElement::willRespondToMouseClickEvents):
3188         (WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
3189
3190 2012-11-30  Mike West  <mkwst@chromium.org>
3191
3192         CSP 1.1: Make the CSP_NEXT flag runtime enabled.
3193         https://bugs.webkit.org/show_bug.cgi?id=103652
3194
3195         Reviewed by Adam Barth.
3196
3197         Content Security Policy 1.1 continues to live behind the CSP_NEXT flag,
3198         this patch adds another layer on top of that in order to enable runtime
3199         decisions about whether it should be active.
3200
3201         * bindings/generic/RuntimeEnabledFeatures.cpp:
3202         (WebCore):
3203         * bindings/generic/RuntimeEnabledFeatures.h:
3204         (RuntimeEnabledFeatures):
3205         (WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled):
3206         (WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled):
3207             Adds methods in order to correctly handle enabling and disabling
3208             CSP 1.1 features.
3209         * dom/Document.idl:
3210             Gate the 'document.securityPolicy' object on the runtime flag.
3211         * page/ContentSecurityPolicy.cpp:
3212         (WebCore::CSPDirectiveList::addDirective):
3213             Check that experimental features are runtime enabled before
3214             processing 1.1 directives.
3215         (WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled):
3216         (WebCore):
3217         * page/ContentSecurityPolicy.h:
3218             Adds a new method which checks against the runtime flag to determine
3219             whether CSP 1.1 features are enabled.
3220
3221 2012-11-30  Simon Fraser  <simon.fraser@apple.com>
3222
3223         Avoid calling into NSUserDefaults every time we start a scroll
3224         https://bugs.webkit.org/show_bug.cgi?id=103804
3225
3226         Reviewed by Dan Bernstein.
3227
3228         Cache the NSScrollAnimationEnabled preference to avoid
3229         hitting NSUserDefaults every time we start scrolling.
3230
3231         * platform/mac/ScrollAnimatorMac.mm:
3232         (WebCore::scrollAnimationEnabledForSystem):
3233
3234 2012-11-30  Beth Dakin  <bdakin@apple.com>
3235
3236         https://bugs.webkit.org/show_bug.cgi?id=103790
3237         The LayerPool m_pruneTimer should have a longer delay
3238
3239         Reviewed by Simon Fraser.
3240
3241         A 1 second delay is more appropriate here.
3242         * platform/graphics/ca/mac/LayerPool.mm:
3243         (WebCore::LayerPool::schedulePrune):
3244
3245 2012-11-30  Jer Noble  <jer.noble@apple.com>
3246
3247         Unreviewed Windows build fix.
3248
3249         Add a default: entry to an case statement to fix a build error when compiled in VS2005.
3250
3251         * html/MediaController.cpp:
3252         (MediaController::playbackState):
3253
3254 2012-11-30  Jer Noble  <jer.noble@apple.com>
3255
3256         Add support for the 'unpause()' method on MediaController.
3257         https://bugs.webkit.org/show_bug.cgi?id=103751
3258
3259         Reviewed by Eric Carlson.
3260
3261         The MediaController spec has been updated to add an unpause() method
3262         which is functionally identical to the old play() method, and changes
3263         the semantics of play() to call play() on the underlying slaved media
3264         elements. The spec also added a playbackState() method, returning a
3265         string representing the last calculated playback state.
3266
3267         Test: media/media-controller-unpause.html
3268
3269         * html/MediaController.cpp:
3270         (MediaController::unpause): Renamed from play().
3271         (MediaController::play): Added. Same as unpause(), but also call
3272             play() on slaved media elements.
3273         (playbackStateWaiting): Static string accessor.
3274         (playbackStatePlaying): Ditto.
3275         (playbackStateEnded): Ditto.
3276         (MediaController::playbackState): Added. Returns string value of
3277             m_playbackState.
3278         * html/MediaController.h:
3279         * html/MediaController.idl:
3280
3281 2012-11-30  Julien Chaffraix  <jchaffraix@webkit.org>
3282
3283         [CSS Grid Layout] Align the grid track code with the specification's production rules
3284         https://bugs.webkit.org/show_bug.cgi?id=103703
3285
3286         Reviewed by Alexis Menard.
3287
3288         In order to support more of the syntax and make the code more readable, this change
3289         splits following the grammar's production rules (see
3290         http://dev.w3.org/csswg/css3-grid-layout/#grid-definition-columns-and-grid-definit).
3291
3292         Refactoring covered by existing tests.
3293
3294         * css/CSSComputedStyleDeclaration.cpp:
3295         (WebCore::valueForGridTrackMinMax):
3296         (WebCore::valueForGridTrackGroup):
3297         (WebCore::valueForGridTrackList):
3298         * css/CSSParser.cpp:
3299         (WebCore::CSSParser::parseGridTrackList):
3300         (WebCore::CSSParser::parseGridTrackGroup):
3301         (WebCore::CSSParser::parseGridTrackMinMax):
3302         * css/CSSParser.h:
3303         * css/StyleResolver.cpp:
3304         (WebCore::createGridTrackMinMax):
3305         (WebCore::createGridTrackGroup):
3306         (WebCore::createGridTrackList):
3307         Mechanical split of the parsing, resolving and computed style code into
3308         <track-list>, <track-group>, <track-minmax> and <track-breadth> parts.
3309
3310         * css/CSSParser.cpp:
3311         (WebCore::CSSParser::parseGridBreadth):
3312         Changed this function to just parse a single value (without any extra logic).
3313
3314         * css/StyleResolver.cpp:
3315         (WebCore::createGridTrackBreadth):
3316         Changed this function to take a Length as it is used to parse a <track-breadth>.
3317         The goal is for it to be the low-level function createGridTrackMinmax will call on
3318         each function parameter.
3319
3320 2012-11-30  Simon Fraser  <simon.fraser@apple.com>
3321
3322         Fix potential crash when canceling animations on renderers with no node
3323         https://bugs.webkit.org/show_bug.cgi?id=103784
3324
3325         Reviewed by Dan Bernstein.
3326
3327         We could crash when tearing down RenderScrollbars because we hit
3328         AnimationController::cancelAnimations() for a renderer with no node.
3329         The assertion already check for a null node, but the line after
3330         does not, so fix that.
3331
3332         I tried to make a test with animations/transitions on a custom scrollbar, but was not able
3333         to get it to crash.
3334
3335         * page/animation/AnimationController.cpp:
3336         (WebCore::AnimationController::cancelAnimations):
3337
3338 2012-11-30  Tim Horton  <timothy_horton@apple.com>
3339
3340         PluginDocument fires didFinishDocumentLoadForFrame upon receiving initial bytes instead of when load completes
3341         https://bugs.webkit.org/show_bug.cgi?id=103702
3342         <rdar://problem/12762534>
3343
3344         Reviewed by Alexey Proskuryakov.
3345
3346         Remove the call to finish() from PluginDocumentParser::appendBytes().
3347
3348         This was introduced in http://trac.webkit.org/changeset/14838, when finish() wouldn't get
3349         called for PluginDocuments any other way. In the time since, DocumentWriter::end() was made
3350         to call finish() anyway, at the correct time (the call from appendBytes makes a PluginDocument
3351         appear to be finished loading after the first bytes are received).
3352
3353         No new tests, because there doesn't seem to be any state in a PluginDocument that can be accessed
3354         from JavaScript to determine whether or not it has finished loading.
3355
3356         * html/PluginDocument.cpp:
3357         (WebCore::PluginDocumentParser::appendBytes):
3358
3359 2012-11-29  Ilya Tikhonovsky  <loislo@chromium.org>
3360
3361         RenderBlock minor clean-up: replace raw pointers with OwnPtrs.
3362         https://bugs.webkit.org/show_bug.cgi?id=103690
3363
3364         Reviewed by Eric Seidel.
3365
3366         raw pointers were replaced with OwnPtrs.
3367         Probably we also gain a small performance improvements because
3368         I replaced get && remove pair with take.
3369
3370         * rendering/RenderBlock.cpp:
3371         (WebCore):
3372         (WebCore::removeBlockFromDescendantAndContainerMaps):
3373         (WebCore::RenderBlock::~RenderBlock):
3374         (WebCore::RenderBlock::addOverflowFromFloats):
3375         (WebCore::RenderBlock::addContinuationWithOutline):
3376         (WebCore::RenderBlock::paintContinuationOutlines):
3377         (WebCore::RenderBlock::insertIntoTrackedRendererMaps):
3378         (WebCore::RenderBlock::removeFromTrackedRendererMaps):
3379         (WebCore::RenderBlock::setDesiredColumnCountAndWidth):
3380         * rendering/RenderBlock.h:
3381         (WebCore):
3382
3383 2012-11-30  Jun Jiang  <jun.a.jiang@intel.com>
3384
3385         WebGL: Add a class to abstract the status of the Image in texImage2D() and texSubImage2D()
3386         https://bugs.webkit.org/show_bug.cgi?id=103606
3387
3388         Reviewed by Kenneth Russell.
3389
3390         In texImage2D() and texSubImage2D() for WebGL, the status of the Image is extracted and kept in the function GraphicsContext3D::getImageData() but provides no interface or guaranteed way to use the status of the Image outside GraphicsContext3D::getImageData() safely. For example, you can not get the address of the raw Image data and operate it outside the scope of the GraphicsContext3D::getImageData() and there is at least one memory copy existed from the Image to the intermediate vector.
3391        This patch refactors the code by adding a ImageExtractor class to abstract and keep the status of the Image. The lifetime and validity of Image status are determined by the lifetime of the object instead of the scope of getImageData(). It provides flexibility on future optimizations.
3392
3393         No new tests. It is a code refactoring patch.
3394
3395         * html/canvas/WebGLRenderingContext.cpp:
3396         (WebCore):
3397         (WebCore::WebGLRenderingContext::texImage2DImpl):
3398         (WebCore::WebGLRenderingContext::texSubImage2DImpl):
3399         * platform/graphics/GraphicsContext3D.cpp:
3400         (WebCore::GraphicsContext3D::ImageExtractor::ImageExtractor):
3401         (WebCore):
3402         (WebCore::GraphicsContext3D::packImageData):
3403         * platform/graphics/GraphicsContext3D.h:
3404         (WebCore):
3405         (GraphicsContext3D):
3406         (ImageExtractor):
3407         (WebCore::GraphicsContext3D::ImageExtractor::extractSucceeded):
3408         (WebCore::GraphicsContext3D::ImageExtractor::imagePixelData):
3409         (WebCore::GraphicsContext3D::ImageExtractor::imageWidth):
3410         (WebCore::GraphicsContext3D::ImageExtractor::imageHeight):
3411         (WebCore::GraphicsContext3D::ImageExtractor::imageSourceFormat):
3412         (WebCore::GraphicsContext3D::ImageExtractor::imageAlphaOp):
3413         (WebCore::GraphicsContext3D::ImageExtractor::imageSourceUnpackAlignment):
3414         * platform/graphics/NativeImagePtr.h:
3415         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3416         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3417         (WebCore):
3418         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3419         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3420         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3421         (WebCore):
3422         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3423         * platform/graphics/clutter/GraphicsContext3DClutter.cpp:
3424         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3425         (WebCore):
3426         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3427         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3428         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3429         (WebCore):
3430         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3431         * platform/graphics/qt/GraphicsContext3DQt.cpp:
3432         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3433         (WebCore):
3434         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3435         * platform/graphics/skia/GraphicsContext3DSkia.cpp:
3436         (WebCore::GraphicsContext3D::ImageExtractor::~ImageExtractor):
3437         (WebCore):
3438         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
3439
3440 2012-11-30  Simon Fraser  <simon.fraser@apple.com>
3441
3442         Make RenderLayer::updateLayerPosition() private
3443         https://bugs.webkit.org/show_bug.cgi?id=102624
3444
3445         Reviewed by Ryosuke Niwa.
3446
3447         Made updateLayerPosition() private. The only external caller was
3448         MouseRelatedEvent::computeRelativePosition(), which has no business updating
3449         layer positions. In fact it had positively dangerous behavior; doing just
3450         a style update without layout, and then calling absoluteToLocal() and walking
3451         layers. Fixed by having it call updateLayoutIgnorePendingStylesheets().
3452         
3453         This revealed a bug where event.offsetX/offsetY could be wrong in some cases.
3454         fast/events/stopPropagation-submit.html does a simulated click (which has
3455         client coordinates at 0,0), so the image submit coordinates were incorrectly
3456         0,0. Now that we do layout before computing them, they are correctly reported
3457         as being relative to the element.
3458
3459         * dom/MouseRelatedEvent.cpp:
3460      &nb