text:
#include "sky/engine/core/css/parser/BisonCSSParser.h"

#include <limits.h>
#include "gen/sky/core/CSSValueKeywords.h"
#include "gen/sky/core/StylePropertyShorthand.h"
#include "gen/sky/platform/RuntimeEnabledFeatures.h"
#include "sky/engine/core/css/CSSAspectRatioValue.h"
#include "sky/engine/core/css/CSSBasicShapes.h"
#include "sky/engine/core/css/CSSFontFeatureValue.h"
#include "sky/engine/core/css/CSSFunctionValue.h"
#include "sky/engine/core/css/CSSGradientValue.h"
#include "sky/engine/core/css/CSSInheritedValue.h"
#include "sky/engine/core/css/CSSInitialValue.h"
#include "sky/engine/core/css/CSSLineBoxContainValue.h"
#include "sky/engine/core/css/CSSPrimitiveValue.h"
#include "sky/engine/core/css/CSSPropertySourceData.h"
#include "sky/engine/core/css/CSSSelector.h"
#include "sky/engine/core/css/CSSShadowValue.h"
#include "sky/engine/core/css/CSSStyleSheet.h"
#include "sky/engine/core/css/CSSTransformValue.h"
#include "sky/engine/core/css/CSSUnicodeRangeValue.h"
#include "sky/engine/core/css/CSSValueList.h"
#include "sky/engine/core/css/CSSValuePool.h"
#include "sky/engine/core/css/HashTools.h"
#include "sky/engine/core/css/Pair.h"
#include "sky/engine/core/css/StylePropertySet.h"
#include "sky/engine/core/css/StyleRule.h"
#include "sky/engine/core/css/StyleSheetContents.h"
#include "sky/engine/core/css/parser/CSSParserIdioms.h"
#include "sky/engine/core/dom/Document.h"
#include "sky/engine/core/frame/FrameHost.h"
#include "sky/engine/core/frame/LocalFrame.h"
#include "sky/engine/core/frame/Settings.h"
#include "sky/engine/core/html/parser/HTMLParserIdioms.h"
#include "sky/engine/core/inspector/ConsoleMessage.h"
#include "sky/engine/core/rendering/RenderTheme.h"
#include "sky/engine/platform/FloatConversion.h"
#include "sky/engine/wtf/BitArray.h"
#include "sky/engine/wtf/HexNumber.h"
#include "sky/engine/wtf/TemporaryChange.h"
#include "sky/engine/wtf/text/StringBuffer.h"
#include "sky/engine/wtf/text/StringBuilder.h"
#include "sky/engine/wtf/text/StringImpl.h"
#include "sky/engine/wtf/text/TextEncoding.h"

#define YYDEBUG 0

#if YYDEBUG > 0
extern int cssyydebug;
#endif

int cssyyparse(blink::BisonCSSParser*);

using namespace WTF;

namespace blink {

static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX;

BisonCSSParser::BisonCSSParser(const CSSParserContext& context)
    : m_context(context)
    , m_id(CSSPropertyInvalid)
    , m_styleSheet(nullptr)
    , m_supportsCondition(false)
    , m_selectorListForParseSelector(0)
    , m_numParsedPropertiesBeforeMarginBox(INVALID_NUM_PARSED_PROPERTIES)
    , m_hadSyntacticallyValidCSSRule(false)
    , m_ignoreErrors(false)
    , m_defaultNamespace(starAtom)
    , m_observer(0)
    , m_source(0)
    , m_ruleHeaderType(CSSRuleSourceData::UNKNOWN_RULE)
    , m_allowImportRules(true)
    , m_allowNamespaceDeclarations(true)
    , m_inViewport(false)
    , m_tokenizer(*this)
{
#if YYDEBUG > 0
    cssyydebug = 1;
#endif
}

BisonCSSParser::~BisonCSSParser()
{
    clearProperties();

    deleteAllValues(m_floatingSelectors);
    deleteAllValues(m_floatingSelectorVectors);
    deleteAllValues(m_floatingValueLists);
    deleteAllValues(m_floatingFunctions);
}

void BisonCSSParser::setupParser(const char* prefix, unsigned prefixLength, const String& string, const char* suffix, unsigned suffixLength)
{
    m_tokenizer.setupTokenizer(prefix, prefixLength, string, suffix, suffixLength);
    m_ruleHasHeader = true;
}

void BisonCSSParser::parseSheet(StyleSheetContents* sheet, const String& string)
{
    setStyleSheet(sheet);
    m_defaultNamespace = starAtom; // Reset the default namespace.
    m_ignoreErrors = false;
    m_tokenizer.m_lineNumber = 0;
    m_source = &string;
    m_tokenizer.m_internal = false;
    setupParser("", string, "");
    cssyyparse(this);
    sheet->shrinkToFit();
    m_source = 0;
    m_rule = nullptr;
    m_lineEndings.clear();
    m_ignoreErrors = false;
    m_tokenizer.m_internal = true;
}

PassRefPtr<StyleRuleBase> BisonCSSParser::parseRule(StyleSheetContents* sheet, const String& string)
{
    setStyleSheet(sheet);
    m_allowNamespaceDeclarations = false;
    setupParser("@-internal-rule ", string, "");
    cssyyparse(this);
    return m_rule.release();
}

bool BisonCSSParser::parseSupportsCondition(const String& string)
{
    m_supportsCondition = false;
    setupParser("@-internal-supports-condition ", string, "");
    cssyyparse(this);
    return m_supportsCondition;
}

static inline bool isColorPropertyID(CSSPropertyID propertyId)
{
    switch (propertyId) {
    case CSSPropertyColor:
    case CSSPropertyBackgroundColor:
    case CSSPropertyBorderBottomColor:
    case CSSPropertyBorderLeftColor:
    case CSSPropertyBorderRightColor:
    case CSSPropertyBorderTopColor:
    case CSSPropertyOutlineColor:
    case CSSPropertyWebkitBorderAfterColor:
    case CSSPropertyWebkitBorderBeforeColor:
    case CSSPropertyWebkitBorderEndColor:
    case CSSPropertyWebkitBorderStartColor:
    case CSSPropertyWebkitTextEmphasisColor:
    case CSSPropertyWebkitTextFillColor:
    case CSSPropertyWebkitTextStrokeColor:
    case CSSPropertyTextDecorationColor:
        return true;
    default:
        return false;
    }
}

static bool parseColorValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode)
{
    ASSERT(!string.isEmpty());
    bool quirksMode = isQuirksModeBehavior(cssParserMode);
    if (!isColorPropertyID(propertyId))
        return false;
    CSSParserString cssString;
    cssString.init(string);
    CSSValueID valueID = cssValueKeywordID(cssString);
    bool validPrimitive = false;
    if (valueID == CSSValueCurrentcolor)
        validPrimitive = true;

    if (validPrimitive) {
        RefPtr<CSSValue> value = cssValuePool().createIdentifierValue(valueID);
        declaration->addParsedProperty(CSSProperty(propertyId, value.release()));
        return true;
    }
    RGBA32 color;
    if (!CSSPropertyParser::fastParseColor(color, string, !quirksMode && string[0] != '#'))
        return false;
    RefPtr<CSSValue> value = cssValuePool().createColorValue(color);
    declaration->addParsedProperty(CSSProperty(propertyId, value.release()));
    return true;
}

static inline bool isSimpleLengthPropertyID(CSSPropertyID propertyId, bool& acceptsNegativeNumbers)
{
    switch (propertyId) {
    case CSSPropertyFontSize:
    case CSSPropertyHeight:
    case CSSPropertyWidth:
    case CSSPropertyMinHeight:
    case CSSPropertyMinWidth:
    case CSSPropertyPaddingBottom:
    case CSSPropertyPaddingLeft:
    case CSSPropertyPaddingRight:
    case CSSPropertyPaddingTop:
    case CSSPropertyWebkitLogicalWidth:
    case CSSPropertyWebkitLogicalHeight:
    case CSSPropertyWebkitMinLogicalWidth:
    case CSSPropertyWebkitMinLogicalHeight:
    case CSSPropertyWebkitPaddingAfter:
    case CSSPropertyWebkitPaddingBefore:
    case CSSPropertyWebkitPaddingEnd:
    case CSSPropertyWebkitPaddingStart:
        acceptsNegativeNumbers = false;
        return true;
    case CSSPropertyBottom:
    case CSSPropertyLeft:
    case CSSPropertyMarginBottom:
    case CSSPropertyMarginLeft:
    case CSSPropertyMarginRight:
    case CSSPropertyMarginTop:
    case CSSPropertyRight:
    case CSSPropertyTop:
    case CSSPropertyWebkitMarginAfter:
    case CSSPropertyWebkitMarginBefore:
    case CSSPropertyWebkitMarginEnd:
    case CSSPropertyWebkitMarginStart:
        acceptsNegativeNumbers = true;
        return true;
    default:
        return false;
    }
}

template <typename CharacterType>
static inline bool parseSimpleLength(const CharacterType* characters, unsigned length, CSSPrimitiveValue::UnitType& unit, double& number)
{
    if (length > 2 && (characters[length - 2] | 0x20) == 'p' && (characters[length - 1] | 0x20) == 'x') {
        length -= 2;
        unit = CSSPrimitiveValue::CSS_PX;
    } else if (length > 1 && characters[length - 1] == '%') {
        length -= 1;
        unit = CSSPrimitiveValue::CSS_PERCENTAGE;
    }

    // We rely on charactersToDouble for validation as well. The function
    // will set "ok" to "false" if the entire passed-in character range does
    // not represent a double.
    bool ok;
    number = charactersToDouble(characters, length, &ok);
    return ok;
}

static bool parseSimpleLengthValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, CSSParserMode cssParserMode)
{
    ASSERT(!string.isEmpty());
    bool acceptsNegativeNumbers = false;

    // In @viewport, width and height are shorthands, not simple length values.
    if (isCSSViewportParsingEnabledForMode(cssParserMode) || !isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers))
        return false;

    unsigned length = string.length();
    double number;
    CSSPrimitiveValue::UnitType unit = CSSPrimitiveValue::CSS_NUMBER;

    if (string.is8Bit()) {
        if (!parseSimpleLength(string.characters8(), length, unit, number))
            return false;
    } else {
        if (!parseSimpleLength(string.characters16(), length, unit, number))
            return false;
    }

    if (unit == CSSPrimitiveValue::CSS_NUMBER) {
        bool quirksMode = isQuirksModeBehavior(cssParserMode);
        if (number && !quirksMode)
            return false;
        unit = CSSPrimitiveValue::CSS_PX;
    }
    if (number < 0 && !acceptsNegativeNumbers)
        return false;

    RefPtr<CSSValue> value = cssValuePool().createValue(number, unit);
    declaration->addParsedProperty(CSSProperty(propertyId, value.release()));
    return true;
}

bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, const CSSParserContext& parserContext)
{
    if (valueID == CSSValueInvalid)
        return false;

    switch (propertyId) {
    case CSSPropertyBackgroundRepeatX: // repeat | no-repeat
    case CSSPropertyBackgroundRepeatY: // repeat | no-repeat
        return valueID == CSSValueRepeat || valueID == CSSValueNoRepeat;
    case CSSPropertyBorderTopStyle: // <border-style>
    case CSSPropertyBorderRightStyle: // Defined as: none | hidden | dotted | dashed |
    case CSSPropertyBorderBottomStyle: // solid | double | groove | ridge | inset | outset
    case CSSPropertyBorderLeftStyle:
    case CSSPropertyWebkitBorderAfterStyle:
    case CSSPropertyWebkitBorderBeforeStyle:
    case CSSPropertyWebkitBorderEndStyle:
    case CSSPropertyWebkitBorderStartStyle:
        return valueID >= CSSValueNone && valueID <= CSSValueDouble;
    case CSSPropertyBoxSizing:
        return valueID == CSSValueBorderBox || valueID == CSSValueContentBox;
    case CSSPropertyDirection: // ltr | rtl
        return valueID == CSSValueLtr || valueID == CSSValueRtl;
    case CSSPropertyDisplay:
        // inline | block | list-item | inline-block | table |
        // inline-table | table-row-group | table-header-group | table-footer-group | table-row |
        // table-column-group | table-column | table-cell | table-caption | -webkit-box | -webkit-inline-box | none
        // flex | inline-flex
        return (valueID >= CSSValueInline && valueID <= CSSValueInlineFlex) || valueID == CSSValueNone;
    case CSSPropertyFontStyle: // normal | italic | oblique
        return valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique;
    case CSSPropertyFontStretch: // normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded
        return valueID == CSSValueNormal || (valueID >= CSSValueUltraCondensed && valueID <= CSSValueUltraExpanded);
    case CSSPropertyImageRendering: // auto | optimizeContrast | pixelated
        return valueID == CSSValueAuto || valueID == CSSValueWebkitOptimizeContrast || (RuntimeEnabledFeatures::imageRenderingPixelatedEnabled() && valueID == CSSValuePixelated);
    case CSSPropertyObjectFit:
        ASSERT(RuntimeEnabledFeatures::objectFitPositionEnabled());
        return valueID == CSSValueFill || valueID == CSSValueContain || valueID == CSSValueCover || valueID == CSSValueNone || valueID == CSSValueScaleDown;
    case CSSPropertyOutlineStyle: // (<border-style> except hidden) | auto
        return valueID == CSSValueAuto || valueID == CSSValueNone || (valueID >= CSSValueInset && valueID <= CSSValueDouble);
    case CSSPropertyOverflowWrap: // normal | break-word
    case CSSPropertyWordWrap:
        return valueID == CSSValueNormal || valueID == CSSValueBreakWord;
    case CSSPropertyOverflowX: // visible | hidden | auto | overlay
        return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueAuto || valueID == CSSValueOverlay;
    case CSSPropertyOverflowY: // visible | hidden | auto | overlay | -webkit-paged-x | -webkit-paged-y
        return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY;
    case CSSPropertyPointerEvents:
        // none | visiblePainted | visibleFill | visibleStroke | visible |
        // painted | fill | stroke | auto | all | bounding-box
        return valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueBoundingBox);
    case CSSPropertyPosition: // static | absolute
        return valueID == CSSValueStatic || valueID == CSSValueAbsolute;
    case CSSPropertyTextAlignLast:
        // auto | start | end | left | right | center | justify
        ASSERT(RuntimeEnabledFeatures::css3TextEnabled());
        return (valueID >= CSSValueLeft && valueID <= CSSValueJustify) || valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueAuto;
    case CSSPropertyTextDecorationStyle:
        // solid | double | dotted | dashed | wavy
        ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
        return valueID == CSSValueSolid || valueID == CSSValueDouble || valueID == CSSValueDotted || valueID == CSSValueDashed || valueID == CSSValueWavy;
    case CSSPropertyTextJustify:
        // auto | none | inter-word | distribute
        ASSERT(RuntimeEnabledFeatures::css3TextEnabled());
        return valueID == CSSValueInterWord || valueID == CSSValueDistribute || valueID == CSSValueAuto || valueID == CSSValueNone;
    case CSSPropertyTextOverflow: // clip | ellipsis
        return valueID == CSSValueClip || valueID == CSSValueEllipsis;
    case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision
        return valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizelegibility || valueID == CSSValueGeometricprecision;
    case CSSPropertyUnicodeBidi:
        return valueID == CSSValueNormal || valueID == CSSValueEmbed
            || valueID == CSSValueBidiOverride || valueID == CSSValueWebkitIsolate
            || valueID == CSSValueWebkitIsolateOverride || valueID == CSSValueWebkitPlaintext;
    case CSSPropertyTouchActionDelay: // none | script
        ASSERT(RuntimeEnabledFeatures::cssTouchActionDelayEnabled());
        return valueID == CSSValueScript || valueID == CSSValueNone;
    case CSSPropertyWebkitBoxDecorationBreak:
        return valueID == CSSValueClone || valueID == CSSValueSlice;
    case CSSPropertyAlignContent:
        // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
        return valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround || valueID == CSSValueStretch;
    case CSSPropertyAlignItems:
        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
        return valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch;
    case CSSPropertyAlignSelf:
        // FIXME: Per CSS alignment, this property should accept the same arguments as 'justify-self' so we should share its parsing code.
        return valueID == CSSValueAuto || valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueBaseline || valueID == CSSValueStretch;
    case CSSPropertyFlexDirection:
        return valueID == CSSValueRow || valueID == CSSValueRowReverse || valueID == CSSValueColumn || valueID == CSSValueColumnReverse;
    case CSSPropertyFlexWrap:
        return valueID == CSSValueNowrap || valueID == CSSValueWrap || valueID == CSSValueWrapReverse;
    case CSSPropertyJustifyContent:
        // FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
        return valueID == CSSValueFlexStart || valueID == CSSValueFlexEnd || valueID == CSSValueCenter || valueID == CSSValueSpaceBetween || valueID == CSSValueSpaceAround;
    case CSSPropertyFontKerning:
        return valueID == CSSValueAuto || valueID == CSSValueNormal || valueID == CSSValueNone;
    case CSSPropertyWebkitFontSmoothing:
        return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueAntialiased || valueID == CSSValueSubpixelAntialiased;
    case CSSPropertyWebkitLineBreak: // auto | loose | normal | strict | after-white-space
        return valueID == CSSValueAuto || valueID == CSSValueLoose || valueID == CSSValueNormal || valueID == CSSValueStrict || valueID == CSSValueAfterWhiteSpace;
    case CSSPropertyWebkitRtlOrdering:
        return valueID == CSSValueLogical || valueID == CSSValueVisual;
    case CSSPropertyWebkitTextEmphasisPosition:
        return valueID == CSSValueOver || valueID == CSSValueUnder;
    case CSSPropertyTransformStyle:
    case CSSPropertyWebkitTransformStyle:
        return valueID == CSSValueFlat || valueID == CSSValuePreserve3d;
    case CSSPropertyWebkitUserModify: // read-only | read-write
        return valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly;
    case CSSPropertyWebkitUserSelect: // auto | none | text | all
        return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll;
    case CSSPropertyWhiteSpace: // normal | pre | nowrap
        return valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap;
    case CSSPropertyWordBreak: // normal | break-all | break-word (this is a custom extension)
        return valueID == CSSValueNormal || valueID == CSSValueBreakAll || valueID == CSSValueBreakWord;
    default:
        ASSERT_NOT_REACHED();
        return false;
    }
    return false;
}

bool isKeywordPropertyID(CSSPropertyID propertyId)
{
    switch (propertyId) {
    case CSSPropertyAlignItems:
    case CSSPropertyAlignSelf:
    case CSSPropertyBackgroundRepeatX:
    case CSSPropertyBackgroundRepeatY:
    case CSSPropertyBorderBottomStyle:
    case CSSPropertyBorderLeftStyle:
    case CSSPropertyBorderRightStyle:
    case CSSPropertyBorderTopStyle:
    case CSSPropertyBoxSizing:
    case CSSPropertyDirection:
    case CSSPropertyDisplay:
    case CSSPropertyFontStyle:
    case CSSPropertyFontStretch:
    case CSSPropertyImageRendering:
    case CSSPropertyObjectFit:
    case CSSPropertyOutlineStyle:
    case CSSPropertyOverflowWrap:
    case CSSPropertyOverflowX:
    case CSSPropertyOverflowY:
    case CSSPropertyPointerEvents:
    case CSSPropertyPosition:
    case CSSPropertyTextAlignLast:
    case CSSPropertyTextDecorationStyle:
    case CSSPropertyTextJustify:
    case CSSPropertyTextOverflow:
    case CSSPropertyTextRendering:
    case CSSPropertyTouchActionDelay:
    case CSSPropertyUnicodeBidi:
    case CSSPropertyWebkitBorderAfterStyle:
    case CSSPropertyWebkitBorderBeforeStyle:
    case CSSPropertyWebkitBorderEndStyle:
    case CSSPropertyWebkitBorderStartStyle:
    case CSSPropertyWebkitBoxDecorationBreak:
    case CSSPropertyAlignContent:
    case CSSPropertyFlexDirection:
    case CSSPropertyFlexWrap:
    case CSSPropertyJustifyContent:
    case CSSPropertyFontKerning:
    case CSSPropertyWebkitFontSmoothing:
    case CSSPropertyWebkitLineBreak:
    case CSSPropertyWebkitRtlOrdering:
    case CSSPropertyWebkitTextEmphasisPosition:
    case CSSPropertyTransformStyle:
    case CSSPropertyWebkitTransformStyle:
    case CSSPropertyWebkitUserModify:
    case CSSPropertyWebkitUserSelect:
    case CSSPropertyWhiteSpace:
    case CSSPropertyWordBreak:
    case CSSPropertyWordWrap:
        return true;
    default:
        return false;
    }
}

static bool parseKeywordValue(MutableStylePropertySet* declaration, CSSPropertyID propertyId, const String& string, const CSSParserContext& parserContext)
{
    ASSERT(!string.isEmpty());

    if (!isKeywordPropertyID(propertyId)) {
        // All properties accept the values of "initial" and "inherit".
        String lowerCaseString = string.lower();
        if (lowerCaseString != "initial" && lowerCaseString != "inherit")
            return false;

        // Parse initial/inherit shorthands using the BisonCSSParser.
        if (shorthandForProperty(propertyId).length())
            return false;
    }

    CSSParserString cssString;
    cssString.init(string);
    CSSValueID valueID = cssValueKeywordID(cssString);

    if (!valueID)
        return false;

    RefPtr<CSSValue> value = nullptr;
    if (valueID == CSSValueInherit)
        value = cssValuePool().createInheritedValue();
    else if (valueID == CSSValueInitial)
        value = cssValuePool().createExplicitInitialValue();
    else if (isValidKeywordPropertyAndValue(propertyId, valueID, parserContext))
        value = cssValuePool().createIdentifierValue(valueID);
    else
        return false;

    declaration->addParsedProperty(CSSProperty(propertyId, value.release()));
    return true;
}

