2007-03-24 Mark Rowe <mrowe@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-24  Mark Rowe  <mrowe@apple.com>
2
3         Rubber-stamped by Darin.
4
5         * Configurations/WebCore.xcconfig: Remove unnecessary INFOPLIST_PREPROCESS.
6
7 2007-03-23  Darin Adler  <darin@apple.com>
8
9         * html/HTMLBodyElement.cpp: Fix comment typo.
10
11 2007-03-23  George Staikos  <staikos@kde.org>
12
13         Reviewed and committed by George.
14
15         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
16         XMLNames is required in any case.
17
18         * WebCore.pro:
19
20 2007-03-23  Darin Adler  <darin@apple.com>
21
22         Reviewed by Hyatt.
23
24         - <rdar://problem/5074439> handle margins on frame and iframe elements
25           without involving FrameView, FrameLoader, etc.
26
27         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
28         Grab the margin from the frame directly here. There was no real benefit
29         to doing this via FrameView. Later we can delete quite a bit of unneeded code
30         here and in WebKit that exists only to set up the margin values in FrameView,
31         which are now unused.
32
33 2007-03-23  Adele Peterson  <adele@apple.com>
34
35         Reviewed by Darin.
36
37         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
38         http://bugs.webkit.org/show_bug.cgi?id=13121
39
40         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
41         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
42         use the m_originalValue for hidden input elements.
43
44         * html/HTMLInputElement.cpp:
45         (WebCore::HTMLInputElement::closeRenderer):
46         (WebCore::HTMLInputElement::reset):
47         (WebCore::HTMLInputElement::setValue):
48         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
49         * html/HTMLInputElement.h:
50
51 2007-03-23  Mitz Pettel  <mitz@webkit.org>
52
53         Reviewed by Dave Hyatt.
54
55         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
56               <rdar://problem/5083995>
57           List markers positioned incorrectly and don't repaint properly on Oxford homepage
58
59         Test: fast/lists/marker-image-error.html
60
61         * rendering/RenderListMarker.cpp:
62         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
63         the image failed to load, since that means we will use a bullet instead.
64
65 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
66
67         Fix the compile.
68
69         * platform/graphics/qt/ImageSourceQt.cpp:
70
71 2007-03-22  Dave Hyatt  <hyatt@apple.com>
72
73         Fix for <rdar://problem/5083072>.
74
75         * page/Frame.cpp:
76         (WebCore::Frame::setPrinting):
77         (WebCore::Frame::forceLayoutWithPageWidthRange):
78         * page/Frame.h:
79         * page/mac/WebCoreFrameBridge.mm:
80         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
81
82 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
83
84         Reviewed by Ada.
85
86         <rdar://problem/5074974>
87         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
88         
89         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
90         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
91         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
92         HTTP server (and not a web archive).
93
94 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
95
96         Not reviewed - gdk build fix.
97
98         * platform/graphics/cairo/ImageSourceCairo.cpp:
99
100 2007-03-22  Dave Hyatt  <hyatt@apple.com>
101
102         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
103         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
104         size changes (making it be the size of the initial containing block according to CSS2.1), but
105         we should still handle this case gracefully in case it comes up again.
106        
107         Reviewed by olliej
108
109         * page/EventHandler.cpp:
110         (WebCore::EventHandler::handleWheelEvent):
111
112 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
113
114         Reviewed by kevin
115
116         <rdar://problem/5081257> 
117         REGRESSION: New Mail signatures start out empty
118
119         * editing/VisiblePosition.cpp:
120         (WebCore::VisiblePosition::canonicalPosition): Allow
121         descent from positions inside the document into an 
122         editable body.
123
124 2007-03-22  Brady Eidson  <beidson@apple.com>
125
126         Reviewed by Adele and John
127
128         <rdar://5043528> - Prepare for new API
129         
130         * platform/network/ResourceHandle.cpp:
131         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
132
133 2007-03-22  Beth Dakin  <bdakin@apple.com>
134
135         Patch by Hyatt, reviewed and committed by me.
136
137         Does not reproduce consistently, so a layout test does not seem 
138         possible.
139
140         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
141         needsLayout()) in RenderView::paint()
142
143         * page/FrameView.cpp:
144         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
145         layout timer is active. There may be times that we don't have a 
146         body yet so we cannot schedule layout yet, but the root still needs 
147         layout.  
148
149 2007-03-22  John Sullivan  <sullivan@apple.com>
150
151         Reviewed by Darin
152         
153         Followup for recent fix to 5079700, found by assertion added to Safari.
154
155         * page/mac/FrameMac.mm:
156         (WebCore::Frame::searchForLabelsBeforeElement):
157         Fixed another place in this method where an empty NSString was being returned instead of nil.
158         Cleaned up the style a little too.
159
160 2007-03-22  David Hyatt  <hyatt@apple.com>
161
162         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
163         the image source, it is no longer needed.
164
165         Reviewed by beth
166
167         * platform/graphics/BitmapImage.cpp:
168         (WebCore::BitmapImage::destroyDecodedData):
169
170 2007-03-22  David Harrison  <harrison@apple.com>
171
172         Reviewed by Geoff, Darin.
173
174         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
175         
176         * platform/mac/ThreadCheck.mm:
177         (WebCore::_WebCoreThreadViolationCheck):
178         Change default on Tiger to NSLog rather than raise an exception.
179
180 2007-03-22  Darin Adler  <darin@apple.com>
181
182         Reviewed by Brady.
183
184         - use binary_search instead of hash table; slightly better performance and
185           less memory use
186
187         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
188         Use binary_search.
189
190 2007-03-22  Darin Adler  <darin@apple.com>
191
192         Reviewed by Adele.
193
194         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
195
196         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
197         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
198         There was no reason for this crucial loading step to be left to the client.
199
200 2007-03-22  David Hyatt  <hyatt@apple.com>
201
202         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
203         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
204
205         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
206         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
207
208         Reviewed by aroben
209
210         * page/FrameView.cpp:
211         (WebCore::FrameView::adjustViewSize):
212         (WebCore::FrameView::needsLayout):
213         (WebCore::FrameView::setNeedsLayout):
214         * page/FrameView.h:
215         * page/mac/WebCoreFrameBridge.mm:
216         (-[WebCoreFrameBridge needsLayout]):
217         (-[WebCoreFrameBridge setNeedsLayout]):
218         * rendering/RenderView.cpp:
219         (WebCore::RenderView::paint):
220
221 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
222
223         Reviewed by Beth Dakin.
224         
225         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
226         accept "extra" coordinates -- virtually all commands accept them.
227
228         * ksvg2/svg/SVGParserUtilities.cpp:
229         (WebCore::SVGPathParser::parseSVG):
230
231 2007-03-21  David Harrison  <harrison@apple.com>
232
233         Reviewed by hyatt.
234
235         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
236
237         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
238         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
239         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
240         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
241         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
242         
243         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
244         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
245
246         * platform/SharedBuffer.h:
247         Declare createCFData().
248         
249         * platform/graphics/cg/ImageSourceCG.cpp:
250         (WebCore::ImageSource::setData):
251         Call createCFData instead of createNSData.
252         
253         * platform/graphics/cg/PDFDocumentImage.cpp:
254         (WebCore::PDFDocumentImage::dataChanged):
255         Call createCFData instead of createNSData.
256         
257        * platform/mac/SharedBufferMac.mm:
258         (WebCore::SharedBuffer::createCFData):
259         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
260         
261 2007-03-21  Mitz Pettel  <mitz@webkit.org>
262
263         Reviewed by Darin.
264
265         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
266           Regression: Scrollbar not resizing after display none
267
268         Test: fast/dynamic/view-overflow.html
269
270         * rendering/RenderView.cpp:
271         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
272         before calling docHeight() and docWidth(), since the former act as a lower
273         bound for the latter.
274
275 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
276
277         Reviewed by Beth Dakin.
278         
279         A little cleanup based work I've been doing on the SVG parsers.
280
281         * ksvg2/svg/SVGParserUtilities.h:
282         (WebCore::skipString):
283         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
284         SVGParserUtilities.h, so it could be with all its friends. Renamed 
285         "checkString" to "skipString" to match the rest of the code and to be 
286         clear about which functions move the buffer pointer.
287         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
288         * ksvg2/svg/SVGTransformable.cpp:
289         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
290         returns. Removed unnecessary magic number.
291
292 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
293
294         Reviewed by Beth Dakin.
295         
296         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
297         buffer when running fuzzing test
298
299         * ksvg2/svg/SVGColor.cpp:
300         (WebCore::parseNumberOrPercent): Check for past the end condition.
301         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
302         of buffer, then check if you're past the end" logic.
303
304 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
305
306         Reviewed by Beth Dakin.
307         
308         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
309         running fuzzer test
310
311         * ksvg2/svg/SVGParserUtilities.cpp:
312         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
313         always preceded by an 'M' or an 'm'.
314
315 2007-03-21  John Sullivan  <sullivan@apple.com>
316
317         Reviewed by Adam
318         
319         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
320           or saved for .Mac homepage login
321
322         * page/mac/FrameMac.mm:
323         (WebCore::Frame::searchForLabelsBeforeElement):
324         don't count empty strings as valid results
325
326 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
327
328         Reviewed by darin
329
330         * editing/markup.cpp:
331         (WebCore::styleFromMatchedRulesAndInlineDecl): 
332         Release the RefPtr to avoid increasing/decreasing
333         the refcount unnecessarily.
334         (WebCore::propertyMissingOrEqualToNone): Added and used
335         instead of converting values to strings.
336         (WebCore::elementHasTextDecorationProperty): 
337         (WebCore::createMarkup):
338
339 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
340
341         Reviewed by oliver
342
343         <rdar://problem/5075944> 
344         REGRESSION: Partially selected underlined content pastes as plain text
345         
346         We stopped adding markup for all the ancestors
347         of lastClosed up to the commonAncestorBlock
348         because it was adding a lot of unnecessary markup.
349         This caused us to lose underlining when copying a 
350         partially selected underlined element (even though 
351         we put all styles that the copied markup inherits 
352         into a style span, because the text-decoration 
353         isn't inheritable).
354
355         * editing/markup.cpp:
356         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
357         code here.
358         (WebCore::elementHasTextDecorationProperty): Added.
359         (WebCore::createMarkup): If the copied markup has a
360         text-decoration because some common ancestor has
361         a text-decoration property set, include that ancestor
362         and all its descendants in the copied markup.
363
364 2007-03-21  Oliver Hunt  <oliver@apple.com>
365
366         Reviewed by Antti.
367
368         Update a few SVG attribute parsers to be more defensive against
369         reading beyond the end of input. 
370
371         Fixes rdar://problem/5077218 -- SVG transform parser runs past
372         end of buffer when running fuzzing test
373
374         * ksvg2/svg/SVGParserUtilities.cpp:
375         (WebCore::SVGPathParser::parseSVG):
376         * ksvg2/svg/SVGParserUtilities.h:
377         (WebCore::skipOptionalSpacesOrDelimiter):
378         * ksvg2/svg/SVGTransformable.cpp:
379         (WebCore::parseTransformParamList):
380         (WebCore::SVGTransformable::parseTransformAttribute):
381
382 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
383
384         Reviewed by Mitz.
385
386         http://bugs.webkit.org/show_bug.cgi?id=13140
387         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
388
389         Test: svg/carto.net/frameless-svg-parse-error.html
390
391         * ksvg2/misc/SVGDocumentExtensions.cpp:
392         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
393         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
394
395 2007-03-21  Beth Dakin  <bdakin@apple.com>
396
397         Reviewed by Geoff.
398
399         Fix for <rdar://problem/5072678> Crash in
400         RenderLayer::scrollRectToVisible with MallocScribble enabled
401
402         I tried to fix this earlier today but my fix caused a regression
403         scrolling through RSS pages. It turns out that sometimes scroll
404         events need to propagate immediately, and sometimes they must be
405         delayed or they risk deleting objects that are expected to be
406         around after the event has propagated. Mitz's original fix made
407         sheduleEvent() only delay events that happen during layout. This
408         fix marks two other places in addition to layout where events also
409         need to be delayed. These two places are places that were marked
410         with FIXMEs that Mitz removed in his original patch. (There was a
411         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
412         case is only called through layout and is covered by Mitz's
413         original patch.)
414
415         * page/FrameView.cpp:
416         (WebCore::FrameView::~FrameView): Added assertion.
417         (WebCore::FrameView::layout): Call new functions to increment and 
418         decrement the queued events count.
419         (WebCore::FrameView::pauseScheduledEvents):
420         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
421         events count and dispatch events if the count has zeroed.
422         * page/FrameView.h:
423         * rendering/RenderLayer.cpp:
424         (WebCore::RenderLayer::scrollRectToVisible):
425         (WebCore::Marquee::start):
426
427 2007-03-21  Mitz Pettel  <mitz@webkit.org>
428
429         Reviewed by John Sullivan.
430
431         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
432           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
433
434         * rendering/RenderFrameSet.cpp:
435         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
436         to be terminated by a mouseup event regardless of whether the frameset needs
437         layout.
438
439 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
440
441         Reviewed by Oliver.
442
443         <rdar://problem/5077252> 
444         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
445         
446         * loader/FrameLoader.cpp:
447         (WebCore::FrameLoader::load):
448         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
449
450 2007-03-20  Brady Eidson  <beidson@apple.com>
451
452         Reviewed by Anders.
453
454         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
455
456         Crash in IconDatabase when private browsing is enabled.
457
458         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
459         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
460         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
461         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
462         can be null.  This led to derefs.
463
464         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
465         world, as that didn't exist when they were originally written - now they just return
466         SharedBuffers instead of taking a Vector<char>& as a parameter
467
468         * loader/icon/IconDatabase.cpp:
469         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
470         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
471           it if it's empty
472         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
473
474         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
475
476 2007-03-20  Adam Roben  <aroben@apple.com>
477
478         Rubberstamped by Adele.
479
480         Roll out r20348 because it was causing crashes.
481
482         * page/FrameView.cpp:
483         (WebCore::FrameViewPrivate::FrameViewPrivate):
484         (WebCore::FrameView::layout):
485         (WebCore::FrameView::scheduleEvent):
486
487 2007-03-20  Timothy Hatcher  <timothy@apple.com>
488
489         Reviewed by Kevin Decker.
490
491         Rolling out part of r19828 that caused a scrolling regression in Mail.
492
493         <rdar://problem/4820817> Message jumps around when trying to select text
494
495         * platform/mac/ScrollViewMac.mm:
496         (WebCore::ScrollView::visibleContentRect):
497         (WebCore::ScrollView::updateContents):
498
499 2007-03-20  Brady Eidson  <beidson@apple.com>
500
501         Reviewed by John
502
503         <rdar://5071341> - Crash in IconLoader::finishLoading()
504         
505         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
506         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
507         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
508         the IconLoader is getting failed/cancelled twice.
509         
510         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
511         serve us until we know more about the cause.
512
513         * loader/icon/IconLoader.cpp:
514         (WebCore::IconLoader::didFail): Add an assertion to catch this case
515         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
516           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
517           IconURL
518
519 2007-03-20  Antti Koivisto  <antti@apple.com>
520
521         Reviewed by Darin.
522
523         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
524         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
525         <rdar://problem/5045710>
526         
527         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
528         really a good fix, smooth scrolling should be supported properly. It should do for now.
529
530         * page/EventHandler.cpp:
531         (WebCore::EventHandler::handleWheelEvent):
532         * rendering/RenderListBox.cpp:
533         (WebCore::RenderListBox::isScrollable):
534         * rendering/RenderListBox.h:
535         * rendering/RenderObject.cpp:
536         (WebCore::RenderObject::isScrollable):
537         * rendering/RenderObject.h:
538         * rendering/RenderTextControl.cpp:
539         (WebCore::RenderTextControl::isScrollable):
540         * rendering/RenderTextControl.h:
541
542 2007-03-20  Beth Dakin  <bdakin@apple.com>
543
544         Reviewed by Geoff.
545
546         Covered by existing test case.
547
548         Fix for <rdar://problem/5072678> Crash in 
549         RenderLayer::scrollRectToVisible with MallocScribble enabled
550
551         This removes some code that was added with http://bugs.webkit.org/
552         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
553         the idea behind it was that there are times when it is safe for 
554         scheduleEvent() to propagate the event immediately. The 
555         MallocScribble crash revealed that this assumption was a bit too 
556         broad; the cause of the crash was that we were propagating events 
557         immediately when it was not safe. Mitz and I discussed this online 
558         and we agree that the safest solution is to revert to the old 
559         behavior here, and always delay the propagation of the event. 
560
561         * page/FrameView.cpp:
562         (WebCore::FrameViewPrivate::FrameViewPrivate):
563         (WebCore::FrameView::layout):
564         (WebCore::FrameView::scheduleEvent):
565
566 2007-03-20  Brady Eidson  <beidson@apple.com>
567
568         Reviewed by John Sullivan
569
570         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
571
572         * loader/icon/IconLoader.cpp:
573         (WebCore::IconLoader::didReceiveResponse):
574         (WebCore::IconLoader::didReceiveData):
575         (WebCore::IconLoader::didFail):
576         (WebCore::IconLoader::didFinishLoading):
577
578 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
579
580         Reviewed by darin
581
582         <rdar://problem/5071074> 
583         REGRESSION: Links are pasted as plain text at certain positions
584         
585         moveParagraphs calls createMarkup without annotation, which leaves
586         out anchor elements that aren't fully selected.
587
588         * editing/CompositeEditCommand.cpp:
589         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
590         createMarkup to do full annotation here.  Doing so could include 
591         special ancestor blocks, which would prevent the copied content 
592         from appearing in the destination paragraph when it's re-inserted.  
593         Annotation would also inline styles from style sheets,  which is 
594         unnecessary because the content is being moved to the same 
595         document it's being moved from.
596         Added a new bool to createMarkup that when true allows markup for 
597         special ancestors as long as they are inline when annotation is off.
598         * editing/markup.cpp:
599         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
600         is off, unless it's inline and we've been told it's ok to include such
601         elements.
602         * editing/markup.h:
603
604 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
605
606         Reviewed by Darin.
607
608         http://bugs.webkit.org/show_bug.cgi?id=12497
609         Implement XPath result ordering.
610
611         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
612         to sort itself, and can remember whether it has been already sorted.
613
614         * CMakeLists.txt:
615         * WebCore.pro:
616         * WebCore.xcodeproj/project.pbxproj:
617         * WebCoreSources.bkl:
618         Added XPathNodeSet files.
619
620         * xml/XPathExpression.cpp: Fixed includes.
621
622         * xml/XPathFunctions.cpp:
623         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
624         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
625         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
626         (WebCore::XPath::FunName::evaluate): Ditto.
627         (WebCore::XPath::FunCount::evaluate): Ditto.
628         (WebCore::XPath::FunSum::evaluate): Ditto.
629
630         * xml/XPathNodeSet.cpp: Added.
631         (WebCore::XPath::parentWithDepth):
632         (WebCore::XPath::sortBlock):
633         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
634         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
635         parent or ancestor sorted).
636         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
637         implemented via fully sorting the node-set, but this can obviously be optimized.
638         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
639         
640         * xml/XPathNodeSet.h: Added.
641         (WebCore::XPath::NodeSet::NodeSet):
642         (WebCore::XPath::NodeSet::operator=):
643         (WebCore::XPath::NodeSet::size):
644         (WebCore::XPath::NodeSet::isEmpty):
645         (WebCore::XPath::NodeSet::operator[]):
646         (WebCore::XPath::NodeSet::reserveCapacity):
647         (WebCore::XPath::NodeSet::clear):
648         (WebCore::XPath::NodeSet::swap):
649         (WebCore::XPath::NodeSet::append):
650         (WebCore::XPath::NodeSet::markSorted):
651         (WebCore::XPath::NodeSet::isSorted):
652         Most of these methods just call Vector counterparts. 
653
654         * xml/XPathParser.cpp: Updated the copyright notice.
655
656         * xml/XPathPath.cpp:
657         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
658         (WebCore::XPath::Path::evaluate): Ditto.
659         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
660         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
661         Identifying and implementing special cases when it is not necessary to do so is an important
662         future optimization.
663
664         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
665         * xml/XPathPredicate.cpp:
666         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
667         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
668         marks the result as unordered; we can consider using merge sort to avoid this.
669
670         * xml/XPathResult.cpp:
671         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
672         (WebCore::XPathResult::singleNodeValue): Ditto.
673         (WebCore::XPathResult::snapshotLength): Ditto.
674         (WebCore::XPathResult::iterateNext): Ditto.
675         (WebCore::XPathResult::snapshotItem): Ditto.
676         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
677
678         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
679
680         * xml/XPathStep.cpp:
681         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
682         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
683         attribute context node.
684         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
685         * xml/XPathStep.h: Ditto.
686
687         * xml/XPathUtil.cpp:
688         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
689         nodes, so passing such node as a context could cause problems.
690
691         * xml/XPathUtil.h: Removed NodeVector typedef.
692
693         * xml/XPathValue.cpp:
694         (WebCore::XPath::Value::Value):
695         (WebCore::XPath::Value::toNodeSet):
696         (WebCore::XPath::Value::toBoolean):
697         (WebCore::XPath::Value::toNumber):
698         (WebCore::XPath::Value::toString):
699         * xml/XPathValue.h:
700         (WebCore::XPath::Value::):
701         (WebCore::XPath::Value::isNodeSet):
702         Replacing NodeVector with NodeSet.
703
704 2007-03-21  Mark Rowe  <mrowe@apple.com>
705
706         Build fix.
707
708         * bindings/objc/WebScriptObject.mm:
709         (-[WebScriptObject methodForSelector:]):
710         (-[WebScriptObject respondsToSelector:]):
711
712 2007-03-21  Mark Rowe  <mrowe@apple.com>
713
714         Reviewed by Tim Hatcher.
715
716         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
717         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
718
719         Some cross-language scripting bridges use the presence of -(int)count to determine
720         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
721         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
722         expose -count only when the object we wrap looks like a collection from a JavaScript
723         point of view (eg, it has a length property).
724
725         * bindings/objc/WebScriptObject.mm:
726         (-[WebScriptObject _shouldRespondToCount]):
727         (-[WebScriptObject methodForSelector:]):
728         (-[WebScriptObject respondsToSelector:]):
729         (-[WebScriptObject _count]):
730         * bindings/objc/WebScriptObjectPrivate.h:
731
732 2007-03-20  Darin Adler  <darin@apple.com>
733
734         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
735         Fix obvious typo in the change from last night -- forgot to assign to the variable.
736
737 2007-03-20  Dave Hyatt  <hyatt@apple.com>
738
739         Refactor fonts a bit for portability.
740        
741         Reviewed by aroben
742
743         * platform/Font.cpp:
744         (WebCore::Font::drawSimpleText):
745         (WebCore::Font::drawGlyphBuffer):
746         (WebCore::Font::floatWidthForSimpleText):
747         * platform/Font.h:
748         * platform/FontData.h:
749         (WebCore::FontData::isSystemFont):
750         (WebCore::FontData::scriptCache):
751         * platform/GlyphBuffer.h:
752         (WebCore::GlyphBuffer::add):
753
754 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
755
756         Reviewed by Adam.
757
758         Stub out a couple of CFNetwork backend functions.
759         
760         * platform/network/ResourceHandle.h:
761
762 2007-03-19  Oliver Hunt  <oliver@apple.com>
763
764         Reviewed by Ada.
765
766         Protect against possibility of JS detaching a frame (and losing its view)
767         midway through a mouse move.
768
769         * page/EventHandler.cpp:
770         (WebCore::EventHandler::handleMouseMoveEvent):
771
772 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
773
774         Reviewed by Darin.
775
776         http://bugs.webkit.org/show_bug.cgi?id=13107
777         XPath should raise an exception when trying to parse an unknown function
778
779         Test: fast/xpath/invalid-functions.html
780
781         * xml/XPathFunctions.cpp:
782         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
783         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
784
785 2007-03-19  Adele Peterson  <adele@apple.com>
786
787         Reviewed by Beth.
788
789         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
790         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
791
792         Test: fast/forms/radio_checked_name.html
793
794         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
795         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
796
797         * html/HTMLInputElement.cpp:
798         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
799          attribute, since we setChecked will now work with unnamed radio buttons.
800         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
801         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
802         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
803         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
804
805 2007-03-19  Adam Roben  <aroben@apple.com>
806
807         Rubberstamped by Oliver.
808
809         * bridge/JavaScriptStatistics.cpp: Added missing header for
810         correctness.
811
812 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
813
814         Reviewed by Maciej.
815
816         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
817
818         * WebCore.xcodeproj/project.pbxproj:
819
820 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
821
822         Reviewed by darin
823         
824         <rdar://problem/5071074> 
825         REGRESSION: Links that aren't fully selected copy and paste as only text
826         
827         We stopped adding markup for all commonAncestorBlocks
828         and the ancestors of lastClosed up to them because it 
829         was adding a lot of unnecessary markup.
830
831         * editing/markup.cpp:
832         (WebCore::createMarkup): Also include markup for nodes
833         up to an enclosing anchor.  Cleaned up the code for
834         including special common ancestors a bit.
835
836 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
837
838         Reviewed by Lars Knoll.
839
840         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
841         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
842
843         * rendering/RenderObject.cpp:
844         (WebCore::RenderObject::updateHitTestResult):
845
846 2007-03-19  Mitz Pettel  <mitz@webkit.org>
847
848         Reviewed by Hyatt.
849
850         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
851         REGRESSION (r14658): Flickering text fields when updating via javascript
852
853         * page/Frame.cpp:
854         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
855         * page/Frame.h:
856         * page/mac/WebCoreFrameBridge.mm:
857         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
858         if not adjusting view size.
859         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
860         layout instead of just whether the root needs layout.
861
862 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
863
864         Reviewed by Maciej.
865
866         Make JS function calls on POD-types (ie. SVGLength) take effect.
867         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
868
869         This worked fine before we switched to SVGLength POD type, so this
870         can be considered as P1 regression fix.
871
872         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
873         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
874         doesn't work as expected - needs a seperated fix.
875
876         * bindings/scripts/CodeGeneratorJS.pm:
877
878 2007-03-19  Adele Peterson  <adele@apple.com>
879
880         Reviewed by Adam.
881
882         Adding comments and a little cleanup from my last checkin.
883
884         * html/HTMLSelectElement.cpp:
885         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
886         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
887         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
888         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
889         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
890         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
891         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
892         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
893         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
894
895 2007-03-19  Mitz Pettel  <mitz@webkit.org>
896
897         Reviewed by Tim Hatcher.
898
899         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
900           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
901
902         Test: fast/innerHTML/additional-inline-style.html
903
904         * editing/markup.cpp:
905         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
906         in AnnotateForInterchange mode.
907
908 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
909
910         Compile fix.
911
912         * platform/qt/ScrollViewQt.cpp:
913         (WebCore::ScrollView::update):
914
915 2007-03-19  Adam Roben  <aroben@apple.com>
916
917         Reviewed by Hyatt and Maciej.
918
919         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
920         part of <rdar://problem/5071653>.
921
922         All layout tests pass.
923
924         * WebCore.exp: Updated.
925         * WebCore.xcodeproj/project.pbxproj: Updated.
926         * bridge/JavaScriptStatistics.cpp: Moved from
927         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
928         (WebCore::collect):
929         (WebCore::JavaScriptStatistics::objectCount):
930         (WebCore::JavaScriptStatistics::interpreterCount):
931         (WebCore::JavaScriptStatistics::protectedObjectCount):
932         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
933         (WebCore::JavaScriptStatistics::garbageCollect):
934         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
935         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
936         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
937         * bridge/JavaScriptStatistics.h: Added.
938         * bridge/mac/WebCoreJavaScript.h: Removed.
939         * bridge/mac/WebCoreJavaScript.mm: Removed.
940
941 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
942
943         Reviewed by Mark.
944
945         - avoid static construction (and global variable access) in a smarter, more portable way,
946         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
947         
948         * bindings/js/JSCustomXPathNSResolver.cpp:
949         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
950         * bindings/js/JSHTMLInputElementBase.cpp:
951         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
952         * bindings/js/JSHTMLOptionElementConstructor.cpp:
953         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
954         * bindings/js/JSXMLHttpRequest.cpp:
955         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
956         * bindings/js/JSXSLTProcessor.cpp:
957         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
958         * bindings/js/kjs_dom.cpp:
959         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
960         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
961         * bindings/js/kjs_events.cpp:
962         (KJS::JSAbstractEventListener::handleEvent):
963         * bindings/js/kjs_html.cpp:
964         (KJS::HTMLElementFunction::HTMLElementFunction):
965         (KJS::JSHTMLCollection::getOwnPropertySlot):
966         * bindings/js/kjs_window.cpp:
967         (KJS::ScheduledAction::execute):
968         * bindings/objc/WebScriptObject.mm:
969         * bindings/scripts/CodeGeneratorJS.pm:
970
971 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
972
973         Reviewed by Mark Rowe
974
975         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
976
977         * WebCore.xcodeproj/project.pbxproj:
978
979 2007-03-18  David Hyatt  <hyatt@apple.com>
980
981         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
982         and resizing to be more like other browsers.
983
984         Reviewed by ggaren
985
986         fast/frames/no-frame-borders.html
987
988         * html/HTMLFrameElement.cpp:
989         (WebCore::HTMLFrameElement::HTMLFrameElement):
990         (WebCore::HTMLFrameElement::attach):
991         (WebCore::HTMLFrameElement::parseMappedAttribute):
992         * html/HTMLFrameElement.h:
993         (WebCore::HTMLFrameElement::hasFrameBorder):
994         * html/HTMLFrameElementBase.cpp:
995         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
996         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
997         * html/HTMLFrameElementBase.h:
998         * html/HTMLFrameSetElement.cpp:
999         (WebCore::HTMLFrameSetElement::attach):
1000         * html/HTMLFrameSetElement.h:
1001         (WebCore::HTMLFrameSetElement::hasFrameBorder):
1002         * html/HTMLIFrameElement.cpp:
1003         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
1004         * rendering/RenderFrame.cpp:
1005         (WebCore::RenderFrame::edgeInfo):
1006         * rendering/RenderFrame.h:
1007         * rendering/RenderFrameSet.cpp:
1008         (WebCore::RenderFrameSet::paint):
1009         (WebCore::RenderFrameSet::GridAxis::resize):
1010         (WebCore::RenderFrameSet::fillFromEdgeInfo):
1011         (WebCore::RenderFrameSet::computeEdgeInfo):
1012         (WebCore::RenderFrameSet::edgeInfo):
1013         (WebCore::RenderFrameSet::layout):
1014         (WebCore::RenderFrameSet::startResizing):
1015         (WebCore::RenderFrameSet::continueResizing):
1016         (WebCore::RenderFrameSet::canResizeRow):
1017         (WebCore::RenderFrameSet::canResizeColumn):
1018         (WebCore::RenderFrameSet::splitPosition):
1019         (WebCore::RenderFrameSet::hitTestSplit):
1020         (WebCore::RenderFrameSet::dump):
1021         * rendering/RenderFrameSet.h:
1022         (WebCore::):
1023         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
1024         (WebCore::FrameEdgeInfo::preventResize):
1025         (WebCore::FrameEdgeInfo::allowBorder):
1026         (WebCore::FrameEdgeInfo::setPreventResize):
1027         (WebCore::FrameEdgeInfo::setAllowBorder):
1028
1029 2007-03-19  Mark Rowe  <mrowe@apple.com>
1030
1031         Rubber-stamped by Brady.
1032
1033         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1034
1035         * ChangeLog:
1036         * WebCore.vcproj/WebCore/build-generated-files.sh:
1037         * manual-tests/ATSU-bad-layout.html:
1038         * manual-tests/accidental-strict-mode.html:
1039         * manual-tests/applet-param-no-name.html:
1040         * manual-tests/bidi-parens.html:
1041         * manual-tests/bugzilla-3855.html:
1042         * manual-tests/bugzilla-4840.html:
1043         * manual-tests/bugzilla-6821.html:
1044         * manual-tests/containing-block-position-chage.html:
1045         * manual-tests/contenteditable-link.html:
1046         * manual-tests/css3-cursor-fallback-quirks.html:
1047         * manual-tests/css3-cursor-fallback-strict.html:
1048         * manual-tests/custom-cursors.html:
1049         * manual-tests/dictionary-scrolled-iframe.html:
1050         * manual-tests/dom-manipulation-on-resize.html:
1051         * manual-tests/drag-image-to-address-bar.html:
1052         * manual-tests/empty-link-target.html:
1053         * manual-tests/empty-title-popup.html:
1054         * manual-tests/first-line-style-crash.html:
1055         * manual-tests/invalid-mouse-event.html:
1056         * manual-tests/left-overflow-repaint.html:
1057         * manual-tests/linkjump-3.html:
1058         * manual-tests/log-keypress-events.html:
1059         * manual-tests/named-window-blank-target.html:
1060         * manual-tests/plain-text-paste.html:
1061         * manual-tests/plugin-controller-datasource.html:
1062         * manual-tests/pre-tab-selection-rect.html:
1063         * manual-tests/redirection-target.html:
1064         * manual-tests/redraw-page-cache-visited-links.html:
1065         * manual-tests/reset-initiatedDrag.html:
1066         * manual-tests/resources/named-window-blank-target-step2.html:
1067         * manual-tests/resources/named-window-blank-target-step3.html:
1068         * manual-tests/resources/named-window-blank-target-step4.html:
1069         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
1070         * manual-tests/scrollbar-hittest.html:
1071         * manual-tests/scrollbar-hittest2.html:
1072         * manual-tests/subview-click-assertion.html:
1073         * manual-tests/tabbing-input-google.html:
1074         * manual-tests/text-field-autoscroll.html:
1075         * manual-tests/textarea-after-stylesheet-link.html:
1076         * manual-tests/textarea-focus.html:
1077         * manual-tests/whitespace-pre-affinity.html:
1078
1079 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1080
1081         Not reviewed - gdk build fix.
1082
1083         * platform/gdk/ScrollViewGdk.cpp:
1084         (WebCore::ScrollView::update): add a stub
1085
1086 2007-03-18  Brady Eidson  <beidson@apple.com>
1087
1088         Reviewed by Hyatt
1089
1090         http://bugs.webkit.org/show_bug.cgi?id=13111
1091         When stopped a load before it completes, partial images become the 
1092         broken image icon
1093
1094         * loader/loader.cpp:
1095         (WebCore::Loader::didFail): Split off into a method that knows the 
1096           difference between failed and cancelled.  If a load is cancelled,
1097           don't call error() on the object - only remove it from the cache
1098         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
1099         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
1100
1101 2007-03-18  Mitz Pettel  <mitz@webkit.org>
1102
1103         Reviewed by Adele.
1104
1105         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
1106           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
1107
1108         Test: fast/forms/input-text-word-wrap.html
1109
1110         * rendering/RenderTextControl.cpp:
1111         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
1112         'word-wrap:normal'.
1113
1114 2007-03-18  Dan Waylonis  <waylonis@mac.com>
1115
1116         Reviewed by Tim Hatcher.
1117
1118         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
1119         Bug 13005: WebScriptObject +throwException needs NULL check.
1120
1121         Add checking for NULL interpreter before throwing exception.
1122
1123         * bindings/objc/WebScriptObject.mm:
1124         (+[WebScriptObject throwException:]):
1125
1126 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
1127
1128         Reviewed by Oliver Hunt.
1129         
1130         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
1131         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
1132         (Style Change Through JavaScript Blanks Content)
1133         
1134         When indexing into collections, treat the empty string as an invalid argument,
1135         instead of the number 0.
1136
1137         * bindings/js/kjs_html.cpp:
1138         (KJS::JSHTMLCollection::getOwnPropertySlot):
1139         (KJS::JSHTMLCollection::callAsFunction):
1140         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
1141
1142 2007-03-18  David Hyatt  <hyatt@apple.com>
1143
1144         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
1145
1146         Reviewed by aroben
1147
1148         * platform/graphics/IntRect.h:
1149         * rendering/RenderFrameSet.cpp:
1150         (WebCore::RenderFrameSet::paintColumnBorder):
1151         (WebCore::RenderFrameSet::paintRowBorder):
1152
1153 2007-03-18  David Hyatt  <hyatt@apple.com>
1154
1155         Change the frameborder color to be light gray for framesets.
1156
1157         Reviewed by aroben
1158
1159         * rendering/RenderFrameSet.cpp:
1160         (WebCore::borderFillColor):
1161         (WebCore::RenderFrameSet::paintColumnBorder):
1162         (WebCore::RenderFrameSet::paintRowBorder):
1163
1164 2007-03-18  David Hyatt  <hyatt@apple.com>
1165
1166         Make iframes work properly with frameborder="0".
1167
1168         Reviewed by aroben
1169
1170         * html/HTMLIFrameElement.cpp:
1171         (WebCore::HTMLIFrameElement::mapToEntry):
1172         (WebCore::HTMLIFrameElement::parseMappedAttribute):
1173
1174 2007-03-18  David Hyatt  <hyatt@apple.com>
1175
1176         Add a 2px border by default to <iframe>s for compatibility with other browsers.
1177
1178         Reviewed by aroben
1179
1180         * css/html4.css:
1181
1182 2007-03-18  David Hyatt  <hyatt@apple.com>
1183
1184         Move frame borders out of WebKit and into WebCore.
1185
1186         Reviewed by aroben, olliej
1187
1188         * bridge/mac/FrameViewMac.mm:
1189         * css/html4.css:
1190         * html/HTMLFrameSetElement.cpp:
1191         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
1192         (WebCore::HTMLFrameSetElement::mapToEntry):
1193         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
1194         (WebCore::HTMLFrameSetElement::attach):
1195         * html/HTMLFrameSetElement.h:
1196         (WebCore::HTMLFrameSetElement::hasBorderColor):
1197         * page/FrameView.cpp:
1198         (WebCore::FrameViewPrivate::FrameViewPrivate):
1199         * page/FrameView.h:
1200         * page/mac/WebCoreFrameBridge.h:
1201         * platform/graphics/IntRect.h:
1202         (WebCore::IntRect::topLeft):
1203         (WebCore::IntRect::topRight):
1204         (WebCore::IntRect::bottomLeft):
1205         (WebCore::IntRect::bottomRight):
1206         * rendering/RenderFrame.cpp:
1207         (WebCore::RenderFrame::viewCleared):
1208         * rendering/RenderFrameSet.cpp:
1209         (WebCore::borderStartEdgeColor):
1210         (WebCore::borderEndEdgeColor):
1211         (WebCore::RenderFrameSet::paintColumnBorder):
1212         (WebCore::RenderFrameSet::paintRowBorder):
1213         (WebCore::RenderFrameSet::paint):
1214         * rendering/RenderFrameSet.h:
1215         * rendering/RenderPartObject.cpp:
1216         (WebCore::RenderPartObject::viewCleared):
1217         * rendering/RenderView.cpp:
1218         (WebCore::RenderView::repaintViewRectangle):
1219
1220 2007-03-17  David Hyatt  <hyatt@apple.com>
1221
1222         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
1223         happens before any timers set by the onload can fire).
1224
1225         Reviewed by aroben
1226
1227         * dom/Document.cpp:
1228         (WebCore::Document::implicitClose):
1229         * platform/ScrollView.h:
1230         * platform/mac/ScrollViewMac.mm:
1231         (WebCore::ScrollView::update):
1232
1233 2007-03-17  Dave Hyatt  <hyatt@apple.com>
1234
1235         Prevent starvation of user input and painting when processing timers.
1236         If we are already in the processing of a custom timer message, don't allow that
1237         processing to do another PostMessage.  Force SetTimer to be used instead.
1238       
1239         Reviewed by ggaren
1240
1241        * platform/win/SharedTimerWin.cpp:
1242         (WebCore::TimerWindowWndProc):
1243         (WebCore::setSharedTimerFireTime):
1244
1245 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
1246
1247         Reviewed by Beth Dakin.
1248
1249         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
1250         closing View Source window
1251         
1252         I award myself 0 points, and may God have mercy on my soul.
1253
1254         * bindings/js/kjs_proxy.cpp:
1255         (WebCore::KJSProxy::~KJSProxy):
1256
1257 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1258
1259         Not reviewed - gdk build fix.
1260
1261         * platform/gdk/TemporaryLinkStubs.cpp:
1262         (Pasteboard::writeURL):
1263
1264 2007-03-17  David Hyatt  <hyatt@apple.com>
1265
1266         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
1267         unless we actually have a border/background.
1268
1269         Reviewed by Brady
1270
1271         * rendering/RenderImage.cpp:
1272         (WebCore::RenderImage::imageChanged):
1273
1274 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
1275
1276         Reviewed by Sam Weinig.
1277
1278         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
1279         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
1280         Added test: svg/custom/use-css-events.svg
1281
1282         In general this fixes the peepo.co.uk website.
1283
1284         Forgot to pass the actual StyleChange to the recalcStyle() function,
1285         when calling it on the shadow tree root element.
1286
1287         * ksvg2/svg/SVGUseElement.cpp:
1288         (WebCore::SVGUseElement::recalcStyle):
1289
1290 2007-03-17  Timothy Hatcher  <timothy@apple.com>
1291
1292         Reviewed by Mark Rowe.
1293
1294         Made Version.xcconfig smarter when building for different configurations.
1295         Now uses the 522+ OpenSource version for Debug and Release, while using the
1296         full 522.4 version for Production builds. The system prefix is also computed
1297         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
1298
1299         * Configurations/Version.xcconfig:
1300         * Configurations/WebCore.xcconfig:
1301
1302 2007-03-17  Antti Koivisto  <antti@apple.com>
1303
1304         Reviewed by Adele.
1305
1306         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
1307         REGRESSION: Can't add item to cart at lnt.com (JS type error)
1308         <rdar://problem/4722863>
1309         
1310         Emulate Firefox behavior where form elements accessed by a name
1311         can be accessed with that name later even if the name changes or
1312         even if element is removed from the document.
1313         
1314         This is loosely based on Darin's earlier patch for the same problem but
1315         is much less expansive. It takes somewhat different approach to more closely
1316         mimic Firefox behavior. Includes expanded test case.
1317
1318         * bindings/js/JSHTMLFormElementCustom.cpp:
1319         (WebCore::JSHTMLFormElement::canGetItemsForName):
1320             Use new the HTMLFormElement::getNamedElements() method
1321         (WebCore::JSHTMLFormElement::nameGetter):
1322             Use new the HTMLFormElement::getNamedElements() method
1323         * html/HTMLFormElement.cpp:
1324         (WebCore::HTMLFormElement::HTMLFormElement):
1325         (WebCore::HTMLFormElement::~HTMLFormElement):
1326         (WebCore::HTMLFormElement::elementForAlias):
1327         (WebCore::HTMLFormElement::addElementAlias):
1328             Maintain a map of known element aliases
1329         (WebCore::HTMLFormElement::getNamedElements):
1330             Get a list of elements matching the name, based both their
1331             current names and known aliases (earlier names).
1332             Keep the alias list in sync.
1333         * html/HTMLFormElement.h:
1334
1335 2007-03-17  Adele Peterson  <adele@apple.com>
1336
1337         Reviewed by Hyatt.
1338
1339         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
1340         http://bugs.webkit.org/show_bug.cgi?id=12725
1341
1342         Test: updated fast/forms/listbox-onchange.html
1343
1344         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
1345         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
1346         they just have to be up-to-date before we execute an action that may trigger onChange.
1347
1348         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
1349           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
1350           that notifyOptionSelected won't get called when the call originates from the select element.
1351         * html/HTMLOptionElement.h:
1352
1353         * html/HTMLSelectElement.cpp:
1354         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
1355         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
1356          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
1357          the HTMLSelectElement.
1358         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
1359         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
1360         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
1361         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
1362          since it will get saved before we call onChange.
1363         (WebCore::HTMLSelectElement::reset): ditto.
1364         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
1365          on blur.
1366         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
1367         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
1368         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
1369          onchange during mouseup, or after autoscroll).
1370         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
1371
1372         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
1373         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
1374         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
1375         * html/HTMLSelectElement.h:
1376         * platform/PopupMenu.h:
1377
1378 2007-03-16  Oliver Hunt  <oliver@apple.com>
1379
1380         Reviewed by Hyatt.
1381
1382         The old canSaveAsWebArchive call was necessary as stand alone
1383         images used to be rendered by ImageDocument.
1384
1385         Fixes rdar://problem/5061252
1386
1387         * dom/Clipboard.cpp:
1388         * dom/Clipboard.h:
1389         (WebCore::Clipboard::setDragHasStarted):
1390         * page/DragClient.h:
1391         (WebCore::DragClient::declareAndWriteDragImage):
1392         * platform/mac/ClipboardMac.mm:
1393         (WebCore::ClipboardMac::declareAndWriteDragImage):
1394
1395 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
1396
1397         Reviewed by Maciej.
1398
1399         <rdar://problem/4869095>
1400         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
1401         
1402         * xml/xmlhttprequest.cpp:
1403         (WebCore::XMLHttpRequest::send):
1404
1405 2007-03-16  Brady Eidson  <beidson@apple.com>
1406
1407         Rubberstamped by Tim Hatcher
1408
1409         Update the hash table header for Window object properties
1410
1411         * bindings/js/kjs_window.cpp:
1412
1413 2007-03-16  Brady Eidson  <beidson@apple.com>
1414
1415         Reviewed by Anders
1416
1417         <rdar://problem/5061826> and
1418         http://bugs.webkit.org/show_bug.cgi?id=12863
1419         Implement window.stop()
1420
1421         * bindings/js/kjs_window.cpp:
1422         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
1423         * bindings/js/kjs_window.h:
1424         (KJS::Window::): Add "Stop"
1425
1426 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1427
1428         Reviewed by Brady Eidson.
1429
1430         Fixed dir creation to account for already existing dirs and missing leading
1431         dirs in path.
1432         
1433         * loader/icon/IconDatabase.cpp:
1434         (WebCore::makeAllDirectories):
1435
1436 2007-03-16  David Hyatt  <hyatt@apple.com>
1437
1438         Fix for 13084, assertion failure in the Cache.  Convert the client list
1439         to a HashCountedSet so that multiple refs and derefs are allowed.
1440
1441         Fix RenderImage so that if it has the same image used as a background/border
1442         and as the foreground that it will repaint properly (can be tested using
1443         border-image and a foreground image).
1444
1445         Optimize list marker so that it doesn't waste time in the base class method,
1446         since list markers don't support background or border images.
1447
1448         Reviewed by andersca
1449
1450         * ChangeLog:
1451         * loader/CachedResource.cpp:
1452         (WebCore::CachedResource::ref):
1453         * loader/CachedResource.h:
1454         * loader/CachedResourceClientWalker.cpp:
1455         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
1456         * loader/CachedResourceClientWalker.h:
1457         * rendering/RenderImage.cpp:
1458         (WebCore::RenderImage::imageChanged):
1459         * rendering/RenderListMarker.cpp:
1460         (WebCore::RenderListMarker::imageChanged):
1461
1462 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1463
1464         Reviewed by Anders Carlsson.
1465         
1466         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
1467         seen on buildbot
1468
1469         The problem was that we were initializing the same WebScriptObject twice.
1470         This caused it to leak its original set of ivars.
1471         
1472         I think some refactoring could prevent this situation from arising in the
1473         first place, but I'm just adding a check at the call site for now, to do 
1474         the simplest thing.
1475
1476         * bindings/objc/WebScriptObject.mm:
1477         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
1478         against multiple calls.
1479
1480         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
1481         to setImp because "init" vs "initialize" was a too subtle indication that
1482         one was a Cocoa initializer and one was not.
1483
1484 2007-03-16  Lars Knoll <lars@trolltech.com>
1485
1486         don't use #import in .cpp files.
1487
1488         * editing/qt/EditorQt.cpp:
1489
1490 2007-03-16  Lars Knoll <lars@trolltech.com>
1491
1492         Fix the Qt build once again.
1493
1494         * platform/qt/PasteboardQt.cpp:
1495         (WebCore::Pasteboard::Pasteboard):
1496         (WebCore::Pasteboard::writeSelection):
1497         (WebCore::Pasteboard::plainText):
1498         (WebCore::Pasteboard::documentFragment):
1499         (WebCore::Pasteboard::writeURL):
1500         (WebCore::Pasteboard::writeImage):
1501         (WebCore::Pasteboard::clear):
1502
1503 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
1504
1505         Gdk build fix.
1506
1507         * loader/gdk/FrameLoaderClientGdk.cpp:
1508         (WebCore::FrameLoaderClientGdk::blockedError):
1509         * loader/gdk/FrameLoaderClientGdk.h:
1510
1511 2007-03-15  Beth Dakin  <bdakin@apple.com>
1512
1513         Reviewed by Geoff.
1514
1515         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
1516         (r19761-19779): Copy image no longer includes image address 
1517         (rdar://5067927)
1518
1519         writeURL() does not need an isImage parameter. Now that it accepts 
1520         the types as a parameter, we can just declare the appropriate image 
1521         types within writeImage and send them to writeURL(). Also, 
1522         declaring the types twice is what broke this.
1523
1524         * platform/Pasteboard.h:
1525         * platform/mac/PasteboardMac.mm:
1526         (WebCore::Pasteboard::writeURL):
1527         (WebCore::Pasteboard::writeImage):
1528
1529 2007-03-15  Adele Peterson  <adele@apple.com>
1530
1531         Reviewed by Kevin Decker.
1532
1533         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
1534
1535         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
1536           Only setTextFromOption if the menu isn't visible.
1537
1538 2007-03-15  Brady Eidson  <beidson@apple.com>
1539
1540         Reviewed by Oliver
1541
1542         A few platform specific tweaks
1543
1544         * platform/cf/RetainPtr.h:
1545         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
1546         
1547         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
1548
1549 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
1550
1551         Reviewed by Geoff and Steve.
1552
1553         * config.h: Remove unneeded hack.
1554
1555 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
1556
1557         Reviewed by john
1558         
1559         <rdar://problem/5062376> 
1560         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
1561         
1562         Bring back the remove step in applyBlockStyle.  It's 
1563         necessary because addBlockStyleIfNeeded assumes that 
1564         the properties it adds aren't already on the block that 
1565         it adds them to.
1566
1567         * editing/ApplyStyleCommand.cpp:
1568         (WebCore::ApplyStyleCommand::applyBlockStyle): 
1569         Bring back the remove step (added a testcase).
1570         Don't do the add step if m_removeOnly is true (no testcase
1571         because there aren't any clients using removeOnly functionality
1572         to remove styles yet, only styled elemets).
1573         Moved the code for creating new blocks up one level
1574         to this function so that we can pass blocks to removeCSSStyle.
1575         When converting VisiblePositions to indices and vice versa,
1576         use the highest node in the shadow tree if we're in one as
1577         the scope (working on a testcase).
1578         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
1579         applyBlockStyle.
1580         * editing/ApplyStyleCommand.h: 
1581
1582 2007-03-15  Brady Eidson  <beidson@apple.com>
1583
1584         Reviewed by Maciej
1585
1586         <rdar://problem/4429701>
1587         Implements a port blocking black list that matches Firefox's
1588
1589         * loader/FrameLoader.cpp:
1590         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
1591         * loader/FrameLoader.h:
1592
1593         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
1594
1595         * loader/ResourceLoader.cpp:
1596         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
1597         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
1598           error to fail with for the didFail() call
1599         * loader/ResourceLoader.h:
1600
1601         * platform/graphics/svg/SVGImageEmptyClients.h:
1602         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
1603
1604         * platform/network/ResourceHandle.cpp:
1605         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
1606           deferred failure on a timer
1607         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
1608         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
1609         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
1610         * platform/network/ResourceHandle.h:
1611         * platform/network/ResourceHandleClient.h:
1612         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
1613
1614 2007-03-15  Beth Dakin  <bdakin@apple.com>
1615
1616         Reviewed by Hyatt.
1617
1618         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
1619         RenderBlock::layoutInlineChildren seen on buildbot
1620
1621         This leak appeared after http://trac.webkit.org/projects/webkit/
1622         changeset/20188. This change shifted line boxes around in 
1623         removeChild(). But since removeChild() calls 
1624         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
1625         removed once we actually lay out anyway. So this patch fixes the 
1626         leak by deleting the line boxes instead of shifting them around. 
1627
1628         * editing/IndentOutdentCommand.cpp:
1629         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
1630         updateLayout(). This fixes an assertion I got in editing/
1631         execCommand/4976800.html This is very similar to the line box fix I 
1632         made recently (http://trac.webkit.org/projects/webkit/changeset/
1633         20177). We need to update layout before relying on VisiblePositions 
1634         after removing a node.
1635         * rendering/RenderBlock.cpp:
1636         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
1637         since this functionality is needed in three places now.
1638         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
1639         deleteLinesForBlock().
1640         (WebCore::RenderBlock::removeChild): Same.
1641         * rendering/RenderBlock.h:
1642
1643 2007-03-15  Timothy Hatcher  <timothy@apple.com>
1644
1645         Reviewed by John.
1646
1647         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
1648           each build configuration was factored out into the shared .xcconfig file.
1649         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
1650         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
1651         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
1652
1653         * Configurations/Base.xcconfig: Added.
1654         * Configurations/DebugRelease.xcconfig: Added.
1655         * Configurations/Version.xcconfig: Added.
1656         * Configurations/WebCore.xcconfig: Added.
1657         * Info.plist:
1658         * WebCore.xcodeproj/project.pbxproj:
1659
1660 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1661
1662         Not reviewed - gdk build fixes.
1663
1664         * platform/gdk/EditorClientGdk.cpp:
1665         (WebCore::EditorClientGdk::handleKeypress):
1666         * platform/graphics/cairo/ImageSourceCairo.cpp:
1667         (WebCore::ImageSource::setData):
1668         * platform/graphics/gdk/ImageGdk.cpp:
1669         (WebCore::Image::loadPlatformResource):
1670
1671 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
1672
1673         Reviewed by john
1674         
1675         ~2x speed up of 5k rich text paste:
1676         http://shakespeare.mit.edu/hamlet/full.html        
1677
1678         * editing/ReplaceSelectionCommand.cpp:
1679         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
1680         level style span if it's unnecessary before inserting
1681         into the document, it's faster than doing it after.
1682         * editing/ReplaceSelectionCommand.h: Exposed 
1683         ReplacementFragment::removeNodePreservingChildren so that
1684         the style span can be removed using non-undoable removes,
1685         like the rest of the removes done on the ReplacementFragment.
1686         * editing/markup.cpp:
1687         (WebCore::createMarkup): Make the style span the top level
1688         element, otherwise it's useless.  This also facilitates the
1689         optimization mentioned above.
1690         When including markup for a fully selected root, include markup
1691         for all the nodes beneath that fully selected root, to preserve 
1692         the structure and appearance of the copied markup.  Did this
1693         by merging with the code for adding markup for descendants of
1694         special commonAncestorBlocks.
1695
1696 2007-03-15  Beth Dakin  <bdakin@apple.com>
1697
1698         Rubber-stamped by Adele.
1699
1700         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
1701         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
1702         and rdar://4722863) because it causes a horrible memory-trasher. 
1703
1704         * bindings/js/JSHTMLFormElementCustom.cpp:
1705         (WebCore::JSHTMLFormElement::canGetItemsForName):
1706         (WebCore::JSHTMLFormElement::nameGetter):
1707         * bindings/js/kjs_dom.cpp:
1708         (KJS::):
1709         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
1710         (KJS::DOMNamedNodesCollection::lengthGetter):
1711         (KJS::DOMNamedNodesCollection::indexGetter):
1712         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
1713         * bindings/js/kjs_dom.h:
1714         (KJS::DOMNamedNodesCollection::classInfo):
1715         * bindings/js/kjs_html.cpp:
1716         (KJS::JSHTMLCollection::getNamedItems):
1717         * dom/ChildNodeList.cpp:
1718         (WebCore::ChildNodeList::ChildNodeList):
1719         (WebCore::ChildNodeList::length):
1720         (WebCore::ChildNodeList::item):
1721         (WebCore::ChildNodeList::nodeMatches):
1722         * dom/ChildNodeList.h:
1723         * dom/NameNodeList.cpp:
1724         (WebCore::NameNodeList::NameNodeList):
1725         (WebCore::NameNodeList::item):
1726         (WebCore::NameNodeList::nodeMatches):
1727         * dom/NameNodeList.h:
1728         (WebCore::NameNodeList::rootNodeAttributeChanged):
1729         * dom/Node.cpp:
1730         (WebCore::TagNodeList::TagNodeList):
1731         (WebCore::TagNodeList::nodeMatches):
1732         (WebCore::Node::registerNodeList):
1733         (WebCore::Node::unregisterNodeList):
1734         * dom/Node.h:
1735         * dom/NodeList.cpp:
1736         (WebCore::NodeList::NodeList):
1737         (WebCore::NodeList::~NodeList):
1738         (WebCore::NodeList::recursiveLength):
1739         (WebCore::NodeList::itemForwardsFromCurrent):
1740         (WebCore::NodeList::itemBackwardsFromCurrent):
1741         (WebCore::NodeList::recursiveItem):
1742         (WebCore::NodeList::itemWithName):
1743         (WebCore::NodeList::rootNodeChildrenChanged):
1744         * dom/NodeList.h:
1745         (WebCore::NodeList::rootNodeAttributeChanged):
1746         * html/HTMLFormElement.cpp:
1747         (WebCore::HTMLFormElement::HTMLFormElement):
1748         (WebCore::HTMLFormElement::~HTMLFormElement):
1749         (WebCore::HTMLFormElement::formData):
1750         (WebCore::HTMLFormElement::parseMappedAttribute):
1751         (WebCore::HTMLFormElement::removeFormElement):
1752         * html/HTMLFormElement.h:
1753         * html/HTMLGenericFormElement.cpp:
1754         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
1755         (WebCore::HTMLGenericFormElement::insertedIntoTree):
1756         * html/HTMLGenericFormElement.h:
1757         * html/HTMLInputElement.cpp:
1758         (WebCore::HTMLInputElement::parseMappedAttribute):
1759
1760 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
1761
1762         Added an assert to help catch a bug. Hopefully someone will hit it!
1763         
1764         * bindings/js/kjs_proxy.cpp:
1765         (WebCore::KJSProxy::~KJSProxy):
1766
1767 2007-03-14  Oliver Hunt  <oliver@apple.com>
1768
1769         Reviewed by Adele.
1770
1771         Fix for rdar://problem/5061737.
1772         
1773         This was a regression from the original Objective-C -> C++ conversion
1774         for the drag logic.  We don't need to call Range::startNode as we just
1775         need the document that contains the range.   
1776
1777         * page/DragController.cpp:
1778         (WebCore::documentFragmentFromDragData):
1779
1780 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1781
1782         Reviewed by Hyatt.
1783
1784         - http://bugs.webkit.org/show_bug.cgi?id=13071
1785           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
1786
1787         Test: fast/loader/text-document-wrapping.html
1788
1789         * loader/TextDocument.cpp:
1790         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
1791
1792 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1793
1794         Reviewed by Hyatt.
1795
1796         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
1797           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
1798
1799         Test: fast/text/whitespace/pre-wrap-last-char.html
1800
1801         * rendering/bidi.cpp:
1802         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
1803
1804 2007-03-14  David Hyatt  <hyatt@apple.com>
1805
1806         Add asserts to help catch double refs and double derefs of CachedResources.
1807
1808         Reviewed by mjs
1809
1810         * loader/CachedResource.cpp:
1811         (WebCore::CachedResource::ref):
1812         (WebCore::CachedResource::deref):
1813
1814 2007-03-14  Alice Liu  <alice.liu@apple.com>
1815
1816         Rubber-stamped by Hyatt.
1817
1818         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
1819
1820         * loader/icon/IconDataCache.cpp:
1821         (WebCore::IconDataCache::writeToDatabase):
1822
1823 === Safari-5522.4 ===
1824
1825 2007-03-14  Adele Peterson  <adele@apple.com>
1826
1827         Reviewed by Adam.
1828
1829         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
1830
1831         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
1832
1833         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
1834
1835 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
1836
1837         Reviewed by Adam.
1838
1839         Added missing null check in case this is called on a subframe
1840         that hasn't started loading.
1841
1842         * page/Frame.cpp:
1843         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
1844
1845 2007-03-14  Antti Koivisto  <antti@apple.com>
1846
1847         Reviewed by Geoff.
1848
1849         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
1850         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
1851         <rdar://5060208>
1852         
1853         Script evaluation may have dereffed the CachedScript object already, causing double deref and
1854         eventually m_liveResourcesSize underflow.
1855
1856         * html/HTMLScriptElement.cpp:
1857         (WebCore::HTMLScriptElement::notifyFinished):
1858
1859 2007-03-14  Adele Peterson  <adele@apple.com>
1860
1861         Reviewed by Darin.
1862
1863         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
1864         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
1865         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
1866         these editing commands will need to consider the event so they are applied to the correct selection.
1867
1868         * WebCore.exp:
1869         * editing/Editor.cpp:
1870         (WebCore::execCopy):
1871         (WebCore::execCut):
1872         (WebCore::execDelete):
1873         (WebCore::execBackwardDelete):
1874         (WebCore::execForwardDelete):
1875         (WebCore::execMoveBackward):
1876         (WebCore::execMoveBackwardAndModifySelection):
1877         (WebCore::execMoveUpByPageAndModifyCaret):
1878         (WebCore::execMoveDown):
1879         (WebCore::execMoveDownAndModifySelection):
1880         (WebCore::execMoveForward):
1881         (WebCore::execMoveForwardAndModifySelection):
1882         (WebCore::execMoveDownByPageAndModifyCaret):
1883         (WebCore::execMoveLeft):
1884         (WebCore::execMoveLeftAndModifySelection):
1885         (WebCore::execMoveRight):
1886         (WebCore::execMoveRightAndModifySelection):
1887         (WebCore::execMoveToBeginningOfDocument):
1888         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
1889         (WebCore::execMoveToBeginningOfSentence):
1890         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
1891         (WebCore::execMoveToBeginningOfLine):
1892         (WebCore::execMoveToBeginningOfLineAndModifySelection):
1893         (WebCore::execMoveToBeginningOfParagraph):
1894         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
1895         (WebCore::execMoveToEndOfDocument):
1896         (WebCore::execMoveToEndOfDocumentAndModifySelection):
1897         (WebCore::execMoveToEndOfSentence):
1898         (WebCore::execMoveToEndOfSentenceAndModifySelection):
1899         (WebCore::execMoveToEndOfLine):
1900         (WebCore::execMoveToEndOfLineAndModifySelection):
1901         (WebCore::execMoveToEndOfParagraph):
1902         (WebCore::execMoveToEndOfParagraphAndModifySelection):
1903         (WebCore::execMoveParagraphBackwardAndModifySelection):
1904         (WebCore::execMoveParagraphForwardAndModifySelection):
1905         (WebCore::execMoveUp):
1906         (WebCore::execMoveUpAndModifySelection):
1907         (WebCore::execMoveWordBackward):
1908         (WebCore::execMoveWordBackwardAndModifySelection):
1909         (WebCore::execMoveWordForward):
1910         (WebCore::execMoveWordForwardAndModifySelection):
1911         (WebCore::execMoveWordLeft):
1912         (WebCore::execMoveWordLeftAndModifySelection):
1913         (WebCore::execMoveWordRight):
1914         (WebCore::execMoveWordRightAndModifySelection):
1915         (WebCore::execPaste):
1916         (WebCore::execSelectAll):
1917         (WebCore::execToggleBold):
1918         (WebCore::execToggleItalic):
1919         (WebCore::execRedo):
1920         (WebCore::execUndo):
1921         (WebCore::execInsertTab):
1922         (WebCore::execInsertBacktab):
1923         (WebCore::execInsertNewline):
1924         (WebCore::execInsertLineBreak):
1925         (WebCore::enabled):
1926         (WebCore::canPaste):
1927         (WebCore::hasEditableSelection):
1928         (WebCore::hasEditableRangeSelection):
1929         (WebCore::hasRangeSelection):
1930         (WebCore::hasRichlyEditableSelection):
1931         (WebCore::canRedo):
1932         (WebCore::canUndo):
1933         (WebCore::CommandEntry::):
1934         (WebCore::Editor::toggleBold):
1935
1936         (WebCore::Editor::execCommand): Added optional event parameter.
1937         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
1938         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
1939          Performs the actual insertion without dispatching any event.
1940         * editing/Editor.h:
1941         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
1942           Call insertTextWithoutSendingTextEvent.
1943
1944 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
1945
1946         Reviewed by darin
1947         
1948         ~3x speedup pasting 5k lines of rich text:
1949         http://shakespeare.mit.edu/hamlet/full.html
1950         ~2x speedup pasting 10k lines of plain text
1951         
1952         * css/CSSComputedStyleDeclaration.cpp:
1953         (WebCore::computedStyle): Added for convenience.
1954         * css/CSSComputedStyleDeclaration.h:
1955         * editing/ReplaceSelectionCommand.cpp:
1956         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
1957         The code that pushed down the top level style span had
1958         a bug in it that made it do unnecessary work.  Instead of
1959         fixing the bug I removed the code because it was used to 
1960         help see more redundancies in second level style spans, but 
1961         createMarkup now *only* creates a top level style span.
1962         Only remove redundant styles from style spans and only remove
1963         unstyled elements if they are style spans.  FF doesn't
1964         remove redundant styles from elements, or remove redundant 
1965         font tags on copy/paste.  We could offer this functionality 
1966         through a separate "cleanup" command.
1967         * editing/markup.cpp:
1968         (WebCore::createMarkup): Only add markup for ancestors of 
1969         lastClosed if we're including markup for acommonAncestorBlock 
1970         (we do this for commonAncestorBlocks like tables and lists),
1971         otherwise it's unnecessary/redundant.
1972
1973 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
1974
1975         Reviewed by Ada.
1976
1977         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
1978         data, since SubresourceLoaderClients now make use of that buffer.
1979         
1980         * loader/SubresourceLoader.cpp:
1981         (WebCore::SubresourceLoader::didReceiveData):
1982
1983 2007-03-14  Administrator  <acarlsson@apple.com>
1984
1985         Get the size from the shared buffer.
1986         
1987         * platform/graphics/cg/ImageSourceCG.cpp:
1988         (WebCore::ImageSource::setData):
1989         * platform/graphics/cg/PDFDocumentImage.cpp:
1990         (WebCore::PDFDocumentImage::dataChanged):
1991
1992 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1993
1994         Reviewed by Hyatt, thumbs up by Darin.
1995
1996         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
1997           Reproducible crash in BidiContext::deref
1998
1999         Test: fast/dynamic/anonymous-block-orphaned-lines.html
2000
2001         * rendering/InlineBox.cpp:
2002         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
2003         * rendering/RenderBlock.cpp:
2004         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
2005         anonymous blocks being destroyed instead of leaving them orphaned, which
2006         is what caused this crash. The boxes will be deleted on the next layout, but
2007         this ensures consistency in the mean time.
2008
2009 2007-03-14  Lars Knoll <lars@trolltech.com>
2010
2011         Reviewed by Antti.
2012
2013         Fix the Qt build.
2014         Add a getter to SharedBuffer that returns a reference to the internal
2015         Vector to avoid an extra copy of the data.
2016
2017         * platform/SharedBuffer.h:
2018         (WebCore::SharedBuffer::buffer):
2019         * platform/graphics/qt/ImageQt.cpp:
2020         (WebCore::Image::loadPlatformResource):
2021         * platform/graphics/qt/ImageSourceQt.cpp:
2022         (WebCore::detectImageFormat):
2023         (WebCore::createDecoder):
2024         (WebCore::ImageSource::setData):
2025
2026 2007-03-14  Antti Koivisto  <antti@apple.com>
2027
2028         Reviewed by Mitz.
2029         
2030         Fix <rdar://problem/5058774>
2031         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
2032         
2033         Horizontal and vertical were switched. Was regression from
2034         http://trac.webkit.org/projects/webkit/changeset/20103
2035
2036         * rendering/RootInlineBox.cpp:
2037         (WebCore::RootInlineBox::addHighlightOverflow):
2038
2039 2007-03-14  David Hyatt  <hyatt@apple.com>
2040
2041         Tweak the data() functions of stylesheets and scripts to be internally consistent.
2042
2043         * loader/CachedCSSStyleSheet.cpp:
2044         (WebCore::CachedCSSStyleSheet::data):
2045         * loader/CachedScript.cpp:
2046         (WebCore::CachedScript::data):
2047         * loader/CachedXSLStyleSheet.cpp:
2048         (WebCore::CachedXSLStyleSheet::data):
2049
2050 2007-03-14  David Hyatt  <hyatt@apple.com>
2051
2052         Fix Radar 5050688.  
2053
2054         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
2055         the memory consumption down while giant images are animating.
2056
2057         Reviewed by andersca
2058
2059         * platform/graphics/BitmapImage.cpp:
2060         (WebCore::BitmapImage::BitmapImage):
2061         (WebCore::BitmapImage::destroyDecodedData):
2062         (WebCore::BitmapImage::dataChanged):
2063         (WebCore::BitmapImage::advanceAnimation):
2064         * platform/graphics/BitmapImage.h:
2065
2066 2007-03-14  David Hyatt  <hyatt@apple.com>
2067
2068         Make sure to use CFDataCreateWithBytesNoCopy where we can.
2069
2070         Reviewed by andersca
2071
2072         * platform/graphics/cg/ImageSourceCG.cpp:
2073         (WebCore::ImageSource::setData):
2074         * platform/graphics/cg/PDFDocumentImage.cpp:
2075         (WebCore::PDFDocumentImage::dataChanged):
2076
2077 2007-03-13  David Hyatt  <hyatt@apple.com>
2078
2079         Fix for bugzilla bug 13050 and also radar p1 5050645.
2080
2081         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
2082         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
2083         database.
2084
2085         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
2086         making their own.  Even ImageIO uses the SharedBuffer while decoding.
2087
2088         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
2089         of 100mb.
2090
2091         Reviewed by olliej, mjs
2092
2093         * WebCore.exp:
2094         * loader/CachedCSSStyleSheet.cpp:
2095         (WebCore::CachedCSSStyleSheet::data):
2096         * loader/CachedCSSStyleSheet.h:
2097         * loader/CachedImage.cpp:
2098         (WebCore::CachedImage::data):
2099         * loader/CachedImage.h:
2100         * loader/CachedResource.cpp:
2101         (WebCore::CachedResource::CachedResource):
2102         (WebCore::CachedResource::~CachedResource):
2103         * loader/CachedResource.h:
2104         (WebCore::CachedResource::data):
2105         * loader/CachedScript.cpp:
2106         (WebCore::CachedScript::data):
2107         * loader/CachedScript.h:
2108         * loader/CachedXSLStyleSheet.cpp:
2109         (WebCore::CachedXSLStyleSheet::data):
2110         * loader/CachedXSLStyleSheet.h:
2111         * loader/DocLoader.cpp:
2112         (WebCore::DocLoader::checkCacheObjectStatus):
2113         * loader/ImageDocument.cpp:
2114         (WebCore::ImageTokenizer::writeRawData):
2115         (WebCore::ImageTokenizer::finish):
2116         * loader/icon/IconDataCache.cpp:
2117         (WebCore::IconDataCache::setImageData):
2118         (WebCore::IconDataCache::writeToDatabase):
2119         * loader/icon/IconDataCache.h:
2120         * loader/icon/IconDatabase.cpp:
2121         (WebCore::IconDatabase::imageDataForIconURL):
2122         (WebCore::IconDatabase::iconForPageURL):
2123         (WebCore::IconDatabase::setIconDataForIconURL):
2124         (WebCore::IconDatabase::setHaveNoIconForIconURL):
2125         (WebCore::IconDatabase::imageDataForIconURLQuery):
2126         * loader/icon/IconDatabase.h:
2127         * loader/icon/IconLoader.cpp:
2128         (WebCore::IconLoader::startLoading):
2129         (WebCore::IconLoader::didReceiveResponse):
2130         (WebCore::IconLoader::didReceiveData):
2131         (WebCore::IconLoader::didFail):
2132         (WebCore::IconLoader::finishLoading):
2133         (WebCore::IconLoader::clearLoadingState):
2134         * loader/icon/IconLoader.h:
2135         * loader/icon/SQLStatement.cpp:
2136         (WebCore::SQLStatement::getColumnBlobAsVector):
2137         (WebCore::SQLStatement::isExpired):
2138         * loader/icon/SQLStatement.h:
2139         * loader/loader.cpp:
2140         (WebCore::Loader::didFinishLoading):
2141         (WebCore::Loader::didReceiveData):
2142         * page/mac/WebCoreFrameBridge.mm:
2143         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2144         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
2145         * platform/SharedBuffer.h:
2146         (WebCore::SharedBuffer::isEmpty):
2147         * platform/graphics/BitmapImage.cpp:
2148         (WebCore::BitmapImage::destroyDecodedData):
2149         (WebCore::BitmapImage::dataChanged):
2150         * platform/graphics/BitmapImage.h:
2151         * platform/graphics/Image.cpp:
2152         (WebCore::Image::setData):
2153         * platform/graphics/Image.h:
2154         (WebCore::Image::dataChanged):
2155         (WebCore::Image::data):
2156         * platform/graphics/ImageSource.h:
2157         * platform/graphics/cg/ImageSourceCG.cpp:
2158         (WebCore::ImageSource::setData):
2159         * platform/graphics/cg/PDFDocumentImage.cpp:
2160         (WebCore::PDFDocumentImage::dataChanged):
2161         * platform/graphics/cg/PDFDocumentImage.h:
2162         * platform/graphics/mac/ImageMac.mm:
2163         (WebCore::Image::loadPlatformResource):
2164         * platform/graphics/svg/SVGImage.cpp:
2165         (WebCore::SVGImage::setData):
2166         * platform/mac/PasteboardMac.mm:
2167         (WebCore::fileWrapperForImage):
2168
2169 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
2170
2171         Reviewed by darin
2172         
2173         <rdar://problem/5046875> 
2174         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
2175
2176         * editing/ApplyStyleCommand.cpp:
2177         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
2178         there is a block style to apply.
2179         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
2180         It was unnecessary and removed properties from blocks that could contain 
2181         content outside the range being operated on (added a testcase).
2182         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
2183         instead of if-nesting.
2184         * editing/ApplyStyleCommand.h:
2185         * editing/CompositeEditCommand.cpp:
2186         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2187         Return the new block, if one was created.  Use moveParagraphs to move
2188         paragraphs into the new block, instead of moving nodes.  The old code moved
2189         too much (added a testcase).
2190         * editing/CompositeEditCommand.h:
2191
2192 2007-03-13  Oliver Hunt  <oliver@apple.com>
2193
2194         Reviewed by Brady.
2195
2196         To fix <rdar://problem/5044366> we now pass a NSString
2197         representation of the URL extracted with _web_originalDataAsString
2198         instead of relying on [NSURL absoluteString] in the bridge
2199
2200         * page/mac/WebCoreFrameBridge.h:
2201         * page/mac/WebCoreFrameBridge.mm:
2202         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2203
2204 2007-03-13  Brady Eidson  <beidson@apple.com>
2205
2206         Reviewed by Anders
2207
2208         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
2209
2210         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
2211         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
2212         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
2213         resources being cached.
2214         
2215         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
2216         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
2217         
2218         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
2219         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
2220         completely load.
2221
2222         Note that the layout test for this - if possible - will require other enhancements including possibly adding
2223         support for window.stop().  That task is documented in <rdar://problem/5061826>
2224
2225         * loader/FrameLoader.cpp:
2226         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
2227           more perfectly restore the original behavior - including only caching HTML documents via the 
2228           m_client->canCachePage() call
2229         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
2230           purpose
2231           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
2232           cachability of a page
2233
2234         * loader/loader.cpp:
2235         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
2236           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
2237
2238 2007-03-13  Beth Dakin  <bdakin@apple.com>
2239
2240         Rendering part reviewed by Hyatt. Editing part consulted with and 
2241         rubber stamped by Justin and Harrison.
2242
2243         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
2244         attempting to print page at http://www.pcadvisor.co.uk
2245
2246         * rendering/RenderBlock.cpp:
2247         (WebCore::RenderBlock::makeChildrenNonInline): 
2248         RenderBlock::makeChildrenNonInline() takes a block's inline 
2249         children and turns them into block children. If the children had 
2250         line boxes, those boxes were being leaked. In the layout test I 
2251         added with the change (and at pcadvisor.co.uk during printing) 
2252         children were being made non-inline, and then they were being made 
2253         inline again. This meant that some of the children ended up 
2254         pointing to totally stale line boxes that are normally just leaked. 
2255         This caused an infinite loop in RenderFlow::destroy(). This patch 
2256         simply deletes everyone's line boxes in 
2257         RenderBlock::makeChildrenNonInline()
2258
2259         * editing/InsertParagraphSeparatorCommand.cpp:
2260         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
2261         of this fix is that I added a call to updateLayout in 
2262         InsertParagraphSeparatorCommand::doApply(). One layout test 
2263         (editing/spelling/spelling.html) was changed by my patch to 
2264         RenderBlock. doApply() inserts a node into the render tree. In at 
2265         least one case in spelling.html, that caused some line boxes to be 
2266         deleted. Back in doApply() this meant that the RenderTree was out-
2267         of-date, and we mistakenly thought we were at the end of the 
2268         paragraph. This caused us to insert a RenderBR() at the end of the 
2269         tree instead of an empty RenderText(). No one seems to know exactly 
2270         why we insert either, or if the change is necessarily a problem. It 
2271         is clear, though, that the RenderTree in doApply() is out-of-date 
2272         after inserting the node and deleting some line boxes, so it seems 
2273         prudent to call into updateLayout().
2274
2275 2007-03-13  Adam Roben  <aroben@apple.com>
2276
2277         Reviewed by Anders.
2278
2279         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
2280
2281 2007-03-13  Beth Dakin  <bdakin@apple.com>
2282
2283         Reviewed by Maciej.
2284
2285         Export DocumentLoader::setFrame(). Part of fix for <rdar://
2286         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
2287         KHTMLView::viewportMouseReleaseEvent (12647)
2288
2289         * WebCore.exp:
2290
2291 2007-03-13  Darin Adler  <darin@apple.com>
2292
2293         Reviewed by Maciej.
2294
2295         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
2296           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
2297           finishes loading due to unclosed canvas tag (12794)
2298
2299         Change <canvas> elements so that their contents are parsed normally,
2300         but not rendered. This change fixes the bug, because normal parsing
2301         rules close the <canvas> element in that case. The special parser
2302         stuff was just getting in the way.
2303
2304         Also do some basic cleanup to the HTML parser. This was motivated by
2305         an earlier version of this patch that made even more changes to the
2306         parser, but the cleanup is still worth landing.
2307
2308         Test: fast/canvas/canvas-hides-fallback.html
2309         Test: fast/canvas/script-inside-canvas-fallback.html
2310         Test: fast/canvas/unclosed-canvas-1.html
2311         Test: fast/canvas/unclosed-canvas-2.html
2312         Test: fast/canvas/unclosed-canvas-3.html
2313         Test: fast/canvas/unclosed-canvas-4.html
2314
2315         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
2316         renderer is a RenderHTMLCanvas or not.
2317         * html/HTMLCanvasElement.cpp:
2318         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
2319         a RenderHTMLCanvas. If it's not, let the default code create the default type
2320         of renderer, which will result in fallback content being visible. The
2321         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
2322         boolean accordingly. Since the actual storage for the canvas is allocated lazily
2323         when you actually get a drawing context, we don't need to do anything special
2324         to prevent it when JavaScript is disabled; the relevant functions won't be called.
2325         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
2326         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
2327         the DOM element that relies on the renderer type.
2328
2329         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
2330         Noncopyable. Changed the Document parameter to the constructor to instead
2331         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
2332         Removed unused noSpaces function and unneeded public doc() function.
2333         Moved data members all down to the end so you can see them together in order.
2334         Renamed map to m_currentMapElement and isindex to m_isindexElement.
2335         Removed unused end and headLoaded data members.  Renamed m_fragment to
2336         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
2337
2338         * html/HTMLParser.cpp:
2339         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
2340         syntax instead of calling reset(). This is especially helpful in the
2341         fragment case, where calling reset() later on is illegal, so not using
2342         it in the constructor lets us assert.
2343         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
2344         calling setCurrent for its side effect.
2345         (WebCore::HTMLParser::reset): Updated for member name changes and removal
2346         and to use document instead of doc().
2347         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
2348         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
2349         m_inCanvasBeforeFirstOpenTag data member to false.
2350         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
2351         top of the function, and added a FIXME about the strange case there where
2352         we don't skip yet stay in skip mode. Updated for renaming and doc().
2353         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
2354         (WebCore::HTMLParser::handleError): Ditto.
2355         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
2356         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
2357         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
2358         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
2359         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
2360         Canvas fallback is now handled in the DOM, not the parser. Updated for
2361         renaming and doc().
2362         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
2363         constant.
2364         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
2365         (WebCore::HTMLParser::isInline): Ditto.
2366         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
2367         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
2368         the local variable Elem to elem.
2369         (WebCore::HTMLParser::createHead): Ditto.
2370         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
2371         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
2372         (WebCore::HTMLParser::finished): Ditto.
2373
2374 2007-03-13  David Hyatt  <hyatt@apple.com>
2375
2376         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
2377         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
2378         data.  Since we're about to be destroyed this is just wasteful.
2379
2380         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
2381         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
2382
2383         Reviewed by ggaren
2384
2385         * loader/Cache.cpp:
2386         (WebCore::Cache::prune):
2387         * platform/graphics/BitmapImage.cpp:
2388         (WebCore::BitmapImage::~BitmapImage):
2389
2390 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
2391
2392         Try fixing the Qt build.
2393         
2394         * editing/Editor.h:
2395         (WebCore::Editor::setStartNewKillRingSequence):
2396
2397 2007-03-13  David Harrison  <harrison@apple.com>
2398
2399         Reviewed by Justin.
2400
2401         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
2402         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
2403
2404         For rdar://5031181, properly extend the selection before the killring handling, and
2405         make sure plainText of that selection returns a linefeed.
2406         
2407         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
2408         even though the range deletion implicitly stopped it via changing the selection.
2409         
2410         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
2411         only difference between the two was whether to emit a newline when the range started
2412         with a blockflow element. No callers actually need that any more.
2413
2414         Tests added:
2415         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
2416         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
2417         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
2418         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
2419
2420         * editing/Editor.cpp:
2421         (WebCore::Editor::deleteRange):
2422         Clear the "start new kill ring sequence" setting, because it was set to true
2423         when the selection was updated by deleting the range.
2424         
2425         (WebCore::Editor::deleteWithDirection):
2426         If extending the selection to the end of paragraph resulted in a caret selection,
2427         extend by character, to handle the case when the selection started as a caret at
2428         the end of paragraph.
2429         
2430         * editing/TextIterator.cpp:
2431         (WebCore::TextIterator::TextIterator):
2432         Initialize new member variables for tracking handling of the beginning of the range.
2433         
2434         (WebCore::TextIterator::advance):
2435         Call representNodeOffsetZero on the m_endContainer.
2436         Move visibility checks into handleTextNode and handleReplacedElement.
2437         
2438         (WebCore::TextIterator::handleTextNode):
2439         (WebCore::TextIterator::handleTextBox):
2440         Call emitText.
2441         
2442         (WebCore::TextIterator::handleReplacedElement):
2443         Moved visibility check into here.
2444         
2445         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2446         
2447         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2448         (WebCore::TextIterator::representNodeOffsetZero):
2449         New. Emits proper sequence when encountering offset 0 of a node, including the
2450         m_endContainer. Started with code from handleNonTextNode.
2451         
2452         (WebCore::TextIterator::handleNonTextNode):
2453         Call representNodeOffsetZero.
2454         
2455         (WebCore::TextIterator::exitNode):
2456         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
2457         was collapsed, and before any other emitted content.
2458         
2459         (WebCore::TextIterator::emitCharacter):
2460         
2461         (WebCore::TextIterator::emitText):
2462         New. Consolidates code used by handleText and handleTextBox.
2463         
2464         (WebCore::CharacterIterator::CharacterIterator):
2465         Removed RUNFINDER.
2466
2467         (WebCore::WordAwareIterator::WordAwareIterator):
2468         Removed RUNFINDER.
2469         
2470         (WebCore::WordAwareIterator::advance):
2471         Formatting.
2472
2473         (WebCore::TextIterator::rangeLength):
2474         Formatting.
2475         
2476         * editing/TextIterator.h:
2477         Added member variables for tracking handling of the beginning of the range.
2478         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2479         
2480         * editing/visible_units.cpp:
2481         (WebCore::nextBoundary):
2482         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2483
2484 2007-03-13  David Hyatt  <hyatt@apple.com>
2485
2486         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
2487         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
2488
2489         * loader/CachedImage.cpp:
2490         (WebCore::CachedImage::data):
2491
2492 2007-03-13  David Hyatt  <hyatt@apple.com>
2493
2494         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
2495         incorrect.
2496
2497         * loader/CachedResource.cpp:
2498         (WebCore::CachedResource::deref):
2499
2500 2007-03-13  Antti Koivisto  <antti@apple.com>
2501
2502         Reviewed by Darin.
2503         
2504         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
2505         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
2506         <rdar://problem/4757650>
2507         
2508         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
2509
2510         * page/EventHandler.cpp:
2511         (WebCore::EventHandler::defaultTabEventHandler):
2512
2513 2007-03-13  David Hyatt  <hyatt@apple.com>
2514
2515         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
2516         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
2517         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
2518
2519         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
2520         changes we should not notify the cache, since - newsflash - we aren't actually in it.
2521
2522         Reviewed by ggaren
2523
2524         * loader/CachedImage.cpp:
2525         (WebCore::CachedImage::clear):
2526         (WebCore::CachedImage::decodedSizeChanged):
2527
2528 2007-03-13  Darin Adler  <darin@apple.com>
2529
2530         Reviewed by Tim Hatcher and John Sullivan.
2531
2532         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
2533           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
2534
2535         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
2536         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
2537         method was never really safe to call unless it was AppKit that called your
2538         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
2539         but seems to work and will almost certainly fix the bug.
2540
2541 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
2542
2543         Reviewed by Maciej.
2544
2545         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
2546
2547         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
2548         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
2549         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
2550         there was already a generic context pointer registered, and the new "to be registered"
2551         object already exists, but pointing to a different object. That's because garbage collection
2552         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
2553
2554         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
2555         using the generic context system while using a custom JSSVGPathSegList implementation.
2556
2557         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
2558         method instead of doing the same using custom code.
2559
2560         * bindings/js/JSSVGPathSegListCustom.cpp:
2561         (WebCore::removeFromPathSegContextMap):
2562         (WebCore::JSSVGPathSegList::clear):
2563         (WebCore::JSSVGPathSegList::removeItem):
2564         * bindings/scripts/CodeGeneratorJS.pm:
2565
2566 2007-03-13  Darin Adler  <darin@apple.com>
2567
2568         Reviewed by Adele.
2569
2570         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
2571           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
2572           (JS type error) (12595)
2573
2574         Test: fast/forms/old-names.html
2575
2576         * bindings/js/JSHTMLFormElementCustom.cpp:
2577         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
2578         nothing for a given name, try the form's oldNamedElement function.
2579         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
2580
2581         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
2582         a class derived from NodeList.
2583         * bindings/js/kjs_dom.cpp: Ditto.
2584
2585         * bindings/js/kjs_html.cpp:
2586         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
2587         from NodeList to be used for the named items result from a collection -- uses a
2588         vector of node pointers.
2589         (KJS::VectorNodeList::length): Added.
2590         (KJS::VectorNodeList::item): Added.
2591         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
2592         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
2593
2594         * dom/ChildNodeList.h:
2595         * dom/ChildNodeList.cpp:
2596         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
2597         since NodeList is now a simpler class.
2598         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
2599
2600         * dom/NameNodeList.h:
2601         * dom/NameNodeList.cpp:
2602         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
2603         since NodeList is now a simpler class.
2604         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
2605         parameter change.
2606
2607         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
2608         * dom/Node.cpp:
2609         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
2610         since NodeList is now a simpler abstract class.
2611         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
2612         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
2613         (WebCore::Node::unregisterNodeList): Ditto.
2614
2615         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
2616         with the machinery for iterating a tree, called TreeNodeList.
2617         * dom/NodeList.cpp:
2618         (WebCore::NodeList::~NodeList): Added.
2619         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
2620         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
2621         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
2622         (WebCore::TreeNodeList::recursiveLength): Ditto.
2623         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
2624         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
2625         (WebCore::TreeNodeList::recursiveItem): Ditto.
2626         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
2627         the other half in NodeList::itemWithName.
2628         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
2629         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
2630
2631         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
2632         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
2633         thought I had already done.
2634         * html/HTMLFormElement.cpp:
2635         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
2636         Switched the rest of the members to initialization syntax.
2637         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
2638         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
2639         to one element under each of its old names.
2640         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
2641         that once had a given name.
2642
2643         * html/HTMLGenericFormElement.h:
2644         * html/HTMLGenericFormElement.cpp:
2645         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
2646         attribute changes, tell the form about the old name.
2647         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
2648         about an element, also store away the old name so that we can use it
2649         when the name changes later.
2650
2651         * html/HTMLInputElement.cpp:
2652         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
2653         base class in the nameAttr case, so the code in HTMLGenericFormElement
2654         above will get called in the input element case.
2655
2656 2007-03-13  Antti Koivisto  <antti@apple.com>
2657
2658         Reviewed by Alexey.
2659
2660         Alexey spotted a DOS by using string of 64k unbreakable character in
2661         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
2662
2663         * dom/Text.cpp:
2664         (WebCore::Text::createWithLengthLimit):
2665
2666 2007-03-13  Lars Knoll <lars@trolltech.com>
2667
2668         Fix the Qt build
2669
2670         * WebCore.pro:
2671
2672 2007-03-13  Rob Buis  <buis@kde.org>
2673
2674         Reviewed by Darin.
2675
2676         http://bugs.webkit.org/show_bug.cgi?id=12576
2677         WebKit does not support xlink:show attributes
2678
2679         Make an exception for non-empty targets, these should be opened
2680         in a new window, unless the value is _self.
2681
2682         * ksvg2/svg/SVGAElement.cpp:
2683         (WebCore::SVGAElement::defaultEventHandler):
2684
2685 2007-03-13  David Hyatt  <hyatt@apple.com>
2686
2687         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
2688           6 objects and ~200MB leaked after opening then closing tab
2689           <rdar://problem/5058714>
2690
2691         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
2692         a separate copy of image data.  See <rdar://problem/5050645>.
2693
2694         Reviewed by aroben.
2695
2696         * loader/CachedImage.cpp:
2697         (WebCore::CachedImage::data):
2698
2699 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2700
2701         Not reviewed - gdk build fix.
2702
2703         * platform/gdk/TemporaryLinkStubs.cpp:
2704         (SearchPopupMenu::enabled): add missing stub.
2705
2706 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
2707
2708         Reviewed by Darin.
2709
2710         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
2711           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
2712
2713         * html/HTMLFormElement.cpp:
2714         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
2715         the boundary prefix that appear after non-dash characters.
2716
2717 2007-03-12  Mitz Pettel  <mitz@webkit.org>
2718
2719         Reviewed by Anders.
2720
2721         - fix http://bugs.webkit.org/show_bug.cgi?id=13015
2722           REGRESSION (r17233-r17241): Repro crash when leaving a page whose unload handler submits a form
2723
2724         Test: fast/loader/onunload-form-submit-crash-2.html
2725
2726         * loader/DocumentLoader.cpp:
2727         (WebCore::DocumentLoader::finishedLoading): Added null check.
2728
2729 2007-03-12  Anders Carlsson  <acarlsson@apple.com>
2730
2731         Reviewed by Darin.
2732
2733         <rdar://problem/4900071>
2734         http://bugs.webkit.org/show_bug.cgi?id=6454
2735         ASSERTION: Navigating 'back' in frameset: !_private->previousItem (6454)
2736
2737         Change back the behavior of checkLoadComplete to traverse the entire frame tree instead of
2738         just the parent frames of the current frame. This is needed in order to reset the previous history item
2739         for all frames when doing a frame navigation. (This was changed in revision 11819)
2740         
2741         * loader/FrameLoader.cpp:
2742         (WebCore::FrameLoader::recursiveCheckLoadComplete):
2743         (WebCore::FrameLoader::checkLoadComplete):
2744         * loader/FrameLoader.h:
2745
2746 2007-03-12  Justin Garcia  <justin.garcia@apple.com>
2747
2748         Reviewed by darin
2749         
2750         <rdar://problem/5056619> 
2751         REGRESSION: Gmail Editor: Dragging text into Reply (textarea) field results in a crash at WebCore::InsertNodeBeforeCommand::doApply()
2752         
2753         * editing/SelectionController.cpp:
2754         (WebCore::removingNodeRemovesPosition): Added.
2755         (WebCore::SelectionController::nodeWillBeRemoved): Clear the
2756         selection if it's inside a shadow tree.
2757         * page/DragController.cpp:
2758         (WebCore::setSelectionToDragCaret): Return false to signal to
2759         clients that a drop shouldn't be performed if the second attempt
2760         to set a selection ends up in non-editable content.
2761
2762 2007-03-12  Darin Adler  <darin@apple.com>
2763
2764         Reviewed by Tim Hatcher.
2765
2766         - fixed JavaScript wrapper classes to be correct for a variety of cases
2767           that a new test uncovered: was broken for at least 5 classes
2768
2769         - fixed Objective-C wrapper classes to be correct for a variety of cases
2770           that a test case uncovered: was broken for ast least 50 classes
2771
2772         - added missing DOM API for creating OverflowEvent and WheelEvent instances
2773
2774         Test: fast/dom/wrapper-classes.html
2775
2776         * DerivedSources.make: Added missing bindings: HTMLCanvasElement for ObjC,
2777         CDATASection, Comment, and EntityReference for JavaScript.
2778         * WebCore.xcodeproj/project.pbxproj: Added those new generated files.
2779
2780         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2781         (WebCore::createJSHTMLWrapper): Corrected the wrapper classes for <keygen>,
2782         which needs an HTMLSelectElement wrapper, and <xmp>, which needs an
2783         HTMLPreElement wrapper.
2784
2785         * bindings/objc/DOMInternal.h: Updated for new naming scheme.
2786         Also moved createDOMWrapper from the KJS namespace to the WebCore namespace.
2787         * bindings/objc/DOMUtility.mm:
2788         (KJS::createDOMWrapper): Broke the core function into a separate one, and
2789         left it in the KJS namespace because Objective-C++ rules make it impossible
2790         for it to work in the WebCore namespace. Used a macro-based implementation
2791         to cut down on repeated code, and added missing cases for Counter,
2792         HTMLOptionsCollection, Range, XPathExpression, XPathResult, Event, RGBColor,
2793         Rect, Window, DOMImplementation, NodeIterator, TreeWalker, and HTMLCollection.
2794         (WebCore::createDOMWrapper): The other half of the function.
2795
2796         * bindings/objc/DOM.mm:
2797         (WebCore::createElementClassMap): Corrected the wrapper classes for
2798         <canvas>, which needs a DOMHTMLCanvasElement wrapper, <del>, which needs
2799         a DOMHTMLModElement wrapper, <embed>, which needs a DOMHTMLEmbedElement
2800         wrapper, <ins>, which needs a DOMHTMLModElement wrapper, <th>, which needs
2801         a DOMHTMLTableCellElement wrapper, and <xmp>, which needs an
2802         DOMHTMLPreElement wrapper.
2803         (+[DOMNode _wrapNode:]): Updated for new naming scheme.
2804         (+[DOMNode _wrapEventTarget:]): Ditto.
2805         (+[DOMNodeFilter _wrapNodeFilter:]): Ditto.
2806         (ObjCNodeFilterCondition::acceptNode): Ditto.
2807         (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Ditto.
2808         (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto.
2809         (WebCore::ObjCEventListener::handleEvent): Ditto.
2810
2811         * dom/Document.cpp: (WebCore::Document::createEvent):
2812         Added cases for OverflowEvent and WheelEvent.
2813
2814         * dom/OverflowEvent.h: Added empty constructor and initOverflowEvent.
2815         * dom/OverflowEvent.cpp:
2816         (WebCore::OverflowEvent::OverflowEvent): Added.
2817         (WebCore::OverflowEvent::initOverflowEvent): Added.
2818         * dom/OverflowEvent.idl: Added initOverflowEvent.
2819
2820         * bindings/objc/PublicDOMInterfaces.h: Added initOverflowEvent.
2821
2822         * bindings/objc/DOMCSS.mm:
2823         (+[DOMStyleSheet _wrapStyleSheet:]): Updated for new naming scheme.
2824         (+[DOMCSSRule _wrapCSSRule:]): Corrected wrapper for CSSUnknownRule.
2825         (+[DOMCSSValue _wrapCSSValue:]): Updated for new naming scheme.
2826
2827         * bindings/js/kjs_css.h:
2828         (KJS::DOMRGBColor::impl): Added. Used when making an ObjC wrapper.
2829         (KJS::DOMRect::impl): Ditto.
2830
2831         * bindings/js/kjs_dom.cpp: (KJS::toJS): Corrected the wrapper classes for
2832         CDATASection, Comment, and EntityReference.
2833
2834         * bindings/js/kjs_html.cpp: Corrected the class name for HTMLElement
2835         (was "DOMHTMLElement") and HTMLCollection (was "Collection").
2836
2837         * bindings/objc/DOMImplementationFront.h:
2838         * bindings/objc/DOMImplementationFront.cpp:
2839         (WebCore::implementationFront): Added new overload that returns a front given
2840         a JavaScript wrapper. Needed by the code that makes the Objective-C wrapper.
2841
2842         * bindings/objc/WebScriptObject.mm:
2843         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
2844         Updated since createDOMWrapper is now in the WebCore namespace.
2845
2846         * bindings/scripts/CodeGeneratorObjC.pm: Update the naming scheme for the
2847         wrapper creation functions to use _wrapElement: rather then _elementWith:
2848         style. Removed now-unneeded special cases for things that needed to stay
2849         upper-case, since we don't have to do the whole lcfirst thing.
2850
2851         * html/HTMLCanvasElement.idl: Added #if so we can successfully generate the
2852         Objective-C wrapper for this class, even though we can't yet handle the
2853         DOMObject return type.
2854
2855         * html/HTMLOptionsCollection.idl: Added GenerateNativeConverter so we get
2856         an appropriate toJS function.
2857
2858         * bindings/objc/DOMEvents.mm:
2859         (+[DOMEvent _wrapEvent:]):
2860         * bindings/objc/DOMHTML.mm:
2861         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
2862         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
2863         * bindings/objc/DOMObject.mm:
2864         (-[DOMObject sheet]):
2865         * bindings/objc/DOMRGBColor.mm:
2866         (-[DOMRGBColor red]):
2867         (-[DOMRGBColor green]):
2868         (-[DOMRGBColor blue]):
2869         (-[DOMRGBColor alpha]):
2870         (+[DOMRGBColor _wrapRGBColor:]):
2871         * bindings/objc/DOMSVGPathSegInternal.mm:
2872         (+[DOMSVGPathSeg _wrapSVGPathSeg:]):
2873         * bindings/objc/DOMXPath.mm:
2874         (+[DOMNativeXPathNSResolver _wrapXPathNSResolver:]):
2875         * page/mac/WebCoreFrameBridge.mm:
2876         (-[WebCoreFrameBridge nodesFromList:]):
2877         (-[WebCoreFrameBridge elementWithName:inForm:]):
2878         (-[WebCoreFrameBridge formForElement:]):
2879         (-[WebCoreFrameBridge currentForm]):
2880         (-[WebCoreFrameBridge controlsInForm:]):
2881         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
2882         (-[WebCoreFrameBridge convertNSRangeToDOMRange:]):
2883         (-[WebCoreFrameBridge markDOMRange]):
2884         (-[WebCoreFrameBridge markedTextDOMRange]):
2885         (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
2886         (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
2887         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]):
2888         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
2889         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
2890         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
2891         (-[WebCoreFrameBridge increaseSelectionListLevel]):
2892         (-[WebCoreFrameBridge increaseSelectionListLevelOrdered]):
2893         (-[WebCoreFrameBridge increaseSelectionListLevelUnordered]):
2894         (-[WebCoreFrameBridge dragCaretDOMRange]):
2895         (-[WebCoreFrameBridge editableDOMRangeForPoint:]):
2896         (-[WebCoreFrameBridge characterRangeAtPoint:]):
2897         (-[WebCoreFrameBridge typingStyle]):
2898         (-[WebCoreFrameBridge rangeOfCharactersAroundCaret]):
2899         * platform/mac/ClipboardMac.mm:
2900         (WebCore::ClipboardMac::declareAndWriteDragImage):
2901         * platform/mac/PasteboardMac.mm:
2902         (WebCore::Pasteboard::writeSelection):
2903         Updated for new naming scheme.
2904
2905 2007-03-12  Timothy Hatcher  <timothy@apple.com>
2906
2907         Reviewed by Darin.
2908
2909         <rdar://problem/4990691> REGRESSION: Selecting text in Adium's Messages field causes horizontal shift
2910
2911         Corrected the recursive point conversion and scrolling done in scrollPointRecursively to use the
2912         document view of each NSClipView.
2913
2914         * platform/mac/ScrollViewMac.mm:
2915         (WebCore::ScrollView::scrollPointRecursively): Call convertPoint:fromView: on the document views,
2916         not the clip views as we encounter them. Then call constrainScrollPoint: on the converted point to
2917         constrain to the document view bounds. And finally call scrollPoint: on the document view, not the clip view.
2918
2919 2007-03-12  Antti Koivisto  <antti@apple.com>
2920
2921         Reviewed by Alexey.
2922
2923         Fix http://bugs.webkit.org/show_bug.cgi?id=12833
2924         REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
2925         <rdar://problem/5028159>
2926         
2927         Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
2928         a manageable subset.
2929         
2930         * dom/Text.cpp:
2931         (WebCore::Text::createWithLengthLimit):
2932         * dom/Text.h:
2933         * html/HTMLParser.cpp:
2934         (WebCore::HTMLParser::parseToken):
2935         * loader/TextDocument.cpp:
2936         (WebCore::TextTokenizer::write):
2937
2938 2007-03-12  David Hyatt  <hyatt@apple.com>
2939
2940         Fix a regression in printing.  Printer fonts need to be part of the
2941         font cache key, since printer fonts have different glyph widths.
2942         (Integer antialiasing is used for screen fonts but not for printer fonts.)
2943
2944         Reviewed by aroben
2945
2946         * platform/FontCache.cpp:
2947         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
2948         (WebCore::FontPlatformDataCacheKey::operator==):
2949         (WebCore::computeHash):
2950         (WebCore::FontCache::getCachedFontPlatformData):
2951
2952 2007-03-12  Lars Knoll <lars@trolltech.com>
2953
2954         add missing symbol to fix the Qt build again.
2955
2956         * platform/qt/SearchPopupMenuQt.cpp:
2957         (WebCore::SearchPopupMenu::enabled):
2958
2959 2007-03-12  Adele Peterson  <adele@apple.com>
2960
2961         Reviewed by Oliver.
2962
2963         Adding the ability to enable or disable a SearchPopupMenu.
2964
2965         * platform/SearchPopupMenu.h:
2966         * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
2967         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
2968
2969 2007-03-12  Rob Buis  <buis@kde.org>
2970
2971         Reviewed by Nikolas Zimmermann.
2972
2973         http://bugs.webkit.org/show_bug.cgi?id=12500
2974         SVG fails to correctly handle all link style selectors
2975         http://bugs.webkit.org/show_bug.cgi?id=12567
2976         <text> elements ignore <a> children
2977
2978         Allow <a> inside svg text and handle xlink:show.
2979
2980         * ksvg2/svg/SVGAElement.cpp:
2981         (WebCore::SVGAElement::createRenderer):
2982         (WebCore::SVGAElement::defaultEventHandler):
2983         (WebCore::SVGAElement::childShouldCreateRenderer):
2984         * ksvg2/svg/SVGAElement.h:
2985         * ksvg2/svg/SVGElement.h:
2986         (WebCore::SVGElement::isTextContent):
2987         * ksvg2/svg/SVGTextContentElement.h:
2988         (WebCore::SVGTextContentElement::isTextContent):
2989         * ksvg2/svg/SVGTextElement.cpp:
2990         (WebCore::SVGTextElement::childShouldCreateRenderer):
2991         * rendering/SVGInlineFlowBox.cpp:
2992         (WebCore::translateBox):
2993         (WebCore::placePositionedBoxesHorizontally):
2994         (WebCore::placeBoxesVerticallyWithAbsBaseline):
2995
2996 2007-03-12  Adele Peterson  <adele@apple.com>
2997
2998         Reviewed by Oliver.
2999
3000         Add a missing parameter to the constructor.
3001
3002         * platform/PlatformKeyboardEvent.h:
3003         * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3004
3005 2007-03-12  Lars Knoll <lars@trolltech.com>
3006
3007         Fix the Qt build. I still get crashes though :/
3008
3009         * platform/graphics/qt/ImageDecoderQt.cpp:
3010         (WebCore::ImageDecoderQt::clearFrame):
3011         * platform/graphics/qt/ImageDecoderQt.h:
3012         * platform/graphics/qt/ImageSourceQt.cpp:
3013         (WebCore::ImageSource::setData):
3014         (WebCore::ImageSource::frameIsCompleteAtIndex):
3015         (WebCore::ImageSource::clear):
3016         (WebCore::ImageSource::destroyFrameAtIndex):
3017         * platform/qt/ClipboardQt.cpp:
3018         (WebCore::ClipboardQt::ClipboardQt):
3019         * platform/qt/ClipboardQt.h:
3020         * platform/qt/DragDataQt.cpp:
3021         (WebCore::DragData::createClipboard):
3022
3023 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3024
3025         Not reviewed - gdk build fixes.
3026
3027         * platform/gdk/EditorClientGdk.cpp:
3028         (WebCore::EditorClientGdk::respondToChangedSelection): add stub
3029         * platform/gdk/EditorClientGdk.h:
3030         * platform/gdk/FrameGdk.cpp:
3031         * platform/gdk/TemporaryLinkStubs.cpp:
3032         (Editor::markMisspellings): add stub
3033
3034 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3035
3036         Reviewed by Adele.
3037
3038         http://bugs.webkit.org/show_bug.cgi?id=12560
3039         W3C XPath test Text_Nodes.svg fails
3040
3041         * xml/XPathStep.cpp:
3042         (WebCore::XPath::Step::nodeTestMatches): Revert the fix, as the behavior doesn't appear 
3043         all that desirable as it did at first glance.
3044
3045 2007-03-11  Oliver Hunt  <oliver@apple.com>
3046
3047         Reviewed by hyatt.
3048
3049         Fix for <rdar://problem/5055690> ASSERTION failure on drop into 
3050         editable element with content changed on drop 
3051
3052         After setting the selection for a drop into an editable region 
3053         we make sure the we succeeded.  If we didn't we assume a focus handler
3054         or similar altered the element contents and try again, if the second
3055         attempt fails we bail out.
3056
3057         * page/DragController.cpp:
3058         (WebCore::setSelectionToDragCaret):
3059         (WebCore::DragController::concludeDrag):
3060
3061 2007-03-11  Oliver Hunt  <oliver@apple.com>
3062
3063         Reviewed by Adele.
3064
3065         Moving Frame{Mac}::respondToChangedSelection to Frame.cpp
3066         Added new EditorClient method to handle old bridge function
3067         
3068         * bridge/EditorClient.h:
3069            Added respondToChangedSelection to replace old bridge function
3070         * editing/Editor.cpp:
3071         (WebCore::Editor::respondToChangedSelection):
3072            Add client call to replace old bridge call from Frame::respondToChangedSelection
3073         * editing/SelectionController.cpp:
3074         (WebCore::SelectionController::setSelection):
3075            No longer directly call Editor as Frame::respondToChangedSelection
3076            makes the call
3077         * page/Frame.cpp:
3078         (WebCore::Frame::respondToChangedSelection):
3079            Moved from FrameMac, replaced bridge call with call to Editor
3080         * page/mac/FrameMac.mm:
3081            Moved respondToChangedSelection to Frame.cpp
3082         * page/mac/WebCoreFrameBridge.h:
3083            Removed respondToChangedSelection from bridge
3084         * page/qt/FrameQt.cpp:
3085            Remove stub method for respondToChangedSelection
3086
3087 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3088
3089         Reviewed by Brady Eidson.
3090
3091         Linux/gdk fix.
3092
3093         * loader/gdk/FrameLoaderClientGdk.cpp:
3094         (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
3095         that FrameLoader:goBackOrForwards() works.
3096
3097 2007-03-10  Geoffrey Garen  <ggaren@apple.com>
3098
3099         Reviewed by Darin Adler.
3100
3101         Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and 
3102         JSCore causes a hang @ www.panoramas.dk
3103         
3104         See JavaScriptCore ChangeLog for details.
3105         
3106         * bindings/objc/WebScriptObject.mm:
3107         (_didExecute): Added helpful ASSERT.
3108         (+[WebScriptObject throwException:]): Added missing JSLock.
3109
3110 2007-03-11  Antti Koivisto  <antti@apple.com>
3111
3112         Reviewed by Hyatt.
3113
3114         Optimize linebox memory consumption:
3115         - move all bitfields to baseclass compacting them
3116         - make InlineTextBox::m_truncation unsigned short and make it relative to m_start
3117         - remove extremely rarely used EllipsisBox pointer from RootInlineBox and instead
3118           use a global hashmap to store it if needed
3119         - use minimum required number of bits to store BidiStatus enum variables in RootInlineBox
3120         - move overflow variables in RootInlineBox to a separate struct that is instantiated
3121           only if any of the variables is set to a value that can't trivially be derived from 
3122           box x, y, width and height
3123           
3124         As a result line box objects shrink:
3125             InlineBox: 44 -> 44 bytes
3126             InlineTextBox: 68 -> 60 bytes
3127             InlineFlowBox: 68 -> 64 bytes
3128             RootInlineBox: 128 -> 88 bytes
3129             
3130         The optimizations possiblity was noticed when debugging http://bugs.webkit.org/show_bug.cgi?id=12833
3131         Bug 12833: REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
3132         <rdar://problem/5028159>
3133         
3134         On that page the patch saves 11.5MB or some 21% of linebox memory consumption. It also
3135         actually improves selection performance somewhat by improving memory locality.
3136
3137         * rendering/InlineBox.h:
3138         (WebCore::InlineBox::InlineBox):
3139         * rendering/InlineFlowBox.h:
3140         (WebCore::InlineFlowBox::InlineFlowBox):
3141         * rendering/InlineTextBox.cpp:
3142         (WebCore::InlineTextBox::placeEllipsisBox):
3143         (WebCore::InlineTextBox::nodeAtPoint):
3144         (WebCore::InlineTextBox::paint):
3145         (WebCore::InlineTextBox::paintDecoration):
3146         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
3147         (WebCore::InlineTextBox::paintMarkedTextUnderline):
3148         * rendering/InlineTextBox.h:
3149         (WebCore::InlineTextBox::InlineTextBox):
3150         * rendering/RootInlineBox.cpp:
3151         (WebCore::throw):
3152         (WebCore::RootInlineBox::Overflow::operator delete):
3153         (WebCore::RootInlineBox::Overflow::destroy):
3154         (WebCore::RootInlineBox::destroy):
3155         (WebCore::RootInlineBox::detachEllipsisBox):
3156         (WebCore::RootInlineBox::clearTruncation):
3157         (WebCore::RootInlineBox::placeEllipsis):
3158         (WebCore::RootInlineBox::paintEllipsisBox):
3159         (WebCore::RootInlineBox::addHighlightOverflow):
3160         (WebCore::RootInlineBox::nodeAtPoint):
3161         (WebCore::RootInlineBox::adjustPosition):
3162         (WebCore::RootInlineBox::selectionTop):
3163         (WebCore::RootInlineBox::setLineBreakInfo):
3164         (WebCore::RootInlineBox::ellipsisBox):
3165         (WebCore::RootInlineBox::setVerticalOverflowPositions):
3166         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
3167         (WebCore::RootInlineBox::setVerticalSelectionPositions):
3168         * rendering/RootInlineBox.h:
3169         (WebCore::RootInlineBox::RootInlineBox):
3170         (WebCore::RootInlineBox::topOverflow):
3171         (WebCore::RootInlineBox::bottomOverflow):
3172         (WebCore::RootInlineBox::leftOverflow):
3173         (WebCore::RootInlineBox::rightOverflow):
3174         (WebCore::RootInlineBox::lineBreakBidiStatus):
3175         (WebCore::RootInlineBox::selectionBottom):
3176         (WebCore::RootInlineBox::Overflow::Overflow):
3177
3178 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3179
3180         Reviewed by Darin.
3181
3182         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
3183         XPath can be very slow
3184
3185         * xml/XPathExpression.cpp:
3186         (WebCore::XPathExpression::evaluate): Cache evaluationContext in a local variable.
3187
3188         * xml/XPathExpressionNode.cpp:
3189         (WebCore::XPath::Expression::evaluationContext):
3190         * xml/XPathExpressionNode.h:
3191         (WebCore::XPath::Expression::addSubExpression):
3192         (WebCore::XPath::Expression::subExprCount):
3193         (WebCore::XPath::Expression::subExpr):
3194         * xml/XPathFunctions.cpp:
3195         * xml/XPathFunctions.h:
3196         (WebCore::XPath::Function::setName):
3197         (WebCore::XPath::Function::arg):
3198         (WebCore::XPath::Function::argCount):
3199         (WebCore::XPath::Function::name):
3200         Made one-liners critical for performance inline.
3201
3202         * xml/XPathGrammar.y: Fully parse NodeTests, so that strings are no longer passed for what is
3203         essentially an enum. Use LocationPath accessors to add steps, instead of directly manipulating
3204         internal data members.
3205
3206         * xml/XPathParser.cpp:
3207         (WebCore::XPath::Parser::parseStatement):
3208         (WebCore::XPath::Parser::registerNodeTest):
3209         (WebCore::XPath::Parser::deleteNodeTest):
3210         * xml/XPathParser.h:
3211         Added support methods for changes in XPathGrammar.y.
3212
3213         * xml/XPathPath.cpp:
3214         (WebCore::XPath::Filter::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
3215         performing vector assignments.
3216         (WebCore::XPath::LocationPath::evaluate): Use swap() to avoid performing vector assignments.
3217         (WebCore::XPath::LocationPath::optimizeStepPair): This new method is called during LocationPath construction, 
3218         to simplify the path as it's being built. Currently, the only optimized case is "//*" - it is a basis for
3219         important operations that cannot be efficiently written in XPath 1.0, but can be optimized with a little bit
3220         of XPath 2.0.
3221         (WebCore::XPath::LocationPath::appendStep): A new accessor that modifies m_steps and calls optimizeStepPair().
3222         (WebCore::XPath::LocationPath::insertFirstStep): Ditto.
3223         * xml/XPathPath.h:
3224         (WebCore::XPath::LocationPath::setAbsolute): A new accessor.
3225
3226         * xml/XPathStep.h:
3227         (WebCore::XPath::Step::NodeTest::):
3228         (WebCore::XPath::Step::NodeTest::NodeTest):
3229         (WebCore::XPath::Step::NodeTest::kind):
3230         (WebCore::XPath::Step::NodeTest::data):
3231         Step::NodeTest is a new sub-class that represents a fully parsed NodeTest.
3232         (WebCore::XPath::Step::axis):
3233         (WebCore::XPath::Step::nodeTest):
3234         (WebCore::XPath::Step::nodeTestData):
3235         (WebCore::XPath::Step::namespaceURI):
3236         (WebCore::XPath::Step::predicates):
3237         (WebCore::XPath::Step::setAxis):
3238         (WebCore::XPath::Step::setNodeTest):
3239         (WebCore::XPath::Step::setNodeTestData):
3240         (WebCore::XPath::Step::setNamespaceURI):
3241         (WebCore::XPath::Step::setPredicates):
3242         New accessors that let optimizeStepPair() manipulate Step data.
3243
3244         * xml/XPathStep.cpp:
3245         (WebCore::XPath::Step::Step): Use the new NodeTest class.
3246         (WebCore::XPath::Step::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
3247         performing unneeded vector assignments.
3248         (WebCore::XPath::Step::nodesInAxis): Cosmetic changes.
3249         (WebCore::XPath::Step::nodeTestMatches): Use NodeTest instead of parsing the test from string each time.
3250         Added a partial implementation of XPath 2.0 element() node test.
3251
3252 2007-03-10  Alexey Proskuryakov  <ap@webkit.org>
3253
3254         Reviewed by Darin.
3255
3256         http://bugs.webkit.org/show_bug.cgi?id=12249
3257         FCKeditor: <hr>, <ul> and <ol> have id="undefined"
3258
3259         This fixes the attached reduction, but not the original issue.
3260
3261         Test: editing/execCommand/default-parameters.html
3262
3263         * dom/Document.h:
3264         * dom/Document.idl:
3265         Make second and third execCommand() parameters optional.
3266
3267 2007-03-10  Adele Peterson  <adele@apple.com>
3268
3269         Reviewed by Maciej.
3270
3271         Fix for http://bugs.webkit.org/show_bug.cgi?id=13028
3272         REGRESSION: textField:doCommandBySelector:inFrame: not being called properly
3273
3274         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
3275           Before calling the base class defaultEventHandler, which will call handleKeypress, call doTextFieldCommandFromEvent.        
3276
3277 2007-03-10  Mitz Pettel  <mitz@webkit.org>
3278
3279         Reviewed by Darin.
3280
3281         - fix http://bugs.webkit.org/show_bug.cgi?id=13013
3282           REGRESSION: Selection box does not scroll to where the focus jumps when pressing an alphanumeric key
3283
3284         Test: fast/forms/listbox-typeahead-scroll.html
3285
3286         * html/HTMLSelectElement.cpp:
3287         (WebCore::HTMLSelectElement::setSelectedIndex): Reordered to set the active selection's
3288         anchor and end before selecting the option, since the active selection is used to
3289         decide where to scroll when the selection is made.
3290         (WebCore::HTMLSelectElement::defaultEventHandler): Removed redundant check.
3291
3292 2007-03-10  Mitz Pettel  <mitz@webkit.org>
3293
3294         Reviewed by Darin.
3295
3296         - fix http://bugs.webkit.org/show_bug.cgi?id=12973
3297           REGRESSION: Reproducible assert while loading this test file if css is already in the cache
3298
3299         Test: fast/dom/css-cached-import-rule.html
3300
3301         Replaced some direct calls to document->stylesheetLoaded() with calls to
3302         the sheet's checkLoaded(). The latter calls back to the element's sheetLoaded() --
3303         which notifies the document of the load -- and then updates the sheet's
3304         loadCompleted() flag, ensuring that it stays in sync with whether the stylesheet
3305         is still considered pending by the document.
3306
3307         * dom/ProcessingInstruction.cpp:
3308         (WebCore::ProcessingInstruction::parseStyleSheet):
3309         * dom/StyleElement.cpp:
3310         (WebCore::StyleElement::childrenChanged):
3311         * html/HTMLLinkElement.cpp:
3312         (WebCore::HTMLLinkElement::process):
3313         (WebCore::HTMLLinkElement::setCSSStyleSheet):
3314         * ksvg2/svg/SVGStyleElement.cpp:
3315         (WebCore::SVGStyleElement::sheetLoaded):
3316         * ksvg2/svg/SVGStyleElement.h:
3317
3318 2007-03-10  David Kilzer  <ddkilzer@webkit.org>
3319
3320         Reviewed by Darin.
3321
3322         - fix http://bugs.webkit.org/show_bug.cgi?id=9609
3323           REGRESSION: Missing image icon needs to be moved back to WebKit
3324
3325         * WebCore.exp: Export WebCore::Image::loadPlatformResource(const char*) for use in
3326         [WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:].
3327
3328 2007-03-09  Darin Adler  <darin@apple.com>
3329
3330         Reviewed by Justin.
3331
3332         - fix http://bugs.webkit.org/show_bug.cgi?id=8928
3333           <rdar://problem/5045708> REPRODUCIBLE ASSERT: Cannot paste HTML into a
3334           contenteditable region in an XHTML document (8928)
3335
3336         Test: editing/pasteboard/paste-xml.xhtml
3337
3338         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Added a check for 0
3339         here, since createContextualFragment can return 0 for XML documents that fail
3340         to parse. In my testing, callers all seem equipped to handle 0.
3341
3342 2007-03-09  Mitz Pettel  <mitz@webkit.org>
3343
3344         Reviewed by Darin.
3345
3346         - fix http://bugs.webkit.org/show_bug.cgi?id=9929
3347           REGRESSION: crash on logging in on mijnpostbank.nl
3348
3349         Test: http/tests/misc/onload-remove-iframe-crash-2.html
3350
3351         The resulted from an iframe's load event handler removing the iframe
3352         from the document.
3353
3354         * dom/Document.cpp:
3355         (WebCore::Document::implicitClose): Bail out early if an event handler
3356         removed the frame.
3357         * loader/FrameLoader.cpp:
3358         (WebCore::FrameLoader::FrameLoader):
3359         (WebCore::FrameLoader::clear):
3360         (WebCore::FrameLoader::checkCompleted): Protect the frame from deletion
3361         by event handlers.
3362         (WebCore::FrameLoader::checkCompletedTimerFired):
3363         (WebCore::FrameLoader::scheduleCheckCompleted):
3364         (WebCore::FrameLoader::detachFromParent): Schedule a completion check
3365         on the parent (in case the child is what has been keeping it from completing).
3366         * loader/FrameLoader.h:
3367
3368 2007-03-08  David Kilzer  <ddkilzer@webkit.org>
3369
3370         Reviewed by Beth.
3371
3372         - fix http://bugs.webkit.org/show_bug.cgi?id=13019
3373           REGRESSION (r20074): Forms don't submit on a variety of websites
3374
3375         No tests added since LayoutTests/fast/forms/document-write.html was timing out
3376         and causing a layout test failure.
3377
3378         * html/HTMLFormElement.cpp:
3379         (WebCore::HTMLFormElement::submit): Removed stray code.
3380
3381 2007-03-08  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3382
3383         Not reviewed - gdk build fix.
3384
3385         * platform/graphics/cairo/ImageSourceCairo.cpp:
3386         (WebCore::ImageSource::frameIsCompleteAtIndex): add empty stub
3387
3388 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3389
3390         Reviewed by harrison
3391         
3392         <rdar://problem/4903193> 
3393         On particular page, Copy is so slow it seems like a hang
3394         
3395         ~2x speedup copying:
3396         http://shakespeare.mit.edu/henryviii/full.html 
3397         Also produces less bloated markup.
3398
3399         * editing/markup.cpp:
3400         (WebCore::startMarkup): Don't wrap text nodes in style spans.
3401         For Elements, don't inline styles inherited from ancestors.
3402         (WebCore::createMarkup): No longer necessary to find 
3403         the root's default style and pass it to startMarkup.
3404         Add a wrapper span around the markup with the styles
3405         that all nodes in the markup inherit (the inheritable 
3406         styles from the common ancestor container's computed style).
3407         Added a FIXME about unecessary markup for inline ancestors 
3408         up to the commonAncestorBlock.
3409
3410 2007-03-08  Darin Adler  <darin@apple.com>
3411
3412         Reviewed by Adele.
3413
3414         - <rdar://problem/4470381> multipart/form-data boundary security vulnerability
3415
3416         By making the form data boundary a string with some random data in it, we reduce
3417         the possibility that anyone could take advantage of it by creating a file that
3418         intentionally has the boundary string in it.
3419
3420         * html/HTMLFormElement.h: Removed boundary(), setBoundary(), and m_boundary.
3421         Marked a lot more stuff private.
3422         * html/HTMLFormElement.cpp:
3423         (WebCore::HTMLFormElement::HTMLFormElement): Removed code to initialize
3424         m_boundary.
3425         (WebCore::randomNumber): Added. Function that returns a random number, including
3426         seeding the random number generator the first time it's called. For now, usees the more
3427         random function random() on Mac OS X and the more-standard rand() on other platforms.
3428         (WebCore::HTMLFormElement::formData): Take a parameter with the form boundary string,
3429         and use that instead of m_boundary.
3430         (WebCore::getUniqueBoundaryString): Added. Makes a boundary string using random numbers
3431         and base 64 encoding.
3432         (WebCore::HTMLFormElement::submit): Call getUniqueBoundaryString and pass the boundary
3433         string into formData for multipart form posts.
3434
3435 2007-03-08  Maciej Stachowiak  <mjs@apple.com>
3436
3437         Reviewed by Adele.
3438         
3439         <rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588)
3440         http://bugs.webkit.org/show_bug.cgi?id=12588
3441
3442         Carefully revised which focus operations restore previous selection, which clear it, and which
3443         select the whole control contents.
3444         
3445         Tests:
3446         fast/forms/focus-selection-input.html
3447         fast/forms/focus-selection-textarea.html
3448         
3449         * dom/Element.cpp:
3450         (WebCore::Element::focus):
3451         * dom/Element.h:
3452         * html/HTMLInputElement.cpp:
3453         (WebCore::HTMLInputElement::focus):
3454         (WebCore::HTMLInputElement::accessKeyAction):
3455         * html/HTMLInputElement.h:
3456         * html/HTMLLabelElement.cpp:
3457         (WebCore::HTMLLabelElement::focus):
3458         (WebCore::HTMLLabelElement::accessKeyAction):
3459         * html/HTMLLabelElement.h:
3460         * html/HTMLLegendElement.cpp:
3461         (WebCore::HTMLLegendElement::focus):
3462         * html/HTMLLegendElement.h:
3463         * html/HTMLTextAreaElement.cpp:
3464         (WebCore::HTMLTextAreaElement::focus):
3465         * html/HTMLTextAreaElement.h:
3466         * page/FocusController.cpp:
3467         (WebCore::FocusController::advanceFocus):
3468
3469 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3470
3471         Reviewed by harrison
3472
3473         <http://bugs.webkit.org/show_bug.cgi?id=12244>
3474         FCKeditor: Find dialog doesn't work
3475
3476         * bindings/js/kjs_window.cpp:
3477         (KJS::Window::find): Added.  This function doesn't yet 
3478         support whole word searches, searching in subframes, or
3479         opening the find dialog.
3480         (KJS::WindowFunc::callAsFunction):
3481         * bindings/js/kjs_window.h:
3482         (KJS::Window::):
3483
3484 2007-03-08  David Hyatt  <hyatt@apple.com>
3485
3486         Fix regression from throwing away frames of large animated images.  Alter
3487         animated images so that they refuse to advance the animation until the
3488         current displayed frame has been fully decoded.
3489
3490         Reviewed by ggaren
3491
3492         * platform/graphics/BitmapImage.cpp:
3493         (WebCore::BitmapImage::startAnimation):
3494         (WebCore::BitmapImage::advanceAnimation):
3495         * platform/graphics/ImageSource.h:
3496         * platform/graphics/cg/ImageSourceCG.cpp:
3497         (WebCore::ImageSource::frameIsCompleteAtIndex):
3498
3499 2007-03-08  David Hyatt  <hyatt@apple.com>
3500
3501         Fix 2% performance regression on the PLT.  Increase the large animated
3502         image cutoff from 1MB to 5MB.
3503
3504         In addition when pruning we will aggressively discard image sources.
3505
3506         Reviewed by ggaren
3507
3508         * platform/graphics/BitmapImage.cpp:
3509         (WebCore::BitmapImage::destroyDecodedData):
3510
3511 2007-03-08  Timothy Hatcher  <timothy@apple.com>
3512
3513         Reviewed by John.
3514
3515         <rdar://problem/4664697> highlighter SPI needs a node parameter to give more context
3516
3517         Pass the RenderObject's node to customHighlightLineRect and paintCustomHighlight.
3518
3519         * page/Frame.h:
3520         * page/mac/FrameMac.mm:
3521         (WebCore::Frame::customHighlightLineRect):
3522         (WebCore::Frame::paintCustomHighlight):
3523         * page/mac/WebCoreFrameBridge.h:
3524         * rendering/InlineTextBox.cpp:
3525         (WebCore::InlineTextBox::paintCustomHighlight):
3526         * rendering/RenderBox.cpp:
3527         (WebCore::RenderBox::paintCustomHighlight):
3528         * rendering/RootInlineBox.cpp:
3529         (WebCore::RootInlineBox::addHighlightOverflow):
3530         (WebCore::RootInlineBox::paintCustomHighlight):
3531
3532 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3533
3534         Reviewed by harrison
3535         
3536         <http://bugs.webkit.org/show_bug.cgi?id=13000>
3537         Range.createContextualFragment is not supported
3538
3539      &nb