2008-03-16 Timothy Hatcher <timothy@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-16  Timothy Hatcher  <timothy@apple.com>
2
3         Reviewed by Darin Adler.
4
5         Bug 17883: Console completion should support bracket notation
6         http://bugs.webkit.org/show_bug.cgi?id=17883
7
8         Also fixes a bug where the Inspector's window object was used instead of the
9         inspected window object.
10
11         * page/inspector/ConsolePanel.js:
12         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
13         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
14         Check the last character of the expression for a dot or bracket. Fallback
15         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
16         If the expression caused an exception, just consider the prefix a window property.
17         When bracket notation is used remember what quote was used and compared property names
18         with that quote surrounding it. Also escape the property name for the quote and backslash.
19
20 2008-03-17  Robert Blaut  <webkit@blaut.biz>
21
22         Reviewed by Darin.
23
24         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
25         Set default margin-bottom for form element in quirk mode
26         and be compatible with Gecko.
27
28         Tests: fast/css/margin-bottom-form-element-quirk.html
29                fast/css/margin-bottom-form-element-strict.html
30
31         * css/html4.css:
32         * css/quirks.css:
33
34 2008-03-17  Antti Koivisto  <antti@apple.com>
35
36         Reviewed by Darin.
37
38         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
39         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
40         
41         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
42         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
43         except in didFail() instead of didFinishLoading().
44
45         * loader/loader.cpp:
46         (WebCore::Loader::Host::didFail):
47
48 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
49
50         Reviewed and tweaked by Darin.
51
52         http://bugs.webkit.org/show_bug.cgi?id=17172
53         Refactor platform checks in ScrollView.h
54
55         * platform/ScrollView.h: Change #ifs around.
56
57 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
58
59         Reviewed by Darin.
60
61         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
62         It is necessary to load the image even when src="".
63
64         Test: fast/images/load-img-with-empty-src.html
65
66         * html/HTMLImageLoader.cpp:
67         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
68
69 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
70
71         Fix GTK+ build from r31094.
72
73         * plugins/gtk/PluginDatabaseGtk.cpp:
74         (PluginDatabase::getPluginsInPaths):
75
76 2008-03-17  Adam Roben  <aroben@apple.com>
77
78         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
79
80         <http://bugs.webkit.org/show_bug.cgi?id=17876>
81
82         Reviewed by John.
83
84         Test: fast/dom/remove-named-attribute-crash.html
85
86         * dom/NamedAttrMap.cpp:
87         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
88         going to remove from the m_attributes Vector in a RefPtr so it doesn't
89         get deleted when it is removed from the Vector.
90
91 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
92
93         Reviewed by Adam Roben.
94
95         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
96         Remove implemented methods from TemporaryLinkStubs.
97
98         * GNUmakefile.am:
99         * plugins/gtk:
100         * plugins/gtk/PluginDatabaseGtk.cpp:
101         * platform/gtk/TemporaryLinkStubs.cpp:
102
103 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
104
105         Fix the Qt build.
106
107         * platform/text/qt/TextCodecQt.cpp:
108         (WebCore::TextCodecQt::encode):
109         * platform/text/qt/TextCodecQt.h:
110
111 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
112
113         Not reviewed, just fixing an incomplete comment from the last commit.
114
115         * dom/Range.cpp:
116         (WebCore::Range::surroundContents):
117
118 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
119
120         Reviewed by Darin.
121
122         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
123         http://bugs.webkit.org/show_bug.cgi?id=17509
124         
125         This gets us to 92/100
126
127         * dom/Range.cpp:
128         (WebCore::Range::surroundContents): Check for
129         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
130         expects exceptional conditions to be tested in the order that the
131         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
132         the start point of the range is in a comment node, the node that
133         would be the parent of a partial replacement is actually the
134         comment node's parent (since comment nodes have character
135         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
136         the parent of the comment node, as for text nodes, even though it
137         will fail later with a different exception because it is not
138         allowed to surround a partially selected non-text node.
139
140 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
141
142         Reviewed by Darin.
143
144         Fix bug 15119: URL query characters that are unencodable in the
145         request's character set should be converted to XML entities with
146         non-alphanumeric characters escaped.
147
148         Test: http/tests/uri/escaped-entity.html
149
150         * html/FormDataList.cpp:
151         (WebCore::FormDataList::appendString):
152         * html/HTMLFormElement.cpp:
153         (WebCore::HTMLFormElement::formData):
154         * platform/KURL.cpp:
155         (WebCore::encodeRelativeString):
156         * platform/text/String.cpp:
157         (WebCore::String::latin1):
158         (WebCore::String::utf8):
159         * platform/text/TextCodec.cpp:
160         (WebCore::TextCodec::unencodableCharReplacement):
161         * platform/text/TextCodec.h:
162         (WebCore::):
163         * platform/text/TextCodecICU.cpp:
164         (WebCore::urlEscapedEntityCallback):
165         (WebCore::gbkUrlEscapedEntityCallack):
166         (WebCore::TextCodecICU::encode):
167         * platform/text/TextCodecICU.h:
168         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
169         * platform/text/TextCodecLatin1.cpp:
170         (WebCore::encodeComplexWindowsLatin1):
171         (WebCore::TextCodecLatin1::encode):
172         * platform/text/TextCodecLatin1.h:
173         * platform/text/TextCodecUTF16.cpp:
174         (WebCore::TextCodecUTF16::encode):
175         * platform/text/TextCodecUTF16.h:
176         * platform/text/TextCodecUserDefined.cpp:
177         (WebCore::encodeComplexUserDefined):
178         (WebCore::TextCodecUserDefined::encode):
179         * platform/text/TextCodecUserDefined.h:
180         * platform/text/TextEncoding.cpp:
181         (WebCore::TextEncoding::encode):
182         * platform/text/TextEncoding.h:
183         * platform/text/mac/TextCodecMac.cpp:
184         (WebCore::TextCodecMac::encode):
185         * platform/text/mac/TextCodecMac.h:
186         * xml/XMLHttpRequest.cpp:
187         (WebCore::XMLHttpRequest::send):
188
189 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
190
191         Rubber stamped by Darin.
192
193         Add set-webkit-configuration support for wx port, and centralize
194         build dir location setting.
195
196         http://bugs.webkit.org/show_bug.cgi?id=17790
197
198         * webcore-base.bkl:
199
200 2008-03-16  Darin Adler  <darin@apple.com>
201
202         Reviewed by Mark Rowe.
203
204         - http://bugs.webkit.org/show_bug.cgi?id=17881
205           a little cleanup for HTMLTextAreaElement
206
207         Tests: fast/forms/textarea-default-value-leading-newline.html
208                fast/forms/textarea-linewrap-dynamic.html
209
210         * html/HTMLTextAreaElement.cpp:
211         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
212         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
213         and check for < 0 rather than -1 specifically.
214         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
215         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
216         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
217         (WebCore::HTMLTextAreaElement::select): Ditto.
218         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
219         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
220         to treat unknown values as meaning "default" rather than "leave value as-is".
221         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
222         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
223         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
224         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
225         class name in isFocusable call.
226         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
227         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
228         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
229         (WebCore::HTMLTextAreaElement::updateValue): Early return.
230         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
231         eliminate on small refcount churn.
232         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
233         string length checks, since String already checks all indexing and returns 0.
234         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
235         line endings and add a leading line ending to fix cases where the first
236         character is a newline.
237         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
238         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
239         refcount churn.
240         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
241         of -1 specifically.
242
243         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
244         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
245         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
246         m_cachedSelectionStart and m_cachedSelectionEnd.
247
248         * rendering/RenderTextControl.cpp:
249         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
250         HTMLTextAreaElement wrap function.
251
252 2008-03-16  Antti Koivisto  <antti@apple.com>
253
254         Reviewed by Mitz.
255
256         Fix http/tests/security/frame-loading-via-document-write.html
257         which was broken by the preload patch.
258         
259         Don't print error message when preload fails local file security check.
260         Some minor refactoring.
261
262         * html/PreloadScanner.cpp:
263         (WebCore::PreloadScanner::emitTag):
264         (WebCore::PreloadScanner::emitCSSRule):
265         * loader/Cache.cpp:
266         (WebCore::Cache::requestResource):
267         * loader/Cache.h:
268         * loader/DocLoader.cpp:
269         (WebCore::DocLoader::requestResource):
270         (WebCore::DocLoader::preload):
271         (WebCore::DocLoader::printPreloadStats):
272         * loader/DocLoader.h:
273
274 2008-03-16  Antti Koivisto  <antti@apple.com>
275
276         Reviewed by Darin.
277         
278         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
279         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
280         
281         This was a memory smasher introduced by the preloading patch. 
282         If a script resource was marked uncacheable, early deletion of the 
283         Request object would cause deletion of the CachedResource too if
284         it was referred more than once in a single document.
285
286         Test: http/tests/misc/uncacheable-script-repeated.html
287
288         * loader/loader.cpp:
289         (WebCore::Loader::Host::servePendingRequests):
290         (WebCore::Loader::Host::didFinishLoading):
291
292 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
293
294         Reviewed by Darin.
295
296         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
297         <img href="#"> should go to top of the page.
298
299         Test: fast/html/empty-fragment-id-goto-top.html
300
301         * loader/FrameLoader.cpp:
302         (WebCore::FrameLoader::gotoAnchor):
303
304 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
305
306         Reviewed by Darin.
307
308         Don't use RefPtr in classes you haven't seen the implementation of.
309
310         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
311         cannot *use* said objects until Foo is defined. This is true even for
312         initialisation with a 0.
313
314         Seems the HP aCC compiler is more strict here than gcc.
315
316         * editing/SplitTextNodeCommand.h:
317         * page/FrameTree.h:
318         * xml/XPathExpressionNode.h:
319
320 2008-03-16  Darin Adler  <darin@apple.com>
321
322         Reviewed by Mitz.
323
324         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
325           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
326
327         Test: fast/forms/textarea-trailing-newline.html
328
329         * rendering/RenderTextControl.cpp:
330         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
331         newline. It's possible there are some obscure cases where this is not wanted,
332         but I couldn't find any. If someone finds a case where this is bad, we can
333         make the code conditional.
334
335 2008-03-16  Darin Adler  <darin@apple.com>
336
337         Reviewed by Mitz.
338
339         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
340           Attempting to visit Ofcom page causes crash
341
342         This is causing intermittent crashes on some existing test cases on the buildbot
343         too; I don't have a 100% test case right now, but it should be easy to add one later
344         and this does fix a crash in a test we already have.
345
346         * dom/CharacterData.cpp:
347         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
348         not the null string. The class assumes the string can never being null.
349         (WebCore::CharacterData::setData): If asked to set the data to the null string,
350         set it to the empty string instead. This matches what the (non-empty) constructor
351         has always done.
352
353 2008-03-15  Timothy Hatcher  <timothy@apple.com>
354
355         Reviewed by Adam Roben.
356
357         Bug 17870: Web Inspector console should feel more like a terminal
358         http://bugs.webkit.org/show_bug.cgi?id=17870
359
360         Bug 14390: Console input area should be more noticeable
361         http://bugs.webkit.org/show_bug.cgi?id=14390
362
363         Adds tab completion, auto completion and a blended input prompt.
364         The prompt is also focused when the console is shown.
365            Implements a new look, that will be part of the UI refresh.
366
367         * page/inspector/ConsolePanel.js: 
368         (WebInspector.ConsolePanel): Renamed a few properties.
369         (WebInspector.ConsolePanel.get/set promptText): Property to set
370         and get the current prompt text. Does not affect command history.
371         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
372         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
373         pending auto complete text.
374         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
375         auto complete text.
376         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
377         complete in 250 ms, only if there isn't a pending auto complete.
378         (WebInspector.ConsolePanel.complete): 
379         (WebInspector.ConsolePanel.completions): Generate a list of possible
380         completions based on the prefix and the previous expression ranges.
381         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
382         from a node and offset to find a start node and offset of the first
383         character found in the characters string.
384         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
385         inspected window.
386         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
387         is collapsed and is inside the prompt element.
388         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
389         to the end of the prompt.
390         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
391         tab press.
392         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
393         autocompletion text is not evaluated.
394
395         * page/inspector/Images/errorIcon.png: New image.
396         * page/inspector/Images/userInputIcon.png: Added.
397         * page/inspector/Images/userInputPreviousIcon.png: Added.
398         * page/inspector/Images/warningIcon.png: New image.
399         * page/inspector/inspector.css: New refreshed UI.
400
401 2008-03-15  Mark Mentovai  <mark@moxienet.com>
402
403         Reviewed and landed by Darin.
404
405         - http://bugs.webkit.org/show_bug.cgi?id=17833
406           use file extensions instead of explicit file types in WebCore's Xcode project
407
408         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
409           uses of explicitFileType, preferring lastKnownFileType ("File Type:
410           Default for File" in Xcode's File Info's General tab).  Files below
411           that relied on an explicit file type setting other than what would
412           be implied by their extensions have been renamed to have correct
413           extensions.
414         * bridge/jni/jni_jsobject.cpp: Removed.
415         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
416         * loader/mac/LoaderNSURLExtras.m: Removed.
417         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
418         * platform/mac/SharedTimerMac.cpp: Removed.
419         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
420
421 2008-03-15  Darin Adler  <darin@apple.com>
422
423         Reviewed by Sam.
424
425         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
426           Ranges are not fixed after mutation (affects Acid3 test 13)
427
428         Test: fast/dom/Range/mutation.html
429
430         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
431         and NodeWithIndexBefore.h.
432
433         * dom/CharacterData.cpp:
434         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
435         with call to Document::textRemoved.
436         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
437         with call to Document::textInserted.
438         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
439         and Document::shiftMarkers with call to Document::textRemoved.
440         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
441         and Document::shiftMarkers with call to Document::textRemoved and
442         Document::textInserted.
443         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
444
445         * dom/ContainerNode.cpp:
446         (WebCore::ContainerNode::childrenChanged): Added a call to
447         Document::nodeChildrenChanged when the nmber of children was changed (and not
448         by the parser).
449         (WebCore::dispatchChildRemovalEvents): Updated for name change.
450
451         * dom/Document.cpp:
452         (WebCore::Document::~Document): Assert that all ranges are gone.
453         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
454         all ranges.
455         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
456         Added code to call nodeWillBeRemoved on all ranges.
457         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
458         also calls shiftMarkers.
459         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
460         calls removeMarkers and shiftMarkers.
461         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
462         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
463         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
464         for this document.
465         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
466         * dom/Document.h: Added the new functions and the data member.
467
468         * dom/Element.cpp:
469         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
470         normalize function that's specific to Element. Better encapsulation to have it
471         here rather than in Node::normalize.
472         * dom/Element.h: Added the new function.
473
474         * dom/Node.cpp:
475         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
476         a call to textNodesMerged after each pair of nodes is merged but before the
477         second node is removed.
478         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
479         normalize, but also useful elsewhere.
480         * dom/Node.h: Added the new function.
481
482         * dom/NodeIterator.cpp:
483         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
484         * dom/NodeIterator.h: Ditto.
485
486         * dom/ProcessingInstruction.cpp:
487         (WebCore::ProcessingInstruction::setData): Call textRemoved.
488
489         * dom/Range.cpp:
490         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
491         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
492         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
493         (WebCore::Range::Range): Call attachRange.
494         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
495         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
496         It's no longer possible to create a range where the two containers are non-zero
497         and have no common ancestor.
498         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
499         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
500         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
501         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
502         initialization of ec to 0; both are now inside checkDeleteExtract.
503         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
504         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
505         and -1.
506         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
507         times on the same node, and tweaked formatting. Removed code to update the range
508         on deletion, because the normal delete logic will take care of that now.
509         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
510         initialization of ec to 0; both are now inside checkDeleteExtract.
511         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
512         (WebCore::Range::toString): Changed variable name to pastLast.
513         (WebCore::Range::detach): Call detachRange.
514         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
515         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
516         (WebCore::endpointNodeChildrenChanged): Added.
517         (WebCore::Range::nodeChildrenChanged): Added.
518         (WebCore::endpointNodeWillBeRemoved): Added.
519         (WebCore::Range::nodeWillBeRemoved): Added.
520         (WebCore::endpointTextInserted): Added.
521         (WebCore::Range::textInserted): Added.
522         (WebCore::endpointTextRemoved): Added.
523         (WebCore::Range::textRemoved): Added.
524         (WebCore::endpointTextNodesMerged): Added.
525         (WebCore::Range::textNodesMerged): Added.
526         (WebCore::endpointTextNodesSplit): Added.
527         (WebCore::Range::textNodeSplit): Added.
528
529         * dom/Range.h: Added new member functions.
530
531         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
532         node more than once.
533         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
534         node and treats a node pointer of 0 as meaning "before first node in parent container".
535         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
536         as meaning "after last node in parent container".
537
538         * dom/Text.cpp:
539         (WebCore::Text::splitText): Call textNodeSplit.
540
541         * editing/ApplyStyleCommand.cpp:
542         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
543
544 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
545
546         Reviewed by Holger.
547
548         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
549         http://bugs.webkit.org/show_bug.cgi?id=16906
550
551         Add null checks for httpBody() to match other ports.
552
553         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
554
555         * platform/network/curl/ResourceHandleManager.cpp:
556         (WebCore::readCallback): Add null check.
557         (WebCore::ResourceHandleManager::setupPOST): Ditto.
558
559 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
560
561         PGO build fixes.
562
563         * WebCore.vcproj/WebCore.vcproj:
564
565 2008-03-14  Anders Carlsson  <andersca@apple.com>
566
567         Reviewed by Sam.
568
569         <rdar://problem/5794989>
570         https://bugs.webkit.org/show_bug.cgi?id=17792
571         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
572
573         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
574         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
575         
576         * bindings/js/JSDOMWindowBase.cpp:
577         (WebCore::createWindow):
578         * loader/FrameLoader.cpp:
579         (WebCore::FrameLoader::createWindow):
580         * loader/FrameLoader.h:
581
582 2008-03-14  Dan Bernstein  <mitz@apple.com>
583
584         Reviewed by Mark Rowe.
585
586         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
587
588         * platform/graphics/cg/GraphicsContextCG.cpp:
589         (WebCore::GraphicsContext::setShadow): Made the workaround for
590         <rdar://problem/5539388> unconditional.
591
592 2008-03-14  Adam Roben  <aroben@apple.com>
593
594         Fix it right this time
595
596         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
597         format string.
598         * platform/mac/MainThreadMac.mm:
599
600 2008-03-14  Adam Roben  <aroben@apple.com>
601
602         Mac build fix
603
604         * platform/mac/MainThreadMac.mm: Corrected a typo.
605
606 2008-03-14  Dan Bernstein  <mitz@apple.com>
607
608         Reviewed by Darin Adler.
609
610         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
611           REGRESSION: floated first-letter does not work when included in table
612
613         Test: fast/css/first-letter-float.html
614
615         * rendering/RenderBlock.cpp:
616         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
617         first text node to stop at a float if that float is an existing first-
618         letter.
619
620 2008-03-14  Sam Weinig  <sam@webkit.org>
621
622         Fix Mac build
623
624         * WebCore.xcodeproj/project.pbxproj:
625
626 2008-03-13  Adam Roben  <aroben@apple.com>
627
628         Make most of callOnMainThread's implementation be cross-platform
629
630         I took the non-platform-specific parts of MainThreadWin.cpp and moved
631         them to a new MainThread.cpp. Each platform is now responsible for
632         implementing one function, scheduleDispatchFunctionsOnMainThread,
633         which is supposed to set things up so that
634         dispatchFunctionsFromMainThread gets called from the main thread in
635         the near future.
636
637         Reviewed by Alexey.
638
639         * GNUmakefile.am: Added MainThread.cpp to the project.
640         * WebCore.pro: Ditto.
641         * WebCore.vcproj/WebCore.vcproj: Ditto.
642         * WebCore.xcodeproj/project.pbxproj: Ditto.
643         * WebCoreSources.bkl: Ditto.
644         * platform/MainThread.cpp:
645           - Copied from WebCore/platform/win/MainThreadWin.cpp.
646           - Removed the Windows-specific parts.
647         (WebCore::callOnMainThread): Changed to call
648         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
649         * platform/gtk/MainThreadGtk.cpp:
650         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
651         just calls dispatchFunctionsFromMainThread.
652         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
653         to g_timeout_add.
654         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
655         WebCoreMainThreadCaller.
656         (-[WebCoreMainThreadCaller call]): Calls through to
657         dispatchFunctionsFromMainThread.
658         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
659         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
660         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
661         (WebCore::MainThreadInvoker::event): Chagned to call through to
662         dispatchFunctionsFromMainThread.
663         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
664         to the MainThreadInvoker.
665         * platform/win/MainThreadWin.cpp:
666           - Removed the non-Windows-specific parts.
667           - Removed some unnecessary initialization of static variables to 0.
668         (WebCore::ThreadingWindowWndProc): Changed to call
669         dispatchFunctionsFromMainThread.
670         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
671         PostMessage.
672         * platform/wx/MainThreadWx.cpp:
673         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
674
675 2008-03-14  Beth Dakin  <bdakin@apple.com>
676
677         Reviewed by Geoff.
678
679         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
680         realloc every time inside NamedAttrMap::addAttribute
681
682         The speed-up for this turned out to be so small that it is mostly 
683         imperceptible. It is likely that it is a tiny boost, though, and 
684         the new code is much cleaner.
685
686         * dom/Element.cpp:
687         (WebCore::Element::setAttributeMap): attrs is now called 
688         m_attributes
689         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
690         RefPtrs called m_attributes, and there is no longer any need for 
691         the len member variable. 
692         (WebCore::NamedAttrMap::NamedAttrMap): 
693         (WebCore::NamedAttrMap::item):
694         (WebCore::NamedAttrMap::getAttributeItem):
695         (WebCore::NamedAttrMap::clearAttributes):
696         (WebCore::NamedAttrMap::operator=):
697         (WebCore::NamedAttrMap::addAttribute):
698         (WebCore::NamedAttrMap::removeAttribute):
699         (WebCore::NamedAttrMap::mapsEquivalent):
700         * dom/NamedAttrMap.h: Same.
701         (WebCore::NamedAttrMap::length):
702         (WebCore::NamedAttrMap::attributeItem):
703         (WebCore::NamedAttrMap::shrinkToLength):
704         (WebCore::NamedAttrMap::reserveCapacity):
705         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
706         that it never took up more memory than it needed to. So the 
707         tokenizer utilizes new member functions on NamedAttrMap 
708         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
709         a minimum. 
710         (WebCore::Token::addAttribute):
711         (WebCore::HTMLTokenizer::processToken):
712
713 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
714
715         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
716
717         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
718         to comment out unused code.
719
720 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
721
722         Unify concept of enabling the Mac Java bridge.
723
724         Reviewed by Darin and Anders.
725
726         No test cases added since there is no change in functionality.
727
728         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
729         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
730         * WebCore.JNI.exp: Added.
731         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
732
733         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
734         * bridge/jni/jni_class.h: Ditto.
735         * bridge/jni/jni_instance.cpp: Ditto.
736         * bridge/jni/jni_instance.h: Ditto.
737         * bridge/jni/jni_jsobject.cpp: Ditto.
738         * bridge/jni/jni_jsobject.h: Ditto.
739         * bridge/jni/jni_objc.mm: Ditto.
740         * bridge/jni/jni_runtime.cpp: Ditto.
741         * bridge/jni/jni_runtime.h: Ditto.
742         * bridge/jni/jni_utility.cpp: Ditto.
743         * bridge/jni/jni_utility.h: Ditto.
744
745         * bridge/runtime.cpp: Removed unused #include statements.
746         * bridge/runtime.h:
747         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
748         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
749         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
750
751         * config.h: Removed definition of HAVE_JNI.
752
753         * loader/FrameLoaderClient.h:
754         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
755         * page/Frame.cpp:
756         (WebCore::Frame::Frame): Ditto.
757         * page/Frame.h:
758         (WebCore::Frame::initJavaJSBindings): Ditto.
759         * page/mac/FrameMac.mm:
760         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
761         (WebCore::Frame::initJavaJSBindings): Ditto.
762
763 2008-03-13  Darin Adler  <darin@apple.com>
764
765         * html/PreloadScanner.h: Corrected license.
766         * html/PreloadScanner.cpp: Corrected license.
767
768 2008-03-13  Mark Mentovai  <mark@moxienet.com>
769
770         Reviewed by darin.  Landed by eseidel.
771
772         * platform/FloatConversion.h: Include a header to get CoreGraphics
773         types when using CoreGraphics types.
774
775 2008-03-13  Mark Mentovai  <mark@moxienet.com>
776
777         Reviewed by eseidel.  Landed by eseidel.
778
779         * WebCore.xcodeproj/project.pbxproj:
780         * css/CSSParser.cpp:
781         * css/makeprop.pl:
782         Move CSSPropertyNames.c to CSSPropertyNames.cpp
783
784 2008-03-13  Mark Mentovai  <mark@moxienet.com>
785
786         Reviewed by eseidel.  Landed by eseidel.
787
788         * platform/Arena.h: Use statement1;statement2 instead of
789         (statement1,statement2) in CLEAR_UNUSED.
790
791 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
792
793         Reviewed by Alp Toker.
794
795         http://bugs.webkit.org/show_bug.cgi?id=17821
796         [SOUP] POST requests are empty
797
798         Send the HTTP request body as well.
799
800         * platform/network/soup/ResourceHandleSoup.cpp:
801         (WebCore::ResourceHandle::start):
802
803 2008-03-13  Dan Bernstein  <mitz@apple.com>
804
805         Reviewed by Dave Hyatt.
806
807         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
808           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
809
810         Test: fast/table/border-collapsing/equal-precedence-resolution.html
811
812         * rendering/RenderTableCell.cpp:
813         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
814         compareBorders() with borders that may have the same precedence, made
815         sure to pass the border belonging to the earlier (in document order)
816         element first, since compareBorders() prefers the first argument when
817         there is a tie.
818         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
819         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
820
821 2008-03-13  Adam Roben  <aroben@apple.com>
822
823         wx build fix and Windows leak fix after r31034
824
825         * platform/graphics/wx/ImageWx.cpp:
826         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
827         * platform/win/SharedBufferWin.cpp:
828         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
829         leaking the SharedBuffer here before).
830
831 2008-03-13  Antti Koivisto  <antti@apple.com>
832
833         Reviewed by Eric.
834
835         Correct a few issues spotted by Mike Belshe. 
836
837         * html/PreloadScanner.cpp:
838         (WebCore::PreloadScanner::tokenize):
839         * loader/loader.cpp:
840         (WebCore::Loader::cancelRequests):
841
842 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
843
844         Fix GTK+ build for SharedBuffer changes.
845
846         * platform/graphics/gtk/ImageGtk.cpp:
847         (Image::loadPlatformResource):
848
849 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
850
851         More PGO build fixes.
852
853         * WebCorePrefix.cpp:
854
855 2008-03-13  Antti Koivisto  <antti@apple.com>
856
857         Reviewed by Darin.
858         
859         Make page loads go fast.
860         
861         http://bugs.webkit.org/show_bug.cgi?id=17480
862
863         - Implement speculative preloading. When a script load blocks the main parser, use a side 
864           parser to pick up more resources.
865         - Implement per-host load queues, prioritize scripts and stylesheets over images.
866         
867         Depending on content and network latency this may speed things up quite a bit.
868
869         * WebCore.xcodeproj/project.pbxproj:
870         * dom/Document.cpp:
871         (WebCore::Document::implicitClose):
872         Clear the preloads after laoding completes.
873         
874         * html/HTMLLinkElement.cpp:
875         (WebCore::HTMLLinkElement::parseMappedAttribute):
876         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
877         * html/HTMLLinkElement.h:
878         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
879         Eliminate a pointless bitfield so I can get references.
880         
881         * html/HTMLTokenizer.cpp:
882         (WebCore::HTMLTokenizer::scriptHandler):
883         (WebCore::HTMLTokenizer::scriptExecution):
884         (WebCore::HTMLTokenizer::write):
885         * html/HTMLTokenizer.h:
886         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
887         the document while temporary ones are created as needed to scan document.write() output.
888         
889         * html/PreloadScanner.cpp: Added.
890         (WebCore::PreloadScanner::PreloadScanner):
891         (WebCore::PreloadScanner::~PreloadScanner):
892         (WebCore::PreloadScanner::begin):
893         (WebCore::PreloadScanner::end):
894         (WebCore::PreloadScanner::reset):
895         (WebCore::PreloadScanner::write):
896         (WebCore::isWhitespace):
897         (WebCore::PreloadScanner::clearLastCharacters):
898         (WebCore::PreloadScanner::rememberCharacter):
899         (WebCore::PreloadScanner::lastCharactersMatch):
900         (WebCore::legalEntityFor):
901         (WebCore::PreloadScanner::consumeEntity):
902         (WebCore::PreloadScanner::tokenize):
903         (WebCore::PreloadScanner::processAttribute):
904         (WebCore::PreloadScanner::emitCharacter):
905         (WebCore::PreloadScanner::tokenizeCSS):
906         (WebCore::PreloadScanner::emitTag):
907         (WebCore::PreloadScanner::emitCSSRule):
908         * html/PreloadScanner.h: Added.
909         (WebCore::PreloadScanner::inProgress):
910         (WebCore::PreloadScanner::):
911         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
912         
913         * loader/Cache.cpp:
914         (WebCore::Cache::pruneDeadResources):
915         Preloads have zero refcount, avoid kicking them out too early.
916         
917         * loader/CachedResource.cpp:
918         (WebCore::CachedResource::CachedResource):
919         (WebCore::CachedResource::ref):
920         * loader/CachedResource.h:
921         (WebCore::CachedResource::):
922         (WebCore::CachedResource::preloadResult):
923         (WebCore::CachedResource::setRequestedFromNetworkingLayer):
924         (WebCore::CachedResource::canDelete):
925         (WebCore::CachedResource::isPreloaded):
926         (WebCore::CachedResource::increasePreloadCount):
927         (WebCore::CachedResource::decreasePreloadCount):
928         Keep track which resources are preloads. Avoid deleting them. Track
929         at which point of the loading preloads get utilized to enable some interesting 
930         statistics.
931         
932         * loader/DocLoader.cpp:
933         (WebCore::DocLoader::~DocLoader):
934         (WebCore::DocLoader::checkForReload):
935         (WebCore::DocLoader::registerPreload):
936         (WebCore::DocLoader::clearPreloads):
937         (WebCore::DocLoader::printPreloadStats):
938         * loader/DocLoader.h:
939         Ensure we utilize preloaded resources during reloads.
940         Keep a list of all preloads in the document. Clear the preloads after
941         parsing is complete. Some debug statistics.
942         
943         * loader/DocumentLoader.cpp:
944         (WebCore::DocumentLoader::isLoadingInAPISense):
945         Avoid signaling that loading is complete too early. 
946         
947         * loader/loader.cpp:
948         (WebCore::Loader::Loader):
949         (WebCore::Loader::~Loader):
950         (WebCore::Loader::determinePriority):
951         (WebCore::Loader::load):
952         (WebCore::Loader::scheduleServePendingRequests):
953         (WebCore::Loader::requestTimerFired):
954         (WebCore::Loader::servePendingRequests):
955         (WebCore::Loader::cancelRequests):
956         (WebCore::Loader::Host::Host):
957         (WebCore::Loader::Host::~Host):
958         (WebCore::Loader::Host::addRequest):
959         (WebCore::Loader::Host::hasRequests):
960         (WebCore::Loader::Host::servePendingRequests):
961         (WebCore::Loader::Host::didFinishLoading):
962         (WebCore::Loader::Host::didFail):
963         (WebCore::Loader::Host::didReceiveResponse):
964         (WebCore::Loader::Host::didReceiveData):
965         (WebCore::Loader::Host::cancelPendingRequests):
966         (WebCore::Loader::Host::cancelRequests):
967         * loader/loader.h:
968         (WebCore::Loader::):
969         Distribute load requests to per-host priority queues. Limit the number of loads issued to the 
970         networking layer so we have better changes of getting important requests through first.
971         Prioritize scripts > stylesheets > images.
972
973 2008-03-13  David Hyatt  <hyatt@apple.com>
974
975         This patch makes full page zoom work pretty well. It fixes repainting so that it works when transforms
976         are set on the RenderView. It also implements the "smart layout" behavior that other browsers support when
977         zooming. The page will still try to constrain to the viewport size even when zoomed.
978
979         Reviewed by john
980
981         * dom/Document.cpp:
982         (WebCore::Document::recalcStyle):
983         Make sure to test for transform changes even when there is no zoom.  This fixes repainting issues
984         caused by jumping from a zoomed state back to the standard size.
985
986         * page/FrameView.cpp:
987         (WebCore::FrameView::adjustViewSize):
988         Adjust for the zoom factor (the render tree is in unzoomed coordinates, but the scrollbars of the view
989         need to handle zoomed coordinates).
990
991         * rendering/RenderBox.cpp:
992         (WebCore::RenderBox::calcHeight):
993         Fix the body-sizing-to-the-view-height quirk so that it takes the zoom factor into account when
994         stretching to fill the viewport.
995
996         * rendering/RenderLayer.cpp:
997         (WebCore::RenderLayer::updateLayerPositions):
998         (WebCore::RenderLayer::setHasVisibleContent):
999         Remove the FIXMEs now that absoluteClippedOverflowRect works with transforms on the RenderView.
1000
1001         * rendering/RenderView.cpp:
1002         (WebCore::RenderView::calcHeight):
1003         (WebCore::RenderView::calcWidth):
1004         Make sure the calculated width/height take the zoom factor into account in order to get the "smart layout"
1005         behavior.
1006
1007         (WebCore::RenderView::layout):
1008         When deciding whether children have to get a relayout, we need to check the zoomed width/height and not just
1009         the viewport size.
1010
1011         (WebCore::RenderView::computeAbsoluteRepaintRect):
1012         Patched to take into account transforms set on the RenderView.
1013
1014         (WebCore::RenderView::docHeight):
1015         (WebCore::RenderView::docWidth):
1016         Patched to just always use m_width and m_height initially, since those have already been adjusted for
1017         the zoom factor.
1018
1019         (WebCore::RenderView::zoomedHeight):
1020         (WebCore::RenderView::zoomedWidth):
1021         * rendering/RenderView.h:
1022         New helper methods for obtaining the adjusted width/height of the viewport taking into account the
1023         zoom factor.
1024
1025 2008-03-13  Anders Carlsson  <andersca@apple.com>
1026
1027         Build fix.
1028
1029         * WebCore.base.exp:
1030
1031 2008-03-13  Anders Carlsson  <andersca@apple.com>
1032
1033         Reviewed by Adam.
1034
1035         Get rid of actualRequest, it is not used anymore. Also, get rid of 
1036         initialRequest and replace all uses with originalRequest because those are
1037         the same thing.
1038         
1039         * loader/DocumentLoader.cpp:
1040         * loader/DocumentLoader.h:
1041         * loader/FrameLoader.cpp:
1042         (WebCore::FrameLoader::initialRequest):
1043         (WebCore::FrameLoader::originalRequestURL):
1044
1045 2008-03-13  Brady Eidson  <beidson@apple.com>
1046
1047         Reviewed by Anders
1048
1049         Convert SharedBuffer to start with a refCount of 1
1050
1051         * loader/ImageDocument.cpp:
1052         (WebCore::ImageTokenizer::finish):
1053
1054         * loader/ResourceLoader.cpp:
1055         (WebCore::ResourceLoader::addData):
1056         (WebCore::ResourceLoader::willStopBufferingData):
1057
1058         * loader/icon/IconDatabase.cpp:
1059         (WebCore::IconDatabase::defaultIcon):
1060         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
1061
1062         * loader/loader.cpp:
1063         (WebCore::Loader::didReceiveData):
1064
1065         * platform/SharedBuffer.h:
1066         (WebCore::SharedBuffer::create): Make all constructors private, add ::create() calls
1067         * platform/SharedBuffer.cpp:
1068         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
1069         (WebCore::SharedBuffer::copy):
1070         * platform/mac/SharedBufferMac.mm:
1071         (WebCore::SharedBuffer::wrapNSData):
1072         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
1073
1074 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
1075
1076         PGO build fixes.
1077         
1078         Disable PGO for normal release builds.
1079         Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
1080
1081         * WebCore.vcproj/WebCore.vcproj:
1082
1083 2008-03-13  Anders Carlsson  <andersca@apple.com>
1084
1085         Reviewed by Darin.
1086
1087         Make a bunch of DocumentLoader setters/getters inline.
1088         
1089         * loader/DocumentLoader.cpp:
1090         * loader/DocumentLoader.h:
1091         (WebCore::DocumentLoader::isStopping):
1092         (WebCore::DocumentLoader::setCommitted):
1093         (WebCore::DocumentLoader::isCommitted):
1094         (WebCore::DocumentLoader::isLoading):
1095         (WebCore::DocumentLoader::setLoading):
1096         (WebCore::DocumentLoader::response):
1097         (WebCore::DocumentLoader::mainDocumentError):
1098         (WebCore::DocumentLoader::setResponse):
1099         (WebCore::DocumentLoader::isClientRedirect):
1100         (WebCore::DocumentLoader::setIsClientRedirect):
1101         (WebCore::DocumentLoader::overrideEncoding):
1102         (WebCore::DocumentLoader::responses):
1103         (WebCore::DocumentLoader::triggeringAction):
1104         (WebCore::DocumentLoader::setTriggeringAction):
1105         (WebCore::DocumentLoader::setOverrideEncoding):
1106         (WebCore::DocumentLoader::setLastCheckedRequest):
1107         (WebCore::DocumentLoader::lastCheckedRequest):
1108         (WebCore::DocumentLoader::title):
1109         (WebCore::DocumentLoader::setLoadingFromCachedPage):
1110         (WebCore::DocumentLoader::isLoadingFromCachedPage):
1111
1112 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
1113
1114         Fix builds without SVG enabled.
1115
1116         * page/Frame.cpp:
1117         (Frame::shouldApplyTextZoom):
1118         (Frame::shouldApplyPageZoom):
1119
1120 2008-03-13  Simon Hausmann  <hausmann@webkit.org>
1121
1122         Fix the Qt build.
1123
1124         * bridge/qt/qt_instance.cpp:
1125         (KJS::Bindings::QtInstance::getQtInstance):
1126         (KJS::Bindings::QtInstance::getRuntimeObject):
1127         * bridge/qt/qt_instance.h:
1128         (KJS::Bindings::QtInstance::create):
1129         * bridge/qt/qt_runtime.cpp:
1130         (KJS::Bindings::convertQVariantToValue):
1131         (KJS::Bindings::QtConnectionObject::execute):
1132         * page/qt/FrameQt.cpp:
1133         (WebCore::Frame::createScriptInstanceForWidget):
1134
1135 2008-03-12  Sam Weinig  <sam@webkit.org>
1136
1137         Reviewed by Darin Adler.
1138
1139         Fix <rdar://problem/5784773>
1140         Crash loading QT movies @ apple.com/ipodtouch/features.html with a PAC file (WebKitThreadingException)
1141
1142         Make bridged RuntimeObjects get collected on the main thread only. This is necessary
1143         because clients of the bridged objects are unlikely to prepared for a collection on 
1144         non-main thread, which can happen with a PAC file.
1145
1146         * bridge/runtime_object.cpp:
1147         (RuntimeObjectImp::RuntimeObjectImp):
1148
1149 2008-03-12  Adam Roben  <aroben@apple.com>
1150
1151         Fix Bug 17815: Inspector's DOM tree should descend into subframes
1152
1153         <http://bugs.webkit.org/show_bug.cgi?id=17815>
1154
1155         Reviewed by Tim.
1156
1157         * page/inspector/DocumentPanel.js:
1158         (WebInspector.DocumentPanel.revealNode): Changed to provide
1159         _isAncestorIncludingParentFramesWithinPanel and
1160         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
1161         parameters to findTreeElement so that parent frames will be searched.
1162         (WebInspector.DocumentPanel.updateBreadcrumb):
1163           - Changed while loop to for loop
1164           - Use _parentNodeOrFrameElementWithinPanel instead of
1165             Node.parentNode to move to the next node
1166           - The loop now ends when we reach the DocumentPanel's document node
1167           - Traversal past other Document nodes is now allowed
1168           - We add the "start" class to the final crumb after the loop exits
1169         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
1170         that returns the node itself if the node is a Document node, or the
1171         node's ownerDocument otherwise.
1172         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
1173         Added. Returns the node's parent node or, in the case of a Document
1174         node, the node's window's owning frame element, but will not return a
1175         node that is in a parent frame of the DocumentPanel's Document.
1176         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
1177         Added. Returns true if a is an ancestor of b if a is an ancestor of a
1178         frame element whose subframe(s) contain b.
1179         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
1180         children if we have a contentDocument.
1181         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
1182         loop into a function so that we can add both children of our
1183         contentDocument and children of our node to the tree.
1184         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
1185         the rootDOMNode by traversing the tree outline hierarchy instead of
1186         the DOM hierarchy so that we can easily jump up to a parent frame.
1187
1188 2008-03-12  Adam Roben  <aroben@apple.com>
1189
1190         Update the styles/metrics panes and breadcrumb after editing DOM
1191         attributes
1192
1193         Reviewed by Tim.
1194
1195         * page/inspector/DocumentPanel.js:
1196         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
1197         the parts of the DocumentPanel other than the DOM tree into a new
1198         function, _focusedNodeChanged.
1199         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
1200         forceUpdate parameter specifies whether the update should occur even
1201         if the focused node hasn't changed since the last update.
1202         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
1203         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
1204         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
1205         parameter. If forceUpdate is true, we always rebuild the styles pane.
1206         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
1207         call to DocumentPanel._focusedNodeChanged. We have to force the update
1208         because we haven't changed the focused node (the attributes of the
1209         node have changed).
1210         * page/inspector/StylesSidebarPane.js:
1211         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
1212         parameter. If forceUpdate is true we always rebuild the styles.
1213
1214 2008-03-12  Mark Rowe  <mrowe@apple.com>
1215
1216         Further Gtk and Qt build fixes.
1217
1218         * bridge/runtime.cpp:
1219         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
1220         * page/gtk/FrameGtk.cpp: Add missing include.
1221
1222 2008-03-12  Mark Rowe  <mrowe@apple.com>
1223
1224         Fix Gtk and Qt builds.
1225
1226         * page/gtk/FrameGtk.cpp:
1227         * page/qt/FrameQt.cpp:
1228
1229 2008-03-12  Mark Rowe  <mrowe@apple.com>
1230
1231         Mac build fix.
1232
1233         * WebCore.base.exp:  Remove symbol.
1234
1235 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
1236
1237         Build fix.
1238
1239         * page/win/FrameWin.cpp:
1240
1241 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
1242
1243         Build fix.
1244
1245         * plugins/win/PluginViewWin.cpp:
1246         (WebCore::PluginView::bindingInstance):
1247
1248 2008-03-12  Darin Adler  <darin@apple.com>
1249
1250         Reviewed by Anders.
1251
1252         - http://bugs.webkit.org/show_bug.cgi?id=17640
1253           eliminate WebCoreFrameBridge
1254
1255         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
1256         to WebFrame in WebKit.
1257         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
1258         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
1259
1260         * page/Frame.cpp:
1261         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
1262         the WebCoreFrameBridge.
1263         * page/Frame.h: Added initJavaJSBindings function.
1264
1265         * page/mac/FrameMac.mm:
1266         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
1267         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
1268
1269         * page/mac/WebCoreFrameBridge.h: Removed.
1270         * page/mac/WebCoreFrameBridge.mm: Removed.
1271
1272 2008-03-12  Sam Weinig  <sam@webkit.org>
1273
1274         Reviewed by Anders Carlsson.
1275
1276         Don't go through the Document just to get the frame Element.
1277
1278         * page/DOMWindow.cpp:
1279         (WebCore::DOMWindow::frameElement):
1280
1281 2008-03-12  Anders Carlsson  <andersca@apple.com>
1282
1283         Reviewed by Geoff and Sam.
1284
1285         More Instance cleanup:
1286         
1287         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
1288         * Make all Instance subclasses private, add static create methods.         
1289         * Have Instance start out with a refcount of 1.
1290         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
1291           instance constructor methods instead.
1292         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
1293           refcounting is done correctly.
1294          
1295         * bridge/c/c_instance.h:
1296         (KJS::Bindings::CInstance::create):
1297         * bridge/c/c_utility.cpp:
1298         (KJS::Bindings::convertNPVariantToValue):
1299         * bridge/jni/jni_instance.cpp:
1300         (JavaInstance::invokeMethod):
1301         * bridge/jni/jni_instance.h:
1302         (KJS::Bindings::JavaInstance::create):
1303         * bridge/jni/jni_jsobject.cpp:
1304         (JavaJSObject::convertJObjectToValue):
1305         * bridge/jni/jni_runtime.cpp:
1306         (JavaField::valueFromInstance):
1307         (JavaArray::valueAt):
1308         * bridge/objc/objc_instance.h:
1309         (KJS::Bindings::ObjcInstance::create):
1310         * bridge/objc/objc_utility.mm:
1311         (KJS::Bindings::convertObjcValueToValue):
1312         * bridge/qt/qt_instance.cpp:
1313         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
1314         (KJS::Bindings::QtInstance::getQtInstance):
1315         (KJS::Bindings::QtInstance::getRuntimeObject):
1316         * bridge/qt/qt_instance.h:
1317         * bridge/runtime.cpp:
1318         (KJS::Bindings::Instance::Instance):
1319         (KJS::Bindings::Instance::createRuntimeObject):
1320         * bridge/runtime.h:
1321         * bridge/runtime_object.cpp:
1322         (RuntimeObjectImp::RuntimeObjectImp):
1323         * bridge/runtime_object.h:
1324         * page/Frame.h:
1325         * page/mac/FrameMac.mm:
1326         (WebCore::Frame::createScriptInstanceForWidget):
1327         * page/win/FrameWin.cpp:
1328         (WebCore::Frame::createScriptInstanceForWidget):
1329         * plugins/PluginView.h:
1330         * plugins/win/PluginViewWin.cpp:
1331         (WebCore::PluginView::bindingInstance):
1332
1333 2008-03-12  Dan Bernstein  <mitz@apple.com>
1334
1335         Suggested by Darin Adler. Reviewed by Dave Hyatt.
1336
1337         - speed up BidiIterator::direction()
1338
1339         * rendering/bidi.cpp:
1340         (WebCore::BidiIterator::current): Made inline and corrected the
1341         out-of-bounds condition to work with 0-length text and offsets beyond
1342         the end of the text.
1343         (WebCore::BidiIterator::direction): Changed to call current() and not
1344         call the virtual method isListMarker() most of the time.
1345         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
1346         (WebCore::appendRunsForObject): Ditto.
1347
1348 2008-03-12  Adam Roben  <aroben@apple.com>
1349
1350         Make URLs not be underlined while editing them in the DOM view
1351
1352         Reviewed by Tim.
1353
1354         * page/inspector/inspector.css:
1355
1356 2008-03-12  Adam Roben  <aroben@apple.com>
1357
1358         Part of Bug 17224: DOM nodes/attributes should be editable
1359
1360         <http://bugs.webkit.org/show_bug.cgi?id=17224>
1361         <rdar://problem/5732825>
1362
1363         We now start editing if the user single-clicks on an attribute,
1364         attribute value, or text node while the parent element is selected.
1365         Previously, we started editing on double-click regardless of the
1366         selection state of the element.
1367
1368         URLs in the DOM tree are now followed on Alt/Option-click, rather than
1369         on just click.
1370
1371         Reviewed by Tim.
1372
1373         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
1374         strings.
1375         * page/inspector/DocumentPanel.js:
1376         (WebInspector.DOMNodeTreeElement.onattach): Call new
1377         _makeURLSActivateOnModifiedClick.
1378         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
1379         Added. Changes the tooltip of each link in this element to indicate
1380         that Alt/Option-click will follow the URL, and sets the
1381         followOnAltClick property on each link.
1382         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
1383         selected.
1384         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
1385         being selected, start editing.
1386         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
1387         editing here. We block re-rooting of the tree if we're currently
1388         editing.
1389         (WebInspector.DOMNodeTreeElement._startEditing):
1390           - Don't do anything if we're not focused
1391           - Pass the event down to _startEditingAttribute.
1392         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
1393         anything if the event target is a URL and the Alt/Option key is
1394         pressed -- in this case we want to follow the link.
1395         (WebInspector.DOMNodeTreeElement._updateTitle): Call
1396         _makeURLsActivateOnClick again since the anchor elements have all been
1397         recreated.
1398         * page/inspector/inspector.js:
1399         (WebInspector.documentClick): If the anchor as a followOnAltClick
1400         property and the Alt/Option key is not pressed, do nothing.
1401
1402 2008-03-12  Ada Chan  <adachan@apple.com>
1403
1404         Fixed the initial value of zoom factor.
1405
1406         Reviewed by Adam.
1407
1408         * page/Frame.cpp:
1409         (WebCore::FramePrivate::FramePrivate):
1410
1411 2008-03-12  David Hyatt  <hyatt@apple.com>
1412
1413         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
1414         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
1415         are just bugs with transforms themselves).
1416
1417         Reviewed by Adam Roben
1418
1419         * css/CSSStyleSelector.cpp:
1420         (WebCore::CSSStyleSelector::applyProperty):
1421         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
1422         * dom/Document.cpp:
1423         (WebCore::Document::recalcStyle):
1424         * page/Frame.cpp:
1425         (WebCore::Frame::shouldApplyTextZoom):
1426         (WebCore::Frame::shouldApplyPageZoom):
1427         * page/Frame.h:
1428         * rendering/RenderLayer.cpp:
1429         (WebCore::RenderLayer::updateLayerPositions):
1430         (WebCore::RenderLayer::setHasVisibleContent):
1431         (WebCore::RenderLayer::paintLayer):
1432         (WebCore::RenderLayer::hitTestLayer):
1433         * rendering/RenderLayer.h:
1434
1435 2008-03-12  David Hyatt  <hyatt@apple.com>
1436
1437         Make the zoom factor a float and not a percent.
1438
1439         Reviewed by antti
1440
1441         * WebCore.base.exp:
1442         * css/CSSStyleSelector.cpp:
1443         (WebCore::CSSStyleSelector::applyProperty):
1444         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
1445         * page/Frame.cpp:
1446         (WebCore::Frame::zoomFactor):
1447         (WebCore::Frame::setZoomFactor):
1448         * page/Frame.h:
1449         * page/FramePrivate.h:
1450         * svg/SVGSVGElement.cpp:
1451         (WebCore::SVGSVGElement::currentScale):
1452         (WebCore::SVGSVGElement::setCurrentScale):
1453
1454 2008-03-12  David Hyatt  <hyatt@apple.com>
1455
1456         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
1457
1458         Reviewed by Tim H.
1459
1460         * WebCore.base.exp:
1461         * page/mac/WebCoreFrameBridge.h:
1462         * page/mac/WebCoreFrameBridge.mm:
1463
1464 2008-03-12  Dan Bernstein  <mitz@apple.com>
1465
1466         Reviewed by Darin Adler and Sam Weinig.
1467
1468         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
1469
1470         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
1471         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
1472         and CTFontRef being toll-free bridged.
1473
1474         * WebCore.Tiger.exp:
1475         * WebCore.base.exp:
1476         * platform/graphics/mac/FontMac.mm:
1477         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
1478         * platform/graphics/mac/FontPlatformData.h:
1479         Made m_cgFont a RetainPtr on Leopard.
1480         (WebCore::toCTFontRef): Added a function that encapsulates the
1481         toll-free bridging.
1482         (WebCore::FontPlatformData::FontPlatformData):
1483         (WebCore::FontPlatformData::cgFont): Added this accessor method.
1484         * platform/graphics/mac/FontPlatformDataMac.mm:
1485         (WebCore::FontPlatformData::FontPlatformData): Changed to use
1486         CoreText API on Leopard.
1487         (WebCore::FontPlatformData::setFont): Ditto.
1488         * platform/graphics/mac/SimpleFontDataMac.mm:
1489         (WebCore::initFontData):
1490         (WebCore::pathFromFont):
1491         (WebCore::SimpleFontData::platformInit):
1492         (WebCore::SimpleFontData::platformWidthForGlyph):
1493         * platform/mac/WebCoreSystemInterface.mm:
1494
1495 2008-03-12  David Harrison  <harrison@apple.com>
1496
1497         Reviewed by Darin.
1498
1499         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
1500
1501         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
1502         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
1503         Also saw that cache clearing was missing from Document::detach(), and fixed that.
1504         
1505         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
1506         
1507         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
1508        
1509         * dom/Document.cpp:
1510         (WebCore::Document::attach):
1511         Assert that there is no AX cache (since there is no renderer).
1512         
1513         (WebCore::Document::detach):
1514         Destroy the AX cache installed on this document.
1515         
1516         (WebCore::Document::clearAXObjectCache):
1517         New. Destroy the AX cache associated with this document.
1518         
1519         (WebCore::Document::axObjectCache):
1520         Added some comments.
1521         
1522         * dom/Document.h:
1523         Declare clearAXObjectCache().
1524         
1525         * page/Frame.cpp:
1526         (WebCore::Frame::disconnectOwnerElement):
1527         Destroy the AX cache associated with this frame's document.
1528         
1529         * page/mac/AXObjectCacheMac.mm:
1530         (WebCore::AXObjectCache::remove):        
1531         * page/mac/WebCoreAXObject.mm:
1532         (-[WebCoreAXObject initWithRenderer:]):
1533         (-[WebCoreAXObject detach]):
1534         * rendering/RenderObject.cpp:
1535         (WebCore::RenderObject::RenderObject):
1536         (WebCore::RenderObject::~RenderObject):
1537         * rendering/RenderObject.h:
1538         (WebCore::RenderObject::setHasAXObject):
1539         (WebCore::RenderObject::hasAXObject):
1540         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
1541         
1542         * rendering/RenderWidget.cpp:
1543         (WebCore::RenderWidget::destroy):
1544         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
1545         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
1546
1547 2008-03-12  Xan Lopez  <xan@gnome.org>
1548
1549         Reviewed by Alp Toker.
1550
1551         http://bugs.webkit.org/show_bug.cgi?id=15229
1552
1553         Add Pango font backend.
1554
1555         Original patch by Sven Herzberg <sven@imendio.com>
1556
1557         * GNUmakefile.am:
1558         * platform/graphics/gtk/FontCacheGtk.cpp:
1559         (WebCore::FontCache::fontExists):
1560         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
1561         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
1562         (WebCore::FontCustomPlatformData::fontPlatformData):
1563         (WebCore::releaseData):
1564         (WebCore::createFontCustomPlatformData):
1565         * platform/graphics/gtk/FontPlatformData.h:
1566         (WebCore::FontPlatformData::FontPlatformData):
1567         (WebCore::FontPlatformData::hash):
1568         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
1569         (WebCore::FontPlatformData::FontPlatformData):
1570         (WebCore::FontPlatformData::init):
1571         (WebCore::FontPlatformData::~FontPlatformData):
1572         (WebCore::FontPlatformData::isFixedPitch):
1573         (WebCore::FontPlatformData::setFont):
1574         (WebCore::FontPlatformData::operator==):
1575         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
1576         (WebCore::pango_font_get_glyph):
1577         (WebCore::GlyphPage::fill):
1578         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
1579         (WebCore::SimpleFontData::platformInit):
1580         (WebCore::SimpleFontData::platformDestroy):
1581         (WebCore::SimpleFontData::smallCapsFontData):
1582         (WebCore::SimpleFontData::containsCharacters):
1583         (WebCore::SimpleFontData::determinePitch):
1584         (WebCore::SimpleFontData::platformWidthForGlyph):
1585         (WebCore::SimpleFontData::setFont):
1586
1587 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
1588
1589         Reviewed by Oliver.
1590         
1591         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
1592         
1593         Fixes some (but not all) of the instances of:
1594         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
1595         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
1596
1597         * editing/InsertLineBreakCommand.cpp:
1598         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
1599         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
1600         * editing/RemoveFormatCommand.cpp:
1601         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
1602
1603 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
1604
1605         Reviewed by Darin.
1606
1607         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
1608         some sites.
1609
1610         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
1611         if the frame and subframe belong to the same site, then the encoding is inherited from parent
1612         frame to subframe. Otherwise, it is not.
1613
1614         Always inheriting the encoding would cause a security problem.
1615
1616         Tests: http/tests/misc/frame-default-enc-different-domain.html
1617                http/tests/misc/frame-default-enc-same-domain.html
1618                fast/encoding/frame-default-enc.html
1619
1620         * loader/FrameLoader.cpp:
1621         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
1622         this function also has code that uses it without checking, so it must be safe.
1623
1624 2008-03-12  Mark Rowe  <mrowe@apple.com>
1625
1626         Gtk build fix.
1627
1628         * page/Frame.h: Forward-declare FramePrivate.
1629
1630 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
1631
1632         Disable LTCG/PGO for all of WebCore for now.
1633         We'll re-enable this as part of follow-on PGO work.
1634         
1635         Reviewed by Oliver.
1636
1637         * WebCore.vcproj/WebCore.vcproj:
1638
1639 2008-03-11  Darin Adler  <darin@apple.com>
1640
1641         Reviewed by Sam.
1642
1643         - remove all bridge-related things from WebCore except the bridge itself
1644
1645         * WebCore.base.exp: Removed the bridge and setBridge functions.
1646
1647         * loader/FrameLoader.cpp:
1648         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
1649         close method.
1650
1651         * page/Frame.cpp:
1652         (WebCore::Frame::~Frame): Removed call to setBridge(0).
1653         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
1654         * page/Frame.h: Removed setBridge and bridge functions.
1655         * page/FramePrivate.h: Removed m_bridge pointer.
1656         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
1657
1658         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
1659         Removed bridgeForDOMDocument: and clearFrame methods.
1660         * page/mac/WebCoreFrameBridge.mm: Ditto.
1661         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
1662         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
1663
1664 2008-03-11  Darin Adler  <darin@apple.com>
1665
1666         - restored some code I removed in the Range change; this code can't go
1667           until the rest of the Range fix is in
1668
1669         * dom/Range.cpp:
1670         (WebCore::Range::commonAncestorContainer): Added back the check for 0
1671         that I removed erroneously in the Range patch.
1672         (WebCore::Range::processContents): Left in assertions I used to debug
1673         this.
1674
1675 2008-03-11  Darin Adler  <darin@apple.com>
1676
1677         - fix Release build
1678
1679         * platform/mac/ScrollViewMac.mm:
1680         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
1681
1682 2008-03-11  Darin Adler  <darin@apple.com>
1683
1684         Reviewed by Anders.
1685
1686         - simplify Mac code for ScrollView, since it's used only for FrameView
1687           and not in two different modes like it was historically
1688         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
1689
1690         * bindings/objc/DOMHTML.mm:
1691         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
1692
1693         * bridge/jni/jni_jsobject.cpp:
1694         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
1695         and NSView, use the WebCoreFrameView interface to do it.
1696
1697         * editing/mac/EditorMac.mm:
1698         (WebCore::Editor::paste): getDocumentView -> documentView.
1699         * editing/mac/SelectionControllerMac.mm:
1700         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
1701
1702         * page/FrameView.h: Fixed comment.
1703
1704         * page/InspectorController.cpp:
1705         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
1706         to ScrollView* since FrameView is derived from ScrollView.
1707
1708         * page/mac/EventHandlerMac.mm:
1709         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
1710         * page/mac/FrameMac.mm:
1711         (WebCore::Frame::imageFromRect): Ditto.
1712         * page/mac/WebCoreAXObject.mm:
1713         (-[WebCoreAXObject position]): Ditto.
1714         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
1715         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
1716         WebCoreBridgeHolder to use WebCoreFrameView instead.
1717
1718         * page/mac/WebCoreFrameBridge.mm:
1719         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
1720         getDocumentView -> documentView.
1721
1722         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
1723         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
1724         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
1725         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
1726         protocol, which returns a WebCore::Frame directly rather than a bridge.
1727
1728         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
1729
1730         * platform/ScrollView.h: Moved the constructor and destructor out of the
1731         class-specific #if blocks. Renamed Mac-specific function that gets the
1732         NSView for from getDocumentView to documentView and a scrollView function
1733         that returns an appropriately classed NSScrollView.
1734
1735         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
1736         instead of Widget.
1737         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1738         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
1739
1740         * platform/mac/PopupMenuMac.mm:
1741         (WebCore::PopupMenu::show): getDocumentView -> documentView.
1742         * platform/mac/ScrollViewMac.mm:
1743         (WebCore::ScrollView::ScrollView): Added.
1744         (WebCore::ScrollView::~ScrollView): Added.
1745         (WebCore::ScrollView::scrollView): Added.
1746         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
1747         (WebCore::ScrollView::visibleHeight): Ditto.
1748         (WebCore::ScrollView::visibleContentRect): Ditto.
1749         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
1750         (WebCore::ScrollView::contentsWidth): Ditto.
1751         (WebCore::ScrollView::contentsHeight): Ditto.
1752         (WebCore::ScrollView::contentsX): Ditto.
1753         (WebCore::ScrollView::contentsY): Ditto.
1754         (WebCore::ScrollView::scrollOffset): Ditto.
1755         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
1756         (WebCore::ScrollView::setContentsPos): Ditto.
1757         (WebCore::ScrollView::setVScrollbarMode): Ditto.
1758         (WebCore::ScrollView::setHScrollbarMode): Ditto.
1759         (WebCore::ScrollView::setScrollbarsMode): Ditto.
1760         (WebCore::ScrollView::vScrollbarMode): Ditto.
1761         (WebCore::ScrollView::hScrollbarMode): Ditto.
1762         (WebCore::ScrollView::suppressScrollbars): Ditto.
1763         (WebCore::ScrollView::addChild): Ditto.
1764         (WebCore::ScrollView::resizeContents): Ditto.
1765         (WebCore::ScrollView::updateContents): Ditto.
1766         (WebCore::ScrollView::contentsToWindow): Ditto.
1767         (WebCore::ScrollView::windowToContents): Ditto.
1768         (WebCore::ScrollView::setStaticBackground): Ditto.
1769         (WebCore::ScrollView::documentView): Renamed and removed unused case.
1770         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
1771
1772         * platform/mac/WidgetMac.mm:
1773         (WebCore::Widget::getOuterView): Update for protocol name change.
1774
1775         * rendering/RenderThemeMac.mm:
1776         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
1777         (WebCore::RenderThemeMac::paintRadio): Ditto.
1778         (WebCore::RenderThemeMac::paintButton): Ditto.
1779         (WebCore::RenderThemeMac::paintMenuList): Ditto.
1780         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
1781         (WebCore::RenderThemeMac::paintSearchField): Ditto.
1782         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
1783         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
1784         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
1785
1786 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
1787
1788         Reviewed by Adam Roben.
1789
1790         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
1791         reduce the massive amount of conditionalization in the file.
1792         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
1793
1794         * WebCore.vcproj/WebCore.vcproj:
1795         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
1796         (WebCore::setCookies):
1797         (WebCore::cookies):
1798         (WebCore::cookiesEnabled):
1799         * platform/network/win/CookieJarWin.cpp:
1800         (WebCore::setCookies):
1801         (WebCore::cookies):
1802         (WebCore::cookiesEnabled):
1803
1804 2008-03-11  Darin Adler  <darin@apple.com>
1805
1806         Reviewed by Sam.
1807
1808         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
1809
1810         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
1811         that were formerly handled by the bridge.
1812
1813         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
1814         functions to a ScriptController section. Removed willPopupMenu.
1815
1816         * page/mac/ChromeMac.mm:
1817         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
1818         via the client instead of the bridge.
1819
1820         * page/mac/EventHandlerMac.mm:
1821         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
1822         and makeFirstResponder via the chrome client instead of the bridge.
1823
1824         * page/mac/FrameMac.mm: Removed willPopupMenu.
1825
1826         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
1827         SubclassResponsibility category. Also removed some unneeded imports.
1828
1829         * platform/mac/PopupMenuMac.mm:
1830         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
1831
1832         * platform/mac/WidgetMac.mm:
1833         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
1834         calling via the bridge.
1835
1836 2008-03-11  Darin Adler  <darin@apple.com>
1837
1838         Reviewed by Mitz.
1839
1840         - make some Range improvements (preparation for Range support for DOM mutation)
1841
1842         Made constructors private, added create functions.
1843         Made refcount start at 1 rather than starting at 0 and being incremented.
1844         Made Range use two Position objects for the start/end container/offset pairs.
1845
1846         * WebCore.base.exp: Updated.
1847
1848         * dom/Document.cpp:
1849         (WebCore::Document::createRange): Changed to use Range::create.
1850         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
1851
1852         * dom/Position.cpp:
1853         (WebCore::Position::formatForDebugger): Updated for member variable name change.
1854         (WebCore::Position::showTreeForThis): Ditto.
1855         (WebCore::startPosition): Changed to use Range::startPosition.
1856         (WebCore::endPosition): Changed to use Range::endPosition.
1857
1858         * dom/Position.h: Made the data members public and renamed them to container
1859         and offset. But since offset() is already a function, temporarily used posOffset
1860         for the data member. Later we'll get rid of offset(). Made more functions inline.
1861         Removed the constructor that takes a PositionIterator.
1862
1863         * dom/PositionIterator.cpp:
1864         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
1865         that used to be in Position.
1866         * dom/PositionIterator.h: Added conversion operator to produce a Position.
1867         Removed friend declaration for Position.
1868
1869         * dom/Range.cpp:
1870         (WebCore::Range::Range): Updated constructors for data member changes and made
1871         them use a refcount of 1.
1872         (WebCore::Range::create): Added.
1873         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
1874         is now indicated by m_start.container of 0. Also updated to use m_start instead
1875         of the old m_startContainer.
1876         (WebCore::Range::startOffset): Ditto.
1877         (WebCore::Range::endContainer): Ditto.
1878         (WebCore::Range::endOffset): Ditto.
1879         (WebCore::Range::commonAncestorContainer): Ditto.
1880         (WebCore::Range::collapsed): Ditto.
1881         (WebCore::Range::setStart): Ditto.
1882         (WebCore::Range::setEnd): Ditto.
1883         (WebCore::Range::collapse): Ditto.
1884         (WebCore::Range::isPointInRange): Ditto.
1885         (WebCore::Range::comparePoint): Ditto.
1886         (WebCore::Range::compareNode): Ditto.
1887         (WebCore::Range::compareBoundaryPoints): Ditto.
1888         (WebCore::Range::boundaryPointsValid): Ditto.
1889         (WebCore::Range::deleteContents): Ditto.
1890         (WebCore::Range::intersectsNode): Ditto.
1891         (WebCore::Range::processContents): Ditto.
1892         (WebCore::Range::extractContents): Ditto.
1893         (WebCore::Range::cloneContents): Ditto.
1894         (WebCore::Range::insertNode): Ditto.
1895         (WebCore::Range::toString): Ditto.
1896         (WebCore::Range::text): Ditto.
1897         (WebCore::Range::createContextualFragment): Ditto.
1898         (WebCore::Range::detach): Ditto.
1899         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
1900         multiple calls to the virtual nodeType() function.
1901         (WebCore::Range::cloneRange): Ditto.
1902         (WebCore::Range::setStartAfter): Ditto.
1903         (WebCore::Range::setEndBefore): Ditto.
1904         (WebCore::Range::setEndAfter): Ditto.
1905         (WebCore::Range::selectNode): Ditto.
1906         (WebCore::Range::selectNodeContents): Ditto.
1907         (WebCore::Range::surroundContents): Ditto.
1908         (WebCore::Range::setStartBefore): Ditto.
1909         (WebCore::Range::checkDeleteExtract): Ditto.
1910         (WebCore::Range::containedByReadOnly): Ditto.
1911         (WebCore::Range::firstNode): Ditto.
1912         (WebCore::Range::editingStartPosition): Ditto.
1913         (WebCore::Range::pastLastNode): Ditto.
1914         (WebCore::Range::addLineBoxRects): Ditto.
1915         (WebCore::Range::formatForDebugger): Ditto.
1916         (WebCore::operator==): Ditto.
1917         (WebCore::rangeOfContents): Ditto.
1918         (WebCore::Range::maxStartOffset): Ditto.
1919         (WebCore::Range::maxEndOffset): Ditto.
1920
1921         * dom/Range.h: Made constructors private. Added create functions.
1922         Added getters for startContainer/Offset and endContainer/Offset that
1923         return 0 instead of an exception for detached ranges that are inline
1924         and don't require an ExceptionCode out parameter. Changed the parameters
1925         to setStart and setEnd to PassRefPtr. Removed isDetached function.
1926         Made ActionType and processContents private. Made startPosition and
1927         endPosition inlines and have then return const&. Renamed startNode and
1928         pastEndNode to firstNode and pastLastNode to reduce the chance of
1929         confusion with startContainer/endContainer. Used Position for m_start
1930         and m_end instead of separate container and offset members. Changed
1931         maxStartOffset and maxEndOffset into int to match other offsets.
1932
1933         * editing/ApplyStyleCommand.cpp:
1934         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
1935         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
1936         * editing/CompositeEditCommand.cpp:
1937         (WebCore::CompositeEditCommand::inputText): Ditto.
1938         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
1939         * editing/DeleteSelectionCommand.cpp:
1940         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
1941         * editing/Editor.cpp:
1942         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
1943         (WebCore::Editor::setComposition): Changed to use Range::create.
1944         (WebCore::paragraphAlignedRangeForRange): Ditto.
1945         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
1946         isDetached and check for 0 from startContainer instead.
1947         (WebCore::Editor::compositionRange): Changed to use Range::create.
1948         * editing/EditorCommand.cpp:
1949         (WebCore::unionDOMRanges): Ditto.
1950         * editing/Selection.cpp:
1951         (WebCore::Selection::toRange): Ditto.
1952         * editing/TextIterator.cpp:
1953         (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
1954         name change.
1955         (WebCore::TextIterator::range): Changed to use Range::create.
1956         (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
1957         (WebCore::TextIterator::subrange): Ditto.
1958         * editing/VisiblePosition.cpp:
1959         (WebCore::makeRange): Ditto.
1960         * editing/VisiblePosition.h: Added now-needed include.
1961         * editing/htmlediting.cpp:
1962         (WebCore::indexForVisiblePosition): Changed to use Range::create.
1963         (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
1964         isDetached and check for 0 instead and to use Range::create.
1965         * editing/markup.cpp:
1966         (WebCore::renderedText): Changed to use Range::create.
1967         (WebCore::createMarkup): Changed to no longer use isDetached and also
1968         for new firstNode/pastEndNode names.
1969         (WebCore::createFragmentFromText): Ditto.
1970         * editing/visible_units.cpp:
1971         (WebCore::previousBoundary): Changed to use Range::create.
1972         * page/mac/WebCoreFrameBridge.mm:
1973         (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
1974         isDetached().
1975         * rendering/RenderTextControl.cpp:
1976         (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
1977         (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
1978
1979 2008-03-11  Daniel Zucker <zucker@wake3.com>
1980
1981         Reviewed by Adam Roben.
1982
1983         There are a handful of placed where the use of CFNetwork-specific
1984         calls are protected by PLATFORM(CF).  Revise to use the more specific
1985         USE(CFNETWORK) macro.  (See http://bugs.webkit.org/show_bug.cgi?id=17783) 
1986
1987         * platform/network/ProtectionSpace.cpp:  Change PLATFORM(CF) to USE(CFNETWORK)
1988         * platform/network/ResourceHandle.cpp: Change PLATFORM(CF) to USE(CFNETWORK)
1989         * platform/network/win/CookieJarWin.cpp:  Correct error in
1990           InternetGetCookie call.  Conditionalize 'cookiesEnabled' the same
1991           as all other implementations in this file.
1992
1993 2008-03-11  Xan Lopez  <xan@gnome.org>
1994
1995         Reviewed by Alp Toker.
1996
1997         http://bugs.webkit.org/show_bug.cgi?id=16476
1998
1999         Add libsoup HTTP backend.
2000         
2001         * GNUmakefile.am:
2002         * platform/network/ResourceHandleInternal.h:
2003         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2004         * platform/network/soup/AuthenticationChallenge.h: Added.
2005         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2006         * platform/network/soup/ResourceError.h: Added.
2007         (WebCore::ResourceError::ResourceError):
2008         * platform/network/soup/ResourceHandleSoup.cpp: Added.
2009         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2010         (WebCore::ResourceHandle::~ResourceHandle):
2011         (WebCore::dataCallback):
2012         (WebCore::parseDataUrl):
2013         (WebCore::ResourceHandle::start):
2014         (WebCore::ResourceHandle::cancel):
2015         (WebCore::ResourceHandle::bufferedData):
2016         (WebCore::ResourceHandle::supportsBufferedData):
2017         (WebCore::ResourceHandle::setDefersLoading):
2018         (WebCore::ResourceHandle::loadsBlocked):
2019         (WebCore::ResourceHandle::willLoadFromCache):
2020         * platform/network/soup/ResourceRequest.h: Copied from WebCore/platform/network/curl/ResourceRequest.h.
2021         (WebCore::ResourceRequest::ResourceRequest):
2022         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2023         * platform/network/soup/ResourceResponse.h: Added.
2024         (WebCore::ResourceResponse::ResourceResponse):
2025         (WebCore::ResourceResponse::setResponseFired):
2026         (WebCore::ResourceResponse::responseFired):
2027         (WebCore::ResourceResponse::doUpdateResourceResponse):
2028
2029 2008-03-11  Rodney Dawes  <dobey@wayofthemonkey.com>
2030
2031         Fix Qt build.
2032
2033         * plugins/qt/PluginDataQt.cpp:
2034         (PluginData::initPlugins)
2035
2036 2008-03-11  Adam Roben  <aroben@apple.com>
2037
2038         Make attribute quoting in DOM view more consistent with source view
2039
2040         Two changes which make the DOM view more consistent with source view:
2041          1) We now quote all attribute values, including URLs
2042          2) The quotes around the values are now purple, matching the left and
2043             right angle brackets that surround the tag
2044
2045         One bug fixed by these changes:
2046          1) The entire URL is selected for editing when you double-click a URL
2047             that is an attribute value. Previously, the first and last
2048             characters were not included in the selection.
2049
2050         Reviewed by Darin.
2051
2052         * page/inspector/DocumentPanel.js:
2053         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
2054         to account for the quotes around attribute values anymore because the
2055         quotes are now outside the webkit-html-attribute-value span.
2056         * page/inspector/utilities.js:
2057         (nodeTitleInfo): Quote all attribute values, including URLs, and place
2058         the quotes outside the webkit-html-attribute-value span.
2059
2060 2008-03-11  Adam Roben  <aroben@apple.com>
2061
2062         Stop including pthread.h in WebCore on Windows
2063
2064         Reviewed by Darin.
2065
2066         * WebCore.vcproj/WebCore.vcproj:
2067           - Changed the include path to not contain pthreads/
2068           - Let VS remove a duplicate FileConfiguration element
2069           - Let VS have its way with the file ordering
2070         * WebCorePrefix.h: Made the #include of pthread.h be compiled out on
2071         Windows.
2072         * loader/FTPDirectoryDocument.cpp: Added a Windows-specific #define of
2073         localtime_r (pthread.h was providing a macro that substituted plain
2074         old localtime before, but localtime_s is "more secure", so I went with
2075         that).
2076         * loader/FTPDirectoryParser.cpp: Ditto for gmtime_r.
2077
2078 2008-03-11  Adam Roben  <aroben@apple.com>
2079
2080         Roll out r30961 since it broke the default site icon on Windows
2081
2082         * loader/icon/IconDatabase.cpp:
2083         (WebCore::IconDatabase::defaultIcon):
2084
2085 2008-03-11  Dan Bernstein  <mitz@apple.com>
2086
2087         Reviewed by Darin Adler.
2088
2089         - clean up line layout code
2090
2091         * platform/graphics/GraphicsContext.cpp:
2092         (WebCore::TextRunIterator::increment): Removed the resolver parameter.
2093         (WebCore::GraphicsContext::drawBidiText): Adjusted for changes to
2094         createBidiRunsForLine(), which no longer takes a start parameter.
2095         * platform/text/BidiResolver.h:
2096         (WebCore::BidiResolver::): Made Noncopyable and removed the
2097         m_adjustEmbedding member variable.
2098         (WebCore::BidiResolver::position): Added. Returns the resolver's current
2099         position.
2100         (WebCore::BidiResolver::setPosition): Added. Sets the resolver's current
2101         position without changing any other state.
2102         (WebCore::BidiResolver::increment): Added. Advances the resolver to the
2103         next position, allowing the iterator to push and pop embedding.
2104         (WebCore::BidiResolver::appendRun): Removed the resolver parameter in
2105         the call to increment().
2106         (WebCore::BidiResolver::embed): Removed code to save, set and restore
2107         m_adjustEmbedding.
2108         (WebCore::BidiResolver::createBidiRunsForLine): Changed to not take a
2109         'start' iterator. Instead, start at the current position. Removed code
2110         to set m_adjustEmbedding. Changed for noncopyability.
2111         * rendering/RenderBlock.h:
2112         * rendering/bidi.cpp:
2113         (WebCore::bidiNext): Made the resolver parameter optional. Changed to
2114         null-check the 'end of inline' pointer only twice.
2115         (WebCore::bidiFirst): Made the resolver parameter optional.
2116         (WebCore::BidiIterator::increment): Ditto.
2117         (WebCore::BidiState::increment): Added. Overrides the default
2118         BidiResolver::increment() method by passing the resolver to
2119         BidiIterator::increment().
2120         (WebCore::checkMidpoints): Removed the resolver parameter.
2121         (WebCore::BidiState::appendRun): Removed code to save, set and restore
2122         m_adjustEmbedding. Adjusted for change to increment().
2123         (WebCore::RenderBlock::bidiReorderLine): Removed the 'start' parameter
2124         and unreachable code.
2125         (WebCore::buildCompactRuns): Adjusted for changes to BidiResolver/
2126         (WebCore::RenderBlock::layoutInlineChildren): Moved code to initialize
2127         the resolver from this method to determineStartPosition(). Unified the
2128         resolver with the 'start' iterator. Removed unreachable code. Moved one
2129         statement from the beginning of the while loop to the end.
2130         (WebCore::RenderBlock::determineStartPosition): Moved code to initialize
2131         the resolver from layoutInlineChildren() into this method.
2132         (WebCore::RenderBlock::matchedEndLine): Adjusted for the resolver and
2133         the 'start' iterator being one object.
2134         (WebCore::skipNonBreakingSpace): Made the parameter const.
2135         (WebCore::requiresLineBox): Ditto.
2136         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Adjusted for
2137         the change to BidiIterator::increment().
2138         (WebCore::RenderBlock::skipWhitespace): Made two versions of this
2139         method, one for BidiIterator and one for BidiState.
2140         (WebCore::shouldSkipWhitespaceAfterStartObject): Removed the resolver
2141         parameter.
2142         (WebCore::RenderBlock::findNextLineBreak): Removed the resolver
2143         parameter. Removed calls to setAdjustEmbedding(). Removed the 'previous'
2144         variable and changed the 'last' variable to do its job.
2145         * rendering/bidi.h:
2146
2147 2008-03-10  Adam Roben  <aroben@apple.com>
2148
2149         Part of Bug 17224: DOM nodes/attributes should be editable
2150
2151         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2152         <rdar://problem/5732825>
2153
2154         This patch makes text nodes editable via double-click.
2155
2156         Reviewed by Tim.
2157
2158         * page/inspector/DocumentPanel.js:
2159         (WebInspector.DOMNodeTreeElement._startEditing):
2160           - Moved most of this code to _startEditingAttribute
2161           - Calls _startEditingTextNode or _startEditingAttribute as
2162             appropriate
2163         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Added. Code
2164         came from _startEditing.
2165         (WebInspector.DOMNodeTreeElement._startEditingTextNode): Added.
2166         (WebInspector.DOMNodeTreeElement._textNodeEditingCommitted): Added.
2167         (WebInspector.DOMNodeTreeElement._editingCancelled): Renamed from
2168         _attributeEditingCancelled.
2169         * page/inspector/utilities.js:
2170         (nodeTitleInfo): Wrap text nodes in a webkit-html-text-node span so
2171         that we can easily recognize/edit them.
2172
2173 2008-03-11  Holger Hans Peter Freyther  <zecke@selfish.org>
2174
2175         Reviewed by Darin.
2176
2177         r25512 inlined the urlIcon to improve the startup time of Safari on Mac. Inlining is
2178         not suitable for platforms where this icon is themable. E.g. the Qt platform is allowing
2179         to theme this icon and the Gtk+ platform will probably end up with themable icons
2180         as well.
2181         
2182         Remove dead code from the windows port and move the urlIcon from the windows
2183         directory to the Resource directory to be used by Qt and other ports.
2184         
2185         Ifdef the usage of the built-in icon in IconDatabase.cpp and for Qt do not use
2186         it. Gtk+ currently has no proper implementation of Image::loadPlatformResource but
2187         once it does it wants to use this for getting the urlIcon as well.
2188
2189         * Resources/urlIcon.png: Renamed from WebKit/win/WebKit.vcproj/urlIcon.png.
2190         * loader/icon/IconDatabase.cpp:
2191         (WebCore::IconDatabase::defaultIcon):
2192
2193 2008-03-11  Tor Arne Vestbø  <tavestbo@trolltech.com>
2194
2195         Reviewed by Darin.
2196
2197         Implemented HTML media element support for QtWebKit, using Phonon.
2198
2199         http://bugs.webkit.org/show_bug.cgi?id=17766
2200
2201         * WebCore.pro:
2202         * platform/graphics/MediaPlayer.cpp:
2203         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: Added.
2204         (debugMediaObject):
2205         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
2206         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
2207         (WebCore::MediaPlayerPrivate::getSupportedTypes):
2208         (WebCore::MediaPlayerPrivate::hasVideo):
2209         (WebCore::MediaPlayerPrivate::load):
2210         (WebCore::MediaPlayerPrivate::cancelLoad):
2211         (WebCore::MediaPlayerPrivate::play):
2212         (WebCore::MediaPlayerPrivate::pause):
2213         (WebCore::MediaPlayerPrivate::paused):
2214         (WebCore::MediaPlayerPrivate::seek):
2215         (WebCore::MediaPlayerPrivate::seeking):
2216         (WebCore::MediaPlayerPrivate::duration):
2217         (WebCore::MediaPlayerPrivate::currentTime):
2218         (WebCore::MediaPlayerPrivate::setEndTime):
2219         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
2220         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
2221         (WebCore::MediaPlayerPrivate::bytesLoaded):
2222         (WebCore::MediaPlayerPrivate::totalBytesKnown):
2223         (WebCore::MediaPlayerPrivate::totalBytes):
2224         (WebCore::MediaPlayerPrivate::setRate):
2225         (WebCore::MediaPlayerPrivate::setVolume):
2226         (WebCore::MediaPlayerPrivate::setMuted):
2227         (WebCore::MediaPlayerPrivate::dataRate):
2228         (WebCore::MediaPlayerPrivate::networkState):
2229         (WebCore::MediaPlayerPrivate::readyState):
2230         (WebCore::MediaPlayerPrivate::updateStates):
2231         (WebCore::MediaPlayerPrivate::setVisible):
2232         (WebCore::MediaPlayerPrivate::setRect):
2233         (WebCore::MediaPlayerPrivate::loadStateChanged):
2234         (WebCore::MediaPlayerPrivate::rateChanged):
2235         (WebCore::MediaPlayerPrivate::sizeChanged):
2236         (WebCore::MediaPlayerPrivate::timeChanged):
2237         (WebCore::MediaPlayerPrivate::volumeChanged):
2238         (WebCore::MediaPlayerPrivate::didEnd):
2239         (WebCore::MediaPlayerPrivate::loadingFailed):
2240         (WebCore::MediaPlayerPrivate::naturalSize):
2241         (WebCore::MediaPlayerPrivate::eventFilter):
2242         (WebCore::MediaPlayerPrivate::repaint):
2243         (WebCore::MediaPlayerPrivate::paint):
2244         (WebCore::MediaPlayerPrivate::stateChanged):
2245         (WebCore::MediaPlayerPrivate::tick):
2246         (WebCore::MediaPlayerPrivate::metaDataChanged):
2247         (WebCore::MediaPlayerPrivate::seekableChanged):
2248         (WebCore::MediaPlayerPrivate::hasVideoChanged):
2249         (WebCore::MediaPlayerPrivate::bufferStatus):
2250         (WebCore::MediaPlayerPrivate::finished):
2251         (WebCore::MediaPlayerPrivate::currentSourceChanged):
2252         (WebCore::MediaPlayerPrivate::aboutToFinish):
2253         (WebCore::MediaPlayerPrivate::prefinishMarkReached):
2254         (WebCore::MediaPlayerPrivate::totalTimeChanged):
2255         * platform/graphics/qt/MediaPlayerPrivatePhonon.h: Added.
2256         (WebCore::MediaPlayerPrivate::):
2257         (WebCore::MediaPlayerPrivate::isAvailable):
2258
2259 2008-03-10  Sam Weinig  <sam@webkit.org>
2260
2261         Reviewed by Beth Dakin.
2262
2263         Throw a SECURITY_ERR when accessing a tainted canvas
2264         by CanvasRenderingContext2D::getImageData() and
2265         HTMLCanvasElement::toDataURL().
2266
2267         * html/CanvasRenderingContext2D.cpp:
2268         (WebCore::CanvasRenderingContext2D::getImageData):
2269         * html/CanvasRenderingContext2D.h:
2270         * html/CanvasRenderingContext2D.idl:
2271         * html/HTMLCanvasElement.cpp:
2272         (WebCore::HTMLCanvasElement::toDataURL):
2273         * html/HTMLCanvasElement.h:
2274         * html/HTMLCanvasElement.idl:
2275
2276 2008-03-10  Justin Garcia  <justin.garcia@apple.com>
2277
2278         Reviewed by Sam.
2279
2280         <rdar://problem/5779984> REGRESSION (r30391): GMail: Safari won't display the Edit Link dialog
2281
2282         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2283         (WebCore::hasCSSPropertyNamePrefix): Fixed a typo.  The code was only
2284         comparing the first character of the prefix to the first character
2285         of the property name.
2286
2287 2008-03-10  Andre Boule  <aboule@apple.com>
2288
2289         Reviewed by Beth.
2290
2291         Hold off on initializing the frame to avoid the RenderView getting 
2292         a null FrameView. This could potentially cause problems.
2293
2294         * svg/graphics/SVGImage.cpp:
2295         (WebCore::SVGImage::dataChanged):
2296
2297 2008-03-10  Darin Adler  <darin@apple.com>
2298
2299         - try to fix Qt build
2300
2301         * bridge/qt/qt_runtime.cpp:
2302         (KJS::Bindings::convertQVariantToValue): Change KJS::UChar to UChar.
2303
2304 2008-03-10  Darin Adler  <darin@apple.com>
2305
2306         Reviewed by Antti.
2307
2308         - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
2309           should be redrawn as visited immediately
2310         - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
2311           the visited URL at directory.umi
2312         - fix http://bugs.webkit.org/show_bug.cgi?id=4941
2313           Visited links should be marked as visited
2314         - fix http://bugs.webkit.org/show_bug.cgi?id=7960
2315           REGRESSION: Visited link color doesn't displayed after loading page from cache
2316
2317         We now mark all links on a page as "changed" at the appropriate times.
2318
2319         * WebCore.base.exp: Update since I made completeURL be a const member function.
2320
2321         * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
2322         into locals. Also changed some static data members to file-scoped globals with
2323         internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
2324         prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
2325         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
2326         (WebCore::parseUASheet): Tweak the comment.
2327         (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
2328         use local variables instead of globals where possible.
2329         (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
2330         it can store the link in a hash. Also changed it to have a return value instead
2331         of having it modify a global variable. Added code to put the hash into a set so
2332         we can tell later if this is one of the links that affects this page.
2333         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
2334         checkPseudoState.
2335         (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
2336         (WebCore::CSSStyleSelector::styleForElement): Ditto.
2337         (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
2338         (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
2339         the SVG style sheet to use a boolean global and put it right here in the function
2340         since this is the only code that needs to know about it.
2341         (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
2342         (WebCore::colorForCSSValue): Moved code inside the function that is not needed
2343         anywhere else.
2344         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
2345         to checkPseudoState.
2346         (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
2347         all links if there were any in the set.
2348         (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
2349         links if the one that changed is in the set.
2350
2351         * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
2352         CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
2353         didn't need to be public, and removed others that could be made into non-member
2354         functions. Changed pseudoStyleRulesForElement to take a const String& instead of
2355         a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
2356         Got rid of unneeded friend declarations.
2357
2358         * dom/Document.cpp:
2359         (WebCore::Document::completeURL): Made const.
2360         (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
2361         (WebCore::findSlashSlash): Ditto.
2362         (WebCore::findSlashDotSlash): Ditto.
2363         (WebCore::containsColonSlashSlash):
2364         (WebCore::cleanPath): Ditto.
2365         (WebCore::matchLetter): Ditto.
2366         (WebCore::needsTrailingSlash): Ditto.
2367         (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
2368         the poor-man's completeURL function. The idea of putting it here is that this
2369         way it can be alongside the real completeURL function. Later we should figure out
2370         a way to make this function share more code with the real thing and match behavior.
2371
2372         * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
2373
2374         * page/DOMWindow.cpp:
2375         (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
2376
2377         * page/Page.cpp:
2378         (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
2379         style selectors.
2380         (WebCore::Page::visitedStateChanged): Ditto.
2381         * page/Page.h: Added the above functions.
2382
2383         * page/PageGroup.cpp:
2384         (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
2385         The CSSStyleSelector now handles actually computing the hash, and it does so by
2386         calling code in Document.
2387         (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
2388         a bit more code. Added code that calls visitedStateChanged if a new link was added.
2389         (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
2390         if any visited links are removed.
2391         * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
2392         definition here.
2393
2394         * platform/text/StringHash.h:
2395         (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
2396         the StringImpl::computeHash function, using the same technique for avoiding 0.
2397         (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
2398         (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
2399
2400         * rendering/RenderStyle.cpp:
2401         (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
2402         of getting directly at a data member so the data member could be made private.
2403
2404         * loader/FrameLoader.cpp:
2405         (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
2406         (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
2407         * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
2408
2409 2008-03-10  Adam Roben  <aroben@apple.com>
2410
2411         Part of Bug 17224: DOM nodes/attributes should be editable
2412
2413         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2414         <rdar://problem/5732825>
2415
2416         This patch makes DOM attributes editable via double-click.
2417
2418         Reviewed by Tim.
2419
2420         * page/inspector/DocumentPanel.js:
2421         (WebInspector.DOMNodeTreeElement.onmousedown): Don't do anything if
2422         we're being edited, since we want default editing behaviors to work.
2423         (WebInspector.DOMNodeTreeElement.ondblclick): Try to start editing
2424         before doing anything else.
2425         (WebInspector.DOMNodeTreeElement._startEditing): Added. Currently only
2426         lets you edit attributes.
2427         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added.
2428         Uses a scratch element to get the new attribute(s) parsed, then sets
2429         the attribute(s) on the node in the inspected document.
2430         (WebInspector.DOMNodeTreeElement._attributeEditingCancelled): Added.
2431         (WebInspector.DOMNodeTreeElement._updateTitle): Added. Refreshes the
2432         representation of the node in the Inspector's DOM tree to reflect
2433         the node's current state.
2434         * page/inspector/inspector.css: Made the .editing class apply
2435         everywhere.
2436         * page/inspector/utilities.js:
2437         (nodeTitleInfo): Changed to surround attribute name/value pairs in a
2438         webkit-html-attribute span so that we can easily edit the pair as a
2439         whole.
2440
2441 2008-03-10  David Kilzer  <ddkilzer@apple.com>
2442
2443         Fix 64-bit builds.
2444
2445         Reviewed by Stephanie.
2446
2447         WebCore.exp only gets generated once for both 32-bit and 64-bit builds,
2448         so we must exclude the _NPN symbols when creating WebCore.LP64.exp.
2449
2450         * WebCore.xcodeproj/project.pbxproj: Reverted build phase shell code to
2451         r30826 to remove _NPN symbols from 64-bit builds in WebCore.LP64.exp.
2452
2453 2008-03-10  Eric Seidel  <eric@webkit.org>
2454
2455         Reviewed by Darin.
2456
2457         Remove KJS::UChar, use ::UChar instead
2458         http://bugs.webkit.org/show_bug.cgi?id=17017
2459
2460         To functional changes, thus no tests.
2461
2462         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2463         (WebCore::hasCSSPropertyNamePrefix):
2464         (WebCore::cssPropertyName):
2465         * bindings/js/JSDOMWindowBase.cpp:
2466         (WebCore::windowProtoFuncAToB):
2467         (WebCore::windowProtoFuncBToA):
2468         * bindings/js/JSSVGPODTypeWrapper.h:
2469         * bindings/js/kjs_proxy.cpp:
2470         (WebCore::KJSProxy::evaluate):
2471         * bridge/objc/objc_utility.mm:
2472         (KJS::Bindings::throwError):
2473         * dom/Document.cpp:
2474         (WebCore::Document::parseQualifiedName):
2475         * platform/text/AtomicString.cpp:
2476         (WebCore::AtomicString::add):
2477         * platform/text/String.cpp:
2478         (WebCore::String::String):
2479         (WebCore::String::operator Identifier):
2480         (WebCore::String::operator UString):
2481         * platform/text/TextCodecICU.cpp:
2482         (WebCore::TextCodecICU::decode):
2483         * svg/SVGAnimatedTemplate.h:
2484
2485 2008-03-10  Darin Adler  <darin@apple.com>
2486
2487         Reviewed by Sam.
2488
2489         - eliminate keyboard UI mode method from WebCoreFrameBridge
2490
2491         * page/ChromeClient.h: Added keyboardUIMode function.
2492         (WebCore::ChromeClient::keyboardUIMode): Ditto.
2493         * page/mac/EventHandlerMac.mm:
2494         (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
2495         of bridge function.
2496         * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
2497         ones.
2498
2499         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
2500         Do not try to fight the Xcode.
2501
2502 2008-03-10  Darin Adler  <darin@apple.com>
2503
2504         - oops, forgot to save last couple changes from the editor
2505
2506         * bindings/js/JSDOMWindowCustom.cpp:
2507         (WebCore::markDOMObjectWrapper): Tweaked a tiny bit.
2508         (WebCore::JSDOMWindow::mark): Sorted alphabetically.
2509
2510 2008-03-10  Darin Adler  <darin@apple.com>
2511
2512         Reviewed by Geoff.
2513
2514         - fix failing regression test (window.navigator is getting garbage
2515           collected and thus losing its custom properties)
2516
2517         * bindings/js/JSDOMWindowCustom.cpp:
2518         (WebCore::markDOMObject): Added helper function.
2519         (WebCore::JSDOMWindow::mark): Added. Marks the wrappers for all the objects that hang
2520         off the window object.
2521
2522         * page/DOMWindow.h:
2523         (WebCore::DOMWindow::optionalScreen): Added so we can get the Screen object without
2524         creating it if it's already there.
2525         (WebCore::DOMWindow::optionalSelection): Ditto.
2526         (WebCore::DOMWindow::optionalHistory): Ditto.
2527         (WebCore::DOMWindow::optionalLocationbar): Ditto.
2528         (WebCore::DOMWindow::optionalMenubar): Ditto.
2529         (WebCore::DOMWindow::optionalPersonalbar): Ditto.
2530         (WebCore::DOMWindow::optionalScrollbars): Ditto.
2531         (WebCore::DOMWindow::optionalStatusbar): Ditto.
2532         (WebCore::DOMWindow::optionalToolbar): Ditto.
2533         (WebCore::DOMWindow::optionalConsole): Ditto.
2534         (WebCore::DOMWindow::optionalNavigator): Ditto.
2535
2536         * page/DOMWindow.idl: Added the CustomMarkFunction flag. Sorted the flags in
2537         alphabetical order since there are a lot of them.
2538
2539 2008-03-10  Darin Adler  <darin@apple.com>
2540
2541         Reviewed by Sam.
2542
2543         - eliminate Java applet methods from WebCoreFrameBridge
2544
2545         * loader/FrameLoaderClient.h: Added a javaApplet function.
2546         * page/mac/FrameMac.mm:
2547         (WebCore::Frame::createScriptInstanceForWidget): Streamlined the code.
2548         Use the loader client instead of the bridge to get the applet.
2549         * page/mac/WebCoreFrameBridge.h: Removed the getAppletInView and
2550         pollForAppletInView methods. Also removed other unused things.
2551
2552 2008-03-10  Marc-Antoine Ruel  <maruel@gmail.com>
2553
2554         Reviewed by Eric, landed by Darin.
2555
2556         http://bugs.webkit.org/show_bug.cgi?id=16095
2557         Move GraphicsContextPrivate to its own header file.
2558
2559         Moves GraphicsContextState and GraphicsContextPrivate to its
2560         own header
2561
2562         * WebCore.vcproj/WebCore.vcproj:
2563         * platform/graphics/GraphicsContext.cpp:
2564         * platform/graphics/GraphicsContextPrivate.h: Added.
2565         (WebCore::GraphicsContextState::GraphicsContextState):
2566         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
2567
2568 2008-03-10  Julien Chaffraix  <julien.chaffraix@gmail.com>
2569
2570         Reviewed and landed by Darin.
2571
2572         bug 12182 : XMLHttpRequest should raise SECURITY_ERR for same-origin policy violations
2573
2574         Removed reference to PERMISSION_DENIED (previous non standard exception) and replaced it
2575         by DOM exception SECURITY_ERR. Updated XMLHttpRequest::open to raise SECURITY_ERR.
2576
2577         * bindings/js/kjs_binding.cpp:
2578         (WebCore::setDOMException): Removed PERMISSION_DENIED code.
2579         * dom/ExceptionCode.cpp: Added SECURITY_ERR exception.
2580         * dom/ExceptionCode.h: Ditto.
2581         * xml/XMLHttpRequest.cpp:
2582         (WebCore::XMLHttpRequest::open): Returns SECURITY_ERR now.
2583         * xml/XMLHttpRequestException.h: Removed PERMISSION_DENIED.
2584
2585 2008-03-09  Adam Roben  <aroben@apple.com>
2586
2587         Refactor CSS editing code so we can share it with DOM editing
2588
2589         Add WebInspector.startEditing, which takes the element to be edited, a
2590         committedCallback, a cancelledCallback, and a context parameter. This
2591         function takes care of setting up the element for editing, and calls
2592         either the cancelledCallback or committedCallback when editing ends.
2593
2594         Reviewed by Tim.
2595
2596         * page/inspector/StylesSidebarPane.js:
2597         (WebInspector.StylePropertyTreeElement.startEditing):
2598           - Call WebInspector.isBeingEdited and WebInspector.startEditing
2599           - Removed code now handled by WebInspector.startEditing
2600         (WebInspector.StylePropertyTreeElement.editingEnded):
2601           - Renamed from endEditing
2602           - Removed code now handled by WebInspector.startEditing
2603         (WebInspector.StylePropertyTreeElement.editingCancelled):
2604           - Renamed from cancelEditing
2605           - Changed parameters to match WebInspector.startEditing's
2606             cancelledCallback
2607         (WebInspector.StylePropertyTreeElement.editingCommitted):
2608           - Renamed from commitEditing
2609           - Changed parameters to match WebInspector.startEditing's
2610             committedCallback
2611         * page/inspector/inspector.js:
2612         (WebInspector.changeFocus): Changed a call to firstParentWithClassName
2613         to firstParentOrSelfWithClassName so that if the focusable element
2614         itself is the target it will be recognized. I don't know why this
2615         change wasn't needed before this.
2616         (WebInspector.isBeingEdited): Added.
2617         (WebInspector.startEditing): Added.
2618
2619 2008-03-10  Adam Roben  <aroben@apple.com>
2620
2621         Windows build fix
2622
2623         * WebCore.vcproj/WebCore.vcproj: Pick up generated source files out of
2624         $(WebKitOutputDir) instead of hard-coding WebKitBuild.
2625
2626 2008-03-10  Darin Adler  <darin@apple.com>
2627
2628         * DerivedSources.make: Merge plug-in-related changes with the new way of handling
2629         autogenerated DOM classes.
2630
2631 2008-03-10  Johnny Ding  <johnnyding.webkit@gmail.com>
2632
2633         Reviewed, tweaked and landed by Alexey.
2634
2635         - fix http://bugs.webkit.org/show_bug.cgi?id=17732        
2636
2637         We didn't have a fallback to frame encoding in the case of loading a script via
2638         changing its src attribute.
2639
2640         Test: fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src.html
2641
2642         * html/HTMLScriptElement.cpp:
2643         (WebCore::HTMLScriptElement::parseMappedAttribute): Use a helper function to get proper
2644         charset for correct decoding of script content.
2645         (WebCore::HTMLScriptElement::insertedIntoDocument):
2646         (WebCore::HTMLScriptElement::scriptCharset): A helper function for getting proper charset
2647         for the script (as much as can be determined prior to loading it).
2648         * html/HTMLScriptElement.h:
2649         * html/HTMLTokenizer.cpp:
2650         (WebCore::HTMLTokenizer::parseTag): Use a helper function to get proper charset for correct
2651         decoding of script content.
2652
2653 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2654
2655         Reviewed by Lars.
2656
2657         Fix reference counting of returned MimeType and Plugin objects
2658         created in the array wrappers.
2659
2660         * plugins/MimeTypeArray.cpp:
2661         * plugins/MimeTypeArray.h:
2662         * plugins/Plugin.cpp:
2663         * plugins/Plugin.h:
2664         * plugins/PluginArray.cpp:
2665         * plugins/PluginArray.h:
2666
2667 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2668
2669         Wx linking fix.
2670
2671         Added missing stubs for PluginData.
2672
2673         * platform/wx/TemporaryLinkStubs.cpp:
2674
2675 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2676
2677         Windows build fix that I forgot to merge earlier ;(
2678
2679         Forward declare Page as class, not struct.
2680
2681         * plugins/PluginData.h:
2682
2683 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2684
2685         Attempt to fix the Wx build.
2686
2687         * WebCoreSources.bkl:
2688
2689 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
2690
2691         Reviewed by Darin.
2692
2693         Done with Lars.
2694
2695         http://bugs.webkit.org/show_bug.cgi?id=16815
2696
2697         Ported the manually written JS bindings of window.navigator,
2698         window.navigator.plugins and window.navigator.mimeTypes to
2699         auto-generated bindings.
2700
2701         Moved the globally cached plugin and mimetype information to a
2702         per WebCore::Page shared PluginData structure.
2703
2704         Implemented window.navigator.plugins.refresh() in a
2705         platform-independent way.
2706
2707         * DerivedSources.make:
2708         * GNUmakefile.am:
2709         * WebCore.pro:
2710         * WebCore.vcproj/WebCore.vcproj:
2711         * WebCore.xcodeproj/project.pbxproj:
2712         * bindings/js/JSDOMWindowBase.cpp:
2713         (WebCore::JSDOMWindowBase::getValueProperty):
2714         * bindings/js/JSMimeTypeArrayCustom.cpp: Added.
2715         (WebCore::JSMimeTypeArray::canGetItemsForName):
2716         (WebCore::JSMimeTypeArray::nameGetter):
2717         * bindings/js/JSNavigatorCustom.cpp: Added.
2718         (WebCore::needsYouTubeQuirk):
2719         (WebCore::JSNavigator::appVersion):
2720         * bindings/js/JSPluginArrayCustom.cpp: Added.
2721         (WebCore::JSPluginArray::canGetItemsForName):
2722         (WebCore::JSPluginArray::nameGetter):
2723         * bindings/js/JSPluginCustom.cpp: Added.
2724         (WebCore::JSPlugin::canGetItemsForName):
2725         (WebCore::JSPlugin::nameGetter):
2726         * bindings/js/kjs_navigator.cpp: Removed.
2727         * bindings/js/kjs_navigator.h: Removed.
2728         * dom/Clipboard.cpp:
2729         * dom/DOMImplementation.cpp:
2730         (WebCore::DOMImplementation::createDocument):
2731         * loader/FrameLoader.cpp:
2732         (WebCore::FrameLoader::shouldUsePlugin):
2733         * page/DOMWindow.cpp:
2734         (WebCore::DOMWindow::clear):
2735         (WebCore::DOMWindow::navigator):
2736         * page/DOMWindow.h:
2737         * page/DOMWindow.idl:
2738         * page/DragController.cpp:
2739         * page/Frame.cpp:
2740         * page/Frame.h:
2741         * page/Navigator.cpp: Added.
2742         (WebCore::Navigator::Navigator):
2743         (WebCore::Navigator::~Navigator):
2744         (WebCore::Navigator::disconnectFrame):
2745         (WebCore::Navigator::appCodeName):
2746         (WebCore::Navigator::appName):
2747         (WebCore::Navigator::appVersion):
2748         (WebCore::Navigator::language):
2749         (WebCore::Navigator::userAgent):
2750         (WebCore::Navigator::platform):
2751         (WebCore::Navigator::plugins):
2752         (WebCore::Navigator::mimeTypes):
2753         (WebCore::Navigator::product):
2754         (WebCore::Navigator::productSub):
2755         (WebCore::Navigator::vendor):
2756         (WebCore::Navigator::vendorSub):
2757         (WebCore::Navigator::cookieEnabled):
2758         (WebCore::Navigator::javaEnabled):
2759         * page/Navigator.h: Added.
2760         (WebCore::Navigator::create):
2761         (WebCore::Navigator::frame):
2762         * page/Navigator.idl: Added.
2763         * page/Page.cpp:
2764         (WebCore::Page::refreshPlugins):
2765         (WebCore::Page::pluginData):
2766         * page/Page.h:
2767         * page/Plugin.h: Removed.
2768         * page/mac/FrameMac.mm:
2769         * page/mac/WebCoreFrameBridge.mm:
2770         (-[WebCoreFrameBridge canProvideDocumentSource]):
2771         * page/mac/WebCoreViewFactory.h:
2772         * page/qt/FrameQt.cpp:
2773         * page/win/FrameWin.cpp:
2774         * platform/gtk/TemporaryLinkStubs.cpp:
2775         * platform/mac/PlugInInfoStoreMac.mm: Removed.
2776         * platform/qt/MIMETypeRegistryQt.cpp:
2777         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
2778         * plugins/MimeType.cpp: Added.
2779         (WebCore::MimeType::MimeType):
2780         (WebCore::MimeType::~MimeType):
2781         (WebCore::MimeType::type):
2782         (WebCore::MimeType::suffixes):
2783         (WebCore::MimeType::description):
2784         (WebCore::MimeType::enabledPlugin):
2785         * plugins/MimeType.h: Added.
2786         (WebCore::MimeType::create):
2787         * plugins/MimeType.idl: Added.
2788         * plugins/MimeTypeArray.cpp: Added.
2789         (WebCore::MimeTypeArray::MimeTypeArray):
2790         (WebCore::MimeTypeArray::~MimeTypeArray):
2791         (WebCore::MimeTypeArray::length):
2792         (WebCore::MimeTypeArray::item):
2793         (WebCore::MimeTypeArray::canGetItemsForName):
2794         (WebCore::MimeTypeArray::nameGetter):
2795         (WebCore::MimeTypeArray::getPluginData):
2796         * plugins/MimeTypeArray.h: Added.
2797         (WebCore::MimeTypeArray::create):
2798         (WebCore::MimeTypeArray::disconnectFrame):
2799         * plugins/MimeTypeArray.idl: Added.
2800         * plugins/Plugin.cpp: Added.
2801         (WebCore::Plugin::Plugin):
2802         (WebCore::Plugin::~Plugin):
2803         (WebCore::Plugin::name):
2804         (WebCore::Plugin::filename):
2805         (WebCore::Plugin::description):
2806         (WebCore::Plugin::length):
2807         (WebCore::Plugin::item):
2808         (WebCore::Plugin::canGetItemsForName):
2809         (WebCore::Plugin::nameGetter):
2810         * plugins/Plugin.h: Added.
2811         (WebCore::Plugin::create):
2812         * plugins/Plugin.idl: Added.
2813         * plugins/PluginArray.cpp: Added.
2814         (WebCore::PluginArray::PluginArray):
2815         (WebCore::PluginArray::~PluginArray):
2816         (WebCore::PluginArray::length):
2817         (WebCore::PluginArray::item):
2818         (WebCore::PluginArray::canGetItemsForName):
2819         (WebCore::PluginArray::nameGetter):
2820         (WebCore::PluginArray::refresh):
2821         (WebCore::PluginArray::getPluginData):
2822         * plugins/PluginArray.h: Added.
2823         (WebCore::PluginArray::create):
2824         (WebCore::PluginArray::disconnectFrame):
2825         * plugins/PluginArray.idl: Added.
2826         * plugins/PluginData.cpp: Added.
2827         (WebCore::PluginData::PluginData):
2828         (WebCore::PluginData::~PluginData):
2829         (WebCore::PluginData::supportsMimeType):
2830         (WebCore::PluginData::pluginNameForMimeType):
2831         * plugins/PluginData.h: Added.
2832         (WebCore::PluginData::create):
2833         (WebCore::PluginData::disconnectPage):
2834         (WebCore::PluginData::page):
2835         (WebCore::PluginData::plugins):
2836         (WebCore::PluginData::mimes):
2837         * plugins/mac/PluginDataMac.mm: Added.
2838         (WebCore::PluginData::initPlugins):
2839         (WebCore::PluginData::refresh):
2840         * plugins/qt/PluginDataQt.cpp: Added.
2841         (WebCore::PluginData::initPlugins):
2842         * plugins/win/PluginDataWin.cpp: Added.
2843         (WebCore::PluginData::initPlugins):
2844         (WebCore::PluginData::refresh):
2845
2846 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2847
2848         Reviewed by Holger.
2849
2850         Replace two printfs() in the Qt port with notImplemented().
2851
2852         * html/CanvasRenderingContext2D.cpp:
2853         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
2854         (WebCore::CanvasRenderingContext2D::applyFillPattern):
2855
2856 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
2857
2858         Reviewed by Alp.
2859
2860         Compilation fix with gcc 4.3: Include stdio.h for printf.
2861
2862         * html/CanvasRenderingContext2D.cpp:
2863         * html/HTMLCanvasElement.cpp:
2864
2865 2008-03-09  Steve Falkenburg  <sfalken@apple.com>
2866
2867         Stop Windows build if an error occurs in a prior project.
2868
2869         Rubber stamped by Darin.
2870
2871         * WebCore.vcproj/WebCore.vcproj:
2872         * WebCore.vcproj/WebCoreGenerated.vcproj:
2873
2874 2008-03-09  Darin Adler  <darin@apple.com>
2875
2876         * DerivedSources.make: Third try at fixing the build.
2877         * bindings/js/JSRGBColor.cpp: And touching this file.
2878
2879 2008-03-09  Darin Adler  <darin@apple.com>
2880
2881         * DerivedSources.make: One *more* try at fixing the build.
2882
2883 2008-03-09  Darin Adler  <darin@apple.com>
2884
2885         * DerivedSources.make: One more try at fixing the build.
2886
2887 2008-03-09  Darin Adler  <darin@apple.com>
2888
2889         * DerivedSources.make: Re-land the change, fixed, and with an attempt to fix the
2890         bots by removing the incorrect file.
2891
2892 2008-03-09  Oliver Hunt  <oliver@apple.com>
2893
2894         RS=Mark Rowe
2895
2896         Roll out r30909 -- it breaks the build and is a non-trivial fix (according to weinig)
2897
2898         * DerivedSources.make:
2899
2900 2008-03-09  Darin Adler  <darin@apple.com>
2901
2902         Reviewed by Adam.
2903
2904         * DerivedSources.make: Put the list of DOM classes into its own
2905         variable, and generate the JavaScript bindings and Objective-C
2906         bindings dependencies from that. Added some separators to make it
2907         a little easier to see the sections of the file. Moved all the
2908         Mac-specific rules (except for the SVG conditional part) down
2909         to the bottom of the file in a separate section.
2910
2911 2008-03-09  Adam Roben  <aroben@apple.com>
2912
2913         Windows build fix
2914
2915         * WebCore.vcproj/WebCore.vcproj: Make sure all Cairo files are
2916         excluded from all three CG-based configurations: Debug, Release, and
2917         Debug_Internal.
2918
2919 2008-03-08  Mark Rowe  <mrowe@apple.com>
2920
2921         Attempt to fix the Qt build.
2922
2923         * platform/MIMETypeRegistry.cpp:  Add missing include.
2924
2925 2008-03-08  Oliver Hunt  <oliver@apple.com>
2926
2927         Reviewed by Sam W.
2928
2929         Bug 16516: canvas image patterns stop working with some transformations
2930
2931         Simple fix.  We used x/yStep of FLT_MAX to fake a no-repeat-x/y pattern
2932         with CG.  However any transforms involving FLT_MAX immediately get
2933         consumed by the introduced floating point error.  yStep had already been
2934         clamped to a much smaller arbitrary value, and this patch makes us use
2935         that clamp value for xStep as well.
2936
2937         * html/CanvasPattern.cpp:
2938         (WebCore::CanvasPattern::createPattern):
2939
2940 2008-03-08  Oliver Hunt  <oliver@apple.com>
2941
2942         Reviewed by Mitz.
2943
2944         Bug 17728: Canvas.createPattern with null repeat argument throws an exception
2945
2946         Trivial fix, we were calling toString on null which produces the string "null",
2947         we just needed to switch to using valueToStringWithNullCheck rather than 
2948         JSValue::toString directly
2949
2950         Test: fast/canvas/canvas-pattern-behaviour.html
2951
2952         * WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp:
2953         (WebCore::JSCanvasRenderingContext2D::createPattern):
2954
2955 2008-03-08  Mark Rowe  <mrowe@apple.com>
2956
2957         Reviewed by Darin Adler.
2958
2959         Fix 64-bit build with GCC 4.2.
2960
2961         * bindings/objc/WebScriptObject.mm: Use NSUInteger in place of unsigned where required.
2962         * platform/mac/SharedBufferMac.mm: Ditto.
2963
2964 2008-03-08  Dan Bernstein  <mitz@apple.com>
2965
2966         Reviewed by Oliver Hunt.
2967
2968         - fix garbage in transparent areas in canvas.toDataURL results
2969
2970         * platform/graphics/cg/ImageBufferCG.cpp:
2971         (WebCore::ImageBuffer::toDataURL): Clear the bitmap context before
2972         painting the canvas image onto it.
2973
2974 2008-03-08  Darin Adler  <darin@apple.com>
2975
2976         Reviewed by Adele.
2977
2978         - eliminate custom highlight methods from WebCoreFrameBridge
2979
2980         * page/Chrome.cpp:
2981         (WebCore::ChromeClient::customHighlightRect): Added.
2982         (WebCore::ChromeClient::paintCustomHighlight): Added.
2983         * page/ChromeClient.h: Added custom highlight functions.
2984         * page/Frame.h: Removed custom highlight functions.
2985         * page/mac/FrameMac.mm: Ditto.
2986         * page/mac/WebCoreFrameBridge.h: Removed custom highlight methods.
2987         * rendering/InlineTextBox.cpp:
2988         (WebCore::InlineTextBox::paintCustomHighlight): Changed code to use
2989         the ChromeClient instead of WebCoreFrameBridge to do the custom highlight.
2990         * rendering/RenderBox.cpp:
2991         (WebCore::RenderBox::paintCustomHighlight): Ditto.
2992         * rendering/RootInlineBox.cpp:
2993         (WebCore::RootInlineBox::addHighlightOverflow): Ditto.
2994         (WebCore::RootInlineBox::paintCustomHighlight): Ditto.
2995
2996 2008-03-07  Stephanie Lewis  <slewis@apple.com>
2997
2998         Reviewed by Oliver.
2999
3000         Fix Windows build.
3001
3002         * platform/graphics/cg/ImageBufferCG.cpp:
3003         (WebCore::ImageBuffer::toDataURL):
3004
3005 2008-03-07  David D. Kilzer  <ddkilzer@apple.com>
3006
3007         Unify concept of enabling Netscape Plug-in API (NPAPI).
3008
3009         Reviewed by Darin.
3010
3011         No test cases since there is no change in functionality.
3012
3013         * DerivedSources.make: Added check for ENABLE_NETSCAPE_PLUGIN_API macro.
3014         If defined as "1", add WebCore.NPAPI.exp to WEBCORE_EXPORT_DEPENDENCIES.
3015         * WebCore.NPAPI.exp: Added.
3016         * WebCore.base.exp: Moved exported NPAPI methods to WebCore.NPAPI.exp.
3017         * WebCore.xcodeproj/project.pbxproj: Removed changes in r30826 (except
3018         comments) since we now handle exported NPAPI methods via DerivedSources.make.
3019
3020         * config.h: Removed USE(NPOBJECT) since we now use ENABLE(NETSCAPE_PLUGIN_API) as
3021         defined in Platform.h.
3022
3023         * bindings/objc/DOM.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3024         (-[DOMElement _NPObject]):
3025
3026         * bridge/NP_jsobject.cpp: Replaced !PLATFORM(DARWIN) || !defined(__LP64__) with
3027         ENABLE(NETSCAPE_PLUGIN_API).
3028         * bridge/NP_jsobject.h: Ditto.
3029         * bridge/c/c_class.cpp: Ditto.
3030         * bridge/c/c_class.h: Ditto.
3031         * bridge/c/c_instance.cpp: Ditto.
3032         * bridge/c/c_instance.h: Ditto.
3033         * bridge/c/c_runtime.cpp: Ditto.
3034         * bridge/c/c_runtime.h: Ditto.
3035         * bridge/c/c_utility.cpp: Ditto.
3036         * bridge/c/c_utility.h: Ditto.
3037         * bridge/npruntime.cpp: Ditto.
3038         * bridge/npruntime_impl.h: Ditto.
3039         * bridge/npruntime_priv.h: Ditto.
3040         * bridge/runtime.cpp: Ditto.
3041         (KJS::Bindings::Instance::createBindingForLanguageInstance):
3042
3043         * html/HTMLPlugInElement.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3044         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
3045         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
3046         * html/HTMLPlugInElement.h: Ditto.
3047
3048         * page/Frame.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3049         (WebCore::Frame::clearScriptObjects):
3050         (WebCore::FramePrivate::FramePrivate): Also added #if ENABLE(NETSCAPE_PLUGIN_API)
3051         guard around m_windowScriptNPObject.
3052         * page/Frame.h: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3053         * page/FramePrivate.h: Added #if ENABLE(NETSCAPE_PLUGIN_API) guard around
3054         m_windowScriptNPObject.
3055         * page/mac/FrameMac.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
3056         (WebCore::Frame::createScriptInstanceForWidget):
3057
3058 2008-03-07  Alexey Proskuryakov  <ap@webkit.org>
3059
3060         Reviewed by Darin.
3061
3062         REGRESSION: Korean decoding doesn't support extended EUC-KR.
3063
3064         Test: fast/encoding/char-decoding.html
3065
3066         * platform/text/TextCodecICU.cpp:
3067         (WebCore::TextCodecICU::registerExtendedEncodingNames): Untangle the system of duplicate ICU
3068         encoding names by manually registering windows-939-2000, and mapping all other related
3069         encodings to it.
3070
3071 2008-03-07  Dan Bernstein  <mitz@apple.com>
3072
3073         Reviewed by Stephanie.
3074
3075         - try to fix leaks seen on Tiger after r30840
3076
3077         * css/CSSStyleSelector.cpp:
3078         (WebCore::CSSStyleSelector::~CSSStyleSelector): Use the default operator
3079         delete, rather than arena delete, to deallocate the root default style.
3080
3081 2008-03-07  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>
3082
3083         Reviewed by Alp Toker.
3084
3085         http://bugs.webkit.org/show_bug.cgi?id=17681
3086         GtkLauncher fails to render an element with position: fixed
3087
3088         Implement the required parts of PlatformScreenGtk.
3089
3090         * ChangeLog:
3091         * platform/gtk/PlatformScreenGtk.cpp:
3092         (WebCore::screenDepth):
3093         (WebCore::screenIsMonochrome):
3094         (WebCore::screenRect):
3095
3096 2008-03-07  Oliver Hunt  <oliver@apple.com>
3097
3098         Reviewed by Darin Adler.
3099
3100         Bug 16610: <canvas> restore() removes path segments created before it
3101
3102         The problem here is that WebKit stored the Path as part of the state, so
3103         restore would incorrectly lose changes made to the canvas path.  To match
3104         Firefox and HTML5 we make two real changes:
3105           * Move the context path from the state object directly onto the context.
3106             This is responsible for all the changes to the path manipulation functions
3107           * Add transform tracking to each state -- this is needed to correctly transform
3108             the current path when restore()-ing to a prior state.
3109
3110         Test: fast/canvas/canvas-save-restore-with-path.html
3111
3112         * html/CanvasRenderingContext2D.cpp:
3113         (WebCore::CanvasRenderingContext2D::restore):
3114         (WebCore::CanvasRenderingContext2D::scale):
3115         (WebCore::CanvasRenderingContext2D::rotate):
3116         (WebCore::CanvasRenderingContext2D::translate):
3117         (WebCore::CanvasRenderingContext2D::transform):
3118         (WebCore::CanvasRenderingContext2D::beginPath):
3119         (WebCore::CanvasRenderingContext2D::closePath):
3120         (WebCore::CanvasRenderingContext2D::moveTo):
3121         (WebCore::CanvasRenderingContext2D::lineTo):
3122         (WebCore::CanvasRenderingContext2D::quadraticCurveTo):
3123         (WebCore::CanvasRenderingContext2D::arcTo):
3124         (WebCore::CanvasRenderingContext2D::arc):
3125         (WebCore::CanvasRenderingContext2D::rect):
3126         (WebCore::CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode):
3127         (WebCore::CanvasRenderingContext2D::fill):
3128         (WebCore::CanvasRenderingContext2D::stroke):
3129         (WebCore::CanvasRenderingContext2D::clip):
3130         (WebCore::CanvasRenderingContext2D::isPointInPath):
3131         * html/CanvasRenderingContext2D.h:
3132
3133 2008-03-07  Oliver Hunt  <oliver@apple.com>
3134
3135         Reviewed by Ada.
3136
3137         Fix for crash caused by FrameLoader incorrectly assuming it has
3138         a RenderWidget
3139
3140         In some circumstances an application embedding a WebView may 
3141         choose to prevent a webview from loading a resource.  If that
3142         resource was requested by an <object> element then we may 
3143         fallback to different content which may not produce a RenderWidget.
3144         Unfortunately FrameLoader::loadSubframe was assuming that if a
3145         renderer was produced it would always be a RenderWidget, and arbitrarily
3146         performed what could be an incorrect cast.  This could then lead to
3147         a crash.
3148
3149         We currently don't have anyway of making a test for this.
3150
3151         * loader/FrameLoader.cpp:
3152         (WebCore::FrameLoader::loadSubframe):
3153
3154 2008-03-07  Samuel Weinig  <sam@webkit.org>
3155
3156         Reviewed by Oliver Hunt.
3157
3158         Fix for http://bugs.webkit.org/show_bug.cgi?id=16673
3159         <canvas> lacks toDataURL()
3160
3161         Tests: fast/canvas/toDataURL-noData.html
3162                fast/canvas/toDataURL-supportedTypes.html
3163
3164         * html/CanvasRenderingContext2D.cpp:
3165         (WebCore::CanvasRenderingContext2D::printSecurityExceptionMessage): Make message non-global.
3166         * html/HTMLCanvasElement.cpp:
3167         (WebCore::HTMLCanvasElement::printSecurityExceptionMessage): Log error message indicating that toDataURL has
3168         been called on a tainted canvas. 
3169         (WebCore::HTMLCanvasElement::toDataURL): This does the tainted canvas check, ensures that the canvas has pixel
3170         data, checks to see if the MIME type is supported.  Unsupported MIME types and the null string (which is made
3171         by passing no argument/null/undefined in JavaScript) are treated as being PNG, as per the spec.  The actual 
3172         toDataURL logic is actually done in the ImageBuffer class.
3173         * html/HTMLCanvasElement.h: Add function declarations.
3174         * html/HTMLCanvasElement.idl: Add function declaration.
3175
3176         * platform/MIMETypeRegistry.cpp:
3177         (WebCore::initializeSupportedImageMIMETypes):
3178         (WebCore::initializeSupportedImageMIMETypesForEncoding):
3179         (WebCore::initializeSupportedJavaScriptMIMETypes):
3180         (WebCore::initializeSupportedNonImageMimeTypes):
3181         (WebCore::initializeSupportedMediaMIMETypes):
3182         (WebCore::initializeMIMETypeRegistry):
3183         (WebCore::MIMETypeRegistry::getMIMETypeForPath):
3184         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
3185         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
3186         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
3187         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
3188         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
3189         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
3190         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType):
3191         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
3192         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
3193         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
3194         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
3195         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
3196         * platform/MIMETypeRegistry.h:
3197         Clean up and add new supportedImageMIMETypesForEncoding set which contains the set of
3198         MIME types the platform knows how to encode. Currently only implemented for CG and Qt.
3199
3200         * platform/graphics/ImageBuffer.h: Add toDataURL method.
3201         * platform/graphics/cairo/ImageBufferCairo.cpp:
3202         (WebCore::ImageBuffer::toDataURL): Add stub.
3203         * platform/graphics/cg/ImageBufferCG.cpp:
3204         (WebCore::ImageBuffer::create):
3205         (WebCore::ImageBuffer::getImageData):
3206         (WebCore::ImageBuffer::putImageData):
3207         (WebCore::ImageBuffer::toDataURL):
3208         Converts the current context to a data: url of the specified MIME type.  This method
3209         unfortunately has to flip the context, resulting in less than optimal code.
3210
3211         * platform/graphics/qt/ImageBufferQt.cpp:
3212         (WebCore::ImageBuffer::toDataURL): Add stub.
3213         * platform/graphics/wx/ImageBufferWx.cpp:
3214         (WebCore::ImageBuffer::toDataURL): Add stub.
3215
3216 2008-03-07  Steve Falkenburg  <sfalken@apple.com>
3217
3218         Build fix.
3219
3220         * WebCore.vcproj/WebCore.vcproj:
3221
3222 2008-03-07  Brent Fulgham  <bfulgham@gmail.com>
3223
3224         Reviewed by Mark Rowe.
3225
3226         Correct build intermediary output
3227         (http://bugs.webkit.org/show_bug.cgi?id=17713)
3228
3229         * WebCore/WebCore.vcproj:  Correct intermediary paths
3230
3231 2008-03-07  Brent Fulgham  <bfulgham@gmail.com>
3232
3233         Reviewed by Steve Falkenburg.
3234
3235         Add Cairo build requirements to WebCore.vcproj under a new
3236         set of targets.  Exclude Cairo elements from normal CG build.
3237         Exclude CG elements from Cairo builds.
3238         (http://bugs.webkit.org/show_bug.cgi?id=17300)
3239
3240         * WebCore.vcproj/WebCore.vcproj:
3241         * WebCore.vcproj/webcore.vsprops: Added.
3242
3243 2008-03-07  Darin Adler  <darin@apple.com>
3244
3245         Reviewed by Adam.
3246
3247         - eliminated WebCoreFrameBridge runOpenPanel
3248
3249         * page/ChromeClient.h: Added runOpenPanel function.
3250         * page/mac/ChromeMac.mm:
3251         (WebCore::ChromeClient::runOpenPanel): Added.
3252         * platform/FileChooser.cpp:
3253         (WebCore::FileChooser::FileChooser): Moved this here. It's no longer platform-specific.
3254         Also start the refcount at 1.
3255         (WebCore::FileChooser::create): Added adoptRef since the refcount no starts at one.
3256         (WebCore::FileChooser::~FileChooser): Moved here. No longer platform-specific.
3257         * platform/FileChooser.h: Removed m_controller, which was Macintosh-specific.
3258         * platform/gtk/FileChooserGtk.cpp: Removed FileChooser constructor and destructor,
3259         since they are no longer platform-specific.
3260         * platform/qt/FileChooserQt.cpp: Ditto.
3261         * platform/win/FileChooserWin.cpp: Ditto.
3262         * platform/wx/TemporaryLinkStubs.cpp: Ditto.
3263         * platform/mac/FileChooserMac.mm:
3264         (WebCore::FileChooser::openFileChooser): Call the chrome client instead of the
3265         bridge to run the open panel. Allows us to get rid of the WebCoreOpenPanelController
3266         class and m_controller data member and move the cosntrutor/destructor to platform-
3267         independent code.
3268
3269 2008-03-07  Adam Roben  <aroben@apple.com>
3270
3271         Add JavaScriptDebugServer
3272
3273         This class is a singleton which allows one or more
3274         JavaScriptDebugListeners to receive callbacks during JavaScript
3275         execution.
3276
3277         Right now all listeners receive callbacks for all Pages in the
3278         process. Eventually we will want to support listeners registering for
3279         callbacks for specific Pages (e.g., the Inspector will want to listen
3280         for execution in just the Page it's inspecting).
3281
3282         Pages notify the JavaScriptDebugServer when they are created so that
3283         it can install itself as the Page's debugger.
3284
3285         Reviewed by Darin.
3286
3287         * GNUMakefile.am: Added new files to project.
3288         * WebCore.pro: Ditto.
3289         * WebCore.vcproj/WebCore.vcproj: Ditto.
3290         * WebCore.xcodeproj/project.pbxproj: Ditto.
3291         * WebCoreSources.bkl: Ditto.
3292         * page/JavaScriptDebugListener.h: Added.
3293         * page/JavaScriptDebugServer.cpp: Added.
3294         (WebCore::toFrame):
3295         (WebCore::JavaScriptDebugServer::shared):
3296         (WebCore::JavaScriptDebugServer::JavaScriptDebugServer):
3297         (WebCore::JavaScriptDebugServer::~JavaScriptDebugServer):
3298         (WebCore::JavaScriptDebugServer::addListener): Registers as the
3299         debugger for all Pages if we're adding our first listener.
3300         (WebCore::JavaScriptDebugServer::removeListener): Deregisters as the
3301         debugger for all Pages if we're removing our last listner.
3302         (WebCore::JavaScriptDebugServer::pageCreated): Registers as the
3303         debugger for the newly created Page if we have any listeners.
3304         (WebCore::dispatchDidParseSource): Helper function.
3305         (WebCore::dispatchFailedToParseSource): Ditto.
3306         (WebCore::JavaScriptDebugServer::sourceParsed): Call
3307         dispatchDidParseSource or dispatchFailedToParseSource depending on
3308         whether there was an error or not.
3309         (WebCore::JavaScriptDebugServer::dispatchFunctionToListeners): Calls
3310         the passed-in JavaScriptExecutionCallback on each listener, guarding
3311         against re-entry.
3312         (WebCore::JavaScriptDebugServer::callEvent): Dispatch didEnterCallFrame.
3313         (WebCore::JavaScriptDebugServer::atStatement): Dispatch willExecuteStatement.
3314         (WebCore::JavaScriptDebugServer::returnEvent): Dispatch willLeaveCallFrame.
3315         (WebCore::JavaScriptDebugServer::exception): Dispatch exceptionWasRaised.
3316         * page/JavaScriptDebugServer.h: Added.
3317         * page/Page.cpp:
3318         (WebCore::Page::Page): Tell the shared JavaScriptDebugServer we were
3319         created so it can register as our debugger if needed.
3320
3321 2008-03-07  Darin Adler  <darin@apple.com>
3322
3323         Reviewed by Brady.
3324
3325         - fix a theoretical problem with the visited-link hash table by avoiding collision
3326           with the special "deleted" value
3327         - improve efficiency of with the visited-link hash table by not hashing twice
3328
3329         * page/PageGroup.cpp:
3330         (WebCore::avoidDeletedValue): Added. Makes sure we never try to use the "all ones"
3331         value, since the hash table uses that for deleted hash table entries.
3332         (WebCore::PageGroup::isLinkVisited): Call avoidDeletedValue before using the hash
3333         value with the HashSet.
3334         (WebCore::PageGroup::addVisitedLink): Ditto.
3335
3336         * page/PageGroup.h: Added a new hash function, AlreadyHashed, for unsigned integer
3337         values. This assumes that the value is already a hash value, and doesn't try to
3338         hash it again. Used this for m_visitedLinkHashes.
3339
3340 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
3341
3342         Fix the Qt build.
3343
3344         * WebCore.pro:
3345
3346 2008-03-06  Sam Weinig  <sam@webkit.org> with a little help from Oliver Hunt  <oliver@apple.com>
3347
3348         Reviewed by Mitz.
3349
3350         Implement the HTML5 canvas tainting rules to prevent potential data leakage
3351
3352         Added originClean to HTMLCanvasElement and CanvasPattern
3353         to track whether a canvas (or pattern) is tainted by remote
3354         data.
3355         Use originClean flag to determine whether getImageData should
3356         return, well, image data.
3357
3358         Test: http/tests/security/canvas-remote-read-remote-image.html
3359
3360         * html/CanvasPattern.cpp:
3361         (WebCore::CanvasPattern::CanvasPattern):
3362         * html/CanvasPattern.h:
3363         * html/CanvasRenderingContext2D.cpp:
3364         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3365         (WebCore::CanvasRenderingContext2D::setFillStyle):
3366         (WebCore::CanvasRenderingContext2D::checkOrigin):
3367         (WebCore::CanvasRenderingContext2D::drawImage):
3368         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
3369         (WebCore::CanvasRenderingContext2D::createPattern):
3370         (WebCore::CanvasRenderingContext2D::printSecurityExceptionMessage):
3371         (WebCore::CanvasRenderingContext2D::getImageData):
3372         * html/CanvasRenderingContext2D.h:
3373         * html/HTMLCanvasElement.cpp:
3374         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
3375         * html/HTMLCanvasElement.h:
3376         (WebCore::HTMLCanvasElement::setOriginTainted):
3377         (WebCore::HTMLCanvasElement::originClean):
3378
3379 2008-03-06  Anders Carlsson  <andersca@apple.com>
3380
3381         Reviewed by Jon.
3382
3383         Templatize the JNI call code to reduce the amount of code that has
3384         to be duplicated.
3385
3386         * bridge/jni/jni_class.cpp:
3387         (JavaClass::JavaClass):
3388         * bridge/jni/jni_instance.cpp:
3389         (JavaInstance::stringValue):
3390         (JavaInstance::numberValue):
3391         (JavaInstance::booleanValue):
3392         (JavaInstance::invokeMethod):
3393         * bridge/jni/jni_jsobject.cpp:
3394         (JavaJSObject::convertJObjectToValue):
3395         * bridge/jni/jni_runtime.cpp:
3396         (JavaField::JavaField):
3397         (JavaMethod::JavaMethod):
3398         * bridge/jni/jni_utility.cpp:
3399         * bridge/jni/jni_utility.h:
3400         (KJS::Bindings::):
3401         (KJS::Bindings::callJNIMethodIDA):
3402         (KJS::Bindings::callJNIMethodV):
3403         (KJS::Bindings::callJNIMethod):
3404         (KJS::Bindings::callJNIStaticMethod):
3405
3406 2008-03-06  Darin Adler  <darin@apple.com>
3407
3408         Reviewed by Mitz.
3409
3410         - fix regression test failures from the visited-link change
3411
3412         * WebCore.base.exp: Export PageGroup::setShouldTrackVisitedLinks.
3413         * page/PageGroup.cpp:
3414         (WebCore::PageGroup::addVisitedLink): Do nothing and return early
3415         if shouldTrackVisitedLinks is false.
3416         (WebCore::PageGroup::removeVisitedLinks): Reset m_visitedLinksPopulated
3417         so the next time a link is queried this will be populated from history.
3418         (WebCore::PageGroup::setShouldTrackVisitedLinks): Added.
3419         * page/PageGroup.h: Added setShouldTrackVisitedLinks. This is global
3420         for now, but it would be better if it was per-page-group instead.
3421
3422 2008-03-06  Adele Peterson  <adele@apple.com>
3423
3424         Reviewed by Darin.
3425
3426         Fixes for for <rdar://problem/5785892> Implement activeElement attribute for HTMLDocument (HTML5)
3427         and <rdar://problem/5785895> Implement hasFocus() for HTMLDocument (HTML5)
3428
3429         Tests: fast/dom/HTMLDocument/activeElement.html
3430                fast/dom/HTMLDocument/hasFocus.html
3431
3432         * html/HTMLDocument.cpp:
3433         (WebCore::HTMLDocument::activeElement): Added. Returns the focused element, or the body element if nothing's focused.
3434         (WebCore::HTMLDocument::hasFocus): Added. Returns whether or not the document has focus (inclusive of sub-frames).
3435         * html/HTMLDocument.h: Added methods for activeElement and hasFocus.
3436         * html/HTMLDocument.idl: Added definitions for activeElement and hasFocus.
3437
3438 2008-03-06  Dan Bernstein  <mitz@apple.com>
3439
3440         Reviewed by Darin Adler.
3441
3442         - fix <rdar://problem/5741981> 154008 WebKit: Some asian language font glyphs are not shown (in Mail and Entourage)
3443
3444         Test: fast/text/soft-hyphen-3.html
3445
3446         * rendering/bidi.cpp:
3447         (WebCore::checkMidpoints):
3448         (WebCore::RenderBlock::findNextLineBreak): Made 'pos' unsigned. Made the
3449         midpoint after a hyphen always be a valid iterator, not allowing an
3450         offset past the end of a text node. Changed the check for consecutive
3451         soft hyphens to account for that.
3452
3453 2008-03-06  Darin Adler  <darin@apple.com>
3454
3455         - try to fix Wx build
3456
3457         * WebCoreSources.bkl: Added PageGroup.cpp.
3458
3459 2008-03-06  Darin Adler  <darin@apple.com>
3460
3461         - fix some builds
3462
3463         * GNUmakefile.am: Added PageGroup.cpp.
3464         * WebCore.base.exp: Removed WebCoreHistory.
3465         * WebCore.pro: Added PageGroup.cpp.
3466
3467 2008-03-06  Alexey Proskuryakov  <ap@webkit.org>
3468
3469         Reviewed by Darin.
3470
3471         <rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
3472         
3473         * ForwardingHeaders/wtf/unicode/Collator.h: Added.
3474         * xml/XSLTUnicodeSort.cpp:
3475         (WebCore::xsltUnicodeSortFunction):
3476         * xml/XSLTUnicodeSort.h:
3477
3478 2008-03-06  Darin Adler  <darin@apple.com>
3479
3480         Reviewed by Mitz.
3481
3482         - fix http://bugs.webkit.org/show_bug.cgi?id=17526
3483           REGRESSION: iframes are added to Safari's History menu
3484           by separating the visited link machinery from global history
3485
3486         This should also make page loading faster due to more efficient visited link coloring.
3487
3488         * WebCore.base.exp: Updated.
3489         * WebCore.vcproj/WebCore.vcproj: Added PageGroup.h/cpp, removed GlobalHistory.h/cpp.
3490         * WebCore.xcodeproj/project.pbxproj: Ditto. Also removed WebCoreHistory.h/m.
3491
3492         * css/CSSStyleSelector.cpp: Updated includes.
3493         (WebCore::CSSStyleSelector::initElementAndPseudoState): Eliminated code to set
3494         currentEncodedURL.
3495         (WebCore::checkPseudoState): Moved most of the code inside a new
3496         PageGroup::isLinkVisited function.
3497         (WebCore::CSSStyleSelector::canShareStyleWithElement): Tightened code a bit by using
3498         references and only getting colors when needed.
3499         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Ditto.
3500         * css/CSSStyleSelector.h: Removed EncodedURL, m_encodedURL, and setEncodedURL.
3501
3502         * dom/Document.cpp:
3503         (WebCore::Document::attach): Removed call to setEncodedURL.
3504         (WebCore::Document::setURL): Ditto.
3505         (WebCore::Document::recalcStyleSelector): Ditto.
3506
3507         * loader/FrameLoader.cpp:
3508         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): Changed code to use
3509         early exit idiom to be a little more readable.
3510         (WebCore::FrameLoader::urlsMatchItem): Change to use a reference for slightly
3511         better efficiency.
3512         (WebCore::FrameLoader::goToItem): Use early exit idiom to be a little more
3513         readable.
3514         (WebCore::FrameLoader::updateHistoryForStandardLoad): Moved history code back
3515         in here and got rid of the helper function updateGlobalHistory, restoring the
3516         logic before r30549. Also added a call to the new addVisitedLink function.
3517         (WebCore::FrameLoader::updateHistoryForClientRedirect): Added code to call
3518         addVisitedLink here.
3519         (WebCore::FrameLoader::updateHistoryForBackForwardNavigation): Removed comment.
3520         (WebCore::FrameLoader::updateHistoryForReload): Removed call to
3521         updateGlobalHistory; we can just go without updating global history or
3522         visited links here, at least for now, since it's not clear that a reload
3523         is a "history event".
3524         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory): Moved
3525         history code back where it was, and added the call to addVisitedLink, just
3526         as in updateHistoryForStandardLoad above.
3527       &