blob: c981a82a2f497f865630f76e9f8e585a1e0ae269 [file] [log] [blame]
2006-05-10 Matt Gough <matt@softchaos.com>
Reviewed, tweaked, and landed by Darin.
Optimization of [DOMNode _nodeWith:] to look up the obj-c wrapperClass
for each HTMLElement using a HashMap instead of by repeated calls to
htmlElt->hasLocalName(someTag).
* bindings/objc/DOM.mm:
(addElementClass): Added.
(createHTMLElementClassMap):
(elementClass):
(+[DOMNode _nodeWith:]): Added code to call elementClass.
2006-05-09 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- fix http://bugs.webkit.org/show_bug.cgi?id=8760
crash (hang?) on subtlegradient.com article page
* manual-tests/first-line-style-crash.html: Added.
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::createStyleForElement): Changed to not return the
shared styleNotYetAvailable if allowSharing is off.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::getPseudoStyle): In the FIRST_LINE_INHERITED case,
set the styleType on the style returned from createStyleForElement().
* rendering/render_style.h:
(WebCore::RenderStyle::setStyleType): Added. Called from RenderObject::getPseudoStyle().
2006-05-09 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Hyatt.
- fix http://bugs.webkit.org/show_bug.cgi?id=8789
RenderStyle::getPseudoStyle() always returns 0
No test possible (no functionality change).
* dom/Node.cpp:
(WebCore::Node::diff): When checking if :before or :after has changed,
return NoInherit unless both pseudoStyles are known and equal.
* rendering/render_style.cpp:
(WebCore::RenderStyle::getPseudoStyle): Fixed to match the requested
type against the pseudoStyle's styleType instead of our own.
2006-05-09 Darin Adler <darin@apple.com>
- another attempt to fix the Windows build
* bindings/js/kjs_window.cpp: (KJS::isSeparator): Take a UChar, not a KJS::UChar.
* bridge/win/FrameWin.cpp:
(WebCore::FrameWin::runJavaScriptAlert): Use UChar instead of QChar.
(WebCore::FrameWin::runJavaScriptConfirm): Ditto.
* editing/TextIterator.h: Include DeprecatedString.h.
2006-05-09 Darin Adler <darin@apple.com>
Reviewed by Hyatt.
- fix http://bugs.webkit.org/show_bug.cgi?id=8781
REGRESSION: image maps with "poly" areas, including one at lisp.geek.nz, don't work
* html/html_imageimpl.cpp: (WebCore::HTMLAreaElement::getRegion): Remove extra Path
definition that was shadowing the real one.
2006-05-09 Darin Adler <darin@apple.com>
- fix build
* rendering/render_style.cpp: (WebCore::RenderStyle::getPseudoStyle):
Fix a typo.
- attempt to fix Windows build
* css/maketokenizer: Use UChar instead of unsigned short.
* platform/win/FontWin.cpp:
(WebCore::getFontData): Removed cast to QChar.
(WebCore::hackishExtentForString): Use UChar.
(WebCore::Font::floatWidth): Use UChar.
(WebCore::Font::drawText): Use UChar.
(WebCore::Font::drawHighlightForText): Use UChar.
(WebCore::Font::selectionRectForText): Use UChar.
(WebCore::Font::checkSelectionPoint): Use UChar.
* platform/win/KeyEventWin.cpp:
(WebCore::singleCharacterString): Added.
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Use above function.
* platform/win/TemporaryLinkStubs.cpp:
(WebCore::findNextSentenceFromIndex): Use UChar.
(WebCore::findSentenceBoundary): Use UChar.
(WebCore::findNextWordFromIndex): Use UChar.
(WebCore::findWordBoundary): Use UChar.
* platform/win/TransferJobWin.cpp:
(WebCore::TransferJob::start): Use a different String constructor.
* rendering/RenderTable.h: Added an include of DeprecatedArray.h.
* rendering/RenderText.cpp: Added an include of DeprecatedString.h.
* rendering/render_list.h: Ditto.
2006-05-09 Darin Adler <darin@apple.com>
Rubber stamped by Hyatt.
- http://bugs.webkit.org/show_bug.cgi?id=8782
use ICU and UChar more, QChar less
- fix http://bugs.webkit.org/show_bug.cgi?id=6310
text-transform: uppercase/lowercase don't handle cases one character becomes two
Test: fast/css/case-transform.html
By using ICU more, this fixes some bugs in a few places.
* bindings/js/JSXMLSerializer.cpp:
* css/css_valueimpl.h:
* kwq/KWQTextStream.cpp:
* loader/CachedObject.h:
* platform/Color.cpp:
Add includes of DeprecatedString.h as needed, now that StringImpl.h no longer
includes it.
* bindings/js/kjs_css.cpp: (KJS::cssPropertyName):
Eliminate use of QChar::latin1() in a case where it's not helpful.
* bindings/js/kjs_proxy.cpp: (WebCore::KJSProxy::evaluate):
Use characters() function instead of the old unicode() function.
* bindings/js/kjs_window.cpp: (KJS::isSeparator):
Use UChar instead of QChar.
* bindings/objc/DOMInternal.mm:
(StringImpl::operator NSString*): Remove typecast that's no longer needed.
(String::String): Ditto. Also use Vector for local buffer to make code read simpler.
* bridge/mac/FrameMac.mm:
(WebCore::selectorForKeyEvent): Remove call to unicode() function, no longer needed.
(WebCore::FrameMac::setTitle): Remove QChar cast, no longer needed.
(WebCore::FrameMac::setStatusBarText): Ditto.
(WebCore::FrameMac::advanceToNextMisspelling): Use UChar instead of QChar.
(WebCore::FrameMac::runJavaScriptAlert): Remove QChar cast, no longer needed.
(WebCore::FrameMac::runJavaScriptConfirm): Ditto.
(WebCore::FrameMac::runJavaScriptPrompt): Ditto.
(WebCore::FrameMac::attributedString): Replaces calls of QChar::direction() with
calls to u_charDirection and use ICU constants instead of QChar ones.
(WebCore::FrameMac::markMisspellings): Remove QChar cast, no longer needed. Added a
QChar cast so we can call isSpace -- slated to be removed later.
(WebCore::FrameMac::shouldClose): Remove QChar cast, no longer needed.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge selectedString]): Remove QChar cast, no longer needed.
(-[WebCoreFrameBridge stringForRange:]): Ditto.
* css/CSSGrammar.y: Update for field name change from string to characters.
Use UChar instead of unsigned short.
* css/css_valueimpl.cpp:
(WebCore::propertyID): Use UChar instead of unsigned short and get rid of call to
unicode() function, no longer needed.
(WebCore::quoteStringIfNeeded): Use strings when building up a resulting string,
instead of depending on the feature where you can append characters to a string.
* css/csshelper.cpp: (WebCore::parseURL): Remove calls to unicode() function and
rewrite to obviate the need to call lower() just to check for a few constant
character values. Also remove a now-unneeded type cast.
* css/cssparser.h: Changed ParseString field to use UChar and to be named characters
instead of string. Changed many other fields to be UChar instead of unsigned short.
(WebCore::domString): Update for that.
(WebCore::atomicString): Ditto.
* css/cssparser.cpp:
(WebCore::ParseString::lower): Use u_tolower instead of QChar::lower(). Also change
name to characters from string.
(WebCore::CSSParser::setupParser): Use UChar instead of unsigned short.
(WebCore::CSSParser::lex): Ditto. Also update for characters name change.
(WebCore::CSSParser::text): Use UChar instead of unsigned short. Also tweak some
of the code a little bit to handle a couple of overflow cases better and reduce
type casting.
(WebCore::deprecatedString): Moved here so we don't have to include DeprecatedString.h
in the header file.
* css/cssstyleselector.cpp: (WebCore::checkPseudoState): Added a type cast since this
code now bridges the world between modern code and QChar/DeprecatedString.
* dom/CharacterData.cpp: (WebCore::CharacterData::CharacterData): Changed QChar to UChar.
* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::isValidName): Updated for name change from unicode to characters.
(WebCore::Document::parseQualifiedName): Ditto.
(WebCore::Document::backslashAsCurrencySymbol): Changed return type to UChar.
* dom/NamedMappedAttrMap.cpp:
(WebCore::isClassWhitespace): Changed parameter to UChar from QChar.
(WebCore::NamedMappedAttrMap::parseClassAttribute): Changed from UChar to QChar and
from unicode to characters.
* dom/Position.cpp:
(WebCore::Position::leadingWhitespacePosition): Changed from QChar to UChar.
(WebCore::Position::trailingWhitespacePosition): Ditto.
* dom/StyledElement.cpp:
(WebCore::isClassWhitespace): Changed from QChar to UChar.
(WebCore::StyledElement::addCSSLength): Changed from QChar to UChar, and remove one
case where latin1() was used and was not helpful.
(WebCore::StyledElement::addCSSColor): Removed unicode() function call, no longer needed.
* dom/dom2_eventsimpl.cpp: (WebCore::KeyboardEvent::charCode):
* html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
Removed unicode() function call, no longer needed.
* dom/xml_tokenizer.h: Removed default parameter for xmlDocPtrForString so we don't have
to include the DeprecatedString.h header in this file (and since no one uses it).
* editing/HTMLInterchange.cpp: (convertHTMLTextToInterchangeFormat): Added a couple calls
to the unicode() function to bridge the gap from QChar/DeprecatedString back to modern
code.
* editing/InsertTextCommand.cpp: Removed unused function.
* editing/TextIterator.h: Changed from QChar to UChar.
* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator): Initialize m_lastCharacter since it's now a UChar
(which is just a typedef) rather than a QChar (which was a class with a default value of 0).
(WebCore::TextIterator::handleTextNode): Updated to use characters() instead of unicode().
(WebCore::TextIterator::handleTextBox): Removed unicode() call since it's now a UChar instead
of a QChar.
(WebCore::TextIterator::emitCharacter): More of the same.
(WebCore::SimplifiedBackwardsTextIterator::handleTextNode): Ditto.
(WebCore::SimplifiedBackwardsTextIterator::emitCharacter): Ditto.
(WebCore::CharacterIterator::string): Ditto.
(WebCore::WordAwareIterator::advance): Ditto.
(WebCore::WordAwareIterator::length): Ditto.
(WebCore::WordAwareIterator::characters): Ditto.
(WebCore::CircularSearchBuffer::CircularSearchBuffer): Changed to use UChar
instead of QChar, but also to use foldCase() instead of lower(), because
we want case folding here, not lowercasing.
(WebCore::CircularSearchBuffer::append): Ditto, with u_foldCase.
(WebCore::CircularSearchBuffer::isMatch): Ditto.
(WebCore::plainText): Added type cast since this bridges the gap from the modern stuff
to QChar/DeprecatedString.
* editing/VisiblePosition.h: Changed from QChar to UChar.
* editing/VisiblePosition.cpp: (WebCore::VisiblePosition::characterAfter): Ditto.
* editing/markup.cpp: (WebCore::escapeTextForMarkup): Changed code that used latin1()
for no good reason to use unicode() instead.
* html/HTMLTokenizer.h: Changed from QChar to UChar.
* html/HTMLTokenizer.cpp: Changed from QChar to UChar, including removing the
KHTML_ALLOC_QCHAR_VEC and KHTML_DELETE_QCHAR_VEC macros, which weren't being
used consistently anyway.
(WebCore::fixUpChar): More of the same.
(WebCore::tagMatch): Ditto.
(WebCore::HTMLTokenizer::reset): Ditto.
(WebCore::HTMLTokenizer::begin): Ditto. Also corrected anomaly where buffer
size was not the same as the size value -- this was only true in the initial
allocation, so I believe there was no value in it.
(WebCore::HTMLTokenizer::parseSpecial): Ditto. Also removed a use of latin1()
that was unnnecessary extra work.
(WebCore::HTMLTokenizer::scriptHandler): More of the same.
(WebCore::HTMLTokenizer::parseComment): Ditto.
(WebCore::HTMLTokenizer::parseServer): Ditto.
(WebCore::HTMLTokenizer::parseProcessingInstruction): Ditto. Another unnecessary
use of latin1() removed.
(WebCore::HTMLTokenizer::parseText): Ditto.
(WebCore::HTMLTokenizer::parseEntity): Ditto. Changed hex-parsing code to handle
uppercase hex a more-efficient way than calling QChar::lower() on each character.
Also changed surrogate code logic to fix a couple things -- reject character codes
> 0x10FFFF as it should and use U16_LEAD and U16_TRAIL instead of writing our
own versions of these.
(WebCore::HTMLTokenizer::parseTag): Ditto.
(WebCore::HTMLTokenizer::write): Ditto.
(WebCore::HTMLTokenizer::end): Ditto.
(WebCore::HTMLTokenizer::finish): Ditto.
(WebCore::HTMLTokenizer::enlargeBuffer): Ditto.
(WebCore::HTMLTokenizer::enlargeScriptBuffer): Ditto.
(WebCore::HTMLTokenizer::notifyFinished):
(WebCore::decodeNamedEntity): Ditto.
* html/html_inlineimpl.cpp: (WebCore::parseFontSizeNumber): Changed from QChar
to UChar, including using u_isdigit and u_charDigitValue instead of QChar::isNumber
and QChar::digitValue. Also removed unneeded range checking that's already done
by WebCore::String.
* kwq/KWQLoader.mm: (KWQIsResponseURLEqualToURL): Rewrote to use Vector and UChar,
removing all the type casts and making the whole function much shorter.
* kwq/WebCoreAXObject.mm:
(AXAttributedStringAppendText): Use UChar instead of QChar.
(-[WebCoreAXObject doAXAttributedStringForTextMarkerRange:]): More of the same.
* loader/Cache.h: Remove unnecessary default parameters, preventing the need to
include the DeprecatedString.h header in this header. Cleaned up the header
structure a bit, removing some obsolete and redundant comments and fixing typos.
* loader/Cache.cpp: Removed unused preload functions.
* page/Frame.h:
* page/Frame.cpp:
(WebCore::UserStyleSheetLoader::UserStyleSheetLoader): Added explicit arguments.
This was the only caller anywhere that took advantage of the default parameter
values in one of the Cache class request functions.
(WebCore::Frame::backslashAsCurrencySymbol): Changed QChar to UChar.
* platform/AtomicString.h: Changed QChar to UChar. Removed constructor that makes
an AtomicString from a single character. Renamed unicode() function to characters().
Renamed KHTML_ATOMICSTRING_HIDE_GLOBALS to ATOMICSTRING_HIDE_GLOBALS.
* platform/AtomicString.cpp:
(WebCore::CStringTranslator::equal): Changed QChar to UChar.
(WebCore::operator==): Changed unicode() to characters().
(WebCore::UCharBufferTranslator::hash): More of the same.
(WebCore::UCharBufferTranslator::equal): Ditto.
(WebCore::UCharBufferTranslator::translate): Ditto.
(WebCore::AtomicString::add): Ditto.
(WebCore::AtomicString::operator Identifier): Ditto.
(WebCore::AtomicString::operator UString): Ditto.
(WebCore::AtomicString::AtomicString): Moved here so we don't need DeprecatedString.h
in the header.
(WebCore::AtomicString::deprecatedString): Ditto.
* platform/DeprecatedString.h: Removed QChar::Direction enum and all the DirXXX values,
isDigit, isLetter, isNumber, isLetterOrNumber, isPunct, digitValue, and direction functions.
(QChar::isSpace): Changed to use u_charDirection instead of QChar::direction.
* platform/Font.h: (WebCore::Font::width): Changed QChar to UChar.
* platform/Font.cpp: (WebCore::Font::width): Ditto.
* platform/GraphicsContext.h:
* platform/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawText): Changed QChar to UChar. Removed horizontalAlignment
parameter from simplified string drawing entry point, since it's not used.
(WebCore::GraphicsContext::drawHighlightForText): Changed QChar to UChar.
* platform/PlatformString.h: Changed QChar to UChar. Removed constructor that makes
a String from a single character. Renamed unicode() function to characters(). Added
an append function and changed += operator to just call that. Added a foldCase() function.
Removed the concatenation operators that add individual strings before or after.
* platform/String.cpp:
(WebCore::String::String): Changed QChar to UChar.
(WebCore::String::append): Renamed from operator+= and removed the return value.
(WebCore::String::operator[]): Changed QChar to UChar.
(WebCore::String::foldCase): Added.
(WebCore::String::percentage): More of the same.
(WebCore::String::characters): Renamed from unicode().
(WebCore::String::deprecatedString): More of the same.
(WebCore::String::sprintf): Fixed mistakes in the comments.
(WebCore::String::isEmpty): Tweaked a bit.
(WebCore::operator==): More of the same.
(WebCore::String::operator Identifier): Ditto.
(WebCore::String::operator UString): Ditto.
* platform/SegmentedString.h: Changed from QChar to UChar. Had to initialize
data members that are now UChar.
* platform/SegmentedString.cpp:
(WebCore::SegmentedString::length): Updated for change from QChar to UChar.
(WebCore::SegmentedString::append): Ditto.
(WebCore::SegmentedString::prepend): Ditto.
(WebCore::SegmentedString::toString): Ditto.
* platform/StringHash.h: Updated to use UChar instead of QChar and for name changes.
Also changed to use case folding intead of lowercasing for case insensitive hashing.
* platform/StringImpl.h:
* platform/StringImpl.cpp:
(WebCore::newUCharVector): Changed to UChar from QChar.
(WebCore::deleteUCharVector): Ditto.
(WebCore::StringImpl::StringImpl): Ditto.
(WebCore::StringImpl::init): Ditto. Also renamed from initWithChar and initWithQChar.
(WebCore::StringImpl::~StringImpl): Ditto.
(WebCore::StringImpl::append): Ditto.
(WebCore::StringImpl::insert): Ditto.
(WebCore::StringImpl::truncate): Ditto.
(WebCore::StringImpl::remove): Ditto.
(WebCore::StringImpl::split): Ditto.
(WebCore::StringImpl::containsOnlyWhitespace): Ditto. Also added comment because this
function seems a little broken.
(WebCore::parseLength): More of the same.
(WebCore::StringImpl::toCoordsArray): Ditto.
(WebCore::StringImpl::toLengthArray): Ditto.
(WebCore::StringImpl::isLower): Ditto.
(WebCore::StringImpl::lower): Rewrote to use u_strToLower.
(WebCore::StringImpl::upper): Rewrote to use u_strToUpper.
(WebCore::StringImpl::foldCase): Added. Uses u_strFoldCase.
(WebCore::getWordBreakIterator): Changed to use U_FAILURE instead of accepting only
U_ZERO_ERROR as a success code.
(WebCore::StringImpl::capitalize): More QChar to UChar changes.
(WebCore::StringImpl::toInt): Ditto.
(WebCore::equal): Changed from QChar to UChar and was careful to preserve the old
semantics where "high ASCII" is treated as U+0080-U+00FF even though I don't know
if this feature is important.
(WebCore::equalIgnoringCase): Ditto, but used case folding instead of lowercasing
by using the u_foldCase and u_memcasecmp functions. Also renamed from
equalCaseInsensitive for more-consistent naming.
(WebCore::StringImpl::find): Ditto. Use case folding for the case insensitive branch.
(WebCore::StringImpl::replace): More of the same.
(WebCore::StringImpl::computeHash): Ditto.
(WebCore::StringImpl::ascii): Ditto.
* platform/TextBoundaries.h: Changed from QChar to UChar.
* platform/mac/TextBoundaries.mm:
(WebCore::findWordBoundary): Made the change to UChar and removed some type casts.
(WebCore::findNextWordFromIndex): Ditto.
(WebCore::findSentenceBoundary): Ditto.
(WebCore::findNextSentenceFromIndex): Ditto.
* platform/TextEncoding.h:
* platform/TextEncoding.cpp:
(WebCore::TextEncoding::backslashAsCurrencySymbol): Changed from QChar to UChar.
(WebCore::TextEncoding::fromUnicode): More of the same.
* platform/mac/TextEncodingMac.cpp: (WebCore::TextEncoding::fromUnicode): More
of the same.
* platform/mac/FontFamilyMac.mm: (WebCore::FontFamily::getNSFamily): Removed a
now-unneeded type cast.
* platform/mac/FontMac.mm:
(WebCore::Font::selectionRectForText):
(WebCore::Font::drawText):
(WebCore::Font::drawHighlightForText):
(WebCore::Font::floatWidth):
(WebCore::Font::checkSelectionPoint):
Changed QChar to UChar and removed some now-unneeded type casts.
* editing/RebalanceWhitespaceCommand.cpp: (WebCore::isWhitespace):
* editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
* editing/visible_units.cpp:
(WebCore::previousBoundary):
(WebCore::nextBoundary):
(WebCore::startWordBoundary):
(WebCore::endWordBoundary):
(WebCore::previousWordPositionBoundary):
(WebCore::nextWordPositionBoundary):
(WebCore::startSentenceBoundary):
(WebCore::endSentenceBoundary):
(WebCore::previousSentencePositionBoundary):
(WebCore::nextSentencePositionBoundary):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* html/HTMLParser.cpp: (WebCore::HTMLParser::handleError):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::selectionRect):
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintMarkedTextBackground):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::offsetForPosition):
(WebCore::InlineTextBox::positionForOffset):
* rendering/RenderBlock.cpp:
(WebCore::stripTrailingSpace):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutVerticalBox):
* rendering/RenderObject.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::backslashAsCurrencySymbol):
* rendering/RenderTreeAsText.cpp: (quoteAndEscapeNonPrintables):
* rendering/break_lines.cpp: (WebCore::nextBreakablePosition):
* rendering/break_lines.h: (WebCore::isBreakable):
* rendering/render_style.h: (WebCore::RenderStyle::isCollapsibleWhiteSpace):
* xml/XSLStyleSheet.cpp: (WebCore::XSLStyleSheet::parseString):
* xml/xmlhttprequest.cpp:
(WebCore::getMIMEType):
(WebCore::getCharset):
Changed QChar to UChar.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged): Changed QChar to UChar.
(WebCore::RenderImage::paint): Changed callers of drawText to no-longer pass 0
for the horizontal alignment, since I removed that parameters.
* rendering/RenderText.h: Changed QChar to UChar.
* rendering/RenderText.cpp:
(WebCore::characterBreakIterator): Update for name change.
(WebCore::RenderText::RenderText): Ditto.
(WebCore::RenderText::allAscii): Remove uneeded unicode() and allow the value
U+007F to count as ASCII.
(WebCore::RenderText::cacheWidths): Changed QChar to UChar.
(WebCore::RenderText::widthFromCache): Changed code that deals with direction to
use the ICU direction calls.
(WebCore::RenderText::trimmedMinMaxWidth): Changed QChar to UChar.
(WebCore::RenderText::calcMinMaxWidth): Ditto.
(WebCore::RenderText::containsOnlyWhitespace): Ditto.
(WebCore::RenderText::setText): Ditto.
(WebCore::RenderText::width): Ditto.
* rendering/RenderTextField.cpp:
(WebCore::RenderTextField::updateFromElement): Removed unneeded QChar cast.
(WebCore::RenderTextField::calcMinMaxWidth): Changed from QChar to UChar.
* rendering/bidi.h:
* rendering/bidi.cpp:
(WebCore::BidiIterator::BidiIterator):
(WebCore::BidiState::BidiState):
(WebCore::BidiContext::BidiContext):
(WebCore::bidiNext):
(WebCore::bidiFirst):
(WebCore::BidiIterator::current):
(WebCore::BidiIterator::direction):
(WebCore::addRun):
(WebCore::checkMidpoints):
(WebCore::appendRun):
(WebCore::embed):
(WebCore::RenderBlock::tabWidth):
(WebCore::RenderBlock::computeHorizontalPositionsForLine):
(WebCore::RenderBlock::bidiReorderLine):
(WebCore::RenderBlock::layoutInlineChildren):
(WebCore::skipNonBreakingSpace):
(WebCore::RenderBlock::skipWhitespace):
(WebCore::RenderBlock::findNextLineBreak):
(WebCore::RenderBlock::checkLinesForTextOverflow):
Changed from QChar to UChar and all direction from QChar constants to the
ones from ICU.
* rendering/render_form.cpp:
(WebCore::RenderLineEdit::updateFromElement):
(WebCore::RenderSelect::updateFromElement):
(WebCore::RenderTextArea::updateFromElement):
(WebCore::RenderTextArea::text):
(WebCore::RenderTextArea::textWithHardLineBreaks):
Got rid of now-unneeded QChar type casts.
* rendering/render_line.cpp:
(WebCore::InlineFlowBox::placeBoxesHorizontally): Updated for change from QChar
to UChar.
(WebCore::EllipsisBox::paint): Updated for unicode() -> characters() name change.
* rendering/render_list.cpp:
(WebCore::toRoman): Updated from QChar to UChar.
(WebCore::toLetterString): Ditto.
(WebCore::toHebrew): More of the same, also cleaned up the logic a bit.
(WebCore::RenderListMarker::paint): Removed the alignment parameters from the
various functions. Also removed all reliance on the width-measuring functions
that take a string.
(WebCore::RenderListMarker::calcMinMaxWidth): More of the same.
(WebCore::RenderListMarker::getRelativeMarkerRect): Ditto.
2006-05-09 Tim Omernick <timo@apple.com>
Reviewed by/co-written by Darin.
Performance improvement when drawing large numbers of animated images.
Instead of removing the "first" object from a set on each next(),
copy the clients into a vector once and keep track of the current index.
* loader/CachedObjectClientWalker.h:
* loader/CachedObjectClientWalker.cpp:
(WebCore::CachedObjectClientWalker::CachedObjectClientWalker):
(WebCore::CachedObjectClientWalker::next):
2006-05-09 Steve Falkenburg <sfalken@apple.com>
Fix Windows build. Added TextDocument.cpp to vcproj.
Reviewed by adele.
* WebCore.vcproj/WebCore/WebCore.vcproj:
2006-05-09 Steve Falkenburg <sfalken@apple.com>
Fix Windows build.
Add host calback so caller can determine success/failure of a page load.
Reviewed by kevin.
* WebCore.vcproj/WebCore/WebCore.vcproj: Fix paths, add missing files
* loader/CachedResource.h: Fix include path.
* loader/CachedResourceClientWalker.h: Fix include path.
* platform/FontPlatformData.h: Fix include path.
* platform/TransferJobClient.h: Make PlatformData, PlatformResponse an opaque struct.
* platform/image-decoders/ImageDecoder.h: Fix include path.
* platform/win/SharedTimerWin.cpp: Fix include path.
* platform/win/TransferJobWin.cpp:
(WebCore::TransferJobWndProc): Add host callback for success/failure of load.
* platform/win/TransferJobWin.h: Added. Windows version of PlatformData/PlatformResponse.
* xpath/impl/XPathFunctions.cpp: Work around missing math functions in MSVC.
(round): Work around missing math functions in MSVC.
* xpath/impl/XPathPredicate.cpp: Work around missing math functions in MSVC.
* xpath/impl/XPathValue.cpp: Work around missing math functions in MSVC.
2006-05-09 David Hyatt <hyatt@apple.com>
Revert styleForElement, pseudoStyleForElement, styleForRenderer back to
their old names, since the term "create" is not accurate.
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::styleForElement):
(WebCore::CSSStyleSelector::pseudoStyleForElement):
* css/cssstyleselector.h:
* dom/Element.cpp:
(WebCore::Element::styleForRenderer):
(WebCore::Element::recalcStyle):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::createRendererIfNeeded):
(WebCore::Node::styleForRenderer):
* dom/Node.h:
* ksvg2/svg/SVGClipPathElement.cpp:
(SVGClipPathElement::canvasResource):
* ksvg2/svg/SVGFEFloodElement.cpp:
(SVGFEFloodElement::filterEffect):
* ksvg2/svg/SVGGradientElement.cpp:
(SVGGradientElement::rebuildStops):
2006-05-09 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
* loader/TextDocument.cpp:
(WebCore::TextTokenizer::write):
Use the correct variable to prevent crashes.
2006-05-09 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=8808
WebCore should handle text files
* WebCore.xcodeproj/project.pbxproj:
Add TextDocument.cpp and TextDocument.h
* bridge/mac/WebCoreFrameBridge.mm:
(+[WebCoreFrameBridge supportedMIMETypes]):
Add text types here.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createTextDocument):
(WebCore::DOMImplementation::isTextMIMEType):
* dom/DOMImplementation.h:
New functions for creating a TextDocument and determining if a
mime type is a text MIME type.
* loader/TextDocument.cpp: Added.
(WebCore::TextTokenizer::TextTokenizer):
(WebCore::TextTokenizer::write):
(WebCore::TextTokenizer::finish):
(WebCore::TextTokenizer::isWaitingForScripts):
Special tokenizer which will put text inside a <pre> tag
in a document.
(WebCore::TextDocument::TextDocument):
(WebCore::TextDocument::createTokenizer):
Create a TextTokenizer.
* loader/TextDocument.h: Added.
* page/Frame.cpp:
(WebCore::Frame::begin):
Create a TextDocument if the MIME type is of type text.
2006-05-09 Maciej Stachowiak <mjs@apple.com>
Rubber stamped by Anders.
- renamed kxmlcore to wtf
kxmlcore --> wtf
KXMLCore --> WTF
KXC --> WTF
* ForwardingHeaders/kxmlcore: Removed.
* ForwardingHeaders/kxmlcore/AlwaysInline.h: Removed.
* ForwardingHeaders/kxmlcore/Assertions.h: Removed.
* ForwardingHeaders/kxmlcore/FastMalloc.h: Removed.
* ForwardingHeaders/kxmlcore/Forward.h: Removed.
* ForwardingHeaders/kxmlcore/HashCountedSet.h: Removed.
* ForwardingHeaders/kxmlcore/HashMap.h: Removed.
* ForwardingHeaders/kxmlcore/HashSet.h: Removed.
* ForwardingHeaders/kxmlcore/HashTraits.h: Removed.
* ForwardingHeaders/kxmlcore/Noncopyable.h: Removed.
* ForwardingHeaders/kxmlcore/OwnArrayPtr.h: Removed.
* ForwardingHeaders/kxmlcore/OwnPtr.h: Removed.
* ForwardingHeaders/kxmlcore/PassRefPtr.h: Removed.
* ForwardingHeaders/kxmlcore/Platform.h: Removed.
* ForwardingHeaders/kxmlcore/RefPtr.h: Removed.
* ForwardingHeaders/kxmlcore/Vector.h: Removed.
* ForwardingHeaders/wtf: Added.
* bindings/js/JSHTMLElementWrapperFactory.h:
* bindings/js/kjs_binding.cpp:
* bindings/js/kjs_window.h:
* bindings/objc/DOMImplementationFront.h:
* bridge/JavaAppletWidget.h:
* bridge/mac/WebCoreFrameNamespaces.mm:
* bridge/mac/WebCorePageBridge.mm:
(initializeLogChannel):
* bridge/mac/WebCoreStringTruncator.mm:
* bridge/mac/WebCoreViewFactory.m:
* config.h:
* css/css_base.h:
* css/css_valueimpl.h:
* css/csshelper.cpp:
* css/cssparser.h:
* dom/DOMImplementation.h:
* dom/Document.h:
* dom/NamedNodeMap.h:
* dom/Node.h:
* dom/NodeList.h:
* dom/QualifiedName.cpp:
* dom/Range.h:
* dom/StyledElement.cpp:
* dom/dom2_traversalimpl.h:
* dom/xml_tokenizer.h:
* editing/RebalanceWhitespaceCommand.cpp:
* editing/RemoveCSSPropertyCommand.cpp:
* editing/RemoveNodeAttributeCommand.cpp:
* editing/RemoveNodeCommand.cpp:
* editing/RemoveNodePreservingChildrenCommand.cpp:
* editing/ReplaceSelectionCommand.h:
* editing/Selection.cpp:
* editing/SetNodeAttributeCommand.cpp:
* editing/SplitElementCommand.cpp:
* editing/SplitTextNodeCommand.cpp:
* editing/SplitTextNodeContainingElementCommand.cpp:
* editing/TextIterator.h:
* editing/htmlediting.h:
* editing/markup.h:
* html/CanvasGradient.h:
* html/CanvasRenderingContext2D.h:
* html/CanvasStyle.cpp:
* html/HTMLCollection.h:
* html/HTMLElementFactory.h:
* kcanvas/KCanvasFilters.cpp:
* kcanvas/KCanvasPath.h:
* kcanvas/RenderPath.cpp:
* kcanvas/RenderSVGImage.cpp:
* kcanvas/RenderSVGText.cpp:
* kcanvas/device/quartz/KCanvasItemQuartz.mm:
* kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
* kcanvas/device/quartz/QuartzSupport.mm:
* ksvg2/misc/KSVGTimeScheduler.h:
* ksvg2/misc/SVGDocumentExtensions.h:
* ksvg2/scripts/make_names.pl:
* ksvg2/svg/SVGDOMImplementation.cpp:
* ksvg2/svg/SVGExternalResourcesRequired.h:
* ksvg2/svg/SVGFilterPrimitiveStandardAttributes.cpp:
* ksvg2/svg/SVGForeignObjectElement.cpp:
* ksvg2/svg/SVGImageElement.cpp:
* ksvg2/svg/SVGMaskElement.cpp:
* ksvg2/svg/SVGStyledElement.cpp:
* ksvg2/svg/SVGTests.h:
* ksvg2/svg/SVGTransform.h:
* ksvg2/svg/SVGTransformable.cpp:
* kwq/AccessibilityObjectCache.h:
* kwq/KWQCString.cpp:
* kwq/KWQFormData.mm:
* kwq/KWQListBox.mm:
* kwq/KWQResourceLoader.mm:
* kwq/KWQTextEdit.mm:
* loader/Cache.h:
* loader/CachedObject.h:
* loader/CachedObjectClientWalker.h:
* loader/Decoder.h:
* loader/DocLoader.h:
* loader/loader.cpp:
* loader/loader.h:
* page/DOMWindow.h:
* page/Frame.h:
* page/FramePrivate.h:
* page/FrameTree.cpp:
* page/Page.cpp:
* page/Page.h:
* page/Plugin.h:
* platform/Arena.cpp:
* platform/ArrayImpl.h:
* platform/AtomicString.cpp:
* platform/CharsetNames.cpp:
* platform/Color.cpp:
* platform/DeprecatedPtrListImpl.cpp:
* platform/DeprecatedValueListImpl.h:
* platform/FontFallbackList.h:
* platform/GraphicsContext.h:
* platform/GraphicsTypes.cpp:
* platform/Image.h:
* platform/KURL.cpp:
* platform/Logging.cpp:
* platform/Logging.h:
* platform/PlatformString.h:
* platform/PlugInInfoStore.h:
* platform/StreamingTextDecoder.cpp:
* platform/StreamingTextDecoder.h:
* platform/String.cpp:
* platform/StringHash.h:
* platform/StringImpl.cpp:
* platform/StringImpl.h:
* platform/TextEncoding.cpp:
* platform/Timer.cpp:
* platform/Timer.h:
* platform/TransferJob.h:
* platform/TransferJobInternal.h:
* platform/mac/BlockExceptions.mm:
* platform/mac/ColorMac.mm:
* platform/mac/FontData.mm:
* platform/mac/KURLMac.mm:
* platform/mac/QStringMac.mm:
* platform/mac/SharedTimerMac.cpp:
* platform/mac/TextEncodingMac.cpp:
* platform/mac/WebCoreImageRendererFactory.m:
* platform/mac/WebCoreKeyGenerator.m:
* platform/mac/WebCoreTextArea.mm:
* platform/mac/WebCoreTextField.mm:
* platform/mac/WebTextRendererFactory.h:
* platform/mac/WebTextRendererFactory.mm:
* platform/win/TemporaryLinkStubs.cpp:
(JavaAppletWidget::JavaAppletWidget):
* rendering/InlineTextBox.cpp:
* rendering/RenderText.cpp:
* rendering/RenderTreeAsText.cpp:
* rendering/bidi.cpp:
* xml/XSLTProcessor.h:
* xpath/impl/XPathExpressionNode.h:
* xpath/impl/XPathParser.h:
* xpath/impl/XPathPath.h:
* xpath/impl/XPathUtil.h:
2006-05-09 Anders Carlsson <acarlsson@apple.com>
Reviewed by Maciej.
http://bugs.webkit.org/show_bug.cgi?id=8803
XPath query for empty attributes crashes in XPath::StringExpression::StringExpression
* xpath/impl/XPathParser.cpp:
(WebCore::XPath::Parser::lexString):
Make sure an empty string is returned instead of a null string.
(WebCore::XPath::Parser::lex):
Only assign the string if it isn't null.
2006-05-09 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=8769
TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
Fix the ICU code path, too (currently unused on the Mac).
* platform/TextEncoding.cpp:
(WebCore::TextEncoding::fromUnicode): Normalize the string.
2006-05-08 Maciej Stachowiak <mjs@apple.com>
Reviewed by Tim Hatcher.
- refactor things so that WebKit doesn't save a WebResource for every loaded URL,
but rather retrieves the data from the WebCore cache as needed.
http://bugs.webkit.org/show_bug.cgi?id=8802
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge getData:andResponse:forURL:]):
(-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
* loader/Cache.cpp:
(WebCore::Cache::updateCacheStatus):
(WebCore::Cache::requestImage):
(WebCore::Cache::requestStyleSheet):
(WebCore::Cache::requestScript):
(WebCore::Cache::requestXSLStyleSheet):
(WebCore::Cache::requestXBLDocument):
* loader/Cache.h:
* loader/CachedResource.cpp: Added.
* loader/CachedResource.h: Added.
* loader/CachedResourceClient.h: Added.
* loader/CachedResourceClientWalker.cpp: Added.
* loader/CachedResourceClientWalker.h: Added.
* loader/DocLoader.cpp:
(WebCore::DocLoader::setAutoloadImages):
(WebCore::DocLoader::removeCachedObject):
* loader/DocLoader.h:
(WebCore::DocLoader::cachedObject):
(WebCore::DocLoader::allCachedObjects):
2006-05-08 Levi Weintraub <lweintraub@apple.com>
Reviewed by justin.
* editing/TextIterator.cpp:
(WebCore::shouldEmitSpaceBeforeAndAfterNode):
Returns true when the node should have a leading and trailing space. Currently only
used for inline tables. The function shouldEmitNewlinesBeforeAndAfterNode has a
fallback for nodes with no RenderObject, but the inline property doesn't really
have a meaning without one.
(WebCore::TextIterator::handleNonTextNode):
Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
(WebCore::TextIterator::exitNode):
Checks shouldEmitSpaceBeforeAndAfterNode and inserts a space if necessary.
2006-05-08 Anders Carlsson <acarlsson@apple.com>
Try fixing the Win32 build
* WebCore.vcproj/WebCore/WebCore.vcproj:
Add XPath files to project.
2006-05-08 Anders Carlsson <acarlsson@apple.com>
Reviewed by Darin, Eric and Maciej.
http://bugs.webkit.org/show_bug.cgi?id=6638
Support Mozilla's XPathEvaluator object.
* DerivedSources.make:
Generate XPath grammar, and JavaScript wrappers.
* WebCore.xcodeproj/project.pbxproj:
Add new files to project
* bindings/js/kjs_binding.cpp:
(KJS::):
(KJS::setDOMException):
Handle setting XPath exceptions.
* bindings/objc/DOM.mm:
Just return nil for now when trying to create a wrapper for
XPath namespace nodes.
* bindings/scripts/CodeGeneratorJS.pm:
Add XPath types. Also add a "CanBeConstructed" extended attribute
for interfaces that can be constructed directly.
* bridge/mac/WebCorePageBridge.mm:
(initializeLoggingChannelsIfNecessary):
Initialize LogXPath channel.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::hasFeature):
Support "xpath" version "3.0".
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::importNode):
Ignore XPath namespace nodes.
(WebCore::Document::createExpression):
(WebCore::Document::createNSResolver):
(WebCore::Document::evaluate):
New functions which call down to a lazily created XPathEvaluator.
* dom/Document.h:
Add function declarations.
* dom/Document.idl:
Add XPath methods.
* dom/Node.h:
(WebCore::Node::):
Add XPATH_NAMESPACE_NODE type.
* editing/markup.cpp:
(WebCore::startMarkup):
Ignore XPath namespace nodes.
* page/DOMWindow.idl:
Add constructors for XPathEvaluator and XPathResult.
* platform/Logging.cpp:
* platform/Logging.h:
Add XPath log channel
* xpath: Added.
* xpath/XPathEvaluator.cpp: Added.
(WebCore::XPathEvaluator::createExpression):
(WebCore::XPathEvaluator::createNSResolver):
(WebCore::XPathEvaluator::evaluate):
* xpath/XPathEvaluator.h: Added.
(WebCore::):
* xpath/XPathEvaluator.idl: Added.
* xpath/XPathExpression.cpp: Added.
(WebCore::XPathExpression::createExpression):
(WebCore::XPathExpression::~XPathExpression):
(WebCore::XPathExpression::evaluate):
* xpath/XPathExpression.h: Added.
* xpath/XPathExpression.idl: Added.
* xpath/XPathNSResolver.cpp: Added.
(WebCore::XPathNSResolver::XPathNSResolver):
(WebCore::XPathNSResolver::lookupNamespaceURI):
* xpath/XPathNSResolver.h: Added.
* xpath/XPathNSResolver.idl: Added.
* xpath/XPathNamespace.cpp: Added.
(WebCore::XPathNamespace::XPathNamespace):
(WebCore::XPathNamespace::~XPathNamespace):
(WebCore::XPathNamespace::ownerDocument):
(WebCore::XPathNamespace::ownerElement):
(WebCore::XPathNamespace::prefix):
(WebCore::XPathNamespace::nodeName):
(WebCore::XPathNamespace::nodeValue):
(WebCore::XPathNamespace::namespaceURI):
(WebCore::XPathNamespace::nodeType):
* xpath/XPathNamespace.h: Added.
* xpath/XPathResult.cpp: Added.
(WebCore::InvalidatingEventListener::InvalidatingEventListener):
(WebCore::InvalidatingEventListener::handleEvent):
(WebCore::XPathResult::XPathResult):
(WebCore::XPathResult::~XPathResult):
(WebCore::XPathResult::convertTo):
(WebCore::XPathResult::resultType):
(WebCore::XPathResult::numberValue):
(WebCore::XPathResult::stringValue):
(WebCore::XPathResult::booleanValue):
(WebCore::XPathResult::singleNodeValue):
(WebCore::XPathResult::invalidateIteratorState):
(WebCore::XPathResult::invalidIteratorState):
(WebCore::XPathResult::snapshotLength):
(WebCore::XPathResult::iterateNext):
(WebCore::XPathResult::snapshotItem):
* xpath/XPathResult.h: Added.
(WebCore::XPathResult::):
* xpath/XPathResult.idl: Added.
* xpath/impl: Added.
* xpath/impl/XPathExpressionNode.cpp: Added.
(WebCore::XPath::Expression::evaluationContext):
(WebCore::XPath::Expression::Expression):
(WebCore::XPath::Expression::~Expression):
(WebCore::XPath::Expression::evaluate):
(WebCore::XPath::Expression::addSubExpression):
(WebCore::XPath::Expression::optimize):
(WebCore::XPath::Expression::subExprCount):
(WebCore::XPath::Expression::subExpr):
(WebCore::XPath::Expression::isConstant):
* xpath/impl/XPathExpressionNode.h: Added.
(WebCore::XPath::EvaluationContext::EvaluationContext):
* xpath/impl/XPathFunctions.cpp: Added.
(WebCore::XPath::Interval::Interval):
(WebCore::XPath::Interval::contains):
(WebCore::XPath::Interval::asString):
(WebCore::XPath::Function::setArguments):
(WebCore::XPath::Function::setName):
(WebCore::XPath::Function::arg):
(WebCore::XPath::Function::argCount):
(WebCore::XPath::Function::name):
(WebCore::XPath::FunLast::doEvaluate):
(WebCore::XPath::FunLast::isConstant):
(WebCore::XPath::FunPosition::doEvaluate):
(WebCore::XPath::FunPosition::isConstant):
(WebCore::XPath::FunLocalName::isConstant):
(WebCore::XPath::FunLocalName::doEvaluate):
(WebCore::XPath::FunNamespaceURI::isConstant):
(WebCore::XPath::FunNamespaceURI::doEvaluate):
(WebCore::XPath::FunName::isConstant):
(WebCore::XPath::FunName::doEvaluate):
(WebCore::XPath::FunCount::doEvaluate):
(WebCore::XPath::FunCount::isConstant):
(WebCore::XPath::FunString::doEvaluate):
(WebCore::XPath::FunConcat::doEvaluate):
(WebCore::XPath::FunStartsWith::doEvaluate):
(WebCore::XPath::FunContains::doEvaluate):
(WebCore::XPath::FunSubstringBefore::doEvaluate):
(WebCore::XPath::FunSubstringAfter::doEvaluate):
(WebCore::XPath::FunSubstring::doEvaluate):
(WebCore::XPath::FunStringLength::doEvaluate):
(WebCore::XPath::FunNormalizeSpace::doEvaluate):
(WebCore::XPath::FunTranslate::doEvaluate):
(WebCore::XPath::FunBoolean::doEvaluate):
(WebCore::XPath::FunNot::doEvaluate):
(WebCore::XPath::FunTrue::doEvaluate):
(WebCore::XPath::FunTrue::isConstant):
(WebCore::XPath::FunLang::doEvaluate):
(WebCore::XPath::FunLang::isConstant):
(WebCore::XPath::FunFalse::doEvaluate):
(WebCore::XPath::FunFalse::isConstant):
(WebCore::XPath::FunNumber::doEvaluate):
(WebCore::XPath::FunSum::doEvaluate):
(WebCore::XPath::FunFloor::doEvaluate):
(WebCore::XPath::FunCeiling::doEvaluate):
(WebCore::XPath::FunRound::doEvaluate):
(WebCore::XPath::FunctionLibrary::self):
(WebCore::XPath::FunctionLibrary::FunctionLibrary):
(WebCore::XPath::FunctionLibrary::createFunction):
* xpath/impl/XPathFunctions.h: Added.
* xpath/impl/XPathGrammar.y: Added.
* xpath/impl/XPathParser.cpp: Added.
(WebCore::XPath::):
(WebCore::XPath::Parser::charCat):
(WebCore::XPath::Parser::isAxisName):
(WebCore::XPath::Parser::isNodeTypeName):
(WebCore::XPath::Parser::isOperatorContext):
(WebCore::XPath::Parser::skipWS):
(WebCore::XPath::Parser::makeTokenAndAdvance):
(WebCore::XPath::Parser::makeIntTokenAndAdvance):
(WebCore::XPath::Parser::peekAheadHelper):
(WebCore::XPath::Parser::peekCurHelper):
(WebCore::XPath::Parser::lexString):
(WebCore::XPath::Parser::lexNumber):
(WebCore::XPath::Parser::lexNCName):
(WebCore::XPath::Parser::lexQName):
(WebCore::XPath::Parser::nextTokenInternal):
(WebCore::XPath::Parser::nextToken):
(WebCore::XPath::Parser::Parser):
(WebCore::XPath::Parser::reset):
(WebCore::XPath::Parser::lex):
(WebCore::XPath::Parser::parseStatement):
(WebCore::XPath::Parser::registerParseNode):
(WebCore::XPath::Parser::unregisterParseNode):
(WebCore::XPath::Parser::registerPredicateVector):
(WebCore::XPath::Parser::unregisterPredicateVector):
(WebCore::XPath::Parser::registerExpressionVector):
(WebCore::XPath::Parser::unregisterExpressionVector):
(WebCore::XPath::Parser::registerString):
(WebCore::XPath::Parser::unregisterString):
* xpath/impl/XPathParser.h: Added.
(WebCore::XPath::Token::Token):
(WebCore::XPath::Parser::):
(WebCore::XPath::Parser::current):
* xpath/impl/XPathPath.cpp: Added.
(WebCore::XPath::Filter::Filter):
(WebCore::XPath::Filter::~Filter):
(WebCore::XPath::Filter::doEvaluate):
(WebCore::XPath::LocationPath::LocationPath):
(WebCore::XPath::LocationPath::~LocationPath):
(WebCore::XPath::LocationPath::optimize):
(WebCore::XPath::LocationPath::doEvaluate):
(WebCore::XPath::Path::Path):
(WebCore::XPath::Path::~Path):
(WebCore::XPath::Path::doEvaluate):
* xpath/impl/XPathPath.h: Added.
* xpath/impl/XPathPredicate.cpp: Added.
(WebCore::XPath::Number::Number):
(WebCore::XPath::Number::isConstant):
(WebCore::XPath::Number::doEvaluate):
(WebCore::XPath::StringExpression::StringExpression):
(WebCore::XPath::StringExpression::isConstant):
(WebCore::XPath::StringExpression::doEvaluate):
(WebCore::XPath::Negative::doEvaluate):
(WebCore::XPath::NumericOp::NumericOp):
(WebCore::XPath::NumericOp::doEvaluate):
(WebCore::XPath::EqTestOp::EqTestOp):
(WebCore::XPath::EqTestOp::doEvaluate):
(WebCore::XPath::LogicalOp::LogicalOp):
(WebCore::XPath::LogicalOp::shortCircuitOn):
(WebCore::XPath::LogicalOp::isConstant):
(WebCore::XPath::LogicalOp::doEvaluate):
(WebCore::XPath::Union::doEvaluate):
(WebCore::XPath::Predicate::Predicate):
(WebCore::XPath::Predicate::~Predicate):
(WebCore::XPath::Predicate::evaluate):
(WebCore::XPath::Predicate::optimize):
* xpath/impl/XPathPredicate.h: Added.
(WebCore::XPath::NumericOp::):
(WebCore::XPath::EqTestOp::):
(WebCore::XPath::LogicalOp::):
* xpath/impl/XPathStep.cpp: Added.
(WebCore::XPath::Step::axisAsString):
(WebCore::XPath::Step::Step):
(WebCore::XPath::Step::~Step):
(WebCore::XPath::Step::evaluate):
(WebCore::XPath::Step::nodesInAxis):
(WebCore::XPath::Step::nodeTestMatches):
(WebCore::XPath::Step::optimize):
(WebCore::XPath::Step::namespaceFromNodetest):
(WebCore::XPath::Step::primaryNodeType):
* xpath/impl/XPathStep.h: Added.
(WebCore::XPath::Step::):
* xpath/impl/XPathUtil.cpp: Added.
(WebCore::XPath::isRootDomNode):
(WebCore::XPath::stringValue):
(WebCore::XPath::isValidContextNode):
* xpath/impl/XPathUtil.h: Added.
* xpath/impl/XPathValue.cpp: Added.
(WebCore::XPath::Value::Value):
(WebCore::XPath::Value::type):
(WebCore::XPath::Value::isNodeVector):
(WebCore::XPath::Value::isBoolean):
(WebCore::XPath::Value::isNumber):
(WebCore::XPath::Value::isString):
(WebCore::XPath::Value::toNodeVector):
(WebCore::XPath::Value::toBoolean):
(WebCore::XPath::Value::toNumber):
(WebCore::XPath::Value::toString):
* xpath/impl/XPathValue.h: Added.
(WebCore::XPath::Value::):
* xpath/impl/XPathVariableReference.cpp: Added.
(WebCore::XPath::VariableReference::VariableReference):
(WebCore::XPath::VariableReference::isConstant):
(WebCore::XPath::VariableReference::doEvaluate):
* xpath/impl/XPathVariableReference.h: Added.
2006-05-08 David Hyatt <hyatt@apple.com>
Comprehensive box-sizing fix. This patch changes all form controls to
have the right box-sizing values (text fields and text areas actually only
use border-box in quirks mode now, and image buttons never use border-box).
Tables are supposed to use border-box box-sizing as well, but that's a scary
enough change that I'm saving it for a separate patch.
Reviewed by mjs
* css/html4.css:
* css/quirks.css:
2006-05-07 Darin Adler <darin@apple.com>
Suggested by Mitz. Reviewed and landed by Maciej.
* dom/Document.cpp: (WebCore::Document::formElementsState): Fixed mistake where the
vector has an initial size and instead should have an initial capacity. Harmless in
a way, but hurts performance.
2006-05-07 David Hyatt <hyatt@apple.com>
Fix for bugzilla bug 8060.
Fixed width table cells weren't having their border widths
included in the effective width of the column (and thus could end up being
too small).
Reviewed by darin
Added fast/tables/fixed-cell-growth.html
* rendering/table_layout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
2006-05-07 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=8769
TextEncoding::fromUnicode() - support non-BMP characters and convert to NFC
Tests:
* fast/forms/form-data-encoding.html
* fast/forms/form-data-encoding-2.html
* platform/mac/TextEncodingMac.cpp:
(WebCore::TextEncoding::fromUnicode): Normalize the string; handle surrogate pairs.
2006-05-06 David Hyatt <hyatt@apple.com>
Rename WebCoreFont to FontPlatformData and WebTextRenderer to FontData. Merge them into the
headers (uncleanly with ifdefs at the moment, so I can see what I'm working towards).
Reviewed by mjs
* ChangeLog:
* WebCore.vcproj/WebCore/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/WebCoreStringTruncator.mm:
(stringWidth):
(truncateString):
(+[WebCoreStringTruncator widthOfString:font:]):
* kwq/KWQComboBox.mm:
(QComboBox::sizeHint):
* kwq/KWQLineEdit.mm:
(QLineEdit::sizeForCharacterWidth):
* kwq/KWQListBox.mm:
(itemTextRenderer):
(groupLabelTextRenderer):
(QListBox::sizeForNumberOfLines):
(-[KWQTableView drawRow:clipRect:]):
* platform/Font.cpp:
(WebCore::m_wordSpacing):
(WebCore::Font::Font):
(WebCore::Font::operator=):
(WebCore::Font::update):
(WebCore::Font::ascent):
(WebCore::Font::descent):
(WebCore::Font::lineSpacing):
(WebCore::Font::xHeight):
(WebCore::Font::isFixedPitch):
* platform/Font.h:
(WebCore::Font::getNSFont):
* platform/FontData.h:
(WebCore::FontData::ascent):
(WebCore::FontData::descent):
(WebCore::FontData::lineSpacing):
(WebCore::FontData::lineGap):
(WebCore::FontData::misspellingLineThickness):
(WebCore::FontData::misspellingLinePatternWidth):
(WebCore::FontData::misspellingLinePatternGapWidth):
* platform/FontDataSet.h: Removed.
* platform/FontFallbackList.h: Added.
* platform/FontPlatformData.h:
* platform/mac/FontData.mm: Added.
(WebCore::WebCoreInitializeFont):
(WebCore::WebCoreInitializeEmptyTextGeometry):
(WebCore::widthForGlyph):
(WebCore::overrideLayoutOperation):
(WebCore::FontData::~FontData):
(WebCore::FontData::xHeight):
(WebCore::FontData::drawRun):
(WebCore::FontData::floatWidthForRun):
(WebCore::FontData::drawLineForCharacters):
(WebCore::FontData::selectionRectForRun):
(WebCore::FontData::drawHighlightForRun):
(WebCore::FontData::drawLineForMisspelling):
(WebCore::FontData::pointToOffset):
(WebCore::FontData::setAlwaysUseATSU):
(WebCore::getSmallCapsRenderer):
(WebCore::findSubstituteFont):
(WebCore::rendererForAlternateFont):
(WebCore::findSubstituteRenderer):
(WebCore::computeWidthForSpace):
(WebCore::setUpFont):
(WebCore::CG_drawHighlight):
(WebCore::CG_selectionRect):
(WebCore::CG_draw):
(WebCore::CG_floatWidthForRun):
(WebCore::updateGlyphMapEntry):
(WebCore::extendGlyphMap):
(WebCore::extendWidthMap):
(WebCore::initializeATSUStyle):
(WebCore::createATSULayoutParameters):
(WebCore::getTextBounds):
(WebCore::ATSU_floatWidthForRun):
(WebCore::ATSU_drawHighlight):
(WebCore::ATSU_selectionRect):
(WebCore::ATSU_draw):
(WebCore::ATSU_pointToOffset):
(WebCore::advanceWidthIteratorOneCharacter):
(WebCore::CG_pointToOffset):
(WebCore::glyphForCharacter):
(WebCore::initializeWidthIterator):
(WebCore::advanceWidthIterator):
* platform/mac/FontMac.mm:
(WebCore::m_font):
(WebCore::FontFallbackList::~FontFallbackList):
(WebCore::FontFallbackList::platformFont):
(WebCore::FontFallbackList::primaryFont):
(WebCore::FontFallbackList::determinePitch):
(WebCore::FontFallbackList::invalidate):
(WebCore::Font::platformFont):
(WebCore::Font::selectionRectForText):
(WebCore::Font::drawText):
(WebCore::Font::drawHighlightForText):
(WebCore::Font::drawLineForText):
(WebCore::Font::drawLineForMisspelling):
(WebCore::Font::misspellingLineThickness):
(WebCore::Font::floatWidth):
(WebCore::Font::checkSelectionPoint):
* platform/mac/WebCoreTextRenderer.mm:
(WebCoreDrawTextAtPoint):
(WebCoreTextFloatWidth):
(WebCoreSetAlwaysUseATSU):
* platform/mac/WebTextRenderer.h: Removed.
* platform/mac/WebTextRenderer.mm: Removed.
* platform/mac/WebTextRendererFactory.h:
* platform/mac/WebTextRendererFactory.mm:
(-[WebTextRendererFactory isFontFixedPitch:]):
(-[WebTextRendererFactory init]):
(-[WebTextRendererFactory rendererWithFont:]):
(-[WebTextRendererFactory fontWithFamilies:traits:size:]):
* platform/win/FontWin.cpp:
(WebCore::FontFallbackList::~FontFallbackList):
(WebCore::FontFallbackList::determinePitch):
(WebCore::FontFallbackList::invalidate):
(WebCore::FontFallbackList::primaryFont):
(WebCore::Font::floatWidth):
(WebCore::Font::drawText):
(WebCore::Font::drawHighlightForText):
(WebCore::Font::selectionRectForText):
(WebCore::Font::checkSelectionPoint):
2006-05-05 Darin Adler <darin@apple.com>
- fix the Windows build
* platform/win/FontWin.cpp: (WebCore::getFontData):
2006-05-05 Darin Adler <darin@apple.com>
* platform/SegmentedString.h: (WebCore::SegmentedString::advance): Oops!
Removed an extra ! that was causing everything to fail.
2006-05-05 Darin Adler <darin@apple.com>
Reviewed by Tim Hatcher.
- remove a few of the stranger features of QChar on the road to
eventually replacing it with an integer type (probably ICU's UChar)
* platform/DeprecatedString.h: Remove SpecialCharacter, byteOrderMark, null,
cell, row, isNull, mirrored, mirroredChar, operator char, >, >=, <, and <=
from QChar. Also removed the many unneeded friend declarations. Remove findArg
and arg from DeprecatedString.
* dom/Document.cpp: (WebCore::Document::parseQualifiedName): Cast the type of the
buffer before invoking the U16_NEXT function. Turns out this was converting each
QChar to a char and back to a UChar, which means it caused a bug with characters
that are U+0100 or greater.
* css/csshelper.cpp: (WebCore::parseURL):
* html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::constrainValue):
* platform/StringImpl.cpp: (WebCore::StringImpl::toCoordsArray):
* xml/xmlhttprequest.cpp: (WebCore::getCharset):
Add some calls to unicode() since we don't have comparison operators any more.
* dom/StyledElement.cpp:
(WebCore::toHex): Rewrote to just take a UChar parameter.
(WebCore::StyledElement::addCSSColor): Call toHex on the character code.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
* editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply):
* editing/TextIterator.cpp: (WebCore::TextIterator::handleTextBox):
* platform/SegmentedString.h:
(WebCore::SegmentedString::push):
(WebCore::SegmentedString::advance):
(WebCore::SegmentedString::escaped):
* platform/SegmentedString.cpp:
(WebCore::SegmentedString::length):
(WebCore::SegmentedString::append):
(WebCore::SegmentedString::prepend):
(WebCore::SegmentedString::toString):
Changed calls to isNull() to instead just use unicode() and check for 0.
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::parseEntity): Change callers that used cell and row to
just use unicode() instead.
(WebCore::HTMLTokenizer::parseTag): Ditto.
* loader/Decoder.cpp: (Decoder::decode): Changed code that did a type cast to
unsigned char to instead call unicode().
* platform/DeprecatedString.cpp:
(KWQStringData::makeAscii): Call latin1() instead of relying on the conversion operator.
(DeprecatedString::DeprecatedString): Call unicode() instead of relying on the conversion
operator (the character has been tested and is known to be ASCII).
(DeprecatedString::at): Use 0 instead of QChar::null.
(DeprecatedString::compare): Use unicode() so we can do comparison since we don't have
comparison operators any more.
(DeprecatedString::find): Call unicode() instead of relying on the conversion
operator (the character has been tested and is known to be ASCII).
(DeprecatedString::findRev): Ditto.
(DeprecatedString::copyLatin1): Call latin1() instead of relying on the conversion operator.
(DeprecatedString::lower): Call unicode() instead of relying on the conversion
operator (the character has been tested and is known to be ASCII).
(DeprecatedString::insert): Ditto.
(DeprecatedString::replace): Ditto.
(DeprecatedString::fill): Ditto.
(DeprecatedString::append): Ditto.
* html/html_inlineimpl.cpp: (WebCore::HTMLAnchorElement::defaultEventHandler):
Eliminate the one use of DeprecatedString::arg.
- other cleanup
* kwq/KWQCString.cpp: Remove unneeded "using" directive.
* html/HTMLElementFactory.cpp:
(WebCore::htmlConstructor):
(WebCore::headConstructor):
(WebCore::bodyConstructor):
(WebCore::baseConstructor):
(WebCore::linkConstructor):
(WebCore::metaConstructor):
(WebCore::styleConstructor):
(WebCore::titleConstructor):
(WebCore::frameConstructor):
(WebCore::framesetConstructor):
(WebCore::iframeConstructor):
(WebCore::formConstructor):
(WebCore::buttonConstructor):
(WebCore::inputConstructor):
(WebCore::isindexConstructor):
(WebCore::fieldsetConstructor):
(WebCore::labelConstructor):
(WebCore::legendConstructor):
(WebCore::optgroupConstructor):
(WebCore::optionConstructor):
(WebCore::selectConstructor):
(WebCore::textareaConstructor):
(WebCore::dlConstructor):
(WebCore::ulConstructor):
(WebCore::olConstructor):
(WebCore::dirConstructor):
(WebCore::menuConstructor):
(WebCore::liConstructor):
(WebCore::blockquoteConstructor):
(WebCore::divConstructor):
(WebCore::headingConstructor):
(WebCore::hrConstructor):
(WebCore::paragraphConstructor):
(WebCore::preConstructor):
(WebCore::basefontConstructor):
(WebCore::fontConstructor):
(WebCore::modConstructor):
(WebCore::anchorConstructor):
(WebCore::imageConstructor):
(WebCore::mapConstructor):
(WebCore::areaConstructor):
(WebCore::canvasConstructor):
(WebCore::appletConstructor):
(WebCore::embedConstructor):
(WebCore::objectConstructor):
(WebCore::paramConstructor):
(WebCore::scriptConstructor):
(WebCore::tableConstructor):
(WebCore::tableCaptionConstructor):
(WebCore::tableColConstructor):
(WebCore::tableRowConstructor):
(WebCore::tableCellConstructor):
(WebCore::tableSectionConstructor):
(WebCore::brConstructor):
(WebCore::quoteConstructor):
(WebCore::marqueeConstructor):
Mark functions static, remove unused parameters, change from docPtr to doc.
2006-05-05 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Maciej.
- http://bugs.webkit.org/show_bug.cgi?id=8626
Strict mode erroneously triggered by a broken comment
Test: fast/parser/broken-comments-vs-parsing-mode.html
* page/Frame.cpp:
(WebCore::Frame::endIfNotLoading): Call determineParseMode() if needed.
2006-05-05 Darin Adler <darin@apple.com>
- fix the Windows build (this time for sure)
* platform/win/TemporaryLinkStubs.cpp:
(GraphicsContext::translate): Added.
(GraphicsContext::rotate): Ditto.
(GraphicsContext::scale): Ditto.
2006-05-05 Darin Adler <darin@apple.com>
- fix the Windows build
* bridge/win/FrameWin.h: Add Element* parameter to createPlugin.
* platform/win/TemporaryLinkStubs.cpp: (FrameWin::createPlugin): Ditto.
2006-05-05 Darin Adler <darin@apple.com>
- get the Windows build a little closer to building again
* platform/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawRect): Call alpha to check if the color is transparent.
Call setColor directly instead of setColorFromPen.
(WebCore::GraphicsContext::drawLine): Ditto.
(WebCore::GraphicsContext::drawEllipse): Ditto.
(WebCore::GraphicsContext::drawArc): Ditto.
(WebCore::GraphicsContext::drawConvexPolygon): Ditto.
* platform/win/TemporaryLinkStubs.cpp: (JavaAppletWidget::JavaAppletWidget): Updated parameter types.
2006-05-05 Darin Adler <darin@apple.com>
Reviewed by Adele.
- fixed data structure used to save/restore form element state to remove the
O(n^2) algorithm and remove anomalies in how it works
- fix http://bugs.webkit.org/show_bug.cgi?id=8683
REGRESSION: imdb search button has "Submit" overload after going back
* manual-tests/form-value-restore.html: Added.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge saveDocumentState]): Rewrote to call the new formElementsState
function on the document and also to convert null strings to NSNull instead of empty
NSString objects.
(-[WebCoreFrameBridge restoreDocumentState]): Ditto, with the setStateForNewFormElements
function.
* dom/Document.h: Added FormElementKey, FormElementKeyHash, and FormElementKeyHashTraits
for use in the hash map. Made readyState, inputEncoding, defaultCharset, charset,
characterSet, getElementByAccessKey, haveStylesheetsLoaded, usesDescendantRules,
usesSiblingRules, inCompatMode, inAlmostStrictMode, inStrictMode, preferredStylesheetSet,
selectedStylesheetSet, and getCSSTarget all const member functions. Removed the unused
nextState function. Renamed registerMaintainsState and deregisterMaintainsState to
registerFormElementWithState and HTMLGenericFormElement and changed them to use form
elements rather than arbitrary DOM nodes. Replaced docState with formElementsState and
setRestoreState and restoreState with setStateForNewFormElements, hasStateForNewFormElements,
and takeStateForFormElement. Replaced m_maintainsState with m_formElementsWithState,
m_state with m_stateForNewFormElements. Made m_elementsByAccessKey and m_accessKeyMapValid
mutable. Removed unused m_elementNames, m_elementNameAlloc, m_elementNameCount, m_attrNames,
m_attrNameAlloc, m_attrNameCount, m_namespaceURIs, m_namespaceURIAlloc, m_namespaceURICount.
* dom/Document.cpp:
(WebCore::Document::Document): Remove initialization of long-obsolete m_elementNames and
m_attrNames.
(WebCore::Document::~Document): Remove destruction of same.
(WebCore::Document::readyState): Made const.
(WebCore::Document::inputEncoding): Ditto.
(WebCore::Document::defaultCharset): Ditto.
(WebCore::Document::getElementByAccessKey): Ditto.
(WebCore::Document::preferredStylesheetSet): Ditto.
(WebCore::Document::selectedStylesheetSet): Ditto.
(WebCore::Document::getCSSTarget): Ditto.
(WebCore::Document::formElementsState): Added. Replaces the old docState function.
Builds a vector of strings, with 3 strings for each form element containing the
name, type, and state value.
(WebCore::Document::setStateForNewFormElements): Added. Converts the state vector
into a hash map, considering the scheme with 3 strings for form element used above.
(WebCore::Document::hasStateForNewFormElements): Added.
(WebCore::Document::takeStateForFormElement): Added. Given a name and type, looks
up the values in the hash map and "peels off" the last one.
(WebCore::FormElementKey::FormElementKey): Added.
(WebCore::FormElementKey::~FormElementKey): Added.
(WebCore::FormElementKey::operator=): Added.
(WebCore::FormElementKey::ref): Added.
(WebCore::FormElementKey::deref): Added.
(WebCore::FormElementKeyHash::hash): Added.
(WebCore::FormElementKeyHashTraits::deletedValue): Added.
* dom/Element.h: Removed state function.
* dom/Node.h: Removed maintainsState, state, and restoreState functions.
* dom/Node.cpp: Ditto.
* dom/QualifiedName.cpp: Reformatted.
(WebCore::hashComponents): Removed code to handle buffers that are not multiples
of 4 bytes, since a QualifiedName is guaranteed to be; also asserted that fact.
* html/HTMLParser.cpp:
(WebCore::HTMLParser::insertNode): Remove code to restore state; that's now handled
by closeRenderer.
(WebCore::HTMLParser::popOneBlock): Ditto.
* html/HTMLFormElement.cpp: Added include of HTMLInputElement.h.
* html/HTMLGenericFormElement.h: Changed form to be a const member function.
Changed type function to return a const AtomicString& instead of a String.
Added an override of closeRenderer. Removed state and findMatchingState functions.
Added stateValue and restoreState functions. Made m_form, m_disabled, and m_readOnly
be private instead of protected. Removed m_inited. Changed booleans to not use bit
fields since there are only two of them.
* html/HTMLGenericFormElement.cpp: Removed encodedElementName, state, and
findMatchingState functions.
(WebCore::HTMLGenericFormElement::stateValue): Added. No implementation. This will only be
called for subclasses that call registerFormElementWithState, and those will override and
implement it.
(WebCore::HTMLGenericFormElement::restoreState): Ditto.
(WebCore::HTMLGenericFormElement::closeRenderer): Added. Replaces code that was in the
HTML parser. Calls takeStateForFormElement, passing in the name and type, and if a
state is found, calls restoreState.
* html/HTMLButtonElement.h: Changed type to return a const AtomicString& instead
of a String.
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::type): Return a const AtomicString& instead of a
String.
(WebCore::HTMLButtonElement::defaultEventHandler): Use form() instead of m_form.
(WebCore::HTMLButtonElement::isSuccessfulSubmitButton): Use disabled() instead of
m_disabled.
* html/HTMLInputElement.h: Changed type to return a const AtomicString& instead
of a String. Removed maintainsState, state, and restoreState functions, and added
new stateValue and restoreState functions. Added m_inited (moved here from the generic
form element base class).
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::init): Call registerFormElementWithState. This was
formerly done by the HTML parser.
(WebCore::HTMLInputElement::~HTMLInputElement): Call deregisterFormElementWithState
by its new name.
(WebCore::HTMLInputElement::isKeyboardFocusable): Use form() instead of m_form.
(WebCore::HTMLInputElement::setType): Ditto.
(WebCore::HTMLInputElement::setInputType): Ditto. Also call inputType() != PASSWORD
instead of maintainsState(), since this is the only function that needs to know
the rule and it's no longer a function in the base class. Also call register and
deregister functions by their new names.
(WebCore::HTMLInputElement::type): Changed to return const AtomicString& instead
of String.
(WebCore::HTMLInputElement::stateValue): Renamed from state and changed to no
longer include the name and type, formerly obtained by calling the base class's
HTMLGenericFormElement::state, and to no longer modify the value() string by
adding a ".", which gets in the way of distinguishing null and empty values
and is slower and unnecessary.
(WebCore::HTMLInputElement::restoreState): Changed because it takes a single
state and doesn't need to call findMatchingState, and also to no longer remove the last
character from the value when restoring state.
(WebCore::HTMLInputElement::parseMappedAttribute): Use form() instead of m_form.
(WebCore::HTMLInputElement::isSuccessfulSubmitButton): Use disabled() instead of
m_disabled.
(WebCore::HTMLInputElement::setChecked): Use form() instead of m_form.
(WebCore::HTMLInputElement::preDispatchEventHandler): Ditto.
(WebCore::HTMLInputElement::defaultEventHandler): Ditto.
* html/HTMLSelectElement.h: Changed type to return a const AtomicString& instead
of a String.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::HTMLSelectElement): Call registerFormElementWithState.
This was formerly done by the HTML parser.
(WebCore::HTMLSelectElement::~HTMLSelectElement): Call deregisterFormElementWithState
by its new name.
(WebCore::HTMLSelectElement::type): Changed to return const AtomicString& instead
of String.
(WebCore::HTMLSelectElement::stateValue): Renamed from state and changed to no
longer include the name and type, formerly obtained by calling the base class's
HTMLGenericFormElement::state, and to build the string in a Vector<char> instead of
appending characters one at a time to a string.
(WebCore::HTMLSelectElement::restoreState): Changed because it takes a single
state and doesn't need to call findMatchingState.
(WebCore::HTMLSelectElement::defaultEventHandler): Use form() instead of m_form.
* html/HTMLTextAreaElement.h: Changed type to return a const AtomicString& instead
of a String. Removed maintainsState, state, and restoreState functions, and added
new stateValue and restoreState functions.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Call registerFormElementWithState.
This was formerly done by the HTML parser. Also use member initialization instead of
assignment.
(WebCore::HTMLTextAreaElement::~HTMLTextAreaElement): Call deregisterFormElementWithState
by its new name.
(WebCore::HTMLTextAreaElement::type): Changed to return const AtomicString& instead
of String.
(WebCore::HTMLTextAreaElement::stateValue): Renamed from state and changed to no
longer include the name and type, formerly obtained by calling the base class's
HTMLGenericFormElement::state, and to no longer modify the value() string by
adding a ".", which is unnecessary.
(WebCore::HTMLTextAreaElement::restoreState): Changed because it takes a single
state and doesn't need to call findMatchingState, and also to no longer remove the last
character from the value when restoring state.
(WebCore::HTMLTextAreaElement::updateValue): Changed to const.
(WebCore::HTMLTextAreaElement::value): Ditto.
(WebCore::HTMLTextAreaElement::defaultValue): Ditto.
* html/HTMLFieldSetElement.h: Changed type to return a const AtomicString& instead
of a String.
* html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::type): Ditto.
* html/HTMLKeygenElement.h: Ditto.
* html/HTMLKeygenElement.cpp: (WebCore::HTMLKeygenElement::type): Ditto.
* html/HTMLLegendElement.h: Ditto.
* html/HTMLLegendElement.cpp: (WebCore::HTMLLegendElement::type):
* html/HTMLOptGroupElement.h: Ditto.
* html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::type): Ditto.
* html/HTMLOptionElement.h: Ditto.
* html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::type): Ditto.
* ksvg2/svg/SVGAnimationElement.cpp: (SVGAnimationElement::closeRenderer):
Added missing call to base class.
* rendering/render_form.h: Removed element() functions that cast to the
appropriate derived element class. They do make some bits of code slightly
more readable, but they also require including too many headers. Removed
the includes of HTMLInputElement.h, HTMLSelectElement.h, HTMLTextAreaElement.h,
and KWQLineEdit.h, and added an include of GraphicsTypes.h.
* rendering/render_form.cpp:
(WebCore::RenderFormElement::updateFromElement): Changed use of element()
to instead use node() and cast.
(WebCore::RenderFormElement::clicked): Ditto.
(WebCore::RenderLineEdit::selectionChanged): Ditto.
(WebCore::RenderLineEdit::returnPressed): Ditto.
(WebCore::RenderLineEdit::performSearch): Ditto.
(WebCore::RenderLineEdit::addSearchResult): Ditto.
(WebCore::RenderLineEdit::calcMinMaxWidth): Ditto.
(WebCore::RenderLineEdit::setStyle): Ditto.
(WebCore::RenderLineEdit::updateFromElement): Ditto.
(WebCore::RenderLineEdit::valueChanged): Ditto.
(WebCore::RenderFileButton::calcMinMaxWidth): Ditto.
(WebCore::RenderFileButton::updateFromElement): Ditto.
(WebCore::RenderFileButton::returnPressed): Ditto.
(WebCore::RenderFileButton::valueChanged): Ditto.
(WebCore::RenderSelect::updateFromElement): Ditto.
(WebCore::RenderSelect::layout): Ditto.
(WebCore::RenderSelect::valueChanged): Ditto.
(WebCore::RenderSelect::selectionChanged): Ditto.
(WebCore::RenderSelect::updateSelection): Ditto.
(WebCore::RenderTextArea::destroy): Ditto.
(WebCore::RenderTextArea::calcMinMaxWidth): Ditto.
(WebCore::RenderTextArea::setStyle): Ditto.
(WebCore::RenderTextArea::updateFromElement): Ditto.
(WebCore::RenderTextArea::valueChanged): Ditto.
(WebCore::RenderTextArea::selectionChanged): Ditto.
(WebCore::RenderSlider::updateFromElement): Ditto.
(WebCore::RenderSlider::valueChanged): Ditto.
2006-05-05 Matt Gough <matt@softchaos.com>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=8563
Test: fast/doctypes/005-case-preserving.html
The doctype object in the DOM is now usable by client code
as opposed to always being exposed as nil. Now also ensures that
the 'name' of the component preserves the case of the original html source.
(i.e HtMl -> HtMl not HTML)
* dom/Document.h:
Changes comment by docType() to say it may return 0 for html
* html/HTMLDocument.cpp:
(WebCore::parseDocTypeDeclaration):
(WebCore::HTMLDocument::determineParseMode):
Preserves the case of the name component
(WebCore::HTMLDocument::doctype):removed
* html/HTMLDocument.h:
(WebCore::HTMLDocument::doctype):removed
2006-05-05 Rob Buis <buis@kde.org>
Reviewed by Darin.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8445:
[DOMHTMLSelectElement multiple] returns no when the select element is multiple
Correct the logic errors, which are clearly indicated by the changeset given
in the bug report.
* bindings/objc/DOMHTML.mm:
(-[DOMHTMLLinkElement disabled]):
(-[DOMHTMLSelectElement disabled]):
(-[DOMHTMLSelectElement multiple]):
(-[DOMHTMLOptGroupElement disabled]):
(-[DOMHTMLOptionElement defaultSelected]):
(-[DOMHTMLOptionElement disabled]):
2006-05-04 Darin Adler <darin@apple.com>
Reviewed by Tim Omernick.
- fix storage leak I introduced yesterday
* platform/cg/GraphicsContextCG.cpp:
(WebCore::setCGFillColor): Added.
(WebCore::setCGStrokeColor): Added.
(WebCore::GraphicsContext::drawRect): Use setCGFillColor to avoid allocating
a CGColorRef object.
(WebCore::GraphicsContext::drawLine): Use setCGStrokeColor and setCGFillColor
to avoid allocating a CGColorRef object.
(WebCore::GraphicsContext::drawEllipse): Ditto.
(WebCore::GraphicsContext::drawArc): Ditto.
(WebCore::GraphicsContext::drawConvexPolygon): Ditto.
(WebCore::GraphicsContext::fillRect): Ditto.
2006-05-04 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
* dom/Node.cpp:
(WebCore::Node::rootEditableElement):
Restored code to stop at the body tag. Editing shouldn't be allowed to
happen outside the body, so it needs to be the editable root even if the
html element is contentEditable.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::shouldMergeEnd):
Now takes in more information so it can be "the decider".
(WebCore::ReplaceSelectionCommand::doApply):
Merging two paragraphs will destroy the moved one's block styles. Perform
the end merge backward (from content already in the document to just inserted
content) if moving forward would move the paragraph that contained the start of
the selection being pasted into, since we always want to preserve that paragraph's
block style.
Moving backward in this case is also helpful because otherwise it would be
difficult to remember the position where inserted content began (since merging
would remove m_firstNodeInserted). That position is needed in order to select
the replacement and to add smart replace whitespace.
(WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
If [br, 0] is at the end of a block, the br is not necessarily collapsed
in quirks mode. [br, 0] needs to also not be at the start of a block.
* editing/ReplaceSelectionCommand.h:
2006-05-04 Tim Omernick <timo@apple.com>
Reviewed by Darin.
<rdar://problem/4537606> Give Java WebKit plugin access to its own DOM element
* bridge/mac/WebCoreFrameBridge.h:
Added DOMElement parameter to -viewForJavaAppletWithFrame:attributeNames:attributeValues:baseURL:.
* bridge/JavaAppletWidget.h:
Constructor now takes the applet's element instead of its containing frame.
* bridge/mac/JavaAppletWidget.mm:
(JavaAppletWidget::JavaAppletWidget):
Pass the applet's element to viewForJavaAppletWithFrame:.
* rendering/RenderApplet.cpp:
(WebCore::RenderApplet::createWidgetIfNecessary):
Pass the element along to JavaAppletWidget.
2006-05-04 Tim Omernick <timo@apple.com>
Reviewed by John Sullivan.
<rdar://problem/4480186> Give WebKit plugins access to their own DOM element
* bridge/mac/WebCoreFrameBridge.h:
Added DOMElement: parameter to -viewForPluginWithURL:attributeNames:attributueValues:MIMEType:
* bridge/mac/FrameMac.h:
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::createPlugin):
Added "element" parameter; wrap element in DOMElement and pass up to the bridge.
* page/Frame.h:
Added "element" parameter to createPlugin().
* page/Frame.cpp:
(WebCore::Frame::loadPlugin):
Get the plugin's DOM element and pass to createPlugin().
2006-05-04 Eric Seidel <eseidel@apple.com>
Reviewed by timo.
Add drag & drop support to <input type="file">
http://bugs.webkit.org/show_bug.cgi?id=8733
Test: manual/input-type-file-drag-drop.html
* kwq/KWQFileButton.mm:
(-[WebFileChooserButton initWithWidget::]):
(-[WebCoreFileButton initWithWidget:]):
(-[WebCoreFileButton drawRect:]):
(-[WebCoreFileButton updateLabel]):
(-[WebCoreFileButton setFilename:]):
(-[WebCoreFileButton changeFilename:]):
(-[WebCoreFileButton chooseFilename:]):
(validFilenameFromPasteboard):
(-[WebCoreFileButton draggingEntered:]):
(-[WebCoreFileButton draggingExited:]):
(-[WebCoreFileButton performDragOperation:]):
2006-05-04 Beth Dakin <bdakin@apple.com>
Reviewed by Hyatt.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8732
Backgrounds with background-size and background-origin do not
always lay out correctly
* platform/cairo/ImageCairo.cpp:
(WebCore::Image::drawTiled): We no longer need to scale the source
point since it will now come in with the scale already taken into
account.
* platform/mac/ImageMac.mm:
(WebCore::Image::drawTiled): Same as above.
* rendering/RenderBox.cpp:
(WebCore::cacluateBackgroundSize): Now calculate the background
size in a helper method.
(WebCore::RenderBox::paintBackgroundExtended): Calculate the
background size before calculating cx, cy, cw, ch, sx, and sy so
that they can all be calculated with the scaled image size taken
into account.
2006-05-04 David Hyatt <hyatt@apple.com>
Fix for 8693, crash when reloading PDF. Make sure to clear the truncator's
cached renderer.
Reviewed by beth
* bridge/mac/WebCoreStringTruncator.h:
* bridge/mac/WebCoreStringTruncator.mm:
(+[WebCoreStringTruncator clear]):
* platform/mac/WebTextRendererFactory.mm:
(-[WebTextRendererFactory clearCaches]):
2006-05-03 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=8696
another round of GraphicsContext improvements
* WebCore.xcodeproj/project.pbxproj: Added GraphicsContextCG.cpp.
* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::scale): Use new GraphicsContext function.
(WebCore::CanvasRenderingContext2D::rotate): Ditto.
(WebCore::CanvasRenderingContext2D::translate): Ditto.
* kwq/KWQComboBox.mm: Added include (not sure if this is needed for this patch,
but it's needed for one of my upcoming ones).
* platform/GraphicsContext.h: Changed fillColor and setFillColor to use Color
instead of RGBA32. Removed setColorFromFillColor and setColorFromPen. Added
scale, rotate, and translate functions.
* platform/GraphicsContext.cpp:
(WebCore::GraphicsContext::setFillColor): Changed to use Color instead of RGBA32.
(WebCore::GraphicsContext::fillColor): Ditto.
* platform/GraphicsTypes.h: Moved HorizontalAlignment here.
* platform/Widget.h: Removed HorizontalAlignment from here.
* platform/cg/GraphicsContextCG.cpp: Added. Started as a copy of GraphicsContextMac.mm.
(WebCore::GraphicsContext::drawRect): Rewrote to not rely on [NSGraphicsContext currentContext].
(WebCore::GraphicsContext::drawLine): Ditto.
(WebCore::GraphicsContext::drawEllipse): Ditto.
(WebCore::GraphicsContext::drawArc): Ditto.
(WebCore::GraphicsContext::drawConvexPolygon): Ditto.
(WebCore::GraphicsContext::fillRect): Ditto.
(WebCore::GraphicsContext::setLineWidth): Added check of paintingDisabled().
(WebCore::GraphicsContext::setMiterLimit): Ditto.
(WebCore::GraphicsContext::setAlpha): Ditto.
(WebCore::GraphicsContext::clearRect): Ditto.
(WebCore::GraphicsContext::strokeRect): Ditto.
(WebCore::GraphicsContext::setLineCap): Ditto.
(WebCore::GraphicsContext::setLineJoin): Ditto.
(WebCore::GraphicsContext::clip): Ditto.
(WebCore::GraphicsContext::scale): Added.
(WebCore::GraphicsContext::rotate): Added.
(WebCore::GraphicsContext::translate): Added.
* platform/mac/GraphicsContextMac.mm: Moved most of this file into GraphicsContextCG.cpp.
(WebCore::GraphicsContext::setCompositeOperation): Added check of paintingDisabled().
* platform/mac/WebCoreSystemInterface.h: Added declarations so this header
stands alone.
2006-05-03 Darin Adler <darin@apple.com>
Reviewed by Justin.
- fix http://bugs.webkit.org/show_bug.cgi?id=8159
REGRESSION: Clicking outside new text field focuses the field
This bug has always been present for "content editable" HTML, but
now affects <input type=text> as well. The problem is with the editing
concept of a "deep equivalent". When computing the deep equivalent,
the code can move from outside an editable area to inside. To fix this,
I removed all use of the "deep equivalent" concept.
* rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
Changed argument names from _x and _y to just x and y. When the element
is the editable root, changed things so that clicks that are not within
the element at all return positions before or after the element, rather than
always choosing the closest point within the element. This gets us off on
the right foot, by not choosing a position inside an editable root when you
click outside that editable root. This code handles shadowParentNode as well,
and also calls positionForCoordinates on children rather than calling
positionForRenderer (which I believe is now a function that can be removed).
* editing/VisiblePosition.h: Removed the deepEquivalent function.
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::previousVisiblePosition): Removed use of the
deepEquivalent function. Also, to make this function easier to understand
I separated out the case where the start point is "in rendered content"
and the case where it's not into two separate loops.
(WebCore::VisiblePosition::nextVisiblePosition): Ditto.
(WebCore::VisiblePosition::initDeepPosition): Removed use of the deepEquivalent
function. Also added code to make sure that this work never turns a position
outside an editable element into a position inside that editable element, or
vice versa. Reorganized the code a bit.
* dom/Position.cpp:
(WebCore::Position::upstream): Removed use of the deepEquivalent function.
(WebCore::Position::downstream): Ditto.
* editing/htmlediting.cpp:
(WebCore::editingIgnoresContent): Changed to use isReplaced instead of isWidget
and isImage to determine if editing should ignore content.
(WebCore::firstInSpecialElement): Rewrote isFirstVisiblePositionInSpecialElement
to have code to share with positionBeforeContainingSpecialElement. And changed
to allow both the position just before a table and the position just inside a
table to qualify. While this is slightly sloppy, the old code worked because
of the "deep equivalent" technique. This change is needed to get the desired
results even without that technique.
(WebCore::lastInSpecialElement): Ditto.
(WebCore::isFirstVisiblePositionInSpecialElement): Changed to use the new function.
(WebCore::positionBeforeContainingSpecialElement): Ditto.
(WebCore::isLastVisiblePositionInSpecialElement): Ditto.
(WebCore::positionAfterContainingSpecialElement): Ditto.
* dom/Node.cpp: (WebCore::Node::rootEditableElement): Rewrote to remove
special case for body tag.
- other changes
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setOuterHTML): Added a FIXME about the fact
that this won't merge neighboring text nodes the way setOuterText does.
(WebCore::HTMLElement::setInnerText): Added a FIXME about the fact that
this creates a text node even when setting to empty text.
(WebCore::HTMLElement::setOuterText): Ditto.
* editing/DeleteSelectionCommand.cpp: Removed some #if 1 and #if 0.
* editing/ReplaceSelectionCommand.cpp: A little reformatting.
* rendering/render_button.h: Tiny formatting tweak.
2006-05-02 Adele Peterson <adele@apple.com>
Reviewed by Beth.
Fix for <rdar://problem/4523671>
REGRESSION (NativeTextField): Auto-complete popup list doesn't appear at the correct location after scrolling page.
* bindings/objc/DOMHTML.mm: (-[DOMHTMLInputElement _rectOnScreen]):
Use the documentView to compute the correct rect for the element when the view is scrolled.
2006-05-02 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<http://bugs.webkit.org/show_bug.cgi?id=8704>
Fix a few end merge bugs
<rdar://problem/4424044>
REGRESSION: Extra line appears when typing
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge smartInsertForString:replacingRange:beforeString:afterString:]):
Use renamed characterAfter.
* editing/InsertParagraphSeparatorCommand.cpp:
(WebCore::InsertParagraphSeparatorCommand::doApply):
Regenerate a VisiblePosition that became stale during a text node split.
Don't rebalance whitespace after the operation, 1) it has a bug that turns preserved
newlines into nbsps, 2) I think it should only be done during serialization, not after
every command (since editable regions now always have -webkit-nbsp-mode:space on them).
Use a regular br for the placeholder as I think we can move away from -webkit-block-placeholders.
* editing/RebalanceWhitespaceCommand.cpp: Added FIXMEs.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::shouldMergeStart): Removed FIXME.
(WebCore::ReplaceSelectionCommand::shouldMergeEnd): Can now use rendering information.
(WebCore::ReplaceSelectionCommand::doApply):
Call shouldMergeEnd after the insertion so that it can use rendering information.
Don't use positionAfterNode of the last node inserted to mark the position at the end
of inserted content because canonicalization can send it into content that was already
in the document.
* editing/ReplaceSelectionCommand.h:
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::characterAfter):
Renamed. When two candidates are visually equivalent, the rightmost candidate will be
the one inside the text node where the character will be.
* editing/VisiblePosition.h:
* editing/htmlediting.cpp:
(WebCore::enclosingTableCell): Added.
(WebCore::enclosingList):
* editing/htmlediting.h:
2006-05-02 David Hyatt <hyatt@apple.com>
Partial fix for the crash in bugzilla bug 8088. There's a third crash
even after fixing this though.
Reviewed by darin
* platform/mac/WebTextRenderer.mm:
(WebCore::WidthMap::widths):
(WebCore::extendWidthMap):
* platform/mac/WebTextRendererFactory.mm:
(-[WebTextRendererFactory clearCaches]):
2006-05-02 Steve Falkenburg <sfalken@apple.com>
Reviewed by eric.
* WebCore.vcproj/WebCore/WebCore.vcproj: defined NDEBUG in release build
* bridge/win/FrameWin.cpp:
(WebCore::FrameWin::FrameWin): turned on javascript.
* kwq/KWQKHTMLSettings.h:
(KHTMLSettings::KHTMLSettings): initialized settings to 0
2006-05-02 David Hyatt <hyatt@apple.com>
Make sure to updateLayout on all scrolling functions (in particular when
setting scrollLeft/Top).
Reviewed by eric
fast/overflow/008,html added as a test case.
* dom/Element.cpp:
(WebCore::Element::scrollIntoView):
(WebCore::Element::scrollIntoViewIfNeeded):
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
2006-05-02 Anders Carlsson <andersca@mac.com>
Reviewed by Dave Hyatt.
http://bugs.webkit.org/show_bug.cgi?id=8688
file URLs aren't being serialized correctly when using window.location
* platform/KURL.cpp:
(KURL::prettyURL):
Append "//" for file URLs.
2006-05-01 David Hyatt <hyatt@apple.com>
Convert WebTextRenderer to be a C++ class. Change the factory so
that it uses pointer-based hashmaps instead of NSMutableDictionaries.
Convert uses of malloc/free to new/delete so that they start using
the fastMalloc/fastFree code.
Reviewed by darin
* bridge/mac/WebCoreStringTruncator.mm:
(stringWidth):
(truncateString):
* kwq/KWQComboBox.mm:
(QComboBox::sizeHint):
* kwq/KWQLineEdit.mm:
(QLineEdit::sizeForCharacterWidth):
* kwq/KWQListBox.mm:
(itemTextRenderer):
(groupLabelTextRenderer):
(QListBox::sizeForNumberOfLines):
(QListBox::clearCachedTextRenderers):
(-[KWQTableView drawRow:clipRect:]):
* platform/FontDataSet.h:
* platform/mac/FontMac.mm:
(WebCore::FontDataSet::~FontDataSet):
(WebCore::FontDataSet::getRenderer):
(WebCore::FontDataSet::invalidate):
(WebCore::Font::ascent):
(WebCore::Font::descent):
(WebCore::Font::lineSpacing):
(WebCore::Font::xHeight):
(WebCore::Font::selectionRectForText):
(WebCore::Font::drawText):
(WebCore::Font::drawHighlightForText):
(WebCore::Font::drawLineForText):
(WebCore::Font::drawLineForMisspelling):
(WebCore::Font::misspellingLineThickness):
(WebCore::Font::floatWidth):
(WebCore::Font::checkSelectionPoint):
* platform/mac/WebCoreTextRenderer.mm:
(WebCoreDrawTextAtPoint):
(WebCoreTextFloatWidth):
(WebCoreSetAlwaysUseATSU):
* platform/mac/WebTextRenderer.h:
(WebCore::WebTextRenderer::ascent):
(WebCore::WebTextRenderer::descent):
(WebCore::WebTextRenderer::lineSpacing):
(WebCore::WebTextRenderer::lineGap):
(WebCore::WebTextRenderer::misspellingLineThickness):
(WebCore::WebTextRenderer::misspellingLinePatternWidth):
(WebCore::WebTextRenderer::misspellingLinePatternGapWidth):
* platform/mac/WebTextRenderer.mm:
(WebCore::WebCoreInitializeFont):
(WebCore::WebCoreInitializeTextRun):
(WebCore::WebCoreInitializeEmptyTextStyle):
(WebCore::WebCoreInitializeEmptyTextGeometry):
(WebCore::widthForGlyph):
(WebCore::overrideLayoutOperation):
(WebCore::m_ATSUMirrors):
(WebCore::WebTextRenderer::~WebTextRenderer):
(WebCore::WebTextRenderer::xHeight):
(WebCore::WebTextRenderer::drawRun):
(WebCore::WebTextRenderer::floatWidthForRun):
(WebCore::WebTextRenderer::drawLineForCharacters):
(WebCore::WebTextRenderer::selectionRectForRun):
(WebCore::WebTextRenderer::drawHighlightForRun):
(WebCore::WebTextRenderer::drawLineForMisspelling):
(WebCore::WebTextRenderer::pointToOffset):
(WebCore::WebTextRenderer::setAlwaysUseATSU):
(WebCore::getSmallCapsRenderer):
(WebCore::findSubstituteFont):
(WebCore::rendererForAlternateFont):
(WebCore::computeWidthForSpace):
(WebCore::setUpFont):
(WebCore::CG_selectionRect):
(WebCore::CG_draw):
(WebCore::updateGlyphMapEntry):
(WebCore::extendGlyphMap):
(WebCore::extendWidthMap):
(WebCore::initializeATSUStyle):
(WebCore::createATSULayoutParameters):
(WebCore::disposeATSULayoutParameters):
(WebCore::addDirectionalOverride):
(WebCore::ATSU_selectionRect):
(WebCore::ATSU_draw):
(WebCore::ATSU_pointToOffset):
(WebCore::freeWidthMap):
(WebCore::freeGlyphMap):
(WebCore::glyphForCharacter):
(WebCore::advanceWidthIterator):
* platform/mac/WebTextRendererFactory.h:
* platform/mac/WebTextRendererFactory.mm:
(-[WebTextRendererFactory clearCaches]):
(-[WebTextRendererFactory init]):
(-[WebTextRendererFactory dealloc]):
(-[WebTextRendererFactory rendererWithFont:]):
2006-05-01 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
<http://bugs.webkit.org/show_bug.cgi?id=8653>
Remove a use of hasMoreThanOneBlock, which uses info from the test rendering.
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::initializePositionData):
Removed code that stopped the merge if the end of the selection to delete
was in a fully selected line, which was nonsense.
(WebCore::DeleteSelectionCommand::mergeParagraphs):
Deletion does a bad job of updating the endpoints of the selection as it removes
content. If the endpoints have been flip flipped, bail.
If deletion has removed everything from the block that contained the
start of the selection to delete, we can't create a visible position inside
that block to serve as a destination for the merge. So, we insert a placeholder
at that position to prop the block open to let content in.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Added an assert and two early returns for cases where we'll crash.
Removed a use of !fragment.hasMoreThanOneBlock, which uses test rendering info
and which was wrong.
If we've already inserted content during the start merge, insertionPos will be
the position just after that content, so inserting new content before insertionPos
will reverse its order.
2006-05-01 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Darin.
- manual test for http://bugs.webkit.org/show_bug.cgi?id=8658
Assertion failure in -[WebPluginContainerCheck _isForbiddenFileLoad]
(bridge is null) when clicking QuickTime object with href
* manual-tests/plugin-controller-datasource.html: Added.
* manual-tests/resources/orange.mov: Added.
2006-04-30 Rob Buis <buis@kde.org>
Reviewed by eseidel. Landed by eseidel.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8651:
CGContextSetLineDash: invalid dash array: emmited during WebKit tests
Properly discard invalid stroke-dasharray properties like in
invalid-css.svg. (Tests updated.)
* ksvg2/css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGStrokeDasharray):
2006-04-28 David Hyatt <hyatt@apple.com>
Make image buffer sizes in the loader more accurate, since we know we store
buffers with 4 bytes per pixel. Double sizes to account for this. Also
deal better with animated GIFs that may have thousands of frames by adding
in a heuristic that will use the data size instead of a single frame RGBA32
buffer size if it's larger.
Reviewed by darin
* loader/Cache.cpp:
* loader/CachedImage.cpp:
(WebCore::CachedImage::data):
2006-04-28 Steve Falkenburg <sfalken@apple.com>
Reviewed by eric.
No test necessary - fixing Win32 build, turned off C++ exceptions, turned off RTTI
* WebCore.vcproj/WebCore/WebCore.vcproj:
* bridge/win/FrameWin.cpp:
(WebCore::FrameWin::~FrameWin):
* bridge/win/PageWin.cpp:
(WebCore::Page::Page):
* page/Page.h:
* platform/win/TemporaryLinkStubs.cpp:
(FrameWin::saveDocumentState):
(Path::contains):
(Path::boundingRect):
2006-04-28 David Hyatt <hyatt@apple.com>
Merge WebCoreTextRenderer into WebTextRenderer. Merge WebCoreTextRendererFactory
into WebTextRendererFactory. Change all callers to refer to the concrete classes
now. Change WebCoreTextRenderer.h to be the public API that WebKit uses when
it calls in to WebCore. Clean up the exports to remove things WebKit no longer
needs.
Reviewed by darin
* WebCore.exp:
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/WebCoreStringTruncator.mm:
(stringWidth):
(truncateString):
(+[WebCoreStringTruncator widthOfString:font:]):
* kwq/KWQComboBox.mm:
(QComboBox::sizeHint):
* kwq/KWQLineEdit.mm:
(QLineEdit::sizeForCharacterWidth):
* kwq/KWQListBox.mm:
(itemTextRenderer):
(groupLabelTextRenderer):
(QListBox::sizeForNumberOfLines):
(-[KWQTableView drawRow:clipRect:]):
* platform/Font.h:
* platform/FontDataSet.h:
* platform/mac/FontMac.mm:
(WebCore::FontDataSet::getWebCoreFont):
(WebCore::FontDataSet::getRenderer):
(WebCore::FontDataSet::determinePitch):
* platform/mac/WebCoreTextRenderer.h:
* platform/mac/WebCoreTextRendererFactory.mm:
(-[WebCoreTextRendererFactory init]):
* platform/mac/WebTextRenderer.h:
* platform/mac/WebTextRenderer.mm:
* platform/mac/WebTextRendererFactory.h:
* platform/mac/WebTextRendererFactory.mm:
(WebCoreInitializeFont):
(WebCoreInitializeTextRun):
(WebCoreInitializeEmptyTextStyle):
(WebCoreInitializeEmptyTextGeometry):
(-[WebTextRendererFactory clearCaches]):
(+[WebTextRendererFactory createSharedFactory]):
(+[WebTextRendererFactory sharedFactory]):
(-[WebTextRendererFactory init]):
2006-04-28 David Hyatt <hyatt@apple.com>
Fix for 8586, move WebTextRenderer into WebCore.
Reviewed by darin
* WebCore.exp:
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/WebCoreStringTruncator.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* platform/mac/WebCoreTextRenderer.h:
* platform/mac/WebCoreTextRendererFactory.mm:
(+[WebCoreTextRendererFactory sharedFactory]):
* platform/mac/WebTextRenderer.h: Added.
* platform/mac/WebTextRenderer.mm: Added.
(widthForGlyph):
(-[WebTextRenderer initWithFont:]):
(destroy):
(-[WebTextRenderer drawLineForCharacters:yOffset:width:color:thickness:]):
(-[WebTextRenderer drawLineForMisspelling:withWidth:]):
(findSubstituteFont):
(setUpFont):
(pathFromFont):
(drawGlyphs):
(CG_draw):
(extendGlyphMap):
(extendWidthMap):
(initializeATSUStyle):
(createATSULayoutParameters):
(getTextBounds):
(addDirectionalOverride):
(ATSU_draw):
(normalizeVoicingMarks):
(advanceWidthIterator):
(fillStyleWithAttributes):
* platform/mac/WebTextRendererFactory.h: Added.
* platform/mac/WebTextRendererFactory.mm: Added.
(getAppDefaultValue):
(getUserDefaultValue):
(getLCDScaleParameters):
(fontsChanged):
(+[WebTextRendererFactory createSharedFactory]):
(-[WebTextRendererFactory isFontFixedPitch:]):
(-[WebTextRendererFactory fontWithFamily:traits:size:]):
(FontCacheKeyCopy):
(-[WebTextRendererFactory cachedFontFromFamily:traits:size:]):
2006-04-28 Eric Seidel <eseidel@apple.com>
Fix by beth. Reviewed by darin. Landed by eseidel.
Make hackish fix to avoid crash in Xcode and Filemaker.
<rdar://problem/4059059> Crash in RenderFlow::detach (XCode Documentation Window)
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
2006-04-28 Alexey Proskuryakov <ap@nypop.com>
Reviewed by hyatt.
- http://bugs.webkit.org/show_bug.cgi?id=5855
REGRESSION: revert SGML comment parsing fix (comment parsing causes most of usbank.com page to be missing)
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::parseComment): Revert one change made for acid2,
<http://weblogs.mozillazine.org/hyatt/acid6.txt>.
2006-04-28 Darin Adler <darin@apple.com>
Reviewed by Eric.
- http://bugs.webkit.org/show_bug.cgi?id=8608
make GraphicsContext more suitable for cross-platform use, step 2
- Changed GraphicsContext to use NSGraphicsContext as little as possible.
- Removed the printing flag from GraphicsContext.
- Changed GraphicsContext to assume the NSGraphicsContext is always flipped,
and got rid of parameters to pass the flipped boolean around.
* WebCore.vcproj/WebCore/WebCore.vcproj: Add GraphicsTypes.h/cpp and remove
CompositeOperator.h/cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
* bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
* html/CanvasPattern.cpp: (WebCore::patternCallback):
* html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createDrawingContext):
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(WebCore::KRenderingDeviceContextQuartz::createGraphicsContext):
* platform/mac/WidgetMac.mm: (WebCore::Widget::lockDrawingFocus):
Update for changes to GraphicsContext constructor (no flipped or printing boolean).
* html/CanvasRenderingContext2D.h: Added a Path to the context state. Changed the
LineCap and LineJoin types to use the new ones in GraphicsTypes.h instead of defining
types here in this class. Changed m_platformContextStrokeStyleIsPattern and
m_platformContextFillStyleIsPattern to be named m_appliedStrokePattern and
m_appliedFillPattern and moved them outside the __APPLE__ ifdefs. Removed the
platformContext() function. Moved applyStrokePattern and applyFillPattern out of
the __APPLE__ ifdef.
* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State): Moved the stroke pattern
booleans out of Mac-specific ifdef.
(WebCore::CanvasRenderingContext2D::save): Changed to use GraphicsContext instead
of using CGContext directly.
(WebCore::CanvasRenderingContext2D::restore): Ditto.
(WebCore::CanvasRenderingContext2D::setStrokeStyle): Ditto.
(WebCore::CanvasRenderingContext2D::setFillStyle): Ditto.
(WebCore::CanvasRenderingContext2D::setLineWidth): Ditto.
(WebCore::CanvasRenderingContext2D::lineCap): Ditto.
(WebCore::CanvasRenderingContext2D::setLineCap): Ditto.
(WebCore::CanvasRenderingContext2D::lineJoin): Ditto.
(WebCore::CanvasRenderingContext2D::setLineJoin): Ditto.
(WebCore::CanvasRenderingContext2D::setMiterLimit): Ditto.
(WebCore::CanvasRenderingContext2D::shadowColor): Ditto.
(WebCore::CanvasRenderingContext2D::setGlobalAlpha): Ditto.
(WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Ditto.
(WebCore::CanvasRenderingContext2D::scale): Update since platformContext() function
no longer exists.
(WebCore::CanvasRenderingContext2D::rotate): Ditto.
(WebCore::CanvasRenderingContext2D::translate): Ditto.
(WebCore::CanvasRenderingContext2D::beginPath): Changed to use GraphicsContext instead
of using CGContext directly.
(WebCore::CanvasRenderingContext2D::closePath): Ditto.
(WebCore::CanvasRenderingContext2D::moveTo): Ditto.
(WebCore::CanvasRenderingContext2D::lineTo): Ditto.
(WebCore::CanvasRenderingContext2D::quadraticCurveTo): Ditto.
(WebCore::CanvasRenderingContext2D::bezierCurveTo): Ditto.
(WebCore::CanvasRenderingContext2D::arcTo): Ditto.
(WebCore::CanvasRenderingContext2D::arc): Ditto.
(WebCore::CanvasRenderingContext2D::rect): Ditto.
(WebCore::CanvasRenderingContext2D::fill): Changed to use the current path from this class
instead of relying on the CGContext's current path.
(WebCore::CanvasRenderingContext2D::stroke): Ditto.
(WebCore::CanvasRenderingContext2D::clip): Changed to use the current path and use the
GraphicsContext instead of using CGContext directly.
(WebCore::CanvasRenderingContext2D::clearRect): Changed to use GraphicsContext instead
of using CGContext directly.
(WebCore::CanvasRenderingContext2D::fillRect): Update since platformContext() function
no longer exists.
(WebCore::CanvasRenderingContext2D::strokeRect): Ditto.
(WebCore::CanvasRenderingContext2D::setShadow): Ditto.
(WebCore::CanvasRenderingContext2D::applyShadow): Ditto.
(WebCore::CanvasRenderingContext2D::drawImage): Ditto.
(WebCore::CanvasRenderingContext2D::drawImageFromRect): Ditto.
(WebCore::CanvasRenderingContext2D::createPattern): Ditto.
(WebCore::CanvasRenderingContext2D::applyStrokePattern): Made a tiny bit of this function
cross-platform. The bulk is still Mac-specific.
(WebCore::CanvasRenderingContext2D::applyFillPattern): Ditto.
* html/CanvasStyle.h: Changed to use GraphicsContext instead of CGContext. Now the
platform-specific stuff is in the implementation, not the header.
* html/CanvasStyle.cpp:
(WebCore::CanvasStyle::applyStrokeColor): Moved the ifdefs inside the function, getting
us one step closer to platform independence.
(WebCore::CanvasStyle::applyFillColor): Ditto.
* html/html_imageimpl.cpp:
(WebCore::HTMLAreaElement::getRect): Update for changes to the Path class.
(WebCore::HTMLAreaElement::getRegion): Ditto.
* page/Frame.cpp:
(WebCore::Frame::paint): Change to check printing flag on the document, rather than on
the GraphicsContext, since there is no printing flag for GraphicsContext any more.
(WebCore::Frame::adjustPageHeight): Update for change to GraphicsContext constructor.
* platform/GraphicsContext.h: Define a type called PlatformGraphicsContext so the
platform-specific getter and constructor don't have to be ifdef'd. Added clearRect,
strokeRect, setLineWidth, setLineCap, setLineJoin, setMiterLimit, setAlpha, setCompositeOperation,
and clip functions. Removed the isForPrinting parameter from createGraphicsContextPrivate.
* platform/GraphicsContext.cpp:
(WebCore::GraphicsContextPrivate::GraphicsContextPrivate): Removed isForPrinting.
(WebCore::GraphicsContext::createGraphicsContextPrivate): Ditto.
* platform/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
Removed NSGraphicsContext.
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
Ditto.
(WebCore::GraphicsContext::GraphicsContext): Removed constructor that
takes an NSGraphicsContext. Removed the flipText and forPrinting parameters
to the other constructor.
(WebCore::GraphicsContext::savePlatformState): Removed NSGraphicsContext code.
(WebCore::GraphicsContext::restorePlatformState): Ditto.
(WebCore::GraphicsContext::drawRect): Updated assertion to more-precisely
reflect the limitation of the current version of this function.
(WebCore::GraphicsContext::setColorFromFillColor): Ditto.
(WebCore::GraphicsContext::setColorFromPen): Ditto.
(WebCore::GraphicsContext::drawLine): Updated assertion to more-precisely
reflect the limitation of the current version of this function.
(WebCore::setCompositeOperation):
(WebCore::GraphicsContext::fillRect): Ditto.
(WebCore::GraphicsContext::setLineWidth): Added.
(WebCore::GraphicsContext::setMiterLimit): Added.
(WebCore::GraphicsContext::setAlpha): Added.
(WebCore::GraphicsContext::setCompositeOperation): Added.
(WebCore::GraphicsContext::clearRect): Added.
(WebCore::GraphicsContext::strokeRect): Added.
(WebCore::GraphicsContext::setLineCap): Added.
(WebCore::GraphicsContext::setLineJoin): Added.
(WebCore::GraphicsContext::clip): Added.
* platform/CompositeOperator.cpp: Removed.
* platform/CompositeOperator.h: Removed.
* platform/GraphicsTypes.cpp: Added. Includes CompositeOperator, LineCap, and LineJoin.
* platform/GraphicsTypes.h: Added.
* platform/Image.h: Changed include to GraphicsTypes.h from CompositeOperator.h.
* platform/Path.h: Removed constructors that take a Rect and an array of points. Made
the Path mutable. Changed the types for contains and boundingRect to be float-based
instead of int-based. Changed translate to take a FloatSize instead of two integers.
Added clear, moveTo, addLineTo, addQuadCurveTo, addBezierCurveTo, addArcTo, closeSubpath,
addArc, addRect, addEllipse, and platformPath functions. Defined a PlatformPath type
so we don't have to ifdef the header so much.
* platform/cg/PathCG.cpp:
(WebCore::Path::Path): Changed class to always have a mutable path.
(WebCore::Path::operator=): Changed to make a mutable copy.
(WebCore::Path::contains): Changed to take a FloatPoint instead of IntPoint.
(WebCore::Path::translate): Changed to use a FloatSize instead of two ints.
(WebCore::Path::boundingRect): Changed to return a FloatRect.
(WebCore::Path::moveTo): Added.
(WebCore::Path::addLineTo): Added.
(WebCore::Path::addQuadCurveTo): Added.
(WebCore::Path::addBezierCurveTo): Added.
(WebCore::Path::addArcTo): Added.
(WebCore::Path::closeSubpath): Added.
(WebCore::Path::addArc): Added.
(WebCore::Path::addRect): Added.
(WebCore::Path::addEllipse): Added.
(WebCore::Path::clear): Added.
* platform/mac/ImageMac.mm:
(WebCore::fillSolidColorInRect): Changed to take a GraphicsContext instead of
a CGContext.
(WebCore::Image::checkForSolidColor): Changed to use the new setCompositeOperation
in GraphicsContex.
(WebCore::Image::draw): Changed to use the new PDF image and fillSolidColorInRect
function that take GraphicsContext instead of CGContext.
(WebCore::Image::drawTiled): Ditto.
* platform/mac/PDFDocumentImage.h: Made most functions private. Changed to
use GraphicsContext and FloatRect instead of CGContext and NSRect. Also
removed the unused alpha and flipped booleans.
* platform/mac/PDFDocumentImage.mm:
(WebCore::PDFDocumentImage::bounds): Update for change in types.
(WebCore::PDFDocumentImage::adjustCTM): Ditto.
(WebCore::PDFDocumentImage::setCurrentPage): Ditto.
(WebCore::PDFDocumentImage::draw): Ditto.
* platform/win/TemporaryLinkStubs.cpp: Added lots of new stubs.
* rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Changed to get
printing boolean from document instead graphics context.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintChildren): Ditto.
(WebCore::RenderBlock::paintObject): Ditto.
* rendering/RenderFlow.cpp: (WebCore::RenderFlow::paintLines): Ditto.
* rendering/RenderHTMLCanvas.cpp: (WebCore::RenderHTMLCanvas::paint): Ditto.
* rendering/RenderImage.cpp: (WebCore::RenderImage::paint): Ditto.
* rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintButton): Ditto.
* rendering/render_list.cpp: (WebCore::RenderListMarker::paint): Ditto.
* rendering/render_replaced.cpp: (WebCore::RenderWidget::paint): Ditto.
2006-04-28 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by hyatt, landed by ap.
- fix http://bugs.webkit.org/show_bug.cgi?id=6769
REGRESSION: Incomplete repaint when a cell's extra bottom margin grows
Test: fast/repaint/table-extra-bottom-grow.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::overflowRect): Changed to not add the top/left overflow twice and
allow the normal overflow height to overlap with the bottom extra height.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::layout): Removed the code that resets the extra heights.
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows): If the top extra height changed or the
bottom extra height increased, just repaint the entire cell.
2006-04-28 Eric Seidel <eseidel@apple.com>
Reviewed by andersca.
Remove KCanvasContainerQuartz, pushing all logic into KCanvasContainer.
No tests affected.
* kcanvas/KCanvasContainer.cpp:
(WebCore::KCanvasContainer::canHaveChildren):
(WebCore::KCanvasContainer::requiresLayer):
(WebCore::KCanvasContainer::lineHeight):
(WebCore::KCanvasContainer::baselinePosition):
(WebCore::KCanvasContainer::calcMinMaxWidth):
(WebCore::KCanvasContainer::layout):
(WebCore::KCanvasContainer::paint):
(WebCore::KCanvasContainer::setViewport):
(WebCore::KCanvasContainer::viewport):
(WebCore::KCanvasContainer::setViewBox):
(WebCore::KCanvasContainer::viewBox):
(WebCore::KCanvasContainer::setAlign):
(WebCore::KCanvasContainer::align):
(WebCore::KCanvasContainer::viewportTransform):
(WebCore::KCanvasContainer::getAbsoluteRepaintRect):
(WebCore::KCanvasContainer::absoluteTransform):
(WebCore::KCanvasContainer::getAspectRatio):
* kcanvas/KCanvasContainer.h:
(WebCore::KCanvasContainer::renderName):
* kcanvas/device/KRenderingDevice.h:
* kcanvas/device/quartz/KCanvasResourcesQuartz.h:
* kcanvas/device/quartz/KCanvasResourcesQuartz.mm:
* kcanvas/device/quartz/KRenderingDeviceQuartz.h:
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(WebCore::KRenderingDeviceQuartz::createPaintServer):
* ksvg2/svg/SVGAElement.cpp:
(WebCore::SVGAElement::createRenderer):
* ksvg2/svg/SVGGElement.cpp:
(SVGGElement::createRenderer):
* ksvg2/svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::createRenderer):
* ksvg2/svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::createRenderer):
* ksvg2/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::createRenderer):
* ksvg2/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createRenderer):
* ksvg2/svg/SVGSwitchElement.cpp:
(WebCore::SVGSwitchElement::createRenderer):
* ksvg2/svg/SVGUseElement.cpp:
(SVGUseElement::createRenderer):
2006-04-27 Eric Seidel <eseidel@apple.com>
Reviewed by andersca.
Make WebCore accept any */*+xml type as XML.
http://bugs.webkit.org/show_bug.cgi?id=5998
<rdar://problem/4031511> XmlHttpRequest doesn't allow responses with Content-Type: application/soap+xml
Test: http/tests/xmlhttprequest/supported-xml-content-types.html
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::isXMLMIMEType):
2006-04-27 Eric Seidel <eseidel@apple.com>
* WebCore.vcproj/WebCore/WebCore.vcproj: Fix break from last checkin.
2006-04-27 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej.
- Added global constructor autogeneration for the following,
many of which are required by *.live.com: Node, Element, Range,
CSSRule, CSSValue, CSSPrimitiveValue, CSSStyleDeclaration, Event,
MutationEvent, NodeFilter
It works like so:
- The autogenerator knows about the "Constructor" data type, which
gets special treatment because it exists purely in the
bindings. It also knows about the "GenerateConstructor" interface
attribute, which does just that.
- The window interface has many Constructor attributes
- The hash table generator swizzles empty tables to tables with one
empty bucket, to prevent crashes in Lookup::findEntry. (The old
generator used to work this way, too.)
- Window object property lookup gets special treatment to allow
shadowing of its built-in global constructor properties. We'll
need to expand this mechanism in the future and make it more
flexible, but it works for now.
* DerivedSources.make:
* WebCore.vcproj/WebCore/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/kjs_css.cpp:
(KJS::toJS):
* bindings/js/kjs_css.h:
* bindings/js/kjs_window.cpp: Removed 'namedFrameGetter' and its use
because they were bogus; added FIXME describing what they were
attempting to do.
(KJS::Window::getValueProperty):
(KJS::Window::getOverridePropertySlot):
(KJS::Window::getOwnPropertySlot):
* bindings/js/kjs_window.h:
(KJS::Window::):
* bindings/scripts/CodeGeneratorJS.pm:
* css/CSSPrimitiveValue.idl:
* css/CSSRule.idl:
* css/CSSStyleDeclaration.idl: Added.
* css/CSSValue.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/Event.idl:
* dom/MutationEvent.idl:
* dom/Node.idl:
* dom/NodeFilter.idl:
* dom/Range.idl:
* page/DOMWindow.idl:
2006-04-27 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by darin
<http://bugs.webkit.org/show_bug.cgi?id=8607>
Automate repaint tests
* manual-tests/backgroundSizeRepaint.html: Removed.
* manual-tests/border-repaint-glitch.html: Removed.
* manual-tests/bugzilla-3509.html: Removed.
* manual-tests/bugzilla-5699.html: Removed.
* manual-tests/bugzilla-6278.html: Removed.
* manual-tests/bugzilla-6388.html: Removed.
* manual-tests/bugzilla-6473.html: Removed.
* manual-tests/bugzilla-7235.html: Removed.
* manual-tests/inline-outline-repaint.html: Removed.
* manual-tests/outline-repaint-glitch.html: Removed.
* manual-tests/repaint-resized-overflow.html: Removed.
* manual-tests/table-cell-move.html: Removed.
2006-04-27 Justin Garcia <justin.garcia@apple.com>
Reviewed by darin
<http://bugs.webkit.org/show_bug.cgi?id=8624>
Placeholders aren't always removed during paste
<rdar://problem/4059807>
Seed: Mail: pasting quoted content sometimes adds a phantom newline
* editing/CompositeEditCommand.cpp: Added a FIXME.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Removed two no-op setEndingSelection calls.
Store away a br at the position where we'll start inserting content in case the
br a) is made unnecessary by the insertion (it's collapsed away) b) was acting
as a placeholder and should therefore be displaced by inserted content or c) was
acting as a line break and, as a result of the insertion, is now acting as a
placeholder.
Don't only store away brs that have the webkit-block-placeholder class on them.
Any br that does any of the three things just mentioned should be removed.
The linePlaceholder removal was run after the code that makes sure to interpret
incoming brs strictly, and was negating that work in certain cases.
(WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded): Described above.
* editing/ReplaceSelectionCommand.h:
* editing/VisiblePosition.cpp:
(WebCore::isEqualIgnoringAffinity):
Added a workaround for 8622. We want this function to return true even if one of
the two visible positions has been incorrectly canonicalized.
2006-04-26 Tim Omernick <timo@apple.com>
Reviewed by Hyatt.
<rdar://problem/4068375> Flash inserted via innerHTML Fails to Show when CSS Display
Style is Toggled via Javascript
* html/html_objectimpl.cpp:
(WebCore::HTMLObjectElement::setComplete):
Set needWidgetUpdate when finished parsing, even if the object element is not in
a document. That way, when the element attaches to a document, it will update its
widget (creating the plug-in view if necessary). This is important when the object
is being inserted via setInnerHTML, since the parsed nodes are not added to the
document until the whole HTML string is parsed.
2006-04-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Hyatt.
- Fixed http://bugs.webkit.org/post_bug.cgi
REGRESSION (r14048): Google calendar not parsing
* html/HTMLParser.cpp:
(WebCore::HTMLParser::handleError): Rolling out grandparent NULL check
because it caused this regression and there's no test case
justifying it.
2006-04-26 Justin Garcia <justin.garcia@apple.com>
Reviewed by hyatt
<http://bugs.webkit.org/show_bug.cgi?id=8459>
REGRESSION: Content lost during a delete/merge of whitespace:pre text
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::prune):
The function would prune a rendered leaf because it assumed that the
first node passed to it would be a container.
The old code ascended using the DOM tree, and would remove the <b> when
pruning the <div> in <b><div></div>foo</b>. Now ascends using the render tree.
2006-04-26 Geoffrey Garen <ggaren@apple.com>
This time for sure. Fixed Windows build too.
* WebCore.vcproj/WebCore/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
2006-04-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by TimO.
Build fix.
* bindings/js/kjs_dom.cpp:
* bindings/js/kjs_domnode.h:
2006-04-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by OMG DETHBAKIN.
- Start autogenerating Node. This fixes many missing attributes in our
DOM by making prototypes hold their relevant constants as properties.
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/kjs_dom.cpp:
(KJS::DOMEventTargetNode::DOMEventTargetNode):
(KJS::toJS):
* bindings/js/kjs_dom.h:
(KJS::DOMEventTargetNode::):
* bindings/js/kjs_domnode.h: Had to break DOMNode into a separate
header to avoid circular dependency in header includes. Gave it an
old-school file name to keep distinguishing beteween old school and
news school files easy.
(KJS::DOMNode::impl):
(KJS::DOMNode::classInfo):
(KJS::DOMNode::):
* bindings/js/kjs_window.cpp:
(KJS::Window::getValueProperty):
* bindings/scripts/CodeGeneratorJS.pm:
* dom/DocumentType.idl:
* dom/Entity.idl:
* dom/Node.idl: Added.
* dom/Notation.idl:
* dom/ProcessingInstruction.idl:
2006-04-26 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
Committing the project file change jhaygood suggesed in
http://bugs.webkit.org/show_bug.cgi?id=8044
WebKit Visual Studio 2005 project shouldn't use the SolutionDir
Instead of his patch, I used the following commands:
sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g' Image\ Viewer/Image\
Viewer.vcproj > Image\ Viewer/Image\ Viewer.vcproj_ && mv Image\
Viewer/Image\ Viewer.vcproj_ Image\ Viewer/Image\ Viewer.vcproj
sed -e 's/$(SolutionDir)/$(ProjectDir)\\../g'
WebCore/WebCore.vcproj > WebCore/WebCore.vcproj_ && mv
WebCore/WebCore.vcproj_ WebCore/WebCore.vcproj
* Viewer.vcproj:
* WebCore.vcproj/WebCore/WebCore.vcproj:
2006-04-25 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
<http://bugs.webkit.org/show_bug.cgi?id=8583>
Moving paste code around and some small fixes
Moved code to make it easier to do the start merge after the fact,
with moveParagraph, instead of in the middle of the paste operation.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraph):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
(WebCore::ReplaceSelectionCommand::shouldMergeStart):
Moved code to make this decision to its own function. Moved special case
checks to the top. Added m_forceMergeStart to override the special cases
because moveParagraph uses ReplaceSelectionCommand and expects a merge.
(WebCore::ReplaceSelectionCommand::shouldMergeEnd):
No functional changes, just moved code here.
(WebCore::ReplaceSelectionCommand::doApply):
Do the end merge in the opposite direction. Merging two paragraphs destroys
the moved one's block level styles, and we prefer to use the styles of the
one that was in the document, not the one that's being pasted.
* editing/ReplaceSelectionCommand.h:
* editing/Selection.h:
(WebCore::Selection::visibleStart): Added.
(WebCore::Selection::visibleEnd): Added.
* editing/htmlediting.cpp:
(WebCore::enclosingList): Added.
(WebCore::isMailBlockquote):
Don't require a renderer so that this can be used on nodes in fragments.
* editing/htmlediting.h:
2006-04-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej.
- Removed special handling of attributes in the DOM. To match
WinIE, we used to make all attributes available as properties of
their elements in the DOM, but that has caused us more
compatibility woes than it has solved, so, after talking with Darin
and Maciej, I'm taking it out. (Firefox does not support it.)
A layout test regression caused by this change led me to do the
following as well:
- Implemented DOM properties missing on EMBED elements: align, height,
name, width, src, type. Since align, height, name, and width are
common to all plugin elements, I factored them and some other common
functionality out into a new abstract base class, HTMLPlugInElement.
- Removed extraneous attribute-to-style mappings on EMBED elements:
valign, border. Why they were there in the first place is a question
for the ages. Neither FF nor IE supports them.
* bindings/js/kjs_dom.cpp:
(KJS::getRuntimeObject):
* bindings/js/kjs_html.cpp:
(KJS::):
(KJS::JSHTMLElement::classInfo):
(KJS::JSHTMLElement::accessors):
(KJS::JSHTMLElement::embedGetter):
(KJS::JSHTMLElement::embedSetter):
* bindings/js/kjs_html.h:
(KJS::JSHTMLElement::):
* bindings/scripts/CodeGeneratorJS.pm:
* dom/Element.idl:
* html/html_objectimpl.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement):
(WebCore::HTMLPlugInElement::align):
(WebCore::HTMLPlugInElement::setAlign):
(WebCore::HTMLPlugInElement::height):
(WebCore::HTMLPlugInElement::setHeight):
(WebCore::HTMLPlugInElement::name):
(WebCore::HTMLPlugInElement::setName):
(WebCore::HTMLPlugInElement::width):
(WebCore::HTMLPlugInElement::setWidth):
(WebCore::HTMLPlugInElement::mapToEntry):
(WebCore::HTMLPlugInElement::parseMappedAttribute):
(WebCore::HTMLPlugInElement::checkDTD):
(WebCore::HTMLAppletElement::HTMLAppletElement):
(WebCore::HTMLAppletElement::~HTMLAppletElement):
(WebCore::HTMLAppletElement::parseMappedAttribute):
(WebCore::HTMLAppletElement::insertedIntoDocument):
(WebCore::HTMLAppletElement::removedFromDocument):
(WebCore::HTMLAppletElement::getInstance):
(WebCore::HTMLAppletElement::closeRenderer):
(WebCore::HTMLAppletElement::detach):
(WebCore::HTMLEmbedElement::HTMLEmbedElement):
(WebCore::HTMLEmbedElement::~HTMLEmbedElement):
(WebCore::HTMLEmbedElement::getInstance):
(WebCore::HTMLEmbedElement::mapToEntry):
(WebCore::HTMLEmbedElement::parseMappedAttribute):
(WebCore::HTMLEmbedElement::attach):
(WebCore::HTMLEmbedElement::detach):
(WebCore::HTMLEmbedElement::insertedIntoDocument):
(WebCore::HTMLEmbedElement::removedFromDocument):
(WebCore::HTMLEmbedElement::src):
(WebCore::HTMLEmbedElement::setSrc):
(WebCore::HTMLEmbedElement::type):
(WebCore::HTMLEmbedElement::setType):
(WebCore::HTMLObjectElement::HTMLObjectElement):
(WebCore::HTMLObjectElement::~HTMLObjectElement):
(WebCore::HTMLObjectElement::getInstance):
(WebCore::HTMLObjectElement::parseMappedAttribute):
(WebCore::HTMLObjectElement::rendererIsNeeded):
(WebCore::HTMLObjectElement::attach):
(WebCore::HTMLObjectElement::closeRenderer):
(WebCore::HTMLObjectElement::detach):
(WebCore::HTMLObjectElement::insertedIntoDocument):
(WebCore::HTMLObjectElement::removedFromDocument):
(WebCore::HTMLObjectElement::recalcStyle):
* html/html_objectimpl.h:
(WebCore::HTMLPlugInElement::endTagRequirement):
(WebCore::HTMLAppletElement::tagPriority):
(WebCore::HTMLEmbedElement::tagPriority):
(WebCore::HTMLObjectElement::tagPriority):
2006-04-25 Beth Dakin <bdakin@apple.com>
Reviewed by Maciej.
Fix for <rdar://problem/4518632> getComputedStyle returns 'auto'
for dimensions like 'margin-left'
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): For
margin and padding, to match Firefox we now go to the renderer to
get the property value instead of calling valueForLength() on the
style attribute. valueForLength() will return the string 'auto' if
that was what was specified in the CSS, or a percentage if it was
specified as a percent. But to match Firefox, we always want to
return a pixel value for margin and padding.
2006-04-26 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by darin. Landed by eseidel.
- fix http://bugs.webkit.org/show_bug.cgi?id=8452
mangleme(0x58c22e11): Random crashes
Test: fast/frames/empty-cols-attribute.html
* platform/StringImpl.cpp:
(WebCore::StringImpl::toLengthArray): If the string is empty, return 0
but set len to 1. This gives the same behavior you get if you don't specify
the attribute at all, matching WinIE and Firefox. Previously, the empty
string resulted in len being set to 0 (and a memory smasher in
RenderFrameSet::layout()).
* rendering/render_frames.cpp:
(WebCore::RenderFrameSet::layout): Added an assert.
2006-04-26 Oliver Hunt <ojh16@student.canterbury.ac.nz>
Reviewed by eseidel. Landed by eseidel.
* WebCore.xcodeproj/project.pbxproj:
* kcanvas/KCanvasFilters.cpp:
(WebCore::operator<<):
* kcanvas/KCanvasFilters.h:
(WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
* kcanvas/device/quartz/KCanvasFilterQuartz.h:
* kcanvas/device/quartz/KCanvasFilterQuartz.mm:
(WebCore::getVectorForChannel):
(WebCore::genImageFromTable):
(WebCore::filterForComponentFunc):
(WebCore::setParametersForComponentFunc):
(WebCore::getFilterForFunc):
(WebCore::KCanvasFEComponentTransferQuartz::getFunctionFilter):
(WebCore::KCanvasFEComponentTransferQuartz::getCIFilter):
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(WebCore::KRenderingDeviceQuartz::createFilterEffect):
* kcanvas/device/quartz/filters/WKComponentMergeFilter.cikernel: Added.
* kcanvas/device/quartz/filters/WKComponentMergeFilter.h: Added.
* kcanvas/device/quartz/filters/WKComponentMergeFilter.m: Added.
(+[WKComponentMergeFilter initialize]):
(+[WKComponentMergeFilter filterWithName:]):
(-[WKComponentMergeFilter init]):
(-[WKComponentMergeFilter outputImage]):
* kcanvas/device/quartz/filters/WKDiscreteTransferFilter.cikernel: Added.
* kcanvas/device/quartz/filters/WKDiscreteTransferFilter.h: Added.
* kcanvas/device/quartz/filters/WKDiscreteTransferFilter.m: Added.
(+[WKDiscreteTransferFilter initialize]):
(+[WKDiscreteTransferFilter filterWithName:]):
(-[WKDiscreteTransferFilter init]):
(-[WKDiscreteTransferFilter outputImage]):
* kcanvas/device/quartz/filters/WKGammaTransferFilter.cikernel: Added.
* kcanvas/device/quartz/filters/WKGammaTransferFilter.h: Added.
* kcanvas/device/quartz/filters/WKGammaTransferFilter.m: Added.
(+[WKGammaTransferFilter initialize]):
(+[WKGammaTransferFilter filterWithName:]):
(-[WKGammaTransferFilter init]):
(-[WKGammaTransferFilter outputImage]):
* kcanvas/device/quartz/filters/WKIdentityTransferFilter.h: Added.
* kcanvas/device/quartz/filters/WKIdentityTransferFilter.m: Added.
(+[WKIdentityTransferFilter initialize]):
(+[WKIdentityTransferFilter filterWithName:]):
(-[WKIdentityTransferFilter init]):
(-[WKIdentityTransferFilter outputImage]):
* kcanvas/device/quartz/filters/WKLinearTransferFilter.cikernel: Added.
* kcanvas/device/quartz/filters/WKLinearTransferFilter.h: Added.
* kcanvas/device/quartz/filters/WKLinearTransferFilter.m: Added.
(+[WKLinearTransferFilter initialize]):
(+[WKLinearTransferFilter filterWithName:]):
(-[WKLinearTransferFilter init]):
(-[WKLinearTransferFilter outputImage]):
* kcanvas/device/quartz/filters/WKTableTransferFilter.cikernel: Added.
* kcanvas/device/quartz/filters/WKTableTransferFilter.h: Added.
* kcanvas/device/quartz/filters/WKTableTransferFilter.m: Added.
(+[WKTableTransferFilter initialize]):
(+[WKTableTransferFilter filterWithName:]):
(-[WKTableTransferFilter init]):
(-[WKTableTransferFilter outputImage]):
* ksvg2/svg/SVGComponentTransferFunctionElement.cpp:
(SVGComponentTransferFunctionElement::parseMappedAttribute):
(SVGComponentTransferFunctionElement::transferFunction):
2006-04-25 Eric Seidel <eseidel@apple.com>
Reviewed by ggaren.
Make trunk match the branch. Now nodes are fully removed
from the tree before calling detach. There is (thankfully) no
good way to test this, as no one should depend on this behavior.
This change was made are part of fixing:
<rdar://problem/4427024> repro crash on www.formassembly.com in khtml::RenderBlock::addChildToFlow
<rdar://problem/4233435> CrashTracer: 2698 crashes in Safari at com.apple.WebCore: khtml::RenderBlock::addChildToFlow + 156
on the branch.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChildren):
2006-04-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele.
- don't have a fini method, since trying to call it will actually call the subclass method
and mess up the bridge count.
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge dealloc]):
(-[WebCoreFrameBridge finalize]):
2006-04-25 Steve Falkenburg <sfalkenburg@apple.com>
Reviewed by eseidel.
No test case needed
* platform/win/TemporaryLinkStubs.cpp:
(KWQFileButton::setFrameGeometry):
2006-04-25 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
Fix reproducible crash in html parser code.
http://bugs.webkit.org/show_bug.cgi?id=7137
Test: fast/parser/remove-current-node-parent.html
* html/HTMLParser.cpp:
(WebCore::HTMLParser::handleError):
2006-04-25 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- fixed http://bugs.webkit.org/show_bug.cgi?id=8575
New KWQFileButton leaks reported by buildbot
* kwq/KWQFileButton.mm:
(KWQFileButton::KWQFileButton): Add a missing release
2006-04-24 David Hyatt <hyatt@apple.com>
Fix for 8336, focus ring redrawing on top of itself. Make sure
not to include empty rects when doing the focus ring drawing, since
that results in a draw with no clip set.
Reviewed by adele
* platform/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
2006-04-24 Eric Seidel <eseidel@apple.com>
Reviewed by ggaren.
Fix for 5th worst unresolved crasher:
<rdar://problem/4129744> [REGRESSION]CrashTracer: ..400 crashes at com.apple.WebCore: DOM::NodeImpl::createRendererIfNeeded + 44
Test: fast/dom/remove-style-element.html
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChildren):
2006-04-24 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
Speculative fix for our 7th worst crasher.
Also added ASSERTs to help us better understand the issue.
<rdar://problem/4153404> CrashTracer: 2412 crashes in Safari at com.apple.WebCore: khtml::RenderStyle::RenderStyle[unified] + 44
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::setInPageCache):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::recalcStyle):
2006-04-24 Adele Peterson <adele@apple.com>
Reviewed by Hyatt.
Fix for <rdar://problem/4503438> REGRESSION (NativeTextField): Can't insert caret when
selection is active in field (Business/Unit)
* css/html4.css: Added -webkit-user-select:text for input elements.
2006-04-24 Maciej Stachowiak <mjs@apple.com>
Build fix:
- move some prematurely moved code back
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge fini]):
2006-04-24 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- move more code from WebFrameBridge to WebCoreFrameBridge
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge domain]):
(-[WebCoreFrameBridge canTargetLoadInFrame:]):
(-[WebCoreFrameBridge fini]):
(-[WebCoreFrameBridge dealloc]):
(-[WebCoreFrameBridge finalize]):
(_getPreSmartSet):
(_getPostSmartSet):
(-[WebCoreFrameBridge isCharacterSmartReplaceExempt:isPreviousCharacter:]):
(-[WebCoreFrameBridge _retrieveKeyboardUIModeFromPreferences:]):
(-[WebCoreFrameBridge keyboardUIMode]):
2006-04-24 Adele Peterson <adele@apple.com>
Reviewed by Tim O.
Fix to send textFieldDidBeginEditing on the first editing change instead of on focus.
This matches our old behavior.
* html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::dispatchFocusEvent):
* rendering/RenderTextField.cpp: (WebCore::RenderTextField::subtreeHasChanged):
2006-04-24 Beth Dakin <bdakin@apple.com>
Reviewed by Eric.
Fix for <rdar://problem/4513383> REGRESSION: Crash in
WebCore::shouldEmitTabBeforeNode() when iterating through document
text
* editing/TextIterator.cpp:
(WebCore::shouldEmitTabBeforeNode): Need to nil-check the renderer.
2006-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej.
* bindings/scripts/CodeGeneratorJS.pm: Removed confusing 'JS' prefix
from string descriptions of DOM prototypes, so the prototype for, e.g.,
Document serializes as 'Document,' not 'JSDocument.'
2006-04-23 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
- Took the larger snippets of C++ in the code generator and broke
them into HERE documents in the hopes of improving readability.
* bindings/scripts/CodeGeneratorJS.pm: I indented variable names
level with their corresponding HERE documents to clearly
"sandwich" the HERE documents between opening and closing EOF
statements.
2006-04-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Darin.
- push WebFileButton and WebStringTruncator code down to WebCore
http://bugs.webkit.org/show_bug.cgi?id=8552
* WebCore.exp:
* WebCore.xcodeproj/project.pbxproj:
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreStringTruncator.h: Added.
* bridge/mac/WebCoreStringTruncator.mm: Added.
(stringWidth):
(truncateString):
(+[WebCoreStringTruncator widthOfString:font:]):
* bridge/mac/WebCoreViewFactory.h:
* kwq/KWQFileButton.h:
* kwq/KWQFileButton.mm:
(-[WebFileChooserButton initWithWidget::]):
(-[WebCoreFileButton positionButton]):
(-[WebCoreFileButton initWithWidget:]):
(-[WebCoreFileButton initWithFrame:]):
(-[WebCoreFileButton dealloc]):
(-[WebCoreFileButton isFlipped]):
(-[WebCoreFileButton drawRect:]):
(-[WebCoreFileButton updateLabel]):
(-[WebCoreFileButton setFilename:]):
(-[WebCoreFileButton filename]):
(-[WebCoreFileButton setFrameSize:]):
(-[WebCoreFileButton bestVisualFrameSizeForCharacterCount:]):
(-[WebCoreFileButton visualFrame]):
(-[WebCoreFileButton setVisualFrame:]):
(-[WebCoreFileButton baseline]):
(-[WebCoreFileButton beginSheet]):
(-[WebCoreFileButton chooseFilename:]):
(-[WebCoreFileButton cancel]):
(-[WebCoreFileButton chooseButtonPressed:]):
(-[WebCoreFileButton mouseDown:]):
(-[WebCoreFileButton acceptsFirstResponder]):
(-[WebCoreFileButton becomeFirstResponder]):
(-[WebCoreFileButton nextKeyView]):
(-[WebCoreFileButton previousKeyView]):
(-[WebCoreFileButton nextValidKeyView]):
(-[WebCoreFileButton previousValidKeyView]):
(-[WebCoreFileButton performClick]):
(-[WebFileChooserButton initWithWidget:]):
(-[WebFileChooserButton nextValidKeyView]):
(-[WebFileChooserButton previousValidKeyView]):
(-[WebFileChooserButton resignFirstResponder]):
(KWQFileButton::KWQFileButton):
(KWQFileButton::setFilename):
(KWQFileButton::click):
(KWQFileButton::sizeForCharacterWidth):
(KWQFileButton::frameGeometry):
(KWQFileButton::setFrameGeometry):
(KWQFileButton::baselinePosition):
(KWQFileButton::filenameChanged):
2006-04-23 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- remove WebCoreCookieAdapter, instead make mac implementation of
CookieJar use Foundation directly.
* WebCore.exp:
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/CookieJar.mm:
(WebCore::cookies):
(WebCore::setCookies):
(WebCore::cookiesEnabled):
* platform/mac/WebCoreCookieAdapter.h: Removed.
* platform/mac/WebCoreCookieAdapter.m: Removed.
2006-04-21 Rob Buis <buis@kde.org>
Reviewed by hyatt. Landed by eseidel.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8170:
SVG CSS property values with extra items do not get treated
as invalid (they should)
Fixes the handling of invalid svg css properties similar
to how invalid html css properties are handled, ie. discard
the property if there are more values in the value list than
expected.
Test: svg/custom/invalid-css.svg
* ksvg2/css/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
2006-04-23 Michael Emmel <mike.emmel@gmail.com>
Reviewed by mjs. Landed by eseidel.
http://bugs.webkit.org/show_bug.cgi?id=8517
No test necessary, no functional change.
* DerivedSources.make: use VPATH more consistently.
2006-04-23 Jon Shier <jshier@iastate.edu>
Reviewed by ggaren. Landed by eseidel.
- Fix for http://bugs.webkit.org/show_bug.cgi?id=8511
onerror JS property does not register listener properly
Test: fast/dom/onerror-img.html
* bindings/js/kjs_dom.cpp:
(KJS::DOMEventTargetNode::getValueProperty): changed khtmlErrorEvent to errorEvent.
(KJS::DOMEventTargetNode::putValueProperty): ditto.
* bindings/js/kjs_window.cpp:
(KJS::Window::getValueProperty): ditto.
(KJS::Window::put):
* dom/EventNames.h: Removed khtmlError macro.
2006-04-23 Eric Seidel <eseidel@apple.com>
Reviewed by hyatt.
Reproducible crasher with <li value=1234567890 type=A>
http://bugs.webkit.org/show_bug.cgi?id=8542
Fixed our alphabetical list generation to match WinIE (not FireFox)
Previously our alphabetical lists were completely wrong past 26 items.
Tests:
* fast/lists/alpha-list-wrap.html
* fast/lists/li-style-alpha-huge-value-crash.html
* rendering/render_list.cpp:
(WebCore::toLetterString):
(WebCore::toHebrew):
(WebCore::RenderListMarker::calcMinMaxWidth):
2006-04-22 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
- Finished autogeneration of Element
* bindings/js/kjs_dom.cpp: Removed DOMElement class
* bindings/js/kjs_dom.h: ditto
* bindings/scripts/CodeGeneratorJS.pm: added support for special
attribute lookup that elements do
* dom/Element.idl: added new attribute,
"IncludeAttributesInPropertyLookup," which tells the code generator
to include HTML element attributes in property lookup
2006-04-22 Michael Emmel <mike.emmel@gmail.com>
Reviewed by Maciej.
- fix http://bugs.webkit.org/show_bug.cgi?id=8529
Extra Qaulification in header
- fix http://bugs.webkit.org/show_bug.cgi?id=8530
Missing assert.h include
* rendering/RenderObject.h: Removed erroneous RenderObject::
prefix from a member function name.
* rendering/RenderText.h: Removed erroneous RenderText::
prefix from a member function name.
* platform/Arena.cpp: Added <assert.h> to list of includes.
* platform/KURL.cpp: Ditto.
* platform/StringImpl.cpp: Ditto.
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Ditto.
* platform/image-decoders/png/PNGImageDecoder.cpp: Ditto.
2006-04-22 Darin Adler <darin@apple.com>
* doc: Added.
2006-04-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Eric.
- push down a bunch of WebCoreFrameBridge code to C++ (plus some reformatting)
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge isDescendantOfFrame:]):
(-[WebCoreFrameBridge traverseNextFrameStayWithin:]):
(-[WebCoreFrameBridge nextFrameWithWrap:]):
(-[WebCoreFrameBridge previousFrameWithWrap:]):
(+[WebCoreFrameBridge bridgeForDOMDocument:]):
(-[WebCoreFrameBridge parent]):
(-[WebCoreFrameBridge addData:]):
(-[WebCoreFrameBridge didNotOpenURL:pageCache:]):
(-[WebCoreFrameBridge restoreDocumentState]):
(-[WebCoreFrameBridge _stringWithDocumentTypeStringAndMarkupString:]):
(-[WebCoreFrameBridge nodesFromList:]):
(-[WebCoreFrameBridge markupStringFromNode:nodes:]):
(-[WebCoreFrameBridge markupStringFromRange:nodes:]):
(-[WebCoreFrameBridge rangeByExpandingSelectionWithGranularity:]):
(-[WebCoreFrameBridge rangeByAlteringCurrentSelection:direction:granularity:]):
(-[WebCoreFrameBridge alterCurrentSelection:direction:granularity:]):
(-[WebCoreFrameBridge rangeByAlteringCurrentSelection:verticalDistance:]):
(-[WebCoreFrameBridge alterCurrentSelection:verticalDistance:]):
(-[WebCoreFrameBridge replaceMarkedTextWithText:]):
(-[WebCoreFrameBridge replaceSelectionWithFragment:selectReplacement:smartReplace:matchStyle:]):
(-[WebCoreFrameBridge increaseSelectionListLevel]):
(-[WebCoreFrameBridge decreaseSelectionListLevel]):
(-[WebCoreFrameBridge insertLineBreak]):
(-[WebCoreFrameBridge insertParagraphSeparator]):
(-[WebCoreFrameBridge insertParagraphSeparatorInQuotedContent]):
(-[WebCoreFrameBridge insertText:selectInsertedText:]):
(-[WebCoreFrameBridge deleteSelectionWithSmartDelete:]):
(-[WebCoreFrameBridge ensureSelectionVisible]):
(-[WebCoreFrameBridge RenderObject::nodeInfoAtPoint:allowShadowContent:]):
* page/Frame.cpp:
(WebCore::Frame::nodeInfoAtPoint):
(WebCore::Frame::hasSelection):
(WebCore::Frame::documentTypeString):
* page/Frame.h:
* page/FrameTree.cpp:
(WebCore::FrameTree::traverseNextWithWrap):
(WebCore::FrameTree::traversePreviousWithWrap):
(WebCore::FrameTree::deepLastChild):
* page/FrameTree.h:
2006-04-22 Beth Dakin <bdakin@apple.com>
Reviewed by Hyatt.
Fix for http://bugs.webkit.org/show_bug.cgi?id=6141
DOMCSSPrimitiveValue is always returning values in pixels when
using getComputedStyle:
getFloatValue() took a unit type as a parameter, ignored it, and
returned m_value.num. This patch writes a second version of the
function that actually converts m_value.num to the specified unites
before returning it. Where a conversion is not required, I removed
the unit type from the caller so that it would go directly to the
inline version of the function.
* css/css_valueimpl.cpp:
(WebCore::CSSPrimitiveValue::computeLengthFloat): Remove type
parameter since a conversion is not needed.
(WebCore::scaleFactorForConversion): Helper function for
conversion.
(WebCore::CSSPrimitiveValue::getFloatValue): This version of
getFloatValue() takes a unit type parameter and converts
m_value.num.
* css/css_valueimpl.h:
(WebCore::CSSPrimitiveValue::getFloatValue): This version does not
take a parameter and just returns m_value.num.
* css/cssparser.cpp:
(WebCore::BorderImageParseContext::commitBorderImage): Remove type
parameter since a conversion is not needed.
* css/cssstyleselector.cpp:
(WebCore::convertToLength): Same.
(WebCore::CSSStyleSelector::applyProperty): Same.
(WebCore::CSSStyleSelector::mapBackgroundSize): Same.
(WebCore::CSSStyleSelector::mapBackgroundXPosition): Same.
(WebCore::CSSStyleSelector::mapBackgroundYPosition): Same.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Same.
* ksvg2/css/SVGCSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applySVGProperty): Same.
* ksvg2/misc/KCanvasRenderingStyle.cpp:
(WebCore::KSVGPainterFactory::cssPrimitiveToLength): Same.
2006-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by John.
- Fixed http://bugs.webkit.org/show_bug.cgi?id=8509
javascript:document.importNode(null)
* dom/Document.cpp:
(WebCore::Document::importNode): Throw an error if the node is null.
This happens when the object provided in the JavaScript call is not
a node.
(WebCore::Document::adoptNode): Set the DOM exception code in all error
cases instead of just a few, because that's what the spec requires.
2006-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by John.
- Fixed http://bugs.webkit.org/show_bug.cgi?id=8510
submit event doesn't bubble - it's supposed to.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseMappedAttribute): Added recognition for the
onsubmit attribute, so elements can use it
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::prepareSubmit): Changed bubbling attribute
to 'true'
2006-04-21 Geoffrey Garen <ggaren@apple.com>
Reviewed by TimO.
- Fixed: error event does not bubble
I discovered this bug while working on the "submit event does not
bubble" bug. The DOM spec says the event should bubble, and that's how
it works in Firefox.
The DOM Spec also says that the error event is "valid for
OBJECT elements, BODY elements, and FRAMESET element." But it doesn't
say "valid ONLY." Firefox supports it on all elements and web
developers tend to think it will work for things like <img> and
<script>, so I went whole hog here.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseMappedAttribute): Make onerror a mapped
attribute for all elements, so containing elements can register for
the event.
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::notifyFinished): make onerror bubble
* html/html_headimpl.cpp:
(WebCore::HTMLScriptElement::parseMappedAttribute): Remove special
case for onerror because HTMLElement will take care of it
(WebCore::HTMLScriptElement::notifyFinished): make onerror bubble
* html/html_imageimpl.cpp:
(WebCore::HTMLImageElement::parseMappedAttribute): Remove special
case for onerror because HTMLElement will take care of it
2006-04-21 Adele Peterson <adele@apple.com>
Test for: http://bugs.webkit.org/show_bug.cgi?id=8181
REGRESSION: After tabbing in page's field, attempting to tab from Google toolbar search to page fails on first try
* manual-tests/tabbing-input-google.html: Added.
2006-04-21 Kevin M. Ollivier <kevino@theolliviers.com>
Reviewed by Darin.
- http://bugs.webkit.org/show_bug.cgi?id=8507
Compilation fixes for building on gcc 4.0.2, and without precomp headers
* platform/Cursor.h: Created a fallback case that typedefs PlatformCursor
to void * if it isn't defined to anything else. (Useful to help get new ports
initially compiling.)
* bindings/js/kjs_window.cpp:
* rendering/RenderTextField.cpp:
* rendering/RenderBox.cpp:
Add missing headers to resolve issues when compiling without precompiled
headers.
* rendering/RenderText.h: Declare the InlineTextBox class before
friend declaration to resolve compilation issues with gcc 4.0.2.
2006-04-21 Adele Peterson <adele@apple.com>
Reviewed by Darin.
Fix for: http://bugs.webkit.org/show_bug.cgi?id=8213
REGRESSION: Can't tab out of text field if iframe comes after it
Test: fast/forms/tabbing-input-iframe.html
* bridge/mac/FrameMac.mm: (WebCore::FrameMac::nextKeyViewInFrame):
If the next focusable node is a RenderWidget without a view, then continue in the loop. We used to break out in this case.
I also made some formatting changes and reorganized the function to make it easier to read.
2006-04-21 Adele Peterson <adele@apple.com>
Reviewed by Beth.
Fix for: http://bugs.webkit.org/show_bug.cgi?id=8496
REGRESSION: Dragging to select text around a text field causes the text field to scroll.
Test: manual-tests/text-field-autoscroll.html
* bridge/mac/FrameMac.mm: (WebCore::FrameMac::handleMouseMoveEvent): Start the frame's autoscroll timer
even when we're calling over the bridge to handle the autoscroll.
* page/Frame.cpp: (WebCore::Frame::stopAutoscrollTimer): Clear out pointer to layer.
2006-04-21 Geoffrey Garen <ggaren@apple.com>
- And again.
* WebCore.vcproj/WebCore/WebCore.vcproj:
2006-04-21 Geoffrey Garen <ggaren@apple.com>
- Futile attempt to fix Windows build.
* WebCore.vcproj/WebCore/WebCore.vcproj:
2006-04-20 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej.
- Added autogeneration of JS bindings for CSSRule, CSSValue,
Event, and NodeFilter.
- Made related prototype objects hold the relevant constants, to
match Mozilla and the DOM 2 spec. (Previously, only the related
constructor objects held those constants, in accordance with the
DOM 3 spec.)
- Fixed up remaining Windows build issues.
* DerivedSources.make: Added new autogenerated files
* WebCore.xcodeproj/project.pbxproj: ditto
* bindings/js/kjs_css.cpp:
(KJS::DOMCSSRule::classInfo):
(KJS::DOMCSSRule::getOwnPropertySlot): scope call to classInfo()
because it's virtual and DOMCSSRule has a derrived class now.
(KJS::DOMCSSRule::put): ditto
(KJS::DOMCSSRuleFunc::callAsFunction):
(KJS::toJS):
* bindings/js/kjs_css.h:
* bindings/js/kjs_events.cpp:
(KJS::toJS):
* bindings/js/kjs_events.h:
* bindings/js/kjs_html.cpp:
(KJS::OptionConstructorImp::OptionConstructorImp):
* bindings/js/kjs_traversal.cpp:
(KJS::toJS):
* bindings/js/kjs_traversal.h:
* bindings/js/kjs_window.cpp:
(KJS::Window::getValueProperty): added CSSValue global object
* bindings/js/kjs_window.h:
(KJS::Window::):
* bindings/scripts/CodeGeneratorJS.pm: Changed generator to write
constants to prototype objects (previously only wrote constants to
constructor objects)
* css/CSSPrimitiveValue.idl: Removed LegacyParent since CSSValue now
exists in IDL
* css/CSSRule.idl: Added.
* css/CSSValue.idl: Added.
* css/css_ruleimpl.h:
(WebCore::CSSRule::):
* css/css_valueimpl.h:
* dom/Event.idl: Added.
* dom/MutationEvent.idl: Removed LegacyParent since Event now exists
in IDL
* dom/NodeFilter.idl: Added.
* dom/UIEvent.idl: Removed LegacyParent since event now exists in IDL
* dom/dom2_eventsimpl.h:
(WebCore::Event::):
2006-04-21 Darin Adler <darin@apple.com>
- one more attempt to fix Windows build
* platform/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillRect): Update to use Color and match
the similar function on GraphicsContextMac.
2006-04-21 Beth Dakin <bdakin@apple.com>
Reviewed by Hyatt.
Fix for http://bugs.webkit.org/show_bug.cgi?id=8495
REGRESSION: Sidebar on cnn.com is hosed
* platform/mac/ImageMac.mm:
(WebCore::Image::drawTiled): Use the size of the destination rect,
not the oneTileRect in the no-pattern case.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBackgroundExtended): Initialize
scaledWidth and scaledHeight to the appropriate value (was wrong in
scroll case), adjust position at appropriate times, and take out
no-repeat clause for now since we don't have enough test cases yet
to be sure we won't cause massive regressions.
2006-04-21 Darin Adler <darin@apple.com>
- attempt to fix Windows build after my last check-in
* WebCore.vcproj/Image Viewer/ImageView.cpp: Changed calls to use the
new IntRect-based API.
* html/CanvasPattern.cpp: (WebCore::CanvasPattern::CanvasPattern):
Put appropriate ifdefs around the m_platformImage initializer.
* page/Frame.cpp: Make Frame::adjustPageHeight Mac-OS-X-only for now
since it's used for printing and we don't have printing going on any
other platforms yet.
* platform/cairo/GraphicsContextCairo.cpp: Take out constructor that
takes only the "for printing" boolean for now.
* platform/cairo/ImageCairo.cpp: Include the GraphicsContext.h header.
* platform/win/TemporaryLinkStubs.cpp: (GraphicsContext::setShadow):
Fix up this stub and remove the GraphicsContext empty constructor stub.
2006-04-21 Darin Adler <darin@apple.com>
- fix build
* WebCore.xcodeproj/project.pbxproj: Replaced absolute path on my system
with a build-result-relative path; also removed some source files from the
list of resources to install!
2006-04-20 Darin Adler <darin@apple.com>
Reviewed by Hyatt.
- make <canvas> element and related API behave more like the draft of
the WhatWG Web Application specification, checking parameter validity
and raising exceptions
- changed HTMLCanvasElement bindings to be auto-generated, fixing all
issues so we can generate bindings for classes drived from HTMLElement
- change GraphicsContext API to use IntRect/Point/Size in more cases
- change GraphicsContext so it is closer to truly wrapping a graphics
context rather than representing the current NSGraphicsContext; there
are still some things like text and rectangle fills that are tied to
NSGraphicsContext, but we're most of the way there
- removed Brush class since it just amounted to a color, using an RGBA32
instead where we used to use a Brush
* DerivedSources.make: Added JSHTMLCanvasElement.h.
* WebCore.xcodeproj/project.pbxproj: Added new files.
* bindings/js/JSCanvasRenderingContext2DBase.h: Added toJS.
* bindings/js/JSCanvasRenderingContext2DBase.cpp:
(WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
Added exception code handling for strokeRect, drawImage, and createPattern.
Added version of createPattern that takes a canvas. Use TYPE_MISMATCH_ERR
instead of JavaScript TypeError when parameter is neither an image or canvas
element. Adapt for new HTMLCanvasElement binding.
(WebCore::toJS): Added. Converts context object to JS wrapper.
* bindings/js/JSHTMLElementWrapperFactory.h: Added.
* bindings/js/JSHTMLElementWrapperFactory.cpp: Added. Creates a JavaScript
wrapper for an arbitrary HTML element. Better than putting this all in the
DOM node class toJS function.
* bindings/js/JSXMLSerializer.cpp: Tweaked to make it build.
* bindings/js/kjs_dom.cpp: (KJS::toJS): Changed to call the
JSHTMLElementWrapperFactory function createJSWrapper, instead
of always creating a JSHTMLElement.
* bindings/js/kjs_html.h: Removed canvas-related stuff. Added HTMLElement
prototype.
* bindings/js/kjs_html.cpp:
(KJS::JSHTMLElement::classInfo): Removed canvas element.
(KJS::JSHTMLElement::accessors): Ditto.
(KJS::JSHTMLElementProtoFunc::callAsFunction): Added, to help the auto-binding
machiner cope with HTMLElement.
(KJS::HTMLElementFunction::callAsFunction): Removed canvas element.
* bindings/scripts/CodeGeneratorJS.pm: Added types needed for HTMLCanvasElement.
* bridge/mac/FrameMac.mm: (WebCore::FrameMac::setDisplaysWithFocusAttributes):
Changed to create a GraphicsContext with the new constructor that takes
a CGContextRef.
* bridge/mac/WebCoreFrameBridge.mm: (-[WebCoreFrameBridge drawRect:]):
Changed to create a GraphicsContext with the new constructor that takes
a NSGraphicsContext.
* page/Frame.cpp: (WebCore::Frame::adjustPageHeight): Changed to create a
GraphicsContext with the new constructor that takes a CGContextRef.
* editing/SelectionController.cpp: (WebCore::SelectionController::paintCaret):
Eliminated a use of obsolete class Brush.
* html/CanvasPattern.h:
* html/CanvasPattern.cpp:
(WebCore::CanvasPattern::parseRepetitionType): Added. Parses a repetition
type. Different from the old logic in that it is case-sensitive and rejects
anything other than null, empty string, or the four repeat types.
(WebCore::CanvasPattern::CanvasPattern): Added constructor that takes
a CGImageRef. Changed constructor to take two booleans instead of the repetition
type string. It's the caller's responsibility to parse the string.
(WebCore::CanvasPattern::~CanvasPattern): Release the CGImage.
(WebCore::patternCallback): Handle the CGImage case. Also changed the code
to create a GraphicsContext as needed and call the image drawing code with that.
(WebCore::CanvasPattern::createPattern): Handle both the image element case and
the canvas element case.
* html/CanvasRenderingContext2D.h:
* html/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::State::State): Change line cap, line join,
and global composite to store enum values instead of strings.
(WebCore::CanvasRenderingContext2D::setLineWidth): Do nothing if width is NaN
or <= 0.
(WebCore::CanvasRenderingContext2D::lineCap): Return a string based on a
stored enum, rather than returning a stored string.
(WebCore::CanvasRenderingContext2D::setLineCap): Do nothing if the string is
not one of the standard line cap types. Also case sensitive and stores enum
rather than the string.
(WebCore::CanvasRenderingContext2D::lineJoin): Return a string based on a
stored enum, rather than returning a stored string.
(WebCore::CanvasRenderingContext2D::setLineJoin): Do nothing if the string is
not one of the standard line join types. Also case sensitive and stores enum
rather than the string.
(WebCore::CanvasRenderingContext2D::setMiterLimit): Do nothing if limit is NaN
or <= 0.
(WebCore::CanvasRenderingContext2D::setGlobalAlpha): Do nothing if alpha is NaN
or < 0 or > 1.
(WebCore::CanvasRenderingContext2D::globalCompositeOperation): Return a string
based on a stored enum, rather than returning a stored string.
(WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation): Do nothing if
the string is not one of the standard compositing modes. Also case sensitive and
stores enum rather than the string.
(WebCore::CanvasRenderingContext2D::arcTo): Generate INDEX_SIZE_ERR exception
if radius is NaN or <= 0.
(WebCore::CanvasRenderingContext2D::arc): Ditto.
(WebCore::CanvasRenderingContext2D::rect): Generate INDEX_SIZE_ERR exception
if width or height is NaN or <= 0.
(WebCore::CanvasRenderingContext2D::clearRect): Ditto.
(WebCore::CanvasRenderingContext2D::fillRect): Ditto.
(WebCore::CanvasRenderingContext2D::strokeRect): Ditto, same for line width.
Changed the case where the line width is not specified to share code with the
case where it is.
(WebCore::size): Renamed from imageSize, since C++ overloads based on parameter
types anyway.
(WebCore::CanvasRenderingContext2D::drawImage): Generate INDEX_SIZE_ERR exception
if the source rect is not entirely inside the image rect, or if the width or height
of either the source or destination rect is NaN or <= 0. Changed image drawing
code to be platform-independent for the image element case, but not yet for the
canvas case.
(WebCore::CanvasRenderingContext2D::drawImageFromRect): Change code to parse the
composite operation to use the new code shared with Image.
(WebCore::CanvasRenderingContext2D::createPattern): Added code to parse the
repetition type separately before creating the pattern. Added an overload for
canvas elements.
(WebCore::CanvasRenderingContext2D::drawingContext): Changed to return a
GraphicsContext*.
(WebCore::CanvasRenderingContext2D::platformContext): Added. Now does what
drawingContext used to do.
* html/CanvasRenderingContext2D.idl: Added exception declarations as needed
for changes above.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement): Changed m_drawingContext
to be a GraphicsContext instead of a CGContextRef.
(WebCore::HTMLCanvasElement::~HTMLCanvasElement): Ditto.
(WebCore::HTMLCanvasElement::getContext): Removed special cases for null
and empty string. Only give a 2D graphics context if the string is "2d".
(WebCore::HTMLCanvasElement::reset): Updated for change to GraphicsContext
from CGContextRef.
(WebCore::HTMLCanvasElement::paint): Ditto.
(WebCore::HTMLCanvasElement::createDrawingContext): Changed to create a
GraphicsContext* instead of a CGContextRef.
(WebCore::HTMLCanvasElement::drawingContext): Changed to return a
GraphicsContext* instead of a CGContextRef.
(WebCore::HTMLCanvasElement::createPlatformImage): Updated for changes above.
* html/HTMLCanvasElement.idl: Added.
* html/HTMLParser.h:
* html/HTMLParser.cpp:
(WebCore::HTMLParser::canvasCreateErrorCheck): Added. An attempt to implement the
fallback behavior for canvas elements when JavaScript is off.
(WebCore::HTMLParser::getNode): Sorted list of functions. Added case for canvas.
* html/html_imageimpl.h:
* html/html_imageimpl.cpp:
(WebCore::HTMLImageElement::HTMLImageElement): Changed m_compositeOperator to be
an enum instead of a string.
(WebCore::HTMLImageElement::parseMappedAttribute): Parse the enum here.
* kcanvas/KCanvasResources.h:
* kcanvas/KCanvasResources.cpp: (WebCore::KCanvasMarker::draw): Changed to take a
GraphicsContext parameter.
* kcanvas/RenderPath.h: Added GraphicsContext parameter to drawMarkersIfNeeded.
* kcanvas/RenderPath.cpp: (WebCore::RenderPath::paint):
* kcanvas/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint):
* kcanvas/RenderSVGText.cpp: (WebCore::RenderSVGText::paint):
Changed to generate and use an appropriate GraphicsContext.
* kcanvas/device/quartz/KCanvasItemQuartz.h: Added GraphicsContext parameter to
drawMarkersIfNeeded.
* kcanvas/device/quartz/KCanvasItemQuartz.mm:
(WebCore::DrawMarkersData::DrawMarkersData): Added GraphicsContext*.
(WebCore::drawMarkerWithData): Pass along a GraphicsContext*.
(WebCore::drawStartAndMidMarkers): Ditto.
(WebCore::KCanvasItemQuartz::drawMarkersIfNeeded): Pass a long a GraphicsContext*.
* kcanvas/device/KRenderingDevice.h: Added a pure virtual createGraphicsContext
to bridge back to a GraphicsContext. Long term that class will replace this one.
* kcanvas/device/quartz/KRenderingDeviceQuartz.h:
* kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
(WebCore::KRenderingDeviceContextQuartz::createGraphicsContext): Added.
* ksvg2/svg/SVGMaskElement.cpp: (WebCore::SVGMaskElement::drawMaskerContent):
Create and pass a GraphicsContext -- old code used the default constructor for
GraphicsContext which meant "current context", and that no longer exists.
* ksvg2/svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::drawPatternContentIntoTile): Ditto.
* platform/Brush.h: Removed.
* platform/CompositeOperator.h: Added.
* platform/CompositeOperator.cpp: Added.
* platform/Font.h: Changed calls to use IntPoint instead of pairs of ints.
Also removed the const from all the uses of GraphicsContext*.
* platform/GraphicsContext.h: Eliminated default constructor and constructor
that takes only a boolean. Replaced with constructors that take platform
graphics contexts only. Replaced brush-related calls with fill color calls.
Replaced use of Brush with use of Color. Changed Image::CompositeOperator to
just plain CompositeOperator. Changed tuples of ints into IntRect and IntPoint.
Moved setFocusRingClip and clearFocusRingClip out of ifdefs. Removed unused
getCompositeOperation and string-based setCompositeOperation. Moved
currentCGContext and the other setCompositeOperation out of the GraphicsContext
class and made them global functions. Fixed platformContext so it won't always
return the CGContextRef of the current NSGraphicsContext. Instead, it will
return the appropriate CGContextRef for the GraphicsContext. This eliminates
the need to use void* for the image-drawing functions.
* platform/GraphicsContext.cpp:
(WebCore::GraphicsContextState::GraphicsContextState): Replaced Brush with
an RGBA fill color.
(WebCore::GraphicsContext::setFillColor): Renamed from setBrush.
(WebCore::GraphicsContext::fillColor): Renamed from brush.
(WebCore::GraphicsContext::drawImage): Changed to use IntRect.
(WebCore::GraphicsContext::drawTiledImage): Moved here from GraphicsContextMac.mm.
(WebCore::GraphicsContext::drawText): Changed to use IntPoint.
(WebCore::GraphicsContext::drawHighlightForText): Ditto.
(WebCore::GraphicsContext::drawLineForText): Ditto.
(WebCore::GraphicsContext::drawLineForMisspelling): Ditto.
* platform/Image.h: Removed CompositeOperator and related functions.
Removed void* context parameters from draw functions.
* platform/Image.cpp: Removed compositeOperatorFromString.
* platform/Widget.h: Added a GraphicsContext* return value from lockDrawingFocus
that you pass back to unlockDrawingFocus (for deletion).
* platform/mac/FontMac.mm:
(WebCore::Font::selectionRectForText): Changed parameter to point and removed
const on GraphicsContext* parameter.
(WebCore::Font::drawText): Ditto.
(WebCore::Font::drawHighlightForText): Ditto.
(WebCore::Font::drawLineForText): Ditto.
(WebCore::Font::drawLineForMisspelling): Ditto.
(WebCore::Font::misspellingLineThickness): Removed const.
* platform/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
Added fields to store a CGContextRef and an NSGraphicsContext.
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
Release both the CGContextRef and the NSGraphicsContext.
(WebCore::GraphicsContext::GraphicsContext): Implement to set up both the
CGContextRef and the NSGraphicsContext in one case, and only the CGContextRef
in the other.
(WebCore::GraphicsContext::savePlatformState): Implement for the CGContext-only
case.
(WebCore::GraphicsContext::restorePlatformState): Ditto.
(WebCore::GraphicsContext::drawRect): Assert that the NS context is present
and
(WebCore::GraphicsContext::setColorFromFillColor): Renamed from
setColorFromBrush.
(WebCore::GraphicsContext::setColorFromPen): Added assertion.