2008-12-29 Josh Roesslein <jroesslein@gmail.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-12-29  Josh Roesslein  <jroesslein@gmail.com>
2
3         Reviewed by Oliver Hunt.
4
5         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22968
6
7         Context menu rendering error when full page zoomed
8
9         * page/ContextMenuController.cpp:
10         (WebCore::ContextMenuController::handleContextMenuEvent):
11
12 2008-12-29  Sam Weinig  <sam@webkit.org>
13
14         Reviewed by Mark Rowe.
15
16         Add some basic memory statistic logging for Node.
17
18         * dom/Node.cpp:
19         (WebCore::Node::dumpStatistics):
20         (WebCore::Node::Node):
21         (WebCore::Node::~Node):
22         (WebCore::Node::setDocument):
23         * dom/Node.h:
24
25 2008-12-29  Sam Weinig  <sam@webkit.org>
26
27         Reviewed by Anders Carlsson.
28
29         Remove one use of DeprecatedPtrList.
30
31         * css/CSSRuleList.cpp:
32         (WebCore::CSSRuleList::~CSSRuleList):
33         (WebCore::CSSRuleList::length):
34         (WebCore::CSSRuleList::item):
35         (WebCore::CSSRuleList::deleteRule):
36         (WebCore::CSSRuleList::append):
37         (WebCore::CSSRuleList::insertRule):
38         * css/CSSRuleList.h: Change m_lstCSSRules from using DeprecatedPtrList to a Vector.
39         I measured no performance change and was comforted by the fact that we use a Vector
40         for StyleList, which serves the exact same purpose.
41
42 2008-12-29  Adele Peterson  <adele@apple.com>
43
44         Reviewed by Brady Eidson.
45
46         Fix for https://bugs.webkit.org/show_bug.cgi?id=21797
47         <rdar://problem/6310682> REGRESSION: Crash in CFHTTPCookieStorageCopy beneath WebCore::cookies() when 
48         running fast/dom/document-attribute-js-null.html and http/tests/security/cookies/create-document.html
49         
50         Return early if the document is trying to get or set a cookie with an empty cookie url.
51
52         * dom/Document.cpp:
53         (WebCore::Document::cookie):
54         (WebCore::Document::setCookie):
55
56 2008-12-28  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
57
58         Reviewed by Sam Weinig.
59
60         Bug 23016: JavaScriptDebugServer::recompileAllJSFunctions() should not execute JS while reparsing all functions
61         <https://bugs.webkit.org/show_bug.cgi?id=23016>
62         <rdar://problem/6425077>
63
64         JavaScriptDebugServer::recompileAllJSFunctions() calls sourceParsed() while
65         reparsing all JS functions, which will execute JS in the inspector. Depending
66         on the order in which functions are recompiled, a function could have a new
67         body but other functions that have not been recompiled could have an optimized
68         (in the sense of inline caching) call to it, bypassing the check of whether or
69         not there is generated bytecode. This leads to a crash caused by accessing
70         indices off of a null pointer.
71
72         To fix the problem, simply delay calling sourceParsed() until after all functions
73         have been reparsed. The crash isn't 100% reproducible, but on the one test case
74         I have, this makes it impossible to reproduce after a large number of attempts,
75         when it used to happen every few attempts.
76
77         * inspector/JavaScriptDebugServer.cpp:
78         (WebCore::JavaScriptDebugServer::recompileAllJSFunctions):
79
80 2008-12-28  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
81
82         Rubber-stamped by Antti Koivisto.
83         Oops, remove some last minute ASSERTS that are obviously wrong.
84
85         * rendering/RenderTextControlMultiLine.cpp:
86         (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
87         * rendering/RenderTextControlSingleLine.cpp:
88         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
89
90 2008-12-28  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
91
92         Reviewed by Antti Koivisto.
93
94         Fixes: https://bugs.webkit.org/show_bug.cgi?id=23015
95
96         Don't rely on HTMLFormControlElement in RenderTextControl.
97
98         Introduce an abstract FormControlElement class, containing the
99         valueMatchesRenderer/setValueMatchesRenderer, the only HTMLFormControlElement
100         specific methods that RenderTextControl relies on.
101
102         This makes it possible for WML to reuse RenderTextControl.
103         RenderTextControlSingleLine still relies on HTMLInputElement,
104         this will change if WMLInputElement is introduced.
105
106         * GNUmakefile.am:
107         * WebCore.vcproj/WebCore.vcproj:
108         * WebCore.xcodeproj/project.pbxproj:
109         * dom/FormControlElement.h: Added.
110         (WebCore::FormControlElement::~FormControlElement):
111         (WebCore::FormControlElement::FormControlElement):
112         * html/HTMLFormControlElement.h:
113         (WebCore::HTMLFormControlElement::valueMatchesRenderer):
114         (WebCore::HTMLFormControlElement::setValueMatchesRenderer):
115         * html/HTMLTextAreaElement.cpp:
116         (WebCore::HTMLTextAreaElement::updateValue):
117         * rendering/RenderTextControl.cpp:
118         (WebCore::RenderTextControl::adjustInnerTextStyle):
119         (WebCore::RenderTextControl::updateFromElement):
120         (WebCore::RenderTextControl::setInnerTextValue):
121         (WebCore::RenderTextControl::selectionChanged):
122         (WebCore::RenderTextControl::formControlElement):
123         * rendering/RenderTextControl.h:
124         * rendering/RenderTextControlMultiLine.cpp:
125         (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
126         (WebCore::RenderTextControlMultiLine::subtreeHasChanged):
127         * rendering/RenderTextControlSingleLine.cpp:
128         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
129         (WebCore::RenderTextControlSingleLine::updateFromElement):
130
131 2008-12-28  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
132
133         Reviewed by Darin Adler.
134
135         Bug 23006: Many Loader::Host member functions are not safe to use reentrantly
136         <https://bugs.webkit.org/show_bug.cgi?id=23006>
137         <rdar://problem/6216106>
138
139         Many Loader::Host member functions set m_processingResource to true when they
140         begin processing a resource and set it to false when they are done. Thanks to
141         JavaScript and the web inspector, almost anything can happen during the
142         processing of a resource, including these functions being called reentrantly,
143         which is unsafe due to this way of using m_processingResource.
144
145         This can theoretically cause a Loader::Host to be used after it is freed,
146         because when Loader::servedPendingRequests() is called, it will free Hosts
147         that have m_processingResource set to false.
148
149         To fix this, we replace m_processingResource with m_numResourcesProcessing,
150         which is incremented and decremented using a helper object, ProcessingResource.
151
152         There are no occurrences of crashes caused by this bug that are reproducible
153         by multiple people, but this fixes the problem of m_processingResource being
154         set to false while a Host is still alive.
155
156         * loader/loader.cpp:
157         (WebCore::Loader::Host::Host):
158         (WebCore::Loader::Host::didFinishLoading): Change to use ProcessingResource
159         instead of manually setting m_processingResource.
160         (WebCore::Loader::Host::didFail): Ditto.
161         (WebCore::Loader::Host::didReceiveData): Ditto.
162         * loader/loader.h:
163         (WebCore::Loader::Host::ProcessingResource::ProcessingResource): Added.
164         (WebCore::Loader::Host::ProcessingResource::~ProcessingResource): Added.
165         (WebCore::Loader::Host::processingResource): Change to use m_numResourcesProcessing
166         instead of just getting m_processingResource.
167
168 2008-12-28  Alexey Proskuryakov  <ap@webkit.org>
169
170         Reviewed by Darin Adler.
171
172         https://bugs.webkit.org/show_bug.cgi?id=23007
173         REGRESSION: Timer-related crash when closing Web Inspector
174
175         Test: fast/dom/Window/remove-timeout-crash.html
176
177         * bindings/js/DOMTimer.cpp: (WebCore::DOMTimer::fired): Besides deleting the timer, make
178         sure to remove it from a Document map.
179
180 2008-12-28  Alexey Proskuryakov  <ap@webkit.org>
181
182         Reviewed by Anders Carlsson.
183
184         https://bugs.webkit.org/show_bug.cgi?id=23012
185         Bring application cache manifest parsing up to date
186
187         Test: http/tests/appcache/manifest-parsing.html
188
189         * loader/appcache/ManifestParser.cpp:
190         (WebCore::Mode): Added a constant for unknown sections, which are ignored when parsing. This
191         is necessary for future extensions.
192         (WebCore::parseManifest): Parse unknown sections correctly. Ignore trailing tokens in
193         supported sections.
194
195 2008-12-28  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
196
197         Reviewed by Darin Adler.
198
199         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22996
200
201         RenderTextControl heavily depends on HTMLInputElement & HTMLTextAreaElement.
202         It handles multi & single line text control rendering in one class. Split up
203         in two new classes: RenderTextControlSingleLine & RenderTextControlMultiLine.
204
205         This has several benefits - code is more readable now, the memory usage
206         for RenderTextControlMultiLine is reduced, as all stuff related to search fields
207         lives in RenderTextControlSingleLine, and it's easier to introduce an
208         abstraction for input/textarea-like elements for other HTML flavours like WML.
209
210         * GNUmakefile.am:
211         * WebCore.order:
212         * WebCore.pro:
213         * WebCore.scons:
214         * WebCore.vcproj/WebCore.vcproj:
215         * WebCore.xcodeproj/project.pbxproj:
216         * WebCoreSources.bkl:
217         * html/HTMLInputElement.cpp:
218         (WebCore::HTMLInputElement::createRenderer):
219         (WebCore::HTMLInputElement::defaultEventHandler):
220         (WebCore::HTMLInputElement::updatePlaceholderVisibility):
221         (WebCore::HTMLInputElement::addSearchResult):
222         (WebCore::HTMLInputElement::onSearch):
223         * html/HTMLTextAreaElement.cpp:
224         (WebCore::HTMLTextAreaElement::createRenderer):
225         (WebCore::HTMLTextAreaElement::defaultEventHandler):
226         * rendering/RenderTextControl.cpp:
227         (WebCore::RenderTextControl::RenderTextControl):
228         (WebCore::RenderTextControl::~RenderTextControl):
229         (WebCore::RenderTextControl::styleDidChange):
230         (WebCore::RenderTextControl::adjustInnerTextStyle):
231         (WebCore::RenderTextControl::createSubtreeIfNeeded):
232         (WebCore::RenderTextControl::textBlockHeight):
233         (WebCore::RenderTextControl::textBlockWidth):
234         (WebCore::RenderTextControl::updateFromElement):
235         (WebCore::RenderTextControl::setInnerTextValue):
236         (WebCore::RenderTextControl::setSelectionRange):
237         (WebCore::RenderTextControl::visiblePositionForIndex):
238         (WebCore::RenderTextControl::indexForVisiblePosition):
239         (WebCore::RenderTextControl::subtreeHasChanged):
240         (WebCore::RenderTextControl::scrollbarThickness):
241         (WebCore::RenderTextControl::calcHeight):
242         (WebCore::RenderTextControl::hitInnerTextBlock):
243         (WebCore::RenderTextControl::forwardEvent):
244         (WebCore::RenderTextControl::calcPrefWidths):
245         (WebCore::RenderTextControl::selectionChanged):
246         (WebCore::RenderTextControl::innerTextElement):
247         * rendering/RenderTextControl.h:
248         (WebCore::RenderTextControl::hasControlClip):
249         (WebCore::RenderTextControl::canHaveChildren):
250         (WebCore::RenderTextControl::avoidsFloats):
251         (WebCore::RenderTextControl::isEdited):
252         (WebCore::RenderTextControl::setEdited):
253         * rendering/RenderTextControlMultiLine.cpp: Added.
254         (WebCore::RenderTextControlMultiLine::RenderTextControlMultiLine):
255         (WebCore::RenderTextControlMultiLine::~RenderTextControlMultiLine):
256         (WebCore::RenderTextControlMultiLine::subtreeHasChanged):
257         (WebCore::RenderTextControlMultiLine::layout):
258         (WebCore::RenderTextControlMultiLine::nodeAtPoint):
259         (WebCore::RenderTextControlMultiLine::forwardEvent):
260         (WebCore::RenderTextControlMultiLine::preferredContentWidth):
261         (WebCore::RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight):
262         (WebCore::RenderTextControlMultiLine::baselinePosition):
263         (WebCore::RenderTextControlMultiLine::updateFromElement):
264         (WebCore::RenderTextControlMultiLine::cacheSelection):
265         (WebCore::RenderTextControlMultiLine::createInnerTextStyle):
266         * rendering/RenderTextControlMultiLine.h: Added.
267         (WebCore::RenderTextControlMultiLine::isTextArea):
268         * rendering/RenderTextControlSingleLine.cpp: Added.
269         (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
270         (WebCore::RenderTextControlSingleLine::~RenderTextControlSingleLine):
271         (WebCore::RenderTextControlSingleLine::placeholderShouldBeVisible):
272         (WebCore::RenderTextControlSingleLine::updatePlaceholderVisibility):
273         (WebCore::RenderTextControlSingleLine::addSearchResult):
274         (WebCore::RenderTextControlSingleLine::stopSearchEventTimer):
275         (WebCore::RenderTextControlSingleLine::showPopup):
276         (WebCore::RenderTextControlSingleLine::hidePopup):
277         (WebCore::RenderTextControlSingleLine::subtreeHasChanged):
278         (WebCore::RenderTextControlSingleLine::paint):
279         (WebCore::RenderTextControlSingleLine::layout):
280         (WebCore::RenderTextControlSingleLine::nodeAtPoint):
281         (WebCore::RenderTextControlSingleLine::forwardEvent):
282         (WebCore::RenderTextControlSingleLine::styleDidChange):
283         (WebCore::RenderTextControlSingleLine::capsLockStateMayHaveChanged):
284         (WebCore::RenderTextControlSingleLine::textBlockWidth):
285         (WebCore::RenderTextControlSingleLine::preferredContentWidth):
286         (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
287         (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
288         (WebCore::RenderTextControlSingleLine::updateFromElement):
289         (WebCore::RenderTextControlSingleLine::cacheSelection):
290         (WebCore::RenderTextControlSingleLine::createInnerTextStyle):
291         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle):
292         (WebCore::RenderTextControlSingleLine::createResultsButtonStyle):
293         (WebCore::RenderTextControlSingleLine::createCancelButtonStyle):
294         (WebCore::RenderTextControlSingleLine::updateCancelButtonVisibility):
295         (WebCore::RenderTextControlSingleLine::autosaveName):
296         (WebCore::RenderTextControlSingleLine::startSearchEventTimer):
297         (WebCore::RenderTextControlSingleLine::searchEventTimerFired):
298         (WebCore::RenderTextControlSingleLine::valueChanged):
299         (WebCore::RenderTextControlSingleLine::itemText):
300         (WebCore::RenderTextControlSingleLine::itemIsEnabled):
301         (WebCore::RenderTextControlSingleLine::itemStyle):
302         (WebCore::RenderTextControlSingleLine::menuStyle):
303         (WebCore::RenderTextControlSingleLine::clientInsetLeft):
304         (WebCore::RenderTextControlSingleLine::clientInsetRight):
305         (WebCore::RenderTextControlSingleLine::clientPaddingLeft):
306         (WebCore::RenderTextControlSingleLine::clientPaddingRight):
307         (WebCore::RenderTextControlSingleLine::listSize):
308         (WebCore::RenderTextControlSingleLine::selectedIndex):
309         (WebCore::RenderTextControlSingleLine::itemIsSeparator):
310         (WebCore::RenderTextControlSingleLine::itemIsLabel):
311         (WebCore::RenderTextControlSingleLine::itemIsSelected):
312         (WebCore::RenderTextControlSingleLine::setTextFromItem):
313         (WebCore::RenderTextControlSingleLine::fontSelector):
314         (WebCore::RenderTextControlSingleLine::hostWindow):
315         (WebCore::RenderTextControlSingleLine::createScrollbar):
316         * rendering/RenderTextControlSingleLine.h: Added.
317         (WebCore::RenderTextControlSingleLine::hasControlClip):
318         (WebCore::RenderTextControlSingleLine::isTextField):
319         (WebCore::RenderTextControlSingleLine::placeholderIsVisible):
320         (WebCore::RenderTextControlSingleLine::popupIsVisible):
321         (WebCore::RenderTextControlSingleLine::shouldPopOver):
322         (WebCore::RenderTextControlSingleLine::valueShouldChangeOnHotTrack):
323         * rendering/TextControlInnerElements.cpp:
324         (WebCore::RenderTextControlInnerBlock::nodeAtPoint):
325         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
326
327 2008-12-28  Dmitry Titov  <dimich@chromium.org>
328
329         Reviewed by Darin Adler.
330
331         https://bugs.webkit.org/show_bug.cgi?id=22755
332         Prepare to add create/remove timeout methods to JSWorkerContext by moving
333         timer-specific code from JSDOMWindowBase to DOMTimer.
334         Moved everything JS-related from DOMTimer to ScheduledAction.
335         Now ScheduledAction is what it wanted to be all the time: a JS engine-specific 
336         container for timer callback that knows how to invoke it.
337         DOMTimer is not anymore JS-specific.
338
339         This is mostly moving the code around. No intended functional changes.
340
341         * bindings/js/DOMTimer.cpp:
342         (WebCore::DOMTimer::DOMTimer):
343         (WebCore::DOMTimer::~DOMTimer):
344         (WebCore::DOMTimer::install):
345         (WebCore::DOMTimer::removeById):
346         (WebCore::DOMTimer::fired):
347         (WebCore::DOMTimer::stop):
348         * bindings/js/DOMTimer.h:
349         * bindings/js/JSDOMWindowBase.cpp:
350         (WebCore::JSDOMWindowBase::installTimeout):
351         (WebCore::JSDOMWindowBase::removeTimeout):
352         * bindings/js/JSDOMWindowBase.h:
353         * bindings/js/ScheduledAction.cpp:
354         (WebCore::ScheduledAction::execute):
355         * bindings/js/ScheduledAction.h:
356         * dom/Document.cpp:
357         (WebCore::Document::addTimeout):
358
359 2008-12-26  Zalan Bujtas  <zbujtas@gmail.com>
360
361         Reviewed by Darin Adler.
362
363         https://bugs.webkit.org/show_bug.cgi?id=22999
364         Check if database thread exists.
365
366         * storage/Database.cpp:
367         (WebCore::Database::openAndVerifyVersion):
368         (WebCore::Database::markAsDeletedAndClose):
369         (WebCore::Database::tableNames):
370
371 2008-12-26  Alexey Proskuryakov  <ap@webkit.org>
372
373         Reviewed by Darin Adler.
374
375         https://bugs.webkit.org/show_bug.cgi?id=23001
376         A call to applicationCache.update() from a cached event listener should be ignored
377
378         Test: http/tests/appcache/idempotent-update.html
379
380         * loader/appcache/ApplicationCacheGroup.cpp:
381         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Only reset m_status after
382         dispatching events.
383
384 2008-12-26  Alexey Proskuryakov  <ap@webkit.org>
385
386         Reviewed by Darin Adler.
387
388         https://bugs.webkit.org/show_bug.cgi?id=22997
389         ASSERTION FAILED: !m_resources.contains(url) in ApplicationCache::addResource()
390
391         Tests: http/tests/appcache/top-frame-1.html
392                http/tests/appcache/top-frame-2.html
393                http/tests/appcache/top-frame-3.html
394                http/tests/appcache/top-frame-4.html
395
396         * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::cacheForMainRequest):
397         Fixed one more instance of top level frame being used for caching purposes.
398
399 2008-12-26  Dmitry Titov  <dimich@chromium.org>
400
401         Reviewed by Darin Adler.
402
403         https://bugs.webkit.org/show_bug.cgi?id=22987
404         Fix for broken test editing/execCommand/5763082.html
405
406         * editing/CompositeEditCommand.cpp:
407         (WebCore::CompositeEditCommand::mergeIdenticalElements): Used local RefPtr to hold onto
408         function parameter across multiple calls.
409
410 2008-12-25  Alexey Proskuryakov  <ap@webkit.org>
411
412         Reviewed by Darin Adler.
413
414         https://bugs.webkit.org/show_bug.cgi?id=22993
415         Application cache shouldn't be inherited by subframes
416
417         <rdar://problem/6284708> AppCache crashes in ApplicationCacheResource::addType()
418         This crash happened because main resource for subframe was looked up in top frame's
419         appcache. If not for the spec change, it could have been fixed by preventing the load
420         altogether.
421
422         Test: http/tests/appcache/foreign-iframe-main.html
423         I intend to write additional tests for the behavior change.
424
425         * loader/DocumentLoader.cpp:
426         (WebCore::DocumentLoader::shouldLoadResourceFromApplicationCache):
427         * loader/DocumentLoader.h:
428         (WebCore::DocumentLoader::applicationCache):
429         * loader/MainResourceLoader.cpp:
430         (WebCore::MainResourceLoader::load):
431         * loader/appcache/DOMApplicationCache.cpp:
432         (WebCore::DOMApplicationCache::associatedCache):
433         Removed DocumentLoader::topLevelApplicationCache(), and changed callers accordingly.
434
435         * loader/appcache/ApplicationCacheGroup.cpp:
436         (WebCore::ApplicationCacheGroup::selectCache):
437         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
438         Removed checks for the frame being top-level one, now that subframes are cached independently.
439
440 2008-12-25  Antti Koivisto  <antti@apple.com>
441
442         Reviewed by Oliver Hunt.
443
444         <rdar://problem/6465669> Frequent !isPurgeable() assertion in WebCore::CachedResource::addClient
445         
446         Disallow turning resources that are being revalidated to purgable state.
447         
448         No test, the condition is difficult to produce in DRT.
449
450         * loader/CachedCSSStyleSheet.cpp:
451         (WebCore::CachedCSSStyleSheet::allClientsRemoved):
452         * loader/CachedImage.cpp:
453         (WebCore::CachedImage::destroyDecodedData):
454         * loader/CachedResource.cpp:
455         (WebCore::CachedResource::isSafeToMakePurgeable):
456         (WebCore::CachedResource::makePurgeable):
457         * loader/CachedResource.h:
458         * loader/CachedScript.cpp:
459         (WebCore::CachedScript::destroyDecodedData):
460
461 2008-12-25  Alexey Proskuryakov  <ap@webkit.org>
462
463         Qt build fix.
464
465         * WebCore.pro: Added ThreadGlobalData.cpp.
466
467 2008-12-24  Mark Rowe  <mrowe@apple.com>
468
469         Build fix.
470
471         * WebCore.base.exp:  Remove a symbol from the export file now that it is no longer generated.
472
473 2008-12-24  Holger Hans Peter Freyther  <zecke@selfish.org>
474
475         Unreviewed build fix to find addSubresourceURL
476
477         This is needed to compile on WebKit/Gtk+
478
479         * css/CSSFontFaceSrcValue.cpp:
480
481 2008-12-23  Alexey Proskuryakov  <ap@webkit.org>
482
483         Reviewed by Darin Adler.
484
485         https://bugs.webkit.org/show_bug.cgi?id=22980
486         WebCore uses more thread specific keys than it really needs
487
488         Consolidated ThreadSpecific data into a single ThreadGlobalData structure.
489
490         * GNUmakefile.am:
491         * WebCore.base.exp:
492         * WebCore.scons:
493         * WebCore.vcproj/WebCore.vcproj:
494         * WebCore.xcodeproj/project.pbxproj:
495         * WebCoreSources.bkl:
496         * dom/EventNames.cpp:
497         * dom/EventNames.h:
498         (WebCore::eventNames):
499         * page/Frame.cpp:
500         (WebCore::Frame::Frame):
501         * platform/ThreadGlobalData.cpp: Added.
502         (WebCore::threadGlobalData):
503         (WebCore::ThreadGlobalData::ThreadGlobalData):
504         (WebCore::ThreadGlobalData::~ThreadGlobalData):
505         * platform/ThreadGlobalData.h: Added.
506         (WebCore::ThreadGlobalData::eventNames):
507         (WebCore::ThreadGlobalData::emptyString):
508         (WebCore::ThreadGlobalData::atomicStringTable):
509         (WebCore::ThreadGlobalData::cachedConverterICU):
510         (WebCore::ThreadGlobalData::cachedConverterTEC):
511         * platform/text/AtomicString.cpp:
512         (WebCore::stringTable):
513         (WebCore::AtomicString::add):
514         (WebCore::AtomicString::remove):
515         (WebCore::AtomicString::find):
516         (WebCore::AtomicString::init):
517         * platform/text/StringImpl.cpp:
518         (WebCore::StringImpl::empty):
519         * platform/text/StringImpl.h:
520         * platform/text/TextCodecICU.cpp:
521         (WebCore::ICUConverterWrapper::~ICUConverterWrapper):
522         (WebCore::cachedConverterICU):
523         * platform/text/TextCodecICU.h:
524         (WebCore::ICUConverterWrapper::ICUConverterWrapper):
525         * platform/text/mac/TextCodecMac.cpp:
526         (WebCore::cachedConverterTEC):
527         * platform/text/mac/TextCodecMac.h:
528         (WebCore::TECConverterWrapper::TECConverterWrapper):
529         (WebCore::TECConverterWrapper::~TECConverterWrapper):
530
531 2008-12-23  Mark Rowe  <mrowe@apple.com>
532
533         Build fix.
534
535         * WebCore.xcodeproj/project.pbxproj: CSSPropertyNames.h is a generated file so it needs to be explicitly copied
536         into the PrivateHeaders directory, rather than relying on the automatic copying of headers which runs before the
537         derived sources are generated.
538
539 2008-12-23  Simon Fraser  <simon.fraser@apple.com>
540
541         Reviewed by Dan Bernstein
542
543         https://bugs.webkit.org/show_bug.cgi?id=22941
544         
545         If the document element has opacity, we need to erase the view background to
546         white before painting.
547         
548         Test: fast/backgrounds/opacity-on-document-element.html
549
550         * rendering/RenderView.cpp:
551         (WebCore::rendererObscuresBackground):
552
553 2008-12-23  Simon Fraser  <simon.fraser@apple.com>
554
555         Reviewed by Dan Bernstein
556
557         https://bugs.webkit.org/show_bug.cgi?id=21910
558         
559         Fix SVGImage painting by ensuring that the SVGImage resizes its FrameView correctly.
560         Otherwise the FrameView is left at 0x0, and nothing paints.
561         
562         * svg/graphics/SVGImage.cpp:
563         (WebCore::SVGImage::draw):
564
565 2008-12-23  Darin Adler  <darin@apple.com>
566
567         Reviewed by John Sullivan.
568
569         - improve robustness of undo/redo in HTML editing to fix the following bugs
570           <https://bugs.webkit.org/show_bug.cgi?id=19703> Crash in WebCore::InsertNodeBeforeCommand::doUnapply()
571           <rdar://problem/4059423> DOM operations performed on editable HTML can cause a crash later during Undo
572
573         Major categories of improvements:
574
575             1) Added null checks.
576             2) Eliminated type casts without corresponding type checks.
577             3) Avoided possible infinite loops by building up lists of nodes to operate on
578                before starting to make DOM changes.
579             4) Use more RefPtr.
580
581         No test at this time, but test cases should follow in separate patches.
582
583         * WebCore.xcodeproj/project.pbxproj: Set the role of CSSPropertyNames.h to Private so it
584         can be used in other Private headers, specifically editing ones.
585
586         * css/CSSStyleSelector.cpp:
587         (WebCore::CSSStyleSelector::locateCousinList): Adopt parentElement.
588         (WebCore::CSSStyleSelector::locateSharedStyle): Ditto.
589         (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Ditto.
590
591         * dom/Element.cpp: (WebCore::Element::cloneElement): Added.
592         * dom/Element.h: Added cloneElement and an implementation of parentElement.
593         * dom/Node.h: Moved parentElement from here to Element.h and changed its
594         implementation so it will return 0 when the parent is not an element
595         (document, document fragment, etc.).
596
597         * editing/AppendNodeCommand.cpp:
598         (WebCore::AppendNodeCommand::AppendNodeCommand): Made parent be an Element.
599         Moved assertions from doApply in here.
600         (WebCore::AppendNodeCommand::doApply): Simplified to just a single unchecked
601         appendChild call.
602         (WebCore::AppendNodeCommand::doUnapply): Simplified to just a single remove call.
603         * editing/AppendNodeCommand.h: Updated.
604
605         * editing/ApplyStyleCommand.cpp:
606         (WebCore::createStyleSpanElement): Eliminate casting by creating an element in a more
607         direct way with new instead of createElementNS.
608         (WebCore::ApplyStyleCommand::ApplyStyleCommand): Use PassRefPtr.
609         (WebCore::ApplyStyleCommand::removeCSSStyle): Use CSSPropertyID.
610         (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Use cloneElement.
611         * editing/ApplyStyleCommand.h:
612
613         * editing/BreakBlockquoteCommand.cpp:
614         (WebCore::BreakBlockquoteCommand::doApply): Use Element* and cloneElement.
615
616         * editing/CompositeEditCommand.cpp:
617         (WebCore::CompositeEditCommand::applyStyledElement): Use PassRefPtr and unsigned.
618         (WebCore::CompositeEditCommand::removeStyledElement): Ditto.
619         (WebCore::CompositeEditCommand::insertNodeBefore): Ditto.
620         (WebCore::CompositeEditCommand::insertNodeAfter): Ditto.
621         (WebCore::CompositeEditCommand::insertNodeAt): Ditto.
622         (WebCore::CompositeEditCommand::appendNode): Ditto.
623         (WebCore::CompositeEditCommand::removeChildrenInRange): Ditto. Also use a vector to
624         make the list of children in case removing them has side effects.
625         (WebCore::CompositeEditCommand::removeNode): Ditto.
626         (WebCore::CompositeEditCommand::removeNodePreservingChildren): Ditto.
627         (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Ditto.
628         (WebCore::CompositeEditCommand::splitTextNode): Ditto.
629         (WebCore::CompositeEditCommand::splitElement): Ditto.
630         (WebCore::CompositeEditCommand::mergeIdenticalElements): Ditto.
631         (WebCore::CompositeEditCommand::wrapContentsInDummySpan): Ditto.
632         (WebCore::CompositeEditCommand::splitTextNodeContainingElement): Ditto.
633         (WebCore::CompositeEditCommand::joinTextNodes): Ditto.
634         (WebCore::CompositeEditCommand::inputText): Ditto.
635         (WebCore::CompositeEditCommand::insertTextIntoNode): Ditto.
636         (WebCore::CompositeEditCommand::deleteTextFromNode): Ditto.
637         (WebCore::CompositeEditCommand::replaceTextInNode): Ditto.
638         (WebCore::CompositeEditCommand::insertNodeAtTabSpanPosition): Ditto.
639         (WebCore::CompositeEditCommand::removeCSSProperty): Ditto.
640         (WebCore::CompositeEditCommand::removeNodeAttribute): Ditto. Implement by calling
641         setNodeAttribute instead of with its own SimpleEditCommand.
642         (WebCore::CompositeEditCommand::setNodeAttribute): Ditto.
643         (WebCore::CompositeEditCommand::deleteInsignificantText): Ditto.
644         (WebCore::CompositeEditCommand::appendBlockPlaceholder): Ditto.
645         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded): Ditto.
646         (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt): Ditto. Don't
647         bother using an undoable operation to put the break element into the paragraph
648         element because there's no need to split them and redo this when doing undo/redo.
649         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
650         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
651         * editing/CompositeEditCommand.h: Ditto.
652
653         * editing/DeleteFromTextNodeCommand.cpp:
654         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand): Use unsigned.
655         (WebCore::DeleteFromTextNodeCommand::doApply): Eliminated inappropriate assertions.
656         (WebCore::DeleteFromTextNodeCommand::doUnapply): Ditto.
657         * editing/DeleteFromTextNodeCommand.h:
658
659         * editing/DeleteSelectionCommand.cpp:
660         (WebCore::DeleteSelectionCommand::removeNode): Use PassRefPtr.
661         (WebCore::DeleteSelectionCommand::deleteTextFromNode): Ditto.
662         * editing/DeleteSelectionCommand.h:
663
664         * editing/FormatBlockCommand.cpp:
665         (WebCore::FormatBlockCommand::FormatBlockCommand): Use AtomicString.
666         (WebCore::FormatBlockCommand::doApply): Use Element.
667         * editing/FormatBlockCommand.h:
668
669         * editing/IndentOutdentCommand.cpp:
670         (WebCore::createIndentBlockquoteElement): Use new to create the element
671         instead of calling a function so we have a more specific type.
672         (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
673         Use RefPtr and Element.
674         (WebCore::IndentOutdentCommand::indentRegion): Ditto.
675         (WebCore::IndentOutdentCommand::outdentParagraph): Ditto.
676         * editing/IndentOutdentCommand.h:
677
678         * editing/InsertIntoTextNodeCommand.cpp:
679         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
680         Use unsigned. Added an assertion.
681         (WebCore::InsertIntoTextNodeCommand::doApply): Eliminated inappropriate assertions.
682         (WebCore::InsertIntoTextNodeCommand::doUnapply): Ditto.
683         * editing/InsertIntoTextNodeCommand.h:
684
685         * editing/InsertLineBreakCommand.cpp:
686         (WebCore::InsertLineBreakCommand::insertNodeAfterPosition): Use Element.
687         (WebCore::InsertLineBreakCommand::insertNodeBeforePosition): Ditto.
688
689         * editing/InsertListCommand.cpp:
690         (WebCore::InsertListCommand::doApply): Use Element.
691
692         * editing/InsertNodeBeforeCommand.cpp:
693         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand): Moved assertions
694         here from doApply.
695         (WebCore::InsertNodeBeforeCommand::doApply): Eliminated inappropriate assertions.
696         Added a null check.
697         (WebCore::InsertNodeBeforeCommand::doUnapply): Simplified to just a single remove call.
698
699         * editing/InsertParagraphSeparatorCommand.cpp:
700         (WebCore::InsertParagraphSeparatorCommand::doApply): Use Element and cloneElement.
701
702         * editing/JoinTextNodesCommand.cpp:
703         (WebCore::JoinTextNodesCommand::doApply): Eliminated inappropriate assertions.
704         Added some runtime checks. Don't store anything in m_offset.
705         (WebCore::JoinTextNodesCommand::doUnapply): Ditto.
706         * editing/JoinTextNodesCommand.h:
707
708         * editing/MergeIdenticalElementsCommand.cpp:
709         (WebCore::MergeIdenticalElementsCommand::MergeIdenticalElementsCommand): Moved
710         an assertion here from doApply.
711         (WebCore::MergeIdenticalElementsCommand::doApply): Eliminated inappropriate assertions.
712         Added a null check. Changed implementation to use remove to avoid null parent issue.
713         Use a vector of nodes to avoid possible infinite loop if mutation happens while iterating.
714         (WebCore::MergeIdenticalElementsCommand::doUnapply): Ditto.
715
716         * editing/ModifySelectionListLevel.cpp:
717         (WebCore::ModifySelectionListLevelCommand::appendSiblingNodeRange): Use Element*.
718         (WebCore::IncreaseSelectionListLevelCommand::doApply): Ditto.
719         * editing/ModifySelectionListLevel.h:
720
721         * editing/RemoveCSSPropertyCommand.cpp:
722         (WebCore::RemoveCSSPropertyCommand::RemoveCSSPropertyCommand): Use PassRefPtr and
723         CSSPropertyID. Also renamed m_decl to m_style.
724         (WebCore::RemoveCSSPropertyCommand::doApply): Eliminated inappropriate assertions.
725         (WebCore::RemoveCSSPropertyCommand::doUnapply): Ditto.
726
727         * editing/RemoveNodeAttributeCommand.cpp: Removed contents of this file. To be deleted.
728         Use SetNodeAttributeCommand instead.
729         * editing/RemoveNodeAttributeCommand.h: Ditto.
730
731         * editing/RemoveNodeCommand.cpp:
732         (WebCore::RemoveNodeCommand::RemoveNodeCommand): Moved assertions here from doApply.
733         Don't initialize m_refChild here; rather do it in doApply.
734         (WebCore::RemoveNodeCommand::doApply): Eliminated inappropriate assertions. Added
735         checks and streamlined implementation.
736         (WebCore::RemoveNodeCommand::doUnapply): Ditto.
737         * editing/RemoveNodeCommand.h:
738
739         * editing/RemoveNodePreservingChildrenCommand.cpp:
740         (WebCore::RemoveNodePreservingChildrenCommand::doApply): Use a vector.
741
742         * editing/ReplaceSelectionCommand.cpp:
743         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Removed now-unneeded cast.
744
745         * editing/SetNodeAttributeCommand.cpp:
746         (WebCore::SetNodeAttributeCommand::SetNodeAttributeCommand): Use AtomicString.
747         Removed assertion that prevents us from using this to remove an attribute.
748         (WebCore::SetNodeAttributeCommand::doApply): Eliminated inappropriate assertions.
749         (WebCore::SetNodeAttributeCommand::doUnapply): Ditto.
750         * editing/SetNodeAttributeCommand.h:
751
752         * editing/SplitElementCommand.cpp:
753         (WebCore::SplitElementCommand::SplitElementCommand): Moved assertion here from doApply.
754         (WebCore::SplitElementCommand::doApply): Check some more invariants and use a vector
755         to avoid possible infinite loops.
756         (WebCore::SplitElementCommand::doUnapply): Ditto.
757
758         * editing/SplitTextNodeCommand.cpp:
759         (WebCore::SplitTextNodeCommand::SplitTextNodeCommand): Moved assertions and comment
760         here from doApply.
761         (WebCore::SplitTextNodeCommand::doApply): Check for null and failures when applying.
762         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
763
764         * editing/SplitTextNodeContainingElementCommand.cpp:
765         (WebCore::SplitTextNodeContainingElementCommand::doApply): Use Element.
766
767         * editing/WrapContentsInDummySpanCommand.cpp:
768         (WebCore::WrapContentsInDummySpanCommand::doApply): Check for null and ignore failures.
769         Don't reuse the dummy span. Simplified logic.
770         (WebCore::WrapContentsInDummySpanCommand::doUnapply): Ditto.
771
772         * editing/htmlediting.cpp:
773         (WebCore::isBlock): Make sure this returns true only for elements.
774         (WebCore::enclosingBlock): Return an Element*.
775         (WebCore::enclosingTableCell): Ditto.
776         (WebCore::enclosingList): Return an HTMLElement*.
777         (WebCore::outermostEnclosingList): Return an HTMLElement*.
778         (WebCore::createDefaultParagraphElement): Return an HTMLElement*.
779         (WebCore::createBreakElement): Return an HTMLElement*.
780         (WebCore::createOrderedListElement): Return an HTMLElement*.
781         (WebCore::createUnorderedListElement): Return an HTMLElement*.
782         (WebCore::createListItemElement): Return an HTMLElement*.
783         (WebCore::createHTMLElement): Return an HTMLElement*.
784         * editing/htmlediting.h:
785
786         * editing/markup.cpp:
787         (WebCore::createFragmentFromText): Use createBreakElement and use Element*.
788
789         * page/MouseEventWithHitTestResults.cpp:
790         (WebCore::MouseEventWithHitTestResults::targetNode): Use parentElement.
791
792 2008-12-23  Darin Adler  <darin@apple.com>
793
794         Reviewed by Dan Bernstein.
795
796         * dom/Node.h: Tweak comments and order of bits that Sam moved
797         here last night.
798         * dom/Node.cpp: Ditto.
799
800 2008-12-22  Julien Chaffraix  <jchaffraix@webkit.org>
801
802         Reviewed by Darin Adler.
803
804         Bug 11106: Some XMLHttpRequest URI resolving tests fail
805         https://bugs.webkit.org/show_bug.cgi?id=11106
806
807         Use the ScriptExecutionContext to resolve the URI when calling open in JavaScript.
808         The previous code was using the containing DOMWindow to do so which would fail for
809         XMLHttpRequest object being passed between iframe.
810
811         Tests: http/tests/xmlhttprequest/uri-resolution-opera-open-004.html
812                http/tests/xmlhttprequest/uri-resolution-opera-open-005.html
813                http/tests/xmlhttprequest/uri-resolution-opera-open-006.html
814                http/tests/xmlhttprequest/uri-resolution-opera-open-007.html
815                http/tests/xmlhttprequest/uri-resolution-opera-open-008.html
816                http/tests/xmlhttprequest/uri-resolution-opera-open-009.html
817                http/tests/xmlhttprequest/uri-resolution-opera-open-010.html
818
819         * bindings/js/JSXMLHttpRequestCustom.cpp:
820         (WebCore::JSXMLHttpRequest::open): Use the ScriptExecutionContext
821         to resolve the URL.
822
823         * dom/Document.cpp:
824         (WebCore::Document::virtualCompleteURL): Virtual method added to
825         avoid performance hit on completeURL call.
826
827         * dom/Document.h:
828         * dom/ScriptExecutionContext.h:
829         (WebCore::ScriptExecutionContext::completeURL): Non-virtual method
830         that wrap the call to the virtual call.
831         * dom/WorkerContext.cpp:
832         (WebCore::WorkerContext::virtualCompleteURL): Pure virtual method.
833         * dom/WorkerContext.h:
834
835 2008-12-23  Darin Adler  <darin@apple.com>
836
837         Reviewed by Dan Bernstein.
838
839         - https://bugs.webkit.org/show_bug.cgi?id=22978
840           a couple tweaks to the new strokeBoundingRect functions
841
842         * platform/graphics/cairo/PathCairo.cpp:
843         (WebCore::Path::strokeBoundingRect): Only create a GraphicsContext
844         if the applier is non-null.
845
846         * platform/graphics/cg/PathCG.cpp:
847         (WebCore::putBytesNowhere): Added.
848         (WebCore::createScratchContext): Changed to use a "/dev/null" type
849         function to discard bytes rather than using a data object. This
850         eliminates the possibility that memory will be used if someone draws
851         into the scratch context by accident. Also moved to the top of the
852         file; it was in a slightly strange place before.
853         (WebCore::Path::strokeBoundingRect): Only create a GraphicsContext
854         if the applier is non-null. Simplify the empty path special case.
855
856 2008-12-22  Sam Weinig  <sam@webkit.org>
857
858         Reviewed by Mark Rowe.
859
860         Save a word in all Elements by moving the 5 loose bits to Node,
861         where we had 16 spare.
862
863         * dom/Element.cpp:
864         (WebCore::Element::Element):
865         * dom/Element.h:
866         * dom/Node.cpp:
867         (WebCore::Node::Node):
868         * dom/Node.h:
869
870 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
871
872         Reviewed by George Staikos.
873
874         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22972
875
876         Add WML <meta> element support. All needed functionality is present
877         in Document::processHttpEquiv, already covered by tests.
878
879         * GNUmakefile.am:
880         * WebCore.pro:
881         * WebCore.vcproj/WebCore.vcproj:
882         * WebCore.xcodeproj/project.pbxproj:
883         * wml/WMLMetaElement.cpp: Added.
884         (WebCore::WMLMetaElement::WMLMetaElement):
885         (WebCore::WMLMetaElement::parseMappedAttribute):
886         (WebCore::WMLMetaElement::insertedIntoDocument):
887         * wml/WMLMetaElement.h: Added.
888         * wml/WMLTagNames.in:
889
890 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
891
892         Rubber-stamped by Darin Adler.
893
894         Don't reference specific layout tests in comments.
895
896         * html/HTMLFormElement.cpp:
897         (WebCore::HTMLFormElement::createFormData):
898
899 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
900
901         Reviewed by George Staikos.
902
903         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22965
904
905         Add WML <head> element support. Doesn't require a WMLHeadElement.
906         No functional behaviour, as we already created a WMLElement for headTag, by default.
907         It's just cleaner to list <head> in WMLTagNames, forwarding to a WMLElement constructor.
908
909         * wml/WMLTagNames.in:
910
911 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
912
913         Reviewed by George Staikos.
914
915         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22971
916
917         Fix regression caused by the HTMLFormElement refactorization.
918         File form elements without a name have to be included in multipart/form-data
919         submission. Cover this behaviour with a new test case.
920
921         Test: http/tests/misc/empty-file-formdata.html
922
923         * html/HTMLFormElement.cpp:
924         (WebCore::HTMLFormElement::createFormData):
925         * wml/WMLTagNames.in:
926
927 2008-12-22  David Kilzer  <ddkilzer@apple.com>
928
929         <rdar://problem/6438298> Bump schema version for app cache
930
931         Reviewed by Alexey Proskuryakov.
932
933         * loader/appcache/ApplicationCacheStorage.cpp: Increment
934         SchemaVersion from 2 to 3.
935
936 2008-12-22  David Kilzer  <ddkilzer@apple.com>
937
938         Use Deque in CSSStyleSheet::addSubresourceStyleURLs()
939
940         Reviewed by Darin Adler.
941
942         * css/CSSStyleSheet.cpp:
943         (WebCore::CSSStyleSheet::addSubresourceStyleURLs): Replaced
944         use of ListHashSet with more efficient Deque.
945
946 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
947
948         Reviewed by Sam Weinig.
949
950         Fix obvious crash fix for WML enabled builds.
951
952         * css/CSSStyleSelector.cpp:
953         (WebCore::CSSStyleSelector::adjustRenderStyle):
954
955 2008-12-22  David Kilzer  <ddkilzer@apple.com>
956
957         Bug 11850: Webarchive fails to save images referenced in CSS
958
959         <https://bugs.webkit.org/show_bug.cgi?id=11850>
960
961         Reviewed by Darin Adler.
962
963         This entry contains two parts since the tests for adding a
964         completeURL() method to StyleSheet and CSSStyleSheet (part 1) depend
965         on Bug 11850 being fixed (part 2).
966
967         --
968
969         Tests: http/tests/webarchive/test-css-url-encoding-shift-jis.html
970                http/tests/webarchive/test-css-url-encoding-utf-8.html
971                http/tests/webarchive/test-css-url-encoding.html
972
973         Added completeURL() methods to StyleSheet and CSSStyleSheet that
974         match the behavior of Document::completeURL().  Most notably,
975         CSSStyleSheet::completeURL() uses the charset of the stylesheet
976         (if it exists) to construct URLs, just like Document::completeURL().
977
978         * css/CSSParser.cpp:
979         (WebCore::CSSParser::parseValue): Use CSSStyleSheet::completeURL().
980         (WebCore::CSSParser::parseContent): Ditto.
981         (WebCore::CSSParser::parseFillImage): Ditto.
982         (WebCore::CSSParser::parseFontFaceSrc): Ditto.
983         (WebCore::CSSParser::parseBorderImage): Ditto.
984
985         * css/CSSStyleSheet.cpp:
986         (WebCore::CSSStyleSheet::completeURL): Added.
987         * css/CSSStyleSheet.h:
988         (WebCore::CSSStyleSheet::completeURL): Added declaration.
989
990         * css/StyleSheet.cpp:
991         (WebCore::StyleSheet::completeURL): Added.
992         * css/StyleSheet.h:
993         (WebCore::StyleSheet::completeURL): Added declaration.
994
995         * dom/Document.cpp:
996         (WebCore::Document::completeURL): Added comment referring to the new
997         completeURL() methods in StyleSheet and CSSStyleSheet.
998
999         --
1000
1001         Tests: webarchive/test-css-url-resources-in-stylesheets.html
1002                webarchive/test-css-url-resources-inline-styles.html
1003
1004         Walk stylesheets and inline style attributes for url() references
1005         when building a list of URLs to include in a webarchive.  Note that
1006         not all URLs found this way will be included in the webarchive if
1007         they were not used (and thus not downloaded) when laying out the
1008         page.
1009
1010         The key method for CSS stylesheets is
1011         CSSStyleSheet::addSubresourceStyleURLs() which iterates over all
1012         CSSStyleSheet objects recursively referenced from its own stylesheet
1013         through @import rules.  Starting with the CSSRule objects in each
1014         sheet and continuing down through the CSSMutableStyleDeclaration and
1015         CSSValue objects, addSubresourceStyleURLs() methods are called to
1016         gather URLs.
1017
1018         For inline style attributes in HTML DOM elements,
1019         StyledElement::addSubresourceAttributeURLs() calls
1020         CSSMutableStyleDeclaration::addSubresourceStyleURLs() to gather URLs
1021         from each element, hence the need to call
1022         addSubresourceAttributeURLs() on superclasses when the method is
1023         implemented on the element class itself.
1024
1025         * css/CSSBorderImageValue.cpp:
1026         (WebCore::CSSBorderImageValue::addSubresourceStyleURLs): Added.
1027         * css/CSSBorderImageValue.h:
1028         (WebCore::CSSBorderImageValue::addSubresourceStyleURLs): Added
1029         declaration.
1030
1031         * css/CSSFontFaceRule.cpp:
1032         (WebCore::CSSFontFaceRule::addSubresourceStyleURLs): Added.
1033         * css/CSSFontFaceRule.h:
1034         (WebCore::CSSFontFaceRule::addSubresourceStyleURLs): Added
1035         declaration.
1036
1037         * css/CSSFontFaceSrcValue.cpp:
1038         (WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Added.
1039         * css/CSSFontFaceSrcValue.h:
1040         (WebCore::CSSFontFaceSrcValue::addSubresourceStyleURLs): Added
1041         declaration.
1042
1043         * css/CSSImportRule.cpp:
1044         (WebCore::CSSImportRule::addSubresourceStyleURLs): Added.
1045         * css/CSSImportRule.h:
1046         (WebCore::CSSImportRule::addSubresourceStyleURLs): Added
1047         declaration.
1048
1049         * css/CSSMutableStyleDeclaration.cpp:
1050         (WebCore::CSSMutableStyleDeclaration::addSubresourceStyleURLs): Added.
1051         Iterates over m_properties vector of CSSProperty objects calling
1052         addSubresourceStyleURLs() on each property's CSSValue object.
1053         * css/CSSMutableStyleDeclaration.h:
1054         (WebCore::CSSMutableStyleDeclaration::addSubresourceStyleURLs): Added
1055         declaration.
1056
1057         * css/CSSPrimitiveValue.cpp:
1058         (WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Added.
1059         * css/CSSPrimitiveValue.h:
1060         (WebCore::CSSPrimitiveValue::addSubresourceStyleURLs): Added
1061         declaration.
1062
1063         * css/CSSReflectValue.cpp:
1064         (WebCore::CSSReflectValue::addSubresourceStyleURLs): Added.
1065         * css/CSSReflectValue.h:
1066         (WebCore::CSSReflectValue::addSubresourceStyleURLs): Added
1067         declaration.
1068
1069         * css/CSSRule.h:
1070         (WebCore::CSSRule::addSubresourceStyleURLs): Added.  Virtual
1071         method with empty implementation that's overridden by subclasses
1072         as needed.
1073
1074         * css/CSSStyleRule.cpp:
1075         (WebCore::CSSStyleRule::addSubresourceStyleURLs): Added.
1076         * css/CSSStyleRule.h:
1077         (WebCore::CSSStyleRule::addSubresourceStyleURLs): Added
1078         declaration.
1079
1080         * css/CSSStyleSheet.cpp:
1081         (WebCore::CSSStyleSheet::addSubresourceStyleURLs): Updated to
1082         call CSSRule::addSubresourceStyleURLs on each rule to extract
1083         URLs.  Removed unneeded baseURL parameter now that the
1084         completeURL() method exists.
1085         * css/CSSStyleSheet.h:
1086         (WebCore::CSSStyleSheet::addSubresourceStyleURLs): Updated
1087         declaration.
1088
1089         * css/CSSValue.h:
1090         (WebCore::CSSValue::addSubresourceStyleURLs): Added.  Virtual
1091         method with empty implementation that's overridden by subclasses
1092         as needed.
1093
1094         * css/CSSValueList.cpp:
1095         (WebCore::CSSValueList::addSubresourceStyleURLs): Added.
1096         Iterates over m_values vector of CSSValue objects calling
1097         addSubresourceStyleURLs() on each.
1098         * css/CSSValueList.h:
1099         (WebCore::CSSValueList::addSubresourceStyleURLs): Added
1100         declaration.
1101
1102         * css/StyleSheet.h:
1103         (WebCore::StyleSheet::addSubresourceStyleURLs): Updated
1104         declaration to remove unneeded baseURL parameter.
1105
1106         * dom/ProcessingInstruction.cpp:
1107         (WebCore::ProcessingInstruction::addSubresourceAttributeURLs):
1108         Fixed to use the StyleBase::baseURL() method to get the
1109         stylesheet's URL instead of calling Document::completeURL().
1110
1111         * dom/StyledElement.cpp:
1112         (WebCore::StyledElement::addSubresourceAttributeURLs): Added method
1113         to extract URLs from inline style declarations.
1114         * dom/StyledElement.h:
1115         (WebCore::StyledElement::addSubresourceAttributeURLs): Added
1116         declaration.
1117
1118         * html/HTMLBodyElement.cpp:
1119         (WebCore::HTMLBodyElement::addSubresourceAttributeURLs): Call
1120         addSubresourceAttributeURLs() in superclass to extract URLs
1121         from inline style declarations.
1122         * html/HTMLEmbedElement.cpp:
1123         (WebCore::HTMLEmbedElement::addSubresourceAttributeURLs): Ditto.
1124         * html/HTMLImageElement.cpp:
1125         (WebCore::HTMLImageElement::addSubresourceAttributeURLs): Ditto.
1126         * html/HTMLInputElement.cpp:
1127         (WebCore::HTMLInputElement::addSubresourceAttributeURLs): Ditto.
1128         * html/HTMLLinkElement.cpp:
1129         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
1130         * html/HTMLObjectElement.cpp:
1131         (WebCore::HTMLObjectElement::addSubresourceAttributeURLs): Ditto.
1132         * html/HTMLParamElement.cpp:
1133         (WebCore::HTMLParamElement::addSubresourceAttributeURLs): Ditto.
1134         * html/HTMLScriptElement.cpp:
1135         (WebCore::HTMLScriptElement::addSubresourceAttributeURLs): Ditto.
1136         * html/HTMLStyleElement.cpp:
1137         (WebCore::HTMLStyleElement::addSubresourceAttributeURLs): Ditto.
1138         * html/HTMLTableCellElement.cpp:
1139         (WebCore::HTMLTableCellElement::addSubresourceAttributeURLs): Ditto.
1140         * html/HTMLTableElement.cpp:
1141         (WebCore::HTMLTableElement::addSubresourceAttributeURLs): Ditto.
1142         * svg/SVGCursorElement.cpp:
1143         (WebCore::SVGCursorElement::addSubresourceAttributeURLs): Ditto.
1144         * svg/SVGFEImageElement.cpp:
1145         (WebCore::SVGFEImageElement::addSubresourceAttributeURLs): Ditto.
1146         * svg/SVGImageElement.cpp:
1147         (WebCore::SVGImageElement::addSubresourceAttributeURLs): Ditto.
1148         * svg/SVGScriptElement.cpp:
1149         (WebCore::SVGScriptElement::addSubresourceAttributeURLs): Ditto.
1150
1151 2008-12-22  Dhananjoy Chutia  <dhanrd@gmail.com>
1152
1153         Reviewed by David Kilzer.
1154
1155         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22959
1156         Memory leak fixes for WebKit+soup
1157
1158         * platform/network/soup/ResourceHandleSoup.cpp:
1159         (WebCore::finishedCallback):
1160
1161 2008-12-22  Alexey Proskuryakov  <ap@webkit.org>
1162
1163         Reviewed by Darin Adler.
1164
1165         <rdar://problem/6277060> ASSERTION FAILED: !m_cacheBeingUpdated if the manifest is not available
1166
1167         Tests: http/tests/appcache/404-manifest.html
1168                http/tests/appcache/fail-on-update.html
1169
1170         * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::stopLoading):
1171         Removed the incorrect assertion.
1172
1173         * loader/appcache/ApplicationCacheGroup.h: Added an explanation of somewhat nonintuitive
1174         m_currentHandle handling.
1175
1176 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1177
1178         Reviewed by Alexey Proskuryakov & George Staikos.
1179
1180         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22961
1181
1182         Add WML <fieldset> element support.
1183         Unlike HTML's <fieldset> element, WML doesn't provide a <legend> child element
1184         to describe the <fieldset>. WML instead offers a 'title' attribute on the <fieldset>
1185         element. To integrate within the existing RenderFieldset code, we just create an
1186         internal <insertedLegend> element as first child for a WML <fieldset> element, containing
1187         the title attribute value.
1188
1189         * GNUmakefile.am:
1190         * WebCore.pro:
1191         * WebCore.vcproj/WebCore.vcproj:
1192         * WebCore.xcodeproj/project.pbxproj:
1193         * css/CSSStyleSelector.cpp:
1194         (WebCore::CSSStyleSelector::adjustRenderStyle):
1195         * css/wml.css:
1196         * rendering/RenderFieldset.cpp:
1197         (WebCore::RenderFieldset::RenderFieldset):
1198         (WebCore::RenderFieldset::findLegend):
1199         * rendering/RenderFieldset.h:
1200         * rendering/RenderLegend.cpp:
1201         (WebCore::RenderLegend::RenderLegend):
1202         * rendering/RenderLegend.h:
1203         * wml/WMLFieldSetElement.cpp: Added.
1204         (WebCore::WMLFieldSetElement::WMLFieldSetElement):
1205         (WebCore::WMLFieldSetElement::~WMLFieldSetElement):
1206         (WebCore::WMLFieldSetElement::parseMappedAttribute):
1207         (WebCore::WMLFieldSetElement::insertedIntoDocument):
1208         (WebCore::WMLFieldSetElement::removedFromDocument):
1209         (WebCore::WMLFieldSetElement::createRenderer):
1210         * wml/WMLFieldSetElement.h: Added.
1211         * wml/WMLInsertedLegendElement.cpp: Added.
1212         (WebCore::WMLInsertedLegendElement::WMLInsertedLegendElement):
1213         (WebCore::WMLInsertedLegendElement::~WMLInsertedLegendElement):
1214         (WebCore::WMLInsertedLegendElement::createRenderer):
1215         * wml/WMLInsertedLegendElement.h: Added.
1216         * wml/WMLTagNames.in:
1217
1218 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1219
1220         Not reviewed. Try to fix clean Mac builds, set role=private for FormDataBuilder.h
1221
1222         * WebCore.xcodeproj/project.pbxproj:
1223
1224 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1225
1226         Rubber-stamped by George Staikos.
1227
1228         Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
1229
1230         * css/CSSStyleSelector.cpp:
1231         * css/wml.css:
1232         * dom/DOMImplementation.cpp:
1233         * dom/Document.cpp:
1234         * dom/Document.h:
1235         * dom/XMLTokenizer.cpp:
1236         * dom/XMLTokenizerLibxml2.cpp:
1237         * dom/XMLTokenizerQt.cpp:
1238         * history/BackForwardList.cpp:
1239         * history/BackForwardList.h:
1240         * loader/FrameLoader.cpp:
1241         * loader/FrameLoader.h:
1242         * loader/MainResourceLoader.cpp:
1243         * page/Page.cpp:
1244         * page/Page.h:
1245         * platform/MIMETypeRegistry.cpp:
1246         * platform/network/FormDataBuilder.cpp:
1247         * platform/network/FormDataBuilder.h:
1248         * platform/qt/MIMETypeRegistryQt.cpp:
1249         * wml/WMLAElement.cpp:
1250         * wml/WMLAElement.h:
1251         * wml/WMLAccessElement.cpp:
1252         * wml/WMLAccessElement.h:
1253         * wml/WMLAnchorElement.cpp:
1254         * wml/WMLAnchorElement.h:
1255         * wml/WMLBRElement.cpp:
1256         * wml/WMLBRElement.h:
1257         * wml/WMLCardElement.cpp:
1258         * wml/WMLCardElement.h:
1259         * wml/WMLDoElement.cpp:
1260         * wml/WMLDoElement.h:
1261         * wml/WMLDocument.cpp:
1262         * wml/WMLDocument.h:
1263         * wml/WMLElement.cpp:
1264         * wml/WMLElement.h:
1265         * wml/WMLErrorHandling.cpp:
1266         * wml/WMLErrorHandling.h:
1267         * wml/WMLEventHandlingElement.cpp:
1268         * wml/WMLEventHandlingElement.h:
1269         * wml/WMLGoElement.cpp:
1270         * wml/WMLGoElement.h:
1271         * wml/WMLImageElement.cpp:
1272         * wml/WMLImageElement.h:
1273         * wml/WMLImageLoader.cpp:
1274         * wml/WMLImageLoader.h:
1275         * wml/WMLIntrinsicEvent.cpp:
1276         * wml/WMLIntrinsicEvent.h:
1277         * wml/WMLIntrinsicEventHandler.cpp:
1278         * wml/WMLIntrinsicEventHandler.h:
1279         * wml/WMLNoopElement.cpp:
1280         * wml/WMLNoopElement.h:
1281         * wml/WMLOnEventElement.cpp:
1282         * wml/WMLOnEventElement.h:
1283         * wml/WMLPElement.cpp:
1284         * wml/WMLPElement.h:
1285         * wml/WMLPageState.cpp:
1286         * wml/WMLPageState.h:
1287         * wml/WMLPostfieldElement.cpp:
1288         * wml/WMLPostfieldElement.h:
1289         * wml/WMLPrevElement.cpp:
1290         * wml/WMLPrevElement.h:
1291         * wml/WMLRefreshElement.cpp:
1292         * wml/WMLRefreshElement.h:
1293         * wml/WMLSetvarElement.cpp:
1294         * wml/WMLSetvarElement.h:
1295         * wml/WMLTableElement.cpp:
1296         * wml/WMLTableElement.h:
1297         * wml/WMLTaskElement.cpp:
1298         * wml/WMLTaskElement.h:
1299         * wml/WMLTemplateElement.cpp:
1300         * wml/WMLTemplateElement.h:
1301         * wml/WMLTimerElement.cpp:
1302         * wml/WMLTimerElement.h:
1303         * wml/WMLVariables.cpp:
1304         * wml/WMLVariables.h:
1305
1306 2008-12-22  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1307
1308         Reviewed by George Staikos.
1309
1310         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22638
1311
1312         Add POST method support to WMLGoElement. GET & POST over HTTP
1313         covered by a new set of WML HTTP layout tests.
1314
1315         Tests: http/tests/wml/go-task-get-method-accept-charset.html
1316                http/tests/wml/go-task-get-method.html
1317                http/tests/wml/go-task-post-method-accept-charset.html
1318                http/tests/wml/go-task-post-method.html
1319
1320         * wml/WMLGoElement.cpp:
1321         (WebCore::WMLGoElement::WMLGoElement):
1322         (WebCore::WMLGoElement::registerPostfieldElement):
1323         (WebCore::WMLGoElement::parseMappedAttribute):
1324         (WebCore::WMLGoElement::executeTask):
1325         (WebCore::WMLGoElement::preparePOSTRequest):
1326         (WebCore::WMLGoElement::prepareGETRequest):
1327         (WebCore::WMLGoElement::createFormData):
1328         * wml/WMLGoElement.h:
1329         * wml/WMLPostfieldElement.cpp:
1330         (WebCore::encodedString):
1331         (WebCore::WMLPostfieldElement::encodeData):
1332         * wml/WMLPostfieldElement.h:
1333
1334 2008-12-21  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1335
1336         Reviewed by Darin Adler and George Staikos.
1337
1338         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22949
1339
1340         Refactor HTMLFormElement to share a maximum level of code between HTMLFormElement & WMLGoElement.
1341         Create a new helper class 'FormDataBuilder', which is hold as member variable in those classes.
1342         It encapsulates all functionality needed to generate a FormData object, usable for HTML/WML form
1343         submission, including boundary string generation, multi-part form handling etc.
1344
1345         No functional changes, no test cases affected.
1346         WMLGoElement will be converted in a follow-up patch.
1347
1348         * GNUmakefile.am:
1349         * WebCore.pro:
1350         * WebCore.scons:
1351         * WebCore.vcproj/WebCore.vcproj:
1352         * WebCore.xcodeproj/project.pbxproj:
1353         * WebCoreSources.bkl:
1354         * html/HTMLFormElement.cpp:
1355         (WebCore::HTMLFormElement::HTMLFormElement):
1356         (WebCore::HTMLFormElement::dataEncoding):
1357         (WebCore::HTMLFormElement::createFormData):
1358         (WebCore::HTMLFormElement::submit):
1359         (WebCore::HTMLFormElement::parseMappedAttribute):
1360         * html/HTMLFormElement.h:
1361         (WebCore::HTMLFormElement::enctype):
1362         (WebCore::HTMLFormElement::encoding):
1363         (WebCore::HTMLFormElement::setEncoding):
1364         (WebCore::HTMLFormElement::acceptCharset):
1365         * platform/network/FormDataBuilder.cpp: Added.
1366         (WebCore::FormDataBuilder::FormDataBuilder):
1367         (WebCore::FormDataBuilder::~FormDataBuilder):
1368         (WebCore::FormDataBuilder::parseEncodingType):
1369         (WebCore::FormDataBuilder::parseMethodType):
1370         (WebCore::FormDataBuilder::dataEncoding):
1371         (WebCore::appendString):
1372         (WebCore::FormDataBuilder::beginMultiPartHeader):
1373         (WebCore::FormDataBuilder::addBoundaryToMultiPartHeader):
1374         (WebCore::FormDataBuilder::addFileNameToMultiPartHeader):
1375         (WebCore::FormDataBuilder::addContentTypeToMultiPartHeader):
1376         (WebCore::FormDataBuilder::finishMultiPartHeader):
1377         (WebCore::FormDataBuilder::clear):
1378         (WebCore::FormDataBuilder::addKeyValuePairAsFormData):
1379         (WebCore::FormDataBuilder::encodeStringAsFormData):
1380         (WebCore::FormDataBuilder::generateUniqueBoundaryString):
1381         * platform/network/FormDataBuilder.h: Added.
1382         (WebCore::FormDataBuilder::isPostMethod):
1383         (WebCore::FormDataBuilder::setIsPostMethod):
1384         (WebCore::FormDataBuilder::isMultiPartForm):
1385         (WebCore::FormDataBuilder::setIsMultiPartForm):
1386         (WebCore::FormDataBuilder::encodingType):
1387         (WebCore::FormDataBuilder::setEncodingType):
1388         (WebCore::FormDataBuilder::acceptCharset):
1389         (WebCore::FormDataBuilder::setAcceptCharset):
1390         (WebCore::FormDataBuilder::encodedData):
1391         (WebCore::FormDataBuilder::multiPartData):
1392
1393 2008-12-21  Dirk Schulze  <krit@webkit.org>
1394
1395         Reviewed by Darin Adler, Nikolas Zimmermann.
1396
1397         Move the the platform dependent strokeBBox functionality out of RenderPath
1398         into Path with strokeBoundingRect.
1399
1400         RenderPath clean-up for strokeBoundingBox
1401         [https://bugs.webkit.org/show_bug.cgi?id=22902]
1402
1403         * GNUmakefile.am:
1404         * WebCore.xcodeproj/project.pbxproj:
1405         * platform/graphics/GraphicsContext.h:
1406         * platform/graphics/Path.h:
1407         * platform/graphics/StrokeStyleApplier.h: Added.
1408         (WebCore::StrokeStyleApplier::~StrokeStyleApplier):
1409         * platform/graphics/cairo/PathCairo.cpp:
1410         (WebCore::Path::strokeBoundingRect):
1411         * platform/graphics/cg/PathCG.cpp:
1412         (WebCore::createScratchContext):
1413         (WebCore::scratchContext):
1414         (WebCore::Path::strokeBoundingRect):
1415         * platform/graphics/qt/GraphicsContextQt.cpp:
1416         (WebCore::GraphicsContext::pen):
1417         * platform/graphics/qt/PathQt.cpp:
1418         (WebCore::Path::strokeBoundingRect):
1419         * rendering/RenderPath.cpp:
1420         (WebCore::StrokeBoundingRectStyleApplier::StrokeBoundingRectStyleApplier):
1421         (WebCore::StrokeBoundingRectStyleApplier::strokeStyle):
1422         (WebCore::RenderPath::relativeBBox):
1423         * rendering/RenderPath.h:
1424         * svg/graphics/cairo/RenderPathCairo.cpp:
1425         * svg/graphics/cg/RenderPathCg.cpp:
1426         * svg/graphics/qt/RenderPathQt.cpp:
1427
1428 2008-12-20  David Kilzer  <ddkilzer@apple.com>
1429
1430         Fix typo "CSSAferRuleValue" to "CSSAfterRuleValue"
1431
1432         * html/PreloadScanner.cpp:
1433         (WebCore::PreloadScanner::tokenizeCSS):
1434         * html/PreloadScanner.h:
1435         (WebCore::PreloadScanner::CSSState):
1436
1437 2008-12-19  Alexey Proskuryakov  <ap@webkit.org>
1438
1439         Reviewed by Geoff Garen.
1440
1441         <rdar://problem/6454076> Random crashes on JS raytracer
1442
1443         No test, because the crash is not readily reproducible.
1444
1445         * platform/text/StringImpl.cpp:
1446         (WebCore::StringImpl::empty):
1447         * platform/text/StringImpl.h:
1448         Made empty string per-thread.
1449
1450 2008-12-19  Anders Carlsson  <andersca@apple.com>
1451
1452         Reviewed by Sam Weinig.
1453
1454         Replace some uses of HardRetain etc with RetainPtr.
1455
1456         * platform/mac/DragImageMac.mm:
1457         * platform/mac/SharedBufferMac.mm:
1458         (WebCore::SharedBuffer::createCFData):
1459         * rendering/RenderThemeMac.mm:
1460         * svg/graphics/cg/SVGResourceFilterCg.mm:
1461         (WebCore::SVGResourceFilter::prepareFilter):
1462         (WebCore::SVGResourceFilter::applyFilter):
1463         * svg/graphics/mac/SVGResourceFilterPlatformDataMac.h:
1464         * svg/graphics/mac/SVGResourceFilterPlatformDataMac.mm:
1465         (WebCore::SVGResourceFilterPlatformDataMac::SVGResourceFilterPlatformDataMac):
1466
1467 2008-12-19  miggilin  <mr.diggilin@gmail.com>
1468
1469         Reviewed by Kevin Ollivier.
1470
1471         Add Context Menu support to wx bindings.
1472         
1473         https://bugs.webkit.org/show_bug.cgi?id=22675
1474
1475         * platform/ContextMenu.h:
1476         * platform/ContextMenuItem.h:
1477         (WebCore::PlatformMenuItemDescription::PlatformMenuItemDescription):
1478         * platform/wx/ContextMenuItemWx.cpp: Added.
1479         * platform/wx/ContextMenuWx.cpp: Added.
1480         * platform/wx/LocalizedStringsWx.cpp:
1481         * platform/wx/TemporaryLinkStubs.cpp:
1482         * webcore-wx.bkl:
1483
1484
1485 2008-12-19  Beth Dakin  <bdakin@apple.com>
1486
1487         Reviewed by Darin Adler.
1488
1489         Temporary band-aide fix for <rdar://problem/6372481> In Gmail, a 
1490         crash occurs at 
1491         AccessibilityTable::isTableExposableThroughAccessibility() when 
1492         attempting to create a link in a rich text message
1493
1494         We need to disable Accessibility Tables until we get this fixed for 
1495         real to prevent rampant crashing.
1496
1497         * page/AccessibilityTable.cpp:
1498         (WebCore::AccessibilityTable::AccessibilityTable):
1499
1500 2008-12-19  Simon Fraser  <simon.fraser@apple.com>
1501
1502         Reviewed by Darin Adler
1503
1504         https://bugs.webkit.org/show_bug.cgi?id=22938
1505         
1506         When the document element is transformed, we need to paint
1507         the view background to avoid unpainted areas.
1508         
1509         Test: fast/transforms/transformed-document-element.html
1510
1511         * rendering/RenderView.cpp:
1512         (WebCore::RenderView::paintBoxDecorations):
1513
1514 2008-12-19  Steve Falkenburg  <sfalken@apple.com>
1515
1516         Fix build.
1517
1518         * WebCore.vcproj/WebCore.vcproj:
1519
1520 2008-12-19  Kevin Ollivier  <kevino@theolliviers.com>
1521
1522         wx build fixes after recent changes.
1523
1524         * WebCoreSources.bkl:
1525         * platform/graphics/wx/ImageSourceWx.cpp:
1526         (WebCore::ImageSource::clear):
1527         * webcore-base.bkl:
1528
1529 2008-12-19  Holger Hans Peter Freyther  <zecke@selfish.org>
1530
1531         Reviewed by Sam Weinig.
1532
1533         [GTK] Fix make distcheck again
1534
1535         These files were moved to WebCore/platform/animation
1536         and WebCore/platform/graphics/transforms.
1537
1538         * GNUmakefile.am:
1539
1540 2008-12-19  Gustavo Noronha Silva  <gns@gnome.org>
1541
1542         Reviewed by Holger Freyther.
1543
1544         https://bugs.webkit.org/show_bug.cgi?id=22900
1545
1546         Fix AtomicString usage, so that building works.
1547
1548         * platform/network/soup/ResourceHandleSoup.cpp:
1549
1550 2008-12-19  Adam Roben  <aroben@apple.com>
1551
1552         Windows build fix on older versions of CFNetwork after r39393
1553
1554         * platform/network/cf/ResourceHandleCFNet.cpp:
1555         (WebCore::highestSupportedCFURLConnectionClientVersion): Changed
1556         preprocessor directives not to leave in unreachable code on old
1557         versions of CFNetwork.
1558
1559 2008-12-19  Antti Koivisto  <antti@apple.com>
1560
1561         Comment fix.
1562
1563         * platform/PurgeableBuffer.h:
1564
1565 2008-12-19  Holger Hans Peter Freyther  <zecke@selfish.org>
1566
1567         [GTK] Build fix by adding the new files.
1568
1569         * GNUmakefile.am:
1570
1571 2008-12-19  Jade Han <jade.han@nokia.com>
1572
1573         Reviewed by Tor Arne Vestbø.
1574
1575         [Qt] Allow conversion of JavaScript Number and Boolean types to Qt types
1576
1577         https://bugs.webkit.org/show_bug.cgi?id=22880
1578
1579         * bridge/qt/qt_runtime.cpp:
1580         (JSC::Bindings::convertValueToQVariant):
1581
1582 2008-12-19  Tor Arne Vestbø  <tavestbo@trolltech.com>
1583
1584         Reviewed by Holger Freyther.
1585
1586         Implement ImageDecoder::filenameExtension() for Qt
1587
1588         * platform/graphics/qt/ImageDecoderQt.cpp:
1589         (WebCore::ImageDecoderQt::filenameExtension):
1590         * platform/graphics/qt/ImageDecoderQt.h:
1591         * platform/graphics/qt/ImageSourceQt.cpp:
1592         (WebCore::ImageSource::filenameExtension):
1593
1594 2008-12-19  Adam Barth  <abarth@webkit.org>
1595
1596         Reviewed by Darin Alder.
1597
1598         Implement ImageSource::filenameExtension for Cario
1599           https://bugs.webkit.org/show_bug.cgi?id=22905
1600
1601         * platform/graphics/cairo/ImageSourceCairo.cpp:
1602         (WebCore::ImageSource::filenameExtension):
1603         * platform/image-decoders/ImageDecoder.h:
1604         * platform/image-decoders/bmp/BMPImageDecoder.h:
1605         (WebCore::BMPImageDecoder::filenameExtension):
1606         * platform/image-decoders/gif/GIFImageDecoder.h:
1607         (WebCore::GIFImageDecoder::filenameExtension):
1608         * platform/image-decoders/ico/ICOImageDecoder.h:
1609         (WebCore::ICOImageDecoder::filenameExtension):
1610         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1611         (WebCore::JPEGImageDecoder::filenameExtension):
1612         * platform/image-decoders/png/PNGImageDecoder.h:
1613         (WebCore::PNGImageDecoder::filenameExtension):
1614         * platform/image-decoders/xbm/XBMImageDecoder.h:
1615         (WebCore::XBMImageDecoder::filenameExtension):
1616
1617 2008-12-18  Dan Bernstein  <mitz@apple.com>
1618
1619         Reviewed by Sam Weinig.
1620
1621         - avoid using the ResourceHandle-level credential storage, if any,
1622           unless the client opts to use it; when use of the credential
1623           storage is disallowed, all authentication challenges are sent to
1624           the client.
1625         - let the FrameLoaderClient decide whether to use the credential
1626           storage. 
1627
1628         * loader/EmptyClients.h:
1629         (WebCore::EmptyFrameLoaderClient::shouldUseCredentialStorage): Added.
1630         Returns false.
1631         * loader/FrameLoader.cpp:
1632         (WebCore::FrameLoader::shouldUseCredentialStorage): Added. Calls through
1633         to the FrameLoaderClient.
1634         * loader/FrameLoader.h: Declared shouldUseCredentialStorage().
1635         * loader/FrameLoaderClient.h: Declared shouldUseCredentialStorage().
1636         * loader/ResourceLoader.cpp: 
1637         (WebCore::ResourceLoader::shouldUseCredentialStorage): Added. Calls
1638         through to the FrameLoader.
1639         * loader/ResourceLoader.h:
1640         (WebCore::ResourceLoader::shouldUseCredentialStorage): Implemented this
1641         ResourceHandleClient method.
1642         * loader/SubresourceLoader.cpp:
1643         (WebCore::SubresourceLoader::shouldUseCredentialStorage): Added.
1644         Overrides the ResourceLoader implementation by letting the client
1645         supply the return value. If the client does not do this, continues
1646         with the ResourceLoader behavior of asking the FrameLoader.
1647         * loader/SubresourceLoader.h: Removed an unused #include and declared
1648         shouldUseCredentialStorage().
1649         * loader/SubresourceLoaderClient.h:
1650         (WebCore::SubresourceLoaderClient::getShouldUseCredentialStorage):
1651         Added a default implementation which returns false, meaning the client
1652         does not wish to decide whether the credential storage should be used.
1653         * platform/network/ResourceHandle.h: Removed unused forward declarations.
1654         Declared a new member function, shouldUseCredentialStorage(), on Mac and
1655         CFNetwork-using builds.
1656         * platform/network/ResourceHandleClient.h:
1657         (WebCore::ResourceHandleClient::shouldUseCredentialStorage): Added this
1658         default implementation that returns false.
1659         * platform/network/cf/ResourceHandleCFNet.cpp:
1660         (WebCore::findCFNetworkModule): Added. Returns a handle to the CFNetwork
1661         module.
1662         (WebCore::cfNetworkVersion): Added. Returns the high word of the
1663         CFNetwork library's product version.
1664         (WebCore::highestSupportedCFURLConnectionClientVersion): Added. Returns
1665         the highest version of the CFURLConnectionClient structure supported by
1666         the CFNetwork library. The only reason to check this at runtime is
1667         that WebKit may be linking at runtime against an older version of
1668         CFNetwork than the one it was built with, as is the case with nightly
1669         builds.
1670         (WebCore::shouldUseCredentialStorageCallback): Added this
1671         CFURLConnection callback which calls through to
1672         ResourceHandle::shouldUseCredentialStorage().
1673         (WebCore::ResourceHandle::start): Pass a version 3 CFURLConnectionClient
1674         including the shouldUseCredentialStorage callback. At runtime, clamp the
1675         client structure version down to the highest supported by CFNetwork.
1676         (WebCore::ResourceHandle::shouldUseCredentialStorage): Added. Calls through
1677         to the client if there is one. Otherwise returns false.
1678         * platform/network/mac/ResourceHandleMac.mm:
1679         (WebCore::ResourceHandle::shouldUseCredentialStorage): Ditto.
1680         (-[WebCoreResourceHandleAsDelegate connectionShouldUseCredentialStorage:]):
1681         Added this delegate method which callls through to
1682         ResourceHandle::shouldUseCredentialStorage().
1683
1684 2008-12-18  David Kilzer  <ddkilzer@apple.com>
1685
1686         Reset role to "Private" on 6 header files to fix clean builds after r39378
1687
1688         Reviewed by BUILD FIX.
1689
1690         * WebCore.xcodeproj/project.pbxproj: Added back "Private" role
1691         that was lost on 6 headers when they were "moved":
1692         AffineTransform.h, Animation.h, AnimationList.h,
1693         TimingFunction.h, TransformOperation.h and
1694         TransformOperations.h.
1695
1696 2008-12-18  Pamela Greene  <pam@chromium.org>
1697
1698         Reviewed by Dan Bernstein.
1699
1700         Add initializer for m_textDirectionSubmenuInclusionBehavior.
1701         https://bugs.webkit.org/show_bug.cgi?id=22926
1702
1703         * page/Settings.cpp:
1704         (WebCore::Settings::Settings): Initialize m_textDirectionSubmenuInclusionBehavior
1705
1706 2008-12-18  Sam Weinig  <sam@webkit.org>
1707
1708         Reviewed by John Sullivan.
1709
1710         Add new FrameLoaderClient method to indicate the first visually 
1711         non-empty layout based on an heuristic.  Right now that heuristic
1712         is the first layout after an image, text or plugin has been added
1713         to the render tree, but I can imagine it becoming much smarter.
1714
1715         * loader/EmptyClients.h:
1716         (WebCore::EmptyFrameLoaderClient::dispatchDidFirstVisuallyNonEmptyLayout):
1717         * loader/FrameLoader.cpp:
1718         (WebCore::FrameLoader::didFirstVisuallyNonEmptyLayout):
1719         * loader/FrameLoader.h:
1720         * loader/FrameLoaderClient.h:
1721         * page/FrameView.cpp:
1722         (WebCore::FrameViewPrivate::reset):
1723         (WebCore::FrameView::layout):
1724         (WebCore::FrameView::performPostLayoutTasks):
1725         (WebCore::FrameView::setIsVisuallyNonEmpty):
1726         * page/FrameView.h:
1727         * rendering/RenderImage.cpp:
1728         (WebCore::RenderImage::RenderImage):
1729         * rendering/RenderPartObject.cpp:
1730         (WebCore::RenderPartObject::RenderPartObject):
1731         * rendering/RenderText.cpp:
1732         (WebCore::RenderText::RenderText):
1733
1734 2008-12-18  Darin Adler  <darin@apple.com>
1735
1736         Reviewed by Sam Weinig.
1737
1738         - fix <rdar://problem/6449841> reduce memory use of ResourceResponseBase by removing two maps
1739
1740         We were parsing the cache-control and pragma header field values into maps.
1741         I changed that so instead we only cache two bits with the data we were actually
1742         using. Later we might want to move this responsibility out of this class entirely;
1743         we can cache it at the higher level instead.
1744
1745         * loader/CachedResource.cpp:
1746         (WebCore::CachedResource::mustRevalidate): Changed to call a specific API to get at
1747         the bits in quest instead of a general "cache control directives" API.
1748
1749         * platform/network/ResourceResponseBase.cpp:
1750         (WebCore::ResourceResponseBase::setHTTPHeaderField): Remove the logic for the
1751         pragma header field since no one is using this for now.
1752         (WebCore::ResourceResponseBase::parseCacheControlDirectives): Eliminated the return
1753         value and made this function have side effects only. Changed it so it's the caller's
1754         responsibility to check m_haveParsedCacheControl. Set m_cacheControlContainsNoCache
1755         and m_cacheControlContainsMustRevalidate rather than keeping a map around.
1756
1757         * platform/network/ResourceResponseBase.h:
1758         (WebCore::ResourceResponseBase::cacheControlContainsNoCache): Added.
1759         (WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate): Added.
1760         (WebCore::ResourceResponseBase::ResourceResponseBase): Updated since I removed
1761         m_haveParsedCacheControl and renamed m_haveParsedCacheControlHeader to remove
1762         the imprecise use of the term "header".
1763
1764 2008-12-18  Steve Falkenburg  <sfalken@apple.com>
1765
1766         Build fix.
1767         Delete 2nd copy of code in these files.
1768
1769         * platform/animation/Animation.cpp:
1770         * platform/animation/Animation.h:
1771         * platform/animation/AnimationList.cpp:
1772         * platform/animation/AnimationList.h:
1773         * platform/animation/TimingFunction.h:
1774         * platform/graphics/transforms/AffineTransform.cpp:
1775         * platform/graphics/transforms/AffineTransform.h:
1776         * platform/graphics/transforms/IdentityTransformOperation.h:
1777         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1778         * platform/graphics/transforms/MatrixTransformOperation.h:
1779         * platform/graphics/transforms/RotateTransformOperation.cpp:
1780         * platform/graphics/transforms/RotateTransformOperation.h:
1781         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1782         * platform/graphics/transforms/ScaleTransformOperation.h:
1783         * platform/graphics/transforms/SkewTransformOperation.cpp:
1784         * platform/graphics/transforms/SkewTransformOperation.h:
1785         * platform/graphics/transforms/TransformOperation.h:
1786         * platform/graphics/transforms/TransformOperations.cpp:
1787         * platform/graphics/transforms/TransformOperations.h:
1788         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1789         * platform/graphics/transforms/TranslateTransformOperation.h:
1790
1791 2008-12-18  Dimitri Glazkov  <dglazkov@chromium.org>
1792
1793         Reviewed by Geoffrey Garen.
1794
1795         https://bugs.webkit.org/show_bug.cgi?id=22859
1796         Abstract away the use of JSDOMWindow in CachedPage and introduce
1797         ScriptCachedPageData abstraction.
1798
1799         * GNUmakefile.am: Added ScriptCachedPageData to project.
1800         * WebCore.pro: Added ScriptCachedPageData to project.
1801         * WebCore.vcproj/WebCore.vcproj: Added ScriptCachedPageData to project.
1802         * WebCore.xcodeproj/project.pbxproj: Added ScriptCachedPageData to
1803             project.
1804         * bindings/js/ScriptCachedPageData.cpp: Added.
1805         (WebCore::ScriptCachedPageData::ScriptCachedPageData):
1806         (WebCore::ScriptCachedPageData::~ScriptCachedPageData):
1807         (WebCore::ScriptCachedPageData::restore):
1808         (WebCore::ScriptCachedPageData::clear):
1809         * bindings/js/ScriptCachedPageData.h: Added.
1810         * history/CachedPage.cpp: Replaced JSDOMWindow and ProtectedPtr with
1811             ScriptCachedPageData.
1812         (WebCore::CachedPage::CachedPage):
1813         (WebCore::CachedPage::domWindow):
1814         (WebCore::CachedPage::restore):
1815         (WebCore::CachedPage::clear):
1816         * history/CachedPage.h: Replaced JSDOMWindow and ProtectedPtr with
1817             ScriptCachedPageData.
1818
1819 2008-12-18  Chris Marrin  <cmarrin@apple.com>
1820
1821         Reviewed by Dave Hyatt.
1822
1823         https://bugs.webkit.org/show_bug.cgi?id=22888
1824
1825         To avoid future dependency issues, all the TransformOperations and Animation related files need to be moved to platform
1826
1827         * WebCore.xcodeproj/project.pbxproj:
1828         * platform/animation: Added.
1829         * platform/animation/Animation.cpp: Copied from WebCore/rendering/style/Animation.cpp.
1830         * platform/animation/Animation.h: Copied from WebCore/rendering/style/Animation.h.
1831         * platform/animation/AnimationList.cpp: Copied from WebCore/rendering/style/AnimationList.cpp.
1832         * platform/animation/AnimationList.h: Copied from WebCore/rendering/style/AnimationList.h.
1833         * platform/animation/TimingFunction.h: Copied from WebCore/rendering/style/TimingFunction.h.
1834         * platform/graphics/AffineTransform.cpp: Removed.
1835         * platform/graphics/AffineTransform.h: Removed.
1836         * platform/graphics/transforms: Added.
1837         * platform/graphics/transforms/AffineTransform.cpp: Copied from WebCore/platform/graphics/AffineTransform.cpp.
1838         * platform/graphics/transforms/AffineTransform.h: Copied from WebCore/platform/graphics/AffineTransform.h.
1839         * platform/graphics/transforms/IdentityTransformOperation.h: Copied from WebCore/rendering/style/IdentityTransformOperation.h.
1840         * platform/graphics/transforms/MatrixTransformOperation.cpp: Copied from WebCore/rendering/style/MatrixTransformOperation.cpp.
1841         * platform/graphics/transforms/MatrixTransformOperation.h: Copied from WebCore/rendering/style/MatrixTransformOperation.h.
1842         * platform/graphics/transforms/RotateTransformOperation.cpp: Copied from WebCore/rendering/style/RotateTransformOperation.cpp.
1843         * platform/graphics/transforms/RotateTransformOperation.h: Copied from WebCore/rendering/style/RotateTransformOperation.h.
1844         * platform/graphics/transforms/ScaleTransformOperation.cpp: Copied from WebCore/rendering/style/ScaleTransformOperation.cpp.
1845         * platform/graphics/transforms/ScaleTransformOperation.h: Copied from WebCore/rendering/style/ScaleTransformOperation.h.
1846         * platform/graphics/transforms/SkewTransformOperation.cpp: Copied from WebCore/rendering/style/SkewTransformOperation.cpp.
1847         * platform/graphics/transforms/SkewTransformOperation.h: Copied from WebCore/rendering/style/SkewTransformOperation.h.
1848         * platform/graphics/transforms/TransformOperation.h: Copied from WebCore/rendering/style/TransformOperation.h.
1849         * platform/graphics/transforms/TransformOperations.cpp: Copied from WebCore/rendering/style/TransformOperations.cpp.
1850         * platform/graphics/transforms/TransformOperations.h: Copied from WebCore/rendering/style/TransformOperations.h.
1851         * platform/graphics/transforms/TranslateTransformOperation.cpp: Copied from WebCore/rendering/style/TranslateTransformOperation.cpp.
1852         * platform/graphics/transforms/TranslateTransformOperation.h: Copied from WebCore/rendering/style/TranslateTransformOperation.h.
1853         * rendering/style/Animation.cpp: Removed.
1854         * rendering/style/Animation.h: Removed.
1855         * rendering/style/AnimationList.cpp: Removed.
1856         * rendering/style/AnimationList.h: Removed.
1857         * rendering/style/IdentityTransformOperation.h: Removed.
1858         * rendering/style/MatrixTransformOperation.cpp: Removed.
1859         * rendering/style/MatrixTransformOperation.h: Removed.
1860         * rendering/style/RotateTransformOperation.cpp: Removed.
1861         * rendering/style/RotateTransformOperation.h: Removed.
1862         * rendering/style/ScaleTransformOperation.cpp: Removed.
1863         * rendering/style/ScaleTransformOperation.h: Removed.
1864         * rendering/style/SkewTransformOperation.cpp: Removed.
1865         * rendering/style/SkewTransformOperation.h: Removed.
1866         * rendering/style/TimingFunction.h: Removed.
1867         * rendering/style/TransformOperation.h: Removed.
1868         * rendering/style/TransformOperations.cpp: Removed.
1869         * rendering/style/TransformOperations.h: Removed.
1870         * rendering/style/TranslateTransformOperation.cpp: Removed.
1871         * rendering/style/TranslateTransformOperation.h: Removed.
1872
1873 2008-12-18  Cameron Zwarich  <zwarich@apple.com>
1874
1875         Reviewed by Geoff Garen.
1876
1877         Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
1878         <https://bugs.webkit.org/show_bug.cgi?id=21855>
1879         <rdar://problem/6278244>
1880
1881         If JavaScript is not currently executing, the handleEvent member function
1882         of JSAbstractEventListener should set the dynamic global object to the
1883         global object of the context in which the event occurred.
1884         
1885         If this is not set, then JavaScriptCore will simply take the global object
1886         of the context where the event handler function was created, which may be
1887         a different frame. This will cause the popup blocker to incorrectly block
1888         windows opened from onclick events inside of an iframe whose handler was
1889         created in the outer frame, as it will check the outer frame and see that
1890         it is not processing any events.
1891
1892         * bindings/js/JSEventListener.cpp:
1893         (WebCore::JSAbstractEventListener::handleEvent):
1894
1895 2008-12-17  Simon Fraser  <simon.fraser@apple.com>
1896
1897         Reviewed by Dave Hyatt
1898
1899         https://bugs.webkit.org/show_bug.cgi?id=22570
1900         
1901         Add the ability to compute clip rects independently from
1902         caching them on the RenderLayer. When painting reflections, use 
1903         such temporarily computed clipRects, otherwise the layer may cache
1904         clipRects which are invalid, since they have been computed with
1905         a rootLayer that is not the one usually used to paint.
1906         
1907         Test: fast/reflections/reflection-overflow-hidden.html
1908
1909         * rendering/RenderLayer.cpp:
1910         (WebCore::RenderLayer::paintLayer):
1911         (WebCore::RenderLayer::hitTestLayer):
1912         (WebCore::RenderLayer::updateClipRects):
1913         (WebCore::RenderLayer::calculateClipRects):
1914         (WebCore::RenderLayer::calculateRects):
1915         * rendering/RenderLayer.h:
1916         (WebCore::ClipRects::ClipRects):
1917         (WebCore::ClipRects::reset):
1918         (WebCore::ClipRects::overflowClipRect):
1919         (WebCore::ClipRects::setOverflowClipRect):
1920         (WebCore::ClipRects::fixedClipRect):
1921         (WebCore::ClipRects::setFixedClipRect):
1922         (WebCore::ClipRects::posClipRect):
1923         (WebCore::ClipRects::setPosClipRect):
1924         (WebCore::ClipRects::setFixed):
1925         (WebCore::ClipRects::operator==):
1926         (WebCore::ClipRects::operator=):
1927         * rendering/RenderReplica.cpp:
1928         (WebCore::RenderReplica::paint):
1929
1930 2008-12-17  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
1931
1932         Reviewed by Simon Hausmann.
1933
1934         https://bugs.webkit.org/show_bug.cgi?id=22618
1935
1936         Fix MinGW QtWebKit linking problems and also make the 
1937         QtWebKit build system more robust.
1938
1939         * WebCore.pro:
1940
1941 2008-12-17  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
1942
1943         Reviewed by Maciej Stachowiak.
1944
1945         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22866
1946
1947         wml.css is based on an older copy of html4.css. Synchronize them.
1948         Remove all entries, that are irrelevant for WML.
1949
1950         Fix <do> appearance: should behave like HTMLs <button>.
1951
1952         * css/wml.css:
1953
1954 2008-12-17  Yury Semikhatsky <yurys@google.com>
1955
1956         Reviewed by Timothy Hatcher.
1957         Landed by Adam Barth.
1958
1959         Added more checks that WebInspector.panels.{resources,scripts} are
1960         defined where they are accessed from other panels and WebInspector
1961         (some panels are not yet supported in Chrome).
1962
1963         * inspector/front-end/Console.js:
1964         (WebInspector.Console.prototype.addMessage):
1965         (WebInspector.Console.prototype.clearMessages):
1966         (WebInspector.Console.prototype.completions):
1967         * inspector/front-end/ObjectPropertiesSection.js:
1968         (WebInspector.ObjectPropertyTreeElement.prototype.evaluateExpression):
1969         * inspector/front-end/ScriptsPanel.js:
1970         (WebInspector.ScriptsPanel.prototype.get searchableViews):
1971         (WebInspector.ScriptsPanel.prototype._sourceViewForScriptOrResource):
1972         (WebInspector.ScriptsPanel.prototype._sourceFrameForScriptOrResource):
1973         (WebInspector.ScriptsPanel.prototype._showScriptOrResource):
1974         * inspector/front-end/SourceView.js:
1975         (WebInspector.SourceView.prototype._addBreakpoint):
1976         * inspector/front-end/inspector.js:
1977         (WebInspector.addResource):
1978         (WebInspector.removeResource):
1979         (WebInspector.showResourceForURL):
1980
1981 2008-12-17  Cary Clark  < caryclark@google.com>
1982
1983         Reviewed by Darin Adler.
1984         Landed by Adam Barth.
1985
1986         Add ENABLE_TEXT_CARET to permit the ANDROID platform
1987         to invalidate and draw the caret in a separate thread.
1988
1989         * page/Frame.cpp:
1990         (WebCore::Frame::clearCaretRectIfNeeded): Body of
1991         function does nothing if text caret is disabled.
1992         (WebCore::Frame::selectionLayoutChanged): Do nothing
1993         if text caret is disabled and the caret only blinked.
1994         (WebCore::Frame::caretBlinkTimerFired):
1995         (WebCore::Frame::paintCaret):
1996         (WebCore::Frame::paintDragCaret): Body of
1997         functions does nothing if text caret is disabled.
1998
1999 2008-12-16  Darin Adler  <darin@apple.com>
2000
2001         Reviewed and landed by Cameron Zwarich.
2002
2003         Change the style of AtomicString::add() to match Identifier:add().
2004
2005         * platform/text/AtomicString.cpp:
2006         (WebCore::AtomicString::add):
2007
2008 2008-12-16  Adele Peterson  <adele@apple.com>
2009
2010         Reviewed by Darin Adler.
2011
2012         Fix for https://bugs.webkit.org/show_bug.cgi?id=22827
2013         <rdar://problem/6247724> RenderThemeWin buttons have weird heavy text
2014
2015         * rendering/RenderThemeWin.cpp:
2016         (WebCore::fillFontDescription): Add version that takes a font size.
2017         (WebCore::RenderThemeWin::systemFont): Use the default GUI font for control fonts, but specify the size.
2018         This will match Firefox.
2019
2020 2008-12-16  Stephanie Lewis  <slewis@apple.com>
2021
2022         Another build fix.
2023
2024         * platform/text/AtomicString.h:
2025         (WebCore::AtomicString::AtomicString):
2026
2027 2008-12-16  Stephanie Lewis  <slewis@apple.com>
2028
2029         Windows Build Fix.
2030
2031         * platform/text/AtomicString.h:
2032         (WebCore::AtomicString::AtomicString):
2033         (WebCore::AtomicString::createCFString):
2034
2035 2008-12-16  Peter Kasting  <pkasting@google.com>
2036
2037         Reviewed by David Hyatt.
2038
2039         https://bugs.webkit.org/show_bug.cgi?id=22885
2040         Fix memory corruption in GIFImageDecoder.cpp with certain GIFs.
2041
2042         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2043         (WebCore::GIFImageDecoder::frameComplete):
2044
2045 2008-12-16  Stephanie Lewis  <slewis@apple.com>
2046
2047         Reviewed by Geoff Garen.
2048
2049         Change HTTPHeaderMap to use an AtomicString as its key.  
2050         Shaves ~1MB off of the Mozilla Memory Test
2051         No functionality difference    
2052
2053         * WebCore.xcodeproj/project.pbxproj:
2054         * inspector/InspectorController.cpp:
2055         (WebCore::addHeaders):
2056         * loader/appcache/ApplicationCacheStorage.cpp:
2057         (WebCore::parseHeader):
2058         * platform/network/HTTPHeaderMap.h:
2059         * platform/network/ResourceRequestBase.cpp:
2060         (WebCore::ResourceRequestBase::httpHeaderField):
2061         (WebCore::ResourceRequestBase::setHTTPHeaderField):
2062         (WebCore::ResourceRequestBase::addHTTPHeaderField):
2063         * platform/network/ResourceRequestBase.h:
2064         * platform/network/ResourceResponseBase.cpp:
2065         (WebCore::ResourceResponseBase::httpHeaderField):
2066         (WebCore::ResourceResponseBase::setHTTPHeaderField):
2067         * platform/network/ResourceResponseBase.h:
2068         * platform/text/StringHash.h:
2069         (WebCore::CaseFoldingHash::hash):
2070         (WebCore::CaseFoldingHash::equal):
2071         * xml/XMLHttpRequest.cpp:
2072         (WebCore::isSetCookieHeader):
2073         (WebCore::XMLHttpRequest::setRequestHeader):
2074         (WebCore::XMLHttpRequest::setRequestHeaderInternal):
2075         (WebCore::XMLHttpRequest::getRequestHeader):
2076         (WebCore::XMLHttpRequest::getResponseHeader):
2077         * xml/XMLHttpRequest.h:
2078
2079 2008-12-16  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
2080
2081         Reviewed by Darin Adler.
2082
2083         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
2084
2085         Remove legacy randomNumber() functionality from HTMLFormElement, and use the new wtf/RandomNumber.h.
2086         Also remove an uneeded QFileInfo include while I'm at it - there is no Qt usage in this file.
2087
2088         * ForwardingHeaders/wtf/RandomNumber.h: Added.
2089         * html/HTMLFormElement.cpp:
2090         (WebCore::getUniqueBoundaryString):
2091
2092 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
2093
2094         Reviewed by Tor Arne Vestbø.
2095
2096         Qt/Win build fix
2097
2098         * platform/win/SystemTimeWin.cpp:
2099
2100 2008-12-16  Kalle Vahlman  <kalle.vahlman@movial.com>
2101
2102         Reviewed by Holger Freyther.
2103
2104         [CURL] memory leak of ResouceHandles
2105         http://bugs.webkit.org/show_bug.cgi?id=20777
2106
2107         Fix ResourceHandle ref management to be consistent and correct.
2108         Original patch from Marco Barisione.
2109
2110         * platform/network/curl/ResourceHandleCurl.cpp:
2111         (WebCore::ResourceHandle::start):
2112         * platform/network/curl/ResourceHandleManager.cpp:
2113         (WebCore::ResourceHandleManager::removeFromCurl):
2114         (WebCore::ResourceHandleManager::add):
2115         (WebCore::ResourceHandleManager::removeScheduledJob):
2116
2117 2008-12-16  Simon Hausmann  <simon.hausmann@nokia.com>
2118
2119         Fix the Qt build.
2120
2121         * platform/graphics/qt/ImageSourceQt.cpp:
2122         (WebCore::ImageSource::clear): Adjust to new signature.
2123
2124 2008-12-15  Mark Rowe  <mrowe@apple.com>
2125
2126         Rubber-stamped by Cameron Zwarich.
2127
2128         <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
2129
2130         * Configurations/Base.xcconfig:
2131         * Configurations/DebugRelease.xcconfig:
2132
2133 2008-12-15  Adele Peterson  <adele@apple.com>
2134
2135         Reviewed by Darin Adler.
2136
2137         Fix for https://bugs.webkit.org/show_bug.cgi?id=22871
2138         <rdar://problem/6417316> RenderThemeWin buttons are too short/thin
2139
2140         * rendering/RenderButton.cpp: (WebCore::RenderButton::setupInnerStyle): 
2141         Check if the button's style (not the new inner style) has appearance set to determine whether we should set padding on the inner style.
2142
2143 2008-12-15  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
2144
2145         Reviewed by Oliver Hunt.
2146
2147         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22865
2148
2149         Add complete WML <table> / <tr> / <td> element support.
2150         Proper handling of all table related attributes, including tests.
2151
2152         Tests: fast/wml/table-element-align-attribute-invalid.wml (variable reference in 'align' attribute, raises error)
2153                fast/wml/table-element-columns-attribute-invalid-number.wml (columns='0', raises error)
2154                fast/wml/table-element-columns-attribute-invalid.wml (non-numeric 'columns' attribute value, raises error)
2155                fast/wml/table-element-columns-attribute-missing.wml (missing 'columns')
2156                fast/wml/table-element-columns-attribute.wml (test 'columns' attribute and <td> count mismatches)
2157
2158         * GNUmakefile.am:
2159         * WebCore.pro:
2160         * WebCore.vcproj/WebCore.vcproj:
2161         * WebCore.xcodeproj/project.pbxproj:
2162         * rendering/RenderObject.cpp:
2163         (WebCore::RenderObject::offsetParent):
2164         * rendering/RenderTableRow.cpp:
2165         (WebCore::RenderTableRow::addChild):
2166         * wml/WMLTableElement.cpp: Added.
2167         (WebCore::WMLTableElement::WMLTableElement):
2168         (WebCore::WMLTableElement::~WMLTableElement):
2169         (WebCore::WMLTableElement::mapToEntry):
2170         (WebCore::WMLTableElement::parseMappedAttribute):
2171         (WebCore::WMLTableElement::finishParsingChildren):
2172         * wml/WMLTableElement.h: Added.
2173         * wml/WMLTagNames.in:
2174
2175 2008-12-15  Darin Adler  <darin@apple.com>
2176
2177         Reviewed by Sam Weinig.
2178
2179         - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
2180
2181         Test: fast/dom/Window/window-custom-prototype.html
2182
2183         Replaced toGlobalObject with the more generally useful unwrappedObject.
2184
2185         * bindings/js/JSDOMWindowShell.cpp:
2186         (WebCore::JSDOMWindowShell::unwrappedObject): Added.
2187         * bindings/js/JSDOMWindowShell.h: Declared unwrappedObject.
2188         * bindings/js/JSQuarantinedObjectWrapper.h:
2189         (WebCore::JSQuarantinedObjectWrapper::unwrappedObject): Ditto.
2190
2191 2008-12-15  Gustavo Noronha Silva  <kov@kov.eti.br>
2192
2193         Reviewed by Mark Rowe.
2194
2195         https://bugs.webkit.org/show_bug.cgi?id=22686
2196
2197         GTK+ build fix.
2198
2199         * GNUmakefile.am:
2200
2201 2008-12-15  Sam Weinig  <sam@webkit.org>
2202
2203         Reviewed by Darin Adler.
2204
2205         Fix for https://bugs.webkit.org/show_bug.cgi?id=22847
2206         Geolocation PositionOptions cannot be an arbitrary object.
2207
2208         Allow the PositionOptions to be a vanilla JS object and parse it
2209         appropriately.
2210
2211         * DerivedSources.make: Remove PositionOptions.
2212         * GNUmakefile.am: Ditto.
2213         * WebCore.pro: Ditto.
2214         * WebCore.vcproj/WebCore.vcproj: Ditto.
2215         * WebCore.xcodeproj/project.pbxproj: Ditto.
2216         * WebCoreSources.bkl: Ditto.
2217
2218         * bindings/js/JSGeolocationCustom.cpp:
2219         (WebCore::createPositionOptions): Added. Extracts the enableHighAccuracy
2220         and timeout fields from a vanilla JS object in order to create the 
2221         PositionOptions object, checking for exceptions as necessary.
2222         (WebCore::JSGeolocation::getCurrentPosition): Use createPositionOptions
2223         instead of toPositionOptions.
2224         (WebCore::JSGeolocation::watchPosition): Ditto.
2225         * page/PositionOptions.idl: Removed
2226
2227 2008-12-15  Peter Kasting  <pkasting@google.com>
2228
2229         Reviewed by David Hyatt.
2230
2231         https://bugs.webkit.org/show_bug.cgi?id=22108
2232         Large animated GIFs weren't always animating.  The code that deleted
2233         the entire decoder after each frame of a large image was resulting in
2234         us forgetting the loop count, breaking animations intermittently.
2235
2236         Instead of throwing the whole decoder away, we're more careful to just
2237         delete frames we don't care about.  This additionally addresses
2238         problems in the Cairo and Chromium ports with excessive peak memory
2239         use and CPU use when decoding large animated GIFs because it leads to
2240         much less redecoding (O(n) instead of O(n^2) CPU, and O(1) instead of
2241         O(n) memory).
2242
2243         This change has less impact on the CG decoder, which seems to throw
2244         away frames automatically when their external references are dropped;
2245         this means the CG decoder didn't suffer from the peak memory usage
2246         issue before (and still doesn't), but it also still burns excessive
2247         CPU redecoding earlier frames, that in theory it wouldn't need to
2248         redecode if it would judiciously save the most recent frames.  At
2249         least this patch plumbs some useful info to the ImageSource so it can
2250         help guide the CG decoder heuristics in the future.
2251
2252         * platform/graphics/BitmapImage.cpp:
2253         (WebCore::frameBytes):
2254         (WebCore::BitmapImage::destroyDecodedData):
2255         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
2256         (WebCore::BitmapImage::destroyMetadataAndNotify):
2257         (WebCore::BitmapImage::clearFrame):
2258         (WebCore::BitmapImage::cacheFrame):
2259         (WebCore::BitmapImage::dataChanged):
2260         (WebCore::BitmapImage::startAnimation):
2261         (WebCore::BitmapImage::resetAnimation):
2262         (WebCore::BitmapImage::internalAdvanceAnimation):
2263         * platform/graphics/BitmapImage.h:
2264         * platform/graphics/GeneratedImage.h:
2265         (WebCore::GeneratedImage::destroyDecodedData):
2266         * platform/graphics/Image.h:
2267         * platform/graphics/ImageSource.h:
2268         * platform/graphics/cairo/ImageSourceCairo.cpp:
2269         (WebCore::ImageSource::~ImageSource):
2270         (WebCore::ImageSource::clear):
2271         * platform/graphics/cg/ImageSourceCG.cpp:
2272         (WebCore::ImageSource::~ImageSource):
2273         (WebCore::ImageSource::clear):
2274         * platform/graphics/cg/PDFDocumentImage.h:
2275         (WebCore::PDFDocumentImage::destroyDecodedData):
2276         * platform/graphics/qt/StillImageQt.h:
2277         (WebCore::StillImage::destroyDecodedData):
2278         * platform/image-decoders/ImageDecoder.h:
2279         (WebCore::RGBA32Buffer::clear):
2280         (WebCore::ImageDecoder::clearFrameBufferCache):
2281         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2282         (WebCore::GIFImageDecoder::repetitionCount):
2283         (WebCore::GIFImageDecoder::clearFrameBufferCache):
2284         (WebCore::GIFImageDecoder::initFrameBuffer):
2285         * platform/image-decoders/gif/GIFImageDecoder.h:
2286         * platform/image-decoders/gif/GIFImageReader.h:
2287         (GIFImageReader::GIFImageReader):
2288         * svg/graphics/SVGImage.h:
2289         (WebCore::SVGImage::destroyDecodedData):
2290
2291 2008-12-15  Cameron Zwarich  <zwarich@apple.com>
2292
2293         Reviewed by Darin Adler.
2294
2295         Bug 22562: REGRESSION (r37971): events not firing after going back in back/forward cache
2296         <https://bugs.webkit.org/show_bug.cgi?id=22562>
2297         <rdar://problem/6414593>
2298
2299         Restore the Frame's DOMWindow to its previous value when going back in
2300         the back/forward cache. The fact that it was not getting set before may
2301         have always caused some subtle bugs with the back/forward cache, but
2302         after r37971, it causes no events to fire after restoring a page.
2303
2304         Previously, ScriptController::clearScriptObjects() was calling
2305         clearPlatformScriptObjects(), which was not actually clearing any
2306         objects, only updating them to reflect some change in state. Since the
2307         window shell was not updated until after the call to clearScriptObjects(),
2308         this didn't actually make that much sense.
2309
2310         We rename clearPlatformScriptObjects() to reflect its actual purpose and
2311         call it after the window shell has been updated rather than before.
2312
2313         Unfortunately, there is no way to test this with a layout test because
2314         it involves the back/forward cache.
2315
2316         * bindings/js/ScriptController.cpp:
2317         (WebCore::ScriptController::updatePlatformScriptObjects): Renamed from
2318         clearPlatformScriptObjects(), because the only nonempty implementation
2319         doesn't actually clear any objects, it updates them. Also made public.
2320         (WebCore::ScriptController::clearScriptObjects): Remove the call to
2321         clearPlatformScriptObjects().
2322         * bindings/js/ScriptController.h:
2323         * bindings/js/ScriptControllerMac.mm:
2324         (WebCore::ScriptController::updatePlatformScriptObjects):
2325         * history/CachedPage.cpp:
2326         (WebCore::CachedPage::domWindow): Added.
2327         * history/CachedPage.h:
2328         * loader/FrameLoader.cpp:
2329         (WebCore::FrameLoader::cancelAndClear): Added call to updatePlatformScriptObjects().
2330         (WebCore::FrameLoader::begin): Added call to updatePlatformScriptObjects().
2331         (WebCore::FrameLoader::open): Added call to updatePlatformScriptObjects().
2332         * page/Frame.cpp:
2333         (WebCore::Frame::setDOMWindow): Added.
2334         (WebCore::Frame::pageDestroyed): Added call to updatePlatformScriptObjects().
2335         * page/Frame.h:
2336
2337 2008-12-15  Antti Koivisto  <antti@apple.com>
2338
2339         Reviewed by Darin Adler.
2340
2341         When a resource is cached locally, WebKit should follow RFC 2616 "Specific end-to-end revalidation" instead of "Unspecified end-to-end revalidation"
2342         https://bugs.webkit.org/show_bug.cgi?id=17998 
2343         
2344         - Enable conditional revalidation for reloads by default. 
2345         - Add a parameter to FrameLoader::reload() for forcing end-to-end reload.
2346         - To avoid duplicating state remove m_cachePolicy variables from FrameLoader and DocLoader. 
2347           Instead synthezise the policy on demand.
2348         
2349         This speeds up reloads and makes them use way less bandwidth.
2350
2351         * WebCore.base.exp:
2352         * loader/CachePolicy.h: Rename CachePolicyRefresh to CachePolicyRevalidate.
2353         (WebCore::):
2354         * loader/DocLoader.cpp:
2355         (WebCore::DocLoader::DocLoader):
2356         (WebCore::DocLoader::checkForReload): Support CachePolicyRevalidate.
2357         (WebCore::DocLoader::requestResource):
2358         (WebCore::DocLoader::cachePolicy):
2359         * loader/DocLoader.h: Get rid of m_cachePolicy member. 
2360         * loader/FrameLoader.cpp:
2361         (WebCore::ScheduledRedirection::ScheduledRedirection): 
2362             Add parameter to differentiate refresh from other types of redirects. 
2363             m_cachePolicy was used for signaling this before.
2364         (WebCore::isBackForwardLoadType):
2365         (WebCore::FrameLoader::FrameLoader):
2366         (WebCore::FrameLoader::changeLocation):
2367         (WebCore::FrameLoader::stopLoading):
2368         (WebCore::FrameLoader::receivedFirstData):
2369         (WebCore::FrameLoader::write):
2370         (WebCore::FrameLoader::startIconLoader):
2371         (WebCore::FrameLoader::restoreDocumentState):
2372         (WebCore::FrameLoader::scheduleHTTPRedirection):
2373         (WebCore::FrameLoader::scheduleLocationChange):
2374         (WebCore::FrameLoader::scheduleRefresh):
2375         (WebCore::FrameLoader::redirectionTimerFired):
2376         (WebCore::FrameLoader::canCachePage):
2377         (WebCore::FrameLoader::loadURL):
2378         (WebCore::FrameLoader::reload): 
2379             Differentiate between revalidation and reload.
2380             No need to use setHTTPHeaderField here, addExtraFieldsToRequest will set the headers.
2381         (WebCore::FrameLoader::transitionToCommitted):
2382         (WebCore::FrameLoader::cachePolicy): Determine the cache policy based on current load type. 
2383         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2384         (WebCore::FrameLoader::addExtraFieldsToRequest): Set Cache-control: no-cache for FrameLoadTypeReloadFromOrigin
2385         (WebCore::FrameLoader::shouldScrollToAnchor):
2386         (WebCore::FrameLoader::loadItem):
2387         (WebCore::FrameLoader::updateHistoryForReload):
2388         (WebCore::FrameLoader::updateHistoryForCommit):
2389         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
2390         * loader/FrameLoader.h:
2391         * loader/FrameLoaderTypes.h: Add FrameLoadTypeReloadFromOrigin
2392         (WebCore::):
2393         * loader/NavigationAction.cpp: 
2394         (WebCore::navigationType):  Support FrameLoadTypeReloadFromOrigin
2395         * loader/loader.cpp:
2396         (WebCore::Loader::Host::servePendingRequests):
2397
2398 2008-12-15  Holger Hans Peter Freyther  <zecke@selfish.org>
2399
2400         Reviewed by Simon Hausmann.
2401
2402         Add null checks to PlatformScreenQt
2403
2404         The other ports do the null checks and JSDOMWindowBase is
2405         at least one caller that is passing 0.
2406
2407         * platform/qt/PlatformScreenQt.cpp:
2408         (WebCore::screenDepth):
2409         (WebCore::screenDepthPerComponent):
2410         (WebCore::screenIsMonochrome):
2411         (WebCore::screenRect):
2412         (WebCore::screenAvailableRect):
2413
2414 2008-12-15  Alexey Proskuryakov  <ap@webkit.org>
2415
2416         Reviewed by Oliver Hunt.
2417
2418         <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
2419
2420         * dom/WorkerThread.cpp: (WebCore::WorkerThread::workerThread):
2421         Detach the thread. Without this, one page of its stack was never unmmaped, and fragmentation
2422         made RegisterFile allocaiton fail after a while.
2423
2424 2008-12-13  Darin Adler  <darin@apple.com>
2425
2426         Reviewed by Sam Weinig.
2427
2428         - half of https://bugs.webkit.org/show_bug.cgi?id=17425
2429           eliminate DeprecatedPtrList
2430
2431         * dom/Document.cpp:
2432         (WebCore::Document::removeImage): Change to set slots in the vector
2433         to 0 rather than removing items from a list.
2434         (WebCore::Document::dispatchImageLoadEventsNow): Rewrite to process
2435         the list. Since we now use a "set to zero" design, we don't need to
2436         be careful about where the iterator points while iterating the list,
2437         instead we just have to skip zeros.
2438
2439         * dom/Document.h: Use Vector instead of DeprecatedPtrList.
2440
2441         * dom/EventTargetNode.cpp:
2442         (WebCore::EventTargetNode::dispatchGenericEvent): Use a Vector instead
2443         of a DeprecatedPtrList for the list of nodes to handle. Also streamlined
2444         the logic a bit and used goto in a couple key places.
2445
2446         * dom/Node.cpp:
2447         (WebCore::Node::eventParentNode): Moved this function into this file
2448         because it's a virtual function so already can't be inlined. Also updated
2449         to return a ContainerNode, so it needs to be in a place where the
2450         definition of ContainerNode is visible, not the header file.
2451
2452         * dom/Node.h: Changed return type of eventParentNode to ContainerNode
2453         and moved its definition into the cpp file.
2454
2455         * dom/XMLTokenizerLibxml2.cpp:
2456         (WebCore::PendingCallbacks::~PendingCallbacks): Added a call to
2457         deleteAllValues here instead of setAutoDelete in the constructor, since
2458         we're using Deque instead of DeprecatedPtrList.
2459         (WebCore::PendingCallbacks::callAndRemoveFirstCallback): Changed the
2460         code to use an OwnPtr since the deque won't delete the callback object.
2461
2462         * editing/ApplyStyleCommand.cpp:
2463         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Use a
2464         Vector instead of a DeprecatedPtrList.
2465
2466         * svg/SVGElement.cpp:
2467         (WebCore::SVGElement::eventParentNode): Moved this function into this file
2468         because it's a virtual function so already can't be inlined. Also updated
2469         to return a ContainerNode.
2470
2471         * svg/SVGElement.h: Changed setShadowParentNode to take a ContainerNode*,
2472         made eventParentNode return a ContainerNode*, and made m_shadowParent a
2473         ContainerNode*.
2474
2475 2008-12-14  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
2476
2477         Reviewed by George Staikos.
2478
2479         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22857
2480
2481         Jumps within a WML deck using <go> task elements fail. Manual reloading
2482         is necessary to display the page - fix cache-policy in WMLGoElement::executeTask
2483         to prevent the problem.
2484
2485         Refactor setActiveCardInDocument in two new functions: findNamedCardInDocument
2486         and determineActiveCard, to fix a side-effect of executing a <go> task:
2487         when switching cards within a deck the active card was changed before the load
2488         was fired which resulted in a flash effect on the screen, and doing unnecessary work.
2489
2490         Test: wml/go-task-animation.html
2491
2492         * wml/WMLCardElement.cpp:
2493         (WebCore::WMLCardElement::findNamedCardInDocument):
2494         (WebCore::WMLCardElement::determineActiveCard):
2495         * wml/WMLCardElement.h:
2496         * wml/WMLDocument.cpp:
2497         (WebCore::WMLDocument::finishedParsing):
2498         * wml/WMLGoElement.cpp:
2499         (WebCore::WMLGoElement::executeTask):
2500         (WebCore::WMLGoElement::prepareGETRequest):
2501         * wml/WMLGoElement.h:
2502
2503 2008-12-14  Dirk Schulze  <krit@webkit.org>
2504
2505         Reviewed by Oliver Hunt.
2506
2507         Fixes an issue in cairo. A fully transparent color can cause wrong
2508         drawings on canvas' composite.
2509
2510         https://bugs.webkit.org/show_bug.cgi?id=22846
2511         [CAIRO] Canvas: transparent color and composite
2512
2513         Test: fast/canvas/canvas-transparency-and-composite.html
2514
2515         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2516         (WebCore::GraphicsContext::fillPath):
2517         (WebCore::GraphicsContext::strokePath):
2518
2519 2008-12-13  Julien Chaffraix  <jchaffraix@webkit.org>
2520
2521         Reviewed by Darin Adler.
2522
2523         Bug 22665: Remove setCreatedByParser(bool) from the few elements that use it
2524         https://bugs.webkit.org/show_bug.cgi?id=22665
2525
2526         Remove setCreatedByParser from frame and iframe.
2527
2528         * html/HTMLElementFactory.cpp:
2529         (WebCore::frameConstructor):
2530         (WebCore::iframeConstructor):
2531         (WebCore::objectConstructor):
2532         * html/HTMLFrameElement.cpp:
2533         (WebCore::HTMLFrameElement::HTMLFrameElement):
2534         * html/HTMLFrameElement.h:
2535         * html/HTMLFrameElementBase.cpp:
2536         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
2537         * html/HTMLFrameElementBase.h:
2538         * html/HTMLFrameOwnerElement.cpp:
2539         (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
2540         * html/HTMLFrameOwnerElement.h:
2541         (WebCore::HTMLFrameOwnerElement::createdByParser):
2542         * html/HTMLIFrameElement.cpp:
2543         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
2544         * html/HTMLIFrameElement.h:
2545         * html/HTMLPlugInElement.cpp:
2546         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2547         * html/HTMLTagNames.in:
2548
2549 2008-12-13  Alexey Proskuryakov  <ap@webkit.org>
2550
2551         Reviewed by Darin Adler.
2552
2553         https://bugs.webkit.org/show_bug.cgi?id=22843
2554         Auto-generate JSWorkerContext
2555
2556         * bindings/scripts/CodeGeneratorJS.pm:
2557         * dom/WorkerContext.idl: Added.
2558         * page/DOMWindow.idl:
2559         Added ExtendsDOMGlobalObject, a new attribute for behaviors common to DOMWindow and
2560         WorkerContext.
2561
2562         * bindings/js/WorkerScriptController.cpp:
2563         (WebCore::WorkerScriptController::initScript):
2564         Made JSWorkerContext creation look more like JSDOMWindow creation, to work with generated code.
2565
2566         * DerivedSources.make:
2567         * GNUmakefile.am:
2568         * WebCore.pro:
2569         * WebCore.scons:
2570         * WebCore.vcproj/WebCore.vcproj:
2571         * WebCore.xcodeproj/project.pbxproj:
2572         * bindings/js/JSWorkerContext.cpp: Removed.
2573         * bindings/js/JSWorkerContext.h: Removed.
2574         * bindings/js/JSWorkerContextBase.cpp: Copied from WebCore/bindings/js/JSWorkerContext.cpp.
2575         (WebCore::JSWorkerContextBase::JSWorkerContextBase):
2576         (WebCore::JSWorkerContextBase::~JSWorkerContextBase):
2577         (WebCore::JSWorkerContextBase::scriptExecutionContext):
2578         (WebCore::getJSWorkerContextBaseTable):
2579         (WebCore::):
2580         (WebCore::JSWorkerContextBase::put):
2581         * bindings/js/JSWorkerContextBase.h: Copied from WebCore/bindings/js/JSWorkerContext.h.
2582         * bindings/js/JSWorkerContextCustom.cpp: Added.
2583         (WebCore::JSWorkerContext::customGetOwnPropertySlot):
2584         (WebCore::JSWorkerContext::mark):
2585         (WebCore::JSWorkerContext::self):
2586         (WebCore::JSWorkerContext::setSelf):
2587         (WebCore::JSWorkerContext::addEventListener):
2588         (WebCore::JSWorkerContext::removeEventListener):
2589         Moved code around. Note that currently, JSWorkerContextBase lookup table is empty, but we'll
2590         need to add some global objects to it in the future, as it is done in JSDOMWindowBase.
2591
2592         * page/WorkerNavigator.cpp:
2593         * page/WorkerNavigator.h:
2594         Added ENABLE(WORKERS) ifdefs.
2595
2596 2008-12-13  Darin Adler  <darin@apple.com>
2597
2598         - fix Release build
2599
2600         * dom/Node.cpp:
2601         (WebCore::Node::rareData): Remove inappropriate inline directive.
2602
2603 2008-12-13  Darin Adler  <darin@apple.com>
2604
2605         Reviewed by Dan Bernstein.
2606
2607         - fix https://bugs.webkit.org/show_bug.cgi?id=18734
2608           REGRESSION (r31081): Focus problems in Gmail 2/Plain text message text
2609           <rdar://problem/5892415>
2610
2611         Test: fast/forms/textarea-selection-preservation.html
2612
2613         The regression reported was caused by the fact that the renderer code had
2614         a bug where it would constantly think the newline at the end of text was
2615         missing, and so it would replace all the text even though it wasn't changing,
2616         which would destroy the selection.
2617
2618         When writing the regression test I discovered another problem: The value
2619         property in HTMLTextAreaElement was intentionally changing the selection
2620         to the end of the textarea, but doing that even when the value wasn't changing.
2621
2622         This patch fixes both and the test checks both.
2623
2624         * html/HTMLTextAreaElement.cpp:
2625         (WebCore::HTMLTextAreaElement::setValue): Exit early if the value is
2626         not changing.
2627
2628         * rendering/RenderTextControl.cpp:
2629         (WebCore::RenderTextControl::text): Add a newline character for each <br>
2630         element encountered in the control
2631
2632 2008-12-13  Darin Adler  <darin@apple.com>
2633
2634         - file deletion part of https://bugs.webkit.org/show_bug.cgi?id=17497
2635           eliminate DeprecatedValueList
2636
2637         * GNUmakefile.am: Removed references to deleted files.
2638         * WebCore.pro: Ditto.
2639         * WebCore.scons: Ditto.
2640         * WebCore.vcproj/WebCore.vcproj: Ditto.
2641         * WebCore.xcodeproj/project.pbxproj: Ditto.
2642         * WebCoreSources.bkl: Ditto.
2643
2644         * platform/DeprecatedPtrQueue.h: Removed.
2645         * platform/DeprecatedValueList.h: Removed.
2646         * platform/DeprecatedValueListImpl.cpp: Removed.
2647         * platform/DeprecatedValueListImpl.h: Removed.
2648
2649 2008-12-13  Darin Adler  <darin@apple.com>
2650
2651         Reviewed by Anders Carlsson.
2652
2653         - https://bugs.webkit.org/show_bug.cgi?id=17497
2654           eliminate DeprecatedValueList
2655
2656         * css/CSSStyleDeclaration.cpp: Removed unneeded include.
2657
2658         * dom/Document.cpp:
2659         (WebCore::Document::removeAllEventListenersFromAllNodes):
2660         Set the removed flag on the window event listeners in case we
2661         are in the middle of dispatching events on this window.
2662         (WebCore::Document::clear): Ditto.
2663         (WebCore::Document::handleWindowEvent): Changed to use a vector
2664         instead of a DeprecatedPtrList.
2665         (WebCore::Document::windowInlineEventListenerForType): Ditto.
2666         (WebCore::Document::removeWindowInlineEventListenerForType): Ditto.
2667         Also added a call to setRemoved, which is needed here just as in
2668         other functions that remove.
2669         (WebCore::Document::removeWindowEventListener): Ditto.
2670         (WebCore::Document::hasWindowEventListener): Ditto.
2671
2672         * dom/Document.h: Changed RegisteredEventListenerList to
2673         RegisteredEventListeners.
2674
2675         * dom/Element.cpp:
2676         (WebCore::Element::attach): Use a function to access rare data instead
2677         of getting directly at the data field.
2678         (WebCore::Element::focus): Ditto.
2679         (WebCore::Element::cancelFocusAppearanceUpdate): Ditto.
2680
2681         * dom/ElementRareData.h: Use "using" to make things that are protected
2682         in NodeRareData be public here.
2683
2684         * dom/EventTarget.h: Removed include of DeprecatedValueList and
2685         related declearations that weren't needed. Tweaked the definitions
2686         of the forbidEventDispatch functions too.
2687
2688         * dom/EventTargetNode.cpp:
2689         (WebCore::EventTargetNode::EventTargetNode): Eliminated code that
2690         was used to initialized m_regdListeners.
2691         (WebCore::EventTargetNode::~EventTargetNode): Elminated delete of
2692         m_regdListeners. Changed code to use eventListeners() instead of
2693         m_regdListeners.
2694         (WebCore::EventTargetNode::eventListeners): Added.
2695         (WebCore::EventTargetNode::insertedIntoDocument): Use eventListeners.
2696         (WebCore::EventTargetNode::removedFromDocument): Ditto.
2697         (WebCore::EventTargetNode::willMoveToNewOwnerDocument): Ditto.
2698         (WebCore::EventTargetNode::didMoveToNewOwnerDocument): Ditto.
2699         (WebCore::EventTargetNode::addEventListener): Ditto.
2700         (WebCore::EventTargetNode::removeEventListener): Ditto.
2701         (WebCore::EventTargetNode::removeAllEventListeners): Ditto.
2702         Also added code to call setRemoved on all the listeners.
2703         (WebCore::EventTargetNode::handleLocalEvents): Ditto.
2704         (WebCore::EventTargetNode::dispatchGenericEvent): Fixed indentation.
2705         (WebCore::EventTargetNode::removeInlineEventListenerForType): Use
2706         the new event listeners vector. Also added missing call to setRemoved.
2707         (WebCore::EventTargetNode::inlineEventListenerForType): Ditto.
2708
2709         * dom/EventTargetNode.h: Added a new RegisteredEventListenerVector
2710         type and replaced the old localEventListeners function with a new
2711         eventListeners function. Removed m_regdListeners.
2712
2713         * dom/Node.cpp:
2714         (WebCore::Node::childNodes): Removed unneeded std prefix.
2715         (WebCore::Node::setFocus): Use function instead of going directly
2716         at rare data.
2717         (WebCore::Node::rareDataFocused): Ditto.
2718         (WebCore::Node::registerDynamicNodeList): Removed unneeded std prefix.
2719         (WebCore::Node::getElementsByName): Ditto.
2720         (WebCore::Node::getElementsByClassName): Ditto.
2721         (WebCore::Node::compareDocumentPosition): Ditto.
2722
2723         * dom/Node.h: Removed unneeded forward declaration of
2724         RegisteredEventListener. This is now in EventTargetNode.
2725
2726         * dom/NodeRareData.h: Renamed m_focused to m_isFocused and made it
2727         private. Made m_needsFocusAppearanceUpdateSoonAfterAttach private.
2728         Added listeners and ensureListeners functions as well as isFocused,
2729         setFocused, and focus-appearance functions. Made all data members private.
2730
2731         * dom/RegisteredEventListener.cpp: Removed operator ==.
2732         * dom/RegisteredEventListener.h: Removed operator == and !=.
2733
2734         * svg/SVGElement.cpp:
2735         (WebCore::hasLoadListener): Rewrote to work with the vector.
2736         * svg/SVGUseElement.cpp:
2737         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Ditto.
2738
2739 2008-12-13  Holger Hans Peter Freyther  <zecke@selfish.org>
2740
2741         Reviewed by Dan Bernstein.
2742
2743         https://bugs.webkit.org/show_bug.cgi?id=22824
2744
2745         Change ENABLE(FONT_FAST_PATH) to USE(FONT_FAST_PATH). With r39206
2746         floatWidth always used the complex path causing a regression
2747         in the pixel tests.
2748
2749         * platform/graphics/Font.cpp:
2750         (WebCore::Font::floatWidth): Use the fast path again
2751
2752 2008-12-13  Dirk Schulze  <krit@webkit.org>
2753
2754         Reviewed by Darin Adler.
2755
2756         Fixes behavior of gradients on empty path in canvas/Cg
2757
2758         https://bugs.webkit.org/show_bug.cgi?id=22844
2759         [Cg] Canvas fill() draws gradients even without a path
2760
2761         Test: fast/canvas/canvas-gradient-without-path.html
2762
2763         * html/CanvasRenderingContext2D.cpp:
2764         (WebCore::CanvasRenderingContext2D::fill):
2765         (WebCore::CanvasRenderingContext2D::stroke):
2766
2767 2008-12-13  Kevin Ollivier  <kevino@theolliviers.com>
2768
2769         wx build fix.
2770
2771         * platform/graphics/wx/ImageSourceWx.cpp:
2772         (WebCore::ImageSource::filenameExtension):
2773
2774 2008-12-12  Brent Fulgham  <bfulgham@gmail.com>
2775
2776         Reviewed by Oliver Hunt.
2777
2778         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22805
2779
2780         Provides implementation of image dragging logic for Windows Cairo
2781         back-end.
2782
2783         * platform/win/DragImageCGWin.cpp:
2784         (WebCore::deallocContext): Add a generic CGContextRef destructor.
2785         * platform/win/DragImageCairoWin.cpp:
2786         (WebCore::deallocContext): Add a generic cairo_* destructor. 
2787         (WebCore::allocImage):  New implementation to allocate a Cairo
2788         surface of a specified size.
2789         (WebCore::createCairoContextFromBitmap): New implementation to
2790         create a Cairo surface from a Windows BITMAP.
2791         (WebCore::scaleDragImage): Replace stub with implementation to
2792         actually create a scaled image.
2793         (WebCore::createDragImageFromImage): Replace stub with implementation
2794         to actually create an image.
2795
2796 2008-12-12  Dean Jackson  <dino@apple.com>
2797
2798         Reviewed by Darin Adler.
2799
2800         Expose WebKitAnimationEvent, WebKitTransitionEvent,
2801         WebKitCSSTransformValue, WebKitCSSKeyframeRule and
2802         WebKitCSSKeyframesRule to Window object.
2803         This required generating constructors for the event
2804         interfaces.
2805         
2806         https://bugs.webkit.org/show_bug.cgi?id=20560
2807
2808         * dom/WebKitAnimationEvent.idl:
2809         * dom/WebKitTransitionEvent.idl:
2810         * page/DOMWindow.idl:
2811
2812 2008-12-12  Dave Moore  <davemoore@google.com>
2813
2814         Reviewed by Eric Seidel.
2815
2816         Fixed https://bugs.webkit.org/show_bug.cgi?id=22798
2817
2818         In Font::drawTextUsingSVGFont() a variable of type SVGTextRunWalkerDrawTextData
2819         is created on the stack (called data). One of its fields, charsConsumed, is
2820         unitialized, leading to random values after calling walk() on the
2821         SVGTextRunWalker created with it. I now initialize the variable
2822
2823         This bug was revealed in our Purify run. I don't know of any specific incorrect
2824         behavior caused by it but it would lead to the charsConsumed field having a
2825         a wrong value.
2826
2827         * svg/SVGFont.cpp:
2828         (WebCore::Font::drawTextUsingSVGFont):
2829
2830 2008-12-12  Beth Dakin  <bdakin@apple.com>
2831
2832         Rubber Stamped by Steve Falkenburg.
2833
2834         Build fix.
2835
2836         * platform/KURL.h:
2837
2838 2008-12-12  Brett Wilson  <brettw@chromium.org>
2839
2840         Reviewed by Darin Adler.
2841
2842         Add the ability so that Google-URL can optionally be used in a build
2843         of WebKit without changing the shared header. The guts of KURL are
2844         optionally ifdefed out, and the replacement code goes in a different
2845         header to avoid polluting KURL.h
2846
2847         * platform/KURL.cpp:
2848         * platform/KURL.h:
2849         (WebCore::KURL::string):
2850         (WebCore::KURL::operator const String&):
2851         (WebCore::KURL::operator JSC::UString):
2852         (WebCore::KURL::operator NSString*):
2853         (WebCore::KURL::parsed):
2854         (WebCore::KURL::utf8String):
2855         (WebCore::KURL::isNull):
2856         (WebCore::KURL::isEmpty):
2857         (WebCore::KURL::isValid):
2858         (WebCore::KURL::hostStart):
2859         (WebCore::KURL::hostEnd):
2860         (WebCore::KURL::pathStart):
2861         (WebCore::KURL::pathEnd):
2862         (WebCore::KURL::pathAfterLastSlash):
2863
2864 2008-12-11  Steve Falkenburg  <sfalken@apple.com>
2865
2866         Delete the previous timer-queue timer in the main thread, just prior to scheduling a new timer.
2867         The code previously called DeleteTimerQueueTimer in the timer callback proc.
2868         
2869         The new technique simplifies the code, since we now create and delete timers on the
2870         same thread, and don't access the timer queue or timer handles in the callback.
2871         This allows us to remove some mutex use, and more importantly, it solves a race
2872         condition that was occuring between ChangeTimerQueueTimer and DeleteTimerQueueTimer.
2873         
2874         Since the timer callback isn't passed the timer handle, we were retrieving that handle
2875         via a global. If the timer callback code was entered, but then a new timer was immediately
2876         scheduled (prior to the callback acquiring the mutex and calling DeleteTimerQueueTimer),
2877         there was a small window where the timer could be re-scheduled via ChangeTimerQueueTimer
2878         and then immediately deleted once the already running callback acquired the mutex and
2879         then called DeleteTimerQueueTimer. This resulted in the newly scheduled timer never firing.
2880         
2881         Reviewed by Oliver Hunt.
2882
2883         * platform/win/SharedTimerWin.cpp:
2884         (WebCore::queueTimerProc): Don't delete the timer in the callback.
2885         (WebCore::setSharedTimerFireTime): Always delete and create the timer instead of using ChangeTimerQueueTimer.
2886         (WebCore::stopSharedTimer): Call DeleteTimerQueueTimer directly.
2887
2888 2008-12-12  Kai Brüning  <kai@granus.net>
2889
2890         Reviewed and tweaked by Darin Adler.
2891
2892         - fix https://bugs.webkit.org/show_bug.cgi?id=18205
2893           DOMNode objects are garbage collected although there are strong references
2894           <rdar://problem/6441200>
2895
2896         Fixes resurrection bug for wrapper objects by using an NSMapTable with zeroing weak
2897         memory for the wrapper reference for DOMWrapperCache (DOMInternal.mm),
2898         JSWrapperCache (WebScriptObject.mm) and wrapperCache (DOMRGBColor.mm).
2899         BUILDING_ON_TIGER is used to create a Leopard-only NSMapTable or an old-style
2900         procedural map table for Tiger systems.
2901
2902         No regression tests yet since we don't currently run any tests in GC mode.
2903
2904         * bindings/objc/DOMInternal.h: added WebCore::createWrapperCache for use by all three caches
2905         * bindings/objc/DOMInternal.mm:
2906         (WebCore::createWrapperCache): Contains the compile-time check for map table creation
2907         (WebCore::getDOMWrapper): HashMap -> NSMapTable
2908         (WebCore::addDOMWrapper): ditto
2909         (WebCore::removeDOMWrapper): ditto
2910         * bindings/objc/DOMObject.mm: removed [DOMObject finalize]
2911         * bindings/objc/DOMRGBColor.mm: removed [DOMRGBColor finalize]
2912         (WebCore::getWrapperForRGB): CFMutableDictionaryRef -> NSMapTable
2913         (WebCore::setWrapperForRGB): ditto
2914         (WebCore::removeWrapperForRGB): ditto
2915         * bindings/objc/WebScriptObject.mm:
2916         (WebCore::getJSWrapper): HashMap -> NSMapTable
2917         (WebCore::addJSWrapper): ditto
2918         (WebCore::removeJSWrapper): ditto
2919         (-[WebScriptObject finalize]): removed call of removeJSWrapper()
2920
2921 2008-12-12  Dimitri Glazkov  <dglazkov@chromium.org>
2922
2923         Reviewed by Alexey Proskuryakov.
2924
2925         https://bugs.webkit.org/show_bug.cgi?id=22813
2926         Remove unused references to JSDOMBinding, CallFrame, and JSLock.
2927
2928         * dom/Node.cpp: Removed CallFrame and JSLock header includes.
2929         * loader/FrameLoader.cpp: Removed JSDOMBinding header include.
2930
2931 2008-12-12  Holger Hans Peter Freyther  <zecke@selfish.org>
2932
2933         Reviewed by Simon Hausmann.
2934
2935         Update the WebKit.qrc and add a script to automatically generate the file.
2936
2937         With the way rcc and qmake work this can not be done at build time
2938         as the WebKit.qrc must sit inside the directory that contains the files
2939         and at build time we may not change the content of the source directory.
2940
2941         * inspector/front-end/WebKit.qrc: Updated with new script
2942
2943 2008-12-12  Oliver Hunt  <oliver@apple.com>
2944
2945         Reviewed by Alexey Proskuryakov.
2946
2947         REGRESSION: Canvas is broken in high dpi mode
2948         <rdar://problem/6432739> <https://bugs.webkit.org/show_bug.cgi?id=22823>
2949
2950         Simply made sure that we correctly scale the graphics context to
2951         account for the difference between logical and buffer resolution.
2952
2953         * html/HTMLCanvasElement.cpp:
2954         (WebCore::HTMLCanvasElement::createImageBuffer):
2955         (WebCore::HTMLCanvasElement::baseTransform):
2956
2957 2008-12-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
2958
2959         Rubber-stamped by Oliver Hunt.
2960
2961         Share PluginView::paintMissingPluginIcon() between ports
2962
2963         Also, enable this feature for Qt/X11, Qt/Mac and GTK
2964
2965         * plugins/PluginView.cpp:
2966         (WebCore::PluginView::paintMissingPluginIcon):
2967         * plugins/gtk/PluginViewGtk.cpp:
2968         (WebCore::PluginView::paint):
2969         * plugins/mac/PluginViewMac.cpp:
2970         (WebCore::PluginView::paint):
2971         * plugins/qt/PluginViewQt.cpp:
2972         (WebCore::PluginView::paint):
2973         * plugins/win/PluginViewWin.cpp:
2974
2975 2008-12-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
2976
2977         Reviewed by Simon Hausmann.
2978
2979         [Qt/Mac] Implement PluginView::updatePluginWidget()
2980
2981         We should update the window and clip rect regardless of whether or
2982         not the plugin has been loaded, for example to ensure that the
2983         missing plugin image is placed correctly.
2984
2985         * plugins/mac/PluginViewMac.cpp:
2986         (WebCore::PluginView::setNPWindowIfNeeded):
2987         (WebCore::PluginView::updatePluginWidget):
2988
2989 2008-12-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
2990
2991         Rubber-stamped by Oliver Hunt.
2992
2993         Make PluginView::updatePluginWidget() non-const
2994
2995         We can do this now since frameRectsChanged() is no longer const. This
2996         also allows us to get rid of the mutables in the PluginView.
2997
2998         * platform/qt/TemporaryLinkStubs.cpp:
2999         (PluginView::updatePluginWidget):
3000         * plugins/PluginView.h:
3001         * plugins/gtk/PluginViewGtk.cpp:
3002         (WebCore::PluginView::updatePluginWidget):
3003         * plugins/mac/PluginViewMac.cpp:
3004         (WebCore::PluginView::updatePluginWidget):
3005         * plugins/qt/PluginViewQt.cpp:
3006         (WebCore::PluginView::updatePluginWidget):
3007         * plugins/win/PluginViewWin.cpp:
3008         (WebCore::PluginView::updatePluginWidget):
3009         * plugins/wx/PluginViewWx.cpp:
3010         (WebCore::PluginView::updatePluginWidget):
3011
3012 2008-12-12  Tor Arne Vestbø  <tavestbo@trolltech.com>
3013
3014         Reviewed by Simon Hausmann.
3015
3016         Implement ImageSource::filenameExtension() for the Qt port
3017         
3018         We're using QImageReader::imageFormat().toLower() to check
3019         that the image format is supported, and if it is we store
3020         the resulting extension when creating the ImageDecoderQt.
3021
3022         * platform/graphics/qt/ImageDecoderQt.cpp:
3023         (WebCore::ImageDecoderQt::create):
3024         (WebCore::ImageDecoderQt::ImageDecoderQt):
3025         (WebCore::ImageDecoderQt::imageFormat):
3026         * platform/graphics/qt/ImageDecoderQt.h:
3027         * platform/graphics/qt/ImageSourceQt.cpp:
3028         (WebCore::ImageSource::setData):
3029         (WebCore::ImageSource::filenameExtension):
3030
3031 2008-12-11  Stephanie Lewis  <slewis@apple.com>
3032
3033         Reviewed by Geoff Garen
3034
3035         Account for the size of the response and request headers as well as other overhead
3036         when calculating the size a resource takes up in the cache.  Halts unbounded 
3037         growth in the cache.  Reduced stress test memory high water marks by > 50%.
3038
3039         Uses estimates gathered from the stress test to set the overhead size.  
3040         A version of the patch was created that calculated most of the sizes, but it was 
3041         decided that the patch was still at a basic level an estimate.  What gains it made
3042         in accuracy was offset by the complexity involved in creating and updating the
3043         estimate.
3044
3045         * loader/Cache.cpp:
3046         (WebCore::Cache::resourceAccessed):
3047         (WebCore::Cache::TypeStatistic::addResource):
3048         (WebCore::Cache::dumpLRULists):
3049         * loader/CachedResource.cpp:
3050         (WebCore::CachedResource::overheadSize):
3051         * loader/CachedResource.h:
3052         (WebCore::CachedResource::size):
3053
3054 2008-12-11  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
3055
3056         Reviewed by Holger Freyther.
3057
3058         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22814
3059
3060         Add <wml> image element support. Based on HTML/SVGImage{Element/Loader}, with
3061         the only difference that WML defines a second source attribute 'localsrc', that
3062         takes precedence over the 'src' attribute. If loading the 'localsrc' attribute
3063         fails, the user agent should try loading the 'src' attribute. If both fail the
3064         'alt' fallback content will be used - just like in HTML.
3065
3066         Fixes: fast/wml/img-localsrc.wml (<img> and 'localsrc' attribute)
3067                fast/wml/img-src-localsrc-alt.wml ('localsrc'/'src' fallback handling)
3068                fast/wml/img-src.wml (<img> and 'src' attribute)
3069
3070         * GNUmakefile.am:
3071         * WebCore.vcproj/WebCore.vcproj:
3072         * WebCore.xcodeproj/project.pbxproj:
3073         * rendering/HitTestResult.cpp:
3074         (WebCore::HitTestResult::altDisplayString):
3075         (WebCore::HitTestResult::absoluteImageURL):
3076         * rendering/RenderImage.cpp:
3077         (WebCore::RenderImage::updateAltText):
3078         * wml/WMLImageElement.cpp: Added.
3079         (WebCore::WMLImageElement::WMLImageElement):
3080         (WebCore::WMLImageElement::~WMLImageElement):
3081         (WebCore::WMLImageElement::mapToEntry):
3082         (WebCore::WMLImageElement::parseMappedAttribute):
3083         (WebCore::WMLImageElement::attach):
3084         (WebCore::WMLImageElement::createRenderer):
3085         (WebCore::WMLImageElement::insertedIntoDocument):
3086         (WebCore::WMLImageElement::isURLAttribute):
3087         (WebCore::WMLImageElement::imageSourceAttributeName):
3088         (WebCore::WMLImageElement::altText):
3089         * wml/WMLImageElement.h: Added.
3090         (WebCore::WMLImageElement::useFallbackAttribute):
3091         (WebCore::WMLImageElement::setUseFallbackAttribute):
3092         * wml/WMLImageLoader.cpp: Added.
3093         (WebCore::WMLImageLoader::WMLImageLoader):
3094         (WebCore::WMLImageLoader::~WMLImageLoader):
3095         (WebCore::WMLImageLoader::dispatchLoadEvent):
3096         (WebCore::WMLImageLoader::sourceURI):
3097         (WebCore::WMLImageLoader::notifyFinished):
3098         * wml/WMLImageLoader.h: Added.
3099         * wml/WMLTagNames.in:
3100
3101 2008-12-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3102
3103         Reviewed by Darin Adler.
3104
3105         https://bugs.webkit.org/show_bug.cgi?id=22043
3106
3107         Do not run into the WebCore::DocumentLoader::updateLoading
3108         ASSERT on Gtk+/CURL when trying to load tests from our LayoutTests.
3109
3110         Do not call setPrimaryLoadComplete when the
3111         activeDocumentLoader has already been replaced. This can happen
3112         when a script executed from within FramerLoader::didFinishLoading will
3113         navigate to another URL.
3114
3115         The assertion is caused by existing tests (e.g.
3116         fast/history/clicked-link-is-visited.html) reproducing this with
3117         network backends not equal to curl is tough or maybe not
3118         even possible.
3119
3120         * loader/DocumentLoader.cpp:
3121         (WebCore::DocumentLoader::setPrimaryLoadComplete):
3122
3123 2008-12-11  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
3124
3125         Reviewed by Eric Seidel.
3126
3127         - Remove some dead, commented-out code from WMLAElement.
3128         - Add missing virtual destructor for <noop>, as suggested by Alexey.
3129         - Refactor addHTMLAlignment in a static helper function to share with WML.
3130
3131         * html/HTMLElement.cpp:
3132         (WebCore::HTMLElement::addHTMLAlignment):
3133         (WebCore::HTMLElement::addHTMLAlignmentToStyledElement):
3134         * html/HTMLElement.h:
3135         * wml/WMLAElement.cpp:
3136         (WebCore::WMLAElement::defaultEventHandler):
3137         * wml/WMLNoopElement.cpp:
3138         (WebCore::WMLNoopElement::~WMLNoopElement):
3139         * wml/WMLNoopElement.h:
3140
3141 2008-12-10  Oliver Hunt  <oliver@apple.com>
3142
3143         Reviewed by Adele Peterson.
3144
3145         <rdar://problem/6302405> Crash (null-deref) when using :before pseudoselector with content CSS rule in SVG
3146         <https://bugs.webkit.org/show_bug.cgi?id=22804>
3147
3148         This issue was caused by css generated content resulting in non-svg flowboxes
3149         being injected into SVG content.  As SVG spec does not describe behaviour in
3150         this case, and neither Opera nor Firefox displays such generated content, so
3151         now we make svg text layout and rendering just ignore any such content.
3152
3153         Test: svg/css/crash-css-generated-content.xhtml
3154
3155         * rendering/SVGRootInlineBox.cpp:
3156         (WebCore::SVGRootInlineBox::buildLayoutInformation):
3157         (WebCore::SVGRootInlineBox::layoutInlineBoxes):
3158         (WebCore::SVGRootInlineBox::buildTextChunks):
3159
3160 2008-12-11  Cameron Zwarich  <zwarich@apple.com>
3161
3162         Reviewed by Dave Hyatt.
3163
3164         Bug 21256: REGRESSION (r36906): horizontally repeating image leaves ghosts when vertical scrolling
3165         <https://bugs.webkit.org/show_bug.cgi?id=21256>
3166         <rdar://problem/6362978>
3167
3168         The ScrollView refactoring in r36906 caused the ScrollView and the
3169         platform widget to disagree about whether optimizing scrolling via
3170         blitting is allowed. The easiest way to fix this is to make ScrollView
3171         simply ask the platform widget whether this is safe on platforms that
3172         are affected.
3173
3174         It is not possible to write a layout test for this bug because it
3175         involves the back/forward cache.
3176
3177         * platform/ScrollView.cpp:
3178         (WebCore::ScrollView::ScrollView):
3179         (WebCore::ScrollView::setCanBlitOnScroll):
3180         (WebCore::ScrollView::canBlitOnScroll):
3181         (WebCore::ScrollView::platformSetCanBlitOnScroll):
3182         (WebCore::ScrollView::platformCanBlitOnScroll):
3183         * platform/ScrollView.h:
3184         * platform/mac/ScrollViewMac.mm:
3185         (WebCore::ScrollView::platformSetCanBlitOnScroll):
3186         (WebCore::ScrollView::platformCanBlitOnScroll):
3187         * platform/wx/ScrollViewWx.cpp:
3188         (WebCore::ScrollView::platformSetCanBlitOnScroll):
3189         (WebCore::ScrollView::platformCanBlitOnScroll):
3190
3191 2008-12-11  Brent Fulgham  <bfulgham@gmail.com>
3192
3193         Reviewed by Adam Roben.
3194
3195         https://bugs.webkit.org/show_bug.cgi?id=22808
3196
3197         Correct build break due to malformed XML in Visual Studio project
3198         following @r39205 change.
3199
3200         * WebCore.vcproj/WebCore.vcproj: Correct file entry so project loads.
3201
3202 2008-12-10  Chris Marrin  <cmarrin@apple.com>
3203
3204         Reviewed by Dave Hyatt.
3205
3206         Fixed https://bugs.webkit.org/show_bug.cgi?id=22738
3207
3208         This gets rid of the per-animation timers which were used when an animation
3209         started, ended and looped. Their job is now done by the main AnimationController's
3210         timer. It is now set to fire as needed. For instance, if there is a delay, it will
3211         fire after the delay time and then every 30ms to run the animation. The start, loop
3212         and end events are generated as needed during the firing of this timer.
3213
3214         I had to add one more bit of code. When animation timers used to fire the animation events.
3215         This would always happen from the RunLoop, so any style changes that happened in the
3216         event handler would get picked up on the next updateRendering() call. But now the start
3217         event is generated during the styleIsAvailable() call, which is in the middle of the 
3218         updateRendering() cycle. And calling an event handler in the middle of updateRendering()
3219         is not allowed and causes style changes to get missed. We already have a mechanism in
3220         AnimationController to defer updateRendering() calls. So I added logic to defer all
3221         event handling to there. Now, I put any request for event handling into a list and ask
3222         for a deferred updateRendering() call. When that deferred timer fires, I go through that
3223         list, send all the events and then call updateRendering().
3224
3225         * page/animation/AnimationBase.cpp:
3226         (WebCore::AnimationBase::AnimationBase):
3227         (WebCore::AnimationBase::updateStateMachine):
3228         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
3229         (WebCore::AnimationBase::willNeedService):
3230         (WebCore::AnimationBase::goIntoEndingOrLoopingState):
3231         * page/animation/AnimationBase.h:
3232         * page/animation/AnimationController.cpp:
3233         (WebCore::AnimationControllerPrivate::updateAnimationTimer):
3234         (WebCore::AnimationControllerPrivate::updateRenderingDispatcherFired):
3235         (WebCore::AnimationControllerPrivate::addEventToDispatch):
3236         (WebCore::AnimationControllerPrivate::animationTimerFired):
3237         (WebCore::AnimationController::addEventToDispatch):
3238         * page/animation/AnimationController.h:
3239         * page/animation/CompositeAnimation.cpp:
3240         (WebCore::CompositeAnimationPrivate::updateTransitions):
3241         (WebCore::CompositeAnimationPrivate::willNeedService):
3242         (WebCore::CompositeAnimationPrivate::getAnimationForProperty):
3243         (WebCore::CompositeAnimation::willNeedService):
3244         (WebCore::CompositeAnimation::getAnimationForProperty):
3245         * page/animation/CompositeAnimation.h:
3246         * page/animation/ImplicitAnimation.cpp:
3247         (WebCore::ImplicitAnimation::animate):
3248         (WebCore::ImplicitAnimation::onAnimationEnd):
3249         (WebCore::ImplicitAnimation::sendTransitionEvent):
3250         * page/animation/ImplicitAnimation.h:
3251         * page/animation/KeyframeAnimation.cpp:
3252         (WebCore::KeyframeAnimation::animate):
3253         (WebCore::KeyframeAnimation::sendAnimationEvent):
3254         * page/animation/KeyframeAnimation.h:
3255         (WebCore::KeyframeAnimation::setUnanimatedStyle):
3256
3257 2008-12-11  Simon Hausmann  <simon.hausmann@nokia.com>
3258
3259         Fix the Qt build with an empty filenameExtension() implementation.
3260
3261         * platform/graphics/qt/ImageSourceQt.cpp:
3262         (WebCore::ImageSource::filenameExtension):
3263
3264 2008-12-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3265
3266         Reviewed by Simon Hausmann.
3267
3268         Fix crash in the cairo implementation of the SVGPaintServer
3269
3270         For SVGFonts the RenderObject can be zero. The existing SVGFont
3271         test cases is exposing this bug. Qt and other ports have fixed
3272         this issue by adding null checks as well.
3273
3274         * svg/graphics/cairo/SVGPaintServerCairo.cpp:
3275         (WebCore::SVGPaintServer::renderPath):
3276
3277 2008-12-11  Holger Freyther  <zecke@selfish.org>
3278
3279         Reviewed by Simon Hausmann.
3280
3281         https://bugs.webkit.org/show_bug.cgi?id=20953
3282
3283         Make the Qt port follow the Win, Mac, Gtk+ port in regard to Font
3284         handling. FontQt.cpp from now on is only implementing the complex path. Create
3285         FontFallbackListQt.cpp and FontPlatformDataQt.cpp to work within
3286         the framework set by the Font code.
3287
3288         Sharing the Font.cpp implementation allows the Qt port to support
3289         the CSS font faces and SVG fonts.
3290
3291         Split out the Qt4.3 Font handling into FonQt43.cpp to allow to more
3292         easily deprecate it.
3293
3294         This commit is removing a lot of #ifdefs from Font.h as the Qt Font
3295         implementation is now in line with the rest of WebCore.
3296
3297         * WebCore.pro:
3298         * platform/graphics/Font.h: Remove #ifdefs
3299         (WebCore::Font::letterSpacing):
3300         (WebCore::Font::setLetterSpacing):
3301         (WebCore::Font::isPlatformFont):
3302         * platform/graphics/FontFallbackList.h:
3303         * platform/graphics/SimpleFontData.cpp:
3304         (WebCore::SimpleFontData::SimpleFontData):
3305         (WebCore::SimpleFontData::platformGlyphInit): There is no GlyphCache
3306         on Qt, move the initialisation over.
3307         (WebCore::SimpleFontData::~SimpleFontData):
3308         * platform/graphics/SimpleFontData.h:
3309         (WebCore::SimpleFontData::getQtFont):
3310         * platform/graphics/qt/FontCacheQt.cpp:
3311         (WebCore::FontCache::getCachedFontPlatformData): Remove unused parameter
3312         (WebCore::FontCache::releaseFontData): Add to build
3313         * platform/graphics/qt/FontCustomPlatformData.cpp:
3314         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
3315         (WebCore::FontCustomPlatformData::fontPlatformData):
3316         (WebCore::createFontCustomPlatformData):
3317         * platform/graphics/qt/FontCustomPlatformData.h:
3318         * platform/graphics/qt/FontFallbackListQt.cpp: Added.
3319         (WebCore::FontFallbackList::FontFallbackList):
3320         (WebCore::FontFallbackList::invalidate):
3321         (WebCore::FontFallbackList::releaseFontData):
3322         (WebCore::FontFallbackList::determinePitch):
3323         (WebCore::FontFallbackList::fontDataAt):
3324         (WebCore::FontFallbackList::fontDataForCharacters):
3325         (WebCore::FontFallbackList::setPlatformFont):
3326         * platform/graphics/qt/FontPlatformData.h:
3327         (WebCore::FontPlatformData::font):
3328         (WebCore::FontPlatformData::size):
3329         * platform/graphics/qt/FontPlatformDataQt.cpp: Added.
3330         (WebCore::FontPlatformData::FontPlatformData):
3331         * platform/graphics/qt/FontQt.cpp:
3332         (WebCore::Font::drawComplexText):
3333         (WebCore::Font::floatWidthForComplexText):
3334         (WebCore::Font::offsetForPositionForComplexText):
3335         (WebCore::Font::selectionRectForComplexText):
3336         (WebCore::Font::font):
3337         * platform/graphics/qt/FontQt43.cpp: Added. Moved Qt4.3 code from FontQt.cpp
3338         (WebCore::Font::drawComplexText):
3339         (WebCore::Font::floatWidthForComplexText):
3340         (WebCore::Font::offsetForPositionForComplexText):
3341         (WebCore::Font::selectionRectForComplexText):
3342         * platform/graphics/qt/GlyphPageTreeNodeQt.cpp:
3343         (WebCore::GlyphPageTreeNode::pruneTreeCustomFontData):
3344         (WebCore::GlyphPageTreeNode::pruneTreeFontData):
3345         * platform/graphics/qt/SimpleFontDataQt.cpp:
3346         (WebCore::SimpleFontData::determinePitch):
3347         (WebCore::SimpleFontData::containsCharacters):
3348         (WebCore::SimpleFontData::platformInit):
3349         (WebCore::SimpleFontData::platformGlyphInit):
3350         (WebCore::SimpleFontData::platformDestroy):
3351         * platform/qt/RenderThemeQt.cpp:
3352         (WebCore::RenderThemeQt::adjustButtonStyle): Avoid crashes.
3353
3354 2008-12-11  Holger Freyther  <zecke@selfish.org>
3355
3356         Reviewed by Simon Hausmann.
3357
3358         https://bugs.webkit.org/show_bug.cgi?id=20953
3359
3360         For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
3361         implementation. This is one of the reasons why the Qt port is currently not
3362         using WebCore/platform/graphics/Font.cpp. By allowing to not use
3363         the simple/fast-path the Qt port will be able to use it.
3364
3365         Introduce USE(FONT_FAST_PATH) and define it for every port but the
3366         Qt one.
3367
3368         * platform/graphics/Font.cpp:
3369         (WebCore::Font::drawText):
3370         (WebCore::Font::floatWidth):
3371         (WebCore::Font::selectionRectForText):
3372         (WebCore::Font::offsetForPosition):
3373         * platform/graphics/Font.h:
3374
3375 2008-12-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3376
3377         Reviewed by Darin Adler.
3378
3379         https://bugs.webkit.org/show_bug.cgi?id=20953
3380
3381         Split out the font fast path from Fast.cpp into FontFastPath.cpp. This
3382         will allow the Qt port to share most of WebCore::Font
3383         implementation but the fast path. Qt does not provide the API to get
3384         individual Glyphs making the fast path hard to support.
3385
3386
3387         * GNUmakefile.am:
3388         * WebCore.vcproj/WebCore.vcproj:
3389         * WebCore.xcodeproj/project.pbxproj:
3390         * WebCoreSources.bkl:
3391         * platform/graphics/Font.cpp:
3392         * platform/graphics/FontFastPath.cpp: Added.
3393         (WebCore::Font::glyphDataForCharacter):
3394
3395 2008-12-11  Robert Carr  <racarr@svn.gnome.org>
3396
3397         Reviewed by Holger Freyther.
3398
3399         https://bugs.webkit.org/show_bug.cgi?id=22560
3400
3401         Code in PlatformScreenGtk for screenDepth and screenRect can not
3402         assume that the platformWindow for the widget has a valid "window"
3403         member. For example in the case of, a new browser view opening as a
3404         child of a GtkNotebook, but never being switched to, or manually
3405         realized. Solve by using the toplevel window of the widget, rather
3406         than the widget itself.
3407
3408         * platform/gtk/PlatformScreenGtk.cpp:
3409         (WebCore::screenDepth):
3410         (WebCore::screenRect):
3411
3412 2008-12-08  Tor Arne Vestbø  <tavestbo@trolltech.com>
3413
3414         Reviewed by Darin Adler and Holger Freyther.
3415
3416         Make Widget::frameRectsChanged() and overrides non-const
3417
3418         This will hopefully allow us to get rid of some of the mutables in
3419         the classes that react to the callback by changing their own state.
3420
3421         * platform/ScrollView.cpp:
3422         (WebCore::ScrollView::frameRectsChanged):
3423         * platform/ScrollView.h:
3424         * platform/Widget.h:
3425         (WebCore::Widget::frameRectsChanged):
3426         * platform/gtk/ScrollbarGtk.cpp: Remove non-const version since
3427         this was more complex and did the same thing, changed const of
3428         the leftover frameRectsChanged() method.
3429         (ScrollbarGtk::frameRectsChanged):
3430         * platform/gtk/ScrollbarGtk.h:
3431         * plugins/PluginView.cpp:
3432         (WebCore::PluginView::frameRectsChanged):
3433         * plugins/PluginView.h:
3434
3435 2008-12-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3436
3437         Reviewed and implemented with Tor Arne Vestbø.
3438
3439         Reimplement RenderTheme::caretBlinkInterval for Qt.
3440
3441         The QApplication::cursorFlashTime is in milliseconds and describes
3442         the whole cycle while WebCore expects half a cycle.
3443
3444         * platform/qt/RenderThemeQt.cpp:
3445         (WebCore::RenderThemeQt::caretBlinkInterval):
3446         * platform/qt/RenderThemeQt.h:
3447
3448 2008-12-09  Trenton Schulz <trenton.schulz@nokia.com>
3449
3450         Reviewed by Tor Arne Vestbø.
3451
3452         [Qt/Mac] Don't call HIGetScaleFactor() if we're not on Tiger or better
3453
3454         * plugins/mac/PluginViewMac.cpp:
3455         (WebCore::tigerOrBetter):
3456         (WebCore::PluginView::globalMousePosForPlugin):
3457
3458 2008-12-10  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
3459
3460         Reviewed by Eric Seidel and George Staikos.
3461
3462         Fixes: https://bugs.webkit.org/show_bug.cgi?id=22799
3463
3464         Add WML <template> support. The <template> element is specified at deck-level
3465         and declares a template for all <card> elements in the document.
3466
3467         * GNUmakefile.am:
3468         * WebCore.vcproj/WebCore.vcproj:
3469         * WebCore.xcodeproj/project.pbxproj:
3470         * editing/htmlediting.cpp:
3471         (WebCore::canHaveChildrenForEditing): Treat <do> just like a <button>.
3472         * wml/WMLCardElement.cpp:
3473         (WebCore::WMLCardElement::WMLCardElement):
3474         (WebCore::WMLCardElement::setTemplateElement):
3475         (WebCore::WMLCardElement::handleIntrinsicEventIfNeeded):
3476         (WebCore::WMLCardElement::handleDeckLevelTaskOverridesIfNeeded):
3477         * wml/WMLCardElement.h:
3478         (WebCore::WMLCardElement::templateElement):
3479         * wml/WMLDoElement.cpp:
3480         (WebCore::WMLDoElement::insertedIntoDocument):
3481         * wml/WMLDocument.cpp:
3482         (WebCore::WMLDocument::finishedParsing):
3483         * wml/WMLErrorHandling.cpp:
3484         (WebCore::errorMessageForErrorCode):
3485         * wml/WMLErrorHandling.h:
3486         (WebCore::):
3487         * wml/WMLEventHandlingElement.cpp:
3488         (WebCore::WMLEventHandlingElement::~WMLEventHandlingElement):
3489         * wml/WMLEventHandlingElement.h:
3490         (WebCore::WMLEventHandlingElement::doElements):
3491         * wml/WMLTagNames.in:
3492         * wml/WMLTemplateElement.cpp: Added.
3493         (WebCore::WMLTemplateElement::WMLTemplateElement):
3494         (WebCore::WMLTemplateElement::~WMLTemplateElement):
3495         (WebCore::WMLTemplateElement::parseMappedAttribute):
3496         (WebCore::WMLTemplateElement::registerTemplatesInDocument):
3497         * wml/WMLTemplateElement.h: Added.
3498         * wml/WMLTimerElement.cpp:
3499         (WebCore::WMLTimerElement::timerFired):
3500
3501 2008-12-09  Dmitry Titov  <dimich@chromium.org>
3502
3503         Reviewed by Darin Adler.
3504
3505         Fix memory leak - need to call stopActiveDOMObjects
3506         when cached pages get destroyed.
3507         https://bugs.webkit.org/show_bug.cgi?id=22753
3508
3509         * dom/Document.cpp:
3510         (WebCore::Document::detach):
3511
3512 2008-12-10  Alice Liu  <alice.liu@apple.com>
3513
3514         Manual test for https://bugs.webkit.org/show_bug.cgi?id=20685
3515
3516         Reviewed by Darin Adler.
3517
3518         * manual-tests/drag-image-to-desktop.html: Added.
3519
3520 2008-12-10  Alice Liu  <alice.liu@apple.com>
3521
3522         fixed https://bugs.webkit.org/show_bug.cgi?id=20685
3523
3524         Reviewed by Darin Adler.
3525
3526         Manual test case is manual-tests/drag-image-to-desktop.html
3527
3528         Added new files to projects
3529         * WebCore.vcproj/WebCore.vcproj:
3530         * WebCore.xcodeproj/project.pbxproj:
3531
3532         * page/DragController.cpp:
3533         (WebCore::DragController::startDrag):
3534         * platform/MIMETypeRegistry.cpp:
3535         (WebCore::initializeSupportedImageMIMETypes):
3536         (WebCore::initializeSupportedImageMIMETypesForEncoding):
3537
3538         These changes add a method to obtain the extension for an image
3539         * platform/graphics/BitmapImage.cpp:
3540         (WebCore::BitmapImage::filenameExtension):
3541         * platform/graphics/BitmapImage.h:
3542         * platform/graphics/Image.h:
3543         (WebCore::Image::filenameExtension):
3544         * platform/graphics/ImageSource.h:
3545         * platform/graphics/cairo/ImageSourceCairo.cpp:
3546         (WebCore::ImageSource::filenameExtension):
3547         * platform/graphics/cg/Imag