template <typename CharType>
static bool parseTransformTranslateArguments(CharType*& pos, CharType* end, unsigned expectedCount, CSSTransformValue* transformValue)
{
    while (expectedCount) {
        size_t delimiter = WTF::find(pos, end - pos, expectedCount == 1 ? ')' : ',');
        if (delimiter == kNotFound)
            return false;
        unsigned argumentLength = static_cast<unsigned>(delimiter);
        CSSPrimitiveValue::UnitType unit = CSSPrimitiveValue::CSS_NUMBER;
        double number;
        if (!parseSimpleLength(pos, argumentLength, unit, number))
            return false;
        if (unit != CSSPrimitiveValue::CSS_PX && (number || unit != CSSPrimitiveValue::CSS_NUMBER))
            return false;
        transformValue->append(cssValuePool().createValue(number, CSSPrimitiveValue::CSS_PX));
        pos += argumentLength + 1;
        --expectedCount;
    }
    return true;
}

template <typename CharType>
static bool parseTransformNumberArguments(CharType*& pos, CharType* end, unsigned expectedCount, CSSTransformValue* transformValue)
{
    while (expectedCount) {
        size_t delimiter = WTF::find(pos, end - pos, expectedCount == 1 ? ')' : ',');
        if (delimiter == kNotFound)
            return false;
        unsigned argumentLength = static_cast<unsigned>(delimiter);
        bool ok;
        double number = charactersToDouble(pos, argumentLength, &ok);
        if (!ok)
            return false;
        transformValue->append(cssValuePool().createValue(number, CSSPrimitiveValue::CSS_NUMBER));
        pos += argumentLength + 1;
        --expectedCount;
    }
    return true;
}

template <typename CharType>
static PassRefPtr<CSSTransformValue> parseSimpleTransformValue(CharType*& pos, CharType* end)
{
    static const int shortestValidTransformStringLength = 12;

    if (end - pos < shortestValidTransformStringLength)
        return nullptr;

    const bool isTranslate = toASCIILower(pos[0]) == 't'
        && toASCIILower(pos[1]) == 'r'
        && toASCIILower(pos[2]) == 'a'
        && toASCIILower(pos[3]) == 'n'
        && toASCIILower(pos[4]) == 's'
        && toASCIILower(pos[5]) == 'l'
        && toASCIILower(pos[6]) == 'a'
        && toASCIILower(pos[7]) == 't'
        && toASCIILower(pos[8]) == 'e';

    if (isTranslate) {
        CSSTransformValue::TransformOperationType transformType;
        unsigned expectedArgumentCount = 1;
        unsigned argumentStart = 11;
        CharType c9 = toASCIILower(pos[9]);
        if (c9 == 'x' && pos[10] == '(') {
            transformType = CSSTransformValue::TranslateXTransformOperation;
        } else if (c9 == 'y' && pos[10] == '(') {
            transformType = CSSTransformValue::TranslateYTransformOperation;
        } else if (c9 == 'z' && pos[10] == '(') {
            transformType = CSSTransformValue::TranslateZTransformOperation;
        } else if (c9 == '(') {
            transformType = CSSTransformValue::TranslateTransformOperation;
            expectedArgumentCount = 2;
            argumentStart = 10;
        } else if (c9 == '3' && toASCIILower(pos[10]) == 'd' && pos[11] == '(') {
            transformType = CSSTransformValue::Translate3DTransformOperation;
            expectedArgumentCount = 3;
            argumentStart = 12;
        } else {
            return nullptr;
        }
        pos += argumentStart;
        RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(transformType);
        if (!parseTransformTranslateArguments(pos, end, expectedArgumentCount, transformValue.get()))
            return nullptr;
        return transformValue.release();
    }

    const bool isMatrix3d = toASCIILower(pos[0]) == 'm'
        && toASCIILower(pos[1]) == 'a'
        && toASCIILower(pos[2]) == 't'
        && toASCIILower(pos[3]) == 'r'
        && toASCIILower(pos[4]) == 'i'
        && toASCIILower(pos[5]) == 'x'
        && pos[6] == '3'
        && toASCIILower(pos[7]) == 'd'
        && pos[8] == '(';

    if (isMatrix3d) {
        pos += 9;
        RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(CSSTransformValue::Matrix3DTransformOperation);
        if (!parseTransformNumberArguments(pos, end, 16, transformValue.get()))
            return nullptr;
        return transformValue.release();
    }

    const bool isScale3d = toASCIILower(pos[0]) == 's'
        && toASCIILower(pos[1]) == 'c'
        && toASCIILower(pos[2]) == 'a'
        && toASCIILower(pos[3]) == 'l'
        && toASCIILower(pos[4]) == 'e'
        && pos[5] == '3'
        && toASCIILower(pos[6]) == 'd'
        && pos[7] == '(';

    if (isScale3d) {
        pos += 8;
        RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(CSSTransformValue::Scale3DTransformOperation);
        if (!parseTransformNumberArguments(pos, end, 3, transformValue.get()))
            return nullptr;
        return transformValue.release();
    }

    return nullptr;
}

template <typename CharType>
static PassRefPtr<CSSValueList> parseSimpleTransformList(CharType*& pos, CharType* end)
{
    RefPtr<CSSValueList> transformList = nullptr;
    while (pos < end) {
        while (pos < end && isCSSSpace(*pos))
            ++pos;
        RefPtr<CSSTransformValue> transformValue = parseSimpleTransformValue(pos, end);
        if (!transformValue)
            return nullptr;
        if (!transformList)
            transformList = CSSValueList::createSpaceSeparated();
        transformList->append(transformValue.release());
        if (pos < end) {
            if (isCSSSpace(*pos))
                return nullptr;
        }
    }
    return transformList.release();
}

static bool parseSimpleTransform(MutableStylePropertySet* properties, CSSPropertyID propertyID, const String& string)
{
    if (propertyID != CSSPropertyTransform && propertyID != CSSPropertyWebkitTransform)
        return false;
    if (string.isEmpty())
        return false;
    RefPtr<CSSValueList> transformList = nullptr;
    if (string.is8Bit()) {
        const LChar* pos = string.characters8();
        const LChar* end = pos + string.length();
        transformList = parseSimpleTransformList(pos, end);
        if (!transformList)
            return false;
    } else {
        const UChar* pos = string.characters16();
        const UChar* end = pos + string.length();
        transformList = parseSimpleTransformList(pos, end);
        if (!transformList)
            return false;
    }
    properties->addParsedProperty(CSSProperty(propertyID, transformList.release()));
    return true;
}

PassRefPtr<CSSValueList> BisonCSSParser::parseFontFaceValue(const AtomicString& string)
{
    if (string.isEmpty())
        return nullptr;
    RefPtr<MutableStylePropertySet> dummyStyle = MutableStylePropertySet::create();
    if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, HTMLStandardMode, 0))
        return nullptr;

    RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily);
    if (!fontFamily->isValueList())
        return nullptr;

    return toCSSValueList(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily).get());
}

bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, const Document& document)
{
    ASSERT(!string.isEmpty());

    CSSParserContext context(document);

    if (parseSimpleLengthValue(declaration, propertyID, string, context.mode()))
        return true;
    if (parseColorValue(declaration, propertyID, string, context.mode()))
        return true;
    if (parseKeywordValue(declaration, propertyID, string, context))
        return true;

    BisonCSSParser parser(context);
    return parser.parseValue(declaration, propertyID, string, static_cast<StyleSheetContents*>(0));
}

bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, CSSParserMode cssParserMode, StyleSheetContents* contextStyleSheet)
{
    ASSERT(!string.isEmpty());
    if (parseSimpleLengthValue(declaration, propertyID, string, cssParserMode))
        return true;
    if (parseColorValue(declaration, propertyID, string, cssParserMode))
        return true;

    CSSParserContext context;
    if (contextStyleSheet)
        context = contextStyleSheet->parserContext();

    if (parseKeywordValue(declaration, propertyID, string, context))
        return true;
    if (parseSimpleTransform(declaration, propertyID, string))
        return true;

    BisonCSSParser parser(context);
    return parser.parseValue(declaration, propertyID, string, contextStyleSheet);
}

bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropertyID propertyID, const String& string, StyleSheetContents* contextStyleSheet)
{
    setStyleSheet(contextStyleSheet);

    setupParser("@-internal-value ", string, "");

    m_id = propertyID;

    cssyyparse(this);

    m_rule = nullptr;
    m_id = CSSPropertyInvalid;

    bool ok = false;
    if (!m_parsedProperties.isEmpty()) {
        ok = true;
        declaration->addParsedProperties(m_parsedProperties);
        clearProperties();
    }

    return ok;
}

// The color will only be changed when string contains a valid CSS color, so callers
// can set it to a default color and ignore the boolean result.
bool BisonCSSParser::parseColor(RGBA32& color, const String& string, bool strict)
{
    // First try creating a color specified by name, rgba(), rgb() or "#" syntax.
    if (CSSPropertyParser::fastParseColor(color, string, strict))
        return true;

    BisonCSSParser parser(strictCSSParserContext());

    // In case the fast-path parser didn't understand the color, try the full parser.
    if (!parser.parseColor(string))
        return false;

    CSSValue* value = parser.m_parsedProperties.first().value();
    if (!value->isPrimitiveValue())
        return false;

    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
    if (!primitiveValue->isRGBColor())
        return false;

    color = primitiveValue->getRGBA32Value();
    return true;
}

StyleColor BisonCSSParser::colorFromRGBColorString(const String& colorString)
{
    // FIXME: Rework css parser so it is more SVG aware.
    RGBA32 color;
    if (parseColor(color, colorString.stripWhiteSpace()))
        return StyleColor(color);
    // FIXME: This branch catches the string currentColor, but we should error if we have an illegal color value.
    return StyleColor::currentColor();
}

bool BisonCSSParser::parseColor(const String& string)
{
    setupParser("@-internal-decls color:", string, "");
    cssyyparse(this);
    m_rule = nullptr;

    return !m_parsedProperties.isEmpty() && m_parsedProperties.first().id() == CSSPropertyColor;
}

bool BisonCSSParser::parseSystemColor(RGBA32& color, const String& string)
{
    CSSParserString cssColor;
    cssColor.init(string);
    CSSValueID id = cssValueKeywordID(cssColor);
    if (!CSSPropertyParser::isSystemColor(id))
        return false;

    Color parsedColor = RenderTheme::theme().systemColor(id);
    color = parsedColor.rgb();
    return true;
}

void BisonCSSParser::parseSelector(const String& string, CSSSelectorList& selectorList)
{
    m_selectorListForParseSelector = &selectorList;

    setupParser("@-internal-selector ", string, "");

    cssyyparse(this);

    m_selectorListForParseSelector = 0;
}

PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseInlineStyleDeclaration(const String& string, Element* element)
{
    Document& document = element->document();
    CSSParserContext context = CSSParserContext(document.elementSheet().contents()->parserContext());
    return BisonCSSParser(context).parseDeclaration(string, document.elementSheet().contents());
}

PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::parseDeclaration(const String& string, StyleSheetContents* contextStyleSheet)
{
    setStyleSheet(contextStyleSheet);

    setupParser("@-internal-decls ", string, "");
    cssyyparse(this);
    m_rule = nullptr;

    RefPtr<ImmutableStylePropertySet> style = createStylePropertySet();
    clearProperties();
    return style.release();
}

bool BisonCSSParser::parseDeclaration(MutableStylePropertySet* declaration, const String& string, CSSParserObserver* observer, StyleSheetContents* contextStyleSheet)
{
    setStyleSheet(contextStyleSheet);

    TemporaryChange<CSSParserObserver*> scopedObsever(m_observer, observer);

    setupParser("@-internal-decls ", string, "");
    if (m_observer) {
        m_observer->startRuleHeader(CSSRuleSourceData::STYLE_RULE, 0);
        m_observer->endRuleHeader(1);
        m_observer->startRuleBody(0);
    }

    cssyyparse(this);

    m_rule = nullptr;

    bool ok = false;
    if (!m_parsedProperties.isEmpty()) {
        ok = true;
        declaration->addParsedProperties(m_parsedProperties);
        clearProperties();
    }

    if (m_observer)
        m_observer->endRuleBody(string.length(), false);

    return ok;
}

bool BisonCSSParser::parseAttributeMatchType(CSSSelector::AttributeMatchType& matchType, const String& string)
{
    if (!RuntimeEnabledFeatures::cssAttributeCaseSensitivityEnabled() && !isUASheetBehavior(m_context.mode()))
        return false;
    if (string == "i") {
        matchType = CSSSelector::CaseInsensitive;
        return true;
    }
    return false;
}

static inline void filterProperties(const Vector<CSSProperty, 256>& input, Vector<CSSProperty, 256>& output, size_t& unusedEntries, BitArray<numCSSProperties>& seenProperties)
{
    // Add properties in reverse order so that highest priority definitions are reached first. Duplicate definitions can then be ignored when found.
    for (int i = input.size() - 1; i >= 0; --i) {
        const CSSProperty& property = input[i];
        const unsigned propertyIDIndex = property.id() - firstCSSProperty;
        if (seenProperties.get(propertyIDIndex))
            continue;
        seenProperties.set(propertyIDIndex);
        output[--unusedEntries] = property;
    }
}

PassRefPtr<ImmutableStylePropertySet> BisonCSSParser::createStylePropertySet()
{
    BitArray<numCSSProperties> seenProperties;
    size_t unusedEntries = m_parsedProperties.size();
    Vector<CSSProperty, 256> results(unusedEntries);

    filterProperties(m_parsedProperties, results, unusedEntries, seenProperties);
    if (unusedEntries)
        results.remove(0, unusedEntries);

    return ImmutableStylePropertySet::create(results.data(), results.size(), HTMLStandardMode);
}

void BisonCSSParser::rollbackLastProperties(int num)
{
    ASSERT(num >= 0);
    ASSERT(m_parsedProperties.size() >= static_cast<unsigned>(num));
    m_parsedProperties.shrink(m_parsedProperties.size() - num);
}

void BisonCSSParser::clearProperties()
{
    m_parsedProperties.clear();
    m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
}

void BisonCSSParser::setCurrentProperty(CSSPropertyID propId)
{
    m_id = propId;
}

bool BisonCSSParser::parseValue(CSSPropertyID propId)
{
    return CSSPropertyParser::parseValue(propId, m_valueList.get(), m_context, m_inViewport, m_parsedProperties, m_ruleHeaderType);
}

class TransformOperationInfo {
public:
    TransformOperationInfo(const CSSParserString& name)
        : m_type(CSSTransformValue::UnknownTransformOperation)
        , m_argCount(1)
        , m_allowSingleArgument(false)
        , m_unit(CSSPropertyParser::FUnknown)
    {
        const UChar* characters;
        unsigned nameLength = name.length();

        const unsigned longestNameLength = 12;
        UChar characterBuffer[longestNameLength];
        if (name.is8Bit()) {
            unsigned length = std::min(longestNameLength, nameLength);
            const LChar* characters8 = name.characters8();
            for (unsigned i = 0; i < length; ++i)
                characterBuffer[i] = characters8[i];
            characters = characterBuffer;
        } else
            characters = name.characters16();

        SWITCH(characters, nameLength) {
            CASE("skew(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::SkewTransformOperation;
                m_allowSingleArgument = true;
                m_argCount = 3;
            }
            CASE("scale(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::ScaleTransformOperation;
                m_allowSingleArgument = true;
                m_argCount = 3;
            }
            CASE("skewx(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::SkewXTransformOperation;
            }
            CASE("skewy(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::SkewYTransformOperation;
            }
            CASE("matrix(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::MatrixTransformOperation;
                m_argCount = 11;
            }
            CASE("rotate(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::RotateTransformOperation;
            }
            CASE("scalex(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::ScaleXTransformOperation;
            }
            CASE("scaley(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::ScaleYTransformOperation;
            }
            CASE("scalez(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::ScaleZTransformOperation;
            }
            CASE("scale3d(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::Scale3DTransformOperation;
                m_argCount = 5;
            }
            CASE("rotatex(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::RotateXTransformOperation;
            }
            CASE("rotatey(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::RotateYTransformOperation;
            }
            CASE("rotatez(") {
                m_unit = CSSPropertyParser::FAngle;
                m_type = CSSTransformValue::RotateZTransformOperation;
            }
            CASE("matrix3d(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::Matrix3DTransformOperation;
                m_argCount = 31;
            }
            CASE("rotate3d(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::Rotate3DTransformOperation;
                m_argCount = 7;
            }
            CASE("translate(") {
                m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercent;
                m_type = CSSTransformValue::TranslateTransformOperation;
                m_allowSingleArgument = true;
                m_argCount = 3;
            }
            CASE("translatex(") {
                m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercent;
                m_type = CSSTransformValue::TranslateXTransformOperation;
            }
            CASE("translatey(") {
                m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercent;
                m_type = CSSTransformValue::TranslateYTransformOperation;
            }
            CASE("translatez(") {
                m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercent;
                m_type = CSSTransformValue::TranslateZTransformOperation;
            }
            CASE("perspective(") {
                m_unit = CSSPropertyParser::FNumber;
                m_type = CSSTransformValue::PerspectiveTransformOperation;
            }
            CASE("translate3d(") {
                m_unit = CSSPropertyParser::FLength | CSSPropertyParser::FPercent;
                m_type = CSSTransformValue::Translate3DTransformOperation;
                m_argCount = 5;
            }
        }
    }

    CSSTransformValue::TransformOperationType type() const { return m_type; }
    unsigned argCount() const { return m_argCount; }
    CSSPropertyParser::Units unit() const { return m_unit; }

    bool unknown() const { return m_type == CSSTransformValue::UnknownTransformOperation; }
    bool hasCorrectArgCount(unsigned argCount) { return m_argCount == argCount || (m_allowSingleArgument && argCount == 1); }

private:
    CSSTransformValue::TransformOperationType m_type;
    unsigned m_argCount;
    bool m_allowSingleArgument;
    CSSPropertyParser::Units m_unit;
};

PassRefPtr<CSSValueList> CSSPropertyParser::parseTransform(CSSPropertyID propId)
{
    if (!m_valueList)
        return nullptr;

    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
    for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
        RefPtr<CSSValue> parsedTransformValue = parseTransformValue(propId, value);
        if (!parsedTransformValue)
            return nullptr;

        list->append(parsedTransformValue.release());
    }

    return list.release();
}

PassRefPtr<CSSValue> CSSPropertyParser::parseTransformValue(CSSPropertyID propId, CSSParserValue *value)
{
    if (value->unit != CSSParserValue::Function || !value->function)
        return nullptr;

    // Every primitive requires at least one argument.
    CSSParserValueList* args = value->function->args.get();
    if (!args)
        return nullptr;

    // See if the specified primitive is one we understand.
    TransformOperationInfo info(value->function->name);
    if (info.unknown())
        return nullptr;

    if (!info.hasCorrectArgCount(args->size()))
        return nullptr;

    // The transform is a list of functional primitives that specify transform operations.
    // We collect a list of CSSTransformValues, where each value specifies a single operation.

    // Create the new CSSTransformValue for this operation and add it to our list.
    RefPtr<CSSTransformValue> transformValue = CSSTransformValue::create(info.type());

    // Snag our values.
    CSSParserValue* a = args->current();
    unsigned argNumber = 0;
    while (a) {
        CSSPropertyParser::Units unit = info.unit();

        if (info.type() == CSSTransformValue::Rotate3DTransformOperation && argNumber == 3) {
            // 4th param of rotate3d() is an angle rather than a bare number, validate it as such
            if (!validUnit(a, FAngle, HTMLStandardMode))
                return nullptr;
        } else if (info.type() == CSSTransformValue::Translate3DTransformOperation && argNumber == 2) {
            // 3rd param of translate3d() cannot be a percentage
            if (!validUnit(a, FLength, HTMLStandardMode))
                return nullptr;
        } else if (info.type() == CSSTransformValue::TranslateZTransformOperation && !argNumber) {
            // 1st param of translateZ() cannot be a percentage
            if (!validUnit(a, FLength, HTMLStandardMode))
                return nullptr;
        } else if (info.type() == CSSTransformValue::PerspectiveTransformOperation && !argNumber) {
            // 1st param of perspective() must be a non-negative number (deprecated) or length.
            if ((propId == CSSPropertyWebkitTransform && !validUnit(a, FNumber | FLength | FNonNeg, HTMLStandardMode))
                || (propId == CSSPropertyTransform && !validUnit(a, FLength | FNonNeg, HTMLStandardMode)))
                return nullptr;
        } else if (!validUnit(a, unit, HTMLStandardMode)) {
            return nullptr;
        }

        // Add the value to the current transform operation.
        transformValue->append(createPrimitiveNumericValue(a));

        a = args->next();
        if (!a)
            break;
        if (a->unit != CSSParserValue::Operator || a->iValue != ',')
            return nullptr;
        a = args->next();

        argNumber++;
    }

    return transformValue.release();
}

void BisonCSSParser::ensureLineEndings()
{
    if (!m_lineEndings)
        m_lineEndings = lineEndings(*m_source);
}

CSSParserSelector* BisonCSSParser::createFloatingSelectorWithTagName(const QualifiedName& tagQName)
{
    CSSParserSelector* selector = new CSSParserSelector(tagQName);
    m_floatingSelectors.append(selector);
    return selector;
}

CSSParserSelector* BisonCSSParser::createFloatingSelector()
{
    CSSParserSelector* selector = new CSSParserSelector;
    m_floatingSelectors.append(selector);
    return selector;
}

PassOwnPtr<CSSParserSelector> BisonCSSParser::sinkFloatingSelector(CSSParserSelector* selector)
{
    if (selector) {
        size_t index = m_floatingSelectors.reverseFind(selector);
        ASSERT(index != kNotFound);
        m_floatingSelectors.remove(index);
    }
    return adoptPtr(selector);
}

Vector<OwnPtr<CSSParserSelector> >* BisonCSSParser::createFloatingSelectorVector()
{
    Vector<OwnPtr<CSSParserSelector> >* selectorVector = new Vector<OwnPtr<CSSParserSelector> >;
    m_floatingSelectorVectors.append(selectorVector);
    return selectorVector;
}

PassOwnPtr<Vector<OwnPtr<CSSParserSelector> > > BisonCSSParser::sinkFloatingSelectorVector(Vector<OwnPtr<CSSParserSelector> >* selectorVector)
{
    if (selectorVector) {
        size_t index = m_floatingSelectorVectors.reverseFind(selectorVector);
        ASSERT(index != kNotFound);
        m_floatingSelectorVectors.remove(index);
    }
    return adoptPtr(selectorVector);
}

CSSParserValueList* BisonCSSParser::createFloatingValueList()
{
    CSSParserValueList* list = new CSSParserValueList;
    m_floatingValueLists.append(list);
    return list;
}

PassOwnPtr<CSSParserValueList> BisonCSSParser::sinkFloatingValueList(CSSParserValueList* list)
{
    if (list) {
        size_t index = m_floatingValueLists.reverseFind(list);
        ASSERT(index != kNotFound);
        m_floatingValueLists.remove(index);
    }
    return adoptPtr(list);
}

CSSParserFunction* BisonCSSParser::createFloatingFunction()
{
    CSSParserFunction* function = new CSSParserFunction;
    m_floatingFunctions.append(function);
    return function;
}

CSSParserFunction* BisonCSSParser::createFloatingFunction(const CSSParserString& name, PassOwnPtr<CSSParserValueList> args)
{
    CSSParserFunction* function = createFloatingFunction();
    function->name = name;
    function->args = args;
    return function;
}

PassOwnPtr<CSSParserFunction> BisonCSSParser::sinkFloatingFunction(CSSParserFunction* function)
{
    if (function) {
        size_t index = m_floatingFunctions.reverseFind(function);
        ASSERT(index != kNotFound);
        m_floatingFunctions.remove(index);
    }
    return adoptPtr(function);
}

CSSParserValue& BisonCSSParser::sinkFloatingValue(CSSParserValue& value)
{
    if (value.unit == CSSParserValue::Function) {
        size_t index = m_floatingFunctions.reverseFind(value.function);
        ASSERT(index != kNotFound);
        m_floatingFunctions.remove(index);
    }
    return value;
}

StyleRuleBase* BisonCSSParser::createSupportsRule(bool conditionIsSupported, RuleList* rules)
{
    m_allowImportRules = m_allowNamespaceDeclarations = false;

    RefPtr<CSSRuleSourceData> data = popSupportsRuleData();
    RefPtr<StyleRuleSupports> rule = nullptr;
    String conditionText;
    unsigned conditionOffset = data->ruleHeaderRange.start + 9;
    unsigned conditionLength = data->ruleHeaderRange.length() - 9;

    if (m_tokenizer.is8BitSource())
        conditionText = String(m_tokenizer.m_dataStart8.get() + conditionOffset, conditionLength).stripWhiteSpace();
    else
        conditionText = String(m_tokenizer.m_dataStart16.get() + conditionOffset, conditionLength).stripWhiteSpace();

    if (rules) {
        rule = StyleRuleSupports::create(conditionText, conditionIsSupported, *rules);
    } else {
        RuleList emptyRules;
        rule = StyleRuleSupports::create(conditionText, conditionIsSupported, emptyRules);
    }

    StyleRuleSupports* result = rule.get();
    m_parsedRules.append(rule.release());

    return result;
}

void BisonCSSParser::markSupportsRuleHeaderStart()
{
    if (!m_supportsRuleDataStack)
        m_supportsRuleDataStack = adoptPtr(new RuleSourceDataList());

    RefPtr<CSSRuleSourceData> data = CSSRuleSourceData::create(CSSRuleSourceData::SUPPORTS_RULE);
    data->ruleHeaderRange.start = m_tokenizer.tokenStartOffset();
    m_supportsRuleDataStack->append(data);
}

void BisonCSSParser::markSupportsRuleHeaderEnd()
{
    ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty());

    if (m_tokenizer.is8BitSource())
        m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.tokenStart<LChar>() - m_tokenizer.m_dataStart8.get();
    else
        m_supportsRuleDataStack->last()->ruleHeaderRange.end = m_tokenizer.tokenStart<UChar>() - m_tokenizer.m_dataStart16.get();
}

PassRefPtr<CSSRuleSourceData> BisonCSSParser::popSupportsRuleData()
{
    ASSERT(m_supportsRuleDataStack && !m_supportsRuleDataStack->isEmpty());
    RefPtr<CSSRuleSourceData> data = m_supportsRuleDataStack->last();
    m_supportsRuleDataStack->removeLast();
    return data.release();
}

BisonCSSParser::RuleList* BisonCSSParser::createRuleList()
{
    OwnPtr<RuleList> list = adoptPtr(new RuleList);
    RuleList* listPtr = list.get();

    m_parsedRuleLists.append(list.release());
    return listPtr;
}

BisonCSSParser::RuleList* BisonCSSParser::appendRule(RuleList* ruleList, StyleRuleBase* rule)
{
    if (rule) {
        if (!ruleList)
            ruleList = createRuleList();
        ruleList->append(rule);
    }
    return ruleList;
}

template <typename CharacterType>
ALWAYS_INLINE static void makeLower(const CharacterType* input, CharacterType* output, unsigned length)
{
    // FIXME: If we need Unicode lowercasing here, then we probably want the real kind
    // that can potentially change the length of the string rather than the character
    // by character kind. If we don't need Unicode lowercasing, it would be good to
    // simplify this function.

    if (charactersAreAllASCII(input, length)) {
        // Fast case for all-ASCII.
        for (unsigned i = 0; i < length; i++)
            output[i] = toASCIILower(input[i]);
    } else {
        for (unsigned i = 0; i < length; i++)
            output[i] = Unicode::toLower(input[i]);
    }
}

void BisonCSSParser::tokenToLowerCase(CSSParserString& token)
{
    // Since it's our internal token, we know that we created it out
    // of our writable work buffers. Therefore the const_cast is just
    // ugly and not a potential crash.
    size_t length = token.length();
    if (token.is8Bit()) {
        makeLower(token.characters8(), const_cast<LChar*>(token.characters8()), length);
    } else {
        makeLower(token.characters16(), const_cast<UChar*>(token.characters16()), length);
    }
}

void BisonCSSParser::endInvalidRuleHeader()
{
    if (m_ruleHeaderType == CSSRuleSourceData::UNKNOWN_RULE)
        return;

    CSSParserLocation location;
    location.lineNumber = m_tokenizer.m_lineNumber;
    location.offset = m_ruleHeaderStartOffset;
    if (m_tokenizer.is8BitSource())
        location.token.init(m_tokenizer.m_dataStart8.get() + m_ruleHeaderStartOffset, 0);
    else
        location.token.init(m_tokenizer.m_dataStart16.get() + m_ruleHeaderStartOffset, 0);

    reportError(location, m_ruleHeaderType == CSSRuleSourceData::STYLE_RULE ? InvalidSelectorCSSError : InvalidRuleCSSError);

    endRuleHeader();
}

StyleRuleBase* BisonCSSParser::createStyleRule(Vector<OwnPtr<CSSParserSelector> >* selectors)
{
    StyleRule* result = 0;
    if (selectors) {
        m_allowImportRules = m_allowNamespaceDeclarations = false;
        RefPtr<StyleRule> rule = StyleRule::create();
        rule->parserAdoptSelectorVector(*selectors);
        rule->setProperties(createStylePropertySet());
        result = rule.get();
        m_parsedRules.append(rule.release());
    }
    clearProperties();
    return result;
}

StyleRuleBase* BisonCSSParser::createFontFaceRule()
{
    m_allowImportRules = m_allowNamespaceDeclarations = false;
    for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
        CSSProperty& property = m_parsedProperties[i];
        if (property.id() == CSSPropertyFontVariant && property.value()->isPrimitiveValue())
            property.wrapValueInCommaSeparatedList();
        else if (property.id() == CSSPropertyFontFamily && (!property.value()->isValueList() || toCSSValueList(property.value())->length() != 1)) {
            // Unlike font-family property, font-family descriptor in @font-face rule
            // has to be a value list with exactly one family name. It cannot have a
            // have 'initial' value and cannot 'inherit' from parent.
            // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
            clearProperties();
            return 0;
        }
    }
    RefPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create();
    rule->setProperties(createStylePropertySet());
    clearProperties();
    StyleRuleFontFace* result = rule.get();
    m_parsedRules.append(rule.release());
    return result;
}

CSSParserSelector* BisonCSSParser::rewriteSpecifiersWithNamespaceIfNeeded(CSSParserSelector* specifiers)
{
    if (m_defaultNamespace != starAtom)
        return rewriteSpecifiersWithElementName(nullAtom, starAtom, specifiers, /*tagIsForNamespaceRule*/true);
    return specifiers;
}

CSSParserSelector* BisonCSSParser::rewriteSpecifiersWithElementName(const AtomicString& namespacePrefix, const AtomicString& elementName, CSSParserSelector* specifiers, bool tagIsForNamespaceRule)
{
    QualifiedName tag(elementName);

    // *:host never matches, so we can't discard the * otherwise we can't tell the
    // difference between *:host and just :host.
    if (tag == anyName && !specifiers->hasHostPseudoSelector())
        return specifiers;
    specifiers->prependTagSelector(tag, tagIsForNamespaceRule);
    return specifiers;
}

CSSParserSelector* BisonCSSParser::rewriteSpecifiers(CSSParserSelector* specifiers, CSSParserSelector* newSpecifier)
{
    specifiers->appendTagHistory(sinkFloatingSelector(newSpecifier));
    return specifiers;
}

void BisonCSSParser::startDeclarationsForMarginBox()
{
    m_numParsedPropertiesBeforeMarginBox = m_parsedProperties.size();
}

void BisonCSSParser::endDeclarationsForMarginBox()
{
    rollbackLastProperties(m_parsedProperties.size() - m_numParsedPropertiesBeforeMarginBox);
    m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
}

void BisonCSSParser::startRule()
{
    if (!m_observer)
        return;

    ASSERT(m_ruleHasHeader);
    m_ruleHasHeader = false;
}

void BisonCSSParser::endRule(bool valid)
{
    if (!m_observer)
        return;

    if (m_ruleHasHeader)
        m_observer->endRuleBody(m_tokenizer.safeUserStringTokenOffset(), !valid);
    m_ruleHasHeader = true;
}

void BisonCSSParser::startRuleHeader(CSSRuleSourceData::Type ruleType)
{
    m_ruleHeaderType = ruleType;
    m_ruleHeaderStartOffset = m_tokenizer.safeUserStringTokenOffset();
    m_ruleHeaderStartLineNumber = m_tokenizer.m_tokenStartLineNumber;
    if (m_observer) {
        ASSERT(!m_ruleHasHeader);
        m_observer->startRuleHeader(ruleType, m_ruleHeaderStartOffset);
        m_ruleHasHeader = true;
    }
}

void BisonCSSParser::endRuleHeader()
{
    ASSERT(m_ruleHeaderType != CSSRuleSourceData::UNKNOWN_RULE);
    m_ruleHeaderType = CSSRuleSourceData::UNKNOWN_RULE;
    if (m_observer) {
        ASSERT(m_ruleHasHeader);
        m_observer->endRuleHeader(m_tokenizer.safeUserStringTokenOffset());
    }
}

void BisonCSSParser::startSelector()
{
    if (m_observer)
        m_observer->startSelector(m_tokenizer.safeUserStringTokenOffset());
}

void BisonCSSParser::endSelector()
{
    if (m_observer)
        m_observer->endSelector(m_tokenizer.safeUserStringTokenOffset());
}

void BisonCSSParser::startRuleBody()
{
    if (m_observer)
        m_observer->startRuleBody(m_tokenizer.safeUserStringTokenOffset());
}

void BisonCSSParser::startProperty()
{
    if (m_observer)
        m_observer->startProperty(m_tokenizer.safeUserStringTokenOffset());
}

void BisonCSSParser::endProperty(bool isPropertyParsed, CSSParserError errorType)
{
    m_id = CSSPropertyInvalid;
    if (m_observer)
        m_observer->endProperty(isPropertyParsed, m_tokenizer.safeUserStringTokenOffset(), errorType);
}

void BisonCSSParser::startEndUnknownRule()
{
    if (m_observer)
        m_observer->startEndUnknownRule();
}

}

redpajama_set_name: RedPajamaGithub


text:
Dorian Gregory (* 26. Januar 1971 in Washington, D.C.) ist ein US-amerikanischer Filmschauspieler und TV-Moderator.

Mit neun Jahren zog er nach Los Angeles, Kalifornien. Seine Schauspielkarriere begann Dorian Gregory ab 1991 mit Gastrollen in verschiedenen Serien. So war er u. a. in Baywatch, Beverly Hills, 90210 und Sister, Sister zu sehen. Seine erste größere Rolle spielte er in Baywatch Nights, wo er von 1996 bis 1997 als "Diamont Teague" zur Stammbesetzung gehörte. 1998 erhielt Dorian Gregory die Rolle des Polizisten "Darryl Morris" in der Serie Charmed, die er bis 2005 spielte. 2003 bis 2006 war er Moderator der Musikshow Soul Train. Es folgten überwiegend kleinere Filmproduktionen und Fernsehrollen.

Privat engagiert sich Gregory stark für verschiedene Wohltätigkeitsorganisationen. Als Mitglied des "Jeopardy Programms" des Los Angeles Police Departments setzt er sich für Jugendliche mit Problemen ein. Außerdem fungiert er als Sprecher für die American Diabetes Association, wobei er seine eigenen Erfahrungen einbringen kann, denn er leidet selbst seit seiner Kindheit an Diabetes. Des Weiteren ist Dorian Gregory für das "AIDS Project LA" und für die Organisation "Mothers Against Drunk Driving" tätig.

Filmografie (Auswahl)
 1996–1997: Baywatch Nights (Fernsehserie, 17 Folgen)
 1998–2005: Charmed – Zauberhafte Hexen (Charmed, Fernsehserie, 70 Folgen)
 2005: Getting Played
 2013: Deceitful
 2017: The Lurking Man
 2018: When It Comes Around
 2019: Christmas Matchmakers
 2021: The Wrong Real Estate Agent

Weblinks

Einzelnachweise

Filmschauspieler
Fernsehmoderator (Vereinigte Staaten)
US-Amerikaner
Geboren 1971
Mann

redpajama_set_name: RedPajamaWikipedia


ATHENS, GEORGIA CHAPTER OF S.P.E.B.S.Q.S.A., INC.
ATHENS, GEORGIA, LODGE NO. 790, B.P.O.E. OF THE UNITED STATES OF AMERICA, INC.
ATHENS-CLARK COUNTY CRIME STOPPERS, INC.
ATHENS Y CAMPS FOUNDATION, INC.
SAFE HAVEN FOR PETS, INC.
GE CAPITAL MORTGAGE SERVICES OF CALIFORNIA, INC.
THE GEORGIA COUNCIL OF SHOPPING CENTERS, INC.
BABB'S HEALTHY HEART FARMS, INC.
TITLE EXCHANGE & PAWN OF CALHOUN, INC.
D & H LOGGING COMPANY, INC.
D & K CLEANING, INC.
FURNITURE & MATTRESS DISCOUNTERS OF AMERICA, INC.
KENNETH FARMER ADVERTISING ART, INC.
NU PHI ZETA FOUNDATION, INC.
ALLSOUTH TURF AND IRRIGATION AN HARDWARE INC.


text:
Human Smuggling/Trafficking
Denver-area man found guilty of human trafficking and other offenses
DENVER – A federal jury convicted a Denver-area man Monday of 89 counts of mail fraud, visa fraud, human trafficking and money laundering, the U.S. Attorney's Office for the District of Colorado announced.
After a four-week trial, the jury deliberated for about a day and a half before reaching its verdicts. Kizzy Kalu, 49, of Highlands Ranch, Colo., who was in custody during the trial, was remanded into custody after the verdicts were read. Kalu was found not guilty of six counts. He is scheduled to be sentenced by Chief U.S. District Court Judge Marcia S. Krieger Sept. 23.
Prior to trial, co-defendant, Philip Langerman, 78, of McDonough, Ga., pleaded guilty for his role in the criminal scheme. A sentencing date has not yet been scheduled for Langerman.
Kalu was indicted by a federal grand jury in Denver March 1, 2012. A superseding indictment was obtained Feb. 12, 2013. The jury trial started June 3. Kalu was found guilty July 1 of 89 of 95 counts.
This case was investigated by the following agencies: U.S. Immigration and Customs Enforcement's (ICE) Homeland Security Investigations (HSI), the Department of State's Diplomatic Security Service, and the U.S. Department of Labor's Office of the Inspector General, Office of Labor Racketeering and Fraud Investigations. Further critical support was provided by U.S. Citizenship and Immigration Services' (USCIS) Office of Fraud Detection and National Security, and the Douglas County Sheriff's Office.
According to the indictment and evidence presented at trial, Kalu and Langerman were involved in a scheme making false representations to foreign nationals to the State of Colorado, to the United States of America, and to others to obtain money. Kalu and Langerman provided false information to the U.S. government to obtain the apparent lawful presence in the U.S. of foreign nationals. The foreign nationals then worked for nursing homes and other long-term care facilities. Those facilities paid Kalu's company, Foreign Healthcare Professionals Group, for the hours the foreign nationals worked. Kalu retained about 40 percent of the money earned from the labor of the foreign nationals.
Among the false information provided to the U.S. government was that the foreign nationals would be employed by Adam University as nurse instructor supervisors and earn more than the prevailing wage so as not to undermine the wages of U.S. workers. Nurse instructor supervisors were considered "specialty occupations" under U.S. immigration law and regulations. Adam University existed largely in name only and had no genuine need for nurse instructor supervisors. The foreign nationals were granted H-1B visas based on fraudulent representations, which permitted them to be employed as nurse instructors/supervisors by the largely nonexistent Adam University. Rather than working in specialty occupations, the foreign nationals instead worked as nurses earning below the prevailing wage.
Kalu also made false representations to the foreign nationals, including that they would have full-time work available in Colorado. Upon their arrival, they learned that they would have to interview for positions and would not be employed by Adam University in a clinical setting. Some were unable to find full-time work. Some learned that Kalu would not allow them to travel freely. Kalu threatened to cause their deportation if the foreign nationals did not provide him their labor and services. As Kalu's scheme evolved, Kalu directed that the foreign nationals find work on their own and be paid directly by the healthcare facilities. However, Kalu demanded that the foreign nationals pay him between $800 to $1,200 per month or face deportation. Kalu threatened to notify the U.S. Department of Homeland Security and have their visas canceled if they did not pay him the money he demanded. Kalu used debt to help keep the foreign nationals with him. Many had gone deeply into debt to pay him for assistance to obtain the visas. In addition, Kalu required that the foreign nationals sign employment contracts that provided they would owe Kalu $25,000 if they left his employment.
Kalu was convicted of the following charges:
19 counts of commercial carrier/mail fraud, which carries a penalty of not more than 20 years in federal prison, per count;
three counts of visa fraud, which carries a penalty of not more than 10 years in federal prison, per count;
nine counts of trafficking in forced labor, which carries a penalty of not more than 20 years in federal prison, per count;
13 counts of forced labor, which carries a penalty of not more than 20 years per count;
15 counts of encouraging and inducing aliens to enter the U.S., which carries a penalty of not more than 10 years in prison, per count; and
30 counts of money laundering, which carries a penalty of not more than 20 years in prison per count.
Each of the 89 counts also carries a fine of up to $250,000.
"We don't tolerate lying to the United States," said First Assistant U.S. Attorney Bob Troyer, District of Colorado. "And we don't tolerate victimizing laborers and cheating folks out of their hard-earned money. Today's guilty verdict on 89 criminal counts confirms these simple truths, and it comes as a direct result of the determination and skill of the prosecution team and the talented agents from the State Department's Diplomatic Security Service, ICE Homeland Security Investigations, and the U.S. Department of Labor's Office of the Inspector General, Office of Labor Racketeering and Fraud Investigations."
"Homeland Security Investigations aggressively investigates human trafficking, which is modern-day slavery," said Kumar Kibble, special agent in charge of HSI in Denver. "These human traffickers use force, fraud and coercion to obtain free or cheap labor from their victims so the traffickers can maximize their profits."
"Today's verdict reflects Diplomatic Service's commitment to aggressively protect U.S. borders and the integrity of our travel document and labor laws," said Michael Bayer, special agent in charge of the Department of State's Diplomatic Security Service. "Diplomatic Security is committed to working with the U.S. Attorney's Office, DHS-HSI, and other Law Enforcement Agencies around the world to investigate allegations of Passport and visa fraud, trafficking in humans, forced labor and other associated offenses, and to bring those who commit these crimes to justice."
Kalu was prosecuted by Special Assistant U.S. Attorney Beth Gibson and Assistant U.S. Attorney Robert Brown.

