Optimization in image decoding.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2012-11-29  Viatcheslav Ostapenko  <v.ostapenko@samsung.com>
2
3         Optimization in image decoding.
4         https://bugs.webkit.org/show_bug.cgi?id=88424
5
6         Reviewed by Brent Fulgham.
7
8         Reduce branching and multiplications in JPEG image decoding loops and functions.
9         Code is moved to the template functions with scale and color space template parameters
10         because they were reason of branches inside loops. With templated funtions compiler
11         will generate separate instance of function for every set of parameters removing
12         unreachable code in every condition where constant value is used.
13
14         Rebase and update of original patch by Misha Tyutyunik <michael.tyuytunik@nokia.com> .
15
16         Thanks to Noel Gordon for his help in cleaning up remaining issues.
17
18         Covered by existing tests.
19
20         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
21         (WebCore):
22         (WebCore::setPixel):
23         (WebCore::JPEGImageDecoder::outputScanlines):
24         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
25         (JPEGImageDecoder):
26
27 2012-11-29  Kentaro Hara  <haraken@chromium.org>
28
29         Unreviewed, rolling out r135862.
30         http://trac.webkit.org/changeset/135862
31         https://bugs.webkit.org/show_bug.cgi?id=103367
32
33         We've been observing 'Fatal error in
34         v8::V8::AddMessageListener()' in bots
35
36         * bindings/v8/V8Binding.cpp:
37         (WebCore::v8NonStringValueToWebCoreString):
38         * bindings/v8/V8StringResource.cpp:
39         (WebCore::int32ToWebCoreStringFast):
40         (WebCore::int32ToWebCoreString):
41         * bindings/v8/V8StringResource.h:
42         (WebCore::V8StringResource::V8StringResource):
43         (WebCore::V8StringResource::prepareBase):
44         (WebCore::V8StringResource::setString):
45         (V8StringResource):
46         (WebCore::V8StringResource::toString):
47         (WebCore::::prepare):
48
49 2012-11-29  Pavel Feldman  <pfeldman@chromium.org>
50
51         Web Inspector: optimize repaint regions upon text editing
52         https://bugs.webkit.org/show_bug.cgi?id=103674
53
54         Reviewed by Vsevolod Vlasov.
55
56         There is a lot happening that makes repaint area larger than it should be,
57         namely unnecessary tabbed pane and navigator updates.
58
59         * inspector/front-end/NavigatorView.js:
60         (WebInspector.NavigatorView.prototype._updateScriptTitle):
61         * inspector/front-end/TabbedPane.js:
62         (WebInspector.TabbedPaneTab.prototype.set title):
63
64 2012-11-29  KyungTae Kim  <ktf.kim@samsung.com>
65
66         Unused parameters on plugins/npapi.cpp
67         https://bugs.webkit.org/show_bug.cgi?id=103676
68
69         Reviewed by Kentaro Hara.
70
71         Because 'instance' and 'menu' are not used when !PLATFORM(QT) || !defined(XP_MACOSX),
72         use UNUSED_PARAM macro to fix build warning -Wunused-parameter
73
74         * plugins/npapi.cpp:
75         (NPN_PopUpContextMenu):
76
77 2012-11-29  Pablo Flouret  <pablof@motorola.com>
78
79         REGRESSION(r134693): Compilation error on @supports grammar code
80         https://bugs.webkit.org/show_bug.cgi?id=103678
81
82         Reviewed by Tony Chang.
83
84         Coming from https://bugs.webkit.org/show_bug.cgi?id=102295
85
86         No new tests, compile fix.
87
88         * css/CSSGrammar.y.in:
89
90 2012-11-29  Simon Fraser  <simon.fraser@apple.com>
91
92         Avoid painting lots of small rects in WebLayer painting
93         https://bugs.webkit.org/show_bug.cgi?id=103673
94
95         Reviewed by Tim Horton.
96
97         r109186 added code in drawLayerContents() to enumerate over the rects in
98         the CALayer's dirty region, and paint them individually. This was done
99         to help performance on the IE Maze Solver test.
100         
101         On large, complex pages like Facebook, the overhead of traversing the
102         RenderLayer tree for painting is such that it's better to paint a single,
103         or fewer rects rather than lots of little ones.
104         
105         So adopt a heuristic similar to that in DrawingArea, where if the
106         combined area of the small rects is 75% or more of the combined rect,
107         just paint the combined rect. Also paint the combined rect if there
108         are more than 5 individual rects.
109         
110         I verified that this preserves the optimization for IE Maze Solver.
111
112         * platform/graphics/mac/WebLayer.mm:
113         (drawLayerContents):
114
115 2012-11-29  Eugene Klyuchnikov  <eustas@chromium.org>
116
117         Web Inspector: Web Inspector: Make main-thread monitoring go through InspectorController.
118         https://bugs.webkit.org/show_bug.cgi?id=103550
119
120         Reviewed by Pavel Feldman.
121
122         InspectorInstrumentation was a wrong path.
123
124         * inspector/InspectorClient.h: Remove start/stop methods.
125         * inspector/InspectorController.cpp:
126         Dispatch main thread activity notifications. 
127         * inspector/InspectorController.h: Ditto.
128         * inspector/InspectorInstrumentation.cpp: Remove dispatching.
129         * inspector/InspectorInstrumentation.h: Ditto.
130         * inspector/InspectorTimelineAgent.cpp:
131         Do not subscribe for notifications explicitly.
132
133 2012-11-29  Adam Barth  <abarth@webkit.org>
134
135         [V8] DOM callbacks shouldn't reimplement ScopedPersistent they should use it
136         https://bugs.webkit.org/show_bug.cgi?id=103662
137
138         Reviewed by Eric Seidel.
139
140         This patch replaces yet another instance of the ScopedPersistent
141         pattern with ScopedPersistent.
142
143         * bindings/scripts/CodeGeneratorV8.pm:
144         (GenerateCallbackHeader):
145         (GenerateCallbackImplementation):
146         * bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp:
147         (WebCore::V8SQLStatementErrorCallback::handleEvent):
148         * bindings/v8/custom/V8MutationCallbackCustom.cpp:
149         (WebCore::V8MutationCallback::handleEvent):
150
151 2012-11-29  Min Qin  <qinmin@chromium.org>
152
153         Make LazyDecodingPixelRef inherit from skia::LazyPixelRef so that cc thread can access it
154         https://bugs.webkit.org/show_bug.cgi?id=103555
155
156         Reviewed by Stephen White.
157
158         Expose LazyDecodingPixelRef to the cc thread by inheriting from skia::LazyPixelRef.
159         No test added for now as impl side paiting is still WIP.
160
161         * platform/graphics/chromium/LazyDecodingPixelRef.cpp:
162         (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
163         (WebCore::LazyDecodingPixelRef::PrepareToDecode):
164         (WebCore):
165         (WebCore::LazyDecodingPixelRef::Decode):
166         * platform/graphics/chromium/LazyDecodingPixelRef.h:
167         (LazyDecodingPixelRef):
168
169 2012-11-29  Julien Chaffraix  <jchaffraix@webkit.org>
170
171         Unreviewed build fix.
172
173         * WebCore.gypi:
174         The new file is GridTrackSize.h not GridTrackSizes.h. For some reason, the
175         EWS didn't complain.
176
177 2012-11-29  John Knottenbelt  <jknotten@chromium.org>
178
179         Use GeolocationController's last geoposition as cached position.
180         https://bugs.webkit.org/show_bug.cgi?id=103540
181
182         Reviewed by Benjamin Poulain.
183
184         The page's GeolocationController mediates access to the
185         GeolocationClient for multiple frames' Geolocation instances. This
186         patch changes the position cache to be on the GeolocationController
187         rather than on the Geolocation instance.
188
189         This fixes a bug where if one frame has has received a fresh
190         position, then a request for a cached position from a second frame
191         does not succeed because the Geolocation instance in the second
192         frame's position cache hasn't received the position update that
193         went to the first frame.
194
195         Test: fast/dom/Geolocation/cached-position-iframe.html
196
197         * Modules/geolocation/Geolocation.cpp:
198         (WebCore::Geolocation::makeCachedPositionCallbacks):
199         (WebCore::Geolocation::haveSuitableCachedPosition):
200         (WebCore::Geolocation::positionChanged):
201         * Modules/geolocation/Geolocation.h:
202         * Modules/geolocation/GeolocationController.h:
203         (GeolocationController):
204
205 2012-11-29  Alexei Filippov  <alph@chromium.org>
206
207         Web Inspector: Allow sorting in NMI snapshot grid view
208         https://bugs.webkit.org/show_bug.cgi?id=102955
209
210         Reviewed by Yury Semikhatsky.
211
212         * English.lproj/localizedStrings.js:
213         * inspector/front-end/NativeMemorySnapshotView.js:
214         (WebInspector.NativeSnapshotDataGrid.prototype.sortingChanged):
215         (WebInspector.NativeSnapshotDataGrid.prototype._sortingFunction):
216         (WebInspector.NativeSnapshotNode):
217         (WebInspector.NativeSnapshotNode.prototype._storeState):
218         (WebInspector.NativeSnapshotNode.prototype._restoreState):
219         (WebInspector.NativeSnapshotNode.prototype.uid):
220         (WebInspector.NativeSnapshotNode.prototype._createSizeCell):
221
222 2012-11-29  Martin Robinson  <mrobinson@igalia.com>
223
224         [GTK] [WebKit2] Embed the HTTP authentication dialog into the WebView
225         https://bugs.webkit.org/show_bug.cgi?id=103277
226
227         Reviewed by Carlos Garcia Campos.
228
229         Refactor the WebCore authentication dialog so that it can be reused for the WebKit2
230         embedded authentication dialog. The main purpose of this refactor is so that the
231         dialog does not rely on GtkDialog to add the action buttons to the dialog itself.
232         This also simplifies the structure of the dialog, using the GtkTable or GtkGrid to
233         contain more of the widget elements, greatly simplifying this code. We also expose
234         a new constructor that does not create the parent GtkDialog -- so that WebKit2
235         can embed the dialog directly into the WebView.
236
237         No new tests. This shouldn't change behavior, only slightly the look of the authentication
238         dialog.
239
240         * platform/gtk/GtkAuthenticationDialog.cpp:
241         (WebCore::GtkAuthenticationDialog::GtkAuthenticationDialog): Added this new constructor
242         which does not add the dialog contents to a GtkDialog.
243         (WebCore::packTwoColumnLayoutInBox): Added this generic method for creating a two column
244         layout in the style the dialog box needs (for both GTK+ 2.x and GTK+ 3.x).
245         (WebCore::createDialogLabel): Added this helper.
246         (WebCore::createDialogEntry): ditto.
247         (WebCore::GtkAuthenticationDialog::createContentsInContainer): Added this method which
248         can be used by subclasses to add the guts of the dialog to the parent container.
249         (WebCore::GtkAuthenticationDialog::show): Added some focus/default handling code that
250         GtkDialog was calling before.
251         (WebCore::GtkAuthenticationDialog::buttonClickedCallback): Added a button clicked handler.
252         Before GtkDialog handled this.
253         * platform/gtk/GtkAuthenticationDialog.h: Updated methods to reflect new functionality.
254         (WebCore::GtkAuthenticationDialog::~GtkAuthenticationDialog): Inline the default constructor.
255
256 2012-11-29  Beth Dakin  <bdakin@apple.com>
257
258         https://bugs.webkit.org/show_bug.cgi?id=103577
259         TiledDrawingArea should recycle tiles
260         -and corresponding-
261         <rdar://problem/12714586>
262
263         Reviewed by Simon Fraser.
264
265         New class LayerPool will keep a list of layers to reuse so that 
266         we can avoid creating and destroying so many layer.
267
268         When removing layers, add them to the LayerPool
269         * platform/graphics/ca/mac/TileCache.mm:
270         (WebCore::TileCache::revalidateTiles):
271
272         Before creating a new layer, try to get one of the appropriate size 
273         from the LayerPool.
274         (WebCore::TileCache::createTileLayer):
275
276         New class.
277         * WebCore.xcodeproj/project.pbxproj:
278         * platform/graphics/ca/mac/LayerPool.h: Added.
279         (WebCore):
280         (LayerPool):
281         (WebCore::LayerPool::capacity):
282         (WebCore::LayerPool::canReuseLayerWithSize):
283         * platform/graphics/ca/mac/LayerPool.mm: Added.
284         (WebCore):
285         (WebCore::LayerPool:: LayerPool):
286         (WebCore::LayerPool::sharedPool):
287         (WebCore::LayerPool::bytesBackingLayerWithPixelSize):
288         (WebCore::LayerPool::listOfLayersWithSize):
289         (WebCore::LayerPool::addLayer):
290         (WebCore::LayerPool::takeLayerWithSize):
291         (WebCore::LayerPool::decayedCapacity):
292         (WebCore::LayerPool::schedulePrune):
293         (WebCore::LayerPool::prune):
294         (WebCore::LayerPool::drain):
295
296         If we're under memory pressure, drain the LayerPool
297         * platform/mac/MemoryPressureHandlerMac.mm:
298         (WebCore::MemoryPressureHandler::releaseMemory):
299
300 2012-11-29  Julien Chaffraix  <jchaffraix@webkit.org>
301
302         [CSS Grid Layout] track sizing functions should have their own type
303         https://bugs.webkit.org/show_bug.cgi?id=103343
304
305         Reviewed by Tony Chang.
306
307         The current code uses a Length to represent the track sizing function. This is
308         fine as we only parse <length> | <percentage> but in order to support minmax
309         sizing, we have to store 2 Lengths. We could go with a pair but that would make
310         the code not very readable so this change introduces GridTrackSize.
311
312         Refactoring, covered by existing tests.
313
314         * GNUmakefile.list.am:
315         * Target.pri:
316         * WebCore.gypi:
317         * WebCore.vcproj/WebCore.vcproj:
318         * WebCore.xcodeproj/project.pbxproj:
319         Added GridTrackSize.h to all our build systems.
320
321         * css/CSSComputedStyleDeclaration.cpp:
322         (WebCore::valueForGridTrackBreadth):
323         (WebCore::valueForGridTrackList):
324         * css/StyleResolver.cpp:
325         (WebCore::createGridTrackBreadth):
326         (WebCore::createGridTrackList):
327         (WebCore::StyleResolver::applyProperty):
328         * rendering/RenderGrid.cpp:
329         (WebCore::RenderGrid::computePreferredLogicalWidths):
330         (WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
331         * rendering/style/RenderStyle.h:
332         Updated the above call sites to use GridTrackSize. While
333         touching them, changed the code to use an empty Vector to represent
334         'none' instead of Length(Undefined).
335
336         * rendering/style/StyleGridData.h:
337         Updated #include, removed a comment as it would have gone stale after
338         adding more grammar support and added a FIXME to rename some variables.
339
340         * rendering/RenderGrid.cpp:
341         (WebCore::RenderGrid::layoutGridItems):
342         Implemented a work-around to avoid crashing due to implicit columns / rows.
343
344         * rendering/style/GridTrackSize.h: Added.
345         (WebCore::GridTrackSize::GridTrackSize):
346         (WebCore::GridTrackSize::length):
347         (WebCore::GridTrackSize::setLength):
348         (WebCore::GridTrackSize::type):
349         (WebCore::GridTrackSize::operator==):
350         New class, it now only wraps a single Length.
351
352 2012-11-29  Helder Correia  <helder.correia@nokia.com>
353
354         Typo in Color creation function name
355         https://bugs.webkit.org/show_bug.cgi?id=103464
356
357         Reviewed by Alexey Proskuryakov.
358
359         Renaming createUnCheked() as createUnchecked().
360
361         No new tests.
362
363         * platform/graphics/Color.cpp:
364         (WebCore::colorFromPremultipliedARGB):
365         * platform/graphics/Color.h:
366         (WebCore::Color::createUnchecked):
367
368 2012-11-29  Otto Derek Cheung  <otcheung@rim.com>
369
370         [BlackBerry] Cookies in private mode should not have access to public cookies
371         https://bugs.webkit.org/show_bug.cgi?id=103649
372
373         Reviewed by Rob Buis.
374
375         PR 253983
376
377         When CookieManager switches back from public to private mode,
378         we will clear the cookie tree so the browser won't have access
379         to the public cookies.
380
381         Tested using browser.swlab.rim.net cookie tests and the steps in
382         the PR.
383
384         * platform/blackberry/CookieManager.cpp:
385         (WebCore::CookieManager::setPrivateMode):
386
387 2012-11-29  Brent Fulgham  <bfulgham@gmail.com>
388
389         Be consistent in handling of frameAtIndex (and related) returns.
390         https://bugs.webkit.org/show_bug.cgi?id=103207
391
392         Reviewed by David Hyatt.
393
394         Under various conditions, frameAtIndex (and therefore,
395         nativeImageForCurrentFrame) returns null. A series of bugs over
396         the years has ensured null returns are handled in some cases,
397         but there are a handful of remaining cases where this is still a
398         problem. 
399
400         No new tests, as these low-level functions are covered by
401         numerous existing test cases.
402
403 2012-11-29  David Hyatt  <hyatt@apple.com>
404
405         [New Multicolumn] Add minimum column height tracking and forced break tracking to column sets.
406         https://bugs.webkit.org/show_bug.cgi?id=103657
407
408         Reviewed by Simon Fraser.
409
410         * rendering/RenderMultiColumnSet.cpp:
411         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
412         * rendering/RenderMultiColumnSet.h:
413         (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight):
414         (WebCore::RenderMultiColumnSet::minimumColumnHeight):
415         (RenderMultiColumnSet):
416         (WebCore::RenderMultiColumnSet::forcedBreaksCount):
417         (WebCore::RenderMultiColumnSet::forcedBreakOffset):
418         (WebCore::RenderMultiColumnSet::maximumDistanceBetweenForcedBreaks):
419         (WebCore::RenderMultiColumnSet::clearForcedBreaks):
420         (WebCore::RenderMultiColumnSet::addForcedBreak):
421
422 2012-11-29  Pavel Feldman  <pfeldman@chromium.org>
423
424         Web Inspector: introduce fast case for within-chunk edit
425         https://bugs.webkit.org/show_bug.cgi?id=103545
426
427         Reviewed by Vsevolod Vlasov.
428
429         Special-casing edits within the chunk for faster operation.
430
431         * inspector/front-end/DOMExtension.js:
432         (removeSubsequentNodes):
433         * inspector/front-end/DefaultTextEditor.js:
434         (WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges):
435
436 2012-11-29  Pavel Feldman  <pfeldman@chromium.org>
437
438         Web Inspector: Console: hovering node wrappers in object tree should highlight them on the page
439         https://bugs.webkit.org/show_bug.cgi?id=101150
440
441         Reviewed by Vsevolod Vlasov.
442
443         - Introduced a way to highlight nodes by object id in addition to node id.
444         - Decorated nodes in the object tree outline and added on-hover highlighting.
445
446         * inspector/Inspector.json:
447         * inspector/InspectorDOMAgent.cpp:
448         (WebCore::InspectorDOMAgent::highlightNode):
449         * inspector/InspectorDOMAgent.h:
450         (InspectorDOMAgent):
451         * inspector/front-end/ConsoleMessage.js:
452         (WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreview):
453         * inspector/front-end/DOMAgent.js:
454         (WebInspector.DOMAgent.prototype.highlightDOMNode):
455         * inspector/front-end/DOMPresentationUtils.js:
456         (WebInspector.DOMPresentationUtils.createSpansForNodeTitle):
457         * inspector/front-end/ObjectPropertiesSection.js:
458         (WebInspector.ObjectPropertyTreeElement.prototype.update):
459         (WebInspector.ObjectPropertyTreeElement.prototype._mouseMove):
460         (WebInspector.ObjectPropertyTreeElement.prototype._mouseOut):
461         * inspector/front-end/RemoteObject.js:
462         (WebInspector.RemoteObject.prototype.highlightAsDOMNode):
463         (WebInspector.RemoteObject.prototype.hideDOMNodeHighlight):
464         * inspector/front-end/TestController.js:
465         * inspector/front-end/externs.js:
466         * inspector/front-end/inspector.css:
467         (.console-formatted-node:hover):
468         * inspector/front-end/utilities.js:
469
470 2012-11-29  Dan Bernstein  <mitz@apple.com>
471
472         <rdar://problem/12771885> Support ruby-position: {before, after}
473         https://bugs.webkit.org/show_bug.cgi?id=103569
474
475         Reviewed by Anders Carlsson.
476
477         Specified in <http://www.w3.org/TR/2011/WD-css3-ruby-20110630/#rubypos>, the ruby-position
478         property takes four values: before, after, inter-character, and inline. This change adds
479         support for the values before and after.
480
481         Test: fast/ruby/position-after.html
482
483         * css/CSSComputedStyleDeclaration.cpp:
484         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle ruby-position.
485         * css/CSSParser.cpp:
486         (WebCore::isValidKeywordPropertyAndValue): Accept before and after as valid values for
487         ruby-position.
488         (WebCore::isKeywordPropertyID): Added ruby-position to the list of properties with keyword
489         values.
490         (WebCore::CSSParser::parseValue): Added ruby-position to the switch statement.
491         * css/CSSPrimitiveValueMappings.h:
492         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mapping from RubyPosition.
493         (WebCore::CSSPrimitiveValue::operator RubyPosition): Added mapping from CSSPrimitiveValue.
494         * css/CSSProperty.cpp:
495         (WebCore::CSSProperty::isInheritedProperty): Added ruby-position as an inherited property.
496         * css/CSSPropertyNames.in: Added -webkit-ruby-position.
497         * css/CSSValueKeywords.in: Added after and before.
498         * css/StyleBuilder.cpp:
499         (WebCore::StyleBuilder::StyleBuilder): Added a handler for ruby-position.
500         * css/StyleResolver.cpp:
501         (WebCore::StyleResolver::applyProperty): Added ruby-position.
502         * rendering/InlineFlowBox.cpp:
503         (WebCore::InlineFlowBox::placeBoxesInBlockDirection): Changed to choose which of
504         hasAnnotationsBefore and hasAnnotationsAfter to set based on ruby position.
505         (WebCore::InlineFlowBox::computeOverAnnotationAdjustment): Changed to adjust only for
506         ruby positioned before the base.
507         (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment): Added adjustment for ruby
508         positioned after the base.
509         * rendering/RenderRubyRun.cpp:
510         (WebCore::RenderRubyRun::layout): Account for ruby-position when positioning the ruby text
511         relative to the base.
512         * rendering/style/RenderStyle.cpp:
513         (WebCore::RenderStyle::diff): Made a ruby-position difference a layout difference.
514         * rendering/style/RenderStyle.h: Added rubyPosition(), setRubyPosition(), and 
515         initialRubyPosition().
516         * rendering/style/RenderStyleConstants.h: Added the RubyPosition enum.
517         * rendering/style/StyleRareInheritedData.cpp:
518         (WebCore::StyleRareInheritedData::StyleRareInheritedData): Added initialized for
519         m_rubyPosition. Added copying the value of this member to the copy constructor.
520         (WebCore::StyleRareInheritedData::operator==): Added comparison of m_rubyPosition.
521         * rendering/style/StyleRareInheritedData.h:
522         (StyleRareInheritedData): Added m_rubyPosition member variable.
523
524 2012-11-29  Tiancheng Jiang  <tijiang@rim.com>
525
526         [BlackBerry] Update BB10 form theme.
527         https://bugs.webkit.org/show_bug.cgi?id=100760
528
529         Reviewed by Rob Buis.
530
531         Internally Reviewed by Eli Fidler.
532         Set text color after buttons are pressed.
533
534         * css/themeBlackBerry.css:
535         (input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active):
536         (select:active):
537         * platform/blackberry/RenderThemeBlackBerry.cpp:
538         (WebCore):
539         (WebCore::RenderThemeBlackBerry::paintButton):
540         (WebCore::RenderThemeBlackBerry::paintMenuList):
541
542 2012-11-29  Zeno Albisser  <zeno@webkit.org>
543
544         GraphicsSurfaceGLX: remove redundant parameter from resolveGLMethods.
545         https://bugs.webkit.org/show_bug.cgi?id=103636
546
547         Reviewed by Kenneth Rohde Christiansen.
548
549         * platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
550         (WebCore::resolveGLMethods):
551         (WebCore::GraphicsSurface::platformCreate):
552         (WebCore::GraphicsSurface::platformImport):
553
554 2012-11-29  Mike West  <mkwst@chromium.org>
555
556         Typo in 'autofocus' sandboxing error message.
557         https://bugs.webkit.org/show_bug.cgi?id=103616
558
559         Reviewed by Jochen Eisinger.
560
561         The sandbox attribute name is 'allow-scripts', not 'allow-script'. :(
562
563         * html/HTMLFormControlElement.cpp:
564         (WebCore::shouldAutofocus):
565
566 2012-11-29  Hajime Morrita  <morrita@google.com>
567
568         HTMLMediaElement's .textTracks property does not reflect <track> element
569         https://bugs.webkit.org/show_bug.cgi?id=103420
570
571         Reviewed by Eric Carlson.
572
573         There were some assumptions that <track> elements are valid only
574         if the parent <media> is in document. This change relaxes this
575         assumption so that <track> is valid when it has <media> as a
576         parent regardless whether the <media> is in the document or not.
577
578         HTMLMediaElement::didAddTrack and didRemoveTrack are now called
579         when the <track> is inserted to or removed from the parent <media>
580         element.
581
582         Test: media/track/track-node-add-remove.html
583
584         * html/HTMLMediaElement.cpp:
585         (WebCore::HTMLMediaElement::didRemoveTrack):
586         Renamed from willRemoveTrack() to reflect the timing. This was once called from
587         Node::willRemove(), which was removed a while ago.
588         * html/HTMLMediaElement.h:
589         (HTMLMediaElement):
590         * html/HTMLTrackElement.cpp:
591         (WebCore::HTMLTrackElement::insertedInto):
592         The old code notified parent <media> only if the subtree became a part of the document.
593         Now it notifies the <media> when this <track> becomes a child of that <media>.
594
595         (WebCore::HTMLTrackElement::removedFrom):
596         The old code notifies the parent <media> every time as long as the parent is available.
597         Now it notifies the <media> only if this <track> is removed from the parent <media>.
598         This matches how corresponding notification is done in insertedInto().
599
600         * html/track/LoadableTextTrack.cpp:
601         (WebCore::LoadableTextTrack::trackElementIndex):
602
603 2012-11-29  Florin Malita  <fmalita@chromium.org>
604
605         [Skia] Add missing OpaqueRegionSkia notifier calls
606         https://bugs.webkit.org/show_bug.cgi?id=102824
607
608         Reviewed by Stephen White.
609
610         http://trac.webkit.org/changeset/135390 exposed some canvas draw clients which are not
611         updating the opaque region tracker. This patch adds the required notifier calls.
612
613         No new tests: platform unit tests added.
614
615         * platform/graphics/skia/OpaqueRegionSkia.h:
616         (OpaqueRegionSkia):
617         * platform/graphics/skia/PlatformContextSkia.h:
618         (WebCore::PlatformContextSkia::writePixels):
619         (WebCore::PlatformContextSkia::drawBitmap):
620         (WebCore::PlatformContextSkia::drawBitmapRect):
621         (WebCore::PlatformContextSkia::drawIRect):
622         (WebCore::PlatformContextSkia::drawPosText):
623         (WebCore::PlatformContextSkia::drawPosTextH):
624         (WebCore::PlatformContextSkia::drawTextOnPath):
625
626 2012-11-29  Andy Shaw  <andy.shaw@digia.com>
627
628         [Qt] Implement support for Cocoa based NPAPI plugins on Mac
629         https://bugs.webkit.org/show_bug.cgi?id=72358
630
631         Reviewed by Simon Hausmann.
632
633         With later versions of Flash they are only Cocoa based which meant that it was not possible to use Flash in a QtWebKit browser.
634         This makes it possible to also use 64bit based plugins too.  
635
636         * plugins/PluginPackage.cpp:
637         (WebCore::PluginPackage::initializeBrowserFuncs):
638         (WebCore):
639         * plugins/PluginQuirkSet.h:
640         * plugins/PluginView.cpp:
641         (WebCore::PluginView::handleEvent):
642         (WebCore::PluginView::PluginView):
643         (WebCore):
644         (WebCore::PluginView::userAgent):
645         * plugins/PluginView.h:
646         (WebCore):
647         (PluginView):
648         * plugins/mac/PluginPackageMac.cpp:
649         (WebCore::PluginPackage::determineQuirks):
650         (WebCore::PluginPackage::fetchInfo):
651         * plugins/mac/PluginViewMac.mm:
652         (WebCore):
653         (WebCore::initializeNPCocoaEvent):
654         (WebCore::getModifiers):
655         (WebCore::PluginView::platformStart):
656         * plugins/npapi.cpp:
657         (NPN_PopUpContextMenu):
658         * plugins/npapi.h:
659
660 2012-11-29  Sheriff Bot  <webkit.review.bot@gmail.com>
661
662         Unreviewed, rolling out r136111.
663         http://trac.webkit.org/changeset/136111
664         https://bugs.webkit.org/show_bug.cgi?id=103620
665
666         Broke compilation on Mac (unused private field m_matchMode)
667         (Requested by apavlov on #webkit).
668
669         * CMakeLists.txt:
670         * GNUmakefile.list.am:
671         * Target.pri:
672         * WebCore.gypi:
673         * WebCore.vcproj/WebCore.vcproj:
674         * WebCore.xcodeproj/project.pbxproj:
675         * html/HTMLSelectElement.cpp:
676         (WebCore):
677         (WebCore::HTMLSelectElement::HTMLSelectElement):
678         (WebCore::stripLeadingWhiteSpace):
679         (WebCore::HTMLSelectElement::typeAheadFind):
680         * html/HTMLSelectElement.h:
681         (HTMLSelectElement):
682         * html/TypeAhead.cpp: Removed.
683         * html/TypeAhead.h: Removed.
684         * html/shadow/DateTimeSymbolicFieldElement.cpp:
685         (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
686         (WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent):
687         * html/shadow/DateTimeSymbolicFieldElement.h:
688         (DateTimeSymbolicFieldElement):
689
690 2012-11-29  Keishi Hattori  <keishi@webkit.org>
691
692         Better type ahead for DateTimeSymbolicFieldElement
693         https://bugs.webkit.org/show_bug.cgi?id=103031
694
695         Reviewed by Kent Tamura.
696
697         This cuts out the type ahead code that will be used by HTMLSelectElement
698         and DateTimeSymbolicFieldElement into a TypeAhead class. This will
699         improve DateTimeSymbolicFieldElement type ahead which was first
700         character match only, by adding cycling, prefix match and index number
701         match.
702
703         Added tests to month-multiple-fields-keyboard-events.html.
704
705         * GNUmakefile.list.am: Added TypeAhead.{h,cpp}
706         * Target.pri: Ditto.
707         * WebCore.gypi: Ditto.
708         * WebCore.vcproj/WebCore.vcproj: Ditto.
709         * WebCore.xcodeproj/project.pbxproj: Ditto.
710         * CMakeLists.txt: Ditto.
711         * html/HTMLSelectElement.cpp:
712         (WebCore):
713         (WebCore::HTMLSelectElement::HTMLSelectElement):
714         (WebCore::HTMLSelectElement::indexOfSelectedOption): Returns index of current selection.
715         (WebCore::HTMLSelectElement::optionCount): Returns total number of options.
716         (WebCore::HTMLSelectElement::optionAtIndex): Returns option at index.
717         (WebCore::HTMLSelectElement::typeAheadFind): Use TypeAhead.
718         * html/HTMLSelectElement.h:
719         (HTMLSelectElement):
720         * html/TypeAhead.cpp: Added.
721         (WebCore):
722         (WebCore::TypeAhead::TypeAhead):
723         (WebCore::stripLeadingWhiteSpace): Moved from HTMLSelectElement.cpp.
724         (WebCore::TypeAhead::handleEvent): Returns index for match.
725         * html/TypeAhead.h: Added.
726         (WebCore):
727         (TypeAheadDataSource): Provide the data about the options that TypeAhead should match against.
728         (TypeAhead):
729         * html/shadow/DateTimeSymbolicFieldElement.cpp:
730         (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
731         (WebCore::DateTimeSymbolicFieldElement::handleKeyboardEvent):
732         (WebCore::DateTimeSymbolicFieldElement::indexOfSelectedOption):
733         (WebCore):
734         (WebCore::DateTimeSymbolicFieldElement::optionCount):
735         (WebCore::DateTimeSymbolicFieldElement::optionAtIndex):
736         * html/shadow/DateTimeSymbolicFieldElement.h:
737         (DateTimeSymbolicFieldElement):
738
739 2012-11-29  Andrei Bucur  <abucur@adobe.com>
740
741         [CSS Regions] Fix content node renderers ordering inside the named flow thread
742         https://bugs.webkit.org/show_bug.cgi?id=103501
743
744         Reviewed by David Hyatt.
745
746         This patch fixes two issues with how content nodes renderers are added to a named flow thread.
747         The first issue was about determining the insertion position of a renderer inside the children list of a named flow thread. Before this patch, the
748         insertion point was based on both the DOM ordering of the elements and insertion order of previous renderers.
749         The patch fixes this and makes the renderer position just a function of the DOM ordering of elements.
750         The second issue appeared when next/previousRenderer methods were skipping nodes because they had the flow-into property as a side effect
751         of copying the style of the parent element (e.g. Text nodes). The patch ensures the skipped nodes are also elements.
752
753         Tests: fast/regions/named-flow-content-order-1.html
754                fast/regions/named-flow-content-order-2.html
755                fast/regions/named-flow-content-order-3.html
756
757         * dom/NodeRenderingContext.cpp:
758         (WebCore::NodeRenderingContext::nextRenderer): Skip only elements.
759         (WebCore::NodeRenderingContext::previousRenderer): Skip only elements.
760         * rendering/RenderNamedFlowThread.cpp:
761         (WebCore::RenderNamedFlowThread::addFlowChild): Insert the renderer in the list based on the DOM position of the owner element.
762         * rendering/RenderNamedFlowThread.h:
763         (RenderNamedFlowThread):
764         * rendering/RenderObject.cpp:
765         (WebCore::RenderObject::renderNamedFlowThreadWrapper): Rename to eliminate the confusion with enclosingRenderFlowThread.
766         (WebCore::RenderObject::insertedIntoTree):
767         (WebCore::RenderObject::willBeRemovedFromTree):
768         * rendering/RenderObject.h:
769         (RenderObject):
770
771 2012-11-28  Mike West  <mkwst@chromium.org>
772
773         Add a test to ensure that 'seamless' iframes do not inherit contenteditable.
774         https://bugs.webkit.org/show_bug.cgi?id=95890
775
776         Reviewed by Ojan Vafai.
777
778         We don't currently support inheriting contenteditable into a seamless
779         frame. http://html5.org/tools/web-apps-tracker?from=7318&to=7319
780         brought the spec in line with WebKit's behavior (ha!). This patch
781         defends the behavior by adding a test, and removes a FIXME comment
782         now that the question is settled.
783
784         It also exposes a brand new bug: https://bugs.webkit.org/show_bug.cgi?id=103539
785         How exciting.
786
787         Test: fast/frames/seamless/seamless-contenteditable-not-inherited.html
788
789         * css/StyleResolver.cpp:
790         (WebCore::StyleResolver::styleForDocument):
791             No functional change, just dropping a FIXME comment.
792
793 2012-11-28  Mike West  <mkwst@chromium.org>
794
795         Web Inspector: Console message's anchor element should be trimmed for readability.
796         https://bugs.webkit.org/show_bug.cgi?id=100095
797
798         Reviewed by Pavel Feldman.
799
800         We're currently trimming URLs that go through
801         'WebInspector.linkifyURLAsNode' down to 150 characters total. Not all
802         URLs go that path, however. We were missing a few cases that dropped
803         back to the default Linkifier (which especially showed up for "Live"
804         anchor elements).
805
806         This patch ensures that anything using WebInspector.Linkifier is also
807         trimmed by default. It adds a new constant to do so in order to avoid
808         magic numbers in the code.
809
810         Test: http/tests/inspector/network/script-as-text-loading-long-url.html
811
812         * inspector/front-end/Linkifier.js:
813         (WebInspector.Linkifier):
814             Pass the max length into the default formatter that's created and
815             stored when creating a 'WebInspector.Linkifier' object.
816         * inspector/front-end/ResourceUtils.js:
817         (WebInspector.linkifyURLAsNode):
818             Use the new maxlength constant rather than hard-coding 150.
819
820 2012-11-28  Kentaro Hara  <haraken@chromium.org>
821
822         Unreviewed. Rebaselined run-bindings-tests.
823
824         * bindings/scripts/test/V8/V8TestNode.h:
825         (WebCore::toV8Fast):
826
827 2012-11-28  Shinya Kawanaka  <shinyak@chromium.org>
828
829         [Shadow] ShadowRoot should cache InsertionPointList.
830         https://bugs.webkit.org/show_bug.cgi?id=103212
831
832         Reviewed by Hajime Morita.
833
834         When distributing or invalidating distribution, we used to traverse all descendent nodes in Shadow DOM.
835         If ShadowRoot has a InsertionPoint list, we can just traverse the list.
836
837         No new tests, should be covered by existing tests.
838
839         * dom/ShadowRoot.cpp:
840         (WebCore::ShadowRoot::insertionPointList):
841         (WebCore):
842         * dom/ShadowRoot.h:
843         (ShadowRoot):
844         * html/shadow/ContentDistributor.cpp:
845         (WebCore::ShadowRootContentDistributionData::ShadowRootContentDistributionData):
846         (WebCore::ShadowRootContentDistributionData::invalidateInsertionPointList):
847         (WebCore):
848         (WebCore::ShadowRootContentDistributionData::ensureInsertionPointList): Creates InsertionPoint list
849         if it's not created and return it.
850         (WebCore::ContentDistributor::distribute): Traverse InsertionPointList instead of all descendent nodes in Shadow DOM.
851         (WebCore::ContentDistributor::invalidate): ditto.
852         * html/shadow/ContentDistributor.h:
853         (WebCore::ShadowRootContentDistributionData::incrementNumberOfShadowElementChildren): Invalidate InsertionPointList cache.
854         (WebCore::ShadowRootContentDistributionData::decrementNumberOfShadowElementChildren): ditto.
855         (WebCore::ShadowRootContentDistributionData::incrementNumberOfContentElementChildren): ditto.
856         (WebCore::ShadowRootContentDistributionData::decrementNumberOfContentElementChildren): ditto.
857         (ShadowRootContentDistributionData):
858
859 2012-11-28  Michael Pruett  <michael@68k.org>
860
861         IndexedDB: Remove duplicate toWireString() and createFromWire() methods in JSC SerializedScriptValue
862         https://bugs.webkit.org/show_bug.cgi?id=103554
863
864         Reviewed by Kentaro Hara.
865
866         In r135022, duplicate createFromWire() and toWireString() methods
867         were added to the JSC version of SerializedScriptValue. In
868         order to allow the JSC SerializedScriptValue to compile when
869         ENABLE(INDEXED_DATABASE) is turned on, these new methods have
870         been removed and the old methods have been moved outside the
871         ENABLE(INDEXED_DATABASE) guard.
872
873         No new tests. No change in functionality.
874
875         * WebCore.exp.in:
876         * bindings/js/SerializedScriptValue.cpp:
877         (WebCore::SerializedScriptValue::toWireString):
878         (WebCore):
879         (WebCore::SerializedScriptValue::createFromWire):
880         * bindings/js/SerializedScriptValue.h:
881
882 2012-11-28  Hajime Morrita  <morrita@google.com>
883
884         [Shadow DOM] Element.createShadowRoot() should be prefixed.
885         https://bugs.webkit.org/show_bug.cgi?id=103595
886
887         Reviewed by Kentaro Hara.
888
889         No new tests, updated shadow-aware-create-shadow-root.html to follow the change.
890
891         * dom/Element.idl:
892
893 2012-11-28  Hayato Ito  <hayato@chromium.org>
894
895         Node::compareDocumentPosition returns wrong value for a node in the different shadow tree.
896         https://bugs.webkit.org/show_bug.cgi?id=103502
897
898         Reviewed by Dimitri Glazkov.
899
900         Make Node::compareDocumentPosition() return the correct value when two nodes are in the different shadow trees.
901
902         Test: fast/dom/shadow/compare-document-position.html
903
904         * dom/Node.cpp:
905         (WebCore::Node::compareDocumentPosition):
906
907 2012-11-28  Joshua Bell  <jsbell@chromium.org>
908
909         [Chromium] IndexedDB: Assert/crash in indexing layout tests in content_shell
910         https://bugs.webkit.org/show_bug.cgi?id=103562
911
912         Reviewed by Tony Chang.
913
914         In multi-process ports, an commit request or setIndexesReady request may arrive from the
915         front-end after the back-end has already aborted. Don't freak out if those occur.
916
917         Tests: storage/indexeddb/index-population.html
918                storage/indexeddb/lazy-index-population.html
919                storage/indexeddb/transaction-error.html
920
921         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
922         (WebCore::IDBObjectStoreBackendImpl::setIndexKeys): Ensure transaction hasn't finished before continuing.
923         (WebCore::IDBObjectStoreBackendImpl::setIndexesReady): Ditto.
924         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
925         (WebCore::IDBTransactionBackendImpl::commit): Ignore a commit request if already aborted.
926
927 2012-11-28  Shinya Kawanaka  <shinyak@chromium.org>
928
929         [Shadow] Move Distribution requirements from ShadowRoot
930         https://bugs.webkit.org/show_bug.cgi?id=103481
931
932         Reviewed by Hajime Morita.
933
934         We would like to shrink the ShadowRoot memory size in this patch. ShadowRoot had several distribution related members,
935         however they were used only if ShadowRoot has <content>, <shadow>, or nested ShadowRoot.
936         Since <input> or <textarea> do not have such requirements, the members consume a few amount of memory.
937
938         We remove them from ShadowRoot and introduce some RareData-like data structure for ShadowRoot.
939         This will reduce memory footprint in most cases.
940
941         No new tests, refactoring.
942
943         * WebCore.exp.in:
944         * dom/ShadowRoot.cpp:
945         (SameSizeAsShadowRoot): Reduced 3 * sizeof(unsigned) bytes from ShadowRoot.
946         (WebCore::ShadowRoot::ShadowRoot): DistributionData is created only when necessary. <input> or <textarea> won't
947         create such data.
948         (WebCore::ShadowRoot::assignedTo):
949         (WebCore):
950         (WebCore::ShadowRoot::setAssignedTo):
951         (WebCore::ShadowRoot::ensureDistributionData):
952         (WebCore::ShadowRoot::registerShadowElement):
953         (WebCore::ShadowRoot::unregisterShadowElement):
954         (WebCore::ShadowRoot::hasShadowInsertionPoint):
955         (WebCore::ShadowRoot::registerContentElement):
956         (WebCore::ShadowRoot::unregisterContentElement):
957         (WebCore::ShadowRoot::hasContentElement):
958         (WebCore::ShadowRoot::registerElementShadow):
959         (WebCore::ShadowRoot::unregisterElementShadow):
960         (WebCore::ShadowRoot::hasElementShadow):
961         (WebCore::ShadowRoot::countElementShadow):
962         (WebCore::ShadowRoot::reportMemoryUsage):
963         * dom/ShadowRoot.h:
964         (WebCore):
965         (ShadowRoot):
966         (WebCore::ShadowRoot::distributionData):
967         * html/shadow/ContentDistributor.cpp:
968         (WebCore::ShadowRootContentDistributionData::ShadowRootContentDistributionData):
969         (WebCore):
970         * html/shadow/ContentDistributor.h:
971         (ShadowRootContentDistributionData): Distribution related fields in ShadowRoot are moved to here.
972         (WebCore::ShadowRootContentDistributionData::insertionPointAssignedTo):
973         (WebCore::ShadowRootContentDistributionData::setInsertionPointAssignedTo):
974         (WebCore::ShadowRootContentDistributionData::incrementNumberOfShadowElementChildren):
975         (WebCore::ShadowRootContentDistributionData::decrementNumberOfShadowElementChildren):
976         (WebCore::ShadowRootContentDistributionData::numberOfShadowElementChildren):
977         (WebCore::ShadowRootContentDistributionData::incrementNumberOfContentElementChildren):
978         (WebCore::ShadowRootContentDistributionData::decrementNumberOfContentElementChildren):
979         (WebCore::ShadowRootContentDistributionData::numberOfContentElementChildren):
980         (WebCore::ShadowRootContentDistributionData::incrementNumberOfElementShadowChildren):
981         (WebCore::ShadowRootContentDistributionData::decrementNumberOfElementShadowChildren):
982         (WebCore::ShadowRootContentDistributionData::numberOfElementShadowChildren):
983         (WebCore):
984
985 2012-11-23  Dirk Schulze  <krit@webkit.org>
986
987         Remove -webkit-mask-attachment
988         https://bugs.webkit.org/show_bug.cgi?id=67137
989
990         Reviewed by David Hyatt.
991
992         Remove CSS property '-webkit-attachment'. The CSS WG agreed that this should not be
993         part of the CSS Masking specification. WebKit never implemented the behavior of
994         attached masks either. The property was just exposed in CSSOM.
995
996         Test: Added negative tests to fast/masking/parsing-mask.html.
997
998         * css/CSSComputedStyleDeclaration.cpp:
999         (WebCore):
1000         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1001         * css/CSSParser.cpp:
1002         (WebCore::CSSParser::parseValue):
1003         (WebCore::CSSParser::parseFillProperty):
1004         * css/CSSProperty.cpp:
1005         (WebCore::CSSProperty::isInheritedProperty):
1006         * css/CSSPropertyNames.in:
1007         * css/StyleBuilder.cpp:
1008         (WebCore::StyleBuilder::StyleBuilder):
1009         * css/StylePropertySet.cpp:
1010         (WebCore::StylePropertySet::asText):
1011         * css/StylePropertyShorthand.cpp:
1012         (WebCore::webkitMaskShorthand):
1013         * css/StyleResolver.cpp:
1014         (WebCore::StyleResolver::applyProperty):
1015         * rendering/style/RenderStyle.h:
1016
1017 2012-11-28  Michael Pruett  <michael@68k.org>
1018
1019         IndexedDB: Add forward declaration of SecurityOrigin to IDBBackingStore.h
1020         https://bugs.webkit.org/show_bug.cgi?id=103578
1021
1022         Reviewed by Kentaro Hara.
1023
1024         Add forward declaration of SecurityOrigin to IDBBackingStore.h
1025         in order to enable compilation of IndexedDB for JSC.
1026
1027         Tests: storage/indexeddb/*
1028
1029         * Modules/indexeddb/IDBBackingStore.h:
1030         (WebCore):
1031
1032 2012-11-28  Hajime Morrita  <morrita@google.com>
1033
1034         checkAcceptChild() needs fewer virtual calls
1035         https://bugs.webkit.org/show_bug.cgi?id=103372
1036
1037         Reviewed by Ojan Vafai.
1038
1039         This change reorganizes checkAcceptChild family for speed.
1040
1041         - Made Node::checkAddChild and Node::checkReplaceChild() static inline functions
1042           in ContainerNode.cpp. checkAcceptChild() was also moved to the same file. This allows us
1043           more aggressive inlining.
1044
1045         - Added a fast path in checkAcceptChild(), where we can assume that the parent is element
1046           and the new child is element or text. Under this assumption, we need no extra type checks
1047           and just needs a cycle prevention through Node::contains(). This is faster than current generic version.
1048
1049         - Moved extra checks from checkAddChild() and checkReplaceChild() to
1050           checkAcceptChild(). This allows the fast path skips even these extra checks.
1051
1052         - Node::canReplaceChild() is devirtualized. Since the only override is on
1053           Document, we can check isDocumentNode() to call it directly.
1054
1055         - The default implemenation of Node::canReplaceChild() just calls isChildTypeAllowed().
1056           That is what an extra check for checkAddChild() did. So we can share these code path in checkAcceptChild().
1057
1058         This gains 2-3% win on Dromaeo dom-modify.html.
1059
1060         No new tests, covered by existing tests.
1061
1062         * dom/ContainerNode.cpp:
1063         (WebCore::isChildTypeAllowed): Moved from Node.cpp
1064         (WebCore::checkAcceptChild): Moved from Node.cpp, Added a fast path.
1065         (WebCore::checkAddChild): Moved from Node.cpp
1066         (WebCore::checkReplaceChild): Moved from Node.cpp
1067         (WebCore::ContainerNode::insertBefore): Followed the signature change.
1068         (WebCore::ContainerNode::replaceChild): Followed the signature change, moved null check from checkReplaceChild to here.
1069         (WebCore::ContainerNode::appendChild): Followed the signature change.
1070         * dom/Document.h:
1071         (Document):
1072         * dom/Node.cpp:
1073         * dom/Node.h:
1074         (WebCore::Node::isDocumentTypeNode): Added for better readability of call sites.
1075
1076 2012-11-28  Kenichi Ishibashi  <bashi@chromium.org>
1077
1078         StyleResolver should not set NaN to font size
1079         https://bugs.webkit.org/show_bug.cgi?id=99506
1080
1081         Reviewed by Abhishek Arya.
1082
1083         fixedScaleFactor could be NaN since settings->defaultFixedFontSize()
1084         and settings->defaultFontSize() are zero in some case. This turns
1085         out setting NaN to font size. Add a zero checks so that
1086         fixedScaleFactor won't be NaN.
1087
1088         Test: fast/css/font-size-nan.html
1089
1090         * css/StyleResolver.cpp:
1091         (WebCore::StyleResolver::checkForGenericFamilyChange):
1092
1093 2012-11-28  Tim Horton  <timothy_horton@apple.com>
1094
1095         [mac] WebHTMLConverter should maintain font size even when there is no related NSFont
1096         https://bugs.webkit.org/show_bug.cgi?id=103568
1097
1098         Reviewed by Alexey Proskuryakov.
1099
1100         WebHTMLConverter should use the default font at the correct size when it
1101         encounters a font that cannot be backed by an NSFont (e.g. a WebFont).
1102
1103         * platform/mac/HTMLConverter.mm:
1104         (+[WebHTMLConverter editingAttributedStringFromRange:]):
1105
1106 2012-11-23  Dirk Schulze  <krit@webkit.org>
1107
1108         CSS parser does not support -webkit-mask-size for -webkit-mask shorthand
1109         https://bugs.webkit.org/show_bug.cgi?id=103020
1110
1111         Reviewed by David Hyatt.
1112
1113         Harmonize the syntax of '-webkit-mask' property with 'background' according to the
1114         CSS Masking specification[1]. This should make it easier to maintain both shorthand
1115         properties in the long term.
1116         It is very unlikely that a lot of content (if any) is affected by this change. The
1117         computed style still is not implemented and this change should rather make it easier
1118         for developers.
1119
1120         With the harmonization, the '-webkit-mask-size' property is part of the shorthand as
1121         well now.
1122
1123         parsing-mask.html covers all the changes. Added new tests for the changed syntax and
1124         '-webkit-mask-size'
1125
1126         [1] http://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#mask-property
1127
1128         * css/CSSParser.cpp:
1129         (WebCore::CSSParser::parseValue):
1130         (WebCore::CSSParser::parseFillShorthand):
1131         * css/StylePropertySet.cpp:
1132         (WebCore::StylePropertySet::getLayeredShorthandValue):
1133         * css/StylePropertyShorthand.cpp:
1134         (WebCore::webkitMaskShorthand):
1135
1136 2012-11-28  Alec Flett  <alecflett@chromium.org>
1137
1138         IndexedDB: Change frontend to call IDBDatabaseBackendInterface::createTransaction()
1139         https://bugs.webkit.org/show_bug.cgi?id=102732
1140
1141         Reviewed by Tony Chang.
1142
1143         Use the new createTransaction, now that it has been stubbed
1144         out. This is part 2 of 3 of a refactor. See
1145         https://bugs.webkit.org/show_bug.cgi?id=102733 for part 3.
1146
1147         No new tests as this refactor simply keeps and propagates a
1148         counter that is currently unused.
1149
1150         * Modules/indexeddb/IDBDatabase.cpp:
1151         (WebCore::IDBDatabase::nextTransactionId):
1152         (WebCore):
1153         (WebCore::IDBDatabase::transaction):
1154         * Modules/indexeddb/IDBDatabase.h:
1155         (IDBDatabase):
1156         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1157         (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
1158         * Modules/indexeddb/IDBRequest.cpp:
1159         (WebCore::IDBRequest::onSuccess):
1160         * Modules/indexeddb/IDBTransaction.cpp:
1161         (WebCore::IDBTransaction::create):
1162         (WebCore::IDBTransaction::IDBTransaction):
1163         * Modules/indexeddb/IDBTransaction.h:
1164         (IDBTransaction):
1165
1166 2012-11-28  Michael Saboff  <msaboff@apple.com>
1167
1168         HTMLFontElement font size parsing should directly handle 8 bit strings
1169         https://bugs.webkit.org/show_bug.cgi?id=103315
1170
1171         Reviewed by Oliver Hunt.
1172
1173         Split parseFontSize() into a templated function based on character type and a wrapper that determines
1174         a string's bitness before calling the template.
1175
1176         No new tests. No change in functionality.
1177
1178         * html/HTMLFontElement.cpp:
1179         (WebCore::parseFontSize):
1180
1181 2012-11-28  Robert Kroeger  <rjkroege@chromium.org>
1182
1183         remove unused PlatformGestureCurve code
1184         https://bugs.webkit.org/show_bug.cgi?id=103296
1185
1186         Reviewed by Adam Barth.
1187
1188         Previous CLs have made the Chromium embedder provide gesture fling
1189         curve implementation to WebKit. Consequently no platform uses the
1190         gestural fling code currently found in WebKit. This CL removes this code.
1191
1192         Code removal only: covered by existing tests.
1193
1194         * CMakeLists.txt:
1195         * GNUmakefile.list.am:
1196         * WebCore.gypi:
1197         * platform/ActivePlatformGestureAnimation.cpp: Removed.
1198         * platform/ActivePlatformGestureAnimation.h: Removed.
1199         * platform/PlatformGestureCurve.h: Removed.
1200         * platform/PlatformGestureCurveTarget.h: Removed.
1201         * platform/ScrollAnimatorNone.cpp: References to removed code removed.
1202         * platform/ScrollAnimatorNone.h:
1203         * platform/TouchFlingPlatformGestureCurve.cpp: Removed.
1204         * platform/TouchFlingPlatformGestureCurve.h: Removed.
1205         * platform/WheelFlingPlatformGestureCurve.cpp: Removed.
1206         * platform/WheelFlingPlatformGestureCurve.h: Removed.
1207         * platform/chromium/support/PlatformGestureCurveFactory.cpp: Removed.
1208         * platform/chromium/support/PlatformGestureCurveFactory.h: Removed.
1209         * platform/chromium/support/WebFlingAnimatorToGestureCurveAdapter.h: Removed.
1210
1211 2012-11-28  Abhishek Arya  <inferno@chromium.org>
1212
1213         Heap-use-after-free in WebCore::EventHandler::handleMousePressEvent
1214         https://bugs.webkit.org/show_bug.cgi?id=101098
1215
1216         Reviewed by Adam Barth.
1217
1218         |subframe| can be blown away inside passMousePressEventToSubframe
1219         call. Use RefPtr to protect it in handleMousePressEvent function.
1220         We use similar approach in handleMouseMoveEvent function.
1221
1222         No new tests. Test is extremely time dependent and needs to trigger
1223         interaction gesture. Reproduced on ClusterFuzz.
1224
1225         * page/EventHandler.cpp:
1226         (WebCore::EventHandler::handleMousePressEvent):
1227
1228 2012-11-28  Tom Sepez  <tsepez@chromium.org>
1229
1230         XSSAuditor bypass with script src=data: URL ending in <!--
1231         https://bugs.webkit.org/show_bug.cgi?id=103548
1232
1233         Reviewed by Adam Barth.
1234
1235         This fixes an additional case where characters from the page itself are
1236         included with the snippet to match against the reflected vector, and the
1237         JS remains legitimate because of a <!--- comment. Truncate the snippet at
1238         such a comment.
1239         
1240         Test: http/tests/security/xssAuditor/script-tag-with-source-data-url3.html
1241
1242         * html/parser/XSSAuditor.cpp:
1243         (WebCore::XSSAuditor::decodedSnippetForAttribute):
1244
1245 2012-11-28  Abhishek Arya  <inferno@chromium.org>
1246
1247         Heap-use-after-free in WebCore::RenderLayerModelObject::hasSelfPaintingL
1248 ayer
1249         https://bugs.webkit.org/show_bug.cgi?id=101970
1250
1251         Reviewed by David Hyatt.
1252
1253         RenderInline::splitFlow and RenderBlock::splitFlow re-use |pre|
1254         block in some cases. In those cases, |pre| might hold floating objects
1255         and those floating descendants might get moved to |post| block. If
1256         the |pre| block does not get a layout later, then the floating
1257         descendant will never get removed since it is now part of |post|
1258         ancestor chain. We don't want failing-to-layout bugs turned into
1259         security bugs and hence clear floating objects list since we expect
1260         it to be rebuilt in subsequent layout.
1261
1262         Test: fast/block/float/float-not-removed-from-pre-block.html
1263
1264         * rendering/RenderBlock.cpp:
1265         (WebCore::RenderBlock::splitFlow): Call removeFloatingObjects on |pre| block.
1266         (WebCore::RenderBlock::removeFloatingObjects): Clear all floating objects from our list.
1267         (WebCore):
1268         * rendering/RenderBlock.h: 
1269         (RenderBlock):
1270         * rendering/RenderInline.cpp:
1271         (WebCore::RenderInline::splitFlow): Call removeFloatingObjects on |pre| block.
1272
1273 2012-11-28  Mark Pilgrim  <pilgrim@chromium.org>
1274
1275         [Chromium] Remove pluginsScriptableObject from PlatformSupport
1276         https://bugs.webkit.org/show_bug.cgi?id=103542
1277
1278         Reviewed by Adam Barth.
1279
1280         Part of a refactoring series. See tracking bug 82948.
1281
1282         * bindings/v8/ScriptController.cpp:
1283         (WebCore::ScriptController::createScriptInstanceForWidget):
1284         * platform/chromium/PlatformSupport.h:
1285         (PlatformSupport):
1286         * plugins/PluginViewBase.h:
1287         (PluginViewBase):
1288         (WebCore::PluginViewBase::scriptableObject):
1289
1290 2012-11-28  Otto Derek Cheung  <otcheung@rim.com>
1291
1292         [BlackBerry] CookieJarBlackBerry will use document settings for cookiesEnabled
1293         https://bugs.webkit.org/show_bug.cgi?id=103560
1294
1295         Reviewed by Rob Buis.
1296
1297         PR 253490
1298
1299         CookieJarBlackBerry will now use page settings to check whether
1300         cookie is enabled.
1301
1302         Tested setting/reading cookies on different client cookie settings using
1303         javascript and HTTP. Cookie behaviour is now back to spec.
1304
1305         * loader/blackberry/CookieJarBlackBerry.cpp:
1306         (WebCore::cookies):
1307         (WebCore::cookieRequestHeaderFieldValue):
1308
1309 2012-11-28  Mark Pilgrim  <pilgrim@chromium.org>
1310
1311         [Chromium][Win] Remove ensureFontLoaded from PlatformSupport
1312         https://bugs.webkit.org/show_bug.cgi?id=97696
1313
1314         Reviewed by Adam Barth.
1315
1316         Move ensureFontLoaded() from PlatformSupport to
1317         FontPlatformDataChromiumWin. Part of a refactoring series; see
1318         tracking bug 82948.
1319
1320         * platform/chromium/PlatformSupport.h:
1321         (PlatformSupport):
1322         * platform/graphics/chromium/FontCacheChromiumWin.cpp:
1323         (WebCore::fontContainsCharacter):
1324         * platform/graphics/chromium/FontChromiumWin.cpp:
1325         (WebCore::drawGlyphsWin):
1326         * platform/graphics/chromium/FontPlatformDataChromiumWin.cpp:
1327         (WebCore::FontPlatformData::scriptFontProperties):
1328         (WebCore):
1329         (WebCore::FontPlatformData::ensureFontLoaded):
1330         * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
1331         (FontPlatformData):
1332         * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
1333         (WebCore::getGlyphIndices):
1334         (WebCore::fillBMPGlyphs):
1335         * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp:
1336         (WebCore::SimpleFontData::platformInit):
1337         (WebCore::SimpleFontData::determinePitch):
1338         (WebCore::SimpleFontData::platformBoundsForGlyph):
1339         (WebCore::SimpleFontData::platformWidthForGlyph):
1340         * platform/graphics/chromium/UniscribeHelperTextRun.cpp:
1341         (WebCore::UniscribeHelperTextRun::tryToPreloadFont):
1342         * platform/graphics/skia/SkiaFontWin.cpp:
1343         (WebCore::paintSkiaText):
1344
1345 2012-11-28  peavo@outlook.com  <peavo@outlook.com>
1346
1347         [WinCairo] Crash when requesting favicon.
1348         https://bugs.webkit.org/show_bug.cgi?id=102689
1349
1350         Reviewed by Brent Fulgham.
1351
1352         * platform/graphics/BitmapImage.h: Made frameCount() method virtual, subclasses made for testing can then override it.
1353         * platform/graphics/win/ImageCairoWin.cpp:
1354         (WebCore::BitmapImage::getHBITMAPOfSize): Added NULL pointer check.
1355         (WebCore::BitmapImage::drawFrameMatchingSourceSize): Added NULL pointer check.
1356
1357 2012-11-28  Tony Chang  <tony@chromium.org>
1358
1359         Move internals.settings.setPageScaleFactor to internals.setPageScaleFactor
1360         https://bugs.webkit.org/show_bug.cgi?id=103559
1361
1362         Reviewed by Jochen Eisinger.
1363
1364         This method doesn't alter the Settings object, so move it to internals.
1365
1366         No new tests, this is a refactor.
1367
1368         * testing/InternalSettings.cpp: Remove.
1369         * testing/InternalSettings.h: Remove.
1370         * testing/InternalSettings.idl: Remove.
1371         * testing/Internals.cpp:
1372         (WebCore::Internals::resetToConsistentState): Add reset code.
1373         (WebCore::Internals::setPageScaleFactor): Add method.
1374         * testing/Internals.h: Add method.
1375         * testing/Internals.idl: Add method.
1376
1377 2012-11-28  Alexandru Chiculita  <achicu@adobe.com>
1378
1379         [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
1380         https://bugs.webkit.org/show_bug.cgi?id=102826
1381
1382         Reviewed by Dave Hyatt.
1383
1384         Follow up update of a comment after the patch was landed by the commit queue in r135921.
1385
1386         * rendering/RenderObject.cpp:
1387         (WebCore::RenderObject::containerForRepaint):
1388
1389 2012-11-28  Christophe Dumez  <christophe.dumez@intel.com>
1390
1391         CSS3 Multicolumn: column-span should accept value 'none' (instead of '1')
1392         https://bugs.webkit.org/show_bug.cgi?id=101462
1393
1394         Reviewed by David Hyatt.
1395
1396         According to the latest CSS3 Multi-column specification:
1397         http://www.w3.org/TR/2011/CR-css3-multicol-20110412/#column-span
1398
1399         column-span should accept values [ none | all ], instead of
1400         [ 1 | all ]. This patch updates WebKit implementation to reflect
1401         this change in the specification. The value 1 is still supported
1402         for compatibility reasons and is mapped to none.
1403
1404         No new tests, already covered by existing tests.
1405
1406         * css/CSSComputedStyleDeclaration.cpp:
1407         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1408         * css/CSSParser.cpp:
1409         (WebCore::CSSParser::parseValue):
1410         * css/CSSPrimitiveValueMappings.h:
1411         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1412         (WebCore::CSSPrimitiveValue::operator ColumnSpan):
1413         * rendering/style/RenderStyle.h:
1414         * rendering/style/RenderStyleConstants.h:
1415
1416 2012-11-28  Anton Vayvod  <avayvod@chromium.org>
1417
1418         Text Autosizing: Clusters should use width of LCA of their text nodes
1419         https://bugs.webkit.org/show_bug.cgi?id=102562
1420
1421         Reviewed by Kenneth Rohde Christiansen.
1422
1423         Many pages set a max-width on their content. So especially for the
1424         RenderView, instead of just taking the width of |cluster| we find
1425         the lowest common ancestor of the first and last descendant text node of
1426         the cluster (i.e. the deepest wrapper block that contains all the text),
1427         and use its width instead.
1428
1429         Tests: fast/text-autosizing/cluster-with-narrow-lca-and-cluster.html
1430                fast/text-autosizing/cluster-with-narrow-lca.html
1431                fast/text-autosizing/cluster-with-wide-lca.html
1432                fast/text-autosizing/list-item-out-of-flow.html
1433                fast/text-autosizing/wide-in-narrow-overflow-scroll.html
1434
1435         * rendering/TextAutosizer.cpp:
1436         (WebCore::TextAutosizer::processCluster): use text nodes LCA instead of cluster for width calculation
1437         (WebCore::TextAutosizer::isAutosizingContainer): list items that are out of parent list element's flow are valid containers (that therefore become clusters in isAutosizingCluster)
1438         (WebCore::TextAutosizer::findDeepestBlockContainingAllText): searches for LCA of text nodes ignoring descendant clusters
1439         (WebCore::TextAutosizer::findFirstTextLeafNotInCluster): searches for the first or the last (depending on specified direction) text leaf node in-order ignoring any descendant clusters
1440         * rendering/TextAutosizer.h: new private methods declarations and an enum for tree traversal direction.
1441
1442 2012-11-28  Sadrul Habib Chowdhury  <sadrul@chromium.org>
1443
1444         cleanup: Change some code to be cleaner, more readable and style conforming
1445         https://bugs.webkit.org/show_bug.cgi?id=103543
1446
1447         Reviewed by Antonio Gomes.
1448
1449         Use more appropriate function name and more meaningful variable names to make the code cleaner.
1450         This is covered by existing tests. This does not make any behavioural changes, so no new tests.
1451
1452         * page/EventHandler.cpp:
1453         (WebCore::closestScrollableNodeInDocumentIfPossible):
1454         (WebCore::EventHandler::handleWheelEvent):
1455
1456 2012-11-28  Alexandru Chiculita  <achicu@adobe.com>
1457
1458         [CSS Regions] Crash when using hover and first-letter inside a flow-thread
1459         https://bugs.webkit.org/show_bug.cgi?id=102957
1460
1461         Reviewed by David Hyatt.
1462
1463         Some RenderObjects use a different path when they are destroyed. That's because they are dynamically
1464         added just before layout happens and their parent is usually not their actual owner. In those cases the parent
1465         will remove the object from the tree, but it's actually the owner that will destroy the object and all its
1466         children.
1467
1468         RenderFlowThread maintains a RenderBoxRegionInfo object for each RenderObject that is rendered inside the
1469         flow-thread. When the RenderObject is removed from the RenderFlowThread, the associated RenderBoxRegionInfo object
1470         also needs to be removed.
1471
1472         In these special cases (list-marker, first-letter), the object itself was removed from the RenderFlowThread,
1473         but its children were still left in the flow-thread. When the these special objects were later destroyed, 
1474         they will remove their own children. Removing their children means it will try to remove them from the
1475         associated RenderFlowThread. However, in this cases there would be no link back to the parent flow-thread,
1476         as the tree is now detached from the enclosing RenderFlowThread.
1477
1478         Added code that recursively removes the whole children tree from the RenderFlowThread when the root is removed.
1479
1480         Tests: fast/regions/firstletter-inside-flowthread.html
1481                fast/regions/listmarker-inside-flowthread.html
1482
1483         * rendering/RenderObject.cpp:
1484         (WebCore::RenderObject::willBeRemovedFromTree):
1485         (WebCore::RenderObject::removeFromRenderFlowThread):
1486         (WebCore):
1487         (WebCore::RenderObject::removeFromRenderFlowThreadRecursive):
1488         * rendering/RenderObject.h:
1489         (RenderObject):
1490
1491 2012-11-28  Alexandru Chiculita  <achicu@adobe.com>
1492
1493         [CSS Regions] Auto-height regions will not calculate the height correctly when the content changes dynamically
1494         https://bugs.webkit.org/show_bug.cgi?id=102954
1495
1496         Reviewed by David Hyatt.
1497
1498         Whenever the flow changes, we need to reset the region computed auto-heights.
1499         However, when we reset the region heights to "auto" or "un-computed", we also need to make
1500         sure that all the region breaks are counted again, so that we split regions correctly during the new layout.
1501         I've reused the m_regionsInvalidated property to force the flow do a complete layout.
1502
1503         Test: fast/regions/autoheight-dynamic-update.html
1504
1505         * rendering/RenderFlowThread.cpp:
1506         (WebCore::RenderFlowThread::resetRegionsOverrideLogicalContentHeight):
1507
1508 2012-11-28  Alexandru Chiculita  <achicu@adobe.com>
1509
1510         [CSS Regions] InRenderFlowThread returns false in the first setStyle
1511         https://bugs.webkit.org/show_bug.cgi?id=102839
1512
1513         Reviewed by Dave Hyatt.
1514
1515         Some render objects use the "inRenderFlowThread" during the first styleWillChange/styleDidChange.
1516         The first call to these methods comes from NodeRendererFactory::createRenderer. That happens before the RenderObject is 
1517         attached to the parent renderer, meaning that inRenderFlowThread is false. That means a RenderLayerBacking will be 
1518         created for renderers inside the RenderFlowThread, but composited layers inside the RenderFlowThread are not supported yet.
1519         https://bugs.webkit.org/show_bug.cgi?id=84900
1520
1521         Test: fast/repaint/region-painting-composited-element.html
1522
1523         * dom/NodeRenderingContext.cpp:
1524         (WebCore::NodeRendererFactory::createRenderer):
1525         Added code to propagate the inRenderFlowThread flag from the parent node before the style is set for the first time.
1526
1527 2012-11-28  Dan Bernstein  <mitz@apple.com>
1528
1529         <rdar://problem/12645085> REGRESSION (r130851): With kerning enabled, a white-space: pre-wrap inline starting with tab+space has the wrong width
1530         https://bugs.webkit.org/show_bug.cgi?id=103541
1531
1532         Reviewed by Anders Carlsson.
1533
1534         Test: fast/text/tab-with-kerning.html
1535
1536         When kerning is enabled, words are measured with their trailing space, then the width of a
1537         space is subtracted. The logic to do this was incorrectly being invoked even when the
1538         trailing whitespace character was a tab or a newline.
1539
1540         * rendering/RenderBlockLineLayout.cpp:
1541         (WebCore::RenderBlock::LineBreaker::nextLineBreak): Changed to check only for the space
1542         character, not other space-like characters.
1543
1544 2012-11-28  Nate Chapin  <japhet@chromium.org>
1545
1546         Move empty loading to DocumentLoader, simplify FrameLoader::init()
1547         https://bugs.webkit.org/show_bug.cgi?id=101512
1548
1549         Reviewed by Adam Barth.
1550
1551         No new tests, though several outputs changed because we no longer send resource
1552             load callbacks for empty loads.
1553
1554         * loader/DocumentLoader.cpp:
1555         (WebCore::DocumentLoader::DocumentLoader):
1556         (WebCore::DocumentLoader::~DocumentLoader):
1557         (WebCore::DocumentLoader::finishedLoading):
1558         (WebCore::DocumentLoader::commitData):
1559         (WebCore::DocumentLoader::clearMainResourceLoader):
1560         (WebCore::DocumentLoader::isLoadingInAPISense):
1561         (WebCore::DocumentLoader::documentURL):
1562         (WebCore::DocumentLoader::isLoadingMainResource):
1563         (WebCore::DocumentLoader::maybeLoadEmpty):
1564         (WebCore):
1565         (WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
1566              loads directly here.
1567         * loader/DocumentLoader.h:
1568         (WebCore::DocumentLoader::serverRedirectSourceForHistory):
1569         (DocumentLoader):
1570         * loader/FrameLoader.cpp:
1571         (WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
1572             were previously being reset in init(). Given that the FrameLoader is in
1573             an inconsistent state before init() is called anyway, there doesn't seem
1574             to be a disadvantage to just initializing them to their post-init() values.
1575         (WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
1576             doing a bunch of direct calls to functions FrameLoader shouldn't know about.
1577         * loader/FrameLoaderStateMachine.cpp:
1578         (WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
1579         * loader/FrameLoaderStateMachine.h:
1580         * loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
1581         (WebCore::MainResourceLoader::loadNow): This only returned true when an empty
1582             load got deferred, which won't happen now. Return void and always treat
1583             as returning false.
1584         * loader/MainResourceLoader.h:
1585         (MainResourceLoader):
1586
1587 2012-11-28  Antoine Quint  <graouts@apple.com>
1588
1589         Calling .removeCue() for a cue that was never added should raise a NOT_FOUND_ERR
1590         https://bugs.webkit.org/show_bug.cgi?id=103412
1591
1592         Reviewed by Eric Carlson.
1593
1594         Updating the .removeCue() implementation to match the latest spec. This means we now
1595         raise a NOT_FOUND_ERR exception when trying to remove a cue that wasn't present in the
1596         cue list instead of a INVALID_STATE_ERR exception like the spec used to mandate.
1597
1598         * html/track/TextTrack.cpp:
1599         (WebCore::TextTrack::removeCue):
1600
1601 2012-11-28  Zeno Albisser  <zeno@webkit.org>
1602
1603         [Qt][Win] Enable usage of QTWEBKIT_PLUGIN_PATH.
1604         https://bugs.webkit.org/show_bug.cgi?id=103529
1605
1606         This patch enables the same behavior for Windows
1607         as it is currently implemented for all other operating
1608         systems supported by Qt.
1609         Directories listed in the environment variable
1610         QTWEBKIT_PLUGIN_PATH are being searched for additional
1611         plugins.
1612         The only difference is that directories on Windows
1613         need to be separated by a semicolon instead of a colon.
1614
1615         Reviewed by Kenneth Rohde Christiansen.
1616
1617         * plugins/win/PluginDatabaseWin.cpp:
1618         (WebCore):
1619         (WebCore::addQtWebKitPluginPath):
1620         (WebCore::PluginDatabase::defaultPluginDirectories):
1621
1622 2012-11-28  Adam Barth  <abarth@webkit.org>
1623
1624         [v8] 4% regression in dom_traverse tests
1625         https://bugs.webkit.org/show_bug.cgi?id=102858
1626
1627         Unreviewed.
1628
1629         This patch is a manual rollout of
1630         http://trac.webkit.org/changeset/134729. We can't do a mechanical
1631         rollout because V8DOMWrapper::getCachedWrapper no longer exists.
1632
1633         * bindings/scripts/CodeGeneratorV8.pm:
1634         (GenerateHeader):
1635
1636 2012-11-28  Denis Nomiyama  <d.nomiyama@samsung.com>
1637
1638         Removed extra definition of GLXContext.
1639         https://bugs.webkit.org/show_bug.cgi?id=103500
1640
1641         Reviewed by Martin Robinson.
1642
1643         A minor cleanup to remove a spare definition of GLXContext in GLContextGLX.h.
1644
1645         No new tests. This doesn't change any behavior.
1646
1647         * platform/graphics/glx/GLContextGLX.h:
1648
1649 2012-11-28  Sadrul Habib Chowdhury  <sadrul@chromium.org>
1650
1651         Fix gesture scrolling when the target-element of scroll-begin is removed
1652         https://bugs.webkit.org/show_bug.cgi?id=103355
1653
1654         Reviewed by Antonio Gomes.
1655
1656         When a touch-scroll starts, the node under the touch-point gets latched, and
1657         subsequent scroll-update events are dispatched to that node. But if the node is
1658         removed while the gesture event is in progress (e.g. in a dynamically updated
1659         list), then the scrolling stops, although there are enough elements to still
1660         enable scrolling. So instead of latching on to the node immediately under the
1661         touch point, latch on to the scrollable node under the touch point.
1662
1663         Test: fast/events/touch/gesture/touch-gesture-scroll-remove-node.html
1664
1665         * page/EventHandler.cpp:
1666         (WebCore::getClosestScrollableNodeInDocumentIfPossible):
1667         (WebCore):
1668         (WebCore::EventHandler::handleWheelEvent):
1669
1670 2012-11-28  Anton Obzhirov  <a.obzhirov@samsung.com>
1671
1672         Fix .libs/libwebkitgtk-3.0.so: undefined reference to `WebCore::validationMessageBadInputForNumberText().
1673         https://bugs.webkit.org/show_bug.cgi?id=103509
1674
1675         Reviewed by Philippe Normand.
1676
1677         GTK build fix after r136001.
1678
1679         * platform/gtk/LocalizedStringsGtk.cpp:
1680         (WebCore::validationMessageBadInputForNumberText):
1681         (WebCore):
1682
1683 2012-11-28  Byungwoo Lee  <bw80.lee@samsung.com>
1684
1685         [EFL] Use mutex locker in wakeUp() to ensure thread-safety.
1686         https://bugs.webkit.org/show_bug.cgi?id=101132
1687
1688         Reviewed by Gyuyoung Kim.
1689
1690         Add mutex locker for the ecore pipe to ensure thread-safety of
1691         RunLoop::wakeUp().
1692
1693         RunLoop::wakeUp() can be called by multiple thread. It uses
1694         ecore_pipe_write() function but the function is not thread-safe.
1695
1696         * platform/RunLoop.h:
1697         (RunLoop):
1698         * platform/efl/RunLoopEfl.cpp:
1699         (WebCore::RunLoop::wakeUp):
1700
1701 2012-11-28  Ryuan Choi  <ryuan.choi@gmail.com>
1702
1703         [EFL] Refactor theme to choose whether to support foreground color of selection
1704         https://bugs.webkit.org/show_bug.cgi?id=102037
1705
1706         Reviewed by Kenneth Rohde Christiansen.
1707
1708         If foreground selection color is supported, selected text is painted to
1709         SelectionForegroundColor instead of text color. If not, text can be painted
1710         to text color.
1711
1712         However, EFL port does not have a way to disable support of foreground
1713         selection color. So this patch refactors color classes of theme from
1714         active and inactive to foreground and background in order to disable support
1715         of foreground selection color when foreground color class is not specified.
1716
1717         * platform/efl/RenderThemeEfl.cpp:
1718         (WebCore::fillColorsFromEdjeClass):
1719         Returned false without error message when colorClass is not specified.
1720         (WebCore::RenderThemeEfl::setColorFromThemeClass):
1721         (WebCore::RenderThemeEfl::loadTheme):
1722         (WebCore::RenderThemeEfl::RenderThemeEfl):
1723         (WebCore::RenderThemeEfl::supportsSelectionForegroundColors):
1724         (WebCore):
1725         * platform/efl/RenderThemeEfl.h:
1726         (RenderThemeEfl):
1727
1728 2012-11-28  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1729
1730         Move childrenAffectedBy bits from RenderStyle to Element
1731         https://bugs.webkit.org/show_bug.cgi?id=101448
1732
1733         Unreviewed buildfix.
1734
1735         To use renderStyle() on some Macs we need to include NodeRenderStyle.h.
1736
1737         * dom/ContainerNode.cpp:
1738
1739 2012-11-28  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1740
1741         Move childrenAffectedBy bits from RenderStyle to Element
1742         https://bugs.webkit.org/show_bug.cgi?id=101448
1743         https://bugs.webkit.org/show_bug.cgi?id=98021
1744
1745         Reviewed by Antti Koivisto.
1746
1747         Moves facts observed about restyling dependencies out of RenderStyle and
1748         into RareData for Node and Element. This also enables further cleanup
1749         in related code that tried to deal with problems caused with the placement
1750         of the data.
1751
1752         Test: fast/css/nth-child-not-in-rightmost.html
1753
1754         * css/SelectorChecker.cpp:
1755         (WebCore::SelectorChecker::checkSelector):
1756         (WebCore::SelectorChecker::checkOneSelector):
1757         * css/SiblingTraversalStrategies.h:
1758         (WebCore::DOMSiblingTraversalStrategy::countElementsBefore):
1759         * css/StyleResolver.cpp:
1760         (WebCore::StyleResolver::sortAndTransferMatchedRules):
1761         (WebCore::StyleResolver::canShareStyleWithElement):
1762         (WebCore::parentElementPreventsSharing):
1763         (WebCore::StyleResolver::locateSharedStyle):
1764         * dom/ContainerNode.cpp:
1765         (WebCore::ContainerNode::setActive):
1766         (WebCore::ContainerNode::setHovered):
1767         * dom/Element.cpp:
1768         (WebCore::Element::detach):
1769         (WebCore::Element::recalcStyle):
1770         (WebCore::checkForEmptyStyleChange):
1771         (WebCore::checkForSiblingStyleChanges):
1772         (WebCore::Element::setChildrenAffectedByHover):
1773         (WebCore::Element::setChildrenAffectedByActive):
1774         (WebCore::Element::setChildrenAffectedByDrag):
1775         (WebCore::Element::setChildrenAffectedByFirstChildRules):
1776         (WebCore::Element::setChildrenAffectedByLastChildRules):
1777         (WebCore::Element::setChildrenAffectedByDirectAdjacentRules):
1778         (WebCore::Element::setChildrenAffectedByForwardPositionalRules):
1779         (WebCore::Element::setChildrenAffectedByBackwardPositionalRules):
1780         (WebCore::Element::setChildIndex):
1781         (WebCore::Element::rareDataStyleAffectedByEmpty):
1782         (WebCore::Element::rareDataChildrenAffectedByHover):
1783         (WebCore::Element::rareDataChildrenAffectedByActive):
1784         (WebCore::Element::rareDataChildrenAffectedByDrag):
1785         (WebCore::Element::rareDataChildrenAffectedByFirstChildRules):
1786         (WebCore::Element::rareDataChildrenAffectedByLastChildRules):
1787         (WebCore::Element::rareDataChildrenAffectedByDirectAdjacentRules):
1788         (WebCore::Element::rareDataChildrenAffectedByForwardPositionalRules):
1789         (WebCore::Element::rareDataChildrenAffectedByBackwardPositionalRules):
1790         (WebCore::Element::rareDataChildIndex):
1791         * dom/Element.h:
1792         (Element):
1793         (WebCore::Element::styleAffectedByEmpty):
1794         (WebCore::Element::childrenAffectedByHover):
1795         (WebCore::Element::childrenAffectedByActive):
1796         (WebCore::Element::childrenAffectedByDrag):
1797         (WebCore::Element::childrenAffectedByPositionalRules):
1798         (WebCore::Element::childrenAffectedByFirstChildRules):
1799         (WebCore::Element::childrenAffectedByLastChildRules):
1800         (WebCore::Element::childrenAffectedByDirectAdjacentRules):
1801         (WebCore::Element::childrenAffectedByForwardPositionalRules):
1802         (WebCore::Element::childrenAffectedByBackwardPositionalRules):
1803         (WebCore::Element::childIndex):
1804         * dom/ElementRareData.h:
1805         (ElementRareData):
1806         (WebCore::ElementRareData::resetComputedStyle):
1807         (WebCore::ElementRareData::resetDynamicRestyleObservations):
1808         * dom/Node.cpp:
1809         (WebCore::Node::diff):
1810         * dom/NodeRareData.h:
1811         (WebCore::NodeRareData::NodeRareData):
1812         (WebCore::NodeRareData::childrenAffectedByHover):
1813         (WebCore::NodeRareData::setChildrenAffectedByHover):
1814         (WebCore::NodeRareData::childrenAffectedByActive):
1815         (WebCore::NodeRareData::setChildrenAffectedByActive):
1816         (WebCore::NodeRareData::childrenAffectedByDrag):
1817         (WebCore::NodeRareData::setChildrenAffectedByDrag):
1818         (NodeRareData):
1819         (WebCore::NodeRareData::childrenAffectedByFirstChildRules):
1820         (WebCore::NodeRareData::setChildrenAffectedByFirstChildRules):
1821         (WebCore::NodeRareData::childrenAffectedByLastChildRules):
1822         (WebCore::NodeRareData::setChildrenAffectedByLastChildRules):
1823         (WebCore::NodeRareData::childrenAffectedByDirectAdjacentRules):
1824         (WebCore::NodeRareData::setChildrenAffectedByDirectAdjacentRules):
1825         (WebCore::NodeRareData::childrenAffectedByForwardPositionalRules):
1826         (WebCore::NodeRareData::setChildrenAffectedByForwardPositionalRules):
1827         (WebCore::NodeRareData::childrenAffectedByBackwardPositionalRules):
1828         (WebCore::NodeRareData::setChildrenAffectedByBackwardPositionalRules):
1829         (WebCore::NodeRareData::childIndex):
1830         (WebCore::NodeRareData::setChildIndex):
1831         * dom/NodeRenderingContext.cpp:
1832         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
1833         * page/TouchAdjustment.cpp:
1834         (WebCore::TouchAdjustment::nodeRespondsToTapGesture):
1835         * rendering/RenderObject.cpp:
1836         (WebCore::RenderObject::updateDragState):
1837         * rendering/style/RenderStyle.cpp:
1838         (WebCore::RenderStyle::copyNonInheritedFrom):
1839         * rendering/style/RenderStyle.h:
1840
1841 2012-11-28  Zeno Albisser  <zeno@webkit.org>
1842
1843         GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
1844         https://bugs.webkit.org/show_bug.cgi?id=103497
1845
1846         Unreviewed buildfix.
1847
1848         Any usage of GraphicsSurface needs to be wrapped with USE(GRAPHICS_SURFACE).
1849
1850         * platform/graphics/qt/GraphicsContext3DQt.cpp:
1851         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1852
1853 2012-11-28  Zeno Albisser  <zeno@webkit.org>
1854
1855         GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
1856         https://bugs.webkit.org/show_bug.cgi?id=103497
1857
1858         This is a temporary workaround for an issue with GraphicsSurfaceMac.
1859         GraphicsSurfaceMac is currently implemented using CGL only.
1860         CGL does not allow us to properly restore the NSView a context was made current with.
1861         Therefore we have to go through QOpenGLContext to ensure the context
1862         is being restored correctly.
1863         As soon as we are updating GraphicsSurfaceMac to use NSOpenGL,
1864         we should revert this patch.
1865
1866         Reviewed by Simon Hausmann.
1867
1868         * platform/graphics/qt/GraphicsContext3DQt.cpp:
1869         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1870
1871 2012-11-28  Zeno Albisser  <zeno@webkit.org>
1872
1873         GraphicsSurface: Implement usage of GraphicsSurface for WebGL in WK1.
1874         https://bugs.webkit.org/show_bug.cgi?id=103497
1875
1876         Using GraphicsSurface for WebGL in WK1 allows us to share
1877         the code with the WK2 implementation.
1878
1879         Reviewed by Simon Hausmann.
1880
1881         * platform/graphics/qt/GraphicsContext3DQt.cpp:
1882         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
1883             Remove obsolete code.
1884         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1885             After blitting the multisample framebuffer,
1886             we can copy the contents onto the GraphicsSurface.
1887             Right after that we can use the GraphicsSurface
1888             as a texture origin to paint to the TextureMapper.
1889             Flags related to flipping and blending are being resolved
1890             by GraphicsSurface, and do not need to be handled here anymore.
1891         (WebCore::GraphicsContext3DPrivate::copyToGraphicsSurface):
1892             Remove a redundant makeCurrentIfNeeded call.
1893             The original context is being restored by
1894             blitMultisampleFramebufferAndRestoreContext anyway.
1895             Instead of explicitly calling swapBuffers here,
1896             we call swapBuffers on the GraphicsSurface implicitly
1897             after in GraphicsSurfacePrivate::copyFromTexture().
1898         * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
1899             Add members to hold the reading end texture IDs.
1900             The texture on the reading side are in a different
1901             context than the texture on the writing side.
1902             By using GraphicsSurface in WK1 we have to distinguish
1903             between these textures, as a single instance serves
1904             for reading and writing.
1905         (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
1906         (WebCore::GraphicsSurfacePrivate::~GraphicsSurfacePrivate):
1907         (WebCore::GraphicsSurfacePrivate::swapBuffers):
1908         (WebCore::GraphicsSurfacePrivate::copyFromTexture):
1909             Add an implicit call to swapBuffers().
1910         (WebCore::GraphicsSurfacePrivate::frontBufferTextureID):
1911         (GraphicsSurfacePrivate):
1912         * platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
1913         (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
1914             Add a flag to distinguish between sending and receiving/reading
1915             side of the surface. This flag is being initialized in the constructor
1916             which is the only place where we know if an instance will be used for
1917             writing or reading.
1918             The purpose of this flag is to avoid erroneously swapping the buffers
1919             on the reading side. We can no longer rely on m_xPixmap for this purpose.
1920         (WebCore::GraphicsSurfacePrivate::swapBuffers):
1921         (WebCore::GraphicsSurfacePrivate::copyFromTexture):
1922         (WebCore::GraphicsSurfacePrivate::glxPixmap):
1923             Lazily create the GLX pixmap on demand.
1924         (GraphicsSurfacePrivate):
1925         (WebCore::GraphicsSurface::platformImport):
1926
1927 2012-11-28  Roger Fong  <roger_fong@apple.com>
1928
1929         Unreviewed. Fix extra spaces in SimpleFontData::initGDIFont().
1930
1931         * platform/graphics/win/SimpleFontDataWin.cpp:
1932         (WebCore::SimpleFontData::initGDIFont):
1933
1934 2012-11-28  Dan Carney  <dcarney@google.com>
1935
1936         [V8] Crash wrapping media element when MediaPlayer isn't available
1937         https://bugs.webkit.org/show_bug.cgi?id=103431
1938
1939         Reviewed by Kentaro Hara.
1940
1941         Call HTMLElement::createWrapper directly when dispatching a
1942         disabled MediaElement wrap.
1943
1944         No new tests. Testing this must apparently be manual.
1945
1946         * bindings/scripts/CodeGeneratorV8.pm:
1947         (GenerateHeader):
1948         * dom/make_names.pl:
1949         (printWrapperFunctions):
1950         (printWrapperFactoryHeaderFile):
1951
1952 2012-11-28  Roger Fong  <roger_fong@apple.com>
1953
1954         Initialize identity matrix in SimpleFontData::initGDIFont() properly.
1955         https://bugs.webkit.org/show_bug.cgi?id=103499
1956         <rdar://problem/12400700>
1957
1958         Reviewed by Timothy Horton.
1959
1960         We are incorrectly initializing the matrix passed into GetGlyphOutline.
1961         This patch fixes MAT2 initialization to match the way we initialize the 
1962         identity matrix in SimpleFontData::boundsForGDIGlyph and SimpleFontData::widthForGDIGlyph.
1963
1964         * platform/graphics/win/SimpleFontDataWin.cpp:
1965         (WebCore::SimpleFontData::initGDIFont):
1966
1967 2012-11-28  Huang Dongsung  <luxtella@company100.net>
1968
1969         [Texmap] REGRESSION(r135620) QtTestBrowser crashes on Google-gravity.
1970         https://bugs.webkit.org/show_bug.cgi?id=103410
1971
1972         Reviewed by Noam Rosenthal.
1973
1974         GraphicsLayerTextureMapper::updateBackingStore() should return early
1975         before TextureMapper is set.
1976
1977         GraphicsLayer::FlushCompositingState() can be called by RenderLayerBacking. It
1978         means this method can be called before creating TextureMapper. So
1979         TextureMapperLayer::flushCompositingState() checks and returns early if
1980         TextureMapper was not created.
1981
1982         However, GraphicsLayerTextureMapper::updateBackingStore() expects that TextureMapper
1983         always exists. updateBackingStore should also return early when TextureMapper
1984         was not created.
1985
1986         No new tests. Covered by existing tests.
1987
1988         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1989         (WebCore::GraphicsLayerTextureMapper::setNeedsDisplay):
1990         (WebCore::GraphicsLayerTextureMapper::setNeedsDisplayInRect):
1991         (WebCore::GraphicsLayerTextureMapper::didFlushCompositingState):
1992         (WebCore::GraphicsLayerTextureMapper::prepareBackingStore):
1993
1994 2012-11-28  Tommy Widenflycht  <tommyw@google.com>
1995
1996         Add basic implementation for MediaStreamAudioDestinationNode
1997         https://bugs.webkit.org/show_bug.cgi?id=101815
1998
1999         Reviewed by Chris Rogers.
2000
2001         Implements an audio destination node which has a MediaStream.
2002         This can be added to a PeerConnection with peerConnection.addStream().
2003         Please see use case (3):
2004         https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/webrtc-integration.html
2005
2006         Test: webaudio/mediastreamaudiodestinationnode.html
2007
2008         * Modules/webaudio/AudioContext.cpp:
2009         (WebCore):
2010         (WebCore::AudioContext::createMediaStreamDestination):
2011         * Modules/webaudio/AudioContext.h:
2012         (WebCore):
2013         (AudioContext):
2014         * Modules/webaudio/AudioContext.idl:
2015         * Modules/webaudio/AudioNode.h:
2016         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Added.
2017         (WebCore):
2018         (WebCore::MediaStreamAudioDestinationNode::create):
2019         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
2020         (WebCore::MediaStreamAudioDestinationNode::mediaStreamSource):
2021         (WebCore::MediaStreamAudioDestinationNode::~MediaStreamAudioDestinationNode):
2022         (WebCore::MediaStreamAudioDestinationNode::process):
2023         (WebCore::MediaStreamAudioDestinationNode::reset):
2024         * Modules/webaudio/MediaStreamAudioDestinationNode.h: Added.
2025         (WebCore):
2026         (MediaStreamAudioDestinationNode):
2027         (WebCore::MediaStreamAudioDestinationNode::stream):
2028         * Modules/webaudio/MediaStreamAudioDestinationNode.idl: Added.
2029         * WebCore.gypi:
2030         * platform/audio/AudioDestinationConsumer.h: Copied from Source/WebCore/platform/mediastream/MediaStreamSource.cpp.
2031         (WebCore):
2032         (AudioDestinationConsumer):
2033         (WebCore::AudioDestinationConsumer::~AudioDestinationConsumer):
2034         * platform/chromium/support/WebMediaStreamSource.cpp:
2035         (WebKit::WebMediaStreamSource::extraData):
2036         (WebKit::WebMediaStreamSource::setExtraData):
2037         (WebKit::WebMediaStreamSource::requiresAudioConsumer):
2038         (WebKit):
2039         (ConsumerWrapper):
2040         (WebKit::ConsumerWrapper::create):
2041         (WebKit::ConsumerWrapper::consumer):
2042         (WebKit::ConsumerWrapper::ConsumerWrapper):
2043         (WebKit::ConsumerWrapper::consumeAudio):
2044         (WebKit::WebMediaStreamSource::addAudioConsumer):
2045         (WebKit::WebMediaStreamSource::removeAudioConsumer):
2046         * platform/mediastream/MediaStreamSource.cpp:
2047         (WebCore::MediaStreamSource::create):
2048         (WebCore::MediaStreamSource::MediaStreamSource):
2049         (WebCore::MediaStreamSource::addAudioConsumer):
2050         (WebCore):
2051         (WebCore::MediaStreamSource::removeAudioConsumer):
2052         (WebCore::MediaStreamSource::consumeAudio):
2053         * platform/mediastream/MediaStreamSource.h:
2054         (WebCore):
2055         (MediaStreamSource):
2056         (WebCore::MediaStreamSource::requiresAudioConsumer):
2057         (WebCore::MediaStreamSource::audioConsumers):
2058
2059 2012-11-27  Mike West  <mkwst@chromium.org>
2060
2061         Improve WebSocketChannel connection failure console messages.
2062         https://bugs.webkit.org/show_bug.cgi?id=103448
2063
2064         Reviewed by Adam Barth.
2065
2066         When a WebSocket connection fails, the current implementation of
2067         WebSocketChannel::fail binds the generated console message to the
2068         document's URL, but doesn't give much indication as to the connection
2069         itself. This patch adjusts the console message to explicitly show the
2070         URL of the failed connection to give developers a better chance of
2071         debugging and resolving errors.
2072
2073         * Modules/websockets/WebSocketChannel.cpp:
2074         (WebCore::WebSocketChannel::fail):
2075             Drop the URL parameter from addConsoleMessage, in favour of adding
2076             the WebSocketHandshake's URL to the message text.
2077
2078 2012-11-27  Zan Dobersek  <zandobersek@gmail.com>
2079
2080         Unreviewed functionality fix, return the height in ImageFrame::height()
2081         on non-Skia platforms.
2082
2083         * platform/image-decoders/ImageDecoder.h:
2084         (WebCore::ImageFrame::height):
2085
2086 2012-11-27  Viatcheslav Ostapenko  <v.ostapenko@samsung.com>
2087
2088         Optimization in image decoding
2089         https://bugs.webkit.org/show_bug.cgi?id=88424
2090
2091         Reviewed by Brent Fulgham.
2092
2093         Optimization in image decoding.
2094         Reduce branching and multiplications in GIF image decoding loops and functions.
2095         Rebase and update of original patch by Misha Tyutyunik <michael.tyuytunik@nokia.com>
2096
2097         Covered by existing tests.
2098
2099         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2100         (WebCore::GIFImageDecoder::haveDecodedRow):
2101
2102 2012-11-27  Michael Saboff  <msaboff@apple.com>
2103
2104         TextIterator unnecessarily converts 8 bit strings to 16 bits
2105         https://bugs.webkit.org/show_bug.cgi?id=103295
2106
2107         Reviewed by Brent Fulgham.
2108
2109         Changed TextIterator to use the contained string instead of calling characters() on that string.
2110         Other sources of text, like emitCharacter() still use the contained UChar* buffer.
2111         Added appendTextToStringBuilder() to append the text contents of the current iterator to a string builder
2112         irrespective of the source of the text.
2113
2114         No new tests as functionality covered by existing tests.
2115
2116         * WebCore.exp.in: Updated plainText export and eliminated plainTextToMallocAllocatedBuffer export
2117         * accessibility/AccessibilityObject.cpp:
2118         (WebCore::AccessibilityObject::stringForVisiblePositionRange): Updated to use TextIterator::appendTextToStringBuilder()
2119         * editing/TextIterator.cpp:
2120         (WebCore::TextIterator::characterAt): New function to return the indexed character of the current TextIterator
2121         (WebCore::TextIterator::appendTextToStringBuilder): Added method to append whatever the current text to a StringBuilder
2122         (WebCore::TextIterator::emitText): Eliminated accessing the character data via characters().
2123         (WebCore::TextIterator::rangeFromLocationAndLength): Changed to use characterAt().
2124         (WebCore::plainText): Combined with plainTextToMallocAllocatedBuffer().
2125         * editing/TextIterator.h:
2126         (WebCore::TextIterator::startOffset): New getter.
2127         (WebCore::TextIterator::string): New getter.
2128         (WebCore::TextIterator::characters): Updated to use correct test source.
2129         * page/ContextMenuController.cpp:
2130         (WebCore::selectionContainsPossibleWord): Changed to use characterAt().
2131
2132 2012-11-27  Noel Gordon  <noel.gordon@gmail.com>
2133
2134         Inline ImageFrame width() and height()
2135         https://bugs.webkit.org/show_bug.cgi?id=103401
2136
2137         Reviewed by Brent Fulgham.
2138
2139         Inline ImageFrame width() and height() to improve the performance of ImageFrame
2140         function getAddr(x,y) per https://bugs.webkit.org/show_bug.cgi?id=88424#c38
2141
2142         No new tests. Covered by many existing tests.
2143
2144         * platform/image-decoders/ImageDecoder.cpp: Remove width() and height() routines
2145         since they now inlined in the ImageFrame class definition in ImageDecoder.h.
2146         * platform/image-decoders/ImageDecoder.h: Add inline definitions of width() and
2147         height() for all ports.
2148         * platform/image-decoders/skia/ImageDecoderSkia.cpp:
2149         (WebCore::ImageFrame::width): Remove.
2150         (WebCore::ImageFrame::height): Remove.
2151
2152 2012-11-27  Michael Pruett  <michael@68k.org>
2153
2154         Remove ASSERT_NOT_REACHED() from IDBCursorBackendImpl::postSuccessHandlerCallback()
2155         https://bugs.webkit.org/show_bug.cgi?id=103461
2156
2157         Reviewed by Kentaro Hara.
2158
2159         The assertion is applicable only to the Chromium port.
2160
2161         Tests: storage/indexeddb/*
2162
2163         * Modules/indexeddb/IDBCursorBackendImpl.h:
2164         (WebCore::IDBCursorBackendImpl::postSuccessHandlerCallback):
2165
2166 2012-11-27  Shinya Kawanaka  <shinyak@chromium.org>
2167
2168         [Refactoring] HasSelectorForClassStyleFunctor in Element.cpp seems verbose
2169         https://bugs.webkit.org/show_bug.cgi?id=103474
2170
2171         Reviewed by Hajime Morita.
2172
2173         The code introduced in r135174 looks verbose. We would like to make it simpler.
2174         We have removed several inline functions and unnecessary structs.
2175
2176         No new tests, simple refactoring.
2177
2178         * dom/Element.cpp:
2179         (WebCore):
2180         (WebCore::checkSelectorForClassChange):
2181         (WebCore::Element::classAttributeChanged):
2182         (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
2183
2184 2012-11-27  Julien Chaffraix  <jchaffraix@webkit.org>
2185
2186         Support proper <percent> / calc() resolution for grid items
2187         https://bugs.webkit.org/show_bug.cgi?id=102968
2188
2189         Reviewed by Ojan Vafai.
2190
2191         This change introduces a mechanism similar to logical height / width override
2192         but for containing block. This is required as we don't have a renderer for the
2193         grid area but any <percent> or calc() size should be resolved against the grid
2194         area size (which is sized after the grid tracks).
2195
2196         Tests: fast/css-grid-layout/calc-resolution-grid-item.html
2197                fast/css-grid-layout/percent-resolution-grid-item.html
2198                fast/css-grid-layout/percent-grid-item-in-percent-grid-track.html
2199                fast/css-grid-layout/percent-grid-item-in-percent-grid-track-in-percent-grid.html
2200
2201         * rendering/RenderBox.cpp:
2202         (WebCore::RenderBox::willBeDestroyed):
2203         Remove any containing block size override.
2204
2205         (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth):
2206         (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight):
2207         (WebCore::RenderBox::hasOverrideContainingBlockLogicalWidth):
2208         (WebCore::RenderBox::hasOverrideContainingBlockLogicalHeight):
2209         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
2210         (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
2211         (WebCore::RenderBox::clearContainingBlockOverrideSize):
2212         Containing block override size functions.
2213
2214         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
2215         Updated the function to check for any override logical width.
2216
2217         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
2218         New function, similar to RenderBox::containingBlockLogicalWidthForContent.
2219
2220         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
2221         (WebCore::RenderBox::computePercentageLogicalHeight):
2222         Updated these function to return overrideContainingBlockContentLogicalHeight as needed.
2223
2224         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2225         (WebCore::RenderBox::availableLogicalHeightUsing):
2226         Updated these functions to use the new containingBlockLogicalHeightForContent instead
2227         of availableLogicalHeight.
2228
2229         * rendering/RenderBox.h:
2230         Added the previous new functions.
2231
2232         * rendering/RenderGrid.cpp:
2233         (WebCore::RenderGrid::layoutGridItems):
2234         Updated to override the containing block size so that we properly size our grid items.
2235
2236 2012-11-27  Kent Tamura  <tkent@chromium.org>
2237
2238         Fix build errors by r135955.
2239
2240         * dom/ShadowRoot.cpp: Use struct instead of class.
2241         * dom/TreeScope.cpp: Ditto.
2242
2243 2012-11-27  Eugene Klyuchnikov  <eustas@chromium.com>
2244
2245         Web Inspector: [Timeline] "Show CPU activity on the ruler" settings checkbox does not take effect until Inspector restart
2246         https://bugs.webkit.org/show_bug.cgi?id=102210
2247
2248         Reviewed by Pavel Feldman.
2249
2250         The checkbox changes should take effect in the real time.
2251
2252         * inspector/front-end/SettingsScreen.js:
2253         (WebInspector.GenericSettingsTab):
2254         Do not show checkpox if browser is not capable.
2255         * inspector/front-end/TimelinePanel.js:
2256         Added setting change listener.
2257
2258 2012-11-27  Andreas Kling  <akling@apple.com>
2259
2260         Compile time size assertions for TreeScope, ShadowRoot and ElementAttributeData.
2261
2262         Rubber-stamped by Anders Carlsson.
2263
2264         * dom/ShadowRoot.cpp:
2265         (SameSizeAsShadowRoot):
2266         * dom/TreeScope.cpp:
2267         (SameSizeAsTreeScope):
2268         * dom/ElementAttributeData.cpp: Derp.
2269
2270 2012-11-27  James Simonsen  <simonjam@chromium.org>
2271
2272         Consolidate FrameLoader::load() into one function taking a FrameLoadRequest
2273         https://bugs.webkit.org/show_bug.cgi?id=102151
2274
2275         Reviewed by Adam Barth.
2276
2277         There's a FIXME that we have too many FrameLoader::load*() functions. This patch consolidates 3 into 1.
2278         There are still a few more load functions that will be consolidated later. Using FrameLoadRequest as
2279         the interface into FrameLoader will also provide a place to pass in the initiator. Finally, this matches
2280         the refactoring done with CachedResourceRequest and CachedResourceLoader.
2281
2282         No new tests. No change in functionality.
2283
2284         * WebCore.exp.in:
2285         * loader/FrameLoadRequest.h:
2286         (WebCore::FrameLoadRequest::FrameLoadRequest):
2287         (WebCore::FrameLoadRequest::setLockHistory): These are former arguments to load().
2288         (WebCore::FrameLoadRequest::lockHistory): Ditto.
2289         (FrameLoadRequest):
2290         (WebCore::FrameLoadRequest::setShouldCheckNewWindowPolicy): Ditto.
2291         (WebCore::FrameLoadRequest::shouldCheckNewWindowPolicy): Ditto.
2292         (WebCore::FrameLoadRequest::substituteData): Ditto.
2293         (WebCore::FrameLoadRequest::setSubstituteData): Ditto.
2294         (WebCore::FrameLoadRequest::hasSubstituteData): Ditto.
2295         * loader/FrameLoader.cpp:
2296         (WebCore::FrameLoader::load): No change in behavior, just merged it all into one function.
2297         * loader/FrameLoader.h:
2298         (FrameLoader):
2299         * page/DragController.cpp:
2300         (WebCore::DragController::performDrag):
2301
2302 2012-11-27  Jer Noble  <jer.noble@apple.com>
2303
2304         Unreviewed build fix; NSSize is not a CGSize in 32-bit.
2305
2306         * platform/mac/WebCoreFullScreenWarningView.mm:
2307
2308 2012-11-27  Dean Jackson  <dino@apple.com>
2309
2310         Attempted build fix for my last commit. The private member variable
2311         is only used on MAC (at the moment) so guard it with #if PLATFORM.
2312         I did this rather than having another constructor, because I expect
2313         other platforms will follow the MAC code soon.
2314
2315         * html/shadow/MediaControlElements.cpp:
2316         (WebCore::MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCaptionsButtonElement):
2317         * html/shadow/MediaControlElements.h:
2318
2319 2012-11-14  Jer Noble  <jer.noble@apple.com>
2320
2321         Add a new shared class WebCoreFullScreenPlaceholderView, for use in WebKit and WebKit2.
2322         https://bugs.webkit.org/show_bug.cgi?id=102300
2323
2324         Reviewed by Anders Carlsson.
2325
2326         Add a new shared class WebCoreFullScreenPlaceholderView, which presents the contents of the 
2327         WebView prior to full screen with a message informing the user how to exit from full screen mode.
2328
2329         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
2330         (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Create the warning view and set up the placeholder layer.
2331         (-[WebCoreFullScreenPlaceholderView setContents:]): Pass along to content view layer.
2332         (-[WebCoreFullScreenPlaceholderView contents]): Ditto.
2333         (-[WebCoreFullScreenPlaceholderView setExitWarningVisible:]): Show or hide the exit warning.
2334         (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call the target with action.
2335
2336          Add a localized string entry for the "click to exit" text:
2337          * English.lproj/Localizable.strings:
2338         * platform/LocalizedStrings.cpp:
2339         (WebCore::clickToExitFullScreenText):
2340         * platform/LocalizedStrings.h:
2341         * English.lproj/Localizable.strings:
2342
2343         Add the new files to the project and exports list:
2344         * WebCore.exp.in:
2345         * WebCore.xcodeproj/project.pbxproj:
2346
2347 2012-11-27  Andreas Kling  <akling@apple.com>
2348
2349         Shrink ShadowRoot and TreeScope.
2350         <http://webkit.org/b/103459>
2351
2352         Reviewed by Antti Koivisto.
2353
2354         We're creating ~1500 ShadowRoots on Apple's PLT3 content (from <input> and <textarea> elements)
2355         and a lot of this is wasted space.
2356
2357         Shrink ShadowRoot and TreeScope a bit by making TreeScope's DocumentOrderedMaps heap-allocated
2358         and packing the counters on ShadowRoot harder together with the bits.
2359
2360         202kB progression on Membuster3.
2361
2362         * dom/ShadowRoot.cpp:
2363         (WebCore::ShadowRoot::ShadowRoot):
2364         * dom/ShadowRoot.h:
2365         (WebCore::ShadowRoot::countElementShadow):
2366         (ShadowRoot):
2367         * dom/TreeScope.cpp:
2368         (WebCore::TreeScope::TreeScope):
2369         (WebCore::TreeScope::getElementById):
2370         (WebCore::TreeScope::addElementById):
2371         (WebCore::TreeScope::removeElementById):
2372         (WebCore::TreeScope::addImageMap):
2373         (WebCore::TreeScope::removeImageMap):
2374         (WebCore::TreeScope::getImageMap):
2375         (WebCore::TreeScope::addLabel):
2376         (WebCore::TreeScope::removeLabel):
2377         (WebCore::TreeScope::labelElementForId):
2378         * dom/TreeScope.h:
2379         (WebCore::TreeScope::shouldCacheLabelsByForAttribute):
2380         (TreeScope):
2381         (WebCore::TreeScope::hasElementWithId):
2382         (WebCore::TreeScope::containsMultipleElementsWithId):
2383
2384 2012-11-14  Jer Noble  <jer.noble@apple.com>
2385
2386         Add a new shared class WebCoreFullScreenWarningView which presents a styled warning message.
2387         https://bugs.webkit.org/show_bug.cgi?id=102299
2388
2389         Reviewed by Alexey Proskuryakov.
2390
2391         Add a shared implementation of a warning view for use in WebKit and WebKit2.
2392
2393         * platform/mac/WebCoreFullScreenWarningView.h: Added.
2394         * platform/mac/WebCoreFullScreenWarningView.mm: Added.
2395         (-[WebCoreFullScreenWarningView initWithTitle:]): Create the view.
2396
2397         Add the new files to the project and exports list:
2398         * WebCore.exp.in:
2399         * WebCore.xcodeproj/project.pbxproj:
2400
2401 2012-11-27  Dean Jackson  <dino@apple.com>
2402
2403         Make track list control active
2404         https://bugs.webkit.org/show_bug.cgi?id=101670
2405
2406         Reviewed by Eric Carlson.
2407
2408         Hook up the event handler for the captions menu so that it enables or
2409         disables tracks in the associated HTMLMediaElement.
2410
2411         Test: media/video-controls-captions-trackmenu.html
2412
2413         * html/HTMLMediaElement.cpp:
2414         (WebCore::HTMLMediaElement::toggleTrackAtIndex): New method to toggle the state of a track, by index.
2415         * html/HTMLMediaElement.h:
2416         (HTMLMediaElement): Ditto.
2417         (WebCore::HTMLMediaElement::textTracksOffIndex): Static method to return the "Off" value.
2418         * html/shadow/MediaControlElements.cpp:
2419         (WebCore::trackListIndexForElement): Helper function to take a track list <li> element and return the value of the custom attribute.
2420         (WebCore::MediaControlToggleClosedCaptionsButtonElement::updateDisplayType): Toggle the state of the button based on captions visibility.
2421         (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler): On Mac platforms show the captions menu. On other platforms, toggle captions.
2422         (WebCore::MediaControlClosedCaptionsTrackListElement::MediaControlClosedCaptionsTrackListElement): Now has a reference to the controls.
2423         (WebCore::MediaControlClosedCaptionsTrackListElement::create):
2424         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler): When the user clicks on a track list item, look
2425         for the custom attribute that identifies the associated track, and then toggle that track.
2426         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay): Set a class on the track list elements so they can be
2427         styled by the injected CSS (with tick marks to represent visibility).
2428         (WebCore::MediaControlClosedCaptionsTrackListElement::resetTrackListMenu): When building the list of track menu items, add
2429         a custom HTML attribute to the element so that the corresponding track can be found in the event handler.
2430         * html/shadow/MediaControlElements.h:
2431         (MediaControlClosedCaptionsTrackListElement): Add a list of elements representing the track list.
2432         * html/shadow/MediaControlsApple.cpp:
2433         (WebCore::MediaControlsApple::createControls):
2434         (WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Make sure to update the track menu.
2435         (WebCore::MediaControlsApple::reset):
2436         * html/shadow/MediaControlsApple.h:
2437         (MediaControlsApple):
2438
2439 2012-11-27  Joshua Bell  <jsbell@chromium.org>
2440
2441         IndexedDB: Simplify transaction timers and event tracking
2442         https://bugs.webkit.org/show_bug.cgi?id=102984
2443
2444         Reviewed by Tony Chang.
2445
2446         Now that the transaction "commit" decision is made on the front-end, the back end no-longer
2447         needs to be aware of when individual IDBRequests have dispatched to script or track pending
2448         events (except for preemptive ones like createIndex). This also lets two timers be collapsed
2449         into one which significantly simplifies the code flow in IDBTransactionBackendImpl.
2450
2451         No new tests - just simplification. Exercised by storage/indexeddb/transaction-*.html etc.
2452
2453         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
2454         (WebCore::IDBCursorBackendImpl::prefetchContinueInternal): No more tracking.
2455         (WebCore::IDBCursorBackendImpl::prefetchReset): No more tracking.
2456         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2457         (WebCore::IDBDatabaseBackendImpl::createObjectStoreInternal): No more tracking.
2458         (WebCore::IDBDatabaseBackendImpl::deleteObjectStoreInternal): No more tracking.
2459         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
2460         (WebCore::IDBObjectStoreBackendImpl::setIndexesReadyInternal): No more tracking.
2461         (WebCore::IDBObjectStoreBackendImpl::createIndexInternal): No more tracking.
2462         (WebCore::IDBObjectStoreBackendImpl::deleteIndexInternal): No more tracking.
2463         * Modules/indexeddb/IDBRequest.cpp:
2464         (WebCore::IDBRequest::dispatchEvent): Order must be:
2465         1. request is unregistered from transaction (so request list may be empty)
2466         2. abort transaction if event being dispatched was an error
2467         3. deactivate transaction (which may commit if #1 left it empty and #2 didn't abort)
2468         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
2469         (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl): Need to track if commit
2470         was requested; previously the front end would have triggered an event timer which, on
2471         completion, would be the signal that the front end was finished.
2472         (WebCore::IDBTransactionBackendImpl::scheduleTask): Schedule a timer to service the new
2473         task, if necessary.
2474         (WebCore::IDBTransactionBackendImpl::abort):
2475         (WebCore::IDBTransactionBackendImpl::hasPendingTasks):
2476         (WebCore::IDBTransactionBackendImpl::commit):
2477         (WebCore::IDBTransactionBackendImpl::taskTimerFired): Picks up "commit" responsibilities
2478         from the now deleted taskEventTimerFired, if everything is truly complete done.
2479         * Modules/indexeddb/IDBTransactionBackendImpl.h:
2480         (IDBTransactionBackendImpl):
2481         * Modules/indexeddb/IDBTransactionBackendInterface.h:
2482         (WebCore::IDBTransactionBackendInterface::didCompleteTaskEvents): Removed from interface.
2483
2484 2012-11-27  Kentaro Hara  <haraken@chromium.org>
2485
2486         [V8] Replace toWebCoreString()/toWebCoreAtomicString() in CodeGeneratorV8.pm with V8StringResource
2487         https://bugs.webkit.org/show_bug.cgi?id=103391
2488
2489         Reviewed by Adam Barth.
2490
2491         This is an incremental effort for fixing bug 103331.
2492         I confirmed that this patch causes no performance regression
2493         for the micro benchmarks (https://bugs.webkit.org/attachment.cgi?id=176178).
2494
2495         No tests. No change in behavior.
2496
2497         * bindings/scripts/CodeGeneratorV8.pm:
2498         (GenerateNormalAttrSetter):
2499         (GenerateEventListenerCallback):
2500         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
2501         (WebCore::TestEventTargetV8Internal::addEventListenerCallback):
2502         (WebCore::TestEventTargetV8Internal::removeEventListenerCallback):
2503         * bindings/scripts/test/V8/V8TestObj.cpp:
2504         (WebCore::TestObjV8Internal::addEventListenerCallback):
2505         (WebCore::TestObjV8Internal::removeEventListenerCallback):
2506
2507 2012-11-27  Alexandru Chiculita  <achicu@adobe.com>
2508
2509         [CSS Regions] Elements using transforms are not repainted correctly when rendered in a region
2510         https://bugs.webkit.org/show_bug.cgi?id=102826
2511
2512         Reviewed by David Hyatt.
2513
2514         When the page is composited, all the elements will have a composited repaint container. In that case we will
2515         never catch the repaints in the RenderFlowThread, but they will go directly to the RenderView. 
2516         There's a single case when the parent composited layer of an element inside the RenderFlowThread will get 
2517         its own repaints. That case only happens when the parent composited layer is also part of the same flow thread.
2518         Right now compositing is disabled for elements inside the RenderFlowThread, so that case doesn't even happen yet.
2519         That will be fixed in https://bugs.webkit.org/show_bug.cgi?id=84900.
2520
2521         Test: fast/repaint/region-painting-in-composited-view.html
2522
2523         * rendering/RenderObject.cpp:
2524         (WebCore::RenderObject::containerForRepaint):
2525
2526 2012-11-27  Tony Chang  <tony@chromium.org>
2527
2528         Unreviewed, win compile fix take 2.
2529
2530         Try again to force this file to recompile.
2531
2532         * rendering/RenderingAllInOne.cpp:
2533
2534 2012-11-27  Tony Chang  <tony@chromium.org>
2535
2536         Unreviewed, win compile fix.
2537
2538         Touch RenderingAllInOne.cpp to force it to rebuild.
2539
2540         * rendering/RenderingAllInOne.cpp:
2541
2542 2012-11-27  Tim Horton  <timothy_horton@apple.com>
2543
2544         PDFPlugin: Scroll bars do not grow on hover
2545         https://bugs.webkit.org/show_bug.cgi?id=103382
2546         <rdar://problem/12555262>
2547
2548         Reviewed by Beth Dakin.
2549
2550         Export a few WebCore::Scrollbar methods to WebKit(2).
2551
2552         * WebCore.exp.in:
2553
2554 2012-11-27  Tom Sepez  <tsepez@chromium.org>
2555
2556         Regression(r129406): Fix the scope of the WidgetHierarchyUpdateSuspensionScope in Element::Attach().
2557         https://bugs.webkit.org/show_bug.cgi?id=100803
2558
2559         Reviewed by Abhishek Arya.
2560
2561         Ensures that the suspension scope has gone out of scope before calling into
2562         resumePostAttachCallbacks().
2563         
2564         Test: fast/dom/adopt-node-crash-2.html
2565
2566         * dom/Element.cpp:
2567         (WebCore::Element::attach):
2568
2569 2012-11-27  Tony Chang  <tony@chromium.org>
2570
2571         Remove hidden limiter div in the input slider shadow DOM
2572         https://bugs.webkit.org/show_bug.cgi?id=102993
2573
2574         Reviewed by Ojan Vafai.
2575
2576         The shadow DOM for input sliders would have a hidden div (the TrackLimiterElement)
2577         the size of the thumb which would limit the position of thumb since the width of
2578         the thumb takes up space in the track. This patch simplifies the shadow DOM by
2579         removing this hidden div and computing the position of the thumb taking the size of
2580         the thumb into account.
2581
2582         No new tests, covered by existing tests in fast/forms.
2583
2584         * css/mediaControlsChromium.css:
2585         (input[type="range"]::-webkit-media-slider-container > div): We were depending on the behavior of the limiter having negative margins, causing the slider div
2586         to overflow. Moving the negative margin to the slider produces the same effect.
2587         * css/mediaControlsChromiumAndroid.css:
2588         (input[type="range"]::-webkit-media-slider-container > div): Ditto.
2589         * html/RangeInputType.cpp:
2590         (WebCore::RangeInputType::createShadowSubtree): Remove limiter div.
2591         * html/shadow/SliderThumbElement.cpp:
2592         (WebCore::RenderSliderContainer::layout): Adjust the available space for the thumb and correctly position in the vertical case.
2593         (WebCore::SliderThumbElement::setPositionFromPoint): Adjust the usable track size and simplify RTL code (no need to account for the limiter).
2594         (WebCore): Delete limiter code.
2595         * html/shadow/SliderThumbElement.h:
2596         (WebCore): Delete limiter code.
2597         * rendering/RenderSlider.cpp:
2598         (WebCore::RenderSlider::layout): Delete limiter code.
2599         * rendering/RenderTheme.cpp:
2600         (WebCore::RenderTheme::paintSliderTicks): Simplify code for painting tick marks.
2601
2602 2012-11-27  Alpha Lam  <hclam@chromium.org>
2603
2604         [chromium] Implement full-featured image cache
2605         https://bugs.webkit.org/show_bug.cgi?id=99784
2606
2607         Reviewed by Stephen White.
2608
2609         Implement a thread-safe image cache to be used with deferred image
2610         decoding. Image cache can now be accessed on any thread.
2611
2612         The patch implements the following logic:
2613         1. Mutex to protect all cache operations.
2614         2. Cache indexing using key (ImageFrameGenerator*, SkISize scaledSize)
2615         3. Cache lookup.
2616         4. Cache insertion.
2617         5. Generation of cache entry by scaling full size image.
2618         6. Generation of cache entries by decoding and scaling.
2619
2620         Classes involved:
2621
2622         ImageDecodingStore
2623
2624         Responsible for owning cache entries and indexing. Pruning and memory
2625         management will be added later.
2626
2627         ImageFrameGenerator
2628
2629         Responsible for generating new cache enties and insert them into
2630         ImageDecodingStore.
2631
2632         LazyDecodingPixelRef
2633
2634         Responsible for cache lookup and lazy generation of cache entries
2635         using ImageFrameGenerator. There is a mutex to protect concurrent
2636         lock operations.
2637
2638         These items are not implemented in this patch:
2639         1. Cache pruning.
2640         2. Setting cache memory limit.
2641         3. Cache deletion.
2642         4. Caching incomplete images and ImageDecoder.
2643
2644         Unit tests added in ImageFrameGeneratorTest.cpp.
2645         Layout tests are under platform/chromium/virtual/fast/images.
2646
2647         * platform/graphics/chromium/DeferredImageDecoder.cpp:
2648         (WebCore::DeferredImageDecoder::~DeferredImageDecoder):
2649         (WebCore::DeferredImageDecoder::createResizedLazyDecodingBitmap):
2650         (WebCore::DeferredImageDecoder::setEnabled):
2651         (WebCore):
2652         (WebCore::DeferredImageDecoder::frameBufferAtIndex):
2653         (WebCore::DeferredImageDecoder::createLazyDecodingBitmap):
2654         * platform/graphics/chromium/DeferredImageDecoder.h:
2655         (DeferredImageDecoder):
2656         * platform/graphics/chromium/ImageDecodingStore.cpp:
2657         (WebCore::ImageDecodingStore::instance):
2658         (WebCore::ImageDecodingStore::initializeOnce):
2659         (WebCore::ImageDecodingStore::shutdown):
2660         (WebCore::ImageDecodingStore::lockCompleteCache):
2661         Lookup complete cache entry using hash key, increment use count.
2662         (WebCore::ImageDecodingStore::lockIncompleteCache): TODO.
2663         (WebCore::ImageDecodingStore::unlockCache):
2664         Lookup cache entry using hash key, decrement use count.
2665         (WebCore):
2666         (WebCore::ImageDecodingStore::insertAndLockCache):
2667         Insert new cache entry and increment use count.
2668         (WebCore::ImageDecodingStore::prune): TODO.
2669         * platform/graphics/chromium/ImageDecodingStore.h:
2670         (WebCore):
2671         (ImageDecodingStore):
2672         (WebCore::ImageDecodingStore::CacheEntry::create):
2673         (WebCore::ImageDecodingStore::CacheEntry::createAndUse):
2674         (CacheEntry):
2675         (WebCore::ImageDecodingStore::CacheEntry::CacheEntry):
2676         (WebCore::ImageDecodingStore::CacheEntry::~CacheEntry):
2677         * platform/graphics/chromium/ImageFrameGenerator.cpp:
2678         (WebCore::ImageFrameGenerator::ImageFrameGenerator):
2679         (WebCore::ImageFrameGenerator::setData):
2680         (WebCore::ImageFrameGenerator::decodeAndScale):
2681         Method for creating new cache entries. This is protected by a mutex
2682         to prevent concurrent operations. Which means only one thread can
2683         generate new cache entries for a set of encoded data.
2684         (WebCore):
2685         (WebCore::ImageFrameGenerator::tryToLockCache):
2686         Tries to lookup a cache entry.
2687         (WebCore::ImageFrameGenerator::tryToScale):
2688         Tries to lookup a full size cache entry and generate a scaled version.
2689         (WebCore::ImageFrameGenerator::tryToDecodeAndScale):
2690         Tries to decode and scale.
2691         * platform/graphics/chromium/ImageFrameGenerator.h:
2692         (WebCore):
2693         (ImageDecoderFactory):
2694         (WebCore::ImageFrameGenerator::create):
2695         (ImageFrameGenerator):
2696         (WebCore::ImageFrameGenerator::setImageDecoderFactoryForTesting):
2697         * platform/graphics/chromium/LazyDecodingPixelRef.cpp:
2698         (WebCore::LazyDecodingPixelRef::LazyDecodingPixelRef):
2699         (WebCore::LazyDecodingPixelRef::onLockPixels):
2700         (WebCore::LazyDecodingPixelRef::onUnlockPixels):
2701         * platform/graphics/chromium/LazyDecodingPixelRef.h:
2702         (WebCore):
2703         (LazyDecodingPixelRef):
2704         * platform/graphics/chromium/ScaledImageFragment.cpp:
2705         (WebCore::ScaledImageFragment::ScaledImageFragment):
2706         * platform/graphics/chromium/ScaledImageFragment.h:
2707         (WebCore):
2708         (WebCore::ScaledImageFragment::create):
2709         (ScaledImageFragment):
2710         (WebCore::ScaledImageFragment::scaledSize):
2711         * platform/graphics/chromium/SkSizeHash.h: Added.
2712         (WTF):
2713
2714 2012-11-27  Mike West  <mkwst@chromium.org>
2715
2716         Expanding variable names in ConsoleMessage.
2717         https://bugs.webkit.org/show_bug.cgi?id=103436
2718
2719         Reviewed by Adam Barth.
2720
2721         Variable names like 'm' should be replaced with full words, like
2722         'myOhMyThisIsAnAwesomeVariable' (or something more descriptive).
2723
2724         * inspector/ConsoleMessage.cpp:
2725         (WebCore::ConsoleMessage::ConsoleMessage):
2726         * inspector/ConsoleMessage.h:
2727         (ConsoleMessage):
2728
2729 2012-11-27  Aaron Colwell  <acolwell@chromium.org>
2730
2731         Use-after-free in media player handling
2732         https://bugs.webkit.org/show_bug.cgi?id=103426
2733
2734         Reviewed by Eric Carlson.
2735
2736         Fixed use-after-free bugs caused by the MediaSource not being closed before the HTMLMediaElement or the MediaPlayer
2737         is destroyed. Closing the MediaSource causes it to clear its reference to the MediaPlayer which prevents
2738         the use-after-free problems from happening.
2739
2740         Test: http/tests/media/media-source/video-media-source-closed-on-htmlmediaelement-destruction.html
2741
2742         * html/HTMLMediaElement.cpp:
2743         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2744         (WebCore::HTMLMediaElement::clearMediaPlayer):
2745
2746 2012-11-27  David Grogan  <dgrogan@chromium.org>
2747
2748         IndexedDB: Remove IDBDatabase.setVersion API
2749         https://bugs.webkit.org/show_bug.cgi?id=94972
2750
2751         Reviewed by Tony Chang.
2752
2753         This has been out of the spec for over a year. No other browser has
2754         implemented it for close to a year.
2755
2756         Tests - removed.html
2757
2758         * Modules/indexeddb/IDBCallbacks.h:
2759         (IDBCallbacks):
2760         * Modules/indexeddb/IDBDatabase.cpp:
2761         (WebCore::IDBDatabase::IDBDatabase):
2762         * Modules/indexeddb/IDBDatabase.h:
2763         (IDBDatabase):
2764         * Modules/indexeddb/IDBDatabase.idl:
2765         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
2766         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
2767         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
2768         (IDBDatabaseBackendImpl):
2769         * Modules/indexeddb/IDBDatabaseBackendInterface.h:
2770         (IDBDatabaseBackendInterface):
2771         * Modules/indexeddb/IDBRequest.cpp:
2772         * Modules/indexeddb/IDBRequest.h:
2773
2774 2012-11-27  Mike West  <mkwst@chromium.org>
2775
2776         Log to console when autofocus is blocked by sandbox attribute.
2777         https://bugs.webkit.org/show_bug.cgi?id=103255
2778
2779         Reviewed by Ojan Vafai.
2780
2781         Adding a short log message when autofocus is blocked by a document's
2782         sandbox flags, as it's currently a black box.
2783
2784         Test: fast/forms/autofocus-in-sandbox-without-allow-scripts.html
2785
2786         * html/HTMLFormControlElement.cpp:
2787         (WebCore::shouldAutofocus):
2788
2789 2012-11-27  Dean Jackson  <dino@apple.com>
2790
2791         Attempted build fix after http://trac.webkit.org/changeset/135888.
2792
2793         * WebCore.exp.in:
2794         * WebCore.order:
2795
2796 2012-11-27  Ryosuke Niwa  <rniwa@webkit.org>
2797
2798         Build fix after r135890. #else, not #elif.
2799
2800         * platform/graphics/ca/PlatformCALayer.h:
2801         (PlatformCALayer):
2802
2803 2012-11-27  Ryosuke Niwa  <rniwa@webkit.org>
2804
2805         HTMLCollection on Document should be stored on NodeListsNodeData like other HTMLCollections and LiveNodeLists
2806         https://bugs.webkit.org/show_bug.cgi?id=103364
2807
2808         Reviewed by Anders Carlsson.
2809
2810         Replaced the HTMLCollection storage in Document by NodeListsNodeData used by other HTMLCollection's
2811         and LiveNodeList's. Now NodeListsNodeData is the only storage for HTMLCollection and LiveNodeList.
2812
2813         * dom/Document.cpp:
2814         (WebCore::Document::Document): Removed code for m_collection since it has been removed.
2815         (WebCore::Document::~Document): Ditto.
2816         (WebCore::Document::registerNodeList): Renamed. 
2817         (WebCore::Document::unregisterNodeList): Ditto.
2818         (WebCore::Document::ensureCachedCollection): Renamed from cachedCollection to match the convetion
2819         used elsewhere. Also use NodeListNodeData::addCacheWithAtomicName now that m_collection is gone.
2820         (WebCore::Document::images):
2821         (WebCore::Document::applets):
2822         (WebCore::Document::embeds):
2823         (WebCore::Document::plugins):
2824         (WebCore::Document::scripts):
2825         (WebCore::Document::links):
2826         (WebCore::Document::forms):
2827         (WebCore::Document::anchors):
2828         (WebCore::Document::all):
2829         (WebCore::Document::windowNamedItems): Use addCacheWithAtomicName.
2830         (WebCore::Document::documentNamedItems): Ditto.
2831         (WebCore::Document::reportMemoryUsage): Removed code for m_collection since it has been removed.
2832         * dom/Document.h:
2833         (WebCore::Document): Removed m_collections, m_documentNamedItemCollections, and
2834         m_windowNamedItemCollections.
2835         * dom/Element.cpp:
2836         (WebCore::Element::ensureCachedHTMLCollection): Merged ElementRareData::ensureCachedHTMLCollection.
2837         (WebCore::Element::cachedHTMLCollection): Merged ElementRareData::cachedHTMLCollection.
2838         * Source/WebCore/dom/ElementRareData.h: Removed ensureCachedHTMLCollection, cachedHTMLCollection,
2839         and removeCachedHTMLCollection since they're no longer used.
2840         * dom/LiveNodeList.h:
2841         (WebCore::LiveNodeListBase::LiveNodeListBase): Call registerNodeList now that LiveNodeList
2842         and HTMLCollection share the same storage in all nodes.
2843         (WebCore::LiveNodeListBase::~LiveNodeListBase): Ditto about unregisterNodeList.
2844         (WebCore::LiveNodeList): Removed the calls to registerNodeList and unregisterNodeList since they
2845         are now called in the base class.
2846         * dom/NameNodeList.h:
2847         (WebCore::NameNodeList::create):
2848         * dom/NodeRareData.h:
2849         (WebCore::NodeListsNodeData::addCacheWithAtomicName): Pass in CollectionType as the second argument
2850         to T::create. This is used in HTMLNameCollection::create. Sevearl LiveNodeList constructors and
2851         create functions have been modified to support this.
2852         (WebCore::NodeListsNodeData::adoptTreeScope):
2853         (WebCore::NodeListsNodeData::namedNodeListKey): CollectionType is no longer restricted in its range.
2854         * dom/TagNodeList.h:
2855         (WebCore::TagNodeList::create):
2856         (WebCore::HTMLTagNodeList::create):
2857         * html/CollectionType.h: Deleted a bunch of unused inline functions and constants, and cleanup enum.
2858         * html/HTMLCollection.cpp:
2859         (WebCore::HTMLCollection::HTMLCollection): Removed the call to registerNodeListCache since it's called
2860         in LiveNodeListBase now.
2861         (WebCore::HTMLCollection::~HTMLCollection): Ditto. Also replaced calls to removeCachedHTMLCollection
2862         of Element and Document by a call to NodeListsNodeData::removeCacheWithAtomicName.
2863         * html/HTMLFormControlsCollection.cpp:
2864         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
2865         (WebCore::HTMLFormControlsCollection::create):
2866         * html/HTMLFormControlsCollection.h:
2867         (HTMLFormControlsCollection):
2868         * html/HTMLNameCollection.cpp:
2869         (WebCore::HTMLNameCollection::HTMLNameCollection):
2870         (WebCore::HTMLNameCollection::~HTMLNameCollection):
2871         * html/HTMLNameCollection.h:
2872         (WebCore::HTMLNameCollection::create):
2873         (HTMLNameCollection):
2874         * html/HTMLOptionsCollection.cpp:
2875         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2876         (WebCore::HTMLOptionsCollection::create):
2877         * html/HTMLOptionsCollection.h:
2878         (HTMLOptionsCollection):
2879         * html/HTMLTableRowsCollection.cpp:
2880         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
2881         (WebCore::HTMLTableRowsCollection::create):
2882         * html/HTMLTableRowsCollection.h:
2883         (HTMLTableRowsCollection):
2884         * html/LabelsNodeList.h:
2885         (WebCore::LabelsNodeList::create):
2886         * html/RadioNodeList.h:
2887         (WebCore::RadioNodeList::create):
2888
2889 2012-11-27  Pravin D  <pravind.2k4@gmail.com>
2890
2891         max-height property not respected in case of tables
2892         https://bugs.webkit.org/show_bug.cgi?id=98633
2893
2894         Reviewed by Julien Chaffraix.
2895
2896         The max-height property determines the maximum computed height an element can have. In case of tables
2897         the computed height was not being limited by the max-height property. The current patch fixes the same.
2898
2899         Test: fast/table/css-table-max-height.html
2900
2901         * rendering/RenderTable.cpp:
2902         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2903           Helper function to compute height from the given style height.
2904           This function handles style height of type fixed, percent and viewport percent.
2905           As height of type 'calculated' gets internally resolved to either fixed or percent
2906           there is no special handling required for the same.
2907
2908         (WebCore):
2909         (WebCore::RenderTable::layout):
2910           Logic to compute the logical height of an element such that it does not exceed the max-height value given that
2911           min-width < Content height < max-height, when min-height < max-height.
2912           However max-height value is not respected if either min-height > max-height or Content height > max-height.
2913
2914         * rendering/RenderTable.h:
2915         (RenderTable):
2916           Function definition for the newly add function convertStyleLogicalHeightToComputedHeight().
2917
2918 2012-11-27  Roger Fong  <roger_fong@apple.com>
2919
2920         Windows specific implementation of usesTileCacheLayer needed after r133056.
2921         https://bugs.webkit.org/show_bug.cgi?id=103321
2922
2923         Reviewed by Simon Fraser.
2924
2925         After r133056 it no longer suffices to use the existing usesTileCacheLayer method on Windows.
2926         The change resulted in 3 crashing tests:
2927         compositing/rotated-tiled-clamped
2928         compositing/rotated-tiled-preserve3d-clamped
2929         fast/events/tabindex-focus-blur-all
2930
2931         * platform/graphics/ca/PlatformCALayer.h:
2932         (WebCore::PlatformCALayer::usesTileCacheLayer):
2933         (PlatformCALayer): 
2934         Adding in platform specific method for Windows that returns false for this method.
2935
2936 2012-11-27  Christophe Dumez  <christophe.dumez@intel.com>
2937
2938         Canvas does not draw any text if the font is not fully loaded yet
2939         https://bugs.webkit.org/show_bug.cgi?id=103392
2940
2941         Reviewed by Kenneth Rohde Christiansen.
2942
2943         Update CanvasRenderingContext2D::drawTextInternal() so that the
2944         text is being drawn, even if custom fonts are still being loaded.
2945         Without this, WebKit was not drawing any text on the canvas if
2946         the needed font is custom and is not fully loaded yet. This seems
2947         broken.
2948
2949         The new behavior is according to specification:
2950         http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
2951
2952         The specification says: "If a font is used before it is fully
2953         loaded, or if the font style source object does not have that
2954         font in scope at the time the font is to be used, then it must be
2955         treated as if it was an unknown font, falling back to another as
2956         described by the relevant CSS specifications."
2957
2958         Test: http/tests/canvas/canvas-slow-font-loading.html
2959
2960         * html/canvas/CanvasRenderingContext2D.cpp:
2961         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2962         * platform/graphics/Font.cpp:
2963         (WebCore::Font::drawText): Add argument to specify the behavior
2964         when custom fonts are not ready. By default, it will not draw
2965         anything (same behavior as before). However, the Canvas code
2966         can now request that a fallback font is used if the custom
2967         font is not fully loaded yet.
2968         * platform/graphics/Font.h: #undef Complex if defined to avoid
2969         conflicting with Complex value in CodePath enum. X11/X.h is
2970         defining Complex to 0.
2971         * platform/graphics/GraphicsContext.cpp:
2972         (WebCore::GraphicsContext::drawBidiText):
2973         * platform/graphics/GraphicsContext.h:
2974         (WebCore):
2975         (GraphicsContext):
2976
2977 2012-11-27  Dean Jackson  <dino@apple.com>
2978
2979         No need for ExceptionCode in HTMLMediaElement::load
2980         https://bugs.webkit.org/show_bug.cgi?id=103438
2981
2982         Reviewed by Eric Carlson.
2983
2984         After https://bugs.webkit.org/show_bug.cgi?id=103318, there is no
2985         need for the ExceptionCode parameter in load(). The HTML5 spec says
2986         that all errors in loading are communicated via state.
2987         http://dev.w3.org/html5/spec/media-elements.html#dom-media-load
2988
2989         Of the 29 tests exercising load(), none of them were exercising
2990         exceptions (obviously).
2991
2992         * html/HTMLMediaElement.cpp:
2993         (WebCore::HTMLMediaElement::load):
2994         (WebCore::HTMLMediaElement::resume):
2995         * html/HTMLMediaElement.h:
2996         * html/HTMLMediaElement.idl:
2997
2998 2012-11-27  Robert Hogan  <robert@webkit.org>
2999
3000         REGRESSION (r125578): word-wrapping in absolute position with nbsp, word-spacing and custom font
3001         https://bugs.webkit.org/show_bug.cgi?id=101443
3002
3003         Reviewed by David Hyatt.
3004
3005         Leading non-breaking space in a text run should always get word-spacing applied. When RenderText
3006         calculates the preferred with of a run of text it breaks it up into word segments that contain
3007         no breaking spaces and calculates the width of each. So when calculating the width of '&nbsp;b' 
3008         it needs to add word-spacing to the leading non-breaking space as it does not get collapsed away.
3009
3010         Test: fast/text/word-space-nbsp.html
3011
3012         * platform/graphics/WidthIterator.cpp:
3013         (WebCore::WidthIterator::advanceInternal):
3014
3015 2012-11-27  Yong Li  <yoli@rim.com>
3016
3017         [BlackBerry] EventLoop should end when WebKit thread is exiting
3018         https://bugs.webkit.org/show_bug.cgi?id=103301
3019
3020         Reviewed by Rob Buis.
3021         RIM PR# 194379.
3022         Internally reviewed by Joe Mason.
3023
3024         Break the nested event loop when WebKit thread has been asked to quit.
3025
3026         * platform/blackberry/EventLoopBlackBerry.cpp:
3027         (WebCore::EventLoop::cycle):
3028
3029 2012-11-27  Pratik Solanki  <psolanki@apple.com>
3030
3031         objc/objc-runtime.h does not exist on all PLATFORM(MAC)
3032         https://bugs.webkit.org/show_bug.cgi?id=101780
3033
3034         Reviewed by Brent Fulgham.
3035
3036         Clean up header includes so we don't include objc/objc-runtime.h.
3037
3038         No new tests because no functional changes.
3039
3040         * bridge/objc/objc_header.h:
3041         * page/mac/EventHandlerMac.mm:
3042         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3043         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3044         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3045         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3046         * platform/graphics/mac/WebLayer.mm:
3047         * platform/mac/WebCoreObjCExtras.mm:
3048         * platform/mac/WebVideoFullscreenController.mm:
3049
3050 2012-11-27  Eberhard Graether  <egraether@google.com>
3051
3052         Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
3053         https://bugs.webkit.org/show_bug.cgi?id=102452
3054
3055         Reviewed by Pavel Feldman.
3056
3057         This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
3058         when changed. And the default paint rects drawing is not used if an alternative is available.
3059         This allows Chromium to draw the paint rects in the compositor's HUDLayer.
3060
3061         No new tests.
3062
3063         * inspector/InspectorClient.h:
3064         (WebCore::InspectorClient::overridesShowPaintRects):
3065         (WebCore::InspectorClient::setShowPaintRects):
3066         (InspectorClient):
3067         * inspector/InspectorPageAgent.cpp:
3068         (PageAgentState):
3069         (WebCore::InspectorPageAgent::restore):
3070         (WebCore::InspectorPageAgent::disable):
3071         (WebCore::InspectorPageAgent::setShowPaintRects):
3072         (WebCore::InspectorPageAgent::didPaint):
3073
3074 2012-11-27  Allan Sandfeld Jensen  <allan.jensen@digia.com>
3075
3076         Unreviewed cleanup.
3077
3078         Remove leftover file that was replaced by PlatformScreenQt.cpp 4 years ago.
3079
3080         * platform/qt/ScreenQt.cpp: Removed.
3081
3082 2012-11-27  Istiaque Ahmed  <lazyboy@chromium.org>
3083
3084         freeV8NPObject: Skip trying to remove object from per context data's ObjectMap if the object does not exist in the map.
3085         https://bugs.webkit.org/show_bug.cgi?id=103356
3086
3087         Reviewed by Adam Barth.
3088
3089         Before introducing per context data, it used to be the case that we would ignore removing v8 object
3090         from context data's map if we couldn't find it. With perContextData change, this turned into an ASSERT
3091         instead and we had crash reports.
3092         Related crbug.com/154462.
3093
3094         Test: platform/chromium/plugins/release-frame-content-window.html
3095
3096         * bindings/v8/NPV8Object.cpp:
3097         (WebCore::freeV8NPObject):
3098
3099 2012-11-27  Marja Hölttä  <marja@chromium.org>
3100
3101         Add callbacks to the FrameLoaderClient when a resource is requested
3102         https://bugs.webkit.org/show_bug.cgi?id=92761
3103
3104         Reviewed by Adam Barth.
3105
3106         In Chromium, when an extension script cancels a network
3107         request (which happens out of process), we'd like to
3108         notify content scripts running on the current page about
3109         which elements failed to load because the requests were
3110         cancelled (as opposed to e.g. the network request just
3111         didn't work). Since the resource request itself does not
3112         carry any information what DOM element is was made for,
3113         currently a content script has to search the DOM tree and
3114         guess which requests will be cancelled by its counter
3115         part. By adding these callbacks, the embedder can make
3116         this connection explictly.
3117
3118         Test: platform/chromium/fast/loader/resource-request-callbacks.html
3119
3120         * loader/FrameLoaderClient.h:
3121         (WebCore):
3122         (WebCore::FrameLoaderClient::dispatchWillRequestResource):
3123         (FrameLoaderClient):
3124         * loader/cache/CachedResourceLoader.cpp:
3125         (WebCore::CachedResourceLoader::requestResource):
3126
3127 2012-11-27  Dean Jackson  <dino@apple.com>
3128
3129         Unreviewed build fix for r135866.
3130
3131         * html/HTMLMediaElement.cpp:
3132         (WebCore::HTMLMediaElement::load):
3133
3134 2012-11-27  Leo Yang  <leoyang@rim.com>
3135
3136         [BlackBerry] Adapt to the change of BlackBerry::Platform::FilterStream::notifyHeadersReceived
3137         https://bugs.webkit.org/show_bug.cgi?id=103425
3138
3139         Reviewed by Yong Li.
3140
3141         A const has been added for HeaderList parameter of BlackBerry::Platform::FilterStream::notifyHeadersReceived.
3142         The patch is adapting to this change.
3143
3144         No functionalities changed no new tests.
3145
3146         * platform/network/blackberry/NetworkJob.cpp:
3147         (WebCore::NetworkJob::notifyHeadersReceived):
3148         * platform/network/blackberry/NetworkJob.h:
3149         (NetworkJob):
3150         * platform/network/blackberry/rss/RSSFilterStream.cpp:
3151         (WebCore::RSSFilterStream::notifyHeadersReceived):
3152         * platform/network/blackberry/rss/RSSFilterStream.h:
3153
3154 2012-11-27  Min Qin  <qinmin@chromium.org>
3155
3156         Don't throw an exception if user gesture is required for load
3157         https://bugs.webkit.org/show_bug.cgi?id=103318
3158
3159         Reviewed by Eric Carlson.
3160
3161         There is no need to throw an exception if media load requires user gesture.
3162         Since chrome does not render the poster and media control after an exception is thrown, throwing an exception may break a lot of sites on android.
3163         Change a current test to match the new behavior: media/video-load-require-user-gesture.html
3164
3165         * html/HTMLMediaElement.cpp:
3166         (WebCore::HTMLMediaElement::load):
3167
3168 2012-11-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3169
3170         [GStreamer] Verify if GStreamer was previously initialized
3171         https://bugs.webkit.org/show_bug.cgi?id=103151
3172
3173         Reviewed by Philippe Normand.
3174
3175         This patch calls gst_is_initialized() before calling gst_init_check()
3176         in order to verify if GStreamer has not been initialized before.
3177
3178         This is useful particularly for WebKit1 so the applications could
3179         initialize GStreamer before.
3180
3181         As the API call was added in GStreamer v0.10.31, the patch fences the
3182         call only in that version of GStreamer or above.
3183
3184         No new tests, existing media tests cover this change.
3185
3186         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
3187         (WebCore::initializeGStreamer):
3188
3189 2012-11-27  Kentaro Hara  <haraken@chromium.org>
3190
3191         [V8] Remove V8StringResource::m_string
3192         https://bugs.webkit.org/show_bug.cgi?id=103367
3193
3194         Reviewed by Adam Barth.
3195
3196         This patch cleans up V8StringResource and removes V8StringResource::m_string.
3197         This patch won't change performance. (This patch just adds one redundant IsString()
3198         check and one IsInt32() check.) I confirmed no performance regression in micro benchmarks
3199         (https://bugs.webkit.org/attachment.cgi?id=176178).
3200
3201         No tests. No change in behavior.
3202
3203         * bindings/v8/V8Binding.cpp:
3204         (WebCore::v8NonStringValueToWebCoreString):
3205         * bindings/v8/V8StringResource.cpp:
3206         (WebCore::int32ToWebCoreStringFast):
3207         (WebCore::String):
3208         (WebCore::AtomicString):
3209         (WebCore):
3210         * bindings/v8/V8StringResource.h:
3211         (WebCore::V8StringResource::V8StringResource):
3212         (WebCore::V8StringResource::prepareBase):
3213         (WebCore::V8StringResource::toString):
3214         (V8StringResource):
3215         (WebCore::::prepare):
3216
3217 2012-11-27  Alec Flett  <alecflett@chromium.org>
3218
3219         IndexedDB: stub out IDBDatabaseBackendInterface::createTransaction
3220         https://bugs.webkit.org/show_bug.cgi?id=102730
3221
3222         Reviewed by Darin Fisher.
3223
3224         Stub out and support passing a 64-bit transaction id
3225         so the frontend can refer to transactions by id rather than
3226         a proxy object or a direct pointer reference. This will ultimately
3227         loosen ownership and lifetime of transactions from the frontend
3228         and backend.
3229
3230         No new tests, this is just part of a refactor.
3231
3232         * Modules/indexeddb/IDBDatabase.cpp:
3233         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
3234         (WebCore):
3235         (WebCore::IDBDatabaseBackendImpl::transaction):
3236         (WebCore::IDBDatabaseBackendImpl::createTransaction):
3237         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
3238         (IDBDatabaseBackendImpl):
3239         * Modules/indexeddb/IDBDatabaseBackendInterface.h:
3240         (IDBDatabaseBackendInterface):
3241         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
3242         (WebCore::IDBTransactionBackendImpl::create):
3243         (WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
3244         * Modules/indexeddb/IDBTransactionBackendImpl.h:
3245         (IDBTransactionBackendImpl):
3246         (WebCore::IDBTransactionBackendImpl::id):
3247
3248 2012-11-27  Andrei Bucur  <abucur@adobe.com>
3249
3250         [CSS Regions] Crash when dispatching regionlayoutupdate
3251         https://bugs.webkit.org/show_bug.cgi?id=102944
3252
3253         Reviewed by Andreas Kling.
3254
3255         The event dispatch function was incorrectly assuming the RenderNamedFlowThread is valid. Because the event is asynchronous it's
3256         possible for the flow to be in the "NULL" state (the renderer is 0) while the regionlayoutupdate event is dispatched.
3257
3258         Test: fast/regions/webkit-named-flow-event-crash.html
3259
3260         * dom/WebKitNamedFlow.cpp:
3261         (WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent): Remove the ASSERT and don't dispatch the event if the flow is
3262             in the "NULL" state.
3263
3264 2012-11-27  Mihnea Ovidenie  <mihnea@adobe.com>
3265
3266         [CSS Regions] Absolutely positioned regions do not expand to fill their container
3267         https://bugs.webkit.org/show_bug.cgi?id=102385
3268
3269         Reviewed by Julien Chaffraix.
3270
3271         In the case of an absolutely positioned region with height auto, height computation should follow
3272         the path of block elements instead of replaced elements.
3273
3274         Tests: fast/regions/autosize-abspos-anchoredregion-vertlr.html
3275                fast/regions/autosize-abspos-anchoredregion.html
3276
3277         * rendering/RenderBox.cpp:
3278         (WebCore::RenderBox::computePositionedLogicalHeight): Skip replaced element height computation when a region has height auto.
3279         * rendering/RenderRegion.h:
3280         (WebCore::RenderRegion::shouldHaveAutoLogicalHeight): Make it private since it is not accessed from outside.
3281
3282 2012-11-27  Alexander Pavlov  <apavlov@chromium.org>
3283
3284         Incorrect value of CSSStyleDeclaration#length when a shorthand property is inherit or initial
3285         https://bugs.webkit.org/show_bug.cgi?id=73002
3286
3287         Reviewed by Alexis Menard.
3288
3289         Before the patch, "inherit" and "initial" shorthands would get added to the StylePropertySet as-is, their longhands unspecified.
3290         This patch tackles two aspects of the problem:
3291         - When parsing "initial" and "inherit" shorthands, their longhands are added to the property set with the corresponding values.
3292         - When querying "initial" and "inherit" shorthands, their values are reconstructed from the longhands as usual, but if all of the longhands
3293           are found to have the same explicit "initial" or "inherit" value, the respective single value is returned as the shorthand value.
3294
3295         When reconstructing shorthands, a "common value" is tracked. If all longhands involved have the same explicit value, it becomes the
3296         "common value", otherwise it is a String(). The "inherit" or "initial" common value ultimately becomes the shorthand value
3297         (except for the "background-position" shorthand, which is a special case).
3298
3299         * css/CSSParser.cpp:
3300         (WebCore::parseKeywordValue): Parse shorthands' "initial" and "inherit" values using the CSSParser.
3301         (WebCore::CSSParser::addExpandedPropertyForValue): Add simple property or all sharthand's longhands with given value and priority.
3302         (WebCore::CSSParser::parseValue): For "initial" and "inherit" shorthands, add their longhands with the respective value, not the shorthands proper.
3303         * css/CSSParser.h: Add addExpandedPropertyForValue().
3304         * css/StylePropertySet.cpp:
3305         (WebCore::isInitialOrInherit): Check if the value is "initial" or "inherit".
3306         (WebCore):
3307         (WebCore::StylePropertySet::appendFontLonghandValueIfExplicit): Modified to track the common value for the "font" shorthand.
3308         (WebCore::StylePropertySet::fontValue): Ditto.
3309         (WebCore::StylePropertySet::get4Values): Return "inherit" or "initial" if all 4 values are explicitly "inherit" or "initial".
3310         (WebCore::StylePropertySet::getLayeredShorthandValue): Use the common value approach for layered shorthands.
3311         (WebCore::StylePropertySet::getShorthandValue): Ditto for ordinary shorthands.
3312         (WebCore::StylePropertySet::borderPropertyValue): Ditto for the "border" shorthand.
3313         * css/StylePropertySet.h: Modify the appendFontLonghandValueIfExplicit() signature.
3314         * html/canvas/CanvasRenderingContext2D.cpp:
3315         (WebCore::CanvasRenderingContext2D::setFont): Now that "inherit" and "initial" shorthands are represented by their longhands,
3316         we need to check the string value of the "font" shorthand for being "inherit" or "initial" instead: getPropertyCSSValue() no longer works,
3317         since the shorthand itself is no longer added to the StylePropertySet.
3318
3319 2012-11-27  Kentaro Hara  <haraken@chromium.org>
3320
3321         Unreviewed. Renamed TRYCATCH => V8TRYCATCH.
3322         (I forgot to apply reviewer's comment in bug 103352 when landing r135817.)
3323
3324         * bindings/scripts/CodeGeneratorV8.pm:
3325         (GenerateParametersCheck):
3326         (GenerateEventConstructorCallback):
3327         (ConvertToV8StringResource):
3328         * bindings/scripts/test/V8/V8Float64Array.cpp:
3329         (WebCore::Float64ArrayV8Internal::fooCallback):
3330         * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
3331         (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionCallback):
3332         (WebCore::TestActiveDOMObjectV8Internal::postMessageCallback):
3333         * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
3334         (WebCore::TestCustomNamedGetterV8Internal::anotherFunctionCallback):
3335         * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
3336         (WebCore::V8TestEventConstructor::constructorCallback):
3337         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
3338         (WebCore::TestEventTargetV8Internal::itemCallback):
3339         (WebCore::TestEventTargetV8Internal::dispatchEventCallback):
3340         * bindings/scripts/test/V8/V8TestInterface.cpp:
3341         (WebCore::TestInterfaceV8Internal::supplementalStaticAttrAttrSetter):
3342         (WebCore::TestInterfaceV8Internal::supplementalStr2AttrSetter):
3343         (WebCore::TestInterfaceV8Internal::supplementalMethod2Callback):
3344         (WebCore::V8TestInterface::constructorCallback):
3345         * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
3346         (WebCore::TestMediaQueryListListenerV8Internal::methodCallback):
3347         * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
3348         (WebCore::V8TestNamedConstructorConstructorCallback):
3349         * bindings/scripts/test/V8/V8TestObj.cpp:
3350         (WebCore::TestObjV8Internal::staticStringAttrAttrSetter):
3351         (WebCore::TestObjV8Internal::stringAttrAttrSetter):
3352         (WebCore::TestObjV8Internal::reflectedStringAttrAttrSetter):
3353         (WebCore::TestObjV8Internal::reflectedURLAttrAttrSetter):
3354         (WebCore::TestObjV8Internal::reflectedCustomURLAttrAttrSetter):
3355         (WebCore::TestObjV8Internal::stringAttrWithGetterExceptionAttrSetter):
3356         (WebCore::TestObjV8Internal::stringAttrWithSetterExceptionAttrSetter):
3357         (WebCore::TestObjV8Internal::voidMethodWithArgsCallback):
3358         (WebCore::TestObjV8Internal::longMethodWithArgsCallback):
3359         (WebCore::TestObjV8Internal::objMethodWithArgsCallback):
3360         (WebCore::TestObjV8Internal::methodWithSequenceArgCallback):
3361         (WebCore::TestObjV8Internal::methodReturningSequenceCallback):
3362         (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsCallback):
3363         (WebCore::TestObjV8Internal::idbKeyCallback):
3364         (WebCore::TestObjV8Internal::optionsObjectCallback):
3365         (WebCore::TestObjV8Internal::methodWithOptionalArgCallback):
3366         (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgCallback):
3367         (WebCore::TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsCallback):
3368         (WebCore::TestObjV8Internal::methodWithOptionalStringCallback):
3369         (WebCore::TestObjV8Internal::methodWithOptionalStringIsUndefinedCallback):
3370         (WebCore::TestObjV8Internal::methodWithOptionalStringIsNullStringCallback):
3371         (WebCore::TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgCallback):
3372         (WebCore::TestObjV8Internal::overloadedMethod1Callback):
3373         (WebCore::TestObjV8Internal::overloadedMethod2Callback):
3374         (WebCore::TestObjV8Internal::overloadedMethod3Callback):
3375         (WebCore::TestObjV8Internal::overloadedMethod4Callback):
3376         (WebCore::TestObjV8Internal::overloadedMethod6Callback):
3377         (WebCore::TestObjV8Internal::overloadedMethod7Callback):
3378         (WebCore::TestObjV8Internal::overloadedMethod8Callback):
3379         (WebCore::TestObjV8Internal::overloadedMethod9Callback):
3380         (WebCore::TestObjV8Internal::overloadedMethod10Callback):
3381         (WebCore::TestObjV8Internal::overloadedMethod11Callback):
3382         (WebCore::TestObjV8Internal::classMethodWithOptionalCallback):
3383         (WebCore::TestObjV8Internal::overloadedMethod12Callback):
3384         (WebCore::TestObjV8Internal::classMethodWithClampCallback):
3385         (WebCore::TestObjV8Internal::enabledAtRuntimeMethod1Callback):
3386         (WebCore::TestObjV8Internal::enabledAtRuntimeMethod2Callback):
3387         (WebCore::TestObjV8Internal::enabledPerContextMethod1Callback):
3388         (WebCore::TestObjV8Internal::enabledPerContextMethod2Callback):
3389         (WebCore::TestObjV8Internal::stringArrayFunctionCallback):
3390         (WebCore::TestObjV8Internal::convert1Callback):
3391         (WebCore::TestObjV8Internal::convert2Callback):
3392         (WebCore::TestObjV8Internal::convert4Callback):
3393         (WebCore::TestObjV8Internal::convert5Callback):
3394         (WebCore::TestObjV8Internal::strictFunctionCallback):
3395         (WebCore::TestObjV8Internal::variadicStringMethodCallback):
3396         (WebCore::TestObjV8Internal::variadicDoubleMethodCallback):
3397         (WebCore::TestObjV8Internal::variadicNodeMethodCallback):
3398         * bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:
3399         (WebCore::V8TestOverloadedConstructors::constructor1Callback):
3400         (WebCore::V8TestOverloadedConstructors::constructor2Callback):
3401         (WebCore::V8TestOverloadedConstructors::constructor3Callback):
3402         (WebCore::V8TestOverloadedConstructors::constructor4Callback):
3403         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
3404         (WebCore::V8TestSerializedScriptValueInterface::constructorCallback):
3405         * bindings/v8/V8Binding.h:
3406         (WebCore::toV8Sequence):
3407         * bindings/v8/V8BindingMacros.h:
3408         * bindings/v8/custom/V8BlobCustom.cpp:
3409         (WebCore::V8Blob::constructorCallbackCustom):
3410         * bindings/v8/custom/V8ConsoleCustom.cpp:
3411         (WebCore::V8Console::profileCallback):
3412         (WebCore::V8Console::profileEndCallback):
3413         * bindings/v8/custom/V8DOMWindowCustom.cpp:
3414         (WebCore::handlePostMessageCallback):
3415         * bindings/v8/custom/V8DataViewCustom.cpp:
3416         (WebCore::V8DataView::getInt8Callback):
3417         (WebCore::V8DataView::getUint8Callback):
3418         (WebCore::V8DataView::setInt8Callback):
3419         (WebCore::V8DataView::setUint8Callback):
3420         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
3421         (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallback):
3422         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
3423         (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallback):
3424         * bindings/v8/custom/V8DocumentCustom.cpp:
3425         (WebCore::V8Document::evaluateCallback):
3426         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
3427         (WebCore::V8HTMLOptionsCollection::addCallback):
3428         * bindings/v8/custom/V8HistoryCustom.cpp:
3429         (WebCore::V8History::pushStateCallback):