LayoutTests:
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
2
3         Reviewed by levi
4         
5         <rdar://problem/4628409>
6         Safari crashes in CompositeEditCommand::removeBlockPlaceholder entering text in a web page form
7
8         * editing/CompositeEditCommand.cpp:
9         (WebCore::CompositeEditCommand::removeBlockPlaceholder): 
10         A script on the page shrinks the textarea down to zero rows just
11         before insertion.  That gives the shadow div a zero height, removing
12         [div, 0] as a candidate for a VisiblePosition.  Then 
13         InsertTextCommand::input() tries to create a VisiblePosition from 
14         [div, 0] and fails.  A nil check is a quick fix.  Another might
15         be to make positions where there is a caret selection candidates.
16         Another might be to make any [div, 0] where div is a shadow div inside
17         a form element a candidate.
18
19 2006-07-27  Graham Dennis  <graham.dennis@gmail.com>
20
21         Reviewed by Darin.
22
23         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
24           Japanese characters improperly rendering in TOT
25           
26         Test: fast/encoding/denormalised-voiced-japanese-chars.html
27
28         * platform/Font.cpp:
29         (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
30         (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
31         into an argument as WidthIterator::advance doesn't update m_currentCharacter while
32         looping
33
34 2006-07-27  Eric Seidel  <eric@eseidel.com>
35
36         Reviewed by ap.
37
38         Complex entities seem to fail on TOT
39         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
40         Use an alternative work-around to an XML Entity parsing bug.
41
42         * dom/XMLTokenizer.cpp:
43         (WebCore::XMLTokenizer::write):
44         (WebCore::hackAroundLibXMLEntityBug): added.
45         (WebCore::startElementNsHandler):
46         (WebCore::endElementNsHandler):
47         (WebCore::charactersHandler):
48         (WebCore::processingInstructionHandler):
49         (WebCore::cdataBlockHandler):
50         (WebCore::commentHandler):
51         (WebCore::getEntityHandler):
52
53 2006-07-27  Rob Buis  <buis@kde.org>
54
55         Reviewed by Darin.
56
57         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
58         Fix viewBox issues in Hixie's test
59
60         Do a more accurate and quicker job of parsing the viewBox
61         attribute. Handle properly on negative width/height and
62         invalid syntax in general.
63
64         * ksvg2/svg/SVGFitToViewBox.cpp:
65         (SVGFitToViewBox::parseViewBox):
66
67 2006-07-27  Eric Seidel  <eric@eseidel.com>
68
69         Reviewed by ap.
70
71         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
72         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
73         This patch does not try to autogenerate anything, but enables the SVG functionality.
74         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
75
76         * bindings/js/kjs_dom.cpp:
77         (KJS::toJS):
78         * bindings/js/kjs_html.cpp:
79         (KJS::JSHTMLElement::objectGetter):
80         (KJS::HTMLElementFunction::callAsFunction):
81         (KJS::JSHTMLElement::objectSetter):
82         * bindings/js/kjs_html.h:
83         (KJS::JSHTMLElement::):
84         * dom/Document.h:
85         (WebCore::Document::isSVGDocument):
86         * html/HTMLEmbedElement.cpp:
87         (WebCore::HTMLEmbedElement::contentDocument):
88         (WebCore::HTMLEmbedElement::getSVGDocument):
89         * html/HTMLEmbedElement.h:
90         * html/HTMLObjectElement.cpp:
91         (WebCore::HTMLObjectElement::HTMLObjectElement):
92         (WebCore::HTMLObjectElement::getInstance):
93         (WebCore::HTMLObjectElement::parseMappedAttribute):
94         (WebCore::HTMLObjectElement::contentDocument):
95         (WebCore::HTMLObjectElement::rendererIsNeeded):
96         (WebCore::HTMLObjectElement::createRenderer):
97         (WebCore::HTMLObjectElement::setCode):
98         (WebCore::HTMLObjectElement::setArchive):
99         (WebCore::HTMLObjectElement::setBorder):
100         (WebCore::HTMLObjectElement::setCodeBase):
101         (WebCore::HTMLObjectElement::setCodeType):
102         (WebCore::HTMLObjectElement::setData):
103         (WebCore::HTMLObjectElement::hspace):
104         (WebCore::HTMLObjectElement::setHspace):
105         (WebCore::HTMLObjectElement::setStandby):
106         (WebCore::HTMLObjectElement::setType):
107         (WebCore::HTMLObjectElement::setUseMap):
108         (WebCore::HTMLObjectElement::vspace):
109         (WebCore::HTMLObjectElement::setVspace):
110         (WebCore::HTMLObjectElement::getSVGDocument):
111         * html/HTMLObjectElement.h:
112         * ksvg2/svg/SVGDocument.h:
113         (WebCore::SVGDocument::isSVGDocument):
114         * rendering/RenderWidget.h:
115         (WebCore::RenderWidget::frameView):
116
117 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
118
119         Reviewed by Darin.
120
121         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
122         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
123
124         Test: fast/js/xhtml-serialize.html
125
126         * editing/markup.cpp:
127         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
128         is not permitted in HTML, to make it valid XML.
129
130 2006-07-26  Alice Liu  <alice.liu@apple.com>
131
132         Reviewed by John Sullivan (and Kevin and Timo).
133
134         landing this patch for John et al.  
135         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
136
137         * page/FrameView.cpp:
138         (WebCore::FrameView::layout):
139         moved the call to didFirstLayout to above the check for needsLayout
140         because we need to call didFirstLayout for every webview, not just
141         ones we think need layout.  
142
143 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
144
145         Reviewed by darin
146         
147         <rdar://problem/4652788>
148         REGRESSION: Can't change size or style of any text in message body
149
150         * dom/Node.cpp:
151         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
152         * html/HTMLElement.cpp:
153         (WebCore::HTMLElement::isContentRichlyEditable): First check
154         the frame for editability, then userModify, like what
155         HTMLElement::isContentEditable() does.
156         * html/HTMLElement.h:
157
158 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
159
160         Reviewed by ap.
161
162         - fix debug-only information() string for table cells
163
164         * rendering/RenderObject.cpp:
165         (WebCore::RenderObject::information):
166
167 2006-07-25  David Harrison  <harrison@apple.com>
168
169         Reviewed by timo and Darin.
170
171         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
172         
173         * WebCore.xcodeproj/project.pbxproj:
174         * bridge/mac/WebCoreFrameBridge.h:
175         * bridge/mac/WebCoreFrameBridge.mm:
176         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
177         Add matchStyle parameter for use by WebKit.
178
179 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
180
181         Reviewed by adele
182         
183         <rdar://problem/4649560>
184         REGRESSION: Can't Select All when the body is contentEditable="true"
185
186         * editing/VisiblePosition.cpp:
187         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
188         element into an editable body as a convenience.
189
190 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
191
192         Reviewed by darin
193         
194         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
195
196         * dom/Document.cpp:
197         (WebCore::Document::inDesignMode): Removed some spaces.
198         * page/Frame.cpp:
199         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
200         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
201         it eventually.
202
203 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
204
205         Reviewed by Darin.
206
207         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
208           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
209
210         No test added because there is no change in functionality.
211
212         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
213         * bindings/js/kjs_binding.h: Ditto.
214         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
215         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
216         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
217           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
218         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
219
220 2006-07-24  Dan Waylonis  <waylonis@google.com>
221
222         Reviewed and tweaked a bunch by Darin.
223
224         Test: plugins/bindings-test.html
225
226         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
227           jsNull and NSNull not properly converted between JS and ObjC
228
229         * bindings/objc/WebScriptObject.mm:
230         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
231         Added case that converts jsNull to NSNull.
232
233 2006-07-24  Darin Adler  <darin@apple.com>
234
235         Reviewed by Adele and Justin.
236
237         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
238           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
239         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
240           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
241         - removed some uses of DeprecatedPtrList in the markup code
242
243         Test: fast/forms/textarea-type-spaces.html
244         Test: fast/forms/textarea-paste-newline.html
245
246         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
247         Updated call to pass a range -- in this case it is the range of the entire document,
248         so this will not handle the whitespace properly.
249
250         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
251         documentFragmentWithText: method, so we can handle whitespace properly.
252         * bridge/mac/WebCoreFrameBridge.mm:
253         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
254         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
255         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
256         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
257         parameter -- pass it on to createFragmentFromText.
258         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
259         DeprecatedPtrList to Vector.
260         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
261         Pass the range of the current selection as context when creating the fragment.
262
263         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
264         a call to the new containsCaretOffset function -- helps make the caret work right when
265         it is past the end of the last line in a textarea.
266
267         * editing/CompositeEditCommand.cpp:
268         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
269         style does not call for collapsing whitespace.
270         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
271         to share code, including the new logic mentioned above.
272
273         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
274         Use a text node instead of a break element when inserting and the style is preserveNewline.
275
276         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
277         to createFragmentFromText.
278
279         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
280         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
281         not to call otherwise.
282
283         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
284         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
285         Also changed the constructor to take a selection rather than a pointer to the root
286         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
287         unused parameter from shouldMergeEnd.
288         * editing/ReplaceSelectionCommand.cpp:
289         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
290         Compute root editable element from passed-in selection. Used the start of the selection
291         as a base node for style purposes for the test rendering. Removed the special case
292         "single text node" alternative to createFragmentFromText in the plain text case, since
293         createFragmentFromText now handles that correctly.
294         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
295         property from the source location when creating a temporary element for test rendering.
296         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
297         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
298         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
299         change code to not remove end BR when it can be re-used instead, don't call the
300         paragraph separator insertion when the position is at the start of a paragraph already,
301         removed redundant computation of identical "next" value, removed unneeded boolean
302         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
303         a newline character, removed unneeded code to set insertionPos after all code that uses
304         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
305         context is one where we do not collapse white space.
306         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
307         a boolean instead of doing the removal.
308
309         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
310         createFragmentFromText function to take a range for context instead of a document.
311         * editing/markup.cpp:
312         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
313         (WebCore::createMarkup): Ditto.
314         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
315         and changed a couple places to use isEmpty instead of comparing with "".
316         (WebCore::createFragmentFromText): Given the new context parameter, if the context
317         is one that preserves newlines, then use "\n" instead of <br> elements.
318         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
319
320         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
321         elements if the context of this node is one where we preserve newlines.
322
323         * rendering/InlineTextBox.h:
324         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
325         Added. Implements the appropriate rule for determining if a caret position is
326         in this line or not. Returns true for both one line and the next in cases where
327         affinity must be considered to determine which line the caret is on.
328
329         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
330         * rendering/RenderText.cpp:
331         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
332         which will no longer apply due to the new containsCaretOffset function logic.
333         (WebCore::RenderText::caretRect): Use containsCaretOffset.
334         (WebCore::RenderText::inlineBox): Ditto.
335
336         * rendering/RenderTextControl.cpp:
337         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
338         after calling setInnerText so that the last newline in the string has the effect
339         we expect outside the HTML world (an additional line).
340         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
341         too. The layout tests caught this problem, which needs a better solution long term.
342         (WebCore::RenderTextControl::text): Call textContent with the parameter false
343         so it will not include newlines for <br> elements. Now the only <br> element
344         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
345         that one should not show up in the text value.
346
347         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
348         that specifically called out the pre whitespace mode and made it work for all
349         the modes that preserve newlines. This makes sure we get a last line box for
350         text after the last "\n" even in cases where there is no <br> afterward.
351
352         * editing/DeleteSelectionCommand.cpp:
353         (WebCore::DeleteSelectionCommand::fixupWhitespace):
354         * editing/InsertParagraphSeparatorCommand.cpp:
355         (WebCore::InsertParagraphSeparatorCommand::doApply):
356         Added assertions to make sure we don't do anything when we're not collapsing
357         whitespace.
358
359         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
360         Changed to use Vector instead of DeprecatedPtrList.
361
362         * editing/HTMLInterchange.cpp: Removed obsolete comment.
363
364         * loader/Cache.h: Removed a stray include.
365
366 2006-07-24  Adele Peterson  <adele@apple.com>
367
368         Reviewed by Justin.
369
370         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
371
372         Test: * editing/style/apple-style-editable-mix.html
373
374         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
375           checks the user modify property of its own renderer, since that is inherited.
376         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
377         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
378
379 2006-07-24  Darin Adler  <darin@apple.com>
380
381         Reviewed by Hyatt.
382
383         - implement String::createCFString
384
385         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
386
387         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
388
389         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
390         and added the CFStringRef ones.
391         * platform/mac/StringMac.mm: Added. Ditto.
392
393 2006-07-24  David Hyatt  <hyatt@apple.com>
394
395         Two bug fixes.
396
397         (1) Make sure to mark positioned objects that depend on line position to
398         mark themselves as needing layout when their line box placeholder gets
399         repositioned.
400
401         * rendering/RenderBox.cpp:
402         (WebCore::RenderBox::position):
403        
404         (2) Improve highlighting to factor the inflation into overflow so that
405         invalidation and repainting will work properly.
406
407         * rendering/RootInlineBox.cpp:
408         (WebCore::RootInlineBox::addHighlightOverflow):
409         * rendering/RootInlineBox.h:
410         * rendering/bidi.cpp:
411         (WebCore::RenderBlock::layoutInlineChildren):
412
413 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
414
415         Reviewed by Adele.
416
417         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
418         
419         * html/HTMLInputElement.cpp:
420         (WebCore::HTMLInputElement::defaultEventHandler):
421         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
422         that onsearch can be invoked.
423         
424         * manual-tests/onsearch-enter.html: Added.
425
426 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
427
428         Reviewed by Darin and Alexey.
429         
430         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
431         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
432
433         Test: svg/custom/non-opaque-filters.svg
434
435         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
436         (WebCore::KCanvasFilterQuartz::prepareFilter):
437         We create an autorelease pool so we can control the deallocation of the
438         CIContext that we're creating. The CIContext retains the CGContext that 
439         you pass it internally so when the CIContext is released, the 
440         CGContext is released as well.
441         This is all fine and dandy unless you wrap the creation of the CIFilter
442         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
443         out from underneath you. So if you start with context A, 
444         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
445         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
446         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
447         release on A, but A never got the refcount in the first place. B did. BOOM!
448         So we create a pool, then do a retain, then release the pool so that we 
449         don't have to worry about the pool releasing it at a later time.
450         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
451
452 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
453
454         Reviewed by Hyatt.
455
456         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
457           Incomplete repaint when changing an inline's border
458
459         Test: fast/repaint/line-overflow.html
460
461         * rendering/RenderBlock.h:
462         * rendering/bidi.cpp:
463         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
464         variables to track the vertical edges of the area that changed, accounting for
465         lines that were deleted, inserted or moved. Removed unnecessary updating of
466         m_overflowHeight.
467         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
468         m_overflowHeight.
469         (WebCore::RenderBlock::determineEndPosition):
470         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
471         arguments, which this method updates to account for deleted lines.
472         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
473
474 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
475
476         Reviewed by Darin.
477
478         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
479           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
480
481         Test: fast/forms/select-visual-hebrew.html
482
483         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
484
485 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
486
487         Reviewed by Darin.
488
489         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
490         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
491
492         * page/Frame.cpp:
493         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
494         claims it.
495
496 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
497
498         Reviewed by Darin.
499
500         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
501           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
502
503         * rendering/RenderBlock.cpp:
504         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
505         for bug 9312: For coordinates outside a replaced object, return the position
506         just before (after) the element if the coordinates are above or to the left (below
507         or to the right).
508
509 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
510
511         Reviewed by maciej.
512
513         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
514         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
515
516         WebCore portion of the fix.
517
518         * bridge/mac/WebCoreScriptDebugger.h:
519         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
520         * bridge/mac/WebCoreScriptDebugger.mm:
521         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
522
523 2006-07-23  Alice Liu  <alice.liu@apple.com>
524
525         Reviewed by Adele.
526         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
527
528         * editing/visible_units.cpp:
529         (WebCore::previousLinePosition):
530         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
531         (WebCore::nextLinePosition):
532         same as above
533
534 2006-07-23  David Harrison  <harrison@apple.com>
535
536         Reviewed by timo.
537
538         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
539         
540         * Test: editing/deleting/delete-mixed-editable-content-001.html
541
542         * editing/visible_units.cpp:
543         (WebCore::startOfParagraph):
544         Respect editable boundary the same way endOfParagraph does.
545
546 2006-07-23  Beth Dakin  <bdakin@apple.com>
547
548         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
549
550         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
551         text - WebCore::InlineBox::root()
552
553         The initial rendering crash was due to a render object having a 
554         stale reference to an inline box that had already been deleted and 
555         then recreated in the exact same location in memory. (Crazy, I 
556         know.) The situation seemed pretty specific to list markers 
557         according to Hyatt according to Maciej, so that is what I patched 
558         specifically. Fixing this crash unearthed a separate editing crash 
559         where we were trying to insert a block into itself. I worked on 
560         that with Maciej and Harrison, and Harrison came up with a fix.
561
562         * editing/CompositeEditCommand.cpp:
563         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
564         node, insert the new block into the parent instead.
565         * rendering/InlineBox.cpp:
566         (WebCore::InlineBox::isChildOfParent): This function is for 
567         posterity. It will help keep the linebox tree in check.
568         * rendering/InlineBox.h:
569         * rendering/InlineFlowBox.cpp:
570         (WebCore::InlineFlowBox::addToLine): Added assert.
571         (WebCore::InlineFlowBox::deleteLine): Added assert.
572         * rendering/ListMarkerBox.cpp:
573         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
574         removeChild on this.
575         (WebCore::ListMarkerBox::operator delete):
576         * rendering/ListMarkerBox.h:
577
578 2006-07-23  Alice Liu  <alice.liu@apple.com>
579
580         Reviewed by Darin.
581
582         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
583
584         * rendering/RenderBlock.cpp:
585         (WebCore::RenderBlock::positionForCoordinates):
586         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
587         * rendering/RenderTextControl.cpp:
588         (WebCore::RenderTextControl::nodeAtPoint):
589         added implementation
590         * rendering/RenderTextControl.h:
591         added function protocol
592
593 2006-07-23  Adele Peterson  <adele@apple.com>
594
595         Reviewed by Darin.
596
597         Updating fix from last checkin.
598
599         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
600         Only tell the view about this flexbox if there isn't another flexbox already cached.
601
602 2006-07-23  Adele Peterson  <adele@apple.com>
603
604         Reviewed by Maciej.
605
606         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
607
608         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
609         its first layout.
610         * rendering/RenderFlexibleBox.cpp:
611         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
612         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
613
614         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
615         * rendering/RenderView.h:
616         (WebCore::RenderView::setFlexBoxInFirstLayout):
617         (WebCore::RenderView::flexBoxInFirstLayout):
618
619 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
620
621         Reviewed by Darin.
622
623         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
624         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
625         of registered mime types
626
627         * bindings/js/kjs_navigator.cpp:
628         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
629         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
630         from even being called.
631
632 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
633
634         Reviewed by Adele and Tim Omernick.
635
636         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
637
638         Couldn't figure out how to make layout test, here's a manual test:
639         * manual-tests/remove-select-onchange.html: Added.
640         
641         * rendering/RenderMenuList.cpp:
642         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
643         tree so it doesn't get destroyed if we do.
644         
645         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
646         to be in the render tree:
647         
648         * rendering/RenderPopupMenu.cpp:
649         (WebCore::RenderPopupMenu::RenderPopupMenu):
650         * rendering/RenderPopupMenu.h:
651         (WebCore::RenderPopupMenu::menuList):
652         * rendering/RenderPopupMenuMac.h:
653         * rendering/RenderPopupMenuMac.mm:
654         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
655         * rendering/RenderPopupMenuWin.h:
656         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
657         * rendering/RenderTheme.h:
658         * rendering/RenderThemeMac.h:
659         * rendering/RenderThemeMac.mm:
660         (WebCore::RenderThemeMac::createPopupMenu):
661         * rendering/RenderThemeWin.cpp:
662         (WebCore::RenderThemeWin::createPopupMenu):
663         * rendering/RenderThemeWin.h:
664
665 2006-07-21  Adele Peterson  <adele@apple.com>
666
667         Reviewed by Darin.
668
669         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
670
671         Test: fast/forms/textarea-scrolled-endline-caret.html
672
673         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
674         When looking for the closest line box, take the scroll offset into account.
675
676 2006-07-21  Tim Omernick  <timo@apple.com>
677
678         Reviewed by Geoff & Maciej.
679
680         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
681
682         Geoff is working on a layout test for this.
683
684         * bridge/mac/FrameMac.mm:
685         (WebCore::FrameMac::focusWindow):
686         (WebCore::FrameMac::unfocusWindow):
687         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
688         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
689         crasher.
690         
691 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
692
693         Reviewed by Darin.
694
695         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
696
697         * rendering/RenderTextControl.cpp:
698         (WebCore::RenderTextControl::updateFromElement): Clear the undo
699         chain when the text control contents have been set
700         programmatically.
701         * bridge/mac/FrameMac.mm:
702         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
703         stack, close all open undo groups and then open an equal number,
704         since otherwise NSUndoManager ends up in an inconsistent state
705         leading to uncaught ObjC exceptions.
706
707 2006-07-21  Beth Dakin  <bdakin@apple.com>
708         
709         Reviewed by Darin.
710
711         Just moving this assertion down a couple of lines. It was hitting 
712         every time you try to print a page because we put it too early in 
713         the function.
714
715         * bridge/mac/WebCoreFrameBridge.mm:
716         (-[WebCoreFrameBridge drawRect:]):
717
718 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
719
720         Reviewed by levi
721         
722         <rdar://problem/4548238>
723         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
724
725         * editing/CompositeEditCommand.cpp:
726         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
727         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
728         * editing/CompositeEditCommand.h:
729         * editing/InsertParagraphSeparatorCommand.cpp:
730         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
731         * editing/TypingCommand.cpp:
732         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
733         the endingSelection is at the start of an editable region.
734         * editing/htmlediting.cpp:
735         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
736         (WebCore::appendedSublist): Ditto.
737         (WebCore::enclosingEmptyListItem): Ditto.
738         * editing/htmlediting.h:
739
740 === Safari-521.20 ===
741
742 2006-07-21  Tim Omernick  <timo@apple.com>
743
744         Reviewed by Beth Dakin & John Sullivan.
745
746         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
747
748         Beth is in the middle of making a layout test for this; she will land it soon.
749
750         * platform/mac/ScrollBarMac.mm:
751         (ScrollBar::~ScrollBar):
752         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
753         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
754         in view-based widgets to prevent their destruction while the tracking is in progress.
755         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
756         than using removeFromSuperview().
757
758 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
759
760         Reviewed by Darin.
761
762         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
763           REGRESSION: Selection bug in new text fields when selecting past the first letter
764
765         Test: editing/selection/select-from-textfield-outwards.html
766
767         * editing/Selection.cpp:
768         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
769         where the selection starts (resp. ends) in the last (resp. first) visual position
770         inside an editable root.
771         * editing/htmlediting.cpp:
772         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
773         tree with a position in the shadow ancestor.
774         * rendering/RenderBlock.cpp:
775         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
776         object, return the position just before (after) the element if the coordinates are above or
777         to the left (below or to the right).
778         * rendering/RenderObject.cpp:
779         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
780         * rendering/RenderText.cpp:
781         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
782         in the lowest text box if the y coordinate is below all text boxes.
783
784 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
785
786         Reviewed by Darin.
787         
788         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
789         HousingMaps.com (Google Maps-based site)
790         
791         - Made style.filter undetectable, like document.all.
792         
793         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
794         which conflicts with IE's custom CSS attribute by the same name. Web programs 
795         like the Google maps API test for style.filter, and assume it's the IE 
796         style.filter if they find it, so we need to make style.filter undetectable 
797         to avoid breaking them.
798         
799         An alternative solution would be to hotwire a delorean, go back in time,
800         and beg the web standards makers to make standards that work on the web.
801
802         * bindings/js/kjs_css.cpp:
803         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
804
805 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
806
807         Reviewed by john
808         
809         <rdar://problem/4641033>
810         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
811         
812         * editing/markup.cpp:
813         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
814         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
815         at those ancestors.  We assumed that any ancestors of the current node not in the 
816         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
817         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
818         currently accumulated markup with markup for render-less containers.  Most of the
819         content at apple.com was being put inside an <optgroup> inside a <select> element.  
820         Then on Paste createContextualFragment would drop it.
821
822 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
823
824         Reviewed by Geoff.
825
826         * dom/Document.h:
827         (WebCore::Document::):
828         * dom/EventTargetNode.cpp:
829         (WebCore::EventTargetNode::addEventListener):
830         * page/FrameView.cpp:
831         (WebCore::FrameView::layout):
832         * rendering/RenderLayer.cpp:
833         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
834         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
835
836 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
837
838         Reviewed by Geoff.
839
840         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
841
842         * xml/XSLTProcessor.cpp:
843         (WebCore::xsltParamArrayFromParameterMap):
844         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
845         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
846         This also works around a bug in libxslt where a hash table isn't allocated.
847
848 2006-07-20  Alice Liu  <alice.liu@apple.com>
849
850         Reviewed by Tim Omernick.
851
852         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
853         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
854
855         * manual-tests/remove-input-file-onchange.html: Added.
856         * platform/mac/FileButtonMac.mm:
857         (-[WebFileChooserButton chooseFilename:]):
858         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
859
860 2006-07-20  Alice Liu  <alice.liu@apple.com>
861
862         Reviewed by Adele.
863
864         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
865         added a manual test because of the need to use AutoFill.
866
867         * dom/Node.h:
868         (WebCore::Node::aboutToUnload):
869         added virtual function prototype
870         * html/HTMLInputElement.cpp:
871         (WebCore::HTMLInputElement::aboutToUnload):
872         added implementation that sends textFieldDidEndEditing notification
873         * html/HTMLInputElement.h:
874         added virtual function prototype
875         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
876         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
877         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
878         * page/Frame.cpp:
879         (WebCore::Frame::stopLoading):
880         before unloading, call aboutToUnload on the current focused node
881
882 2006-07-20  Brady Eidson  <beidson@apple.com>
883
884         Reviewed by Maciej
885
886         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
887         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
888         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
889
890         * dom/Document.cpp:
891         (WebCore::Document::Document):
892         (WebCore::Document::clear):
893         (WebCore::Document::handleWindowEvent):
894         (WebCore::Document::getHTMLWindowEventListener):
895         (WebCore::Document::removeHTMLWindowEventListener):
896         (WebCore::Document::removeWindowEventListener):
897         (WebCore::Document::hasWindowEventListener):
898         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
899
900         * dom/Document.h:
901         Changed the EventListener list to be a vanilla pointer list to a refptr list
902
903 2006-07-20  John Sullivan  <sullivan@apple.com>
904
905         Reviewed by Maciej
906
907         - WebCore part of fix for:
908         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
909         closing tabs after clicking in a web page
910         
911         * bridge/mac/WebCoreFrameBridge.h:
912         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
913         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
914         * bridge/mac/FrameMac.mm:
915         (WebCore::FrameMac::passMouseDownEventToWidget):
916         updated for name change
917
918 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
919
920         Reviewed by Darin.
921
922         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
923         Use of window.open & window.close can cause crash
924
925         * platform/PlatformMouseEvent.h:
926         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
927         * platform/mac/PlatformMouseEventMac.mm:
928         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
929         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
930
931         * bridge/mac/FrameMac.mm:
932         (WebCore::FrameMac::handleMouseMoveEvent):
933         * rendering/RenderFormElement.cpp:
934         (WebCore::RenderFormElement::clicked): 
935         Updated for the above changes.
936
937         * platform/gdk/MouseEventGdk.cpp:
938         * platform/gdk/TemporaryLinkStubs.cpp:
939         (PlatformMouseEvent::PlatformMouseEvent):
940         * platform/win/MouseEventWin.cpp:
941         * platform/win/TemporaryLinkStubs.cpp:
942         (PlatformMouseEvent::PlatformMouseEvent):
943         Trying not to break other platforms.
944
945         * manual-tests/invalid-mouse-event.html: Added.
946
947 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
948         
949         Reviewed by Anders.
950
951         - delete line that I only commented in the last patch - meant to do this before landing
952
953         * html/HTMLFrameElement.cpp:
954         (WebCore::HTMLFrameElement::close): 
955
956 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
957
958         Reviewed by Geoff.
959
960         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
961         
962         I couldn't figure out how to make an automated test case for this,
963         or even a manual one. It seems to be timing-related in some way.
964
965         * html/HTMLFrameElement.cpp:
966         (WebCore::HTMLFrameElement::close): detach the child frame from
967         its element, not the frame containing this element.
968
969 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
970
971         Reviewed by Darin.
972
973         * bridge/mac/FrameMac.mm:
974         (WebCore::FrameMac::nextKeyViewInFrame):
975         Hold a ref to the node in case it gets destroyed by an event handler.
976
977 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
978
979         Reviewed by Darin.
980
981         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
982         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
983         Image::checkForSolidColor
984
985         * platform/Image.cpp:
986         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
987         the frame was decoded successfully.
988
989 2006-07-19  Adele Peterson  <adele@apple.com>
990
991         Reviewed by Maciej.
992
993         - Fix for: 
994         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
995         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
996
997         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
998         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
999
1000         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
1001
1002         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
1003         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
1004         which will cause the correct selection & scrolling behavior to occur. 
1005
1006         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
1007         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
1008         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
1009         a layout to happen, and we don't want that to happen in the middle of attach().
1010
1011         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
1012         * bindings/objc/DOMPrivate.h:
1013
1014         * dom/Element.cpp:
1015         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
1016         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
1017         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
1018         and only requiring the element to be focusable now before updating focus appearance.
1019         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1020         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
1021         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
1022         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
1023         (WebCore::Element::blur): ditto.
1024         * dom/Element.h:
1025         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
1026         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
1027
1028         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
1029         * html/HTMLAnchorElement.h: Added supportsFocus.
1030         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
1031         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
1032         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1033         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1034
1035         * html/HTMLInputElement.cpp:
1036         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1037         and only requiring the element to be focusable now before updating focus appearance.
1038         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1039         * html/HTMLInputElement.h:
1040
1041         * html/HTMLTextAreaElement.cpp:
1042         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1043         and only requiring the element to be focusable now before updating focus appearance.
1044         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1045         * html/HTMLTextAreaElement.h:
1046
1047 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1048
1049         Reviewed by levi
1050         
1051         <rdar://problem/4631972>
1052         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1053
1054         * dom/Position.cpp:
1055         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1056         (WebCore::Position::downstream): Ditto.
1057         * editing/CompositeEditCommand.cpp:
1058         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1059         * editing/htmlediting.cpp:
1060         (WebCore::canHaveChildrenForEditing): Added !iframe.
1061         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1062         (WebCore::enclosingBlock): Added.
1063         * editing/htmlediting.h:
1064
1065 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1066
1067         Reviewed by Adele.
1068
1069         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1070         
1071         * bridge/mac/FrameMac.mm:
1072         (WebCore::FrameMac::nextKeyViewInFrame):
1073         Take into account that focus handlers can cause a node's renderer to be destroyed.
1074         
1075 2006-07-19  David Hyatt  <hyatt@apple.com>
1076
1077         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1078         I re-architected image.  This patch restores the optimization for CG.  Cairo
1079         will still need the optimization.
1080
1081         Reviewed by darin
1082
1083         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1084
1085         * platform/Image.cpp:
1086         (WebCore::Image::Image):
1087         (WebCore::Image::invalidateData):
1088         (WebCore::Image::cacheFrame):
1089         * platform/Image.h:
1090         (WebCore::Image::setIsPDF):
1091         * platform/cairo/ImageCairo.cpp:
1092         (WebCore::Image::checkForSolidColor):
1093         * platform/mac/ImageMac.mm:
1094         (WebCore::Image::initNativeData):
1095         (WebCore::Image::invalidateNativeData):
1096         (WebCore::Image::checkForSolidColor):
1097         (WebCore::Image::draw):
1098         (WebCore::Image::drawTiled):
1099
1100 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1101
1102         Reviewed by levi
1103         
1104         <rdar://problem/4613519>
1105         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1106
1107         * editing/InsertParagraphSeparatorCommand.cpp:
1108         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1109         if the enclosingBlockFlowElement doesn't have a parent.
1110
1111 2006-07-19  David Harrison  <harrison@apple.com>
1112
1113         Reviewed by Tim Hatcher.
1114
1115         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1116         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1117         
1118         Better patch than previous checkin.
1119
1120         * test: editing/pasteboard/paste-table-003.html
1121         
1122         * editing/markup.cpp:
1123         (WebCore::createMarkup):
1124         Make sure to include the table when including a tbody.
1125
1126 === Safari-521.19 ===
1127
1128 2006-07-19  David Harrison  <harrison@apple.com>
1129
1130         Reviewed by Tim Hatcher.
1131
1132         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1133
1134         No test case as this can only be reproduced through ObjC APIs.
1135
1136         * editing/markup.cpp:
1137         (WebCore::createMarkup):
1138         Adjust the range for ancestor markup handling when main loop skips first node.
1139
1140 2006-07-18  David Hyatt  <hyatt@apple.com>
1141
1142         Fix for radar 4611287, make resizable text fields opt-in rather than
1143         opt-out.  Open source users will need to write the pref into their defaults
1144         to see the resizers on textareas now.
1145
1146         Reviewed by mjs and adele
1147
1148         * WebCore.xcodeproj/project.pbxproj:
1149         * bridge/mac/WebCoreSettings.mm:
1150         (-[WebCoreSettings setTextAreasAreResizable:]):
1151         * css/cssparser.cpp:
1152         (WebCore::CSSParser::parseValue):
1153         * css/cssstyleselector.cpp:
1154         (WebCore::CSSStyleSelector::applyProperty):
1155         * css/html4.css:
1156
1157 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1158
1159         Reviewed by Darin.
1160
1161         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1162         REGRESSION: iframes stop rendering after 200th one on successive reloads
1163         
1164         * html/HTMLFrameElement.cpp:
1165         (WebCore::HTMLFrameElement::attach):
1166         (WebCore::HTMLFrameElement::close):
1167         * html/HTMLIFrameElement.cpp:
1168         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1169         (WebCore::HTMLIFrameElement::willRemove):
1170         Remove calls to incrementFrameCount and decrementFrameCount.
1171         
1172         * page/Frame.cpp:
1173         (WebCore::Frame::Frame):
1174         Call incrementFrameCount here.
1175         
1176         (WebCore::Frame::~Frame):
1177         Call disconnectOwnerElement.
1178         
1179         (WebCore::Frame::disconnectOwnerElement):
1180         Call decrementFrameCount here.
1181         
1182 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1183
1184         Reviewed by Darin.
1185
1186         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1187         Let correct CSS custom cursor declarations parse
1188
1189         * css/cssparser.cpp:
1190         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1191         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1192         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1193
1194         * manual-tests/custom-cursors.html: Added a test for this issue.
1195         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1196
1197 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1198
1199         Reviewed by Anders.
1200         
1201         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1202         
1203         WebCore needs to add -sub_library libobjc to maintain
1204         backwards compatibility with binaries linked with WebKit
1205         before JavaScriptCore moved out of WebKit.
1206
1207         * WebCore.xcodeproj/project.pbxproj:
1208
1209 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1210
1211         Reviewed by Justin.
1212
1213         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1214           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1215
1216         Test: editing/selection/click-start-of-line.html
1217
1218         * rendering/RenderText.cpp:
1219         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1220         affinity if the x coordinate is to the left of the middle of the first character
1221         in the text box.
1222
1223 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1224
1225         Reviewed by Darin.
1226
1227         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1228         <rdar://problem/4614085> 
1229         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1230         
1231         * editing/SelectionController.cpp:
1232         (WebCore::SelectionController::modifyExtendingRightForward):
1233         (WebCore::SelectionController::modifyMovingRightForward):
1234         (WebCore::SelectionController::modifyExtendingLeftBackward):
1235         (WebCore::SelectionController::modifyMovingLeftBackward):
1236         If the caret is inside an editable region, the beginning/end of the document should actually be the
1237         beginning/end of the editable region.
1238
1239 2006-07-17  Tim Omernick  <timo@apple.com>
1240
1241         Reviewed by Maciej.
1242
1243         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1244         by script
1245
1246         * bridge/mac/WebCoreFrameBridge.h:
1247         * bridge/mac/WebCoreFrameBridge.mm:
1248         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1249         * page/Frame.cpp:
1250         (WebCore::Frame::prohibitsScrolling):
1251         (WebCore::Frame::setProhibitsScrolling):
1252         * page/Frame.h:
1253         * page/FramePrivate.h:
1254         (WebCore::FramePrivate::FramePrivate):
1255         * page/FrameView.cpp:
1256         (WebCore::FrameView::scrollPointRecursively):
1257         (WebCore::FrameView::setContentsPos):
1258         * page/FrameView.h:
1259         * platform/ScrollView.h:
1260
1261 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1262
1263         Reviewed by Dave Harrison.
1264         
1265         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1266
1267         * editing/htmlediting.cpp:
1268         (WebCore::editingIgnoresContent):
1269
1270 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1271
1272         Reviewed by levi
1273         
1274         <rdar://problem/4621728>
1275         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1276         <rdar://problem/4604932>
1277         REGRESSION: Dragging too far left on a line will select all lines above it.
1278  
1279         No layout test because of 9980.
1280
1281         * rendering/RenderBlock.cpp:
1282         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1283         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1284         editable.
1285
1286 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1287
1288         Reviewed by Darin.
1289
1290         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1291
1292         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1293         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1294         * html/CanvasRenderingContext2D.cpp:
1295         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1296
1297 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1298
1299         Reviewed by Maciej.
1300
1301         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1302
1303         Moves WebScriptObject and WebUndefined to WebCore.
1304
1305         * WebCore.exp:
1306         * WebCore.xcodeproj/project.pbxproj:
1307         * bindings/objc/DOM.mm:
1308         * bindings/objc/DOMCore.h:
1309         * bindings/objc/DOMInternal.mm:
1310         * bindings/objc/DOMUtility.mm:
1311         * bindings/objc/WebScriptObject.mm: Added.
1312         (+[WebUndefined allocWithZone:]):
1313         (-[WebUndefined initWithCoder:]):
1314         (-[WebUndefined encodeWithCoder:]):
1315         (-[WebUndefined copyWithZone:]):
1316         * bindings/objc/WebScriptObjectPrivate.h: Added.
1317         * bridge/mac/FrameMac.mm:
1318         * bridge/mac/WebCoreScriptDebugger.mm:
1319
1320 2006-07-17  David Hyatt  <hyatt@apple.com>
1321
1322         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1323         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1324         font parsing as a means of also correcting IE's incorrect font size rules.
1325
1326         This fixes Yahoo.com.
1327
1328         Reviewed by darin
1329
1330         * css/cssparser.cpp:
1331         (WebCore::CSSParser::parseFont):
1332
1333 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1334
1335         Reviewed by levi
1336         
1337         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1338         
1339         * dom/Document.cpp:
1340         (WebCore::Document::updateSelection):
1341
1342 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1343
1344         Reviewed by Beth.
1345         
1346         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1347
1348         * html/HTMLInputElement.cpp:
1349         (WebCore::HTMLInputElement::setChecked):
1350         (WebCore::HTMLInputElement::preDispatchEventHandler):
1351         * html/HTMLInputElement.h:
1352
1353 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1354
1355         Reviewed by Darin.
1356
1357         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1358           REGRESSION: document.dir should return empty string in <head>
1359
1360         Test: fast/dom/document-dir-property.html
1361
1362         * bindings/js/kjs_html.cpp:
1363         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1364         undefined value for an unset document.dir property.
1365
1366 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1367
1368         Reviewed by Darin.
1369
1370         * dom/NodeFilter.idl:
1371         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1372         * manual-tests/input-empty-on-focus.html:
1373         Removed "Property changes" that snuck in as part of the "apply patch" process.
1374
1375 2006-07-16  Darin Adler  <darin@apple.com>
1376
1377         Reviewed by John Sullivan.
1378
1379         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1380           <rdar://problem/4590613>
1381           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1382
1383         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1384         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1385         Presumably some other bug that we fixed had been compensating.
1386
1387         Test: fast/html/body-offset-properties.html
1388
1389         * rendering/RenderObject.cpp:
1390         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1391         (WebCore::RenderObject::offsetTop): Ditto.
1392         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1393
1394 2006-07-16  Beth Dakin  <bdakin@apple.com>
1395
1396         Reviewed by Maciej.
1397
1398         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1399         clock widget clock hand motion on 9A211 + 4604574
1400
1401         The second hand on the widget was jiggling because the rotation was 
1402         messing up the use of the affine transformation matrix while 
1403         rounding to pixel boundaries in device space. We are mainly 
1404         concerned with rounding to pixel boundaries with the scale in mind, 
1405         so this patch extracts the scale to device space from the matrix, 
1406         and rounds to pixel boundaries using only the scale. This doesn't 
1407         seem like it is a perfect solution, but it definitely solves the 
1408         immediate problem. We will probably need to re-address what should 
1409         happen to avoid pixel cracks with rotations at non-integral scale 
1410         factors. 
1411
1412         * platform/cg/GraphicsContextCG.cpp:
1413         (WebCore::GraphicsContext::roundToDevicePixels):
1414
1415 2006-07-15  Darin Adler  <darin@apple.com>
1416
1417         - fix mistake from fix for 8952 that was breaking layout tests
1418
1419         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1420         Justin was right! I changed the behavior of the function by accident. Changed it
1421         back so that it doesn't blow away the selection on the DOM side in the case where
1422         it didn't before.
1423
1424         I will write 100 times on the blackboard: "When Justin says something about editing,
1425         assume he is right."
1426
1427 2006-07-15  Darin Adler  <darin@apple.com>
1428
1429         - try to fix Windows build
1430
1431         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1432
1433 2006-07-15  Darin Adler  <darin@apple.com>
1434
1435         Reviewed by John Sullivan.
1436
1437         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1438           <rdar://problem/4575185>
1439           REGRESSION: crash on drag of highlighted Google custom home page modules
1440
1441         Test: fast/dynamic/move-node-with-selection.html
1442
1443         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1444         Call updateRendering before calling clearSelection(), since it's important to do any
1445         work beforehand, and there are calls inside clearSelection that will indirectly do an
1446         updateRendering. Also change code to make fewer assumptions about object lifetime.
1447
1448 2006-07-15  Darin Adler  <darin@apple.com>
1449
1450         Reviewed by John Sullivan.
1451
1452         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1453           <rdar://problem/4631844>
1454           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1455
1456         Test: fast/lists/numeric-markers-outside-list.html
1457
1458         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1459         Look for list items, even when we're outside any list.
1460
1461 2006-07-15  Adele Peterson  <adele@apple.com>
1462
1463         Reviewed by John.
1464
1465         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1466
1467         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1468         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1469         part of an editing command to replace the selected text.
1470
1471         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1472           part of a composite command to replace the text being deleted.
1473         * editing/DeleteSelectionCommand.cpp:
1474         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1475         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1476         * editing/CompositeEditCommand.h:
1477         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1478           Added replace argument to construct DeleteSelectionCommand.
1479           
1480         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1481         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1482
1483 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1484
1485         Reviewed by Maciej, tweaked to match Darin's patch.
1486         
1487         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1488         FCKeditor demo (9911)
1489         
1490         * WebCore.xcodeproj/project.pbxproj:
1491         * bindings/js/kjs_html.cpp:
1492         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1493         forwarding the put request to it. I confirmed that no other parts of the 
1494         file use 'body' or 'bodyElement' without checking for null. 
1495         
1496         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1497         any element, not just HTMLBodyElement.
1498
1499 2006-07-15  Darin Adler  <darin@apple.com>
1500
1501         Reviewed by Adele.
1502
1503         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1504           <rdar://problem/4575417>
1505           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1506
1507         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1508           <rdar://problem/4614228>
1509           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1510
1511         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1512         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1513         enough for the future.
1514
1515         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1516         Consume Enter key keypress events even if the element is not in a form.
1517
1518         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1519         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1520         the Macintosh, but in layout tests we can use \n, and everything other than the
1521         code path here works, so worth fixing.
1522
1523 2006-07-15  Darin Adler  <darin@apple.com>
1524
1525         Reviewed by John Sullivan.
1526
1527         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1528           <rdar://problem/4631821>
1529           REGRESSION: NativePopups don't work correctly in some forum software
1530
1531         Test: fast/forms/select-selected.html
1532
1533         * rendering/RenderMenuList.h:
1534         * rendering/RenderMenuList.cpp:
1535         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1536         index to a list index before using it to index into the list.
1537         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1538         to a list index before passing it to the menu renderer.
1539         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1540         option index before calling setSelectedIndex (that function takes an option index).
1541
1542 2006-07-15  Darin Adler  <darin@apple.com>
1543
1544         Reviewed by John Sullivan.
1545
1546         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1547           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1548
1549         * bindings/objc/DOM.mm:
1550         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1551         (-[DOMNode removeEventListener:::]): Ditto.
1552         (-[DOMNode dispatchEvent:]): Ditto.
1553
1554         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1555
1556 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1557
1558         Reviewed by Anders.
1559
1560         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1561
1562         * rendering/RenderTable.cpp:
1563         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1564         just table sections!
1565
1566 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1567
1568         Reviewed by Darin.
1569
1570         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1571         <rdar://problem/4631561>
1572         REGRESSION: Repro crash from mangleme using iframe, only from server.
1573         
1574         * html/HTMLIFrameElement.cpp:
1575         (WebCore::HTMLIFrameElement::attach):
1576         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1577
1578 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1579
1580         Reviewed by Darin.
1581
1582         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1583         REGRESSION: KOI8-U encoding no longer supported.
1584
1585         Tests:
1586         * http/tests/misc/BOM-override.pl
1587         * http/tests/misc/BOM-override-script.html
1588         * fast/encoding/charset-koi8-u.html
1589         * fast/encoding/charset-x-nextstep.html
1590
1591         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1592         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1593         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1594         makes little sense now.
1595
1596         * WebCore.exp:
1597         * bridge/mac/WebCoreTextDecoder.h: Removed.
1598         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1599         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1600
1601         * loader/Decoder.cpp:
1602         (Decoder::Decoder):
1603         (Decoder::setEncodingName):
1604         (Decoder::decode):
1605         Use StreamingTextDecoder::create().
1606
1607         * platform/StreamingTextDecoder.cpp:
1608         (WebCore::StreamingTextDecoder::create):
1609         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1610         * platform/StreamingTextDecoder.h:
1611         StreamingTextDecoder is just an abstract interface to implementations now.
1612
1613         * platform/StreamingTextDecoderICU.cpp: Added.
1614         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1615         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1616         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1617         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1618         (WebCore::StreamingTextDecoderICU::convertUTF16):
1619         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1620         (WebCore::StreamingTextDecoderICU::createICUConverter):
1621         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1622         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1623         (WebCore::StreamingTextDecoderICU::convert):
1624         (WebCore::StreamingTextDecoderICU::toUnicode):
1625         (WebCore::StreamingTextDecoderICU::fromUnicode):
1626         * platform/StreamingTextDecoderICU.h: Added.
1627         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1628         supported by the decoder; minor cleanup.
1629
1630         * platform/TextEncoding.cpp:
1631         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1632         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1633         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1634         
1635         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1636
1637         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1638         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1639         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1640         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1641         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1642         (WebCore::StreamingTextDecoderMac::convertUTF16):
1643         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1644         (WebCore::StreamingTextDecoderMac::createTECConverter):
1645         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1646         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1647         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1648         (WebCore::StreamingTextDecoderMac::convert):
1649         (WebCore::StreamingTextDecoderMac::toUnicode):
1650         (WebCore::StreamingTextDecoderMac::fromUnicode):
1651         * platform/mac/StreamingTextDecoderMac.h: Added.
1652         (WebCore::StreamingTextDecoderMac::convert):
1653         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1654
1655         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1656
1657         * WebCore.xcodeproj/project.pbxproj:
1658
1659 === Safari-521.17 ===
1660
1661 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1662
1663         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1664
1665         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1666         DOMEventTarget protocol that works with GCC 5412.
1667
1668         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1669
1670         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1671         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1672
1673         * WebCore.xcodeproj/project.pbxproj:
1674         * bindings/objc/DOMCore.h:
1675         * bindings/objc/DOMEvents.h:
1676         * bridge/mac/FormDataMac.h:
1677         * bridge/mac/WebCoreAXObject.h:
1678         * bridge/mac/WebCoreCache.h:
1679         * bridge/mac/WebCoreEncodings.h:
1680         * bridge/mac/WebCoreFrameBridge.h:
1681         * bridge/mac/WebCoreFrameNamespaces.h:
1682         * bridge/mac/WebCoreJavaScript.h:
1683         * bridge/mac/WebCorePageBridge.h:
1684         * bridge/mac/WebCorePageState.h:
1685         * bridge/mac/WebCoreResourceLoader.h:
1686         * bridge/mac/WebCoreScriptDebugger.h:
1687         * bridge/mac/WebCoreSettings.h:
1688         * bridge/mac/WebCoreStringTruncator.h:
1689         * bridge/mac/WebCoreStringTruncator.mm:
1690         * bridge/mac/WebCoreTextDecoder.h:
1691         * bridge/mac/WebDashboardRegion.h:
1692         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1693         * platform/mac/CookieJar.mm:
1694         * platform/mac/DeprecatedStringMac.mm:
1695         * platform/mac/FontDataMac.mm:
1696         * platform/mac/FoundationExtras.h:
1697         * platform/mac/TextBoundaries.mm:
1698         * platform/mac/WebCoreHistory.h:
1699         * platform/mac/WebCoreHistory.m:
1700         * platform/mac/WebCoreKeyGenerator.h:
1701         * platform/mac/WebCoreTextArea.h:
1702         * platform/mac/WebCoreTextField.h:
1703         * platform/mac/WebCoreTextRenderer.h:
1704         * platform/mac/WebCoreView.h:
1705         * platform/mac/WebCoreWidgetHolder.h:
1706
1707 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1708
1709         Reviewed by Maciej.
1710
1711         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1712         JavaScriptCore.
1713
1714         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1715         manual delete.
1716
1717 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1718
1719         Reviewed by Adele and Justin.
1720
1721         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1722         <rdar://problem/4613948>
1723         REGRESSION: Check Spelling does not work in textarea elements
1724         
1725         * bridge/mac/FrameMac.mm:
1726         (WebCore::FrameMac::advanceToNextMisspelling):
1727         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1728         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1729         indices respectively.
1730         
1731         * dom/Range.cpp:
1732         (WebCore::Range::checkNodeBA):
1733         Allow range operations on shadow trees.
1734
1735         * manual-tests/form-element-spelling.html: Added.
1736
1737 2006-07-14  Beth Dakin  <bdakin@apple.com>
1738
1739         Reviewed by Hyatt.
1740
1741         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1742         WebCore::FrameView::updateOverflowStatus
1743
1744         m_viewportRenderer is never initialized for framesets, and it 
1745         shouldn't be. So we just need to nil-check for it in 
1746         updateOverflowStatus() and return early.
1747
1748         * page/FrameView.cpp:
1749         (WebCore::FrameView::updateOverflowStatus): Nil check.
1750
1751 2006-07-14  Adele Peterson  <adele@apple.com>
1752
1753         RS by Darin.
1754
1755         Backing out fix for <rdar://problem/4604703> 
1756         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1757
1758         Darin had a better fix in WebKit for this.
1759
1760         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1761
1762 2006-07-14  Adele Peterson  <adele@apple.com>
1763
1764         Reviewed by Darin.
1765
1766         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1767
1768         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1769         * bridge/mac/FrameMac.h: ditto.
1770         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1771         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1772         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1773         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1774
1775 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1776
1777         Reviewed by Darin.
1778
1779         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1780           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1781
1782         * rendering/RenderText.cpp:
1783         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1784         position.
1785
1786 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1787
1788         Reviewed by Darin.
1789
1790         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1791           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1792
1793         Test: editing/deleting/delete-at-start-or-end.html
1794
1795         * editing/TypingCommand.cpp:
1796         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1797         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1798
1799 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1800
1801         Reviewed by Geoffrey.
1802
1803         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1804           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1805
1806         No test cases since there is no change in functionality.
1807
1808         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1809         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1810         no-argument getNumber() method.
1811
1812 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1813
1814         Reviewed by Adele.
1815
1816         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1817         one surrounding this function, and the nested one makes the compiler
1818         think our local variable is volatile (seems like a compiler bug to me).
1819         
1820         * bridge/mac/FrameMac.mm:
1821         (WebCore::FrameMac::sendContextMenuEvent):
1822
1823 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1824
1825         Reviewed by Maciej.
1826
1827         Make JavaScriptCore a public framework. Adjusted the paths.
1828
1829         * WebCore.xcodeproj/project.pbxproj:
1830
1831 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1832
1833         Reviewed by Hyatt.
1834
1835         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1836         
1837         I also fixed all the similar crash / assertion failure cases I could think of.
1838
1839         * dom/Node.cpp:
1840         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1841         * dom/Node.h:
1842         * rendering/RenderTable.cpp:
1843         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1844         an HTML document, since we don't need that quirk and because parsing won't
1845         do certain render tree fixups. Also watch out for case when inserting before
1846         the renderer of a misnested child.
1847         * rendering/RenderTableRow.cpp:
1848         (WebCore::RenderTableRow::addChild): ditto
1849         * rendering/RenderTableSection.cpp:
1850         (WebCore::RenderTableSection::addChild): ditto
1851
1852 2006-07-13  Adele Peterson  <adele@apple.com>
1853
1854         Reviewed by Maciej.
1855
1856         - Fix for <rdar://problem/4604703> 
1857         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1858
1859         Test:
1860         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1861
1862         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1863         If we're about to set a selection in the current view, make sure its the first responder.
1864         In this case, this will cause the password field to resign first responder at the right time.
1865
1866 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1867
1868         Reviewed by Hyatt.
1869
1870         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1871           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1872
1873         Test: fast/text/international/rtl-white-space-pre-wrap.html
1874
1875         * rendering/RenderText.cpp:
1876         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1877         of clipping the caret position to the text box when the caret is after
1878         the trailing space of an autowrapped line.
1879         * rendering/bidi.cpp:
1880         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1881         to-fit the logically last text box if it contains the trailing spaces of an
1882         autowrapped line. 
1883         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1884         In the case of autowrapped text with white space that overflows beyond the line,
1885         the last text run is the one containing the overflowing white space.
1886         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1887         line that autowraps only after white space into a separate text run.
1888
1889 2006-07-13  David Harrison  <harrison@apple.com>
1890
1891         Reviewed by Dave Hyatt.
1892
1893         <rdar://problem/4624203> -webkit-highlight should be behind images
1894
1895         * rendering/RenderImage.cpp:
1896         (WebCore::RenderImage::paint):
1897         * rendering/RenderListMarker.cpp:
1898         (WebCore::RenderListMarker::paint):
1899         * rendering/RenderWidget.cpp:
1900         (WebCore::RenderWidget::paint):
1901         Call custom highlighter before painting the image, marker, or widget.
1902
1903 2006-07-13  David Harrison  <harrison@apple.com>
1904
1905         Reviewed by Justin and Levi.
1906
1907         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1908
1909         * Tests:
1910         editing/deleting/delete-by-word-001.html
1911         editing/deleting/delete-by-word-002.html
1912
1913         * editing/TypingCommand.cpp:
1914         (WebCore::TypingCommand::deleteKeyPressed):
1915         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1916         (WebCore::TypingCommand::doApply):
1917         * editing/TypingCommand.h:
1918         Delete and forward delete to use specified granularity.
1919         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1920         
1921         * page/Frame.cpp:
1922         (WebCore::Frame::setSelection):
1923         Close typing and end style even if selection is not changing.
1924         * page/Frame.h:
1925         Remove unused setSelection parameter keepTypingStyle.
1926
1927 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1928
1929         Reviewed by justin
1930
1931         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1932
1933         * editing/DeleteSelectionCommand.cpp:
1934         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1935         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1936         instead of enclosingBlockFlowElement.
1937         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1938         when the start or end block is removed.
1939         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1940         to keep things like HRs from being given children.
1941         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1942         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1943         * editing/TypingCommand.cpp:
1944         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1945         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1946         * editing/htmlediting.cpp:
1947         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1948         * editing/visible_units.cpp:
1949         (WebCore::startOfParagraph): Fix for HRs and tables.
1950         (WebCore::endOfParagraph): Ditto.
1951
1952 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1953
1954         Reviewed by Darin.
1955
1956         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1957           Memory leaks running DOM-Hanoi
1958
1959         No change in behavior, thus no test included.
1960
1961         * bridge/mac/FrameMac.mm:
1962         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1963         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1964
1965 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1966
1967         Reviewed by Adele.
1968
1969         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
1970           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
1971         - see also <rdar://problem/4622407>
1972
1973         Test: fast/frames/repaint-display-none-crash.html
1974
1975         * rendering/RenderView.cpp:
1976         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
1977         renderer, which can be null if the iframe is set to display:none.
1978
1979 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
1980
1981         Reviewed by levi
1982         
1983         <rdar://problem/4509393>
1984         selected DOM range starts with <object>, 0 offset but selection should include the <object>
1985
1986         * editing/ReplaceSelectionCommand.cpp:
1987         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
1988         Don't pull content out of a table cell.
1989         * editing/htmlediting.cpp:
1990         (WebCore::editingIgnoresContent): Added <select> nodes.
1991         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
1992         for more types of nodes.
1993         * rendering/RenderContainer.cpp:
1994         (WebCore::RenderContainer::positionForCoordinates): 
1995         Fix a crasher when right clicking on an anonymous table.
1996
1997 2006-07-12  John Sullivan  <sullivan@apple.com>
1998
1999         Reviewed by Brady Eidson
2000         
2001         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
2002         misspelled words (WebCore::RenderObject::repaint(bool)
2003
2004         * dom/Document.cpp:
2005         (WebCore::Document::removeMarkers):
2006         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
2007         happening. One of the cases like this was fixed a while back, but other cases were
2008         either missed at that time or crept in since. 
2009
2010 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
2011
2012         Reviewed by Justin.
2013
2014         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
2015         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
2016         
2017         * dom/Document.cpp:
2018         (WebCore::Document::updateSelection):
2019         Don't return early if the selection is empty.
2020
2021 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2022
2023         Reviewed by Adele.
2024
2025         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
2026         
2027         * bridge/mac/FrameMac.mm:
2028         (WebCore::FrameMac::dispatchCPPEvent):
2029         If the element is a shadow node, dispatch the event to its real parent.
2030
2031         * manual-tests/textarea-onpaste.html: Added.
2032
2033 2006-07-12  Beth Dakin  <bdakin@apple.com>
2034
2035         Reviewed by Anders.
2036
2037         Fix for layout test regressions after my check-in last night. Just 
2038         a silly mistake where I should have asked if we were NOT printing 
2039         instead of if we were in the listbox code.
2040
2041         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2042         XCode 2.3
2043         * platform/mac/ListBoxMac.mm:
2044         (itemTextRenderer): Inverted check.
2045         (groupLabelTextRenderer): Inverted check.
2046
2047 2006-07-12  Darin Adler  <darin@apple.com>
2048
2049         Reviewed by Maciej.
2050
2051         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2052           <rdar://problem/4622622>
2053           REGRESSION: Large rowspan causes WebKit to call abort()
2054
2055         Test: fast/table/large-rowspan-crash.html
2056
2057         * rendering/RenderTableSection.cpp:
2058         (WebCore::RenderTableSection::ensureRows):
2059         Use sizeof(RowStruct) instead of sizeof(int).
2060         Clearly we'll need something better to solve this completely.
2061         I expect another smaller, but still huge, value will still cause a problem.
2062
2063 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2064
2065         Reviewed by Maciej.
2066
2067         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2068
2069         * bridge/mac/FrameMac.h:
2070         Add focusCallResultedInViewBeingCreated argument. 
2071         
2072         * bridge/mac/FrameMac.mm:
2073         (WebCore::FrameMac::nextKeyViewInFrame):
2074         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2075         
2076         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2077         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2078         a text field as the first responder if its field editor already is the current first responder.
2079         
2080         * page/FrameView.cpp:
2081         (WebCore::FrameView::handleMousePressEvent):
2082         In some cases, get the event target node again after dispatching the mouse event.
2083
2084 2006-07-12  Beth Dakin  <bdakin@apple.com>
2085
2086         Reviewed by Adele.
2087
2088         Fix for <rdar://problem/4615765> Input[type='search' fields 
2089         initially render too large in Widgets
2090
2091         Fundamentally, the problem here is that we were miscalculating 
2092         things because [NSGraphicsContext currentContextDrawingToScreen] 
2093         was evaluating to false when widgets first load. We only ever used 
2094         this check, however, to determine if we were printing or not, so it 
2095         should not have evaluated to false for loading in Dashbaord. 
2096         Instead, if we query the RenderView about whether or not we are 
2097         printing, we will get the right answer.
2098
2099         No test case added since this appears only to affect Dashboard.
2100
2101         * bridge/mac/WebCoreFrameBridge.mm:
2102         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2103         printing instead. This is not part of the actual bug fix, but it 
2104         seems wise to get rid of all calls to [NSGraphicsContext 
2105         currentContextDrawingToScreen] when we are just trying to determine 
2106         if we are printing or not.
2107         * platform/mac/ListBoxMac.mm:
2108         (itemTextRenderer):This function now takes a boolean, isPrinting.
2109         (groupLabelTextRenderer): Same as above.
2110         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2111         printing.
2112         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2113         * platform/mac/PopUpButtonMac.mm:
2114         (PopUpButton::sizeHint): Same as above.
2115         * platform/mac/TextFieldMac.mm:
2116         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2117         * rendering/RenderLineEdit.cpp: Same as above.
2118
2119 2006-07-12  Adele Peterson  <adele@apple.com>
2120
2121         Reviewed by Maciej.
2122
2123         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2124         OPTION text can paint over select element's scrollbar
2125
2126         Test: fast/forms/option-text-clip.html
2127
2128         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2129         When calculating the clip to apply to the button text, also consider padding.
2130         In the future, we may have separate renderers for the text part, and the arrow part
2131         of the control, and then the separation should be natural.  For now, we use padding.
2132
2133 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2134
2135         Windows build fix.  Reviewed by NOBODY.
2136
2137         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2138         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2139
2140 2006-07-11  Darin Adler  <darin@apple.com>
2141
2142         Reviewed by Adele.
2143
2144         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2145           <rdar://problem/4619515>
2146           focus ring fails to appear on select element after choosing item from popup
2147
2148         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2149           improvements to select element, including some storage leak fixes
2150
2151         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2152         reference for the list items, so we don't have to copy a vector.
2153         * html/HTMLSelectElement.cpp:
2154         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2155         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2156         (WebCore::HTMLSelectElement::length): Ditto.
2157         (WebCore::HTMLSelectElement::remove): Ditto.
2158         (WebCore::HTMLSelectElement::value): Ditto.
2159         (WebCore::HTMLSelectElement::setValue): Ditto.
2160         (WebCore::HTMLSelectElement::stateValue): Ditto.
2161         (WebCore::HTMLSelectElement::restoreState): Ditto.
2162         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2163         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2164         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2165         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2166         fields mutable.
2167         (WebCore::HTMLSelectElement::reset): Use a const reference for
2168         the list items, so we don't have to copy the vector. Remove the call to
2169         setSelectionChanged for the RenderMenuList case.
2170         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2171         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2172         the pop-up.
2173         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2174         Changed the listItems function to return a const reference to the vector so
2175         it no longer copies the vector. Removed the const_cast to the call to
2176         recalcListItems and changed it to a const member function. Made m_recalcListItems
2177         mutable.
2178         * rendering/DeprecatedRenderSelect.cpp:
2179         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2180         to recalcListItems, which is called automatically. Use a const reference for the
2181         list items so we don't have to copy a vector.
2182         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2183         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2184         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2185         * rendering/RenderMenuList.cpp:
2186         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2187         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2188         (WebCore::RenderMenuList::addChild): Ditto.
2189         (WebCore::RenderMenuList::removeChild): Ditto.
2190         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2191         on the pop-up menu, because it's created with the correct style and destroyed
2192         before it a style change could occur.
2193         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2194         maximum width in a simpler fashion, and to not bother trying to maintain
2195         the "selected" flags on the elements, since the HTMLSelectElement class
2196         takes care of that. Store the width as an int. Call setText to set the text
2197         based on the selected element's option text.
2198         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2199         up the clip -- always set up the clip.
2200         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2201         instead of calling ceilf on m_longestWidth.
2202         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2203         menu -- instead keep the pointer in a local variable. Get the selected
2204         index from the HTMLSelectElement.
2205         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2206         to do most of the work.
2207         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2208         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2209         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2210         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2211         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2212         hasPopupMenu functions. Removed extra includes.
2213         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2214         Change to iterate the list items instead of iterating all children
2215         of the select node.
2216         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2217         * rendering/RenderPopupMenuMac.mm:
2218         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2219         the pop-up here from the caller. Removed an extra retain that would cause
2220         the NSPopUpButtonCell to leak.
2221         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2222         create the pop-up, which is now in populate, and also the call to the
2223         clear function, for the same reason. Reorganized code to make it a bit
2224         more readable. Removed an unnecessary if to check if frame is nil.
2225         Used a RefPtr to make sure we don't make a call on a frame after it's
2226         deleted. As part of the reorganization fixed a problem where we'd retain
2227         the event and then return early without releasing it in one case.
2228         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2229         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2230         manage the NSMenu at the bottom of the function.
2231         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2232
2233 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2234
2235         Reviewed by levi
2236         
2237         <rdar://problem/4620686>
2238         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2239
2240         * bridge/mac/FrameMac.mm:
2241         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2242         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2243         
2244
2245 2006-07-11  Tim Omernick  <timo@apple.com>
2246
2247         Reviewed by NOBODY (build fix)
2248
2249         * bindings/objc/DOMPrivate.h:
2250         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2251         there is of a different type.
2252         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2253         before landing.
2254
2255 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2256
2257         Reviewed by Geoff.
2258
2259         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2260         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2261         
2262         * html/HTMLTokenizer.cpp:
2263         (WebCore::HTMLTokenizer::scriptHandler):
2264         Don't load external scripts if the parser is stopped.
2265         
2266         * manual-tests/open-close-tokenizer-crash.html: Added.
2267         * manual-tests/resources/empty-file.js: Added.
2268         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2269         Add manual test.
2270
2271 2006-07-11  John Sullivan  <sullivan@apple.com>
2272
2273         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2274
2275         - added support for creating a selection image with white text
2276
2277         * rendering/RenderObject.h:
2278         (WebCore::):
2279         add PaintRestriction enum
2280         (WebCore::RenderObject::PaintInfo::PaintInfo):
2281         add forceWhiteText boolean to PaintInfo struct
2282
2283         * page/FramePrivate.h:
2284         (WebCore::FramePrivate::FramePrivate):
2285         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2286         text to white
2287
2288         * page/Frame.cpp:
2289         (WebCore::Frame::paint):
2290         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2291
2292         * bridge/mac/FrameMac.h:
2293         * bridge/mac/FrameMac.mm:
2294         (WebCore::FrameMac::selectionImage):
2295         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2296
2297         * bridge/mac/WebCoreFrameBridge.h:
2298         * bridge/mac/WebCoreFrameBridge.mm:
2299         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2300         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2301         down into Frame
2302
2303         * rendering/RenderLayer.h:
2304         * rendering/RenderLayer.cpp:
2305         (WebCore::RenderLayer::paint):
2306         use a PaintRestriction value where we used to use a selectionOnly bool
2307         (WebCore::RenderLayer::paintLayer):
2308         ditto; also stores forceWhiteText in PaintInfo struct
2309
2310         * kcanvas/KCanvasResources.cpp:
2311         (WebCore::KCanvasMarker::draw):
2312         updated for changed signature of PaintInfo constructor
2313
2314         * ksvg2/svg/SVGMaskElement.cpp:
2315         (WebCore::SVGMaskElement::drawMaskerContent):
2316         ditto
2317
2318         * ksvg2/svg/SVGPatternElement.cpp:
2319         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2320         ditto
2321
2322         * rendering/InlineTextBox.cpp:
2323         (WebCore::InlineTextBox::paint):
2324         paint with white text color if forceWhiteText is set in PaintInfo struct
2325
2326 2006-07-11  Tim Omernick  <timo@apple.com>
2327
2328         Reviewed by Anders.
2329
2330         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2331         Give Netscape plug-ins access to their own DOM element
2332
2333         * html/HTMLPlugInElement.h:
2334         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2335         Changed __APPLE__ to PLATFORM(MAC).
2336         Added m_NPObject ivar.
2337         * html/HTMLPlugInElement.cpp:
2338         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2339         Initialize the NPObject.
2340         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2341         Release the NPObject when the element is destroyed.
2342         (WebCore::HTMLPlugInElement::createNPObject):
2343         Creates an NPObject for the element.
2344         (WebCore::HTMLPlugInElement::getNPObject):
2345         Returns the NPObject for the element, creating and caching it if necessary.
2346
2347         * html/HTMLAppletElement.h:
2348         Changed __APPLE__ to PLATFORM(MAC).
2349         * html/HTMLAppletElement.cpp:
2350         ditto
2351         * html/HTMLEmbedElement.h:
2352         ditto
2353         * html/HTMLEmbedElement.cpp:
2354         ditto
2355         * html/HTMLObjectElement.h:
2356         ditto
2357         * html/HTMLObjectElement.cpp:
2358         ditto
2359
2360         * bindings/objc/DOMPrivate.h:
2361         Added -[DOMElement _NPObject].
2362
2363         * bindings/objc/DOM.mm:
2364         (-[DOMElement _NPObject]):
2365         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2366         the NPObject for applet, embed, and object elements.
2367         
2368 2006-07-11  Adele Peterson  <adele@apple.com>
2369
2370         Reviewed by Hyatt.
2371
2372         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2373         REGRESSION: Can't dynamically change list box to popup
2374         
2375         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2376         REGRESSION: Can't dynamically change popup to list box
2377
2378         The original fix for 9859 was in the renderer, and I think we can catch the change
2379         earlier in the element to detach and reattach.
2380
2381         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2382
2383         Test: fast/forms/select-change-listbox-to-popup.html
2384
2385         * html/HTMLSelectElement.cpp:
2386         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2387         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2388         when we attach.
2389         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2390         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2391         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2392         (WebCore::HTMLSelectElement::createRenderer): ditto.
2393         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2394         (WebCore::HTMLSelectElement::reset): ditto.
2395         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2396         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2397
2398         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2399         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2400         to determine whether or not to use the new menu list implementation.
2401
2402         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2403         * rendering/DeprecatedRenderSelect.cpp:
2404         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2405         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2406         (WebCore::DeprecatedRenderSelect::updateFromElement):
2407         (WebCore::DeprecatedRenderSelect::baselinePosition):
2408         (WebCore::DeprecatedRenderSelect::layout):
2409         (WebCore::DeprecatedRenderSelect::updateSelection):
2410
2411         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2412         Backed out previous fix since this is now done in HTMLSelectElement.
2413
2414 2006-07-11  Adele Peterson  <adele@apple.com>
2415
2416         Reviewed by Hyatt.
2417
2418         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2419         REGRESSION: Can't dynamically change popup to list box
2420
2421         Test: fast/forms/select-change-popup-to-listbox.html
2422
2423         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2424         If the select element has the multiple property set, or has a size > 1, then it
2425         really should be a list box, so we detach and attach the element so it creates the
2426         correct type of renderer.
2427
2428 2006-07-11  John Sullivan  <sullivan@apple.com>
2429
2430         Reviewed by Beth Dakin and Tim Omernick
2431
2432         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2433         at non-integral scale factors
2434
2435         * bridge/mac/FrameMac.mm:
2436         (WebCore::FrameMac::imageFromRect):
2437         round image rect in window coordinate space
2438
2439 2006-07-10  Darin Adler  <darin@apple.com>
2440
2441         Reviewed by Geoff.
2442
2443         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2444           rdar://problem/4619572
2445           OPTION text contained in OPTGROUP appears at the wrong size
2446
2447         * dom/Node.h:
2448         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2449         The derived classes were overriding with const member functions, and I could
2450         change either this or the derived -- decided to do this.
2451
2452 2006-07-10  Darin Adler  <darin@apple.com>
2453
2454         Reviewed by Geoff.
2455
2456         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2457           rdar://problem/4619534
2458           OPTGROUP label text is using the default font instead of Lucida Grande
2459
2460         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2461         Code wants the family name, but was calling fontName, which is not the same thing.
2462         Also removed the unneeded conversion to DeprecatedString.
2463
2464 === Safari-521.16 ===
2465
2466 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2467
2468         Reviewed by Darin.
2469
2470         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2471           Implement select.options.add() method
2472
2473         Tests:
2474         - fast/dom/select-selectedIndex-multiple.html
2475         - fast/dom/select-selectedIndex.html
2476         - fast/js/select-options-add.html
2477
2478         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2479         * ForwardingHeaders/kjs/operations.h: Added.
2480         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2481         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2482         (WebCore::JSHTMLOptionsCollection::length):
2483         (WebCore::JSHTMLOptionsCollection::setLength):
2484         (WebCore::JSHTMLOptionsCollection::indexSetter):
2485         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2486         Renamed classes and methods for consistency.
2487         (KJS::JSHTMLElement::selectGetter):
2488         (KJS::JSHTMLElement::put):
2489         (KJS::JSHTMLElement::selectSetter):
2490         (KJS::JSHTMLCollection::JSHTMLCollection):
2491         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2492         (KJS::getHTMLOptionsCollection):
2493         * bindings/js/kjs_html.h: Ditto.
2494         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2495         Added support for Optional parameter attribute, which makes generated code assume overloaded
2496         implementation methods are available for a JavaScript function with optional arguments.  Changed
2497         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2498         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2499         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2500         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2501         (WebCore::HTMLOptionsCollection::add):
2502         (WebCore::HTMLOptionsCollection::selectedIndex):
2503         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2504         (WebCore::HTMLOptionsCollection::setLength):
2505         * html/HTMLOptionsCollection.h: Ditto.
2506         * html/HTMLOptionsCollection.idl: Added.
2507
2508 2006-07-10  David Harrison  <harrison@apple.com>
2509
2510         Reviewed by Dave Hyatt.
2511
2512         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2513
2514         * rendering/RenderBox.cpp:
2515         (WebCore::RenderBox::paintCustomHighlight):
2516         * rendering/RenderBox.h:
2517         Utility for subclasses.
2518         
2519         * rendering/RenderImage.cpp:
2520         (WebCore::RenderImage::paint):
2521         Custom highlight in front of images.
2522         
2523         * rendering/RenderListMarker.cpp:
2524         (WebCore::RenderListMarker::paint):
2525         Custom highlight in front of list markers.
2526
2527         * rendering/RenderWidget.cpp:
2528         (WebCore::RenderWidget::paint):
2529         Custom highlight in front of objects.
2530
2531 2006-07-10  David Hyatt  <hyatt@apple.com>
2532
2533         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2534         correctly after choosing Redo Typing
2535
2536         Better fix for repainting issue with positioned objects when height
2537         changes.  Optimize when only a positioned child changes so that we don't
2538         incorrectly do normal flow layout.
2539
2540         Reviewed by darin
2541
2542         * WebCore.xcodeproj/project.pbxproj:
2543         * rendering/RenderBlock.cpp:
2544         (WebCore::RenderBlock::layoutBlock):
2545         * rendering/RenderFlexibleBox.cpp:
2546         (WebCore::RenderFlexibleBox::layoutBlock):
2547         * rendering/RenderTable.cpp:
2548         (WebCore::RenderTable::layout):
2549         * rendering/RenderView.cpp:
2550         (WebCore::RenderView::layout):
2551         * rendering/bidi.cpp:
2552         (WebCore::RenderBlock::layoutInlineChildren):
2553
2554 2006-07-10  Adele Peterson  <adele@apple.com>
2555
2556         Reviewed by Beth.
2557
2558         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2559
2560         Test: fast/forms/select-style.html
2561
2562         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2563         Don't let popups be style-able for now.  We'll allow it later, when we
2564         have a good way to handle border & backgrounds and still having it look like a control.
2565
2566 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2567
2568         Reviewed by harrison
2569         
2570         <rdar://problem/4619260>
2571         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2572         <rdar://problem/4619841>
2573         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2574
2575         * WebCore.xcodeproj/project.pbxproj:
2576         * editing/Selection.cpp:
2577         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2578         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2579         Migrate to isEditablePosition instead of isContentEditable.
2580         
2581
2582 2006-07-10  Beth Dakin  <bdakin@apple.com>
2583
2584         Reviewed by Adele.
2585
2586         Shuffling comments around from my last check-in to make things read 
2587         more clearly.
2588
2589         * page/DOMWindow.h:
2590         * page/DOMWindow.idl:
2591
2592 2006-07-10  Beth Dakin  <bdakin@apple.com>
2593
2594         Reviewed by Darin.
2595
2596         Fix for <rdar://problem/4621095> The should be a way to 
2597         access the user interface scale factor through the DOM
2598
2599         window.devicePixelRatio returns the user interface scale factor.
2600
2601         * page/DOMWindow.cpp:
2602         (WebCore::DOMWindow::devicePixelRatio):
2603         * page/DOMWindow.h:
2604         * page/DOMWindow.idl:
2605
2606 2006-07-10  Brady Eidson  <beidson@apple.com>
2607
2608         Reviewed by Alexey
2609
2610         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2611
2612         * icon/IconDatabase.cpp:
2613         (WebCore::IconDatabase::pruneUnreferencedIcons):
2614         (WebCore::IconDatabase::pruneUnretainedIcons):
2615         Added quick check to bail if the DB isn't open
2616
2617 2006-07-10  David Harrison  <harrison@apple.com>
2618
2619         Reviewed by Tim Hatcher
2620
2621         Partial fix for...
2622         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2623         
2624         * editing/Selection.cpp:
2625         (WebCore::Selection::adjustForEditableContent):
2626         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2627
2628 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2629
2630         Reviewed by Darin.
2631
2632         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2633           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2634
2635         * manual-tests/ATSU-bad-layout.html: Added.
2636         * platform/mac/FontMac.mm:
2637         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2638
2639 2006-07-10  Darin Adler  <darin@apple.com>
2640
2641         - try to fix the no-SVG build
2642
2643         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2644
2645 2006-07-10  Darin Adler  <darin@apple.com>
2646
2647         Reviewed by Anders.
2648
2649         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2650           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2651
2652         * manual-tests/empty-title-popup.html: Added.
2653
2654         * rendering/RenderMenuList.h: Add createInnerBlock.
2655         * rendering/RenderMenuList.cpp:
2656         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2657         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2658         (WebCore::RenderMenuList::setText): Changed parameter type.
2659         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2660         the parent class's addChild.
2661
2662 2006-07-10  Rob Buis  <buis@kde.org>
2663
2664         Reviewed by Maciej via IRC.
2665
2666         Make sure the attributes are calculated against viewport width value,
2667         as defined in the spec.  http://paste.lisp.org/display/22342
2668
2669         * ksvg2/svg/SVGEllipseElement.cpp:
2670         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2671         * ksvg2/svg/SVGLineElement.cpp:
2672         (SVGLineElement::x2): Ditto.
2673
2674 2006-07-10  Beth Dakin  <bdakin@apple.com>
2675
2676         Reviewed by Maciej.
2677
2678         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2679         for images
2680
2681         This patch provides initial support for the CSS3 content property. 
2682         It lacks support for any content other than images, and only allows 
2683         content for elements that seemed safe for now.
2684
2685         * css/cssstyleselector.cpp:
2686         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2687         just :before and :after
2688         * html/HTMLBRElement.cpp:
2689         (WebCore::HTMLBRElement::createRenderer):
2690         * html/HTMLFrameSetElement.cpp:
2691         (WebCore::HTMLFrameSetElement::createRenderer):
2692         * html/HTMLImageElement.cpp:
2693         (WebCore::HTMLImageElement::createRenderer):
2694         * html/HTMLLegendElement.cpp:
2695         (WebCore::HTMLLegendElement::createRenderer):
2696         * rendering/RenderImage.cpp:
2697         (WebCore::RenderImage::RenderImage):
2698         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2699         set this way if it was already set with the content property.
2700         * rendering/RenderImage.h:
2701         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2702         those set through the content property.
2703         (WebCore::RenderImage::isAnonymousImage):
2704         * rendering/RenderObject.cpp:
2705         (WebCore::RenderObject::createObject): If there is content 
2706         specified, create a RenderImage with the content and initialize the 
2707         cached image to whatever was specified in the CSS.
2708
2709 2006-07-10  Brady Eidson  <beidson@apple.com>
2710
2711         Reviewed by NOBODY (Build Fix!)
2712
2713         * icon/SiteIcon.cpp:
2714         (SiteIcon::getImage):
2715         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2716
2717 2006-07-10  Brady Eidson  <beidson@apple.com>
2718
2719         Reviewed by Maciej
2720
2721         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2722         information out to keep down disk usage.  For now, it is still off by default, as the critical
2723         feature of importing old icons into the new DB is still unrealized.
2724         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2725
2726         * icon/IconDatabase.cpp:
2727         (WebCore::IconDatabase::IconDatabase):
2728         (WebCore::IconDatabase::open):
2729           -Sets up a timer for initial pruning
2730         (WebCore::IconDatabase::iconForPageURL):
2731           -Switched away from "dirty blob hack" as the problem is provisionally solved
2732         (WebCore::IconDatabase::retainIconForURL):
2733         (WebCore::IconDatabase::releaseIconForURL):
2734           -Same as found in WebKit
2735         (WebCore::IconDatabase::totalRetainCountForIconURL):
2736           -Adds up all retainers of icon
2737         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2738           -Wipes an Icon table entry out
2739         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2740         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2741         (WebCore::IconDatabase::establishIconIDForIconURL):
2742         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2743           -Added ability to get an iconID without creating a new one if a lookup is all
2744            that is genuinely wanted
2745         (WebCore::IconDatabase::pruneUnreferencedIcons):
2746         (WebCore::IconDatabase::pruneUnretainedIcons):
2747           -Called on a timer on DB startup to clean it out
2748         * icon/IconDatabase.h:
2749         * icon/SiteIcon.cpp:
2750         (SiteIcon::SiteIcon):
2751         (SiteIcon::~SiteIcon):
2752           -Deletes the image on deletion
2753         (SiteIcon::getImage):
2754           -Cut down on no-longer-necessary debug info
2755
2756 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2757
2758         Reviewed by Adele.
2759
2760         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2761         Quirksmode: Incorrect handling of disabled BUTTON elements
2762
2763         * html/HTMLButtonElement.cpp:
2764         (WebCore::HTMLButtonElement::defaultEventHandler):
2765         Don't call prepareSubmit if the element is disabled.
2766
2767         * html/HTMLInputElement.cpp:
2768         (WebCore::HTMLInputElement::defaultEventHandler):
2769         Don't call prepareSubmit if the element is disabled.
2770
2771 2006-07-10  Darin Adler  <darin@apple.com>
2772
2773         - try to fix Windows build
2774
2775         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2776         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2777
2778 2006-07-10  Darin Adler  <darin@apple.com>
2779
2780         Reviewed by Geoff.
2781
2782         - fix failures seen in layout tests
2783
2784         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2785         that really needed to be there -- because we have two classes named JSHTMLDocument
2786         at the moment! (One in KJS and one in WebCore namespace.)
2787
2788 2006-07-10  Darin Adler  <darin@apple.com>
2789
2790         - try to fix Windows build
2791
2792         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2793
2794 2006-07-09  Adele Peterson  <adele@apple.com>
2795
2796         Reviewed by Maciej.
2797
2798         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2799
2800         * css/html4.css: Added style for new selects, and for list boxes.
2801         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2802    
2803         * rendering/RenderMenuList.cpp:
2804         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2805         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2806         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2807
2808         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2809         so RenderThemeMac will compute its baseline.
2810         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2811         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2812         Removed sizeOfArrowControl. 
2813         * rendering/RenderThemeMac.mm:
2814         (WebCore::): Added enum for padding.
2815         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2816         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2817         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2818         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2819         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2820         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2821         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2822         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2823         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2824         (WebCore::RenderThemeMac::minimumTextSize): Added.
2825
2826 2006-07-09  Darin Adler  <darin@apple.com>
2827
2828         - add back "unused code" for plain text fields, still used by <isindex>!
2829
2830         * platform/TextField.h:
2831         * platform/mac/TextFieldMac.mm:
2832         * platform/mac/WebCoreTextField.h:
2833         * platform/mac/WebCoreTextField.mm:
2834         * rendering/RenderLineEdit.cpp:
2835
2836 2006-07-09  Darin Adler  <darin@apple.com>
2837
2838         Reviewed by Tim Hatcher.
2839
2840         - put more into the WebCore namespace
2841         - removed unused code for plain text fields
2842
2843         Put more classes, class templates, enums, functions, and constants into
2844         the WebCore namespace, including all the headers in the platform directory.
2845
2846         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2847
2848         Added some "WebCore::" qualifiers in a few places.
2849
2850         Removed "uses WebCore::" in headers that we said we'd remove "when
2851         everything is in the WebCore namespace".
2852
2853         * bindings/js/JSDOMParser.cpp:
2854         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2855         * bindings/js/JSXSLTProcessor.cpp:
2856         * bindings/js/kjs_binding.cpp:
2857         * bindings/js/kjs_css.cpp:
2858         * bindings/js/kjs_dom.cpp:
2859         * bindings/js/kjs_dom.h:
2860         * bindings/js/kjs_events.cpp:
2861         * bindings/js/kjs_proxy.h:
2862         * bindings/js/kjs_window.h:
2863         * bindings/objc/DOM.mm:
2864         * bridge/History.h:
2865         * bridge/JavaAppletWidget.h:
2866         * bridge/mac/FormDataMac.h:
2867         * bridge/mac/FormDataMac.mm:
2868         * bridge/mac/WebCoreAXObject.mm:
2869         * bridge/mac/WebCoreEncodings.mm:
2870         * bridge/mac/WebCoreFrameBridge.h:
2871         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2872         * bridge/mac/WebCorePageState.h:
2873         * bridge/mac/WebCoreScriptDebugger.mm:
2874         * bridge/mac/WebCoreSettings.h:
2875         * css/CSSGrammar.y:
2876         * css/CSSPageRule.cpp:
2877         * css/CSSPageRule.h:
2878         * css/MediaList.cpp:
2879         * css/cssstyleselector.h:
2880         * dom/Clipboard.h:
2881         * dom/Document.cpp:
2882         * dom/Document.h:
2883         * dom/EventTargetNode.h:
2884         * dom/Node.cpp:
2885         * dom/Node.h:
2886         * dom/Position.h:
2887         * dom/Range.cpp:
2888         * dom/XMLTokenizer.cpp:
2889         * editing/AppendNodeCommand.h:
2890         * editing/ApplyStyleCommand.cpp:
2891         * editing/BreakBlockquoteCommand.cpp:
2892         * editing/BreakBlockquoteCommand.h:
2893         * editing/CompositeEditCommand.cpp:
2894         * editing/CompositeEditCommand.h:
2895         * editing/CreateLinkCommand.h:
2896         * editing/DeleteFromTextNodeCommand.h:
2897         * editing/DeleteSelectionCommand.h:
2898         * editing/FormatBlockCommand.h:
2899         * editing/HTMLInterchange.cpp:
2900         * editing/HTMLInterchange.h:
2901         * editing/IndentOutdentCommand.h:
2902         * editing/InsertIntoTextNodeCommand.h:
2903         * editing/InsertLineBreakCommand.h:
2904         * editing/InsertListCommand.h:
2905         * editing/InsertNodeBeforeCommand.h:
2906         * editing/InsertTextCommand.cpp:
2907         * editing/InsertTextCommand.h:
2908         * editing/JSEditor.cpp:
2909         * editing/JSEditor.h:
2910         * editing/JoinTextNodesCommand.h:
2911         * editing/MergeIdenticalElementsCommand.cpp:
2912         * editing/MergeIdenticalElementsCommand.h:
2913         * editing/ModifySelectionListLevel.h:
2914         * editing/MoveSelectionCommand.h:
2915         * editing/RebalanceWhitespaceCommand.h:
2916         * editing/RemoveNodeAttributeCommand.h:
2917         * editing/RemoveNodeCommand.h:
2918         * editing/RemoveNodePreservingChildrenCommand.h:
2919         * editing/ReplaceSelectionCommand.h:
2920         * editing/SetNodeAttributeCommand.h:
2921         * editing/SplitElementCommand.cpp:
2922         * editing/SplitElementCommand.h:
2923         * editing/SplitTextNodeCommand.cpp:
2924         * editing/SplitTextNodeCommand.h:
2925         * editing/SplitTextNodeContainingElementCommand.h:
2926         * editing/TypingCommand.cpp:
2927         * editing/TypingCommand.h:
2928         * editing/UnlinkCommand.h:
2929         * editing/VisiblePosition.cpp:
2930         * editing/WrapContentsInDummySpanCommand.cpp:
2931         * editing/WrapContentsInDummySpanCommand.h:
2932         * editing/markup.cpp:
2933         * editing/markup.h:
2934         * html/HTMLAnchorElement.cpp:
2935         * html/HTMLBodyElement.cpp:
2936         * html/HTMLButtonElement.h:
2937         * html/HTMLCollection.h:
2938         * html/HTMLDocument.h:
2939         * html/HTMLEmbedElement.cpp:
2940         * html/HTMLFormElement.cpp:
2941         * html/HTMLFormElement.h:
2942         * html/HTMLFrameElement.cpp:
2943         * html/HTMLFrameSetElement.cpp:
2944         * html/HTMLKeygenElement.cpp:
2945         * html/HTMLLabelElement.cpp:
2946         * html/HTMLObjectElement.cpp:
2947         * html/HTMLObjectElement.h:
2948         * html/HTMLTableElement.cpp:
2949         * html/HTMLTablePartElement.cpp:
2950         * icon/IconDatabase.h:
2951         * kcanvas/KCanvasPath.h:
2952         * kcanvas/KCanvasResources.cpp:
2953         * kcanvas/KCanvasResources.h:
2954         * kcanvas/KCanvasTreeDebug.cpp:
2955         * kcanvas/KCanvasTreeDebug.h:
2956         * kcanvas/RenderSVGContainer.cpp:
2957         * kcanvas/RenderSVGText.h:
2958         * kcanvas/device/KRenderingPaintServer.h:
2959         * kcanvas/device/KRenderingPaintServerGradient.h:
2960         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2961         * ksvg2/misc/SVGImageLoader.cpp:
2962         * ksvg2/svg/SVGElement.cpp:
2963         * ksvg2/svg/SVGElement.h:
2964         * ksvg2/svg/SVGForeignObjectElement.cpp:
2965         * ksvg2/svg/SVGForeignObjectElement.h:
2966         * ksvg2/svg/SVGImageElement.cpp:
2967         * ksvg2/svg/SVGPoint.h:
2968         * ksvg2/svg/SVGStylable.h:
2969         * ksvg2/svg/SVGTRefElement.cpp:
2970         * ksvg2/svg/SVGTRefElement.h:
2971         * ksvg2/svg/SVGTSpanElement.cpp:
2972         * ksvg2/svg/SVGTSpanElement.h:
2973         * ksvg2/svg/SVGTextElement.h:
2974         * ksvg2/svg/svgpathparser.cpp:
2975         * ksvg2/svg/svgpathparser.h:
2976         * loader/Cache.h:
2977         * loader/DocLoader.h:
2978         * loader/LoaderFunctions.h:
2979         * loader/mac/LoaderFunctionsMac.mm:
2980         * page/Frame.h:
2981         * page/FrameView.h:
2982         * page/Page.h:
2983         * page/Settings.h:
2984         * platform/AffineTransform.cpp:
2985         * platform/AffineTransform.h:
2986         * platform/Arena.cpp:
2987         * platform/Arena.h:
2988         * platform/CookieJar.h:
2989         * platform/DeprecatedCString.cpp:
2990         * platform/DeprecatedCString.h:
2991         * platform/DeprecatedPtrList.h:
2992         * platform/DeprecatedPtrListImpl.cpp:
2993         * platform/DeprecatedPtrListImpl.h:
2994         * platform/DeprecatedPtrQueue.h:
2995         * platform/DeprecatedString.cpp:
2996         * platform/DeprecatedString.h:
2997         * platform/DeprecatedStringList.cpp:
2998         * platform/DeprecatedStringList.h:
2999         * platform/DeprecatedValueList.h:
3000         * platform/DeprecatedValueListImpl.cpp:
3001         * platform/DeprecatedValueListImpl.h:
3002         * platform/FileButton.h:
3003         * platform/FloatPoint.h:
3004         * platform/FloatRect.h:
3005         * platform/FloatSize.h:
3006         * platform/FontData.h:
3007         * platform/FontFallbackList.h:
3008         * platform/GraphicsContext.h:
3009         * platform/IntPoint.h:
3010         * platform/IntRect.h:
3011         * platform/IntSize.h:
3012         * platform/KURL.cpp:
3013         * platform/KURL.h:
3014         * platform/ListBox.h:
3015         * platform/Logging.cpp:
3016         * platform/Logging.h:
3017         * platform/Pen.h:
3018         * platform/PopUpButton.h:
3019         * platform/RegularExpression.cpp:
3020         * platform/RegularExpression.h:
3021         * platform/SSLKeyGenerator.h:
3022         * platform/ScrollBar.h:
3023         * platform/SegmentedString.h:
3024         * platform/Shared.h:
3025         * platform/Slider.h:
3026         * platform/StringImpl.h:
3027         * platform/TextBox.h:
3028         * platform/TextField.h:
3029         * platform/TextStream.cpp:
3030         * platform/TextStream.h:
3031         * platform/TransferJob.h:
3032         * platform/TransferJobClient.h:
3033         * platform/Widget.h:
3034         * platform/cg/AffineTransformCG.cpp:
3035         * platform/mac/ClipboardMac.h:
3036         * platform/mac/ClipboardMac.mm:
3037         * platform/mac/DeprecatedStringListMac.mm:
3038         * platform/mac/FontCacheMac.mm:
3039         * platform/mac/KURLMac.mm:
3040         * platform/mac/ListBoxMac.mm:
3041         * platform/mac/PopUpButtonMac.mm:
3042         * platform/mac/SSLKeyGeneratorMac.mm:
3043         * platform/mac/TextBoxMac.mm:
3044         * platform/mac/TextFieldMac.mm:
3045         * platform/mac/WebCoreTextArea.h:
3046         * platform/mac/WebCoreTextArea.mm:
3047         * platform/mac/WebCoreTextField.h:
3048         * platform/mac/WebCoreTextField.mm:
3049         * rendering/DeprecatedRenderSelect.h:
3050         * rendering/RenderArena.cpp:
3051         * rendering/RenderArena.h:
3052         * rendering/RenderBlock.cpp:
3053         * rendering/RenderBox.cpp:
3054         * rendering/RenderContainer.cpp:
3055         * rendering/RenderFlexibleBox.cpp:
3056         * rendering/RenderFlow.cpp:
3057         * rendering/RenderLayer.cpp:
3058         * rendering/RenderLineEdit.cpp:
3059         * rendering/RenderObject.h:
3060         * rendering/RenderStyle.cpp:
3061         * rendering/RenderStyle.h:
3062         * rendering/RenderText.cpp:
3063         * rendering/RenderTextFragment.cpp:
3064         * rendering/RenderTheme.h:
3065         * rendering/RenderTreeAsText.cpp:
3066         * rendering/RenderTreeAsText.h:
3067         * rendering/RenderView.h:
3068         * rendering/bidi.h:
3069         * xml/XSLStyleSheet.cpp:
3070         * xml/XSLTProcessor.cpp:
3071
3072 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3073
3074         Reviewed by Beth.
3075
3076         * bindings/js/kjs_window.cpp:
3077         (KJS::Window::clear): Garbage collect after reinitalizing the global
3078         object, not before, since the reinitialization tends to create garbage.
3079
3080 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3081
3082         Reviewed by Darin.
3083
3084         Bug 9820: Move new DOM API that has been through API review to public headers
3085         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3086
3087         * bindings/objc/DOM.mm:
3088         (-[DOMElement focus]):
3089         (-[DOMElement blur]):
3090         (-[DOMRange text]):
3091         (-[DOMRange _text]):
3092         * bindings/objc/DOMCSS.mm:
3093         (-[DOMRGBColor color]):
3094         (-[DOMRGBColor _color]):
3095         * bindings/objc/DOMCore.h:
3096         * bindings/objc/DOMEvents.h:
3097         * bindings/objc/DOMExtensions.h:
3098         * bindings/objc/DOMHTML.mm:
3099         (-[DOMHTMLElement titleDisplayString]):
3100         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3101         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3102         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3103         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3104         * bindings/objc/DOMPrivate.h:
3105         * bindings/objc/DOMXPath.h:
3106         * bindings/objc/DOMXPath.mm:
3107
3108 2006-07-09  Beth Dakin  <bdakin@apple.com>
3109
3110         Reviewed by Maciej.
3111
3112         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3113         nested content editable div causes unnecessary screen redraws.
3114         
3115         We were repainting too much because we were deciding that we needed 
3116         a full layout because we didn't have a first line box. Our code 
3117         used to hold a lot of assumptions that positioned elements would 
3118         always have line boxes, but I fixed a few bugs a while back that 
3119         appeared because this assumption isn't true. This assumption was 
3120         also causing the extra redraws because the check meant that we 
3121         would decide to do a full layout for any positioned element that 
3122         did not have any line boxes in the first place. Maciej and I talked 
3123         about this, and we couldn't figure out why the check for line boxes 
3124         was part of determining if we need a full layout in the first 
3125         place. After hunting around the code, we decided to assume that 
3126         this check is antiquated. Removing it fixes the bug and doesn't 
3127         seem to break any layout tests. So, fingers crossed!
3128
3129         Will add layout test so soon.
3130
3131         * rendering/bidi.cpp:
3132         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3133         check.
3134
3135 2006-07-09  David Harrison  <harrison@apple.com>
3136
3137         Reviewed by John Sullivan.
3138
3139         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3140
3141         Test: fast/dom/delete-contents.html
3142         
3143         * dom/Range.cpp:
3144         (WebCore::Range::processContents):
3145
3146 2006-07-09  Darin Adler  <darin@apple.com>
3147
3148         - another round of renaming; and KWQ is dead
3149
3150         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3151         Move files to their new locations. Did rename.
3152         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3153         * WebCoreSources.bkl: Did rename.
3154         * webcore-base.bkl: Removed kwq.
3155
3156         * kwq/AccessibilityObjectCache.h: Removed.
3157         * kwq/AccessibilityObjectCache.mm: Removed.
3158         * kwq/FormDataMac.h: Removed.
3159         * kwq/FormDataMac.mm: Removed.
3160         * kwq/WebCoreAXObject.h: Removed.
3161         * kwq/WebCoreAXObject.mm: Removed.
3162         * kwq/WebCoreEditCommand.h: Removed.
3163         * kwq/WebCoreEditCommand.mm: Removed.
3164         * kwq/WebCorePageState.h: Removed.
3165         * kwq/WebCorePageState.mm: Removed.
3166         * kwq/WebCoreResourceLoaderImp.h: Removed.
3167         * kwq/WebCoreResourceLoaderImp.mm: Removed.
3168
3169         * bridge/AXObjectCache.h: Added.
3170         * bridge/mac/AXObjectCacheMac.mm: Added.
3171         * bridge/mac/WebCoreAXObject.h: Added.
3172         * bridge/mac/WebCoreAXObject.mm: Added.
3173
3174         * loader/CachedObject.cpp: Removed.
3175         * loader/CachedObject.h: Removed.
3176         * loader/CachedObjectClient.h: Removed.
3177         * loader/CachedObjectClientWalker.cpp: Removed.
3178         * loader/CachedObjectClientWalker.h: Removed.
3179
3180         * loader/CachedResource.cpp: Added.
3181         * loader/CachedResource.h: Added.
3182         * loader/CachedResourceClient.h: Added.
3183         * loader/CachedResourceClientWalker.cpp: Added.
3184         * loader/CachedResourceClientWalker.h: Added.
3185
3186         * bridge/mac/FrameMac.mm:
3187         * bridge/mac/WebCoreFrameBridge.mm:
3188         * css/CSSImageValue.h:
3189         * css/CSSImportRule.h:
3190         * dom/Document.cpp:
3191         * dom/Document.h:
3192         * dom/Notation.h:
3193         * dom/ProcessingInstruction.h:
3194         * dom/XMLTokenizer.cpp:
3195         * html/CanvasPattern.h:
3196         * html/HTMLDocument.h:
3197         * html/HTMLImageLoader.cpp:
3198         * html/HTMLImageLoader.h:
3199         * html/HTMLLinkElement.h:
3200         * html/HTMLScriptElement.cpp:
3201         * html/HTMLScriptElement.h:
3202         * html/HTMLTokenizer.cpp:
3203         * html/HTMLTokenizer.h:
3204         * kcanvas/KCanvasFilters.h:
3205         * ksvg2/svg/SVGCursorElement.cpp:
3206         * ksvg2/svg/SVGCursorElement.h:
3207         * ksvg2/svg/SVGFEImageElement.cpp:
3208         * ksvg2/svg/SVGFEImageElement.h:
3209         * loader/Cache.cpp:
3210         * loader/Cache.h:
3211         * loader/CachedCSSStyleSheet.cpp:
3212         * loader/CachedCSSStyleSheet.h:
3213         * loader/CachedImage.cpp:
3214         * loader/CachedImage.h:
3215         * loader/CachedScript.cpp:
3216         * loader/CachedScript.h:
3217         * loader/CachedXBLDocument.cpp:
3218         * loader/CachedXBLDocument.h:
3219         * loader/CachedXSLStyleSheet.cpp:
3220         * loader/CachedXSLStyleSheet.h:
3221         * loader/DocLoader.cpp:
3222         * loader/DocLoader.h:
3223         * loader/LoaderFunctions.h:
3224         * loader/Request.cpp:
3225         * loader/Request.h:
3226         * loader/loader.cpp:
3227         * loader/loader.h:
3228         * loader/mac/LoaderFunctionsMac.mm:
3229         * page/Frame.cpp:
3230         * page/FrameView.cpp:
3231         * platform/gdk/TemporaryLinkStubs.cpp:
3232         * platform/mac/ClipboardMac.h:
3233         * platform/win/TemporaryLinkStubs.cpp:
3234         * rendering/RenderBox.h:
3235         * rendering/RenderContainer.cpp:
3236         * rendering/RenderImage.cpp:
3237         * rendering/RenderImage.h:
3238         * rendering/RenderLayer.h:
3239         * rendering/RenderObject.cpp:
3240         * rendering/RenderObject.h:
3241         * rendering/RenderStyle.cpp:
3242         * rendering/RenderStyle.h:
3243         * xml/XSLImportRule.h:
3244         Did renaming.
3245
3246         * platform/mac/can-convert.mm: Removed.
3247
3248 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3249
3250         Reviewed by Tim O.
3251
3252         * WebCore.exp:
3253         Add wkPathFromFont.
3254         
3255         * platform/mac/FontDataMac.mm:
3256         (-[NSFont WebCore]):
3257         Use wkPathFromFont.
3258         
3259         * platform/mac/WebCoreSystemInterface.h:
3260         * platform/mac/WebCoreSystemInterface.mm:
3261         Declare wkPathFromFont.
3262
3263 2006-07-09  Brady Eidson  <beidson@apple.com>
3264
3265         Reviewed by Maciej
3266
3267         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3268         preparation for pruning unreferenced and unretained icons.
3269
3270         * icon/IconDatabase.cpp:
3271         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3272         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3273         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3274         (WebCore::IconDatabase::imageDataForIconURL):  same
3275         (WebCore::IconDatabase::imageDataForPageURL):  same
3276         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3277           by any PageURL
3278         * icon/IconDatabase.h:
3279
3280         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3281           a byte-buffer, and is what CFData expects
3282         * icon/SQLStatement.cpp:
3283         (WebCore::SQLStatement::getColumnBlobAsVector):
3284
3285 2006-07-09  Darin Adler  <darin@apple.com>
3286
3287         - move all but the last 12 files out of kwq directory
3288         - removed a few unused source files I discovered
3289
3290         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3291         * WebCore.xcodeproj/project.pbxproj: Ditto.
3292
3293         * bridge/mac/FrameMac.mm:
3294         * dom/Element.h:
3295         * html/HTMLImageLoader.cpp:
3296         * loader/Cache.cpp:
3297         * loader/Cache.h:
3298         * loader/CachedCSSStyleSheet.cpp:
3299         * loader/CachedCSSStyleSheet.h:
3300         * loader/CachedImage.cpp:
3301         * loader/CachedImage.h:
3302         * loader/CachedObject.h:
3303         * loader/CachedScript.cpp:
3304         * loader/CachedScript.h:
3305         * loader/CachedXBLDocument.cpp:
3306         * loader/CachedXBLDocument.h:
3307         * loader/CachedXSLStyleSheet.cpp:
3308         * loader/CachedXSLStyleSheet.h:
3309         * loader/DocLoader.cpp:
3310         * loader/DocLoader.h:
3311         * page/Frame.cpp:
3312         * page/Frame.h:
3313         * page/FramePrivate.h:
3314         * platform/gdk/TemporaryLinkStubs.cpp:
3315         * platform/win/TemporaryLinkStubs.cpp:
3316         * rendering/DeprecatedSlider.cpp:
3317         * rendering/RenderObject.h:
3318         * xml/xmlhttprequest.cpp:
3319         Updated includes as needed for file location changes. Changed
3320         CachePolicy uses to match new filename and enum names.
3321
3322         * loader/CachedResource.cpp: Removed.
3323         * loader/CachedResource.h: Removed.
3324         * loader/CachedResourceClient.h: Removed.
3325         * loader/CachedResourceClientWalker.cpp: Removed.
3326         * loader/CachedResourceClientWalker.h: Removed.
3327         The above files were checked in by accident a while back. The rename of
3328         CachedObject to CachedResource is now reflected in do-webcore-rename,
3329         and will be done soon.
3330
3331         * kwq/AffineTransform.cpp: Removed.
3332         * kwq/AffineTransform.h: Removed.
3333         * kwq/CacheControl.h: Removed.
3334         * kwq/DeprecatedPtrQueue.h: Removed.
3335         * kwq/FileButton.h: Removed.
3336         * kwq/FileButton.mm: Removed.
3337         * kwq/ListBox.h: Removed.
3338         * kwq/ListBox.mm: Removed.
3339         * kwq/LoaderFunctions.h: Removed.
3340         * kwq/LoaderFunctions.mm: Removed.
3341         * kwq/PopUpButton.h: Removed.
3342         * kwq/PopUpButton.mm: Removed.
3343         * kwq/SSLKeyGenerator.h: Removed.
3344         * kwq/SSLKeyGenerator.mm: Removed.
3345         * kwq/Settings.h: Removed.
3346         * kwq/TextBox.h: Removed.
3347         * kwq/TextBox.mm: Removed.
3348         * kwq/TextField.h: Removed.
3349         * kwq/TextField.mm: Removed.
3350         * kwq/WebCoreScrollBar.h: Removed.
3351         * kwq/WebCoreScrollBar.mm: Removed.
3352         * kwq/WebCoreSlider.h: Removed.
3353         * kwq/WebCoreSlider.mm: Removed.
3354
3355         * loader/CachePolicy.h: Added.
3356         * loader/LoaderFunctions.h: Added.
3357
3358         * loader/mac/LoaderFunctionsMac.mm: Added.
3359
3360         * page/Settings.h: Added.
3361
3362         * platform/AffineTransform.cpp: Added.
3363         * platform/AffineTransform.h: Added.
3364         * platform/DeprecatedPtrQueue.h: Added.
3365         * platform/FileButton.h: Added.
3366         * platform/ListBox.h: Added.
3367         * platform/PopUpButton.h: Added.
3368         * platform/SSLKeyGenerator.h: Added.
3369         * platform/ScrollBar.h: Added.
3370         * platform/Slider.h: Added.
3371         * platform/TextBox.h: Added.
3372         * platform/TextField.h: Added.
3373
3374         * platform/cg/AffineTransformCG.cpp: Added.
3375
3376         * platform/mac/FileButtonMac.mm: Added.
3377         * platform/mac/ListBoxMac.mm: Added.
3378         * platform/mac/PopUpButtonMac.mm: Added.
3379         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3380         * platform/mac/ScrollBarMac.mm: Added.
3381         * platform/mac/ScrollBarMac.mm: Added.
3382         * platform/mac/SliderMac.mm: Added.
3383         * platform/mac/SliderMac.mm: Added.
3384         * platform/mac/TextBoxMac.mm: Added.
3385         * platform/mac/TextFieldMac.mm: Added.
3386
3387 2006-07-09  Darin Adler  <darin@apple.com>
3388
3389         - move 4 files out of kwq directory
3390         - make some minor project adjustments for the WebCore project
3391
3392         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3393         libraries, rather than using a custom linker option. Moved the files from their
3394         old locations to the new ones. Removed "khtml" from the list of header search
3395         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3396         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3397         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3398         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3399         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3400         Removed the explicit -Y,3 option now that Xcode does that by default.
3401
3402         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3403         many of which didn't exist any more. Moved the files from their old locations
3404         to the new ones.
3405
3406         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3407
3408         * kwq/DeprecatedCString.cpp: Removed.
3409         * kwq/DeprecatedCString.h: Removed.
3410         * kwq/TextStream.cpp: Removed.
3411         * kwq/TextStream.h: Removed.
3412         * platform/DeprecatedCString.cpp: Added.
3413         * platform/DeprecatedCString.h: Added.
3414         * platform/TextStream.cpp: Added.
3415         * platform/TextStream.h: Added.
3416
3417 2006-07-09  Darin Adler  <darin@apple.com>
3418
3419         Rubber stamped by Maciej (kinda).
3420
3421         - did the next pass of renaming (used do-webcore-rename script)
3422           this takes care of most of the remaining KWQ names (almost all)
3423
3424         * WebCore+SVG/DOMList.h:
3425         * WebCore.vcproj/WebCore/WebCore.vcproj:
3426         * WebCore.xcodeproj/project.pbxproj:
3427         * WebCoreSources.bkl:
3428         * bindings/js/kjs_dom.cpp:
3429         * bindings/js/kjs_window.cpp:
3430         * bindings/objc/DOMHTML.mm:
3431         * bridge/mac/FrameMac.h:
3432         * bridge/mac/FrameMac.mm:
3433         * bridge/mac/WebCoreFrameBridge.mm:
3434         * bridge/mac/WebCoreSettings.h:
3435         * bridge/mac/WebCoreSettings.mm:
3436         * bridge/win/FrameWin.cpp:
3437         * css/CSSPrimitiveValue.cpp:
3438         * css/CSSValueKeywords.in:
3439         * css/MediaQueryEvaluator.cpp:
3440         * css/cssparser.cpp:
3441         * css/cssstyleselector.cpp:
3442         * css/cssstyleselector.h:
3443         * dom/CharacterData.cpp:
3444         * dom/CharacterData.h:
3445         * dom/Document.cpp:
3446         * dom/Element.cpp:
3447         * dom/Element.h:
3448         * dom/EventTargetNode.cpp:
3449         * dom/EventTargetNode.h:
3450         * dom/Node.cpp:
3451         * dom/Node.h:
3452         * dom/Position.cpp:
3453         * dom/ProcessingInstruction.cpp:
3454         * dom/QualifiedName.cpp:
3455         * dom/QualifiedName.h:
3456         * dom/XMLTokenizer.cpp: Added.
3457         * dom/xml_tokenizer.cpp: Removed.
3458         * dom/xml_tokenizer.h: Removed.
3459         * editing/EditAction.h:
3460         * editing/HTMLInterchange.cpp:
3461         * editing/HTMLInterchange.h:
3462         * editing/Selection.h:
3463         * editing/SelectionController.h:
3464         * editing/TextAffinity.h:
3465         * editing/TextIterator.cpp:
3466         * editing/TextIterator.h:
3467         * editing/VisiblePosition.h:
3468         * editing/htmlediting.cpp:
3469         * editing/markup.cpp:
3470         * editing/markup.h:
3471         * editing/visible_units.cpp:
3472         * editing/visible_units.h:
3473         * html/HTMLDocument.cpp:
3474         * html/HTMLFontElement.cpp:
3475         * html/HTMLInputElement.cpp:
3476         * html/HTMLKeygenElement.cpp:
3477         * html/HTMLSelectElement.h:
3478         * html/HTMLTextAreaElement.cpp:
3479         * html/HTMLTextFieldInnerElement.cpp:
3480         * html/HTMLTokenizer.cpp:
3481         * html/HTMLTokenizer.h:
3482         * kcanvas/KCanvasContainer.cpp: Removed.
3483         * kcanvas/KCanvasContainer.h: Removed.
3484         * kcanvas/KCanvasCreator.cpp:
3485         * kcanvas/KCanvasFilters.cpp:
3486         * kcanvas/KCanvasFilters.h:
3487         * kcanvas/KCanvasMatrix.cpp:
3488         * kcanvas/KCanvasMatrix.h:
3489         * kcanvas/KCanvasPath.cpp:
3490         * kcanvas/KCanvasPath.h:
3491         * kcanvas/KCanvasResources.cpp:
3492         * kcanvas/KCanvasResources.h:
3493         * kcanvas/KCanvasTreeDebug.cpp:
3494         * kcanvas/KCanvasTreeDebug.h:
3495         * kcanvas/RenderForeignObject.cpp:
3496         * kcanvas/RenderForeignObject.h:
3497         * kcanvas/RenderPath.cpp:
3498         * kcanvas/RenderPath.h:
3499         * kcanvas/RenderSVGContainer.cpp: Added.
3500         * kcanvas/RenderSVGContainer.h: Added.
3501         * kcanvas/RenderSVGImage.cpp:
3502         * kcanvas/RenderSVGImage.h:
3503         * kcanvas/RenderSVGText.cpp:
3504         * kcanvas/RenderSVGText.h:
3505         * kcanvas/device/KRenderingPaintServer.h: