[CSS Exclusions] Polygon edges should span colinear vertices
https://bugs.webkit.org/show_bug.cgi?id=99343

Patch by Hans Muller <hmuller@adobe.com> on 2012-11-05
Reviewed by Dirk Schulze.

Source/WebCore:

ExclusionPolygonEdges now span coincident and collinear vertices. Currently
pairs of vertices are only considered coincident if their coordinates are exactly
equal. Similarly, a vertex is only considered collinear with an edge if the area
of the triangle defined by the three vertices is exactly zero.  In the future it
may be useful to relax the comparison with zero.

Tests: fast/exclusions/shape-inside/shape-inside-coincident-vertices.html
       fast/exclusions/shape-inside/shape-inside-collinear-vertices.html

* rendering/ExclusionPolygon.cpp:
(WebCore::determinant): Used to measure collinearity.
(WebCore):
(WebCore::areCollinearPoints): True if three FloatPoint arguments are collinear per the test outlined above.
(WebCore::areCoincidentPoints): True if the two FloatPoint arguments are equal.
(WebCore::nextVertexIndex): The next vertex index in clockwise or counterclockwise order.
(WebCore::ExclusionPolygon::findNextEdgeVertexIndex): Return the index of the next non-coincident, non-collinear vertex.
(WebCore::ExclusionPolygon::ExclusionPolygon): Skip coincident and collinear vertices when building the list of edges.
* rendering/ExclusionPolygon.h: Added private findNextEdgeVertexIndex() declaration.

LayoutTests:

Verify that exclusion polygonal shape-inside layout is unaffected by coincident
or collinear vertices.

* fast/exclusions/shape-inside/shape-inside-coincident-vertices-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-coincident-vertices.html: Added.
* fast/exclusions/shape-inside/shape-inside-collinear-vertices-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-collinear-vertices.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, unskip a now passing test.

* platform/qt-5.0-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Decouple Attr logic from ElementAttributeData.
<http://webkit.org/b/101126>

Reviewed by Antti Koivisto.

Move all logic dealing with Attr DOM nodes from ElementAttributeData to Element.
This makes more sense since an Attr is tied to a single Element, but an ElementAttributeData
can be shared by any number of Elements at a given time.

Also updated naming convention from just "Attr" to "Attr node" in the code I was touching.
"Attr" is way too generic, and has been historically confused with WebCore::Attribute a lot.

* dom/Element.h:
* dom/ElementAttributeData.h:
* dom/Element.cpp:
(WebCore::attrNodeListMap):
(WebCore::attrNodeListForElement):
(WebCore::ensureAttrNodeListForElement):
(WebCore::removeAttrNodeListForElement):
(WebCore::findAttrNodeInList):
(WebCore::Element::~Element):
(WebCore::Element::detachAttribute):
(WebCore::Element::setAttributeNode):
(WebCore::Element::removeAttributeInternal):
(WebCore::Element::getAttributeNode):
(WebCore::Element::getAttributeNodeNS):
(WebCore::Element::normalizeAttributes):
(WebCore::Element::attrIfExists):
(WebCore::Element::ensureAttr):
(WebCore::Element::detachAttrNodeFromElementWithValue):
(WebCore::Element::detachAllAttrNodesFromElement):
(WebCore::Element::cloneAttributesFromElement):

    Move everything Attr-related into Element.cpp while simplifying some loops and remove
    conditions that are no longer needed as they used to depend on having an attributeData().

* dom/Node.h:
(WebCore::Node::hasSyntheticAttrChildNodes):
(WebCore::Node::setHasSyntheticAttrChildNodes):

    Renamed the hasAttrList() node flag to hasSyntheticAttrChildNodes().

* dom/Attr.cpp:
(WebCore::Attr::detachFromElementWithValue):

    Remove awkward indirection and let the call site deal with removing the Attr node from
    the Element's list of Attr nodes.

* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::clearAttributes):

    Remove now-unused Element* argument.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133492 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce the verbosity of referring to QNaN in JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=101174

Reviewed by Geoffrey Garen.

Introduces a #define QNaN in JSValue.h, and replaces all previous uses of
std::numeric_limits<double>::quiet_NaN() with QNaN.

* API/JSValueRef.cpp:
(JSValueMakeNumber):
(JSValueToNumber):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitFloatTypedArrayGetByVal):
* runtime/CachedTranscendentalFunction.h:
(JSC::CachedTranscendentalFunction::initialize):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/DateInstanceCache.h:
(JSC::DateInstanceData::DateInstanceData):
(JSC::DateInstanceCache::reset):
* runtime/ExceptionHelpers.cpp:
(JSC::InterruptedExecutionError::defaultValue):
(JSC::TerminatedExecutionError::defaultValue):
* runtime/JSCell.h:
(JSC::JSValue::getPrimitiveNumber):
* runtime/JSDateMath.cpp:
(JSC::parseDateFromNullTerminatedCharacters):
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::resetDateCache):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::parseInt):
(JSC::jsStrDecimalLiteral):
(JSC::toDouble):
(JSC::jsToNumber):
(JSC::parseFloat):
* runtime/JSValue.cpp:
(JSC::JSValue::toNumberSlowCase):
* runtime/JSValue.h:
(JSC):
* runtime/JSValueInlineMethods.h:
(JSC::jsNaN):
* runtime/MathObject.cpp:
(JSC::mathProtoFuncMax):
(JSC::mathProtoFuncMin):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement SimpleFontData::platformBoundsForGlyph on skia
https://bugs.webkit.org/show_bug.cgi?id=101115

Reviewed by Eric Seidel.

Source/WebCore:

The implementation is similar to SimpleFontData::platformWidthForGlyph on skia.

Tested by: fast/block/lineboxcontain/*glyphs*, mathml/presentation/*

* platform/graphics/skia/SimpleFontDataSkia.cpp:
(WebCore::SimpleFontData::platformBoundsForGlyph): Implemented.

LayoutTests:

Some lineboxcontain/etc. tests will need rebaselining.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Rolled DEPS.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133495 268f45cc-cd09-0410-ab3c-d52691b4dbfc