Reviewed by Darin.
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  Alexey Proskuryakov  <ap@nypop.com>
2
3         Reviewed by Darin.
4
5         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8770
6           XMLHttpRequest should strip CR/LF characters from the URL
7
8         Test: fast/loader/url-strip-cr-lf-tab.html
9
10         * platform/KURL.cpp:
11         (appendEscapingBadChars): Strip CR, LF and TAB, as Firefox and IE do.
12
13 2006-05-11  David Hyatt  <hyatt@apple.com>
14
15         Remove the misspelling drawing code from Font and FontData.  Implement it
16         natively in GraphicContext instead.
17
18         Reviewed by maciej
19
20         * platform/FontData.h:
21         * platform/GraphicsContext.cpp:
22         * platform/GraphicsContext.h:
23         * platform/cairo/GraphicsContextCairo.cpp:
24         (WebCore::GraphicsContext::drawLineForMisspelling):
25         * platform/mac/FontData.mm:
26         * platform/mac/FontMac.mm:
27         * platform/mac/GraphicsContextMac.mm:
28         (WebCore::GraphicsContext::drawLineForMisspelling):
29         * platform/win/FontWin.cpp:
30         * rendering/InlineTextBox.cpp:
31         (WebCore::InlineTextBox::paintSpellingMarker):
32
33 2006-05-11  David Hyatt  <hyatt@apple.com>
34
35         Remove drawLineForText from the Font API.  Implement it natively in
36         the two GraphicsContexts (CG and Cairo) instead.
37
38         Reviewed by maciej
39
40         * platform/Font.h:
41         * platform/FontData.h:
42         * platform/GraphicsContext.cpp:
43         * platform/GraphicsContext.h:
44         * platform/cairo/GraphicsContextCairo.cpp:
45         (WebCore::GraphicsContext::drawLineForText):
46         * platform/cg/GraphicsContextCG.cpp:
47         (WebCore::GraphicsContext::drawLineForText):
48         * platform/mac/FontData.mm:
49         * platform/mac/FontMac.mm:
50         * platform/win/FontWin.cpp:
51         (WebCore::Font::drawLineForText):
52         * rendering/InlineTextBox.cpp:
53         (WebCore::InlineTextBox::paintDecoration):
54         (WebCore::InlineTextBox::paintMarkedTextUnderline):
55         * rendering/render_line.cpp:
56         (WebCore::InlineFlowBox::paintDecorations):
57
58 2006-05-11  Steve Falkenburg  <sfalken@apple.com>
59
60         Reviewed by eric.
61
62         Fix last fix.
63
64         * dom/QualifiedName.h:
65         (WebCore::QualifiedName::QualifiedName):
66
67 2006-05-11  Steve Falkenburg  <sfalken@apple.com>
68
69         Reviewed by eric.
70
71         Fix crash on static constructors builds at exit due to qualified name default constructor not
72         initializing m_impl.
73
74         * dom/QualifiedName.cpp:
75         (WebCore::QualifiedName::deref):
76
77 2006-05-11  Mitz Pettel  <opendarwin.org@mitzpettel.com>
78
79         Reviewed by hyatt
80
81         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8851
82           REGRESSION: RTL text shifted to the right
83
84         Already covered by several tests in fast/text
85
86         * platform/Font.h:
87         (WebCore::TextRun::TextRun): Added length parameter.
88         * rendering/InlineTextBox.cpp: Pass the length to the TextRun constructor.
89         (WebCore::InlineTextBox::selectionRect):
90         (WebCore::InlineTextBox::paint):
91         (WebCore::InlineTextBox::paintSelection):
92         (WebCore::InlineTextBox::paintMarkedTextBackground):
93         (WebCore::InlineTextBox::paintTextMatchMarker):
94         (WebCore::InlineTextBox::offsetForPosition):
95         (WebCore::InlineTextBox::positionForOffset):
96         * rendering/RenderText.cpp:
97         (WebCore::RenderText::widthFromCache): Pass length and from instead of from and to
98         to the TextRun constructor.
99         (WebCore::RenderText::width): Ditto.
100
101 2006-05-11  David Hyatt  <hyatt@apple.com>
102
103         Fix a regression from the TextRun landing.  Delete the characters in
104         the adjustedRun, not the ones in the original run!
105
106         Reviewed by beth
107
108         * platform/mac/FontMac.mm:
109         (WebCore::Font::drawComplexText):
110
111 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
112
113         Reviewed by thatcher, levi
114
115         * editing/ReplaceSelectionCommand.cpp:
116         (WebCore::ReplaceSelectionCommand::doApply):
117         Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
118         position pasted into must be split to avoid block nesting.  We now split unnecessarily
119         some times, but the end merge cleans up for us.
120
121 2006-05-11  David Hyatt  <hyatt@apple.com>
122
123         This patch makes drawHighlightForText a completely cross-platform method
124         implemented by the GraphicsContext.  The platform-specific implementations
125         of the method in the Font class have been eliminated.
126
127         Reviewed by andersca
128
129         * platform/Font.h:
130         * platform/FontData.h:
131         Remove the drawHighlight methods.  Change the selectionRect method in
132         Font to return a FloatRect so that the GraphicsContext can do an accurate
133         fill.
134
135         * platform/GraphicsContext.cpp:
136         (WebCore::GraphicsContext::drawHighlightForText):
137         Implement the drawHighlightFunction in terms of the cross-platform
138         Font selectionRect functions and a new float-based fillRect graphics context
139         function.
140
141         * platform/GraphicsContext.h:
142         * platform/cairo/GraphicsContextCairo.cpp:
143         (WebCore::GraphicsContext::fillRect):
144         * platform/cg/GraphicsContextCG.cpp:
145         (WebCore::GraphicsContext::fillRect):
146         Add the new float-based fillRect function for Cairo and CG.
147
148         * platform/mac/FontData.mm:
149         (WebCore::CG_draw):
150         (WebCore::ATSU_draw):
151         Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
152         the background from the deprecated draw methods (they'll be removed
153         soon).
154
155         * platform/mac/FontMac.mm:
156         (WebCore::Font::selectionRectForText):
157         * platform/win/FontWin.cpp:
158         (WebCore::Font::selectionRectForText):
159         Change selectionRectForText to return a FloatRect instead of an IntRect,
160         so that the GraphicsContext can do a precise fill.
161
162         * rendering/InlineTextBox.cpp:
163         (WebCore::InlineTextBox::selectionRect):
164         (WebCore::InlineTextBox::positionForOffset):
165         Modify the callers who expect an int-based selection rect so that they call
166         enclosingIntRect.
167
168 2006-05-11  Darin Adler  <darin@apple.com>
169
170         Reviewed by Adele.
171
172         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
173           REGRESSION: focus() on input field selects all text within it
174           (was: cannot select cities on British Rail reservation site)
175
176         Test: fast/forms/double-focus.html
177
178         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
179         Changed to only call setFocusNode, select, and revealSelection
180         if the element is not already focused. Also changed to use return
181         a bit more rather than else.
182
183 2006-05-11  Darin Adler  <darin@apple.com>
184
185         Reviewed by Tim Hatcher (earlier version).
186
187         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
188           use the preprocessor for IDL files
189
190         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
191         driver script, passing "-E" so we only preprocess, "-P" so we don't get
192         "#line" directives, and "-x c++" so we handle both C and C++ comments.
193         Removed the code to eliminate comments since the preprocessor handles that.
194         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
195         updated it to do the same way as above.
196
197 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
198
199         Reviewed by Darin.
200
201         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
202         Add support for mozilla-style node constructors as properties of the window object
203         
204         * DerivedSources.make:
205         * WebCore.xcodeproj/project.pbxproj:
206         Add new generated files.
207         
208         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
209         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
210         * bindings/js/JSHTMLElementWrapperFactory.cpp:
211         (WebCore::createJSWrapper):
212         Specify the KJS namespace for JSHTMLElmement.
213                 
214         * bindings/js/kjs_dom.cpp:
215         (KJS::toJS):
216         Create a WebCore::JSHTMLDocument for document nodes. Also, create
217         JSDocumentFragments for document fragments (instead of plain node objects).
218         
219         * bindings/js/kjs_html.cpp:
220         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
221         (KJS::JSHTMLDocument::JSHTMLDocument):
222         (KJS::JSHTMLDocument::getOwnPropertySlot):
223         Add a prototype for JSHTMLDocument and move all functions there.
224         
225         (KJS::JSHTMLElement::JSHTMLElement):
226         (KJS::JSHTMLElement::getOwnPropertySlot):
227         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
228         
229         (KJS::JSHTMLElement::getValueProperty):
230         (KJS::JSHTMLElement::putValueProperty):
231         Remove title setter and getter. Those are autogenerated now.
232         
233         * bindings/js/kjs_html.h:
234         (KJS::JSHTMLElement::):
235         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
236         
237         * bindings/scripts/CodeGeneratorJS.pm:
238         Always generate a prototype object, regardless of whether the object has any functions or
239         constants.
240         
241         Use the type of generator attributes to determine what constructor to use. This is useful for
242         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
243         
244         * dom/DocumentFragment.idl: Added.        
245         * html/HTMLDocument.idl: Added.
246         * html/HTMLElement.idl: Added.
247         
248         * page/DOMWindow.idl:
249         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
250         an alias for the Document constructor.
251         
252 2006-05-11  David Hyatt  <hyatt@apple.com>
253
254         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
255         make it the new API for Font and GraphicsContext when drawing/measuring
256         text.
257
258         Reviewed by andersca
259
260         * platform/Font.cpp:
261         (WebCore::m_finalRoundingWidth):
262         (WebCore::WidthIterator::advance):
263         (WebCore::WidthIterator::normalizeVoicingMarks):
264         (WebCore::Font::width):
265         (WebCore::Font::canUseGlyphCache):
266         (WebCore::Font::drawSimpleText):
267         (WebCore::Font::drawText):
268         (WebCore::Font::floatWidth):
269         (WebCore::Font::floatWidthForSimpleText):
270         * platform/Font.h:
271         (WebCore::TextRun::m_to):
272         (WebCore::TextRun::operator[]):
273         (WebCore::TextRun::data):
274         (WebCore::TextRun::adjustFrom):
275         (WebCore::TextRun::adjustTo):
276         (WebCore::TextRun::characters):
277         (WebCore::TextRun::length):
278         (WebCore::TextRun::from):
279         (WebCore::TextRun::to):
280         * platform/GraphicsContext.cpp:
281         (WebCore::GraphicsContext::drawText):
282         (WebCore::GraphicsContext::drawHighlightForText):
283         * platform/GraphicsContext.h:
284         * platform/mac/FontMac.mm:
285         (WebCore::addDirectionalOverride):
286         (WebCore::overrideLayoutOperation):
287         (WebCore::ATSULayoutParameters::initialize):
288         (WebCore::Font::selectionRectForText):
289         (WebCore::Font::drawComplexText):
290         (WebCore::Font::drawHighlightForText):
291         (WebCore::Font::floatWidthForComplexText):
292         (WebCore::Font::checkSelectionPoint):
293         * platform/win/FontWin.cpp:
294         (WebCore::hackishExtentForString):
295         (WebCore::Font::floatWidth):
296         (WebCore::Font::drawText):
297         (WebCore::Font::drawHighlightForText):
298         (WebCore::Font::selectionRectForText):
299         (WebCore::Font::checkSelectionPoint):
300         * rendering/InlineTextBox.cpp:
301         (WebCore::InlineTextBox::selectionRect):
302         (WebCore::InlineTextBox::paint):
303         (WebCore::InlineTextBox::paintSelection):
304         (WebCore::InlineTextBox::paintMarkedTextBackground):
305         (WebCore::InlineTextBox::paintTextMatchMarker):
306         (WebCore::InlineTextBox::offsetForPosition):
307         (WebCore::InlineTextBox::positionForOffset):
308         * rendering/RenderBlock.cpp:
309         (WebCore::stripTrailingSpace):
310         * rendering/RenderFlexibleBox.cpp:
311         (WebCore::RenderFlexibleBox::layoutVerticalBox):
312         * rendering/RenderImage.cpp:
313         (WebCore::RenderImage::imageChanged):
314         (WebCore::RenderImage::paint):
315         * rendering/RenderText.cpp:
316         (WebCore::RenderText::cacheWidths):
317         (WebCore::RenderText::widthFromCache):
318         (WebCore::RenderText::trimmedMinMaxWidth):
319         (WebCore::RenderText::calcMinMaxWidth):
320         (WebCore::RenderText::width):
321         * rendering/RenderTextField.cpp:
322         (WebCore::RenderTextField::calcMinMaxWidth):
323         * rendering/bidi.cpp:
324         (WebCore::RenderBlock::tabWidth):
325         (WebCore::RenderBlock::checkLinesForTextOverflow):
326         * rendering/render_line.cpp:
327         (WebCore::EllipsisBox::paint):
328         * rendering/render_list.cpp:
329         (WebCore::RenderListMarker::paint):
330         (WebCore::RenderListMarker::calcMinMaxWidth):
331         (WebCore::RenderListMarker::getRelativeMarkerRect):
332
333 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
334
335         Reviewed by darin
336
337         * editing/ReplaceSelectionCommand.cpp:
338         (WebCore::ReplaceSelectionCommand::doApply):
339         Removed the code to find out if we must later add smart replace whitespace.  We can 
340         wait until we've done the insertion to figure it out, and the position sampled (startPos)
341         to make the decision about trailing whitespace was wrong.
342         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
343         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
344         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
345         whitespace (2 and 3 were reversed because the end merge must happen before we can know
346         whether or not we need to add a trailing space).
347         Don't do an end merge if the last node inserted was a br because the end merge will 
348         clobber it.
349         
350         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
351         brs where [br, 0] is at the end of a block and not at the start of a paragraph
352         are the ones that are collapsed because of quirks mode.
353
354 2006-05-10  David Hyatt  <hyatt@apple.com>
355
356         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
357         Font and make them static methods (inlined in the header).  Make the rounding
358         hack character table a static member as well.  Remove the redundant space/rounding
359         functions from FontData.mm.
360
361         Reviewed by darin
362
363         * platform/Font.cpp:
364         (WebCore::):
365         (WebCore::m_finalRoundingWidth):
366         (WebCore::WidthIterator::advance):
367         * platform/Font.h:
368         (WebCore::Font::treatAsSpace):
369         (WebCore::Font::isRoundingHackCharacter):
370         * platform/mac/FontData.mm:
371         (WebCore::overrideLayoutOperation):
372         (WebCore::createATSULayoutParameters):
373         (WebCore::initializeWidthIterator):
374         (WebCore::advanceWidthIterator):
375         * platform/mac/FontMac.mm:
376         (WebCore::overrideLayoutOperation):
377         (WebCore::ATSULayoutParameters::initialize):
378
379 2006-05-10  Darin Adler  <darin@apple.com>
380
381         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
382
383 >>>>>>> .r14297
384 2006-05-10  David Carson <dacarson@gmail.com>
385
386         - Fix for bug 8833. Removed inline keyword from functions declared
387         in .mm and .cpp files. inline function code needs to reside in the
388         header file for the linker to find the code. 
389         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
390
391         Reviewed by Darin, landed by Timothy.
392
393         * platform/Font.cpp:
394         (WebCore::isSpace):
395         * platform/mac/FontData.mm:
396         (WebCore::widthForGlyph):
397         (WebCore::isRoundingHackCharacter):
398         (WebCore::glyphForCharacter):
399
400 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
401
402         Reviewed and landed by Anders.
403
404         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
405           REGRESSION: Words render on top of each other when fallback font is used
406
407         Already covered by several pixel tests in fast/text
408
409         * platform/Font.cpp:
410         (WebCore::Font::drawSimpleText):
411
412 2006-05-10  David Hyatt  <hyatt@apple.com>
413
414         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
415         drawing and measuring of runs up into the Font class.  The fast code
416         path is in Font.cpp and is designed to be mostly cross-platform.  The
417         slow code path is in FontMac.cpp and is Mac-specific.
418
419         Reviewed by darin
420
421         * WebCore.xcodeproj/project.pbxproj:
422         * platform/Font.cpp:
423         (WebCore::isSpace):
424         (WebCore::):
425         (WebCore::isRoundingHackCharacter):
426         (WebCore::m_finalRoundingWidth):
427         (WebCore::WidthIterator::advance):
428         (WebCore::WidthIterator::normalizeVoicingMarks):
429         (WebCore::Font::primaryFont):
430         (WebCore::Font::setAlwaysUseComplexPath):
431         (WebCore::Font::canUseGlyphCache):
432         (WebCore::Font::drawSimpleText):
433         (WebCore::Font::drawText):
434         (WebCore::Font::floatWidth):
435         (WebCore::Font::floatWidthForSimpleText):
436         * platform/Font.h:
437         * platform/FontData.h:
438         (WebCore::FontData::platformData):
439         * platform/GlyphBuffer.h: Added.
440         (WebCore::GlyphBuffer::GlyphBuffer):
441         (WebCore::GlyphBuffer::isEmpty):
442         (WebCore::GlyphBuffer::size):
443         (WebCore::GlyphBuffer::glyphs):
444         (WebCore::GlyphBuffer::advances):
445         (WebCore::GlyphBuffer::fontDataAt):
446         (WebCore::GlyphBuffer::swap):
447         (WebCore::GlyphBuffer::glyphAt):
448         (WebCore::GlyphBuffer::advanceAt):
449         (WebCore::GlyphBuffer::add):
450         * platform/mac/FontData.mm:
451         (WebCore::isSpace):
452         (WebCore::isRoundingHackCharacter):
453         (WebCore::FontData::widthForGlyph):
454         (WebCore::m_ATSUMirrors):
455         (WebCore::FontData::xHeight):
456         (WebCore::FontData::smallCapsFontData):
457         (WebCore::findSubstituteFont):
458         (WebCore::rendererForAlternateFont):
459         (WebCore::findSubstituteRenderer):
460         (WebCore::FontData::findSubstituteFontData):
461         (WebCore::computeWidthForSpace):
462         (WebCore::FontData::updateGlyphMapEntry):
463         (WebCore::extendGlyphMap):
464         (WebCore::extendWidthMap):
465         (WebCore::createATSULayoutParameters):
466         (WebCore::FontData::glyphForCharacter):
467         (WebCore::advanceWidthIterator):
468         (WebCore::shouldUseATSU):
469         * platform/mac/FontMac.mm:
470         (WebCore::ATSULayoutParameters::m_padPerSpace):
471         (WebCore::addDirectionalOverride):
472         (WebCore::initializeATSUStyle):
473         (WebCore::overrideLayoutOperation):
474         (WebCore::ATSULayoutParameters::initialize):
475         (WebCore::disposeATSULayoutParameters):
476         (WebCore::Font::drawComplexText):
477         (WebCore::Font::floatWidthForComplexText):
478         (WebCore::Font::drawGlyphs):
479         * platform/mac/WebCoreTextRenderer.mm:
480         (WebCoreSetAlwaysUseATSU):
481
482 2006-05-10  Darin Adler  <darin@apple.com>
483
484         - another try at fixing the Windows build
485
486         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
487         instead of unicode().
488
489 == Rolled over to ChangeLog-2006-05-10 ==