redpajama_set_name: RedPajamaCommonCrawl


longer, in fact, than Tennessee has been a state.
What makes America great? Democracy!
Be sure to do your civic duty and vote in the elections.
Know when elections are being held and deadlines.
Our staff is working to bring Washington County Election Commission into the mobile age starting with our website. Our commitment is to provide you with access to all the information and forms you need to express your democracy by voting.
Register to Vote, Request a Ballot, or Update My Voter Info all online.
Using the latest in mobile technology you can now subscribe to our election calendar on your mobile phone or computer. Stay up to date on upcoming elections and important deadlines.
On election night you can visit our website to access live results as precincts report in.
Register to Vote, Request a Ballot, or Update My Voter Info online.
Stay up to date with important articles and announcements concerning upcoming Washington County elections.
Visit our growing Frequently Asked Questions section. Can't find what your looking for? Reach out to us, we are here to serve you.
We now have county, district, and precinct maps online.
Art Center, Gray Commons, or our Main Office Downtown Jonesborough.
Stay current with important articles, notices, and postings concerning the Washington County elections from the staff of Washington County Election Commission.
Our commission is comprised of appointed members.
We strive to provide information in the most accurate and transparent way. Our office is open to stop by with any questions you may have.


The Daily Logo Challenge is part of several affiliate sales networks. This means that many of the companies whose products you see listed on this site pay us referral fees for sending them customers for certain products of theirs.
When you click to buy those products using the links that you find on this site, we receive compensation from the company that sells the product. Being a part of these networks makes it possible to support a team of writers who help provide the latest graphic design information free to our loyal readers.
Opinions presented on the site are those of Daily Logo Challenge or our team of writers who at times may post their own opinions.
Affiliate networks include Smartmockups, Placeit, and many other smaller affiliate networks.


