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