-
mitz@apple.com authored
Reviewed by Dave Hyatt. - fix <rdar://problem/5876370> Safari 3.1.1 bad rendering of pages from http://www.legifrance.gouv.fr/ Tests: fast/parser/p-in-scope-strict.html fast/parser/p-in-scope.html * html/HTMLParagraphElement.h: (WebCore::HTMLParagraphElement::endTagRequirement): Changed to require an end tag. The explicit closing of one P element by another is now done in error checking, and therefore takes scope into account, allowing for <p><button><p>, for example. * html/HTMLParser.cpp: (WebCore::HTMLParser::HTMLParser): Initialize m_hasPElementInScope. (WebCore::isScopingTag): Added. Returns whether the given tag represents a scoping element as defined in HTML 5 section 8.2.3.2. (WebCore::HTMLParser::formCreateErrorCheck): Added a call to pCloserCreateErrorCheck(). (WebCore::HTMLParser::ddCreateErrorCheck): Ditto. (WebCore::HTMLParser::dtCreateErrorCheck): Ditto. (WebCore::HTMLParser::nestedPCloserCreateErrorCheck): Added for use with <li>, which both closes P elements in scope and any previous LI. (WebCore::HTMLParser::pCloserCreateErrorCheck): Added. If there is a P element in scope, acts as if a </p> tag was seen. (WebCore::HTMLParser::pCloserStrictCreateErrorCheck): Ditto, but only in strict mode. Used for <table>. (WebCore::HTMLParser::getNode): Added entries for tags that close a P element in scope. (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): Added code to reset m_hasPElementInScope. (WebCore::HTMLParser::pushBlock): Added code to update m_hasPElementInScope. (WebCore::HTMLParser::popOneBlockCommon): Ditto. (WebCore::HTMLParser::checkIfHasPElementInScope): Added. Updates m_hasPElementInScope. * html/HTMLParser.h: (WebCore::HTMLParser::hasPElementInScope): Added. Calls checkIfHasPElementInScope() if needed and returns whether there is a P element in scope. LayoutTests: Reviewed by Dave Hyatt. - tests, updated tests and updated results for <rdar://problem/5876370> Safari 3.1.1 bad rendering of pages from http://www.legifrance.gouv.fr/ * fast/block/basic/001.html: * fast/block/positioning/absolute-in-inline-ltr-2.html: * fast/block/positioning/absolute-in-inline-ltr-3.html: * fast/block/positioning/absolute-in-inline-ltr.html: * fast/block/positioning/absolute-in-inline-rtl-2.html: * fast/block/positioning/absolute-in-inline-rtl-3.html: * fast/block/positioning/absolute-in-inline-rtl.html: * fast/block/positioning/absolute-in-inline-short-ltr.html: * fast/block/positioning/absolute-in-inline-short-rtl.html: * fast/block/positioning/auto/006.html: * fast/inline/continuation-outlines-with-layers.html: * fast/inline/continuation-outlines.html: * fast/parser/p-in-scope-expected.txt: Added. * fast/parser/p-in-scope-strict-expected.txt: Added. * fast/parser/p-in-scope-strict.html: Added. * fast/parser/p-in-scope.html: Added. * fast/parser/resources/p-in-scope.css: Added. * fast/parser/resources/p-in-scope.js: Added. * fast/repaint/subtree-root-clip-2.html: * platform/mac/fast/block/basic/001-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-ltr-2-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-ltr-3-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-ltr-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-rtl-2-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-rtl-3-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-rtl-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-short-ltr-expected.txt: * platform/mac/fast/block/positioning/absolute-in-inline-short-rtl-expected.txt: * platform/mac/fast/block/positioning/auto/006-expected.txt: * platform/mac/fast/inline/continuation-outlines-expected.txt: * platform/mac/fast/inline/continuation-outlines-with-layers-expected.txt: * platform/mac/fast/repaint/subtree-root-clip-2-expected.txt: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
3709e55e