text:
Review of Starborn by Lucy Hounsom
Title/Author: Starborn (The Worldmaker Trilogy #1) by Lucy Hounsom
Publisher/Date published: Tor UK, April 23rd 2015
Goodreads summary: Death and destruction will bar her way...
Kyndra's fate holds betrayal and salvation, but the journey starts in her small village. On the day she comes of age, she accidentally disrupts an ancient ceremony, ending centuries of tradition. So when an unnatural storm targets her superstitious community, Kyndra is blamed. She fears for her life until two strangers save her, by wielding powers not seen for an age - powers fuelled by the sun and the moon.
Together, they flee to the hidden citadel of Naris. And here, Kyndra experiences disturbing visions of the past, showing war and one man's terrifying response. She'll learn more in the city's subterranean chambers, amongst fanatics and rebels. But first Kyndra will be brutally tested in a bid to unlock her own magic.
If she survives the ordeal, she'll discover a force greater than she could ever have imagined. But could it create as well as destroy? And can she control it, to right an ancient wrong?
I was so hoping I'd love this, cause it sounded awesome, I mean, I'm all for characters going on a journey and learning about school and hidden powers and just yes, ok? I have a soft spot for this type of story. But sadly, it didn't fully work for me.
Starborn is a pretty big book, it was over 400 pages on my e-reader. And they were in teeny-tiny script cause my e-reader can't handle pdf for some reason (SO ANNOYING), so I really needed this to be interesting, cause there was a big investment as to squinty eyes and time. And it was really interesting at first, I mean, Kyndra basically destroys a relic of her hometown by accident and almost gets killed by an angry mob after that. So she flees and there is all this secrecy from the two people who rescued her from said angry mob about their powers and I kinda wanted to shake them and have them tell her what the heck was going on because UGH, you're taking her to a place where she's going to get all these answers, why not fill her in on the way and not blindside her? But yeah, I was intrigued, because this Starborn is a whole different class of Wielder and I think everyone will be able to guess that's what Kyndra is, so I don't think that counts as a spoiler. I mean, it's pretty much staring you in the face.
By the time we got the Naris, the secret Wielder city, things started going South for me. I mean, up until that time I was doing ok with Kyndra, we were bonding a bit and then she goes and does something that was so incredibly WTF-ish, I can't even. I mean, she's assaulted by three students (ok, one mostly watched, but still, you're just as guilty in my opinion), even sexually assaulted and then the next minute she's best friends with them? I mean, WTF? SERIOUSLY??? How are you going to trust these people who were mean and vicious and all of a sudden I'm supposed to believe they're actually really good people? I mean, WHAT?? Are you out of your mind? Report it and move on to people who won't attack you. There was not even so much as a real apology.
And then she's crushing on this dude that makes me go ewww, why you so annoying? I mean, he's obviously sketchy, I don't care if he's pretty, there's a reason the two good people in your life, who rescued you, don't like him. Grow a brain or something.
I did think that the magic system was pretty interesting, with there being two types of Wielders who aren't all powerful, cause their powers are controlled by either the sun or the moon and so the different parts of the day are their strengths and weaknesses. That was pretty cool. And I would have loved seeing Kyndra develop her power gradually and learn through trial and error. Instead we went from zero to ALL OF THE POWER and knowing how to control it in about 2 seconds. Yeah, I'm not digging that. And I know that there's a reason for that, but it's not one that I particularly enjoy and feels like it's a bit too convenient. I mean, wow, previous Starborns couldn't do it and she can when she's just gotten into her powers? Just. No.
Something that I did like were Kyndra's two rescuers. They were SUCH interesting characters and the relationship between them was just YES! SHIPPING IT! There's all this history and longing and just I'm in. When one or both of them were present I was very much enjoying reading Starborn, preferably with an absent Kyndra, but I'll take what I can get.
So I guess what I'm saying is that I'm disappointed by this book. It could have been so much better than it was and there were just too many things that annoyed me.
Micaella Lopez May 14, 2015 at 3:28 PM
Very entertaining! The opening chapters have a familiar Wheel of Time feel, but then Starborn quickly finds its own path full of new and exciting places, characters, and fantasy elements. It also does a great job of keeping the reader guessing at different characters' motives, and who can or can't be trusted.
Bowers and Wilkins P5 Series 2


Argentina's Francisco Saubidet Birkner and China's Linli Wu claimed the Boy's and Girl's Techno 293 honours as sailing concluded at the Nanjing 2014 Youth Olympic Games in China.
A single undiscardable race brought the Techno 293 racing to a close with the conditions testing the 20 boy's and 21 girl's racers who took to the course. Three knots gusting up to eight knots from an easterly direction made life tough on the race course with those with excellent tactical nous and light wind prowess excelling.
Argentina's Francisco Saubidet Birkner overthrew Russia's Maxim Tokarev to take Boy's Techno 293 gold in a winner take all final duel.
The points were extremely tight between the top seven of the pack with plenty of equations possible. In the end it turned out to be a tussle at the top between Saubidet Birkner and Tokarev.
Saubidet Birkner and Tokarev jostled for position throughout the final race with the places going to and fro. The Argentine read the conditions perfectly to overtake Tokarev and finish second in the final race, one place ahead of the Russian to take the title.
"I'm very happy because the wind was very difficult today," said the Argentina. "I raced very good, I was always on the right side and I finished second and first overall, so it's perfect.
"We've trained all of the year for this event so we are very happy that that I finished first."
From six races, Tokarev took a one point lead over the Argentine going into the final day. Saubidet Birkner was aware of the threat that Tokarev posed, as he explained, "He's very good in this wind and in this wind I think he's the best. I started very good and very near to him and I raced always next to him because I was second and one point behind him. In the last lap I was on the right side so I finished second and he finished third."
Tokarev was visibly disappointed upon completion of the final race but was happy ashore, "I was behind my opponent at the second upwind but the wind dropped and my opponent went ahead of me so maybe he was more powerful or maybe it was luck.
"I'm happy that I have silver and the girl from my team also picked up silver so Russia is the most powerful team in the Techno now."
The Netherlands Lars van Someren (NED) came into the day with a chance of gold and a threat of dropping completely out of the medals. He came through in fourth position to seal bronze and after racing he said, "I'm super happy. Before I came here I expected a top five but a medal is amazing. I love being on the podium."
Van Someren headed straight to the spectator stand after racing where he greeted his family, "Well my dad has been over excited all the week. He's supported me all the way and my mother as well with all the time they've invested with the training, the driving, buying equipment and without them I couldn't have done it so that's why I wanted to thank them first."
Linli Wu took gold for China in the Girl's Techno 293 with a final race bullet stylishly sealing the deal on her home waters.
Wu dominated the pack throughout the week and took a seven point advantage into the final day. Despite being middle of the pack at the first mark she worked her way up the fleet to seal an emphatic victory with the chasing racers a considerable distance behind.
After racing Wu said, "I had good starts and used the wind shifts and got to know the wind well before. I could see from the beginning it would be pumping tactics and I am quite good at that.
"To prepare for this event I lost some weight and went from 65kg to 55kg for the light conditions because I knew it would be light conditions.
"I am very happy and very proud."
Before racing commenced the Chinese sailor was somewhat of an unknown quantity but the fleet got to know her quickly as she took four of seven race victories.
Mariam Sekhposyan picked up silver and was content with her performance, "I'm happy that everything is over but I'm upset that it's just silver because I didn't know the Chinese girl and when I saw her in the first races I was like, 'what, who is this?' but she is very good."
France's Lucie Pianazza wrapped up bronze, finishing the final race in fourth, "It was difficult because the wind moved a lot but I finished third or fourth because I arrived as the same time as the Thailand sailor. It's great because I am third and it's beautiful.
"I would like to have an Olympic medal but I have bronze here and I am really happy. I will move to the RS:X and I would like to go to the Worlds and be in the top and one of the best athletes. I want to sail at the ISAF Youth Worlds."


text:
Mole National Park - A must-visit animal, plant kingdom
BY: Mohammed Fugu
Category: Features
A herd of elephants moving around the reserve and Some revellers on a ride into the reserve
The chirping of birds, screeching of monkeys and yaking and wahoos of baboons welcome every tourist to the park.
It has very rich flora and fauna and is arguably Ghana's first, largest and most prestigious national park.
Located near Damongo in the West Gonja Municipality in the Savannah Region, the Mole National Park is managed mainly for its outstanding natural, physical, historical and cultural values.
Established in 1958, the park covers an area of 4,840sq km of undulating terrain with steep scarps.
It is rich in biodiversity and home to some 742 vascular plant species and over 90 mammal species, including five primate species.
Some of the species of conservation and tourist interest include Elephants, Buffalos, Kobs, Western Hartebeests, Roan Antelopes, Defassa Waterbucks, Oribis, Bohor Reedbucks and Red-flanked Duikers.
Rare and endangered species include the Yellow-backed Duiker, Black and White Colobus Monkey, Leopard and Lion.
Also, the park is home to 334 bird species, 33 reptiles, nine amphibian species and some 120 butterfly species.
The park has the most viable elephant population in Ghana, and as such, is a hotspot for elephant conservation.
It is also said to have a unique breed of elephants, which are not hostile, not aggressive or insecure, compared to other elephant populations in the rest of Africa.
Mole shares its borders with 33 fringe communities in two regions - Northern and Upper West.
Adjoining communities
In addition to savouring the precious flora and fauna through game viewing, bird watching, informative walks and camping, visitors to the park can also visit some of the neighbouring communities and experience their rich cultural heritage, architecture and traditional livelihood activities, among others.
Located near the park are the ancient Larabanga Mosque, Mystic Stone, Mognori Eco-Village and a host of sites that revellers can also visit to spice up their tour.
The park is also Ghana's most developed tourism site in terms of tourist amenities, as it has West Africa's first luxury safari lodge nestled in the heart of the Mole forest.
Known as the Zaina Lodge, it provides world-class hospitality service with a unique touch. There are also very affordable guest houses within the park's community.
Serene environment
The Manager of the Park, Chief Ali Mahama, in an interview, said: "For those who want to interact with nature and also a serene environment to relax, Mole is obviously the best destination."
He indicated that the park had put in place stringent measures to provide quality services to tourists while ensuring their safety.
Chief Mahama added: "We have reviewed our prices upwards marginally to reflect the current economic situation, we have packages for both middle and low-income earners."
However, poaching and illegal logging have been the biggest threat at the Mole National Park.
Chief Mahama expressed worry about the increasing cases of poaching around the reserve and said management had put in place stringent measures to help protect the wildlife in the park.
A Canadian reveller, Irene Thompson, who shared her experience with the Daily Graphic, said, "I am really enjoying the place, I get to connect with nature and have a good rest and that's all I need to end the year with."
Another tourist, Abubakari Salifu, said he had enjoyed his visit to the place and would continue to share fond memories with friends.
Writer's email: This email address is being protected from spambots. You need JavaScript enabled to view it.


While optimum wellness is a major goal for many individuals, sometimes a disease like cancer gets in the way of that goal. When that happens patients often look to both conventional and alternative therapies for relief. One of the alternative therapies is acupuncture, or needling.
Acupuncture is an ancient technique used by Chinese and oriental practitioners for thousands of years. The concept of this therapy has to do with energy flow in the body; needles placed in certain areas called acupoints affect the energy flow and correct imbalances. Modern medicine and research have not been able to determine exactly how it works, but scientists speculate the needle placement affects blood flow and/or the nervous system and brain. It may also have a local effect, causing the release of certain chemicals that relieve muscle tension or have other tissue effects.
Medical treatment varies according to the particular type of tumor or cells. For solid tumors surgery is usually the treatment of choice. However, chemotherapy and radiation may also be used for solid tumors and are commonly used for other types of cancers. Bone marrow transplant may be used for conditions like leukemia. In addition, many other treatments are used in managing the disease, such as medications for pain and nausea, blood transfusions and hormonal therapy. These treatments often have side effects and can cause significant additional stress.
~ Pain Management – Needling is effective for pain control in some patients and may be used in addition to anesthesia during surgery. Treatment can help reduce the use of narcotic pain medications. This can also decrease or alleviate side effects like constipation, nausea and mental confusion or behavioral changes.
~ Swelling – Needling can help decrease localized swelling after surgery and decrease the formation of hematomas (bruises) or help them resolve more quickly.
~ Nausea and Vomiting – Needling has been found to be effective in controlling the vomiting which so often accompanies chemotherapy, although it seems to be less effective against nausea alone. This can allow doctors to reduce the use or decrease the dose of expensive medications (which often have significant side effects) to control nausea and vomiting, which is common in chemotherapy.
~ Overall Wellness – Energetic acupuncture, which combines needling, electric stimulation and the use of moxibustion, can help create a feeling of well-being. Moxibustion is the use of herbs which are burned on or near the skin (the burning does not injure the skin). Nutritional support and moxibustion are often used routinely with needling in some institutions. In addition to needling and related techniques, nutritional support is critical to promoting overall health.
~ Osteopuncture – Another form of treatment is called osteopuncture, in which the needles are inserted through the skin into areas of the bone that lie close under the skin. Osteopuncture may also be combined with electrical nerve stimulation. Since the growing tumors are thought to deplete the body's energy reserves, treatment can promote feelings of overall wellness and reduce stress by correcting energy imbalances.
~ Other Treatments – Although the control of nausea and vomiting has been shown to be most effective, patients often also use needling and related therapies for hot flashes, anxiety, depression, sleep problems and fatigue. Research in animals indicates needling may also promote immune system function.
Eugene Mak, MD, a board certified oncologist writing for the American Academy of Medical Acupuncture, notes that cancer is a collective term for a very diverse group of conditions, all of which require different treatments or combinations of treatments. In addition, the stage of the tumor(s), the patient's response to treatment and the areas involved can all affect the success of any given treatment. However, says, Dr. Mak, in many cases needling can be helpful in treating patients with many of these conditions. The National Cancer Institute notes that it should only be administered by a qualified practitioner and the needles should always be sterile.


text:
The 2012 Tokyo gubernatorial election took place on December 16, 2012, which was held on the same day as the general election.

Background
After long-term Governor Shintaro Ishihara suddenly resigned to return to national politics ahead of the then-looming next general election. A field of nine candidates emerged, with the front-runner being Naoki Inose, who had been vice-governor under Ishihara from 2007 to 2012, and then acting governor after Ishihara's abrupt resignation. Inose vowed to follow Ishihara's policies.

Candidates
 Mac Akasaka (real name: Makoto Tonami) - Therapist, activist, perennial candidate. Founder and leader of the Smile Party.
 Masaichi Igarashi - Member of the board of directors of an international exchange body.
 Naoki Inose -  Journalist, historian, social critic. Then vice-governor of Tokyo and acting governor.
 Shigefumi Matsuzawa - Former governor of Kanagawa Prefecture.
 Yoshiro Nakamatsu (Dr. NakaMats)- Inventor, perennial candidate.
 Takashi Sasagawa - Former LDP General Council Chairman.
 Tokuma Suginomori (TOKMA) - Rock musician. Director of the Happiness Realization Party's youth division.
 Kenji Utsunomiya - Lawyer. Former head of the Japan Federation of Bar Associations from 2010 to 2012.
 Shigenobu Yoshida - Former Japanese ambassador to Nepal.

Campaign
Information campaign for the polls was administered by the Tokyo Metropolitan Election Administration Commission. AKB48's Minami Takahashi, Tomomi Itano and Yui Yokoyama (also of NMB48) were appointed as image characters.

Result
The result was a landslide victory for Inose, who received 4,338,936 votes, setting a new record for the total number of votes in a Tokyo gubernatorial election. The previous record was 3.61 million cast for the socialist Governor Ryokichi Minobe in 1971.

References

2012
December 2012 events in Japan
2012 in Tokyo
2012 elections in Japan


Are you applying to a top Executive MBA program? Are you seeking expert advice and professional tips on how to roll your extensive employment experience, management skills, and other impressive qualifications into a winning EMBA application? Do you have questions about who the ideal EMBA applicant is and the steps you can take to embody that candidate?
The resources listed below will help you navigate the EMBA application process and steer yourself to acceptance at the EMBA program of your choice.
Are you seeking more in-depth, individualized advice for your Executive MBA application? Work one-on-one with an experienced admissions consultant to create a successful EMBA application!


text:
D +44 (0)1481 732078
Location: Guernsey
Andrew Boyce
Andrew has significant experience in and is recognised both locally and internationally for investment and finance transactions across all entity types. Andrew has specialist experience in the structuring and establishment of open and closed-ended investment funds and the credit and structured finance products related to them. In particular he has built an enviable reputation in his core expertise of private equity fund formation having advised a range of global investment houses as well as new managers on fund establishment, investment structuring, asset acquisitions and disposals and regulatory issues. Andrew's banking and finance expertise compliments his investment funds core practice and covers a range of credit types including capital call facilities, leveraged financing and asset finance. He has acted for global banking institutions and alternative credit providers as well as institutional borrowers.
Andrew is instructed by leading UK, European and international law firms and financial institutions, and is recognised by global legal directories and publications.
As a qualified British Virgin Islands lawyer Andrew also advises on the above in relation to British Virgin Islands law from his base in Guernsey.
On admission as an Attorney at Law of the Supreme Court of Trinidad and Tobago in 1995, Andrew took tenancy in chambers before moving to a well-established local firm of attorneys. In 1997, he moved to the British Virgin Islands (BVI) to join Farrara George-Creque & Kerins and was admitted as a Barrister and Solicitor of the Eastern Caribbean Supreme Court. He then spent two years with KPMG in the BVI as in-house counsel for the firm's trust companies. Andrew joined Carey Olsen in 2000 and was admitted as a Solicitor of England and Wales in 2002. He was called to the Guernsey Bar in 2004 and made a partner in 2005.
Advises on
Banking and FinanceFund FinanceCorporateMergers and AcquisitionsInvestment FundsFund ListingsPrivate Equity FundsRegulatoryRestructuring and Insolvency
Carey Olsen among finalists for Association of Real Estate Funds Annual Awards
Who's Who Legal recognises nine Carey Olsen partners as experts in private funds
39 Carey Olsen lawyers recognised in latest IFLR1000 rankings
Carey Olsen among finalists at the 2020 Private Equity Service Provider Awards
Best Lawyers recognition for seven Carey Olsen partners
The Takeover Code and Guernsey Companies
Acquisition by a Company of its own Shares
"One of the finest minds in the Guernsey legal sector."
"He is very approachable" says one interviewee. "...Andrew will give you a quick and clear route through a particular issue."
IFLR1000
Andrew Boyce is "highly commercial and client-focused."
Chambers UK
Clients profess "100% confidence" in Andrew Boyce, for his "clear, concise advisory work."
Chambers Global
"He is a reassuring presence on any transaction."


All Alex wants for Christmas is for his parents to stop fighting. He asks them for a robot hoping that it will bring his family together instead it tears them apart, literally.
This isn't your typical killer robot story. It gets you to sympathize with the machine but not by humanizing it, rather by dehumanizing the human.