ecaa58c5e2485015534db3946677ceb66c019d35
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-02-11  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Disable delete button controller on non-Mac ports and delete EditorClient::shouldShowDeleteInterface
4         https://bugs.webkit.org/show_bug.cgi?id=109534
5
6         Reviewed by Anders Carlsson.
7
8         * editing/DeleteButtonController.cpp:
9         (WebCore::DeleteButtonController::show):
10         * editing/Editor.cpp:
11         (WebCore):
12         * editing/Editor.h:
13         (Editor):
14         * loader/EmptyClients.h:
15         (WebCore::EmptyEditorClient::shouldDeleteRange):
16         (EmptyEditorClient):
17         (WebCore::EmptyEditorClient::shouldShowDeleteInterface):
18         * page/EditorClient.h:
19         (EditorClient):
20
21 2013-02-11  Hayato Ito  <hayato@chromium.org>
22
23         Factor EventContext and introduces MouseOrFocusEventContext.
24         https://bugs.webkit.org/show_bug.cgi?id=109278
25
26         Reviewed by Dimitri Glazkov.
27
28         To supoort Touch event retargeting (bug 107800), we have to factor
29         event retargeting code so that it can support not only MouseEvent or FocusEvent,
30         but also other events.
31
32         This is the first attempt to refactor event retargeting code, a
33         separated patch from bug 109156.  EventContext is now factored and
34         MouseOrFocusEventContext was introduced to support MouseEvent or
35         FocusEvent separately.
36
37         In following patches, I'll introduce TouchEventContext and
38         TouchEventDispatchMediator to support Touch event retargeting.
39
40         No new tests. No change in functionality.
41
42         * dom/EventContext.cpp:
43         (WebCore::EventContext::EventContext): Factor relatedTarget out from EventContext into MouseOrFocusEventContext.
44         (WebCore::EventContext::~EventContext):
45         (WebCore):
46         (WebCore::EventContext::handleLocalEvents):
47         (WebCore::EventContext::isMouseOrFocusEventContext):
48         (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):  New. Handles MouseEvent's (or FocusEvent's) relatedTarget retargeting.
49         (WebCore::MouseOrFocusEventContext::~MouseOrFocusEventContext):
50         (WebCore::MouseOrFocusEventContext::handleLocalEvents):
51         (WebCore::MouseOrFocusEventContext::isMouseOrFocusEventContext):
52         * dom/EventContext.h:
53         (EventContext):
54         (WebCore::EventContext::node):
55         (WebCore::EventContext::target):
56         (WebCore::EventContext::currentTargetSameAsTarget):
57         (WebCore):
58         (MouseOrFocusEventContext):
59         (WebCore::MouseOrFocusEventContext::relatedTarget):
60         (WebCore::MouseOrFocusEventContext::setRelatedTarget):
61         * dom/EventDispatcher.cpp:
62         (WebCore::EventRelatedTargetAdjuster::adjust):
63         (WebCore::EventDispatcher::adjustRelatedTarget):
64         (WebCore::EventDispatcher::ensureEventPath):  Renamad from ensureEventAncestors. Use the DOM Core terminology.
65         (WebCore::EventDispatcher::dispatchEvent):
66         (WebCore::EventDispatcher::dispatchEventAtCapturing):
67         (WebCore::EventDispatcher::dispatchEventAtTarget):
68         (WebCore::EventDispatcher::dispatchEventAtBubbling):
69         (WebCore::EventDispatcher::dispatchEventPostProcess):
70         (WebCore::EventDispatcher::topEventContext):
71         * dom/EventDispatcher.h:
72         (EventRelatedTargetAdjuster):
73         (EventDispatcher):
74         * inspector/InspectorInstrumentation.cpp:
75         (WebCore):
76         (WebCore::eventHasListeners):
77         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
78         * inspector/InspectorInstrumentation.h:
79         (InspectorInstrumentation):
80         (WebCore::InspectorInstrumentation::willDispatchEvent):
81
82 2013-02-11  peavo@outlook.com  <peavo@outlook.com>
83
84         [Curl] setCookiesFromDOM function does not save cookies to disk.
85         https://bugs.webkit.org/show_bug.cgi?id=109285
86
87         Reviewed by Brent Fulgham.
88
89         Write cookies to disk by using the Curl easy api.
90
91         * platform/network/curl/CookieJarCurl.cpp:
92         (WebCore::setCookiesFromDOM):Write cookie to disk.
93         * platform/network/curl/ResourceHandleManager.cpp:
94         (WebCore::ResourceHandleManager::getCurlShareHandle): Added method to get Curl share handle.
95         (WebCore::ResourceHandleManager::getCookieJarFileName): Added method to get cookie file name.
96         * platform/network/curl/ResourceHandleManager.h: Added methods to get cookie file name, and Curl share handle.
97
98 2013-02-11  Hayato Ito  <hayato@chromium.org>
99
100         Split each RuleSet and feature out from StyleResolver into its own class.
101         https://bugs.webkit.org/show_bug.cgi?id=107777
102
103         Reviewed by Dimitri Glazkov.
104
105         Re-landing r141964, which was reverted in r141973, since r141964 seem to be innocent.
106
107         No tests. No change in behavior.
108
109         * CMakeLists.txt:
110         * GNUmakefile.list.am:
111         * Target.pri:
112         * WebCore.gypi:
113         * WebCore.xcodeproj/project.pbxproj:
114         * css/CSSAllInOne.cpp:
115         * css/DocumentRuleSets.cpp: Added.
116         (WebCore):
117         (WebCore::DocumentRuleSets::DocumentRuleSets):
118         (WebCore::DocumentRuleSets::~DocumentRuleSets):
119         (WebCore::DocumentRuleSets::initUserStyle): New helper to initialize each RuleSets.
120         (WebCore::DocumentRuleSets::collectRulesFromUserStyleSheets): Factored out from StyleResolver.
121         (WebCore::makeRuleSet): Ditto.
122         (WebCore::DocumentRuleSets::resetAuthorStyle): Ditto.
123         (WebCore::DocumentRuleSets::appendAuthorStyleSheets): Ditto.
124         (WebCore::DocumentRuleSets::collectFeatures): Ditto.
125         (WebCore::DocumentRuleSets::reportMemoryUsage): New methods to report memory usage. Factored out from StyleResolver.
126         * css/DocumentRuleSets.h: Added.
127         (WebCore):
128         (DocumentRuleSets):
129         (WebCore::DocumentRuleSets::authorStyle): Moved from StyleResolver.
130         (WebCore::DocumentRuleSets::userStyle): Ditto.
131         (WebCore::DocumentRuleSets::features): Ditto.
132         (WebCore::DocumentRuleSets::sibling): Ditto.
133         (WebCore::DocumentRuleSets::uncommonAttribute): Ditto.
134         * css/StyleResolver.cpp:
135         (WebCore::StyleResolver::StyleResolver):
136         (WebCore::StyleResolver::appendAuthorStyleSheets): Now calls DocumentRuleSets::appendAuthorStyleSheets.
137         (WebCore::StyleResolver::matchAuthorRules): Use m_ruleSets.
138         (WebCore::StyleResolver::matchUserRules): Ditto.
139         (WebCore::StyleResolver::classNamesAffectedByRules): Ditto.
140         (WebCore::StyleResolver::locateCousinList): Ditto.
141         (WebCore::StyleResolver::canShareStyleWithElement): Ditto.
142         (WebCore::StyleResolver::locateSharedStyle): Ditto.
143         (WebCore::StyleResolver::styleForPage): Ditto.
144         (WebCore::StyleResolver::checkRegionStyle): Ditto.
145         (WebCore::StyleResolver::applyProperty): Ditto.
146         (WebCore::StyleResolver::reportMemoryUsage): Now calls DocumentRuleSets::reportMemoryUsage.
147         * css/StyleResolver.h:
148         (WebCore::StyleResolver::scopeResolver):
149         (StyleResolver):
150         (WebCore::StyleResolver::ruleSets): accessor r to DocumentRuleSets.
151         (WebCore::StyleResolver::usesSiblingRules): Use m_ruleSets.
152         (WebCore::StyleResolver::usesFirstLineRules): Ditto.
153         (WebCore::StyleResolver::usesBeforeAfterRules): Ditto.
154         (WebCore::StyleResolver::hasSelectorForAttribute): Ditto.
155         (WebCore::StyleResolver::hasSelectorForClass): Ditto.
156         (WebCore::StyleResolver::hasSelectorForId): Ditto.
157         * dom/DocumentStyleSheetCollection.cpp:
158         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
159
160 2013-02-11  Keishi Hattori  <keishi@webkit.org>
161
162         REGRESSION (r140778):Calendar Picker buttons are wrong when rtl
163         https://bugs.webkit.org/show_bug.cgi?id=109158
164
165         Reviewed by Kent Tamura.
166
167         The calendar picker button's icon and position where wrong when rtl.
168
169
170         Test: platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-ar.html
171
172         * Resources/pagepopups/calendarPicker.css:
173         (.year-month-button-left .year-month-button): Use -webkit-margin-end so the margin is applide to the right side.
174         (.year-month-button-right .year-month-button): Use -webkit-margin-start so the margin is applide to the right side.
175         (.today-clear-area .today-button): Use -webkit-margin-end so the margin is applide to the right side.
176         * Resources/pagepopups/calendarPicker.js:
177         (YearMonthController.prototype._attachLeftButtonsTo): Flip icon image when rtl.
178         (YearMonthController.prototype._attachRightButtonsTo): Ditto.
179
180 2013-02-11  KwangYong Choi  <ky0.choi@samsung.com>
181
182         REGRESSION (r142549): Remove web intents code
183         https://bugs.webkit.org/show_bug.cgi?id=109532
184
185         Reviewed by Nico Weber.
186
187         Remove remaning code related to web intents.
188
189         No new tests, no change on behavior.
190
191         * UseJSC.cmake:
192         * bindings/js/JSIntentConstructor.cpp: Removed.
193
194 2013-02-11  Kenneth Russell  <kbr@google.com>
195
196         Add temporary typedef to ANGLEWebKitBridge to support incompatible API upgrade
197         https://bugs.webkit.org/show_bug.cgi?id=109127
198
199         Reviewed by Dean Jackson.
200
201         No new tests. Built and tested WebKit and Chromium with this change.
202
203         * platform/graphics/ANGLEWebKitBridge.cpp:
204         (WebCore):
205             Define temporary typedef spanning int -> size_t change.
206         (WebCore::getValidationResultValue):
207         (WebCore::getSymbolInfo):
208             Use temporary typedef.
209
210 2013-02-11  Kentaro Hara  <haraken@chromium.org>
211
212         [V8] ScheduledAction::m_context can be empty, so we shouldn't
213         retrieve an Isolate by using m_context->GetIsolate()
214         https://bugs.webkit.org/show_bug.cgi?id=109523
215
216         Reviewed by Adam Barth.
217
218         Chromium bug: https://code.google.com/p/chromium/issues/detail?id=175307#makechanges
219
220         Currently ScheduledAction is retrieving an Isolate by using m_context->GetIsolate().
221         This can crash because ScheduledAction::m_context can be empty. Specifically,
222         ScheduledAction::m_context is set to ScriptController::currentWorldContext(),
223         which can return an empty handle when a frame does not exist. In addition,
224         'if(context.IsEmpty())' in ScheduledAction.cpp implies that it can be empty.
225
226         Alternately, we should pass an Isolate explicitly when a ScheduledAction is instantiated.
227
228         No tests. The Chromium crash report doesn't provide enough information
229         to reproduce the bug.
230
231         * bindings/v8/ScheduledAction.cpp:
232         (WebCore::ScheduledAction::ScheduledAction):
233         (WebCore):
234         (WebCore::ScheduledAction::~ScheduledAction):
235         * bindings/v8/ScheduledAction.h:
236         (ScheduledAction):
237         * bindings/v8/custom/V8DOMWindowCustom.cpp:
238         (WebCore::WindowSetTimeoutImpl):
239         * bindings/v8/custom/V8WorkerContextCustom.cpp:
240         (WebCore::SetTimeoutOrInterval):
241
242 2013-02-11  Adenilson Cavalcanti  <cavalcantii@gmail.com>
243
244         Build fix: r142549 broke EFL build
245         https://bugs.webkit.org/show_bug.cgi?id=109527
246
247         Reviewed by Kentaro Hara.
248
249         No new tests, no change on behavior.
250
251         * CMakeLists.txt:
252
253 2013-02-11  Simon Fraser  <simon.fraser@apple.com>
254
255         REGRESSION (r142520?): Space no longer scrolls the page
256         https://bugs.webkit.org/show_bug.cgi?id=109526
257
258         Reviewed by Tim Horton.
259
260         ScrollingTree::updateTreeFromStateNode() used to bail early when it had
261         no children (no fixed or sticky elements), but that left updateAfterChildren()
262         uncalled. Fix by always calling updateAfterChildren(), which updates the scroll
263         position.
264
265         * page/scrolling/ScrollingTree.cpp:
266         (WebCore::ScrollingTree::updateTreeFromStateNode):
267
268 2013-02-11  Tim Horton  <timothy_horton@apple.com>
269
270         Remove extra early-return in FrameView::setScrollPosition
271
272         Rubber-stamped by Simon Fraser.
273
274         * page/FrameView.cpp:
275         (WebCore::FrameView::setScrollPosition):
276
277 2013-02-11  Arko Saha  <arko@motorola.com>
278
279         [Microdata] Fix crash after r141034 in chromuim port
280         https://bugs.webkit.org/show_bug.cgi?id=109514
281
282         Reviewed by Ryosuke Niwa.
283
284         Added V8SkipVTableValidation extended attribute to skip
285         VTable validation check for DOMSettableTokenList interface.
286
287         This patch fixes below test failures:
288         Tests: fast/dom/MicroData/domsettabletokenlist-attributes-add-token.html
289                fast/dom/MicroData/domsettabletokenlist-attributes-out-of-range-index.html
290                fast/dom/MicroData/element-with-empty-itemprop.html
291                fast/dom/MicroData/itemprop-add-remove-tokens.html
292                fast/dom/MicroData/itemprop-for-an-element-must-be-correct.html
293                fast/dom/MicroData/itemprop-must-be-read-only.html
294                fast/dom/MicroData/itemprop-reflected-by-itemProp-property.html
295                fast/dom/MicroData/itemref-add-remove-tokens.html
296                fast/dom/MicroData/itemref-attribute-reflected-by-itemRef-property.html
297                fast/dom/MicroData/itemref-for-an-element-must-be-correct.html
298                fast/dom/MicroData/itemref-must-be-read-only.html
299                fast/dom/MicroData/itemtype-add-remove-tokens.html
300                fast/dom/MicroData/itemtype-attribute-test.html
301                fast/dom/MicroData/microdata-domtokenlist-attribute-add-remove-tokens.html
302                fast/dom/MicroData/properties-collection-namedgetter-with-invalid-name.html
303                fast/dom/MicroData/propertynodelist-add-remove-itemprop-tokens.html
304                fast/dom/MicroData/propertynodelist-add-remove-itemref-tokens.html
305
306         * html/DOMSettableTokenList.idl:
307
308 2013-02-11  Adam Barth  <abarth@webkit.org>
309
310         Load event fires too early with threaded HTML parser (take 2)
311         https://bugs.webkit.org/show_bug.cgi?id=109485
312
313         Reviewed by Eric Seidel.
314
315         This patch restores the code that was removed in
316         http://trac.webkit.org/changeset/142492 and adds code to
317         DocumentLoader.cpp to avoid the regression.
318
319         * dom/Document.cpp:
320         (WebCore::Document::hasActiveParser):
321         (WebCore::Document::decrementActiveParserCount):
322         * loader/DocumentLoader.cpp:
323         (WebCore::DocumentLoader::isLoadingInAPISense):
324
325 2013-02-11  Eric Seidel  <eric@webkit.org>
326
327         Fold HTMLTokenizerState back into HTMLTokenizer now that MarkupTokenizerBase is RFG
328         https://bugs.webkit.org/show_bug.cgi?id=109502
329
330         Reviewed by Tony Gentilcore.
331
332         Just a search replace of HTMLTokenizerState with HTMLTokenizer and moving the enum.
333         This restores us to the peacefull world pre-NEW_XML.
334
335         * html/parser/BackgroundHTMLParser.cpp:
336         (WebCore::BackgroundHTMLParser::forcePlaintextForTextDocument):
337         (WebCore::BackgroundHTMLParser::simulateTreeBuilder):
338         * html/parser/HTMLDocumentParser.cpp:
339         (WebCore::tokenizerStateForContextElement):
340         (WebCore::HTMLDocumentParser::forcePlaintextForTextDocument):
341         (WebCore::HTMLDocumentParser::pumpTokenizer):
342         * html/parser/HTMLTokenizer.cpp:
343         (WebCore::isEndTagBufferingState):
344         (WebCore):
345         (WebCore::HTMLTokenizer::reset):
346         (WebCore::HTMLTokenizer::flushEmitAndResumeIn):
347         (WebCore::HTMLTokenizer::nextToken):
348         (WebCore::HTMLTokenizer::updateStateFor):
349         * html/parser/HTMLTokenizer.h:
350         (HTMLTokenizer):
351         (WebCore::HTMLTokenizer::create):
352         (WebCore::HTMLTokenizer::shouldSkipNullCharacters):
353         (WebCore::HTMLTokenizer::emitEndOfFile):
354         * html/parser/HTMLTreeBuilder.cpp:
355         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
356         (WebCore::HTMLTreeBuilder::processEndTag):
357         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
358         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
359         (WebCore::HTMLTreeBuilder::processScriptStartTag):
360         * html/parser/TextViewSourceParser.cpp:
361         (WebCore::TextViewSourceParser::TextViewSourceParser):
362
363 2013-02-11  Kentaro Hara  <haraken@chromium.org>
364
365         Build fix after r142528
366         https://bugs.webkit.org/show_bug.cgi?id=109520
367
368         Reviewed by Eric Seidel.
369
370         r142528 changed GIFImageReader from a struct to a class.
371         We also need to fix a forward declaration.
372
373         No tests.
374
375         * platform/image-decoders/gif/GIFImageDecoder.h:
376
377 2013-02-11  Nico Weber  <thakis@chromium.org>
378
379         Remove web intents code
380         https://bugs.webkit.org/show_bug.cgi?id=109501
381
382         Reviewed by Eric Seidel.
383
384         See thread "Removing ENABLE(WEB_INTENTS) code" on webkit-dev.
385
386         * DerivedSources.make:
387         * Modules/intents/DOMWindowIntents.cpp: Removed.
388         * Modules/intents/DOMWindowIntents.h: Removed.
389         * Modules/intents/DOMWindowIntents.idl: Removed.
390         * Modules/intents/DeliveredIntent.cpp: Removed.
391         * Modules/intents/DeliveredIntent.h: Removed.
392         * Modules/intents/DeliveredIntent.idl: Removed.
393         * Modules/intents/Intent.cpp: Removed.
394         * Modules/intents/Intent.h: Removed.
395         * Modules/intents/Intent.idl: Removed.
396         * Modules/intents/IntentRequest.cpp: Removed.
397         * Modules/intents/IntentRequest.h: Removed.
398         * Modules/intents/IntentResultCallback.h: Removed.
399         * Modules/intents/IntentResultCallback.idl: Removed.
400         * Modules/intents/NavigatorIntents.cpp: Removed.
401         * Modules/intents/NavigatorIntents.h: Removed.
402         * Modules/intents/NavigatorIntents.idl: Removed.
403         * WebCore.gyp/WebCore.gyp:
404         * WebCore.gypi:
405         * bindings/generic/RuntimeEnabledFeatures.cpp:
406         (WebCore):
407         * bindings/generic/RuntimeEnabledFeatures.h:
408         (RuntimeEnabledFeatures):
409         * bindings/v8/custom/V8IntentCustom.cpp: Removed.
410         * html/HTMLElementsAllInOne.cpp:
411         * html/HTMLIntentElement.cpp: Removed.
412         * html/HTMLIntentElement.h: Removed.
413         * html/HTMLIntentElement.idl: Removed.
414         * loader/EmptyClients.cpp:
415         * loader/EmptyClients.h:
416         (EmptyFrameLoaderClient):
417         * loader/FrameLoaderClient.h:
418         (WebCore):
419         * page/DOMWindow.idl:
420
421 2013-02-11  Eric Seidel  <eric@webkit.org>
422
423         Fix Mac build after http://trac.webkit.org/changeset/142535.
424
425         Unreviewed build fix.
426
427         * html/parser/HTMLTokenizer.h:
428         (WebCore::HTMLTokenizer::emitAndReconsumeIn):
429
430 2013-02-11  David Farler  <dfarler@apple.com>
431
432         Make WebCore Derived Sources work with SDK identifiers too
433         https://bugs.webkit.org/show_bug.cgi?id=109324
434
435         Reviewed by Sam Weinig.
436
437         * WebCore.xcodeproj/project.pbxproj: Pass SDKROOT to make for DerivedSources.make
438
439 2013-02-11  Zhenyao Mo  <zmo@google.com>
440
441         WEBGL_compressed_texture_s3tc extension can be enabled even when not supported
442         https://bugs.webkit.org/show_bug.cgi?id=109508
443
444         Reviewed by Kenneth Russell.
445
446         * html/canvas/WebGLRenderingContext.cpp:
447         (WebCore):
448         (WebCore::WebGLRenderingContext::getExtension): Check whether the extension support is there before returning the extension pointer.
449
450 2013-02-11  Emil A Eklund  <eae@chromium.org>
451
452         Change RenderFrameSet::paint to use m-rows/m_cols directly.
453         https://bugs.webkit.org/show_bug.cgi?id=108503
454
455         Reviewed by Eric Seidel.
456
457         Test: fast/frames/invalid-frameset.html
458
459         * rendering/RenderFrameSet.cpp:
460         (WebCore::RenderFrameSet::paint):
461
462 2013-02-11  Yong Li  <yoli@rim.com>
463
464         XMLHttpRequestProgressEventThrottle::resume() always schedules timer even when unnecessary
465         https://bugs.webkit.org/show_bug.cgi?id=105348
466
467         Reviewed by Alexey Proskuryakov.
468
469         Let resume() clear the defer flag and return if there is deferred events to dispatch.
470
471         No new tests as this should not affect existing cross-platform behavior. It should be
472         OK as long as it doesn't break anything.
473
474         * xml/XMLHttpRequestProgressEventThrottle.cpp:
475         (WebCore::XMLHttpRequestProgressEventThrottle::resume):
476
477 2013-02-11  Eric Seidel  <eric@webkit.org>
478
479         Fold MarkupTokenizerBase into HTMLTokenizer now that it is the only subclass
480         https://bugs.webkit.org/show_bug.cgi?id=109499
481
482         Reviewed by Adam Barth.
483
484         For great justice.  And sanity.
485         Epic amount of template code deleted.
486
487         * GNUmakefile.list.am:
488         * Target.pri:
489         * WebCore.gypi:
490         * WebCore.vcproj/WebCore.vcproj:
491         * WebCore.vcxproj/WebCore.vcxproj:
492         * WebCore.vcxproj/WebCore.vcxproj.filters:
493         * WebCore.xcodeproj/project.pbxproj:
494         * html/parser/HTMLTokenizer.cpp:
495         (WebCore::HTMLTokenizer::HTMLTokenizer):
496         * html/parser/HTMLTokenizer.h:
497         (HTMLTokenizer):
498         (Checkpoint):
499         (WebCore::HTMLTokenizer::state):
500         (WebCore::HTMLTokenizer::setState):
501         (WebCore::HTMLTokenizer::shouldSkipNullCharacters):
502         (WebCore::HTMLTokenizer::bufferCharacter):
503         (WebCore::HTMLTokenizer::emitAndResumeIn):
504         (WebCore::HTMLTokenizer::emitAndReconsumeIn):
505         (WebCore::HTMLTokenizer::emitEndOfFile):
506         (WebCore::HTMLTokenizer::haveBufferedCharacterToken):
507         * xml/parser/MarkupTokenizerBase.h: Removed.
508
509 2013-02-11  Anton Vayvod  <avayvod@chromium.org>
510
511         [Text Autosizing] Collect narrow descendants and process them separately. Refactoring for
512         a change to follow.
513         https://bugs.webkit.org/show_bug.cgi?id=109054
514
515         Preparational change to combine narrow descendants of the same autosizing cluster into
516         groups by the width difference between the descendant and the block containing all text of
517         the parent autosizing cluster. The groups will be autosized with the same multiplier.
518
519         For example, on sites with a sidebar, sometimes the paragraphs next to the sidebar will have
520         a large margin individually applied (via a CSS selector), causing them all to individually
521         appear narrower than their enclosing blockContainingAllText. Rather than making each of
522         these paragraphs into a separate cluster, we eventually want to be able to merge them back
523         together into one (or a few) descendant clusters.
524
525         Reviewed by Julien Chaffraix.
526
527         No behavioral changes thus no new tests or test changes.
528
529         * rendering/TextAutosizer.cpp:
530         (TextAutosizingClusterInfo): Vector of narrow descendants.
531         (WebCore::TextAutosizer::processCluster): Process narrow descendants separately.
532         (WebCore::TextAutosizer::processContainer):
533
534             Remember narrow descendants of the parent cluster for later processing.
535
536 2013-02-11  Enrica Casucci  <enrica@apple.com>
537
538         Add ENABLE_DELETION_UI to control the use of the deletion UI.
539         https://bugs.webkit.org/show_bug.cgi?id=109463.
540
541         Reviewed by Ryosuke Niwa.
542         
543         This patch adds #if ENABLE(DELETION_UI) in every spot where
544         DeleteButtonController is used. This class is now only instantiated
545         if the feature is enabled. I've also done some cleanup in the
546         DeleteButtonController class, removing unused methods and making
547         private some methods only used internally to the class.
548         Both DeleteButtonController and DeleteButton classes are now excluded
549         from the compilation if the feature is not enabled.
550
551         No new tests, no change of functionality.
552
553         * dom/ContainerNode.cpp:
554         (WebCore::ContainerNode::cloneChildNodes):
555         * editing/CompositeEditCommand.cpp:
556         (WebCore::EditCommandComposition::unapply):
557         (WebCore::EditCommandComposition::reapply):
558         (WebCore::CompositeEditCommand::apply):
559         * editing/DeleteButton.cpp:
560         * editing/DeleteButtonController.cpp:
561         * editing/DeleteButtonController.h: Some cleanup.
562         (WebCore::DeleteButtonController::enabled): Made private.
563         * editing/EditCommand.cpp:
564         (WebCore::EditCommand::EditCommand):
565         * editing/Editor.cpp:
566         (WebCore::Editor::notifyComponentsOnChangedSelection):
567         (WebCore::Editor::Editor):
568         (WebCore::Editor::rangeForPoint):
569         (WebCore::Editor::deviceScaleFactorChanged):
570         * editing/Editor.h:
571         * editing/htmlediting.cpp: avoidIntersectionWithNode is
572         used only if the feature is enabled.
573         * editing/htmlediting.h:
574         * editing/markup.cpp:
575         (WebCore::createMarkup):
576         (WebCore::createFragmentFromNodes):
577         * rendering/RenderTable.cpp: Removed unnecessary include
578         fo DeleteButtonController.h
579
580 2013-02-11  Rafael Weinstein  <rafaelw@chromium.org>
581
582         [HTMLTemplateElement] <template> inside of <head> may not create <body> if EOF is hit
583         https://bugs.webkit.org/show_bug.cgi?id=109338
584
585         Reviewed by Adam Barth.
586
587         This patch adds the logic to clear the stack of open elements back to the first <template> when EOF
588         is hit. This allows a <body> to be generated if the initial <template> was opened inside of <head>.
589
590         Tests added to html5lib.
591
592         * html/parser/HTMLTreeBuilder.cpp:
593         (WebCore):
594         (WebCore::HTMLTreeBuilder::popAllTemplates):
595         (WebCore::HTMLTreeBuilder::processEndTag):
596         (WebCore::HTMLTreeBuilder::processEndOfFile):
597         * html/parser/HTMLTreeBuilder.h:
598         (HTMLTreeBuilder):
599
600 2013-02-11  Andreas Kling  <akling@apple.com>
601
602         RenderText::isAllCollapsibleWhitespace() shouldn't upconvert string to 16-bit.
603         <http://webkit.org/b/109354>
604
605         Reviewed by Eric Seidel.
606
607         254 KB progression on Membuster3.
608
609         * rendering/RenderText.cpp:
610         (WebCore::RenderText::isAllCollapsibleWhitespace):
611
612 2013-02-11  Alpha Lam  <hclam@chromium.org>
613
614         Fix code style violations in GIFImageReader.{cc|h}
615         https://bugs.webkit.org/show_bug.cgi?id=109007
616
617         Reviewed by Stephen White.
618
619         This is just a style clean up for GIFImageReader.{cc|h}.
620
621         There's going to be a lot changes in these two files and style check
622         will add a lot of noise in later reviews. Fix style problems first.
623
624         There is no change in logic at all. Just style fixes.
625
626         No new tests.
627
628         * platform/image-decoders/gif/GIFImageDecoder.cpp:
629         (WebCore::GIFImageDecoder::frameCount):
630         (WebCore::GIFImageDecoder::repetitionCount):
631         (WebCore::GIFImageDecoder::haveDecodedRow):
632         (WebCore::GIFImageDecoder::initFrameBuffer):
633         * platform/image-decoders/gif/GIFImageReader.cpp:
634         (GIFImageReader::outputRow):
635         (GIFImageReader::doLZW):
636         (GIFImageReader::read):
637         * platform/image-decoders/gif/GIFImageReader.h:
638         (GIFFrameContext):
639         (GIFFrameContext::GIFFrameContext):
640         (GIFFrameContext::~GIFFrameContext):
641         (GIFImageReader::GIFImageReader):
642         (GIFImageReader::~GIFImageReader):
643         (GIFImageReader):
644         (GIFImageReader::imagesCount):
645         (GIFImageReader::loopCount):
646         (GIFImageReader::globalColormap):
647         (GIFImageReader::globalColormapSize):
648         (GIFImageReader::frameContext):
649
650 2013-02-11  Bem Jones-Bey  <bjonesbe@adobe.com>
651
652         [CSS Exclusions] Handle shape-outside changing a float's overhang behavior
653         https://bugs.webkit.org/show_bug.cgi?id=106927
654
655         Reviewed by Julien Chaffraix.
656
657         When the position on a shape outside causes a float to spill out into
658         another block than it's container, it was not being drawn correctly. It
659         became apparent that in order to fix this properly, the approach to
660         positioning shape outsides and floats needed to be changed. The new
661         approach also fixes some other outstanding issues, like hit detection.
662
663         When a float has a shape outside, inline and float layout happens
664         using the exclusion shape bounds instead of the float's box.  The
665         effect of this is that the float itself no longer has any effect on
666         layout, both with respect to positioning of the float's siblings as
667         well as positioning the float's box. This means that when the float is
668         positioned, it is the shape's box that must obey the positioning rules
669         for floats. When the shape is given a position relative to the float's
670         box, the rules for float positioning determine where the shape sits
671         in the parent, causing the float's box to be offset by the position of
672         the shape. Since the float's box does not affect layout (due to the
673         shape), this is similar to relative positioning in that the offset is
674         a paint time occurrence.
675
676         So the new approach is to implement positioning of shape outside on
677         floats similar to how relative positioning is implemented, using a
678         RenderLayer.
679
680         This is also tested by the existing tests for shape outside on floats positioning.
681
682         Test: fast/exclusions/shape-outside-floats/shape-outside-floats-overhang.html
683
684         * rendering/ExclusionShapeOutsideInfo.h:
685         (WebCore::ExclusionShapeOutsideInfo::shapeLogicalOffset): Utility method to create a LayoutSize for computing the layer offset.
686         (ExclusionShapeOutsideInfo):
687         * rendering/LayoutState.cpp:
688         (WebCore::LayoutState::LayoutState): Check for floats with shape outside as well as in flow positioning.
689         * rendering/RenderBlock.cpp:
690         (WebCore::RenderBlock::flipFloatForWritingModeForChild): Remove old positioning implementation.
691         (WebCore::RenderBlock::paintFloats): Remove old positioning implementation.
692         (WebCore::RenderBlock::blockSelectionGaps): Check for floats with shape outside as well as in flow positioning.
693         (WebCore::RenderBlock::positionNewFloats): Remove old positioning implementation.
694         (WebCore::RenderBlock::addOverhangingFloats): Remove FIXME.
695         (WebCore::positionForPointRespectingEditingBoundaries): Check for floats with shape outside as well as in flow positioning.
696         * rendering/RenderBlock.h:
697         (RenderBlock): Remove old positioning implementation.
698         (WebCore::RenderBlock::xPositionForFloatIncludingMargin): Remove old positioning implementation.
699         (WebCore::RenderBlock::yPositionForFloatIncludingMargin): Remove old positioning implementation.
700         * rendering/RenderBox.cpp:
701         (WebCore::RenderBox::mapLocalToContainer): Check for floats with shape outside as well as in flow positioning.
702         (WebCore::RenderBox::offsetFromContainer): Check for floats with shape outside as well as in flow positioning.
703         (WebCore::RenderBox::computeRectForRepaint): Check for floats with shape outside as well as in flow positioning.
704         (WebCore::RenderBox::layoutOverflowRectForPropagation): Check for floats with shape outside as well as in flow positioning.
705         * rendering/RenderBox.h: Make floats with shape outside get a layer.
706         * rendering/RenderBoxModelObject.cpp:
707         (WebCore::RenderBoxModelObject::paintOffset): Method to return in flow
708             positioning offset + offset from shape outside on floats.
709         * rendering/RenderBoxModelObject.h:
710         (RenderBoxModelObject): Add paintOffset method.
711         * rendering/RenderInline.cpp:
712         (WebCore::RenderInline::clippedOverflowRectForRepaint): Check for floats with shape outside as well as in flow positioning.
713         (WebCore::RenderInline::computeRectForRepaint): Check for floats with shape outside as well as in flow positioning.
714         (WebCore::RenderInline::mapLocalToContainer): Check for floats with shape outside as well as in flow positioning.
715         * rendering/RenderLayer.cpp:
716         (WebCore::RenderLayer::updateLayerPosition): Check for floats with shape outside as well as in flow positioning.
717         (WebCore::RenderLayer::calculateClipRects): Check for floats with shape outside as well as in flow positioning.
718         * rendering/RenderLayer.h:
719         (WebCore::RenderLayer::paintOffset): Rename offsetForInFlowPosition to reflect that it's not just for
720             in flow positioning, it also reflects shape outside position on floats.
721         (RenderLayer):
722         * rendering/RenderObject.h:
723         (WebCore::RenderObject::hasPaintOffset): Determines if this object is in flow positioined or is a float with shape outside.
724         * rendering/style/RenderStyle.h: Add hasPaintOffset method, analagous to method with same name on RenderObject.
725
726 2013-02-11  Tim Horton  <timothy_horton@apple.com>
727
728         FrameView::setScrollPosition should clamp scroll position before handing it to
729         ScrollingCoordinator instead of depending on ScrollView to do this
730         https://bugs.webkit.org/show_bug.cgi?id=109497
731         <rdar://problem/12631789>
732
733         Reviewed by Simon Fraser.
734
735         Clamp scroll position before handing it to ScrollingCoordinator. Also, like ScrollView does,
736         bail out if we've already scrolled to the clamped scroll position.
737
738         Test: platform/mac-wk2/tiled-drawing/clamp-out-of-bounds-scrolls.html
739
740         * page/FrameView.cpp:
741         (WebCore::FrameView::setScrollPosition):
742
743 2013-02-11  Adam Barth  <abarth@webkit.org>
744
745         The threaded HTML parser should pass all the fast/parser tests
746         https://bugs.webkit.org/show_bug.cgi?id=109486
747
748         Reviewed by Tony Gentilcore.
749
750         This patch fixes the last two test failures in fast/parser, which were
751         crashes caused by not having a tokenizer when document.close() was
752         called. (The tokenizer is created lazily by calls to document.write,
753         which might not happen before document.close).
754
755         fast/parser/document-close-iframe-load.html
756         fast/parser/document-close-nested-iframe-load.html
757
758         In addition, I've added a new test to make sure we flush the tokenizer
759         properly in these cases.
760
761         Test: fast/parser/document-close-iframe-load-partial-entity.html
762
763         * html/parser/HTMLDocumentParser.cpp:
764         (WebCore::HTMLDocumentParser::prepareToStopParsing):
765         (WebCore::HTMLDocumentParser::pumpTokenizer):
766
767 2013-02-11  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
768
769         [texmap] Implement frames-per-second debug counter
770         https://bugs.webkit.org/show_bug.cgi?id=107942
771
772         Reviewed by Noam Rosenthal.
773
774         Adds FPS counter via WEBKIT_SHOW_FPS=<interval> environment variable,
775         where <interval> is the period in seconds (i.e. =1.5) between FPS
776         updates on screen. It is measured by counting
777         CoordinatedGraphicsScene::paintTo* calls and is painted using
778         drawRepaintCounter() after TextureMapperLayer has finished painting its
779         contents.
780
781         Visual debugging feature, no need for new tests.
782
783         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
784         (WebCore::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
785         (WebCore::CoordinatedGraphicsScene::paintToCurrentGLContext):
786         (WebCore::CoordinatedGraphicsScene::paintToGraphicsContext):
787         (WebCore::CoordinatedGraphicsScene::updateFPS):
788         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
789
790 2013-02-11  Eric Seidel  <eric@webkit.org>
791
792         Fold MarkupTokenBase into HTMLToken now that it has no other subclasses
793         https://bugs.webkit.org/show_bug.cgi?id=109483
794
795         Reviewed by Adam Barth.
796
797         This deletes an epic amount of template yuck, as well as removes
798         a vtable !?! from HTMLToken.
799
800         This paves the way for further cleanup of HTMLToken now that we
801         can see the whole object at once.
802         We'll also probably re-create an HTMLToken.cpp again, now that we're
803         free from the chains of template nonsense.
804
805         * GNUmakefile.list.am:
806         * Target.pri:
807         * WebCore.gypi:
808         * WebCore.vcproj/WebCore.vcproj:
809         * WebCore.vcxproj/WebCore.vcxproj:
810         * WebCore.vcxproj/WebCore.vcxproj.filters:
811         * WebCore.xcodeproj/project.pbxproj:
812         * html/parser/HTMLToken.h:
813         (WebCore::findAttributeInVector):
814         (WebCore):
815         (HTMLToken):
816         (Attribute):
817         (Range):
818         (WebCore::HTMLToken::HTMLToken):
819         (WebCore::HTMLToken::clear):
820         (WebCore::HTMLToken::isUninitialized):
821         (WebCore::HTMLToken::type):
822         (WebCore::HTMLToken::makeEndOfFile):
823         (WebCore::HTMLToken::startIndex):
824         (WebCore::HTMLToken::endIndex):
825         (WebCore::HTMLToken::setBaseOffset):
826         (WebCore::HTMLToken::end):
827         (WebCore::HTMLToken::data):
828         (WebCore::HTMLToken::isAll8BitData):
829         (WebCore::HTMLToken::name):
830         (WebCore::HTMLToken::appendToName):
831         (WebCore::HTMLToken::nameString):
832         (WebCore::HTMLToken::selfClosing):
833         (WebCore::HTMLToken::setSelfClosing):
834         (WebCore::HTMLToken::beginStartTag):
835         (WebCore::HTMLToken::beginEndTag):
836         (WebCore::HTMLToken::addNewAttribute):
837         (WebCore::HTMLToken::beginAttributeName):
838         (WebCore::HTMLToken::endAttributeName):
839         (WebCore::HTMLToken::beginAttributeValue):
840         (WebCore::HTMLToken::endAttributeValue):
841         (WebCore::HTMLToken::appendToAttributeName):
842         (WebCore::HTMLToken::appendToAttributeValue):
843         (WebCore::HTMLToken::attributes):
844         (WebCore::HTMLToken::eraseValueOfAttribute):
845         (WebCore::HTMLToken::ensureIsCharacterToken):
846         (WebCore::HTMLToken::characters):
847         (WebCore::HTMLToken::appendToCharacter):
848         (WebCore::HTMLToken::comment):
849         (WebCore::HTMLToken::beginComment):
850         (WebCore::HTMLToken::appendToComment):
851         (WebCore::HTMLToken::eraseCharacters):
852         * html/parser/HTMLTokenTypes.h:
853         * html/parser/XSSAuditor.h:
854         * xml/parser/MarkupTokenBase.h: Removed.
855
856 2013-02-11  Gavin Barraclough  <barraclough@apple.com>
857
858         PluginProcess should quit immediately if idle in response to low-memory notifications
859         https://bugs.webkit.org/show_bug.cgi?id=109103
860         <rdar://problem/12679827>
861
862         Reviewed by Brady Eidson.
863
864         This patch allows a process to set a custom callback for low memory warnings
865         (defaulting to the current behaviour, as implemented in releaseMemory).
866
867         * platform/MemoryPressureHandler.cpp:
868         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
869             - Initialize m_lowMemoryHandler to releaseMemory.
870         (WebCore::MemoryPressureHandler::install):
871         (WebCore::MemoryPressureHandler::uninstall):
872         (WebCore::MemoryPressureHandler::holdOff):
873             - Cleaned up spacing.
874         (WebCore::MemoryPressureHandler::releaseMemory):
875             - Added null implementation for non-Mac builds.
876         * platform/MemoryPressureHandler.h:
877         (WebCore::MemoryPressureHandler::setLowMemoryHandler):
878             - Added method to set m_lowMemoryHandler.
879         * platform/mac/MemoryPressureHandlerMac.mm:
880         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
881             - Changed to call releaseMemory via m_lowMemoryHandler.
882
883 2013-02-11  Simon Fraser  <simon.fraser@apple.com>
884
885         REGRESSION (r133807): Sticky-position review bar on bugzilla review page is jumpy
886         https://bugs.webkit.org/show_bug.cgi?id=104276
887         <rdar://problem/12827187>
888
889         Reviewed by Tim Horton.
890
891         When committing new scrolling tree state, if the root node has a scroll
892         position update, we would handle that before updating the state of child
893         nodes (with possibly new viewport constraints). That would cause incorrect
894         child layer updates.
895         
896         Fix by adding a second 'update' phase that happens after child nodes,
897         and moving the scroll position update into that.
898
899         Scrolling tests only dump the state tree, so cannot test the bug.
900
901         * page/FrameView.cpp:
902         (WebCore::FrameView::setScrollPosition): If the scroll position didn't
903         actually change, don't request a scroll position update from the ScrollingCoordinator.
904         * page/scrolling/ScrollingTree.cpp:
905         (WebCore::ScrollingTree::updateTreeFromStateNode): Keep track of the scrolling node so
906         that we can call updateAfterChildren() on it.
907         * page/scrolling/ScrollingTreeNode.h:
908         (ScrollingTreeNode):
909         (WebCore::ScrollingTreeNode::updateAfterChildren):
910         * page/scrolling/ScrollingTreeScrollingNode.cpp:
911         (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
912         * page/scrolling/ScrollingTreeScrollingNode.h:
913         (ScrollingTreeScrollingNode):
914         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
915         (WebCore::ScrollingCoordinatorMac::updateViewportConstrainedNode):
916         In the current bug the scrolling tree was scheduled for commit because of a
917         scroll position request, but if only the viewport constraints change, we also need
918         to commit the tree.
919         * page/scrolling/mac/ScrollingTreeFixedNode.h:
920         (ScrollingTreeFixedNode):
921         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
922         (WebCore::ScrollingTreeFixedNode::updateBeforeChildren):
923         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.h:
924         (ScrollingTreeScrollingNodeMac):
925         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
926         (WebCore::ScrollingTreeScrollingNodeMac::updateBeforeChildren):
927         (WebCore::ScrollingTreeScrollingNodeMac::updateAfterChildren): Move code here
928         that updates things that have to happen after children.
929         * page/scrolling/mac/ScrollingTreeStickyNode.h:
930         (ScrollingTreeStickyNode):
931         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
932         (WebCore::ScrollingTreeStickyNode::updateBeforeChildren):
933
934 2013-02-11  Roger Fong  <roger_fong@apple.com>
935
936         Unreviewed. Build fix for Win7 Release.
937         Because of InspectorAllInOne.cpp static globals must be named differently in files included by InspectorAllInOne.
938         This was the case for UserInitiatedProfileName. Also removed the repeated HeapProfileType definition in
939         InspectorHeapProfilerAgent.cpp since it wasn't being used anyways.
940
941         * inspector/InspectorHeapProfilerAgent.cpp:
942         (WebCore):
943         (WebCore::InspectorHeapProfilerAgent::takeHeapSnapshot):
944
945 2013-02-11  Tony Gentilcore  <tonyg@chromium.org>
946
947         SegmentedString's copy ctor should copy all fields
948         https://bugs.webkit.org/show_bug.cgi?id=109477
949
950         Reviewed by Adam Barth.
951
952         This fixes http/tests/inspector-enabled/document-write.html (and likely others) for the threaded HTML parser.
953
954         No new tests because covered by existing tests.
955
956         * platform/text/SegmentedString.cpp:
957         (WebCore::SegmentedString::SegmentedString):
958
959 2013-02-11  Joshua Bell  <jsbell@chromium.org>
960
961         IndexedDB: database connections don't close after versionchange transaction aborts
962         https://bugs.webkit.org/show_bug.cgi?id=102298
963
964         Reviewed by Tony Chang.
965
966         Per spec, close the database if the "versionchange" transaction aborts.
967
968         Tests: storage/indexeddb/aborted-versionchange-closes.html
969                storage/indexeddb/lazy-index-population.html
970                storage/objectstore-basics.html
971
972         * Modules/indexeddb/IDBTransaction.cpp:
973         (WebCore::IDBTransaction::onAbort): Tell the IDBDatabase (connection) to close if
974         this was a "versionchange" transaction.
975
976 2013-02-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
977
978         [EFL] fast/forms/number/number-l10n-input.html is failing
979         https://bugs.webkit.org/show_bug.cgi?id=109440
980
981         Reviewed by Laszlo Gombos.
982
983         Use LocaleICU instead of LocaleNone on EFL port. The EFL
984         port already depends on ICU library and we get additional
985         functionality this way.
986
987         No new tests, already covered by existing tests.
988
989         * CMakeLists.txt:
990         * PlatformBlackBerry.cmake:
991         * PlatformEfl.cmake:
992         * PlatformWinCE.cmake:
993
994 2013-02-11  Benjamin Poulain  <benjamin@webkit.org>
995
996         Kill TestRunner::setMinimumTimerInterval; implement the feature with InternalSettings
997         https://bugs.webkit.org/show_bug.cgi?id=109349
998
999         Reviewed by Sam Weinig.
1000
1001         Expose setMinimumTimerInterval() and implement the backup/restore to keep
1002         a consistent state between tests.
1003
1004         * testing/InternalSettings.cpp:
1005         (WebCore::InternalSettings::Backup::Backup):
1006         (WebCore::InternalSettings::Backup::restoreTo):
1007         (WebCore::InternalSettings::setMinimumTimerInterval):
1008         (WebCore):
1009         * testing/InternalSettings.h:
1010         (Backup):
1011         (InternalSettings):
1012         * testing/InternalSettings.idl:
1013
1014 2013-02-11  Dean Jackson  <dino@apple.com>
1015
1016         Source/WebCore: Snapshotted plug-in should use shadow root
1017         https://bugs.webkit.org/show_bug.cgi?id=108284
1018
1019         Reviewed by Simon Fraser.
1020
1021         Take three - relanding after rollout in r142400 that was caused by a global
1022         selector interfering with CSS Instrumentation in the Inspector.
1023
1024         A snapshotted plugin needs to indicate to the user that it can be clicked
1025         to be restarted. Previously this was done with an image that had embedded
1026         text. Instead, we now use an internal shadow root to embed some markup that
1027         will display instructions that can be localised.
1028
1029         The UA stylesheet for plug-ins provides a default styling for the label, which
1030         can be overridden by ports.
1031
1032         In the process, RenderSnapshottedPlugIn no longer inherits from RenderEmbeddedObject,
1033         since it is only responsible for drawing a paused plug-in. The snapshot creation
1034         can work with the default renderer, but a shadow root requires something like
1035         RenderBlock in order to draw its children. We swap from one renderer to another when
1036         necessary either by creating the shadow root or by explicitly detaching and attaching
1037         the plugin element.
1038
1039         Unfortunately this is difficult to test, because the snapshotting requires
1040         time to execute, and also a PluginView to be instantiated.
1041
1042         * css/plugIns.css:
1043         (object::-webkit-snapshotted-plugin-content): New rules for a default label style.
1044
1045         * platform/LocalizedStrings.cpp: Make sure all ports have plugin strings, now it is called.
1046         * platform/LocalizedStrings.h:
1047         * platform/blackberry/LocalizedStringsBlackBerry.cpp:
1048         * platform/chromium/LocalizedStringsChromium.cpp:
1049         * platform/efl/LocalizedStringsEfl.cpp:
1050         * platform/gtk/LocalizedStringsGtk.cpp:
1051         * platform/qt/LocalizedStringsQt.cpp:
1052
1053         * html/HTMLPlugInElement.cpp:
1054         (WebCore::HTMLPlugInElement::defaultEventHandler): Take into account the fact
1055         that RenderSnapshottedPlugIn no longer is an embedded object.
1056
1057         * html/HTMLPlugInImageElement.cpp:
1058         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): New default values in constructor.
1059         (WebCore::HTMLPlugInElement::defaultEventHandler): Make sure to call base class.
1060         (WebCore::HTMLPlugInElement::willRecalcStyle): No need to reattach if we're a snapshot.
1061         (WebCore::HTMLPlugInImageElement::createRenderer): If we're showing a snapshot, create such
1062             a renderer, otherwise use the typical plug-in path.
1063         (WebCore::HTMLPlugInImageElement::updateSnapshot): Keep a record of the snapshot, since we'll
1064             need to give it to the renderer.
1065         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Build a subtree that will display a label.
1066         * html/HTMLPlugInImageElement.h:
1067         (HTMLPlugInImageElement): New member variable to record the snapshot image and whether the label
1068             should show immediately.
1069         (WebCore::HTMLPlugInImageElement::swapRendererTimerFired): The callback function triggered when we need
1070             to swap to the Shadow Root.
1071         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): The user has tapped on the snapshot so the plugin
1072             in being recreated. Make sure we reattach so that a plugin renderer will be created.
1073         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Make sure we set the right
1074             displayState for snapshots.
1075         * html/HTMLPlugInImageElement.h:
1076         (HTMLPlugInImageElement): The new methods listed above.
1077         (WebCore::HTMLPlugInImageElement::setShouldShowSnapshotLabelAutomatically): Indicates whether or not
1078             a snapshot should be immediately labeled.
1079
1080         * page/ChromeClient.h: No need for plugInStartLabelImage any more.
1081
1082         * rendering/RenderSnapshottedPlugIn.cpp:
1083         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): New inheritance.
1084         (WebCore::RenderSnapshottedPlugIn::paint): If we're in the background paint phase, render the snapshot image.
1085         (WebCore::RenderSnapshottedPlugIn::paintSnapshotImage): Rename.
1086         (WebCore::RenderSnapshottedPlugIn::paintSnapshot): Rename.
1087         (WebCore::RenderSnapshottedPlugIn::paintSnapshotWithLabel): Rename. No need for label sizes.
1088         (WebCore::RenderSnapshottedPlugIn::getCursor):
1089         (WebCore::RenderSnapshottedPlugIn::handleEvent): The renderer doesn't restart the plug-in any more. Tell the element and it will do it.
1090         * rendering/RenderSnapshottedPlugIn.h:
1091         (RenderSnapshottedPlugIn): New inheritance. Some method renaming.
1092
1093 2013-02-11  Mike West  <mkwst@chromium.org>
1094
1095         CSP reports for blocked 'data:' URLs should report the scheme only.
1096         https://bugs.webkit.org/show_bug.cgi?id=109429
1097
1098         Reviewed by Adam Barth.
1099
1100         https://dvcs.w3.org/hg/content-security-policy/rev/001dc8e8bcc3 changed
1101         the CSP 1.1 spec to require that blocked URLs that don't refer to
1102         generally resolvable schemes (e.g. 'data:', 'javascript:', etc.) be
1103         stripped down to their scheme in violation reports.
1104
1105         Test: http/tests/security/contentSecurityPolicy/report-blocked-data-uri.html
1106
1107         * page/ContentSecurityPolicy.cpp:
1108         (WebCore::ContentSecurityPolicy::reportViolation):
1109             If the blocked URL is a web-resolvable scheme, apply the current
1110             stripping logic to it, otherwise, strip it to the scheme only.
1111         * platform/KURL.h:
1112         (KURL):
1113             Move KURL::isHierarchical() out into KURL's public API.
1114
1115 2013-02-11  Simon Fraser  <simon.fraser@apple.com>
1116
1117         ScrollingTree node maps keep getting larger
1118         https://bugs.webkit.org/show_bug.cgi?id=109348
1119
1120         Reviewed by Sam Weinig.
1121
1122         When navigating between pages, nodes would get left in the ScrollingTree's
1123         node map, and the ScrollingStateTree's node map, so these would get larger
1124         and larger as you browse.
1125         
1126         Simplify map maintenance by clearing the map when setting a new root node
1127         (which happens on the first commit of a new page). Also, don't keep root nodes
1128         around, but create them afresh for each page, which simplifies their ID
1129         management.
1130         
1131         This is closer to the original behavior; keeping the root nodes around was
1132         a fix for bug 99668, but we avoid regressing that fix by bailing early
1133         from frameViewLayoutUpdated() if there is no root state node (we'll get
1134         called again anyway).
1135         
1136         This now allows state nodeIDs to be purely read-only.
1137
1138         * page/scrolling/ScrollingStateNode.h:
1139         * page/scrolling/ScrollingStateTree.cpp:
1140         (WebCore::ScrollingStateTree::ScrollingStateTree):
1141         (WebCore::ScrollingStateTree::attachNode):
1142         (WebCore::ScrollingStateTree::clear):
1143         (WebCore::ScrollingStateTree::removeNode):
1144         * page/scrolling/ScrollingTree.cpp:
1145         (WebCore::ScrollingTree::updateTreeFromStateNode):
1146         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1147         (WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
1148
1149 2013-02-11  Simon Fraser  <simon.fraser@apple.com>
1150
1151         Move m_stateNodeMap from ScrollingCoordinatorMac to ScrollingStateTree
1152         https://bugs.webkit.org/show_bug.cgi?id=109361
1153
1154         Reviewed by Sam Weinig.
1155         
1156         The map of scrolling node IDs to ScollingStateNodes was maintained by
1157         ScrollingCoordinatorMac, rather than ScrollingStateTree. This is different
1158         from the ScrollingTree (which owns its node map), and added some amount
1159         of to-and-fro between ScrollingStateTree and ScrollingCoordinatorMac.
1160         
1161         Having ScrollingCoordinatorMac maintain the map of IDs to state nodes
1162         simplifies things.
1163
1164         No behavior change.
1165
1166         * page/scrolling/ScrollingStateTree.cpp:
1167         (WebCore::ScrollingStateTree::attachNode):
1168         (WebCore::ScrollingStateTree::detachNode):
1169         (WebCore::ScrollingStateTree::clear):
1170         (WebCore::ScrollingStateTree::removeNode):
1171         (WebCore::ScrollingStateTree::stateNodeForID):
1172         * page/scrolling/ScrollingStateTree.h:
1173         (ScrollingStateTree): Remove some stale comments.
1174         (WebCore::ScrollingStateTree::removedNodes):
1175         * page/scrolling/mac/ScrollingCoordinatorMac.h:
1176         (ScrollingCoordinatorMac):
1177         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1178         (WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated):
1179         (WebCore::ScrollingCoordinatorMac::recomputeWheelEventHandlerCountForFrameView):
1180         (WebCore::ScrollingCoordinatorMac::frameViewRootLayerDidChange):
1181         (WebCore::ScrollingCoordinatorMac::requestScrollPositionUpdate):
1182         (WebCore::ScrollingCoordinatorMac::attachToStateTree):
1183         (WebCore::ScrollingCoordinatorMac::detachFromStateTree):
1184         (WebCore::ScrollingCoordinatorMac::clearStateTree):
1185         (WebCore::ScrollingCoordinatorMac::updateScrollingNode):
1186         (WebCore::ScrollingCoordinatorMac::updateViewportConstrainedNode):
1187
1188 2013-02-11  Mark Rowe  <mrowe@apple.com>
1189
1190         Build fix.
1191
1192         * platform/mac/PlatformSpeechSynthesizerMac.mm: Fix the case in the include.
1193
1194 2013-02-11  Julien Chaffraix  <jchaffraix@webkit.org>
1195
1196         Regression(r131539): Heap-use-after-free in WebCore::RenderBlock::willBeDestroyed
1197         https://bugs.webkit.org/show_bug.cgi?id=107189
1198
1199         Reviewed by Abhishek Arya.
1200
1201         Test: fast/dynamic/continuation-detach-crash.html
1202
1203         This patch reverts r131539 and the following changes (r132591 and r139664).
1204         This means we redo detaching from the bottom-up which solves the regression.
1205         It fixes the attached test case as we re-attach child nodes before detaching
1206         the parent. It seems wrong to do but this avoid a stale continuation.
1207
1208         * dom/ContainerNode.cpp:
1209         (WebCore::ContainerNode::detach): Detach the children first, then ourself.
1210         * dom/Node.cpp:
1211         (WebCore::Node::detach): Clear the renderer instead of ASSERT'ing.
1212         * rendering/RenderObject.cpp:
1213         (WebCore::RenderObject::willBeDestroyed): Removed the code to clear the associated node's renderer.
1214         (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
1215         * rendering/RenderObjectChildList.cpp:
1216         (WebCore::RenderObjectChildList::removeChildNode):
1217         Moved the repainting logic back into removeChildNode from destroyAndCleanupAnonymousWrappers.
1218         (WebCore::RenderObjectChildList::destroyLeftoverChildren): Re-added the code to clear the associated node's
1219         renderer.
1220         * rendering/RenderTextFragment.cpp:
1221         (WebCore::RenderTextFragment::setText): Re-added the code to set the associated node's renderer.
1222
1223         * dom/ContainerNode.cpp:
1224         (WebCore::ContainerNode::detach):
1225         * dom/Node.cpp:
1226         (WebCore::Node::detach):
1227         * rendering/RenderObject.cpp:
1228         (WebCore::RenderObject::willBeDestroyed):
1229         (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
1230         * rendering/RenderObjectChildList.cpp:
1231         (WebCore::RenderObjectChildList::destroyLeftoverChildren):
1232         (WebCore::RenderObjectChildList::removeChildNode):
1233         * rendering/RenderTextFragment.cpp:
1234         (WebCore::RenderTextFragment::setText):
1235
1236 2013-02-11  Eric Seidel  <eric@webkit.org>
1237
1238         Make WebVTTTokenizer stop inheriting from MarkupTokenizerBase
1239         https://bugs.webkit.org/show_bug.cgi?id=109411
1240
1241         Reviewed by Adam Barth.
1242
1243         Moved InputStreamPreprocessor into its own header file so it can be
1244         used by both WebVTTTokenizer and HTMLTokenizer.
1245
1246         Also split out kEndOfFileMarker from InputStreamPreprocessor<T> so that
1247         it can be used w/o a specific instantiation of the template class.
1248         This also made it possible to fix three old fixmes about wanting to share
1249         that constant.
1250
1251         Again, separating WebVTT code from Markup* base classes made it simpler
1252         at the cost of a little copy/paste code.  WebVTT tokenization is remarkably
1253         simple compared to HTML.
1254
1255         This will make it immediately possible to pull MarkupTokenizerBase up into
1256         HTMLTokenizer and further simplify the code.
1257
1258         * GNUmakefile.list.am:
1259         * Target.pri:
1260         * WebCore.gypi:
1261         * WebCore.vcproj/WebCore.vcproj:
1262         * WebCore.vcxproj/WebCore.vcxproj:
1263         * WebCore.vcxproj/WebCore.vcxproj.filters:
1264         * WebCore.xcodeproj/project.pbxproj:
1265         * html/parser/BackgroundHTMLParser.cpp:
1266         (WebCore::BackgroundHTMLParser::markEndOfFile):
1267         * html/parser/HTMLInputStream.h:
1268         (WebCore::HTMLInputStream::markEndOfFile):
1269         * html/parser/HTMLTokenizer.cpp:
1270         (WebCore::HTMLTokenizer::nextToken):
1271         * html/parser/InputStreamPreprocessor.h: Added.
1272         (WebCore):
1273         (InputStreamPreprocessor):
1274         (WebCore::InputStreamPreprocessor::InputStreamPreprocessor):
1275         (WebCore::InputStreamPreprocessor::nextInputCharacter):
1276         (WebCore::InputStreamPreprocessor::peek):
1277         (WebCore::InputStreamPreprocessor::advance):
1278         (WebCore::InputStreamPreprocessor::skipNextNewLine):
1279         (WebCore::InputStreamPreprocessor::reset):
1280         (WebCore::InputStreamPreprocessor::shouldTreatNullAsEndOfFileMarker):
1281         * html/track/WebVTTTokenizer.cpp:
1282         (WebCore::WebVTTTokenizer::WebVTTTokenizer):
1283         (WebCore::WebVTTTokenizer::nextToken):
1284         * html/track/WebVTTTokenizer.h:
1285         (WebVTTTokenizer):
1286         (WebCore::WebVTTTokenizer::haveBufferedCharacterToken):
1287         (WebCore::WebVTTTokenizer::bufferCharacter):
1288         (WebCore::WebVTTTokenizer::emitAndResumeIn):
1289         (WebCore::WebVTTTokenizer::emitEndOfFile):
1290         (WebCore::WebVTTTokenizer::shouldSkipNullCharacters):
1291         * xml/parser/MarkupTokenizerBase.h:
1292         (MarkupTokenizerBase):
1293         (WebCore::MarkupTokenizerBase::bufferCharacter):
1294
1295 2013-02-11  Adam Barth  <abarth@webkit.org>
1296
1297         document.write during window.onload can trigger DumpRenderTree to dump the render tree
1298         https://bugs.webkit.org/show_bug.cgi?id=109465
1299
1300         Reviewed by Eric Seidel.
1301
1302         This patch is a partial revert of
1303         http://trac.webkit.org/changeset/142378. It's not safe to call
1304         checkComplete during the load event. We'll need to find another way of
1305         calling checkComplete at the right time.
1306
1307         Test: fast/parser/document-write-during-load.html
1308
1309         * dom/Document.cpp:
1310         (WebCore::Document::decrementActiveParserCount):
1311
1312 2013-02-11  Andrey Kosyakov  <caseq@chromium.org>
1313
1314         Web Inspector: Timeline: invalidate and force locations are same for Layout records caused by style recalculaiton
1315         https://bugs.webkit.org/show_bug.cgi?id=109294
1316
1317         Reviewed by Pavel Feldman.
1318
1319         Use the stack that caused style recalculation as a cause for relayout performed due to
1320         layout invalidation caused by style recalculation.
1321
1322         * inspector/front-end/TimelinePresentationModel.js:
1323         (WebInspector.TimelinePresentationModel.prototype.reset):
1324         (WebInspector.TimelinePresentationModel.Record):
1325
1326 2013-02-01  Andrey Kosyakov  <caseq@chromium.org>
1327
1328         Web Inspector: [Extension API] adjust inspectedWindow.eval() callback parameters to expose non-exceptional error
1329         https://bugs.webkit.org/show_bug.cgi?id=108640
1330
1331         Reviewed by Vsevolod Vlasov.
1332
1333         - only set first parameter to eval() callback iff expression successfully evaluates;
1334         - use object, not bool as second parameter;
1335         - pass exceptions and extension errors as second parameter if evaluate failed;
1336         - minor drive-by changes in ExtensionAPI utilities.
1337
1338         * inspector/front-end/ExtensionAPI.js:
1339         (injectedExtensionAPI.ExtensionSidebarPaneImpl.prototype.setExpression):
1340         (injectedExtensionAPI.InspectedWindow.prototype.):
1341         (injectedExtensionAPI.InspectedWindow.prototype.eval):
1342         (injectedExtensionAPI.extractCallbackArgument):
1343         * inspector/front-end/ExtensionServer.js:
1344         (WebInspector.ExtensionServer.prototype.):
1345         (WebInspector.ExtensionServer.prototype._onEvaluateOnInspectedPage):
1346         (WebInspector.ExtensionStatus):
1347
1348 2013-02-11  Andrey Kosyakov  <caseq@chromium.org>
1349
1350         Web Inspector: [Extensions API] expose ExtensionServerClient to tests so tests use same port as extensions API
1351         https://bugs.webkit.org/show_bug.cgi?id=109443
1352
1353         Reviewed by Vsevolod Vlasov.
1354
1355         Promote extensionServer var to the outer closure, so it may be accessed by platform-specific (or test) code.
1356
1357         * inspector/front-end/ExtensionAPI.js:
1358         (buildExtensionAPIInjectedScript):
1359
1360 2013-02-11  Eric Seidel  <eric@webkit.org>
1361
1362         Move WebVTTToken off of MarkupTokenBase
1363         https://bugs.webkit.org/show_bug.cgi?id=109410
1364
1365         Reviewed by Tony Gentilcore.
1366
1367         This introduces a small amount of "copy/paste" code
1368         but actually makes WebVTTToken much smaller and simpler!
1369         This also frees the HTMLParser to have its Token class
1370         back to itself so we can tune it to make HTML faster.
1371
1372         * html/track/WebVTTToken.h:
1373         (WebVTTToken):
1374         (WebCore::WebVTTToken::WebVTTToken):
1375         (WebCore::WebVTTToken::appendToName):
1376         (WebCore::WebVTTToken::type):
1377         (WebCore::WebVTTToken::name):
1378         (WebCore::WebVTTToken::ensureIsCharacterToken):
1379         (WebCore::WebVTTToken::appendToCharacter):
1380         (WebCore::WebVTTToken::beginEmptyStartTag):
1381         (WebCore::WebVTTToken::beginStartTag):
1382         (WebCore::WebVTTToken::beginEndTag):
1383         (WebCore::WebVTTToken::beginTimestampTag):
1384         (WebCore::WebVTTToken::makeEndOfFile):
1385         (WebCore::WebVTTToken::clear):
1386
1387 2013-02-11  Joshua Bell  <jsbell@chromium.org>
1388
1389         [V8] IndexedDB: Minor GC can collect IDBDatabase wrapper with versionchange handler
1390         https://bugs.webkit.org/show_bug.cgi?id=108670
1391
1392         Reviewed by Kentaro Hara.
1393
1394         Prevent IDBDatabase's wrapper from being GC'd while the database is open if it has
1395         listeners, as those listeners may close the database in response to events.
1396
1397         Also, removed extraneous super-calls from hasPendingActivity() overrides.
1398
1399         Test: storage/indexeddb/database-wrapper.html
1400
1401         * Modules/indexeddb/IDBDatabase.cpp:
1402         (WebCore::IDBDatabase::hasPendingActivity): Implemented.
1403         * Modules/indexeddb/IDBDatabase.h: Declared.
1404         * Modules/indexeddb/IDBRequest.cpp:
1405         (WebCore::IDBRequest::hasPendingActivity): Simplified.
1406         * Modules/indexeddb/IDBTransaction.cpp:
1407         (WebCore::IDBTransaction::hasPendingActivity): Simplified.
1408
1409 2013-02-11  Eric Seidel  <eric@webkit.org>
1410
1411         Remove AttributeBase now that NEW_XML is gone
1412         https://bugs.webkit.org/show_bug.cgi?id=109408
1413
1414         Reviewed by Adam Barth.
1415
1416         Just deleting code.  HTMLToken::Attribute is now just
1417         the real class and not a typedef.
1418
1419         * html/parser/CompactHTMLToken.cpp:
1420         (WebCore::CompactHTMLToken::CompactHTMLToken):
1421         * html/parser/HTMLTokenizer.cpp:
1422         (WebCore::AtomicHTMLToken::nameForAttribute):
1423         * xml/parser/MarkupTokenBase.h:
1424         (WebCore):
1425         (MarkupTokenBase):
1426         (Attribute):
1427         (Range):
1428
1429 2013-02-11  Eric Seidel  <eric@webkit.org>
1430
1431         Rename PreloadTask to StartTagScanner to match its purpose
1432         https://bugs.webkit.org/show_bug.cgi?id=109406
1433
1434         Reviewed by Sam Weinig.
1435
1436         As discussed in bug 107807.
1437
1438         * html/parser/HTMLPreloadScanner.cpp:
1439         (WebCore::StartTagScanner::StartTagScanner):
1440         (WebCore::StartTagScanner::processAttributes):
1441         (WebCore::HTMLPreloadScanner::processToken):
1442
1443 2013-02-11  Vsevolod Vlasov  <vsevik@chromium.org>
1444
1445         Web Inspector: WebInspector.Project refactorings.
1446         https://bugs.webkit.org/show_bug.cgi?id=109433
1447
1448         Reviewed by Alexander Pavlov.
1449
1450         This change prepares Workspace and Project to migration to project-per-domain mode for network based projects.
1451         Renamed WebInspector.WorkspaceProvider to WebInspector.ProjectDelegate.
1452         Renamed Project.name() to Project.id() and delegated it to project delegate.
1453         Added Project.displayName() method that is delegated to project delegate.
1454         SimpleWorkspaceProvider is now responsible for creation of SimpleWorkspaceDelegates and
1455         isolates various mappings from Project/ProjectDelegate concept.
1456         UISourceCode is now created based on path in the project.
1457         UISourceCode uri is now calculated based on project and path (right now uri is equal to path).
1458
1459         * WebCore.gypi:
1460         * WebCore.vcproj/WebCore.vcproj:
1461         * inspector/compile-front-end.py:
1462         * inspector/front-end/FileSystemProjectDelegate.js: Renamed from Source/WebCore/inspector/front-end/FileSystemWorkspaceProvider.js.
1463         (WebInspector.FileSystemProjectDelegate):
1464         (WebInspector.FileSystemProjectDelegate.prototype.id):
1465         (WebInspector.FileSystemProjectDelegate.prototype.type):
1466         (WebInspector.FileSystemProjectDelegate.prototype.displayName):
1467         (WebInspector.FileSystemProjectDelegate.prototype.innerCallback):
1468         (WebInspector.FileSystemProjectDelegate.prototype.requestFileContent):
1469         (WebInspector.FileSystemProjectDelegate.prototype.setFileContent):
1470         (WebInspector.FileSystemProjectDelegate.prototype.contentCallback):
1471         (WebInspector.FileSystemProjectDelegate.prototype.searchInFileContent):
1472         (WebInspector.FileSystemProjectDelegate.prototype._contentTypeForPath):
1473         (WebInspector.FileSystemProjectDelegate.prototype._populate.filesLoaded):
1474         (WebInspector.FileSystemProjectDelegate.prototype._populate):
1475         (WebInspector.FileSystemProjectDelegate.prototype._addFile):
1476         (WebInspector.FileSystemProjectDelegate.prototype._removeFile):
1477         (WebInspector.FileSystemProjectDelegate.prototype.reset):
1478         (WebInspector.FileSystemUtils):
1479         (WebInspector.FileSystemUtils.errorHandler):
1480         (WebInspector.FileSystemUtils.requestFileSystem):
1481         (.fileSystemLoaded):
1482         (.innerCallback):
1483         (WebInspector.FileSystemUtils.requestFilesRecursive):
1484         (.fileEntryLoaded):
1485         (.fileLoaded):
1486         (.readerLoadEnd):
1487         (WebInspector.FileSystemUtils.requestFileContent):
1488         (.fileWriterCreated.fileTruncated):
1489         (.fileWriterCreated):
1490         (.writerEnd):
1491         (WebInspector.FileSystemUtils.setFileContent):
1492         (WebInspector.FileSystemUtils._getDirectory):
1493         (.toArray):
1494         (WebInspector.FileSystemUtils._readDirectory):
1495         (WebInspector.FileSystemUtils._requestEntries):
1496         * inspector/front-end/IsolatedFileSystemModel.js:
1497         (WebInspector.IsolatedFileSystemModel.prototype._innerAddFileSystem):
1498         * inspector/front-end/SimpleWorkspaceProvider.js:
1499         (WebInspector.SimpleProjectDelegate):
1500         (WebInspector.SimpleProjectDelegate.prototype.id):
1501         (WebInspector.SimpleProjectDelegate.prototype.displayName):
1502         (WebInspector.SimpleProjectDelegate.prototype.requestFileContent):
1503         (WebInspector.SimpleProjectDelegate.prototype.setFileContent):
1504         (WebInspector.SimpleProjectDelegate.prototype.searchInFileContent):
1505         (WebInspector.SimpleProjectDelegate.prototype.addFile):
1506         (WebInspector.SimpleProjectDelegate.prototype._uniquePath):
1507         (WebInspector.SimpleProjectDelegate.prototype.removeFile):
1508         (WebInspector.SimpleProjectDelegate.prototype.reset):
1509         (WebInspector.SimpleWorkspaceProvider):
1510         (WebInspector.SimpleWorkspaceProvider.uriForURL):
1511         (WebInspector.SimpleWorkspaceProvider.prototype.addFileForURL):
1512         (WebInspector.SimpleWorkspaceProvider.prototype.addUniqueFileForURL):
1513         (WebInspector.SimpleWorkspaceProvider.prototype._innerAddFileForURL):
1514         (WebInspector.SimpleWorkspaceProvider.prototype.removeFile):
1515         (WebInspector.SimpleWorkspaceProvider.prototype.reset):
1516         * inspector/front-end/UISourceCode.js:
1517         (WebInspector.UISourceCode):
1518         (WebInspector.UISourceCode.prototype.path):
1519         (WebInspector.UISourceCode.prototype.uri):
1520         * inspector/front-end/WebKit.qrc:
1521         * inspector/front-end/Workspace.js:
1522         (WebInspector.FileDescriptor):
1523         (WebInspector.ProjectDelegate):
1524         (WebInspector.ProjectDelegate.prototype.id):
1525         (WebInspector.ProjectDelegate.prototype.displayName):
1526         (WebInspector.ProjectDelegate.prototype.requestFileContent):
1527         (WebInspector.ProjectDelegate.prototype.setFileContent):
1528         (WebInspector.ProjectDelegate.prototype.searchInFileContent):
1529         (WebInspector.Project):
1530         (WebInspector.Project.prototype.id):
1531         (WebInspector.Project.prototype.type):
1532         (WebInspector.Project.prototype.displayName):
1533         (WebInspector.Project.prototype.isServiceProject):
1534         (WebInspector.Project.prototype._fileAdded):
1535         (WebInspector.Project.prototype._fileRemoved):
1536         (WebInspector.Project.prototype._reset):
1537         (WebInspector.Project.prototype.uiSourceCode):
1538         (WebInspector.Project.prototype.uiSourceCodeForOriginURL):
1539         (WebInspector.Project.prototype.uiSourceCodeForURI):
1540         (WebInspector.Project.prototype.uiSourceCodes):
1541         (WebInspector.Project.prototype.requestFileContent):
1542         (WebInspector.Project.prototype.setFileContent):
1543         (WebInspector.Project.prototype.searchInFileContent):
1544         (WebInspector.Project.prototype.dispose):
1545         (WebInspector.Workspace.prototype.uiSourceCode):
1546         (WebInspector.Workspace.prototype.uiSourceCodeForURI):
1547         (WebInspector.Workspace.prototype.addProject):
1548         (WebInspector.Workspace.prototype.removeProject):
1549         (WebInspector.Workspace.prototype.project):
1550         (WebInspector.Workspace.prototype.uiSourceCodes):
1551         (WebInspector.Workspace.prototype.projectForUISourceCode):
1552         * inspector/front-end/inspector.html:
1553
1554 2013-02-11  Yury Semikhatsky  <yurys@chromium.org>
1555
1556         Web Inspector: fix closure compiler warnings in the profiler code
1557         https://bugs.webkit.org/show_bug.cgi?id=109432
1558
1559         Reviewed by Pavel Feldman.
1560
1561         Updated type annotations to match the code.
1562
1563         * inspector/front-end/NativeMemorySnapshotView.js:
1564         * inspector/front-end/ProfilesPanel.js:
1565
1566 2013-02-11  Alexander Shalamov  <alexander.shalamov@intel.com>
1567
1568         [QT] Regression (r142444): Broke qt linux minimal build
1569         https://bugs.webkit.org/show_bug.cgi?id=109423
1570
1571         Reviewed by Kenneth Rohde Christiansen.
1572
1573         Test: cssom/cssvalue-comparison.html
1574
1575         * css/CSSValue.cpp:
1576         (WebCore::CSSValue::equals):
1577
1578 2013-02-11  Andrey Lushnikov  <lushnikov@chromium.org>
1579
1580         Web Inspector: introduce WebInspector.TextUtils
1581         https://bugs.webkit.org/show_bug.cgi?id=109289
1582
1583         Reviewed by Pavel Feldman.
1584
1585         Add new WebInspector.TextUtils file and extract commonly used
1586         text-operation subroutines from DefaultTextEditor into it.
1587
1588         No new tests: no change in behaviour.
1589
1590         * WebCore.gypi:
1591         * WebCore.vcproj/WebCore.vcproj:
1592         * inspector/compile-front-end.py:
1593         * inspector/front-end/DefaultTextEditor.js:
1594         (WebInspector.TextEditorMainPanel.TokenHighlighter.prototype._isWord):
1595         (WebInspector.DefaultTextEditor.WordMovementController.prototype._rangeForCtrlArrowMove):
1596         (WebInspector.TextEditorMainPanel.BraceHighlightController.prototype.handleSelectionChange):
1597         * inspector/front-end/TextUtils.js: Added.
1598         (WebInspector.TextUtils.isStopChar):
1599         (WebInspector.TextUtils.isWordChar):
1600         (WebInspector.TextUtils.isSpaceChar):
1601         (WebInspector.TextUtils.isWord):
1602         (WebInspector.TextUtils.isBraceChar):
1603         * inspector/front-end/WebKit.qrc:
1604         * inspector/front-end/inspector.html:
1605
1606 2013-02-11  Zan Dobersek  <zdobersek@igalia.com>
1607
1608         [GTK][Clang] Build errors in LocalizedStringsGtk.cpp
1609         https://bugs.webkit.org/show_bug.cgi?id=109418
1610
1611         Reviewed by Philippe Normand.
1612
1613         Use the C++ isfinite(float) and abs(float) (instead of fabsf(float))
1614         methods by including the WTF MathExtras.h header. Use a static cast to
1615         an integer type on the float return value of the abs(float) method call
1616         instead of the C-style cast.
1617
1618         No new tests - no new functiolnality.
1619
1620         * platform/gtk/LocalizedStringsGtk.cpp:
1621         (WebCore::localizedMediaTimeDescription):
1622
1623 2013-02-11  Zan Dobersek  <zdobersek@igalia.com>
1624
1625         Unreviewed build fix for the WTFURL backend of KURL.
1626
1627         * platform/KURL.cpp:
1628         (WebCore::KURL::isSafeToSendToAnotherThread): m_urlImpl is of RefPtr type so use
1629         the appropriate operator on it when calling the isSafeToSendToAnotherThread method.
1630
1631 2013-02-11  Mike West  <mkwst@chromium.org>
1632
1633         Range::collapsed callers should explicitly ASSERT_NO_EXCEPTION.
1634         https://bugs.webkit.org/show_bug.cgi?id=108921
1635
1636         Reviewed by Jochen Eisinger.
1637
1638         For clarity and consistency, this patch adjusts Range::collapsed() to
1639         drop the default value of the ExceptionCode parameter it accepts. The
1640         three call sites that called the method with no arguments (all part of
1641         Editor::rangeOfString) will now explicitly ASSERT_NO_EXCEPTION.
1642
1643         * dom/Range.h:
1644         (Range):
1645         * editing/Editor.cpp:
1646         (WebCore::Editor::rangeOfString):
1647
1648 2013-02-11  Alexei Filippov  <alph@chromium.org>
1649
1650         Web Inspector: Split Profiler domain in protocol into Profiler and HeapProfiler
1651         https://bugs.webkit.org/show_bug.cgi?id=108653
1652
1653         Reviewed by Yury Semikhatsky.
1654
1655         Currently CPU and heap profilers share the same domain 'Profiler' in the protocol.
1656         In fact these two profile types have not too much in common. So put each into its own domain.
1657         It should also help when Profiles panel gets split into several tools.
1658         This is the phase 1 which adds InspectorHeapProfilerAgent but doesn't
1659         change the original InspectorProfilerAgent.
1660
1661         * CMakeLists.txt:
1662         * GNUmakefile.list.am:
1663         * Target.pri:
1664         * WebCore.gypi:
1665         * WebCore.vcproj/WebCore.vcproj:
1666         * WebCore.vcxproj/WebCore.vcxproj:
1667         * WebCore.vcxproj/WebCore.vcxproj.filters:
1668         * WebCore.xcodeproj/project.pbxproj:
1669         * inspector/Inspector.json:
1670         * inspector/InspectorAllInOne.cpp:
1671         * inspector/InspectorController.cpp:
1672         (WebCore::InspectorController::InspectorController):
1673         * inspector/InspectorHeapProfilerAgent.cpp: Added.
1674         (WebCore):
1675         (WebCore::InspectorHeapProfilerAgent::create):
1676         (WebCore::InspectorHeapProfilerAgent::InspectorHeapProfilerAgent):
1677         (WebCore::InspectorHeapProfilerAgent::~InspectorHeapProfilerAgent):
1678         (WebCore::InspectorHeapProfilerAgent::resetState):
1679         (WebCore::InspectorHeapProfilerAgent::resetFrontendProfiles):
1680         (WebCore::InspectorHeapProfilerAgent::setFrontend):
1681         (WebCore::InspectorHeapProfilerAgent::clearFrontend):
1682         (WebCore::InspectorHeapProfilerAgent::restore):
1683         (WebCore::InspectorHeapProfilerAgent::collectGarbage):
1684         (WebCore::InspectorHeapProfilerAgent::createSnapshotHeader):
1685         (WebCore::InspectorHeapProfilerAgent::hasHeapProfiler):
1686         (WebCore::InspectorHeapProfilerAgent::getProfileHeaders):
1687         (WebCore::InspectorHeapProfilerAgent::getHeapSnapshot):
1688         (WebCore::InspectorHeapProfilerAgent::removeProfile):
1689         (WebCore::InspectorHeapProfilerAgent::takeHeapSnapshot):
1690         (WebCore::InspectorHeapProfilerAgent::getObjectByHeapObjectId):
1691         (WebCore::InspectorHeapProfilerAgent::getHeapObjectId):
1692         (WebCore::InspectorHeapProfilerAgent::reportMemoryUsage):
1693         * inspector/InspectorHeapProfilerAgent.h: Added.
1694         (WebCore):
1695         (InspectorHeapProfilerAgent):
1696         (WebCore::InspectorHeapProfilerAgent::clearProfiles):
1697         * inspector/InspectorInstrumentation.cpp:
1698         (WebCore):
1699         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1700         * inspector/InstrumentingAgents.h:
1701         (WebCore):
1702         (InstrumentingAgents):
1703         (WebCore::InstrumentingAgents::inspectorHeapProfilerAgent):
1704         (WebCore::InstrumentingAgents::setInspectorHeapProfilerAgent):
1705         * inspector/WorkerInspectorController.cpp:
1706         (WebCore::WorkerInspectorController::WorkerInspectorController):
1707         * inspector/front-end/HeapSnapshotDataGrids.js:
1708         * inspector/front-end/HeapSnapshotGridNodes.js:
1709         (WebInspector.HeapSnapshotGenericObjectNode.prototype.queryObjectContent):
1710         * inspector/front-end/HeapSnapshotView.js:
1711         (WebInspector.HeapProfileHeader.prototype.startSnapshotTransfer):
1712         (WebInspector.HeapProfileHeader.prototype.saveToFile.onOpen):
1713         (WebInspector.HeapProfileHeader.prototype.saveToFile):
1714         * inspector/front-end/ProfilesPanel.js:
1715         (WebInspector.ProfilesPanel):
1716         (WebInspector.ProfilesPanel.prototype._clearProfiles):
1717         (WebInspector.ProfilesPanel.prototype._garbageCollectButtonClicked):
1718         (WebInspector.ProfilesPanel.prototype._removeProfileHeader):
1719         (WebInspector.ProfilesPanel.prototype._populateProfiles.var):
1720         (WebInspector.ProfilesPanel.prototype._populateProfiles.populateCallback):
1721         (WebInspector.ProfilesPanel.prototype._populateProfiles):
1722         (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
1723         (WebInspector.ProfilesPanel.prototype.revealInView):
1724         (WebInspector.HeapProfilerDispatcher):
1725         (WebInspector.HeapProfilerDispatcher.prototype.addProfileHeader):
1726         (WebInspector.HeapProfilerDispatcher.prototype.addHeapSnapshotChunk):
1727         (WebInspector.HeapProfilerDispatcher.prototype.finishHeapSnapshot):
1728         (WebInspector.HeapProfilerDispatcher.prototype.resetProfiles):
1729         (WebInspector.HeapProfilerDispatcher.prototype.reportHeapSnapshotProgress):
1730         * inspector/front-end/TimelinePanel.js:
1731         (WebInspector.TimelinePanel.prototype._garbageCollectButtonClicked):
1732         * inspector/front-end/inspector.js:
1733         (WebInspector.doLoadedDone):
1734
1735 2013-02-11  Mike West  <mkwst@chromium.org>
1736
1737         Use IGNORE_EXCEPTION for Editor::countMatchesForText's ignored exceptions.
1738         https://bugs.webkit.org/show_bug.cgi?id=109372
1739
1740         Reviewed by Jochen Eisinger.
1741
1742         Rather than implicitly ignoring exceptions, we should use the
1743         IGNORE_EXCEPTION macro for clarity.
1744
1745         * editing/Editor.cpp:
1746         (WebCore::Editor::countMatchesForText):
1747
1748 2013-02-11  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
1749
1750         [Qt] Unreviewed. Fix minimal build after r142444.
1751
1752         * css/CSSValue.cpp:
1753         (WebCore::CSSValue::equals):
1754
1755 2013-02-11  Christophe Dumez  <ch.dumez@sisa.samsung.com>
1756
1757         [EFL] Stop using smart pointers for Ecore_Timer
1758         https://bugs.webkit.org/show_bug.cgi?id=109409
1759
1760         Reviewed by Kenneth Rohde Christiansen.
1761
1762         Stop using a smart pointer for Ecore_Timer in RunLoop::TimerBase. This
1763         is a bad idea because the timer handle becomes invalid as soon as the
1764         timer callback returns ECORE_CALLBACK_CANCEL. This may lead to crashes
1765         on destruction because OwnPtr calls ecore_timer_del() on an invalid
1766         handle.
1767
1768         No new tests, already covered by exiting tests.
1769
1770         * platform/RunLoop.h:
1771         (TimerBase):
1772         * platform/efl/RunLoopEfl.cpp:
1773         (WebCore::RunLoop::TimerBase::timerFired):
1774         (WebCore::RunLoop::TimerBase::start):
1775         (WebCore::RunLoop::TimerBase::stop):
1776
1777 2013-02-11  Vladislav Kaznacheev  <kaznacheev@chromium.org>
1778
1779         Web Inspector: Allow SplitView to keep the sidebar size as a fraction of the container size
1780         https://bugs.webkit.org/show_bug.cgi?id=109414
1781
1782         Reviewed by Vsevolod Vlasov.
1783
1784         SplitView now interprets defaultSidebarWidth and defaultSidebarHeight values between 0 and 1 as
1785         fractions of the total container size. The sidebar then will grow or shrink along with the container.
1786         When the sidebar is resized manually the updated ratio is stored in the settings.
1787
1788         * inspector/front-end/SplitView.js:
1789         (WebInspector.SplitView):
1790         (WebInspector.SplitView.prototype._removeAllLayoutProperties):
1791         (WebInspector.SplitView.prototype._updateTotalSize):
1792         (WebInspector.SplitView.prototype._innerSetSidebarSize):
1793         (WebInspector.SplitView.prototype._saveSidebarSize):
1794
1795 2013-02-11  Pavel Feldman  <pfeldman@chromium.org>
1796
1797         Web Inspector: highlight DOM nodes on hover while debugging
1798         https://bugs.webkit.org/show_bug.cgi?id=109355
1799
1800         Reviewed by Vsevolod Vlasov.
1801
1802         Along with showing the popover, highlight the remote object as node.
1803
1804         * inspector/front-end/ObjectPopoverHelper.js:
1805         (WebInspector.ObjectPopoverHelper.prototype.):
1806         (WebInspector.ObjectPopoverHelper.prototype._showObjectPopover):
1807         (WebInspector.ObjectPopoverHelper.prototype._onHideObjectPopover):
1808
1809 2013-02-11  Andrey Lushnikov  <lushnikov@chromium.org>
1810
1811         Web Inspector: displaying whitespace characters is broken
1812         https://bugs.webkit.org/show_bug.cgi?id=109412
1813
1814         Reviewed by Vsevolod Vlasov.
1815
1816         Add "pointer-events: none" rule for pseudo-class "before", which
1817         maintains rendering of whitespace characters.
1818
1819         No new tests.
1820
1821         * inspector/front-end/inspectorSyntaxHighlight.css:
1822         (.webkit-whitespace::before):
1823
1824 2013-02-11  Alexander Pavlov  <apavlov@chromium.org>
1825
1826         Web Inspector: Implement position-based sourcemapping for stylesheets
1827         https://bugs.webkit.org/show_bug.cgi?id=109168
1828
1829         Reviewed by Vsevolod Vlasov.
1830
1831         This change introduces support for position-based source maps for CSS stylesheets.
1832         Sourcemaps and originating resources (sass, scss, etc.) are loaded synchronously
1833         upon the CSS UISourceCode addition. RangeBasedSourceMap is removed as it is not used.
1834
1835         Test: http/tests/inspector/stylesheet-source-mapping.html
1836
1837         * inspector/front-end/CSSStyleModel.js:
1838         (WebInspector.CSSStyleModel):
1839         (WebInspector.CSSStyleModel.prototype.setSourceMapping):
1840         (WebInspector.CSSStyleModel.prototype.rawLocationToUILocation):
1841         (WebInspector.CSSStyleModel.LiveLocation.prototype.uiLocation):
1842         (WebInspector.CSSLocation):
1843         (WebInspector.CSSProperty):
1844         (WebInspector.CSSProperty.parsePayload):
1845         * inspector/front-end/CompilerScriptMapping.js:
1846         (WebInspector.CompilerScriptMapping):
1847         (WebInspector.CompilerScriptMapping.prototype.rawLocationToUILocation):
1848         (WebInspector.CompilerScriptMapping.prototype.loadSourceMapForScript):
1849         * inspector/front-end/SASSSourceMapping.js:
1850         (WebInspector.SASSSourceMapping):
1851         (WebInspector.SASSSourceMapping.prototype._styleSheetChanged.callback):
1852         (WebInspector.SASSSourceMapping.prototype._styleSheetChanged):
1853         (WebInspector.SASSSourceMapping.prototype._reloadCSS):
1854         (WebInspector.SASSSourceMapping.prototype._resourceAdded.didRequestContent):
1855         (WebInspector.SASSSourceMapping.prototype._resourceAdded):
1856         (WebInspector.SASSSourceMapping.prototype._loadAndProcessSourceMap):
1857         (WebInspector.SASSSourceMapping.prototype.loadSourceMapForStyleSheet):
1858         (WebInspector.SASSSourceMapping.prototype._bindUISourceCode):
1859         (WebInspector.SASSSourceMapping.prototype.rawLocationToUILocation):
1860         (WebInspector.SASSSourceMapping.prototype.uiLocationToRawLocation):
1861         (WebInspector.SASSSourceMapping.prototype._reset):
1862         * inspector/front-end/SourceMap.js:
1863         (WebInspector.SourceMap):
1864         (WebInspector.SourceMap.load):
1865         (WebInspector.SourceMap.prototype.findEntry):
1866         (WebInspector.SourceMap.prototype.findEntryReversed):
1867         (WebInspector.SourceMap.prototype._parseMap):
1868         * inspector/front-end/StylesSourceMapping.js:
1869         (WebInspector.StylesSourceMapping):
1870         (WebInspector.StylesSourceMapping.prototype._bindUISourceCode):
1871         * inspector/front-end/inspector.js:
1872
1873 2013-02-11  Alexander Shalamov  <alexander.shalamov@intel.com>
1874
1875         Implement CSSValue::equals(const CSSValue&) to optimise CSSValue comparison
1876         https://bugs.webkit.org/show_bug.cgi?id=102901
1877
1878         Reviewed by Antti Koivisto.
1879
1880         Added comparison method to CSSValue and its children, so that the
1881         css values could be compared efficiently. Before this patch, CSSValue
1882         objects were compared using strings that were generated by the cssText() method.
1883
1884         Test: cssom/cssvalue-comparison.html
1885
1886         * css/CSSAspectRatioValue.cpp:
1887         (WebCore::CSSAspectRatioValue::equals):
1888         (WebCore):
1889         * css/CSSAspectRatioValue.h:
1890         (CSSAspectRatioValue):
1891         * css/CSSBasicShapes.cpp:
1892         (WebCore::CSSBasicShapeRectangle::equals):
1893         (WebCore):
1894         (WebCore::CSSBasicShapeCircle::equals):
1895         (WebCore::CSSBasicShapeEllipse::equals):
1896         (WebCore::CSSBasicShapePolygon::equals):
1897         * css/CSSBasicShapes.h:
1898         (CSSBasicShapeRectangle):
1899         (CSSBasicShapeCircle):
1900         (CSSBasicShapeEllipse):
1901         (CSSBasicShapePolygon):
1902         * css/CSSBorderImageSliceValue.cpp:
1903         (WebCore::CSSBorderImageSliceValue::equals):
1904         (WebCore):
1905         * css/CSSBorderImageSliceValue.h:
1906         (CSSBorderImageSliceValue):
1907         * css/CSSCalculationValue.cpp:
1908         (WebCore::CSSCalcValue::equals):
1909         (WebCore):
1910         (WebCore::CSSCalcPrimitiveValue::equals):
1911         (CSSCalcPrimitiveValue):
1912         (WebCore::CSSCalcPrimitiveValue::type):
1913         (WebCore::CSSCalcBinaryOperation::equals):
1914         (CSSCalcBinaryOperation):
1915         (WebCore::CSSCalcBinaryOperation::type):
1916         * css/CSSCalculationValue.h:
1917         (WebCore::CSSCalcExpressionNode::equals):
1918         (CSSCalcExpressionNode):
1919         (CSSCalcValue):
1920         * css/CSSCanvasValue.cpp:
1921         (WebCore::CSSCanvasValue::equals):
1922         (WebCore):
1923         * css/CSSCanvasValue.h:
1924         (CSSCanvasValue):
1925         * css/CSSComputedStyleDeclaration.cpp:
1926         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1927         (WebCore::CSSComputedStyleDeclaration::cssPropertyMatches):
1928         (WebCore::CSSComputedStyleDeclaration::getCSSPropertyValuesForSidesShorthand):
1929         * css/CSSCrossfadeValue.cpp:
1930         (WebCore::CSSCrossfadeValue::equals):
1931         (WebCore):
1932         * css/CSSCrossfadeValue.h:
1933         (CSSCrossfadeValue):
1934         * css/CSSCursorImageValue.cpp:
1935         (WebCore::CSSCursorImageValue::equals):
1936         (WebCore):
1937         * css/CSSCursorImageValue.h:
1938         (CSSCursorImageValue):
1939         * css/CSSFontFaceSrcValue.cpp:
1940         (WebCore::CSSFontFaceSrcValue::equals):
1941         (WebCore):
1942         * css/CSSFontFaceSrcValue.h:
1943         (CSSFontFaceSrcValue):
1944         * css/CSSFunctionValue.cpp:
1945         (WebCore::CSSFunctionValue::equals):
1946         (WebCore):
1947         * css/CSSFunctionValue.h:
1948         (CSSFunctionValue):
1949         * css/CSSGradientValue.cpp:
1950         (WebCore::CSSLinearGradientValue::equals):
1951         (WebCore):
1952         (WebCore::CSSRadialGradientValue::equals):
1953         * css/CSSGradientValue.h:
1954         (WebCore::CSSGradientColorStop::operator==):
1955         (CSSLinearGradientValue):
1956         (CSSRadialGradientValue):
1957         * css/CSSImageValue.cpp:
1958         (WebCore::CSSImageValue::equals):
1959         (WebCore):
1960         * css/CSSImageValue.h:
1961         (CSSImageValue):
1962         * css/CSSInheritedValue.h:
1963         (WebCore::CSSInheritedValue::equals):
1964         (CSSInheritedValue):
1965         * css/CSSInitialValue.h:
1966         (WebCore::CSSInitialValue::equals):
1967         (CSSInitialValue):
1968         * css/CSSLineBoxContainValue.h:
1969         (WebCore::CSSLineBoxContainValue::equals):
1970         * css/CSSPrimitiveValue.cpp:
1971         (WebCore::CSSPrimitiveValue::equals):
1972         (WebCore):
1973         * css/CSSPrimitiveValue.h:
1974         (CSSPrimitiveValue):
1975         * css/CSSReflectValue.cpp:
1976         (WebCore::CSSReflectValue::equals):
1977         (WebCore):
1978         * css/CSSReflectValue.h:
1979         (CSSReflectValue):
1980         * css/CSSTimingFunctionValue.cpp:
1981         (WebCore::CSSCubicBezierTimingFunctionValue::equals):
1982         (WebCore):
1983         (WebCore::CSSStepsTimingFunctionValue::equals):
1984         * css/CSSTimingFunctionValue.h:
1985         (WebCore::CSSLinearTimingFunctionValue::equals):
1986         (CSSLinearTimingFunctionValue):
1987         (CSSCubicBezierTimingFunctionValue):
1988         (CSSStepsTimingFunctionValue):
1989         * css/CSSUnicodeRangeValue.cpp:
1990         (WebCore::CSSUnicodeRangeValue::equals):
1991         (WebCore):
1992         * css/CSSUnicodeRangeValue.h:
1993         (CSSUnicodeRangeValue):
1994         * css/CSSValue.cpp:
1995         (WebCore):
1996         (WebCore::compareCSSValues):
1997         (WebCore::CSSValue::equals):
1998         * css/CSSValue.h:
1999         (CSSValue):
2000         (WebCore):
2001         (WebCore::compareCSSValueVector):
2002         (WebCore::compareCSSValuePtr):
2003         * css/CSSValueList.cpp:
2004         (WebCore::CSSValueList::removeAll):
2005         (WebCore::CSSValueList::hasValue):
2006         (WebCore::CSSValueList::equals):
2007         (WebCore):
2008         * css/CSSValueList.h:
2009         (CSSValueList):
2010         * css/CSSVariableValue.h:
2011         (WebCore::CSSVariableValue::equals):
2012         (CSSVariableValue):
2013         * css/Counter.h:
2014         (Counter):
2015         (WebCore::Counter::equals):
2016         * css/DashboardRegion.h:
2017         (WebCore::DashboardRegion::equals):
2018         * css/FontFeatureValue.cpp:
2019         (WebCore::FontFeatureValue::equals):
2020         (WebCore):
2021         * css/FontFeatureValue.h:
2022         (FontFeatureValue):
2023         * css/FontValue.cpp:
2024         (WebCore::FontValue::equals):
2025         (WebCore):
2026         * css/FontValue.h:
2027         (FontValue):
2028         * css/MediaQueryExp.h:
2029         (WebCore::MediaQueryExp::operator==):
2030         * css/Pair.h:
2031         (WebCore::Pair::equals):
2032         (Pair):
2033         * css/Rect.h:
2034         (WebCore::RectBase::equals):
2035         (RectBase):
2036         * css/ShadowValue.cpp:
2037         (WebCore::ShadowValue::equals):
2038         (WebCore):
2039         * css/ShadowValue.h:
2040         (ShadowValue):
2041         * css/StylePropertySet.cpp:
2042         (WebCore::StylePropertySet::get4Values):
2043         (WebCore::StylePropertySet::propertyMatches):
2044         * css/WebKitCSSArrayFunctionValue.cpp:
2045         (WebCore::WebKitCSSArrayFunctionValue::equals):
2046         (WebCore):
2047         * css/WebKitCSSArrayFunctionValue.h:
2048         (WebKitCSSArrayFunctionValue):
2049         * css/WebKitCSSFilterValue.cpp:
2050         (WebCore::WebKitCSSFilterValue::equals):
2051         (WebCore):
2052         * css/WebKitCSSFilterValue.h:
2053         (WebKitCSSFilterValue):
2054         * css/WebKitCSSMixFunctionValue.cpp:
2055         (WebCore::WebKitCSSMixFunctionValue::equals):
2056         (WebCore):
2057         * css/WebKitCSSMixFunctionValue.h:
2058         (WebKitCSSMixFunctionValue):
2059         * css/WebKitCSSSVGDocumentValue.cpp:
2060         (WebCore::WebKitCSSSVGDocumentValue::equals):
2061         (WebCore):
2062         * css/WebKitCSSSVGDocumentValue.h:
2063         (WebKitCSSSVGDocumentValue):
2064         * css/WebKitCSSShaderValue.cpp:
2065         (WebCore::WebKitCSSShaderValue::equals):
2066         (WebCore):
2067         * css/WebKitCSSShaderValue.h:
2068         (WebKitCSSShaderValue):
2069         * css/WebKitCSSTransformValue.h:
2070         (WebCore::WebKitCSSTransformValue::equals):
2071         * editing/EditingStyle.cpp:
2072         (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
2073         * svg/SVGColor.cpp:
2074         (WebCore::SVGColor::equals):
2075         (WebCore):
2076         * svg/SVGColor.h:
2077         (SVGColor):
2078         * svg/SVGPaint.cpp:
2079         (WebCore::SVGPaint::equals):
2080         (WebCore):
2081         * svg/SVGPaint.h:
2082         (SVGPaint):
2083
2084 2013-02-11  Pan Deng  <pan.deng@intel.com>
2085
2086         [Web Inspector] Network panel, sort by "transferSize" instead of "resourceSize".
2087         https://bugs.webkit.org/show_bug.cgi?id=109142.
2088
2089         Reviewed by Vsevolod Vlasov.
2090
2091         Sort by "transferSize" as it is the primary rather than "resoureSize".
2092
2093         No new tests.
2094
2095         * inspector/front-end/NetworkPanel.js:
2096         (WebInspector.NetworkDataGridNode.SizeComparator):
2097
2098 2013-02-11  Eugene Klyuchnikov  <eustas@chromium.org>
2099
2100         Web Inspector: [Resources] Prefactorings in DataGrid and CookieTable
2101         https://bugs.webkit.org/show_bug.cgi?id=109141
2102
2103         Reviewed by Vsevolod Vlasov.
2104
2105         1) Make deleteCookie method static and move to WebInspector.Cookie
2106         2) Replace resfreshCallback getter/setter in DataGrid with
2107         constructor parameter
2108
2109         * inspector/front-end/CookieItemsView.js: Adopt changes.
2110         * inspector/front-end/CookieParser.js:
2111         (WebInspector.Cookie.prototype.remove): Moved from CookiesTable.
2112         * inspector/front-end/CookiesTable.js: Adopt changes.
2113         * inspector/front-end/DataGrid.js:
2114         Replace setter with constructor parameter.
2115
2116 2013-02-11  John J. Barton  <johnjbarton@chromium.org>
2117
2118         Web Inspector: Don't throw exceptions in WebInspector.Color
2119         https://bugs.webkit.org/show_bug.cgi?id=104835
2120
2121         Reviewed by Vsevolod Vlasov.
2122
2123         WebInspector.Color.parse() returns a Color from a string, or null;
2124         Ctor calls now call parse();
2125         In the StylesSideBarPane, test null rather than catch(e).
2126
2127         Added case to inspector/styles/styles-invalid-color-values.html
2128
2129         * inspector/front-end/Color.js:
2130         (WebInspector.Color):
2131         (WebInspector.Color.parse):
2132         (WebInspector.Color.fromRGBA):
2133         (WebInspector.Color.fromRGB):
2134         (WebInspector.Color.prototype.toString):
2135         (WebInspector.Color.prototype._parse.this.alpha.set 0):
2136         (WebInspector.Color.prototype._parse.this.nickname.set 2):
2137         (WebInspector.Color.prototype._parse.this.hsla.set 1):
2138         (WebInspector.Color.prototype._parse.this.rgba.set 0):
2139         (WebInspector.Color.prototype._parse.set WebInspector):
2140         (WebInspector.Color.prototype._parse):
2141         * inspector/front-end/Spectrum.js:
2142         (WebInspector.Spectrum.prototype.get color):
2143         * inspector/front-end/StylesSidebarPane.js:
2144
2145 2013-02-11  Andrey Lushnikov  <lushnikov@chromium.org>
2146
2147         Web Inspector: home button behaviour is wrong in DTE
2148         https://bugs.webkit.org/show_bug.cgi?id=109154
2149
2150         Reviewed by Vsevolod Vlasov.
2151
2152         Handle home key shortcut explicitly in TextEditorMainPanel.
2153
2154         New test: inspector/editor/text-editor-home-button.html
2155
2156         * inspector/front-end/DefaultTextEditor.js:
2157         (WebInspector.TextEditorMainPanel.prototype._registerShortcuts):
2158         (WebInspector.TextEditorMainPanel.prototype._handleHomeKey):
2159
2160 2013-02-11  Abhishek Arya  <inferno@chromium.org>
2161
2162         Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access
2163         https://bugs.webkit.org/show_bug.cgi?id=108981
2164
2165         Reviewed by Eric Seidel.
2166
2167         * Modules/mediastream/RTCStatsResponse.cpp:
2168         (WebCore::RTCStatsResponse::addElement):
2169         (WebCore::RTCStatsResponse::addStatistic):
2170         * Modules/websockets/WebSocketChannel.cpp:
2171         (WebCore::WebSocketChannel::skipBuffer):
2172         * css/CSSCalculationValue.cpp:
2173         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
2174         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
2175         * css/WebKitCSSTransformValue.cpp:
2176         (WebCore::transformValueToCssString):
2177         * editing/TextIterator.cpp:
2178         (WebCore::SearchBuffer::search):
2179         * html/HTMLElement.cpp:
2180         (WebCore::parseColorStringWithCrazyLegacyRules):
2181         * html/ImageData.cpp:
2182         (WebCore::ImageData::ImageData):
2183         * html/shadow/DateTimeSymbolicFieldElement.cpp:
2184         (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
2185         * html/track/TextTrackCueList.cpp:
2186         (WebCore::TextTrackCueList::add):
2187         * platform/SharedBuffer.cpp:
2188         (WebCore::SharedBuffer::getSomeData):
2189         * platform/SharedBufferChunkReader.cpp:
2190         (WebCore::SharedBufferChunkReader::nextChunk):
2191         * platform/audio/HRTFDatabase.cpp:
2192         (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation):
2193         * platform/graphics/GlyphPageTreeNode.cpp:
2194         (WebCore::GlyphPageTreeNode::initializePage):
2195         * platform/graphics/Region.cpp:
2196         (WebCore::Region::Shape::segments_end):
2197         * platform/graphics/filters/FEComponentTransfer.cpp:
2198         (WebCore::FEComponentTransfer::getValues):
2199         * platform/graphics/filters/FilterEffect.cpp:
2200         (WebCore::FilterEffect::inputEffect):
2201         * platform/text/TextCodecUTF8.cpp:
2202         (WebCore::TextCodecUTF8::decode):
2203         * platform/text/mac/TextCodecMac.cpp:
2204         (WebCore::TextCodecMac::decode):
2205         * rendering/RenderBlockLineLayout.cpp:
2206         (WebCore::RenderBlock::checkFloatsInCleanLine):
2207         * svg/SVGAnimatedTypeAnimator.h:
2208         (WebCore::SVGAnimatedTypeAnimator::executeAction):
2209         * svg/SVGAnimationElement.cpp:
2210         (WebCore::SVGAnimationElement::calculatePercentForSpline):
2211         * svg/animation/SVGSMILElement.cpp:
2212         (WebCore::SVGSMILElement::findInstanceTime):
2213
2214 2013-02-10  Chris Fleizach  <cfleizach@apple.com>
2215
2216         WebSpeech: Implement basic speaking/finished speaking behavior
2217         https://bugs.webkit.org/show_bug.cgi?id=107135
2218
2219         Reviewed by Sam Weinig.
2220
2221         Implements the basic functionality of speaking utterances.
2222
2223         In the WebCore side, it manages the speech queue the way the spec defines
2224         (that is, new jobs are appended to a queue and wait for other jobs to finish).
2225
2226         On the Mac side, it instantiates a synthesizer and handles the callbacks for when
2227         jobs are finished. It sends those jobs back to WebCore to dispatch the right events.
2228
2229         Test: platform/mac/fast/speechsynthesis/speech-synthesis-speak.html
2230
2231         * Modules/speech/SpeechSynthesis.cpp:
2232         (WebCore::SpeechSynthesis::SpeechSynthesis):
2233         (WebCore::SpeechSynthesis::paused):
2234         (WebCore::SpeechSynthesis::startSpeakingImmediately):
2235         (WebCore::SpeechSynthesis::speak):
2236         (WebCore):
2237         (WebCore::SpeechSynthesis::fireEvent):
2238         (WebCore::SpeechSynthesis::handleSpeakingCompleted):
2239         (WebCore::SpeechSynthesis::didStartSpeaking):
2240         (WebCore::SpeechSynthesis::didFinishSpeaking):
2241         (WebCore::SpeechSynthesis::speakingErrorOccurred):
2242         * Modules/speech/SpeechSynthesis.h:
2243         (WebCore):
2244         (WebCore::SpeechSynthesis::speaking):
2245         (SpeechSynthesis):
2246         * Modules/speech/SpeechSynthesisEvent.cpp:
2247         (WebCore::SpeechSynthesisEvent::create):
2248         (WebCore):
2249         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
2250         * Modules/speech/SpeechSynthesisEvent.h:
2251         (SpeechSynthesisEvent):
2252         (WebCore::SpeechSynthesisEvent::interfaceName):
2253         * Modules/speech/SpeechSynthesisUtterance.h:
2254         (WebCore::SpeechSynthesisUtterance::startTime):
2255         (WebCore::SpeechSynthesisUtterance::setStartTime):
2256         (SpeechSynthesisUtterance):
2257         * platform/PlatformSpeechSynthesisUtterance.cpp:
2258         (WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance):
2259         * platform/PlatformSpeechSynthesisUtterance.h:
2260         (PlatformSpeechSynthesisUtterance):
2261         (WebCore::PlatformSpeechSynthesisUtterance::setVolume):
2262         (WebCore::PlatformSpeechSynthesisUtterance::setRate):
2263         (WebCore::PlatformSpeechSynthesisUtterance::setPitch):
2264         (WebCore::PlatformSpeechSynthesisUtterance::startTime):
2265         (WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
2266         (WebCore::PlatformSpeechSynthesisUtterance::client):
2267         * platform/PlatformSpeechSynthesizer.cpp:
2268         (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
2269         * platform/PlatformSpeechSynthesizer.h:
2270         (PlatformSpeechSynthesizerClient):
2271         (WebCore::PlatformSpeechSynthesizer::client):
2272         (PlatformSpeechSynthesizer):
2273         * platform/mac/PlatformSpeechSynthesizerMac.mm:
2274         (-[WebSpeechSynthesisWrapper initWithSpeechSynthesizer:WebCore::]):
2275         (-[WebSpeechSynthesisWrapper dealloc]):
2276         (-[WebSpeechSynthesisWrapper convertRateToWPM:]):
2277         (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
2278         (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
2279         (WebCore::PlatformSpeechSynthesizer::speak):
2280
2281 2013-02-10  Eric Seidel  <eric@webkit.org>
2282
2283         Make the existing HTMLPreloadScanner threading-aware
2284         https://bugs.webkit.org/show_bug.cgi?id=107807
2285
2286         Reviewed by Adam Barth.
2287
2288         The HTMLPreloadScanner and CSSPreloadScanner do a number of things.
2289         CSSPreloadScanner is mostly just a helper class for HTMLPreloadScanner.
2290         HTMLPreloadScanner runs its own copy of the HTMLTokenizer and uses
2291         HTMLTokenizer::updateStateFor to emulate enough of the TreeBuilder
2292         to get a realistic stream of tokens.  It does some additional TreeBuilder
2293         emulation, including tracking template tags and base tags, but mostly
2294         just scans the token stream for start-tags and looks for URLs in them.
2295         It tracks when it has seen a <style> tag and starts sending all character tokens
2296         to the CSSPreloadScanner until a </style> tag is seen.
2297         It also (unfortunately) knows some about the loader guts and how to construct
2298         a proper CachedResourcRequest and issue a preload.
2299
2300         This patch changes the model so that the preload scanners only know how to produce
2301         PreloadRequest objects and append them to a passed-in vector.
2302
2303         This changes the preload-scanner behavior so that preloads are now all issued in one large
2304         batch at the end of scanning, instead of as we hit each resource.  It's possible that
2305         we'll wait to instead check for preload requests more often, at a possible tradeoff
2306         to tokenizing speed.
2307
2308         An alternate approach might be to pass in a preload-delegate of sorts which knew how
2309         to either build a vector, or send requests immediately.  For now the build-a-vector-always
2310         approach seems clean, and does not seem to slow down our PerformanceTest microbenchmarks at least.
2311
2312         This patch has 2 main pieces:
2313         - Remove Document and (and loader) dependencies from HTMLPreloadScanner/CSSPreloadScanner
2314           This is done through introduction of a new HTMLResourcePreloader class which holds
2315           a Document* and knows how to talk to the CachedResourceLoader.
2316         - Clean-up HTMLPreloadScanners token-loop to not be tied to having a Tokenizer.
2317           (On a background thead, the HTMLPreloadScanner won't own the tokenizer, it will just
2318            be passed in tokens and expected to issue loads if necessary.)
2319
2320         This passes all of the LayoutTests using the main thread parser.
2321
2322         This patch does not make the HTMLPreloadScanner 100% ready for threading
2323         (it still uses AtomicString which is currently not-OK on the parser thread)
2324         but it's very close.  Two further (already written) patches will complete this.
2325
2326         * CMakeLists.txt:
2327         * GNUmakefile.list.am:
2328         * Target.pri:
2329         * WebCore.gypi:
2330         * WebCore.vcproj/WebCore.vcproj:
2331         * WebCore.vcxproj/WebCore.vcxproj:
2332         * WebCore.xcodeproj/project.pbxproj:
2333         * html/parser/CSSPreloadScanner.cpp:
2334         (WebCore::CSSPreloadScanner::CSSPreloadScanner):
2335         (WebCore::CSSPreloadScanner::scan):
2336         (WebCore::CSSPreloadScanner::emitRule):
2337         * html/parser/CSSPreloadScanner.h:
2338         (CSSPreloadScanner):
2339         * html/parser/HTMLDocumentParser.cpp:
2340         (WebCore::HTMLDocumentParser::HTMLDocumentParser):
2341         (WebCore::HTMLDocumentParser::pumpTokenizer):
2342         (WebCore::HTMLDocumentParser::insert):
2343         (WebCore::HTMLDocumentParser::append):
2344         (WebCore::HTMLDocumentParser::appendCurrentInputStreamToPreloadScannerAndScan):
2345         * html/parser/HTMLDocumentParser.h:
2346         (HTMLDocumentParser):
2347         * html/parser/HTMLPreloadScanner.cpp:
2348         (WebCore::isStartTag):
2349         (WebCore):
2350         (WebCore::isStartOrEndTag):
2351         (WebCore::PreloadTask::processAttributes):
2352         (WebCore::PreloadTask::charset):
2353         (PreloadTask):
2354         (WebCore::PreloadTask::resourceType):
2355         (WebCore::PreloadTask::shouldPreload):
2356         (WebCore::PreloadTask::createPreloadRequest):
2357         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
2358         (WebCore::HTMLPreloadScanner::scan):
2359         (WebCore::HTMLPreloadScanner::processPossibleTemplateTag):
2360         (WebCore::HTMLPreloadScanner::processPossibleStyleTag):
2361         (WebCore::HTMLPreloadScanner::processPossibleBaseTag):
2362         (WebCore::HTMLPreloadScanner::processToken):
2363         * html/parser/HTMLPreloadScanner.h:
2364         (HTMLPreloadScanner):
2365         * html/parser/HTMLResourcePreloader.cpp: Added.
2366         (WebCore):
2367         (WebCore::isStringSafeToSendToAnotherThread):
2368         (WebCore::PreloadRequest::isSafeToSendToAnotherThread):
2369         (WebCore::PreloadRequest::completeURL):
2370         (WebCore::PreloadRequest::resourceRequest):
2371         (WebCore::HTMLResourcePreloader::preload):
2372         * html/parser/HTMLResourcePreloader.h: Added.
2373         (WebCore):
2374         (PreloadRequest):
2375         (WebCore::PreloadRequest::create):
2376         (WebCore::PreloadRequest::PreloadRequest):
2377         (HTMLResourcePreloader):
2378         (WebCore::HTMLResourcePreloader::HTMLResourcePreloader):
2379         (WebCore::HTMLResourcePreloader::createWeakPtr):
2380         * loader/cache/CachedResourceRequest.h:
2381
2382 2013-02-06  Kentaro Hara  <haraken@chromium.org>
2383
2384         [V8] Rename isolated() to getWorld(), rename worldForEnteredContextIfIsolated() to worldForEnteredContext()
2385         https://bugs.webkit.org/show_bug.cgi?id=109039
2386
2387         Reviewed by Adam Barth.
2388
2389         This is a follow-up patch for r141983.
2390         Rename methods for consistency.
2391
2392         No tests. No change in behavior.
2393
2394         * bindings/v8/DOMDataStore.cpp:
2395         (WebCore::DOMDataStore::current):
2396         * bindings/v8/DOMWrapperWorld.h:
2397         (WebCore::DOMWrapperWorld::getWorld):
2398         * bindings/v8/ScriptController.cpp:
2399         (WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
2400         (WebCore::ScriptController::currentWorldContext):
2401         * bindings/v8/V8Binding.h:
2402         (WebCore::worldForEnteredContext):
2403         * bindings/v8/WorldContextHandle.cpp:
2404         (WebCore::WorldContextHandle::WorldContextHandle):
2405         * bindings/v8/custom/V8DocumentCustom.cpp:
2406         (WebCore::wrap):
2407         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
2408         (WebCore::wrap):
2409         * bindings/v8/custom/V8SVGDocumentCustom.cpp:
2410         (WebCore::wrap):
2411         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
2412         (WebCore::V8XMLHttpRequest::constructorCallbackCustom):
2413
2414 2013-02-10  Alexandre Elias  <aelias@chromium.org>
2415
2416         [chromium] Fix Android scrollbar size
2417         https://bugs.webkit.org/show_bug.cgi?id=109374
2418
2419         Reviewed by James Robinson.
2420
2421         This shrinks scrollbars to 3 device-independent pixels (usually 6
2422         physical pixels) and deletes the edge fade. Although the Android
2423         system theme does have an edge fade, it's a much sharper cliff
2424         than we had (against black, the colors go 64 -> 64 -> 52 -> 21 -> 0)
2425         and I can't perceive any difference compared with no fade at all.
2426
2427         No new tests (due for rewrite in a week anyway).
2428
2429         * platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
2430         (WebCore):
2431         (WebCore::ScrollbarThemeChromiumAndroid::paintThumb):
2432
2433 2013-02-04  Kentaro Hara  <haraken@chromium.org>
2434
2435         [V8] Remove V8GCController::m_edenNodes and make minor DOM GC more precise
2436         https://bugs.webkit.org/show_bug.cgi?id=108579
2437
2438         Reviewed by Adam Barth.
2439
2440         Currently V8GCController::m_edenNodes stores a list of nodes whose
2441         wrappers have been created since the latest GC. The reason why we
2442         needed m_edenNodes is that there was no way to know a list of wrappers
2443         in the new space of V8. By using m_edenNodes, we had been approximating
2444         'wrappers in the new space' by 'wrappers that have been created since
2445         the latest GC'.
2446
2447         Now V8 provides VisitHandlesForPartialDependence(), with which WebKit
2448         can know a list of wrappers in the new space. By using the API, we can
2449         remove V8GCController::m_edenNodes. The benefit is that (1) we no longer
2450         need to keep m_edenNodes and that (2) it enables more precise minor
2451         DOM GC (Remember that m_edenNodes was just an approximation).
2452
2453         Performance benchmark: https://bugs.webkit.org/attachment.cgi?id=185940
2454         The benchmark runs 300 iterations, each of which creates 100000 elements.
2455         The benchmark measures average, min, median, max and stdev of execution times
2456         of the 300 iterations. This will tell us the worst-case overhead of this change.
2457
2458         Before:
2459           mean=59.91ms, min=39ms, median=42ms, max=258ms, stdev=47.48ms
2460
2461         After:
2462           mean=58.75ms, min=35ms, median=41ms, max=250ms, stdev=47.32ms
2463
2464         As shown above, I couldn't observe any performance regression.
2465
2466         No tests. No change in behavior.
2467
2468         * bindings/v8/DOMDataStore.h:
2469         (WebCore::DOMDataStore::setWrapperInObject):
2470         * bindings/v8/DOMWrapperWorld.h:
2471         (DOMWrapperWorld):
2472         (WebCore::DOMWrapperWorld::getWorldWithoutContextCheck):
2473         * bindings/v8/V8Binding.h:
2474         (WebCore):
2475         (WebCore::worldForEnteredContextIfIsolated):
2476         (WebCore::worldForEnteredContextWithoutContextCheck):
2477         * bindings/v8/V8DOMWindowShell.cpp:
2478         (WebCore::V8DOMWindowShell::initializeIfNeeded):
2479         * bindings/v8/V8GCController.cpp:
2480         (WebCore::gcTree):
2481         (WebCore):
2482         (MinorGCWrapperVisitor):
2483         (WebCore::MinorGCWrapperVisitor::MinorGCWrapperVisitor):
2484         (WebCore::MinorGCWrapperVisitor::notifyFinished):
2485         (WebCore::MajorGCWrapperVisitor::MajorGCWrapperVisitor):
2486         (WebCore::V8GCController::gcPrologue):
2487         (WebCore::V8GCController::minorGCPrologue):
2488         (WebCore::V8GCController::majorGCPrologue):
2489         * bindings/v8/V8GCController.h:
2490         (V8GCController):
2491
2492 2013-02-10  Tim Horton  <timothy_horton@apple.com>
2493
2494         REGRESSION (r132422): Page content and scrollbars are incorrectly offset after restoring a page from the page cache
2495         https://bugs.webkit.org/show_bug.cgi?id=109317
2496         <rdar://problem/12649131>
2497
2498         Reviewed by Simon Fraser.
2499
2500         Mark all scrolling that occurs beneath FrameView::layout as programmatic.
2501
2502         Test: platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html
2503
2504         * page/FrameView.cpp:
2505         (WebCore::FrameView::layout):
2506
2507 2013-02-10  Kent Tamura  <tkent@chromium.org>
2508
2509         [Mac] Fix release build failure by recent reverts
2510
2511         * WebCore.exp.in:
2512
2513 2013-02-10  Philippe Normand  <pnormand@igalia.com>
2514
2515         [GStreamer] media/video-controls-fullscreen-volume.html crashes
2516         https://bugs.webkit.org/show_bug.cgi?id=108682
2517
2518         Reviewed by Martin Robinson.
2519
2520         Clean up various signal handlers and avoid bad interaction between
2521         the FullscreenVideoControllerGStreamer and its subclasses,
2522         especially when the platform video window is created.
2523
2524         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp:
2525         (WebCore::FullscreenVideoControllerGStreamer::enterFullscreen):
2526         Initialize the window before connecting to the volume/mute
2527         signals. This ensures that the signals won't ever interfere with
2528         an inexisting window.
2529         * platform/graphics/gstreamer/GStreamerGWorld.cpp:
2530         (WebCore::GStreamerGWorld::~GStreamerGWorld): Remove GstBus
2531         synchronous handler function.
2532         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2533         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2534         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2535         Disconnect from volume/mute signals.
2536         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
2537         Keep a trace of volume/mute signal handlers.
2538         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2539         Various forward type declarations to avoid un-necessary header includes.
2540         (MediaPlayerPrivateGStreamerBase):
2541         * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp:
2542         (WebCore::FullscreenVideoControllerGtk::FullscreenVideoControllerGtk):
2543         (WebCore::FullscreenVideoControllerGtk::volumeChanged): Bail out
2544         if volume button hasn't been created yet.
2545         (WebCore::FullscreenVideoControllerGtk::muteChanged): Ditto.
2546
2547 2013-02-10  Andreas Kling  <akling@apple.com>
2548
2549         RenderStyle should use copy-on-write inheritance for NinePieceImage.
2550         <http://webkit.org/b/109366>
2551
2552         Reviewed by Antti Koivisto.
2553
2554         Refactor NinePieceImage to hold a copy-on-write DataRef like other RenderStyle substructures.
2555         This allows us to avoids copying the NinePieceImageData when one RenderStyle inherits from another
2556         but modifies something in the substructure holding the NinePieceImage (typically StyleSurroundData.)
2557
2558         Also made RenderStyle not copy-on-write its StyleSurroundData prematurely when doing a no-op write
2559         to a border-image related value.
2560
2561         1.23 MB progression on Membuster3.
2562
2563         * rendering/style/NinePieceImage.cpp:
2564         (WebCore::defaultData):
2565         (WebCore::NinePieceImage::NinePieceImage):
2566         (WebCore::NinePieceImageData::NinePieceImageData):
2567         (WebCore::NinePieceImageData::operator==):
2568         * rendering/style/NinePieceImage.h:
2569         (WebCore::NinePieceImageData::create):
2570         (WebCore::NinePieceImageData::copy):
2571         (NinePieceImageData):
2572         (NinePieceImage):
2573         (WebCore::NinePieceImage::operator==):
2574         (WebCore::NinePieceImage::operator!=):
2575         (WebCore::NinePieceImage::hasImage):
2576         (WebCore::NinePieceImage::image):
2577         (WebCore::NinePieceImage::setImage):
2578         (WebCore::NinePieceImage::imageSlices):
2579         (WebCore::NinePieceImage::setImageSlices):
2580         (WebCore::NinePieceImage::fill):
2581         (WebCore::NinePieceImage::setFill):
2582         (WebCore::NinePieceImage::borderSlices):
2583         (WebCore::NinePieceImage::setBorderSlices):
2584         (WebCore::NinePieceImage::outset):
2585         (WebCore::NinePieceImage::setOutset):
2586         (WebCore::NinePieceImage::horizontalRule):
2587         (WebCore::NinePieceImage::setHorizontalRule):
2588         (WebCore::NinePieceImage::verticalRule):
2589         (WebCore::NinePieceImage::setVerticalRule):
2590         (WebCore::NinePieceImage::copyImageSlicesFrom):
2591         (WebCore::NinePieceImage::copyBorderSlicesFrom):
2592         (WebCore::NinePieceImage::copyOutsetFrom):
2593         (WebCore::NinePieceImage::copyRepeatFrom):
2594         (WebCore::NinePieceImage::setMaskDefaults):
2595         (WebCore::NinePieceImage::computeOutset):
2596         * rendering/style/RenderStyle.cpp:
2597         (WebCore::RenderStyle::setBorderImageSource):
2598         (WebCore::RenderStyle::setBorderImageSlices):
2599         (WebCore::RenderStyle::setBorderImageWidth):
2600         (WebCore::RenderStyle::setBorderImageOutset):
2601         * rendering/style/RenderStyle.h:
2602
2603 2013-02-10  Kent Tamura  <tkent@chromium.org>
2604
2605         Unreviewed, rolling out r142343.
2606         http://trac.webkit.org/changeset/142343
2607         https://bugs.webkit.org/show_bug.cgi?id=108284
2608
2609         It might make inspector/profiler/selector-profiler-url.html
2610         crashy.
2611
2612         * WebCore.exp.in:
2613         * css/plugIns.css:
2614         (p):
2615         * html/HTMLPlugInElement.cpp:
2616         (WebCore::HTMLPlugInElement::defaultEventHandler):
2617         * html/HTMLPlugInImageElement.cpp:
2618         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
2619         (WebCore::HTMLPlugInImageElement::createRenderer):
2620         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2621         (WebCore::HTMLPlugInImageElement::updateSnapshot):
2622         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
2623         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
2624         * html/HTMLPlugInImageElement.h:
2625         (WebCore):
2626         (HTMLPlugInImageElement):
2627         * page/ChromeClient.h:
2628         (WebCore::ChromeClient::plugInStartLabelImage):
2629         * platform/LocalizedStrings.cpp:
2630         * platform/LocalizedStrings.h:
2631         * platform/blackberry/LocalizedStringsBlackBerry.cpp:
2632         * platform/chromium/LocalizedStringsChromium.cpp:
2633         * platform/efl/LocalizedStringsEfl.cpp:
2634         (WebCore):
2635         * platform/gtk/LocalizedStringsGtk.cpp:
2636         (WebCore):
2637         * platform/qt/LocalizedStringsQt.cpp:
2638         * rendering/RenderSnapshottedPlugIn.cpp:
2639         (WebCore):
2640         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn):
2641         (WebCore::RenderSnapshottedPlugIn::paint):
2642         (WebCore::RenderSnapshottedPlugIn::paintReplaced):
2643         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2644         (WebCore::RenderSnapshottedPlugIn::paintReplacedSnapshot):
2645         (WebCore::RenderSnapshottedPlugIn::startLabelImage):
2646         (WebCore::RenderSnapshottedPlugIn::paintReplacedSnapshotWithLabel):
2647         (WebCore::RenderSnapshottedPlugIn::getCursor):
2648         (WebCore::RenderSnapshottedPlugIn::handleEvent):
2649         (WebCore::RenderSnapshottedPlugIn::tryToFitStartLabel):
2650         * rendering/RenderSnapshottedPlugIn.h:
2651
2652 2013-02-10  Andreas Kling  <akling@apple.com>
2653
2654         RenderText: Access characters through m_text instead of caching data pointers separately.
2655         <http://webkit.org/b/109357>
2656
2657         Reviewed by Antti Koivisto.
2658
2659         Go through RenderText::m_text.impl() instead of caching the character data pointer.
2660         RenderText should never have a null String in m_text so it's safe to access impl() directly.
2661         We have assertions for this since before.
2662
2663         Removing this pointer shrinks RenderText by 8 bytes, allowing it to fit into a snugger size class.
2664         749 KB progression on Membuster3.
2665
2666         * rendering/RenderText.cpp:
2667         (SameSizeAsRenderText):
2668         (WebCore::RenderText::RenderText):
2669         (WebCore::RenderText::setTextInternal):
2670         * rendering/RenderText.h:
2671         (WebCore::RenderText::is8Bit):
2672         (WebCore::RenderText::characters8):
2673         (WebCore::RenderText::characters16):
2674         (WebCore::RenderText::characterAt):
2675         (WebCore::RenderText::operator[]):
2676         (RenderText):
2677
2678 2013-02-10  Jae Hyun Park  <jae.park08@gmail.com>
2679
2680         Rename ENABLE(GLIB_SUPPORT) to USE(GLIB)
2681         https://bugs.webkit.org/show_bug.cgi?id=104266
2682
2683         Reviewed by Philippe Normand.
2684
2685         Using USE(GLIB) instead of ENABLE(GLIB_SUPPORT) is more consistent with
2686         the existing macro naming conventions.
2687
2688         From Platform.h
2689         USE() - use a particular third-party library or optional OS service
2690         ENABLE() - turn on a specific feature of WebKit
2691
2692         No new tests, no new functionality.
2693
2694         * WebCore.pri:
2695
2696 2013-02-10  Zan Dobersek  <zdobersek@igalia.com>
2697
2698         [GTK] Build errors in TextureMapperShaderProgram.cpp when compiling with Clang
2699         https://bugs.webkit.org/show_bug.cgi?id=109321
2700
2701         Reviewed by Noam Rosenthal.
2702
2703         Clang is reporting errors due to non-constant expressions that cannot be narrowed
2704         from double to float type in initializer list when constructing a matrix of GC3Dfloat
2705         numbers. To avoid this every parameter is passed through an explicit GC3Dfloat constructor.
2706
2707         No new tests - no new functionality.
2708
2709         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2710         (WebCore::TextureMapperShaderProgram::setMatrix):
2711
2712 2013-02-10  Philippe Normand  <pnormand@igalia.com>
2713
2714         [GStreamer] audio is muted when playback rate is between 0.8 and 2.0
2715         https://bugs.webkit.org/show_bug.cgi?id=109362
2716
2717         Reviewed by Martin Robinson.
2718
2719         Don't mute sound if the audio pitch is preserved. If this is not
2720         the case mute it if it's too extreme, as the HTML5 spec recommends.
2721
2722         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2723         (WebCore::MediaPlayerPrivateGStreamer::setRate):
2724
2725 2013-02-09  Dominic Mazzoni  <dmazzoni@google.com>
2726
2727         fast/encoding/parser-tests-*.html tests sometimes crash
2728         https://bugs.webkit.org/show_bug.cgi?id=108058
2729
2730         Reviewed by Chris Fleizach.
2731
2732         To avoid calling accessibilityIsIgnored while the render
2733         tree is unstable, call accessibilityIsIgnored in the
2734         notification timer handler, only for childrenChanged
2735         notifications.
2736
2737         This exposed a problem where notifications queued on
2738         objects can fire after the object has been deleted; fix that
2739         by checking the object's id, which is always set to 0 when
2740         removed from the tree.
2741
2742         Covered by existing tests.
2743
2744         * accessibility/AXObjectCache.cpp:
2745         (WebCore::AXObjectCache::childrenChanged):
2746         (WebCore::AXObjectCache::notificationPostTimerFired):
2747
2748 2013-02-09  Eric Carlson  <eric.carlson@apple.com>
2749
2750         [Mac] Do not assume MediaAccessibility framework is installed
2751         https://bugs.webkit.org/show_bug.cgi?id=109365
2752
2753         Reviewed by Sam Weinig.
2754
2755         * page/CaptionUserPreferencesMac.h:
2756         * page/CaptionUserPreferencesMac.mm:
2757         (WebCore::CaptionUserPreferencesMac::userPrefersCaptions): Call the base class if the framework
2758             is not available.
2759         (WebCore::CaptionUserPreferencesMac::setUserPrefersCaptions): Ditto.
2760         (WebCore::CaptionUserPreferencesMac::userHasCaptionPreferences): Ditto.
2761         (WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Ditto.
2762         (WebCore::CaptionUserPreferencesMac::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
2763         (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Ditto.
2764         (WebCore::CaptionUserPreferencesMac::captionFontSizeScale): Ditto.
2765         (WebCore::CaptionUserPreferencesMac::setPreferredLanguage): Ditto.
2766         (WebCore::CaptionUserPreferencesMac::preferredLanguages): Ditto.
2767
2768 2013-02-09  Dominic Mazzoni  <dmazzoni@google.com>
2769
2770         AX: move isIgnored caching to AXObject
2771         https://bugs.webkit.org/show_bug.cgi?id=109322
2772
2773         Reviewed by Chris Fleizach.
2774
2775         There's some benefit to caching accessibilityIsIgnored
2776         (using AXComputedObjectAttributeCache) for more than just
2777         AXRenderObject, so move the caching code to AXObject.
2778
2779         AXObject now has a protected virtual method
2780         computeAccessibilityIsIgnored, and all subclasses
2781         override that instead.
2782
2783         No new tests.
2784
2785         * accessibility/AccessibilityImageMapLink.h:
2786         (AccessibilityImageMapLink):
2787         (WebCore::AccessibilityImageMapLink::computeAccessibilityIsIgnored):
2788         * accessibility/AccessibilityList.cpp:
2789         (WebCore::AccessibilityList::computeAccessibilityIsIgnored):
2790         * accessibility/AccessibilityList.h:
2791         (AccessibilityList):
2792         * accessibility/AccessibilityListBox.cpp:
2793         (WebCore::AccessibilityListBox::computeAccessibilityIsIgnored):
2794         * accessibility/AccessibilityListBox.h:
2795         (AccessibilityListBox):
2796         * accessibility/AccessibilityListBoxOption.cpp:
2797         (WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored):
2798         * accessibility/AccessibilityListBoxOption.h:
2799         (AccessibilityListBoxOption):
2800         * accessibility/AccessibilityMediaControls.cpp:
2801         (WebCore::AccessibilityMediaControl::computeAccessibilityIsIgnored):
2802         (WebCore::AccessibilityMediaTimeDisplay::computeAccessibilityIsIgnored):
2803         * accessibility/AccessibilityMediaControls.h:
2804         (AccessibilityMediaControl):
2805         (WebCore::AccessibilityMediaControlsContainer::computeAccessibilityIsIgnored):
2806         (AccessibilityMediaTimeDisplay):
2807         * accessibility/AccessibilityMenuList.h:
2808         (WebCore::AccessibilityMenuList::computeAccessibilityIsIgnored):
2809         * accessibility/AccessibilityMenuListOption.cpp:
2810         (WebCore::AccessibilityMenuListOption::computeAccessibilityIsIgnored):
2811         * accessibility/AccessibilityMenuListOption.h:
2812         (AccessibilityMenuListOption):
2813         * accessibility/AccessibilityMenuListPopup.cpp:
2814         (WebCore::AccessibilityMenuListPopup::computeAccessibilityIsIgnored):
2815         * accessibility/AccessibilityMenuListPopup.h:
2816         (AccessibilityMenuListPopup):
2817         * accessibility/AccessibilityNodeObject.cpp:
2818         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored):
2819         * accessibility/AccessibilityNodeObject.h:
2820         (AccessibilityNodeObject):
2821         * accessibility/AccessibilityObject.cpp:
2822         (WebCore::AccessibilityObject::accessibilityIsIgnored):
2823         (WebCore):
2824         * accessibility/AccessibilityObject.h:
2825         (AccessibilityObject):
2826         (WebCore::AccessibilityObject::computeAccessibilityIsIgnored):
2827         * accessibility/AccessibilityProgressIndicator.cpp:
2828         (WebCore::AccessibilityProgressIndicator::computeAccessibilityIsIgnored):
2829         * accessibility/AccessibilityProgressIndicator.h:
2830         (AccessibilityProgressIndicator):
2831         * accessibility/AccessibilityRenderObject.cpp:
2832         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2833         * accessibility/AccessibilityRenderObject.h:
2834         (AccessibilityRenderObject):
2835         * accessibility/AccessibilityScrollView.cpp:
2836         (WebCore::AccessibilityScrollView::computeAccessibilityIsIgnored):
2837         * accessibility/AccessibilityScrollView.h:
2838         (AccessibilityScrollView):
2839         * accessibility/AccessibilityScrollbar.h:
2840         (WebCore::AccessibilityScrollbar::computeAccessibilityIsIgnored):
2841         * accessibility/AccessibilitySlider.cpp:
2842         (WebCore::AccessibilitySlider::computeAccessibilityIsIgnored):
2843         (WebCore::AccessibilitySliderThumb::computeAccessibilityIsIgnored):
2844         * accessibility/AccessibilitySlider.h:
2845         (AccessibilitySlider):
2846         (AccessibilitySliderThumb):
2847         * accessibility/AccessibilitySpinButton.h:
2848         (WebCore::AccessibilitySpinButton::computeAccessibilityIsIgnored):
2849         (WebCore::AccessibilitySpinButtonPart::computeAccessibilityIsIgnored):
2850         * accessibility/AccessibilityTable.cpp:
2851         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored):
2852         * accessibility/AccessibilityTable.h:
2853         (AccessibilityTable):
2854         * accessibility/AccessibilityTableCell.cpp:
2855         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):
2856         * accessibility/AccessibilityTableCell.h:
2857         (AccessibilityTableCell):
2858         * accessibility/AccessibilityTableColumn.cpp:
2859         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
2860         * accessibility/AccessibilityTableColumn.h:
2861         (AccessibilityTableColumn):
2862         * accessibility/AccessibilityTableHeaderContainer.cpp:
2863         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
2864         * accessibility/AccessibilityTableHeaderContainer.h:
2865         (AccessibilityTableHeaderContainer):
2866         * accessibility/AccessibilityTableRow.cpp:
2867         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored):
2868         * accessibility/AccessibilityTableRow.h:
2869         (AccessibilityTableRow):
2870
2871 2013-02-09  David Farler  <dfarler@apple.com>
2872
2873         Make TestWebKitAPI work for iOS
2874         https://bugs.webkit.org/show_bug.cgi?id=108978
2875
2876         Reviewed by David Kilzer.
2877
2878         Tests already exist - refactor only.
2879
2880         * WebCore.exp.in: Lumped __ZNK7WebCore4KURL7hasPathEv with related methods.
2881         * platform/KURL.cpp: Inlined hasPath() into the header
2882         * platform/KURL.h: Inlined hasPath() into the header
2883
2884 2013-02-09  Adam Barth  <abarth@webkit.org>
2885
2886         Load event fires too early with threaded HTML parser
2887         https://bugs.webkit.org/show_bug.cgi?id=108984
2888
2889         Reviewed by Eric Seidel.
2890
2891         Previously, the DocumentLoader would always be on the stack when the
2892         HTMLDocumentParser was processing data from the network.  The
2893         DocumentLoader would then tell isLoadingInAPISense not to fire the load
2894         event.  Now that we process data asynchronously with the threaded
2895         parser, the DocumentLoader is not always on the stack, which means we
2896         need to delay the load event using the clause that asks the parser
2897         whether it is processing data.
2898
2899         Unfortunately, that clause is fragile because we can check for load
2900         completion while we're switching parsers between the network-created
2901         parser and a script-created parser. To avoid accidentially triggerin
2902         the load event during these "gaps," this patch introduces a counter on
2903         document to record how many parsers are active on the stack.  While
2904         that numer is non-zero, we'll delay the load event. When that number
2905         reaches zero, we'll check for load complete.
2906
2907         That last step is required because the DocumentLoader::finishLoading
2908         method is no longer guarunteed to check for load complete after calling
2909         finish on the parser because the finish operation might complete
2910         asynchronously.
2911
2912         After this patch, the threaded parser passes all but four fast/parser
2913         tests.
2914
2915         * dom/Document.cpp:
2916         (WebCore::Document::Document):
2917         (WebCore::Document::hasActiveParser):
2918         (WebCore):
2919         (WebCore::Document::decrementActiveParserCount):
2920         * dom/Document.h:
2921         (Document):
2922         (WebCore::Document::incrementActiveParserCount):
2923         * html/parser/HTMLDocumentParser.cpp:
2924         (WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser):
2925         (WebCore::HTMLDocumentParser::pumpTokenizer):
2926         * html/parser/HTMLParserScheduler.cpp:
2927         (WebCore::ActiveParserSession::ActiveParserSession):
2928         (WebCore):
2929         (WebCore::ActiveParserSession::~ActiveParserSession):
2930         (WebCore::PumpSession::PumpSession):
2931         (WebCore::PumpSession::~PumpSession):
2932         * html/parser/HTMLParserScheduler.h:
2933         (WebCore):
2934         (ActiveParserSession):
2935         (PumpSession):
2936         * loader/DocumentLoader.cpp:
2937         (WebCore::DocumentLoader::isLoadingInAPISense):
2938
2939 2013-02-09  Mike West  <mkwst@chromium.org>
2940
2941         Use IGNORE_EXCEPTION for initialized, but unused, ExceptionCodes.
2942         https://bugs.webkit.org/show_bug.cgi?id=109295
2943
2944         Reviewed by Darin Adler.
2945
2946         The monster patch in http://wkbug.com/108771 missed an entire class of
2947         ignored exceptions. It only dealt with call sites that never initialized
2948         the ExceptionCode variable, on the assumption that only such call sites
2949         would ignore the variable's value.
2950
2951         That was a flawed assumption: a large number of sites that initialize the
2952         ExceptionCode to 0 ignore it regardless. This patch deals with the
2953         almost-as-large set of callsites that initialize the variable, pass it to
2954         a function, and then never touch it again.
2955
2956         * Modules/indexeddb/IDBDatabase.cpp:
2957         (WebCore::IDBDatabase::forceClose):
2958         * accessibility/AccessibilityRenderObject.cpp:
2959         (WebCore::AccessibilityRenderObject::ariaSelectedTextRange):
2960         (WebCore::AccessibilityRenderObject::visiblePositionForIndex):
2961         (WebCore::AccessibilityRenderObject::indexForVisiblePosition):
2962         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2963         (getSelectionOffsetsForObject):
2964         * accessibility/atk/WebKitAccessibleUtil.cpp:
2965         (selectionBelongsToObject):
2966         * dom/Node.cpp:
2967         (WebCore::Node::textRects):
2968         * editing/DeleteButtonController.cpp:
2969         (WebCore::DeleteButtonController::hide):
2970         * editing/EditingStyle.cpp:
2971         (WebCore::EditingStyle::styleAtSelectionStart):
2972         * editing/Editor.cpp:
2973         (WebCore::Editor::canDeleteRange):
2974         (WebCore::Editor::pasteAsPlainText):
2975         (WebCore::Editor::pasteAsFragment):
2976         (WebCore::Editor::shouldDeleteRange):
2977         (WebCore::Editor::dispatchCPPEvent):
2978         (WebCore::Editor::setComposition):
2979         (WebCore::Editor::advanceToNextMisspelling):
2980         (WebCore::isFrameInRange):
2981         * editing/EditorCommand.cpp:
2982         (WebCore::expandSelectionToGranularity):
2983         * editing/MergeIdenticalElementsCommand.cpp:
2984         (WebCore::MergeIdenticalElementsCommand::doApply):
2985         * editing/SplitElementCommand.cpp:
2986         (WebCore::SplitElementCommand::doUnapply):
2987         * editing/SplitTextNodeCommand.cpp:
2988         (WebCore::SplitTextNodeCommand::doApply):
2989         * editing/TextCheckingHelper.cpp:
2990         (WebCore::expandToParagraphBoundary):
2991         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2992         (WebCore::TextCheckingHelper::isUngrammatical):
2993         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
2994         * editing/TextInsertionBaseCommand.cpp:
2995         (WebCore::dispatchBeforeTextInsertedEvent):
2996         (WebCore::canAppendNewLineFeedToSelection):
2997         * editing/TextIterator.cpp:
2998         (WebCore::findPlainText):
2999         * editing/htmlediting.cpp:
3000         (WebCore::extendRangeToWrappingNodes):
3001         (WebCore::isNodeVisiblyContainedWithin):
3002         * editing/visible_units.cpp:
3003         (WebCore::nextBoundary):
3004         * html/FileInputType.cpp:
3005         (WebCore::FileInputType::createShadowSubtree):
3006         * html/HTMLKeygenElement.cpp:
3007         (WebCore::HTMLKeygenElement::HTMLKeygenElement):
3008         * html/HTMLScriptElement.cpp:
3009         (WebCore::HTMLScriptElement::setText):
3010         * html/HTMLTitleElement.cpp:
3011         (WebCore::HTMLTitleElement::setText):
3012         * html/HTMLTrackElement.cpp:
3013         (WebCore::HTMLTrackElement::didCompleteLoad):
3014         * html/RangeInputType.cpp:
3015         (WebCore::RangeInputType::createShadowSubtree):
3016         * html/SearchInputType.cpp:
3017         (WebCore::SearchInputType::createShadowSubtree):
3018         * html/TextFieldInputType.cpp:
3019         (WebCore::TextFieldInputType::createShadowSubtree):
3020         * html/track/TextTrackList.cpp:
3021         (TextTrackList::asyncEventTimerFired):
3022         * inspector/DOMPatchSupport.cpp:
3023         (WebCore::DOMPatchSupport::patchDocument):
3024         * inspector/InspectorDatabaseAgent.cpp:
3025         (WebCore):
3026         * inspector/InspectorFileSystemAgent.cpp:
3027         (WebCore):
3028         * page/DOMSelection.cpp:
3029         (WebCore::DOMSelection::addRange):
3030         * page/DragController.cpp:
3031         (WebCore::DragController::dispatchTextInputEventFor):
3032         * page/EventHandler.cpp:
3033         (WebCore::EventHandler::dispatchMouseEvent):
3034         (WebCore::EventHandler::handleTouchEvent):
3035         * page/FrameActionScheduler.cpp:
3036         (WebCore::EventFrameAction::fire):
3037         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3038         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
3039         * svg/SVGDocument.cpp:
3040         (WebCore::SVGDocument::dispatchZoomEvent):
3041         (WebCore::SVGDocument::dispatchScrollEvent):
3042         * svg/SVGLength.cpp:
3043         (WebCore::SVGLength::SVGLength):
3044         (WebCore::SVGLength::value):
3045         * xml/parser/XMLDocumentParser.cpp:
3046         (WebCore::XMLDocumentParser::exitText):
3047         * xml/parser/XMLDocumentParserQt.cpp:
3048         (WebCore::XMLDocumentParser::parse):
3049         (WebCore::XMLDocumentParser::startDocument):
3050         (WebCore::XMLDocumentParser::parseCharacters):
3051
3052 2013-02-09  Stephen White  <senorblanco@chromium.org>
3053
3054         [skia] Fix memory management in SkiaImageFilterBuilder and friends.
3055         https://bugs.webkit.org/show_bug.cgi?id=109326
3056
3057         Sadly, skia has no official ref-counted pointers, so we must make do
3058         with SkAutoTUnref.
3059
3060         Reviewed by James Robinson.
3061
3062         Correctness covered by existing tests in css3/filters.
3063
3064         * platform/graphics/filters/skia/FEBlendSkia.cpp:
3065         (WebCore::FEBlend::createImageFilter):
3066         * platform/graphics/filters/skia/FEComponentTransferSkia.cpp:
3067         (WebCore::FEComponentTransfer::createImageFilter):
3068         * platform/graphics/filters/skia/FELightingSkia.cpp:
3069         (WebCore::FELighting::createImageFilter):
3070         Adopt refs produced by the build() pass with SkAutoTUnref.
3071         * platform/graphics/filters/skia/SkiaImageFilterBuilder.cpp:
3072         (WebCore::SkiaImageFilterBuilder::~SkiaImageFilterBuilder):
3073         Unref the builder's hashmap effect pointers.
3074         (WebCore::SkiaImageFilterBuilder::build):
3075         Ref the pointer returned to the caller, and use SkAutoTUnref
3076         internally while building the tree.
3077         * platform/graphics/filters/skia/SkiaImageFilterBuilder.h:
3078         (SkiaImageFilterBuilder):
3079         Add a destructor to SkiaImageFilterBuilder.
3080
3081
3082 2013-02-09  Dominic Mazzoni  <dmazzoni@google.com>
3083
3084         AX: Rename AXObject::cachedIsIgnoredValue to lastKnownIsIgnoredValue
3085         https://bugs.webkit.org/show_bug.cgi?id=108238
3086
3087         Reviewed by Chris Fleizach.
3088
3089         Simple refactoring, no new tests.
3090
3091         * accessibility/AXObjectCache.cpp:
3092         (WebCore::AXObjectCache::getOrCreate):
3093         (WebCore::AXObjectCache::childrenChanged):
3094         * accessibility/AccessibilityObject.cpp:
3095         (WebCore::AccessibilityObject::AccessibilityObject):
3096         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
3097         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
3098         (WebCore::AccessibilityObject::notifyIfIgnoredValueChanged):
3099         * accessibility/AccessibilityObject.h:
3100         (AccessibilityObject):
3101
3102 2013-02-09  Anton Vayvod  <avayvod@chromium.org>
3103  
3104         [Text Autosizing] Cleanup change: converter the pointer argument to be a reference since
3105         non-null pointer is always expected.
3106         https://bugs.webkit.org/show_bug.cgi?id=109079
3107  
3108         Reviewed by Kenneth Rohde Christiansen.
3109  
3110         Cleanup change, no need to add new tests or modify the existing ones.
3111  
3112         * rendering/TextAutosizer.cpp:
3113  
3114         Changed parameter from a pointer to a reference in the methods below.
3115  
3116         (WebCore::TextAutosizer::processSubtree):
3117         (WebCore::TextAutosizer::processCluster):
3118         (WebCore::TextAutosizer::processContainer):
3119         (WebCore::TextAutosizer::isNarrowDescendant):
3120         (WebCore::TextAutosizer::isWiderDescendant):
3121         (WebCore::TextAutosizer::isAutosizingCluster):
3122         (WebCore::TextAutosizer::clusterShouldBeAutosized):
3123         (WebCore::TextAutosizer::measureDescendantTextWidth):
3124  
3125         * rendering/TextAutosizer.h: updated method prototypes.
3126
3127 2013-02-09  Rafael Brandao  <rafael.lobo@openbossa.org>
3128
3129         [TexMap] Separate classes per file in TextureMapperBackingStore.h
3130         https://bugs.webkit.org/show_bug.cgi?id=109333
3131
3132         Reviewed by Noam Rosenthal.
3133
3134         TextureMapperBackingStore.h had the classes TextureMapperBackingStore,
3135         TextureMapperTiledBackingStore, TextureMapperSurfaceBackingStore and
3136         TextureMapperTile which was quite confusing. Now each one has its
3137         own header and its own source file.
3138
3139         No new tests needed, refactoring only.
3140
3141         * CMakeLists.txt:
3142         * GNUmakefile.list.am:
3143         * Target.pri:
3144         * WebCore.gypi:
3145         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3146         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
3147         * platform/graphics/texmap/TextureMapperBackingStore.h:
3148         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Added.
3149         (WebCore):
3150         (WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface):
3151         (WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded):
3152         (WebCore::TextureMapperSurfaceBackingStore::texture):
3153         (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
3154         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Added.
3155         (WebCore):
3156         (TextureMapperSurfaceBackingStore):
3157         (WebCore::TextureMapperSurfaceBackingStore::create):
3158         (WebCore::TextureMapperSurfaceBackingStore::~TextureMapperSurfaceBackingStore):
3159         (WebCore::TextureMapperSurfaceBackingStore::TextureMapperSurfaceBackingStore):
3160         * platform/graphics/texmap/TextureMapperTile.cpp: Added.
3161         (WebCore):
3162         (WebCore::TextureMapperTile::updateContents):
3163         (WebCore::TextureMapperTile::paint):
3164         * platform/graphics/texmap/TextureMapperTile.h: Added.
3165         (WebCore):
3166         (TextureMapperTile):
3167         (WebCore::TextureMapperTile::texture):
3168         (WebCore::TextureMapperTile::rect):
3169         (WebCore::TextureMapperTile::setTexture):
3170         (WebCore::TextureMapperTile::setRect):
3171         (WebCore::TextureMapperTile::~TextureMapperTile):
3172         (WebCore::TextureMapperTile::TextureMapperTile):
3173         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp: Copied from Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp.
3174         (WebCore):
3175         (WebCore::TextureMapperTiledBackingStore::TextureMapperTiledBackingStore):
3176         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
3177         (WebCore::TextureMapperTiledBackingStore::adjustedTransformForRect):
3178         (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
3179         (WebCore::TextureMapperTiledBackingStore::drawBorder):
3180         (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
3181         (WebCore::TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded):
3182         (WebCore::TextureMapperTiledBackingStore::updateContents):
3183         (WebCore::TextureMapperTiledBackingStore::texture):
3184         * platform/graphics/texmap/TextureMapperTiledBackingStore.h: Added.
3185         (WebCore):
3186         (TextureMapperTiledBackingStore):
3187         (WebCore::TextureMapperTiledBackingStore::create):
3188         (WebCore::TextureMapperTiledBackingStore::~TextureMapperTiledBackingStore):
3189         (WebCore::TextureMapperTiledBackingStore::setContentsToImage):
3190         (WebCore::TextureMapperTiledBackingStore::rect):
3191         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
3192         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
3193
3194 2013-02-09  Philip Rogers  <pdr@google.com>
3195
3196         Sanitize m_keyTimes for paced value animations
3197         https://bugs.webkit.org/show_bug.cgi?id=108828
3198
3199         Reviewed by Dirk Schulze.
3200
3201         SVG animations with calcMode=paced calculate new m_keyTimes in
3202         SVGAnimationElement::calculateKeyTimesForCalcModePaced() because paced animations do not
3203         specify keyTimes. If an error occurs while calculating m_keyTimes, and there exists
3204         user-specified values, a crash could occur because the user-specified values were not
3205         sanitized.
3206
3207         This change clears user-specified keyTimes before calculating new ones.
3208
3209         Test: svg/animations/animate-keytimes-crash.html
3210
3211         * svg/SVGAnimationElement.cpp:
3212         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
3213
3214 2013-02-09  Eric Seidel  <eric@webkit.org>
3215
3216         Fix TextDocumentParser to play nice with threading
3217         https://bugs.webkit.org/show_bug.cgi?id=109240
3218
3219         Reviewed by Adam Barth.
3220
3221         Before the HTML5 parser re-write the text document parser
3222         was completely custom.  With the HTML5 parser, we just made
3223         the TextDocumentParser use the HTMLDocumentParser with an
3224         artificial script tag.
3225
3226         However, our solution was slightly over-engineered to avoid
3227         lying about the column numbers of the first line of the text document
3228         during parsing. :)
3229
3230         This change makes us use a simpler (and threading-compatible)
3231         solution by just inserting a real "<pre>" tag into the
3232         input stream instead of hacking one together with the treebuilder
3233         and manually setting the Tokenizer state.
3234
3235         fast/parser/empty-text-resource.html covers this case.
3236
3237         * html/parser/TextDocumentParser.cpp:
3238         (WebCore::TextDocumentParser::TextDocumentParser):
3239         (WebCore::TextDocumentParser::insertFakePreElement):
3240
3241 2013-02-09  Kent Tamura  <tkent@chromium.org>
3242
3243         Add missing copyright header
3244         https://bugs.webkit.org/show_bug.cgi?id=107507
3245
3246         * Resources/pagepopups/chromium/calendarPickerChromium.css:
3247         * Resources/pagepopups/chromium/pickerCommonChromium.css:
3248
3249 2013-02-09  Kent Tamura  <tkent@chromium.org>
3250
3251         Fix crash by img[ismap] with content property
3252         https://bugs.webkit.org/show_bug.cgi?id=108702
3253
3254         Reviewed by Adam Barth.
3255
3256         Test: fast/dom/HTMLAnchorElement/anchor-ismap-crash.html
3257
3258         * html/HTMLAnchorElement.cpp:
3259         (WebCore::appendServerMapMousePosition):
3260         Check if the renderer of an img element is RenderImage.
3261
3262 2013-02-09  Mike West  <mkwst@chromium.org>
3263
3264         Drop ExceptionCode from IDB's directionToString and modeToString.
3265         https://bugs.webkit.org/show_bug.cgi?id=109143
3266
3267         Reviewed by Jochen Eisinger.
3268
3269         No caller of either IDBCursor::directionToString or
3270         IDBTransaction::modeToString makes use of the ExceptionCode these
3271         methods require. This patch removes the 'ExceptionCode&' parameter from
3272         both methods and their callsites.
3273
3274         * Modules/indexeddb/IDBCursor.cpp:
3275         (WebCore::IDBCursor::direction):
3276         (WebCore::IDBCursor::directionToString):
3277             Drop the 'ExceptionCode&' parameter, and replace the 'TypeError'
3278             exception previously generated with ASSERT_NOT_REACHED.
3279         * Modules/indexeddb/IDBCursor.h:
3280         * Modules/indexeddb/IDBTransaction.cpp:
3281         (WebCore::IDBTransaction::mode):
3282         (WebCore::IDBTransaction::modeToString):
3283             Drop the 'ExceptionCode&' parameter, and replace the 'TypeError'
3284             exception previously generated with ASSERT_NOT_REACHED.
3285         * Modules/indexeddb/IDBTransaction.h:
3286
3287 2013-02-09  Kondapally Kalyan  <kalyan.kondapally@intel.com>
3288
3289         [EFL][Qt][WebGL] Share the common code between GraphicsSurfaceGLX and X11WindowResources.
3290         https://bugs.webkit.org/show_bug.cgi?id=106666
3291
3292         Reviewed by Kenneth Rohde Christiansen.
3293
3294         Covered by existing WebGL tests.
3295
3296         This patch removes any duplicate code in X11WindowResources and
3297         GraphicsSurfaceGLX. No new functionality is added.
3298
3299         * PlatformEfl.cmake:
3300         * Target.pri:
3301         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp:
3302         (WebCore::EGLConfigSelector::pixmapContextConfig):
3303         * platform/graphics/surfaces/egl/EGLConfigSelector.h:
3304         (EGLConfigSelector):
3305         * platform/graphics/surfaces/egl/EGLSurface.cpp:
3306         (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
3307         (WebCore::EGLWindowTransportSurface::destroy):
3308         (WebCore::EGLWindowTransportSurface::setGeometry):
3309         * platform/graphics/surfaces/egl/EGLSurface.h:
3310         (WebCore):
3311         (EGLWindowTransportSurface):
3312         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
3313         (WebCore::GLXConfigSelector::GLXConfigSelector):
3314         (WebCore::GLXConfigSelector::visualInfo):
3315         (WebCore::GLXConfigSelector::pBufferContextConfig):
3316         (WebCore::GLXConfigSelector::createSurfaceConfig):
3317         (GLXConfigSelector):
3318         * platform/graphics/surfaces/glx/GLXContext.cpp:
3319         (WebCore::initializeARBExtensions):
3320         (WebCore::GLXOffScreenContext::GLXOffScreenContext):
3321         (WebCore::GLXOffScreenContext::initialize):
3322         (WebCore::GLXOffScreenContext::platformReleaseCurrent):
3323         (WebCore::GLXOffScreenContext::freeResources):
3324         * platform/graphics/surfaces/glx/GLXContext.h:
3325         (GLXOffScreenContext):
3326         * platform/graphics/surfaces/glx/GLXSurface.cpp:
3327         (WebCore::GLXTransportSurface::GLXTransportSurface):
3328         (WebCore::GLXTransportSurface::setGeometry):
3329         (WebCore::GLXTransportSurface::destroy):
3330         (WebCore::GLXPBuffer::initialize):
3331         * platform/graphics/surfaces/glx/GLXSurface.h:
3332         (GLXTransportSurface):
3333         (GLXPBuffer):
3334         * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
3335         (WebCore):
3336         (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate):
3337         (WebCore::GraphicsSurfacePrivate::initialize):
3338         (GraphicsSurfacePrivate):
3339         (WebCore::GraphicsSurfacePrivate::createSurface):
3340         (WebCore::GraphicsSurfacePrivate::createPixmap):
3341         (WebCore::GraphicsSurfacePrivate::display):
3342         (WebCore::GraphicsSurfacePrivate::flags):
3343         (WebCore::GraphicsSurfacePrivate::clear):
3344         (WebCore::GraphicsSurface::platformPaintToTextureMapper):
3345         No new functionality added. Made changes to take the common code into use.
3346
3347         * platform/graphics/surfaces/glx/X11WindowResources.h: Removed.
3348         * platform/graphics/surfaces/glx/X11Helper.cpp: Renamed from Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp.
3349         (WebCore):
3350         (WebCore::DisplayConnection::DisplayConnection):
3351         (DisplayConnection):
3352         (WebCore::DisplayConnection::~DisplayConnection):
3353         (WebCore::DisplayConnection::display):
3354         (OffScreenRootWindow):
3355         (WebCore::OffScreenRootWindow::OffScreenRootWindow):
3356         (WebCore::OffScreenRootWindow::~OffScreenRootWindow):
3357         (WebCore::OffScreenRootWindow::rootWindow):
3358         (WebCore::X11Helper::resizeWindow):
3359         (WebCore::X11Helper::createOffScreenWindow):
3360         (WebCore::X11Helper::destroyWindow):
3361         (WebCore::X11Helper::isXRenderExtensionSupported):
3362         (WebCore::X11Helper::nativeDisplay):
3363         (WebCore::X11Helper::offscreenRootWindow):
3364         * platform/graphics/surfaces/glx/X11Helper.h: Added.
3365         (WebCore):
3366         (WebCore::handleXPixmapCreationError):
3367         (X11Helper):
3368         (ScopedXPixmapCreationErrorHandler):
3369         (WebCore::ScopedXPixmapCreationErrorHandler::ScopedXPixmapCreationErrorHandler):
3370         (WebCore::ScopedXPixmapCreationErrorHandler::~ScopedXPixmapCreationErrorHandler):
3371         (WebCore::ScopedXPixmapCreationErrorHandler::isValidOperation):
3372         Moved common code from GraphicsSurfaceGLX to X11Helper.
3373
3374 2013-02-09  Andrey Lushnikov  <lushnikov@chromium.org>
3375
3376         Web Inspector: show whitespace characters in DTE
3377         https://bugs.webkit.org/show_bug.cgi?id=108947
3378
3379         Reviewed by Pavel Feldman.
3380
3381         New test: inspector/editor/text-editor-show-whitespaces.html
3382
3383         Split consecutive whitespace characters into groups of 16, 8, 4, 2 and 1 and
3384         add ::before pseudoclass for this groups which contains necessary
3385         amount of "dots" (u+00b7). Add a setting "Show whitespace" for this
3386         option in "Sources" section of "General" tab.
3387
3388         * English.lproj/localizedStrings.js:
3389         * inspector/front-end/DefaultTextEditor.js:
3390         (WebInspector.TextEditorMainPanel.prototype.wasShown):
3391         (WebInspector.TextEditorMainPanel.prototype.willHide):
3392         (WebInspector.TextEditorMainPanel.prototype._renderRanges):
3393         (WebInspector.TextEditorMainPanel.prototype._renderWhitespaceCharsWithFixedSizeSpans):
3394         (WebInspector.TextEditorMainPanel.prototype._paintLine):
3395         * inspector/front-end/Settings.js:
3396         * inspector/front-end/SettingsScreen.js:
3397         (WebInspector.GenericSettingsTab):
3398         * inspector/front-end/inspectorSyntaxHighlight.css:
3399         (.webkit-whitespace-1::before):
3400         (.webkit-whitespace-2::before):
3401         (.webkit-whitespace-4::before):
3402         (.webkit-whitespace-8::before):
3403         (.webkit-whitespace-16::before):
3404         (.webkit-whitespace::before):
3405
3406 2013-02-08  Eric Carlson  <eric.carlson@apple.com>
3407
3408         [Mac] respect in-band caption color
3409         https://bugs.webkit.org/show_bug.cgi?id=109203
3410
3411         Reviewed by Dean Jackson.
3412
3413         Test: media/track/track-in-band-style.html
3414
3415         * WebCore.xcodeproj/project.pbxproj: Add HTMLDivElement.h to private headers because it is 
3416             included by HTMLTextElement, which is included by HTMLMediaElement.h, which is included 
3417             by files in WebKit/WebKit2.
3418         * html/track/InbandTextTrack.cpp:
3419         (WebCore::InbandTextTrack::addGenericCue): Set cue colors if necessary.
3420
3421         * html/track/TextTrackCue.h:
3422         (WebCore::TextTrackCue::element): New, accessor for the cue element so it can be styled.
3423
3424         * html/track/TextTrackCueGeneric.cpp:
3425         (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): Set container and cue background 
3426             color if necessary.
3427         (WebCore::TextTrackCueGeneric::operator==): Compare cue colors.
3428         * html/track/TextTrackCueGeneric.h:
3429         (WebCore::TextTrackCueGeneric::foregroundColor): Add color accessors.
3430         (WebCore::TextTrackCueGeneric::setForegroundColor):
3431         (WebCore::TextTrackCueGeneric::backgroundColor):
3432         (WebCore::TextTrackCueGeneric::setBackgroundColor):
3433
3434         * page/CaptionUserPreferencesMac.mm:
3435         (WebCore::CaptionUserPreferencesMac::registerForCaptionPreferencesChangedCallbacks): Always
3436             regenerate override CSS when an element registers for callbacks.
3437         (WebCore::CaptionUserPreferencesMac::captionsWindowCSS): Drive by fix of "window color" padding.
3438         (WebCore::CaptionUserPreferencesMac::captionsStyleSheetOverride): Log the stylesheet generated
3439             for easier debugging.
3440
3441         * platform/graphics/InbandTextTrackPrivateClient.h:
3442         (WebCore::GenericCueData::foregroundColor): Add color getters/setters.
3443         (WebCore::GenericCueData::setForegroundColor):
3444         (WebCore::GenericCueData::backgroundColor):
3445         (WebCore::GenericCueData::setBackgroundColor):
3446
3447         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
3448         (WebCore::makeRGBA32FromARGBCFArray): Initialize a RGBA32 from a CFArray of color values.
3449         (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Process cue colors.
3450
3451 2013-02-08  Benjamin Poulain  <bpoulain@apple.com>
3452
3453         Move workerThreadCount from TestRunner to WebCore Internals
3454         https://bugs.webkit.org/show_bug.cgi?id=109239
3455
3456         Reviewed by Darin Adler.
3457
3458         Add the new read-only property workerThreadCount.
3459
3460         * testing/Internals.cpp:
3461         (WebCore::Internals::workerThreadCount):
3462         (WebCore):
3463         * testing/Internals.h:
3464         (Internals):
3465         * testing/Internals.idl:
3466
3467 2013-02-08  Dean Jackson  <dino@apple.com>
3468
3469         Snapshotted plug-in should use shadow root
3470         https://bugs.webkit.org/show_bug.cgi?id=108284
3471
3472         Reviewed by Simon Fraser.
3473
3474         Take two! This time with updated exports file.
3475
3476         A snapshotted plugin needs to indicate to the user that it can be clicked
3477         to be restarted. Previously this was done with an image that had embedded
3478         text. Instead, we now use an internal shadow root to embed some markup that
3479         will display instructions that can be localised.
3480
3481         The UA stylesheet for plug-ins provides a default styling for the label, which
3482         can be overridden by ports.
3483
3484         In the process, RenderSnapshottedPlugIn no longer inherits from RenderEmbeddedObject,
3485         since it is only responsible for drawing a paused plug-in. The snapshot creation
3486         can work with the default renderer, but a shadow root requires something like
3487         RenderBlock in order to draw its children. We swap from one renderer to another when
3488         necessary either by creating the shadow root or by explicitly detaching and attaching
3489         the plugin element.
3490
3491         Unfortunately this is difficult to test, because the snapshotting requires
3492         time to execute, and also a PluginView to be instantiated.
3493
3494         * WebCore.exp.in: Export the InlineBox interface.
3495
3496         * css/plugIns.css:
3497         (object::-webkit-snapshotted-plugin-content): New rules for a default label style.
3498
3499         * platform/LocalizedStrings.cpp: Make sure all ports have plugin strings, now it is called.
3500         * platform/LocalizedStrings.h:
3501         * platform/blackberry/LocalizedStringsBlackBerry.cpp:
3502         * platform/chromium/LocalizedStringsChromium.cpp:
3503         * platform/efl/LocalizedStringsEfl.cpp:
3504         * platform/gtk/LocalizedStringsGtk.cpp:
3505         * platform/qt/LocalizedStringsQt.cpp:
3506
3507         * html/HTMLPlugInElement.cpp:
3508         (WebCore::HTMLPlugInElement::defaultEventHandler): Take into account the fact
3509         that RenderSnapshottedPlugIn no longer is an embedded object.
3510
3511         * html/HTMLPlugInImageElement.cpp:
3512         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): New default values in constructor.
3513         (WebCore::HTMLPlugInElement::defaultEventHandler): Make sure to call base class.
3514         (WebCore::HTMLPlugInElement::willRecalcStyle): No need to reattach if we're a snapshot.
3515         (WebCore::HTMLPlugInImageElement::createRenderer): If we're showing a snapshot, create such
3516             a renderer, otherwise use the typical plug-in path.
3517         (WebCore::HTMLPlugInImageElement::updateSnapshot): Keep a record of the snapshot, since we'll
3518             need to give it to the renderer.
3519         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Build a subtree that will display a label.
3520         * html/HTMLPlugInImageElement.h:
3521         (HTMLPlugInImageElement): New member variable to record the snapshot image and whether the label
3522             should show immediately.
3523         (WebCore::HTMLPlugInImageElement::swapRendererTimerFired): The callback function triggered when we need
3524             to swap to the Shadow Root.
3525         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): The user has tapped on the snapshot so the plugin
3526             in being recreated. Make sure we reattach so that a plugin renderer will be created.
3527         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Make sure we set the right
3528             displayState for snapshots.
3529         * html/HTMLPlugInImageElement.h:
3530         (HTMLPlugInImageElement): The new methods listed above.
3531         (WebCore::HTMLPlugInImageElement::setShouldShowSnapshotLabelAutomatically): Indicates whether or not
3532             a snapshot should be immediately labeled.
3533
3534         * page/ChromeClient.h: No need for plugInStartLabelImage any more.
3535
3536         * rendering/RenderSnapshottedPlugIn.cpp:
3537         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): New inheritance.
3538         (WebCore::RenderSnapshottedPlugIn::paint): If we're in the background paint phase, render the snapshot image.
3539         (WebCore::RenderSnapshottedPlugIn::paintSnapshotImage): Rename.
3540         (WebCore::RenderSnapshottedPlugIn::paintSnapshot): Rename.
3541         (WebCore::RenderSnapshottedPlugIn::paintSnapshotWithLabel): Rename. No need for label sizes.
3542         (WebCore::RenderSnapshottedPlugIn::getCursor):
3543         (WebCore::RenderSnapshottedPlugIn::handleEvent): The renderer doesn't restart the plug-in any more. Tell the element and it will do it.
3544         * rendering/RenderSnapshottedPlugIn.h:
3545         (RenderSnapshottedPlugIn): New inheritance. Some method renaming.
3546
3547 2013-02-08  Dean Jackson  <dino@apple.com>
3548
3549         Rolling out r142333 and r142337 which broke Mac Release builds.
3550
3551 2013-02-08  Sheriff Bot  <webkit.review.bot@gmail.com>
3552
3553         Unreviewed, rolling out r142337.
3554         http://trac.webkit.org/changeset/142337
3555         https://bugs.webkit.org/show_bug.cgi?id=109339
3556
3557         Breaking Mac release builds (Requested by dino_ on #webkit).
3558
3559         * rendering/RenderSnapshottedPlugIn.h:
3560
3561 2013-02-08  Dean Jackson  <dino@apple.com>
3562
3563         Attempted Mac and GTK build fix after r142333.
3564
3565         * rendering/RenderSnapshottedPlugIn.h: Include InlineBox.h.
3566
3567 2013-02-08  Andy Estes  <aestes@apple.com>
3568
3569         Restore pre-r118852 behavior for EllipsisBox::nodeAtPoint()
3570         https://bugs.webkit.org/show_bug.cgi?id=109277
3571
3572         Reviewed by Simon Fraser.
3573
3574         Test: fast/flexbox/line-clamp-link-after-ellipsis.html
3575
3576         Roll out r118852. Enough time has passed that this can't be done
3577         mechanically, so transcribe the old method definition to current
3578         WebCore interfaces.
3579
3580         * rendering/EllipsisBox.cpp:
3581         (WebCore::EllipsisBox::markupBox): EllipsisBox no longer has
3582         m_markupBox, so break the logic for finding the markup box from
3583         paintMarkupBox() into its own function.
3584         (WebCore::EllipsisBox::paintMarkupBox): Call markupBox().
3585         (WebCore::EllipsisBox::nodeAtPoint): Transcribe the pre-r118852 implementation.
3586         * rendering/EllipsisBox.h:
3587         (EllipsisBox): Declare markupBox().
3588
3589 2013-02-08  Eric Carlson  <eric.carlson@apple.com>
3590
3591         [Mac] In-band closed caption tracks are not always initialized correctly
3592         https://bugs.webkit.org/show_bug.cgi?id=109323
3593
3594         Reviewed by Dean Jackson.
3595
3596         No new tests, this fix makes existing tests less flakey.
3597
3598         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3599         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Create and configure legible output
3600             here instad of in tracksChanged.
3601         (WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible): Do nothing in a build with
3602             in-band track support.
3603         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Move legible output creation to 
3604             createAVPlayerItem, don't set look at track media type to see if the movie has captions 
3605             when we have support for in-band captions.
3606
3607 2013-02-08  Dean Jackson  <dino@apple.com>
3608
3609         Snapshotted plug-in should use shadow root
3610         https://bugs.webkit.org/show_bug.cgi?id=108284
3611
3612         Reviewed by Simon Fraser.
3613
3614         A snapshotted plugin needs to indicate to the user that it can be clicked
3615         to be restarted. Previously this was done with an image that had embedded
3616         text. Instead, we now use an internal shadow root to embed some markup that
3617         will display instructions that can be localised.
3618
3619         The UA stylesheet for plug-ins provides a default styling for the label, which
3620         can be overridden by ports.
3621
3622         In the process, RenderSnapshottedPlugIn no longer inherits from RenderEmbeddedObject,
3623         since it is only responsible for drawing a paused plug-in. The snapshot creation
3624         can work with the default renderer, but a shadow root requires something like
3625         RenderBlock in order to draw its children. We swap from one renderer to another when
3626         necessary either by creating the shadow root or by explicitly detaching and attaching
3627         the plugin element.
3628
3629         Unfortunately this is difficult to test, because the snapshotting requires
3630         time to execute, and also a PluginView to be instantiated.
3631
3632         * css/plugIns.css:
3633         (object::-webkit-snapshotted-plugin-content): New rules for a default label style.
3634
3635         * platform/LocalizedStrings.cpp: Make sure all ports have plugin strings, now it is called.
3636         * platform/LocalizedStrings.h:
3637         * platform/blackberry/LocalizedStringsBlackBerry.cpp:
3638         * platform/chromium/LocalizedStringsChromium.cpp:
3639         * platform/efl/LocalizedStringsEfl.cpp:
3640         * platform/gtk/LocalizedStringsGtk.cpp:
3641         * platform/qt/LocalizedStringsQt.cpp:
3642
3643         * html/HTMLPlugInElement.cpp:
3644         (WebCore::HTMLPlugInElement::defaultEventHandler): Take into account the fact
3645         that RenderSnapshottedPlugIn no longer is an embedded object.
3646
3647         * html/HTMLPlugInImageElement.cpp:
3648         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): New default values in constructor.
3649         (WebCore::HTMLPlugInElement::defaultEventHandler): Make sure to call base class.
3650         (WebCore::HTMLPlugInElement::willRecalcStyle): No need to reattach if we're a snapshot.
3651         (WebCore::HTMLPlugInImageElement::createRenderer): If we're showing a snapshot, create such
3652             a renderer, otherwise use the typical plug-in path.
3653         (WebCore::HTMLPlugInImageElement::updateSnapshot): Keep a record of the snapshot, since we'll
3654             need to give it to the renderer.
3655         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Build a subtree that will display a label.
3656         * html/HTMLPlugInImageElement.h:
3657         (HTMLPlugInImageElement): New member variable to record the snapshot image and whether the label
3658             should show immediately.
3659         (WebCore::HTMLPlugInImageElement::swapRendererTimerFired): The callback function triggered when we need
3660             to swap to the Shadow Root.
3661         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): The user has tapped on the snapshot so the plugin
3662             in being recreated. Make sure we reattach so that a plugin renderer will be created.
3663         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Make sure we set the right
3664             displayState for snapshots.
3665         * html/HTMLPlugInImageElement.h:
3666         (HTMLPlugInImageElement): The new methods listed above.
3667         (WebCore::HTMLPlugInImageElement::setShouldShowSnapshotLabelAutomatically): Indicates whether or not
3668             a snapshot should be immediately labeled.
3669
3670         * page/ChromeClient.h: No need for plugInStartLabelImage any more.
3671
3672         * rendering/RenderSnapshottedPlugIn.cpp:
3673         (WebCore::RenderSnapshottedPlugIn::RenderSnapshottedPlugIn): New inheritance.
3674         (WebCore::RenderSnapshottedPlugIn::paint): If we're in the background paint phase, render the snapshot image.
3675         (WebCore::RenderSnapshottedPlugIn::paintSnapshotImage): Rename.
3676         (WebCore::RenderSnapshottedPlugIn::paintSnapshot): Rename.
3677         (WebCore::RenderSnapshottedPlugIn::paintSnapshotWithLabel): Rename. No need for label sizes.
3678         (WebCore::RenderSnapshottedPlugIn::getCursor):
3679         (WebCore::RenderSnapshottedPlugIn::handleEvent): The renderer doesn't restart the plug-in any more. Tell the element and it will do it.
3680         * rendering/RenderSnapshottedPlugIn.h:
3681         (RenderSnapshottedPlugIn): New inheritance. Some method renaming.
3682
3683 2013-02-08  Kentaro Hara  <haraken@chromium.org>
3684
3685         {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator should be in FocusEvent.cpp
3686         https://bugs.webkit.org/show_bug.cgi?id=109265
3687
3688         Reviewed by Dimitri Glazkov.
3689
3690         Conventionally we put XXXEventDispatchMediator to XXXEvent.cpp.
3691         We should move {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator to FocusEvent.cpp.
3692
3693         No tests. No change in behavior.
3694
3695         * dom/EventDispatchMediator.cpp:
3696         * dom/EventDispatchMediator.h:
3697         * dom/FocusEvent.cpp:
3698         (WebCore::FocusEventDispatchMediator::create):
3699         (WebCore):
3700         (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
3701         (WebCore::FocusEventDispatchMediator::dispatchEvent):
3702         (WebCore::BlurEventDispatchMediator::create):
3703         (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
3704         (WebCore::BlurEventDispatchMediator::dispatchEvent):
3705         (WebCore::FocusInEventDispatchMediator::create):
3706         (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
3707         (WebCore::FocusInEventDispatchMediator::dispatchEvent):
3708         (WebCore::FocusOutEventDispatchMediator::create):
3709         (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
3710         (WebCore::FocusOutEventDispatchMediator::dispatchEvent):
3711         * dom/FocusEvent.h:
3712         (WebCore):
3713         (FocusEventDispatchMediator):
3714         (BlurEventDispatchMediator):
3715         (FocusInEventDispatchMediator):
3716         (FocusOutEventDispatchMediator):
3717         * dom/UIEvent.cpp:
3718         * dom/UIEvent.h:
3719
3720 2013-02-08  Jer Noble  <jer.noble@apple.com>
3721
3722         Unreviewed build fix. MSVC (and other compilers) need a default: case in switch statement.
3723
3724         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3725         (WebCore::notificationName):
3726
3727 2013-02-08  Jer Noble  <jer.noble@apple.com>
3728
3729         Bring WebKit up to speed with latest Encrypted Media spec.
3730         https://bugs.webkit.org/show_bug.cgi?id=97037
3731
3732         Reviewed by Eric Carlson.
3733
3734         The most recent version of the Encrypted Media Extensions spec breaks functionality out of the
3735         HTMLMediaElement and into new MediaKeys and MediaKeySession classes. Since the CDM functionality
3736         has been pulled out of the media element, we create a proxy CDM class and factory system for
3737         creating specific CDM key system implementations. The spec also breaks out MediaKeyEvent
3738         into distinct event classes, MediaKeyNeededEvent and MediaKeyMessageEvent, for needkey and
3739         keymessage events, respectively.
3740
3741         Tests: media/encrypted-media/encrypted-media-v2-events.html
3742                media/encrypted-media/encrypted-media-v2-syntax.html
3743
3744         CDM is a proxy class (a la MediaPlayer) for a specific CDMPrivateInterface implementation. A CDM
3745         implementation is registered with the CDMFactory and will be created if that implementation supports
3746         the key system passed into the MediaKeys constructor. CDMSession is a pure-virtual interface exposed
3747         by concrete CDMPrivate subclasses.  Its lifetime is owned by MediaKeySession.
3748         * Modules/encryptedmedia/CDM.cpp: Added.
3749         (WebCore::installedCDMFactories): Initialize all the known CDM subtypes. Ports will add CDM implementations here.
3750         (WebCore::CDM::registerCDMFactory): Registers a new CDMFactory using the passed in function pointers.
3751         (WebCore::CDMFactoryForKeySystem): Return the first CDM factory which supports the requested key system.
3752         (WebCore::CDM::supportsKeySystem): Walk the installed CDMs and ask if the given key system is supported.
3753         (WebCore::CDM::supportsKeySystemMIMETypeAndCodec): Ditto, with an additional MIME type and codec string.
3754         (WebCore::CDM::create): Simple constructor wrapper.
3755         (WebCore::CDM::CDM): Simple constructor; calls bestCDMForKeySystem() to create it's private implementation.
3756         (WebCore::CDM::~CDM): Simple destructor.
3757         (WebCore::CDM::createSession): Creates a new CDMSession.
3758         * Modules/encryptedmedia/CDM.h: Added.
3759         (WebCore::CDM::keySystem): Simple accessor for m_keySystem.
3760         (WebCore::CDMSession::CDMSession): Simple constructor.
3761         (WebCore::CDMSession::~CDMSession): Simple destructor.
3762         * Modules/encryptedmedia/CDMPrivate.h: Added.
3763         (WebCore::CDMPrivateInterface::CDMPrivateInterface): Simple constructor.
3764         (WebCore::CDMPrivateInterface::~CDMPrivateInterface): Simple destructor.
3765
3766         The new classes, MediaKeyMessageEvent and MediaKeyNeededEvent, take distinct subsets of the initializers of
3767         the original MediaKeyMessageEvent.
3768         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp: Copied from Source/WebCore/html/MediaKeyEvent.cpp.
3769         (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Initializer now only takes message and destinationURL
3770             parameters.
3771         (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent): Simple constructor.
3772         (WebCore::MediaKeyMessageEvent::~MediaKeyMessageEvent): Simple destructor.
3773         (WebCore::MediaKeyMessageEvent::interfaceName): Standard interfaceName.
3774         * Modules/encryptedmedia/MediaKeyMessageEvent.h: Copied from Source/WebCore/html/MediaKeyEvent.h.
3775         (WebCore::MediaKeyMessageEvent::create): Simple construction wrapper.
3776         (WebCore::MediaKeyMessageEvent::message): Simple accessor for m_message.
3777         (WebCore::MediaKeyMessageEvent::destinationURL): Simple accessor for m_destinationURL.
3778         * Modules/encryptedmedia/MediaKeyMessageEvent.idl: Copied from Source/WebCore/html/MediaKeyEvent.idl.
3779         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp: Copied from Source/WebCore/html/MediaKeyEvent.h.
3780         (WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Initializer now only takes initData parameter.
3781         (WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent): Simple constructor.
3782         (WebCore::MediaKeyNeededEvent::~MediaKeyNeededEvent): Simple destructor.
3783         (WebCore::MediaKeyNeededEvent::interfaceName): Standard interfaceName.
3784         * Modules/encryptedmedia/MediaKeyNeededEvent.h: Copied from Source/WebCore/html/MediaKeyEvent.h.
3785         (WebCore::MediaKeyNeededEvent::create): Simple construction wrapper.
3786         (WebCore::MediaKeyNeededEvent::initData): Simple accessor for m_initData.
3787         * Modules/encryptedmedia/MediaKeyNeededEvent.idl: Copied from Source/WebCore/html/MediaKeyEvent.idl.
3788
3789         MediaKeySession is a new class that maps keys and key requests to a given session ID:
3790         * Modules/encryptedmedia/MediaKeySession.cpp: Added.
3791         (WebCore::MediaKeySession::create): Simple construction wrapper.
3792         (WebCore::MediaKeySession::MediaKeySession): Simple constructor.
3793         (WebCore::MediaKeySession::~MediaKeySession): Simple destructor; calls close().
3794         (WebCore::MediaKeySession::setError): Simple setter for m_error;
3795         (WebCore::MediaKeySession::close): Tell the CDM to clear any saved session keys.
3796         (WebCore::MediaKeySession::generateKeyRequest): Start a one-shot timer, handled in keyRequestTimerFired.
3797         (WebCore::MediaKeySession::keyRequestTimerFired): Follow the steps in the spec; ask the CDM to generate a key request.
3798         (WebCore::MediaKeySession::addKey): Start a one-shot timer, handled in addKeyTimerFired.
3799         (WebCore::MediaKeySession::addKeyTimerFired): Follow the steps in the spec; provide the key data to the CDM.
3800         * Modules/encryptedmedia/MediaKeySession.h: Added.
3801         (WebCore::MediaKeySession::keySystem): Simple accessor for m_keySystem.
3802         (WebCore::MediaKeySession::sessionId): Simple accessor for m_sessionId.
3803         (WebCore::MediaKeySession::error): Simple accessor for m_error;
3804         * Modules/encryptedmedia/MediaKeySession.idl:
3805
3806         MediaKeySession inherits from EventTarget, and must override the pure virtual functions in that class:
3807         * Modules/encryptedmedia/MediaKeySession.cpp: Added.
3808         (WebCore::MediaKeySession::interfaceName):
3809         * Modules/encryptedmedia/MediaKeySession.h: Added.
3810         (WebCore::MediaKeySession::refEventTarget):
3811         (WebCore::MediaKeySession::derefEventTarget):
3812         (WebCore::MediaKeySession::eventTargetData):
3813         (WebCore::MediaKeySession::ensureEventTargetData):
3814         (WebCore::MediaKeySession::scriptExecutionContext):
3815
3816         MediaKeys is a new class that encapsulates a CDM and a number of key sessions:
3817         * Modules/encryptedmedia/MediaKeys.cpp: Added.
3818         (WebCore::MediaKeys::create): Throw an exception if the key system parameter is unsupported; create a CDM object
3819             and a new MediaKeys session.
3820         (WebCore::MediaKeys::MediaKeys): Simple constructor.
3821         (WebCore::MediaKeys::~MediaKeys): Simple destructor.
3822         (WebCore::MediaKeys::createSession): Follow the spec and create a new key session.
3823         * Modules/encryptedmedia/MediaKeys.h: Added.
3824         * Modules/encryptedmedia/MediaKeys.idl: Copied from Source/WebCore/html/MediaError.idl.
3825
3826         Provide a new interface to HTMLMediaElement for MediaPlayer which does not require a sessionId or a key system:
3827         * html/HTMLMediaElement.cpp:
3828         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3829         * platform/graphics/MediaPlayer.cpp:
3830         (WebCore::MediaPlayer::keyNeeded):
3831
3832         MediaKeyError now has a systemCode parameter and member variable.
3833         * html/MediaKeyError.h:
3834         (WebCore::MediaKeyError::create): Take a systemCode parameter with a default (0) value.
3835         (WebCore::MediaKeyError::MediaKeyError): Ditto.
3836         (WebCore::MediaKeyError::systemCode): Simple accessor for m_systemCode.
3837         * html/MediaKeyError.idl:
3838
3839         Add new methods to HTMLMediaElement to support MediaKeys. Support different initializer
3840         for the MediaKeyNeededEvent.
3841         * html/HTMLMediaElement.cpp:
3842         (WebCore::HTMLMediaElement::setMediaKeys): Simple setter for m_mediaKeys.
3843         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): This version takes fewer parameters
3844             than the deprecated version.
3845         * html/HTMLMediaElement.h:
3846         (WebCore::HTMLMediaElement::mediaKeys): Simple accessor for m_mediaKeys.
3847         * html/HTMLMediaElement.idl: Add the mediaKeys attribute.
3848
3849         Add an ENABLE(ENCRYPTED_MEDIA_V2) check to the existing ENABLE(ENCRYPTED_MEDIA) one:
3850         * html/MediaError.h:
3851         * html/MediaError.idl:
3852         * platform/graphics/MediaPlayer.cpp:
3853         (WebCore::bestMediaEngineForTypeAndCodecs):
3854         (WebCore::MediaPlayer::supportsType):
3855         * platform/graphics/MediaPlayer.h:
3856         (WebCore::MediaPlayer::keyNeeded): This version takes fewer parameters than the
3857             deprecated version.
3858
3859         Support the new version of canPlayType which takes an extra parameter:
3860         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3861         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3862         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
3863         (WebCore::MediaPlayerPrivateAVFoundationObjC::extendedSupportsType):
3864         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3865         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3866         (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine):
3867         (WebCore::MediaPlayerPrivateQTKit::extendedSupportsType):
3868
3869         Add a mock CDM for use within DRT and WKTR to test the MediaKeys and MediaKeySession
3870         APIs and events:
3871         * testing/Internals.cpp:
3872         (WebCore::Internals::initializeMockCDM): Add the MockCDM class to the CDM factories.
3873         * testing/Internals.h:
3874         * testing/Internals.idl: Add the initializeMockCDM() method.
3875         * testing/MockCDM.cpp: Added.
3876         (WebCore::MockCDM::supportsKeySystem): Only supports the 'com.webcore.mock' key system.
3877         (WebCore::MockCDM::supportsMIMEType): Only supports the 'video/mock' mime type.
3878         (WebCore::initDataPrefix): Static method which returns a Uint8Array containing 'mock'.
3879         (WebCore::keyPrefix): Static method which returns a Uint8Array containing 'key'.
3880         (WebCore::keyRequest): Static method which returns a Uint8Array containing 'request'.
3881         (WebCore::generateSessionId): Return a monotonically increasing number.
3882         (WebCore::MockCDMSession::MockCDMSession): Simple constructor.
3883         (WebCore::MockCDMSession::generateKeyRequest): Ignores the parameters and returns a keyRequest() array.
3884         (WebCore::MockCDMSession::releaseKeys): No-op.
3885         (WebCore::MockCDMSession::addKey): Checks that the key starts with the keyPrefix() array.
3886         * testing/MockCDM.h: Added.
3887         (WebCore::MockCDM::create):
3888         (WebCore::MockCDM::~MockCDM): Simple destructor.
3889         (WebCore::MockCDM::MockCDM): Simple constructor.
3890
3891         Add the new classes to the built system:
3892         * Configurations/FeatureDefines.xcconfig:
3893         * DerivedSources.make:
3894         * WebCore.exp.in:
3895         * WebCore.xcodeproj/project.pbxproj:
3896
3897         Miscelaneous changes:
3898         * dom/EventNames.in: Add the two new event types, MediaKeyMessageEvent and MediaKeyNeededEvent.
3899         * dom/EventTargetFactory.in: Add the new EventTarget, MediaKeySession.
3900         * page/DOMWindow.idl: Add constructors for the new classes to the window object.
3901
3902 2013-02-08  Chris Fleizach  <cfleizach@apple.com>
3903
3904         Refactor platform-specific code in SpeechSynthesis
3905         https://bugs.webkit.org/show_bug.cgi?id=107414
3906
3907         Reviewed by Sam Weinig.
3908
3909         Refactor WebSpeech code to use a platform mechanism to provide access to platform resources.
3910
3911         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
3912         (WebCore::DOMWindowSpeechSynthesis::from):
3913         * Modules/speech/SpeechSynthesis.cpp:
3914         (WebCore::SpeechSynthesis::SpeechSynthesis):
3915         (WebCore):
3916         (WebCore::SpeechSynthesis::voicesDidChange):
3917         (WebCore::SpeechSynthesis::getVoices):
3918         (WebCore::SpeechSynthesis::pending):
3919         (WebCore::SpeechSynthesis::speaking):
3920         (WebCore::SpeechSynthesis::paused):
3921         (WebCore::SpeechSynthesis::speak):
3922         (WebCore::SpeechSynthesis::cancel):
3923         (WebCore::SpeechSynthesis::pause):
3924         (WebCore::SpeechSynthesis::resume):
3925         * Modules/speech/SpeechSynthesis.h:
3926         (WebCore):
3927         (SpeechSynthesis):
3928         (WebCore::SpeechSynthesis::didStartSpeaking):
3929         (WebCore::SpeechSynthesis::didFinishSpeaking):
3930         (WebCore::SpeechSynthesis::speakingErrorOccurred):
3931         * Modules/speech/SpeechSynthesisUtterance.cpp:
3932         (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
3933         * Modules/speech/SpeechSynthesisUtterance.h:
3934         (WebCore::SpeechSynthesisUtterance::text):
3935         (WebCore::SpeechSynthesisUtterance::setText):
3936         (WebCore::SpeechSynthesisUtterance::lang):
3937         (WebCore::SpeechSynthesisUtterance::setLang):
3938         (WebCore::SpeechSynthesisUtterance::voiceURI):
3939         (WebCore::SpeechSynthesisUtterance::setVoiceURI):
3940         (WebCore::SpeechSynthesisUtterance::volume):
3941         (WebCore::SpeechSynthesisUtterance::setVolume):
3942         (WebCore::SpeechSynthesisUtterance::rate):
3943         (WebCore::SpeechSynthesisUtterance::setRate):
3944         (WebCore::SpeechSynthesisUtterance::pitch):
3945         (WebCore::SpeechSynthesisUtterance::setPitch):
3946         (SpeechSynthesisUtterance):
3947         (WebCore::SpeechSynthesisUtterance::platformUtterance):
3948         * Modules/speech/SpeechSynthesisVoice.cpp:
3949         (WebCore::SpeechSynthesisVoice::create):
3950         (WebCore::SpeechSynthesisVoice::SpeechSynthesisVoice):
3951         * Modules/speech/SpeechSynthesisVoice.h:
3952         (SpeechSynthesisVoice):
3953         (WebCore::SpeechSynthesisVoice::voiceURI):
3954         (WebCore::SpeechSynthesisVoice::name):
3955         (WebCore::SpeechSynthesisVoice::lang):
3956         (WebCore::SpeechSynthesisVoice::localService):
3957         (WebCore::SpeechSynthesisVoice::isDefault):
3958         * Modules/speech/mac/SpeechSynthesisMac.mm:
3959         * WebCore.xcodeproj/project.pbxproj:
3960         * platform/PlatformSpeechSynthesis.h: Added.
3961         (WebCore):
3962         (PlatformSpeechSynthesis):
3963         * platform/PlatformSpeechSynthesisUtterance.cpp: Added.
3964         (WebCore):
3965         (WebCore::PlatformSpeechSynthesisUtterance::PlatformSpeechSynthesisUtterance):
3966         * platform/PlatformSpeechSynthesisUtterance.h: Added.
3967         (WebCore):
3968         (PlatformSpeechSynthesisUtteranceClient):
3969         (WebCore::PlatformSpeechSynthesisUtteranceClient::~PlatformSpeechSynthesisUtteranceClient):
3970         (PlatformSpeechSynthesisUtterance):
3971         (WebCore::PlatformSpeechSynthesisUtterance::text):
3972         (WebCore::PlatformSpeechSynthesisUtterance::setText):
3973         (WebCore::PlatformSpeechSynthesisUtterance::lang):
3974         (WebCore::PlatformSpeechSynthesisUtterance::setLang):
3975         (WebCore::PlatformSpeechSynthesisUtterance::voiceURI):
3976         (WebCore::PlatformSpeechSynthesisUtterance::setVoiceURI):
3977         (WebCore::PlatformSpeechSynthesisUtterance::volume):
3978         (WebCore::PlatformSpeechSynthesisUtterance::setVolume):
3979         (WebCore::PlatformSpeechSynthesisUtterance::rate):
3980         (WebCore::PlatformSpeechSynthesisUtterance::setRate):
3981         (WebCore::PlatformSpeechSynthesisUtterance::pitch):
3982         (WebCore::PlatformSpeechSynthesisUtterance::setPitch):
3983         * platform/PlatformSpeechSynthesisVoice.cpp: Added.
3984         (WebCore):
3985         (WebCore::PlatformSpeechSynthesisVoice::create):
3986         (WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice):
3987         * platform/PlatformSpeechSynthesisVoice.h: Added.
3988         (WebCore):
3989         (PlatformSpeechSynthesisVoice):
3990         (WebCore::PlatformSpeechSynthesisVoice::voiceURI):
3991         (WebCore::PlatformSpeechSynthesisVoice::name):
3992         (WebCore::PlatformSpeechSynthesisVoice::lang):
3993         (WebCore::PlatformSpeechSynthesisVoice::localService):
3994         (WebCore::PlatformSpeechSynthesisVoice::isDefault):
3995         * platform/PlatformSpeechSynthesizer.cpp: Added.
3996         (WebCore):
3997         (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
3998         * platform/PlatformSpeechSynthesizer.h: Added.
3999         (WebCore):
4000       &