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