Hello community, here is the log from the commit of package khtml for openSUSE:Factory checked in at 2016-07-15 12:34:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/khtml (Old) and /work/SRC/openSUSE:Factory/.khtml.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "khtml" Changes: -------- --- /work/SRC/openSUSE:Factory/khtml/khtml.changes 2016-07-03 12:22:25.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.khtml.new/khtml.changes 2016-07-15 12:35:01.000000000 +0200 @@ -1,0 +2,18 @@ +Wed Jul 6 15:03:57 UTC 2016 - [email protected] + +- Update to 5.24.0 + * Fix applying inherit value for outline shorthand property + * Handle initial and inherit for border radius + * Discard property if we caught an invalid length|percent + as background-size + * cssText must output comma separated values for those properties + * Fix parsing background-clip in shorthand + * Implement background-size parsing in shorthand + * Mark properties as set when repeating patterns + * Fix background properties inheritance + * Fix applying Initial and Inherit for background-size property + * Deploy the khtml kxmlgui file in a Qt resource file + * For more details please see: + https://www.kde.org/announcements/kde-frameworks-5.24.0.php + +------------------------------------------------------------------- Old: ---- khtml-5.23.0.tar.xz New: ---- khtml-5.24.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ khtml.spec ++++++ --- /var/tmp/diff_new_pack.Aqr41F/_old 2016-07-15 12:35:01.000000000 +0200 +++ /var/tmp/diff_new_pack.Aqr41F/_new 2016-07-15 12:35:01.000000000 +0200 @@ -18,9 +18,9 @@ %bcond_without lang %define lname libKF5KHtml5 -%define _tar_path 5.23 +%define _tar_path 5.24 Name: khtml -Version: 5.23.0 +Version: 5.24.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 @@ -136,7 +136,6 @@ %{_kf5_servicesdir}/ %{_kf5_datadir}/kjava/ %{_kf5_datadir}/khtml/ -%{_kf5_sharedir}/kxmlgui5/ %config %{_kf5_configdir}/khtmlrc %files devel ++++++ khtml-5.23.0.tar.xz -> khtml-5.24.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/CMakeLists.txt new/khtml-5.24.0/CMakeLists.txt --- old/khtml-5.23.0/CMakeLists.txt 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/CMakeLists.txt 2016-07-03 11:13:03.000000000 +0200 @@ -3,7 +3,7 @@ project(KHtml) include(FeatureSummary) -find_package(ECM 5.23.0 NO_MODULE) +find_package(ECM 5.24.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) @@ -20,8 +20,8 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) -set(KF5_VERSION "5.23.0") # handled by release scripts -set(KF5_DEP_VERSION "5.23.0") # handled by release scripts +set(KF5_VERSION "5.24.0") # handled by release scripts +set(KF5_DEP_VERSION "5.24.0") # handled by release scripts find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED) find_package(KF5Codecs ${KF5_DEP_VERSION} REQUIRED) find_package(KF5GlobalAccel ${KF5_DEP_VERSION} REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/metainfo.yaml new/khtml-5.24.0/metainfo.yaml --- old/khtml-5.23.0/metainfo.yaml 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/metainfo.yaml 2016-07-03 11:13:03.000000000 +0200 @@ -3,7 +3,9 @@ tier: 3 type: solution platforms: - - name: All + - name: Linux + - name: Windows + - name: MacOSX portingAid: true deprecated: true release: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/po/it/khtml5.po new/khtml-5.24.0/po/it/khtml5.po --- old/khtml-5.23.0/po/it/khtml5.po 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/po/it/khtml5.po 2016-07-03 11:13:03.000000000 +0200 @@ -23,7 +23,7 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 2.0\n" msgctxt "NAME OF TRANSLATORS" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/po/zh_TW/khtml5.po new/khtml-5.24.0/po/zh_TW/khtml5.po --- old/khtml-5.23.0/po/zh_TW/khtml5.po 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/po/zh_TW/khtml5.po 2016-07-03 11:13:03.000000000 +0200 @@ -11,28 +11,29 @@ # Frank Weng (a.k.a. Franklin) <franklin at goodhorse dot idv dot tw>, 2006-2009, 2010. # Franklin Weng <[email protected]>, 2010, 2011, 2012. # Franklin Weng <[email protected]>, 2010, 2011, 2012, 2013, 2014. +# Jeff Huang <[email protected]>, 2016. msgid "" msgstr "" "Project-Id-Version: kdelibs4\n" "Report-Msgid-Bugs-To: http://bugs.kde.org\n" "POT-Creation-Date: 2016-03-06 07:13+0000\n" -"PO-Revision-Date: 2014-09-06 21:11+0800\n" -"Last-Translator: Franklin\n" -"Language-Team: Chinese Traditional <[email protected]>\n" +"PO-Revision-Date: 2016-06-28 17:24+0800\n" +"Last-Translator: Jeff Huang <[email protected]>\n" +"Language-Team: Chinese <[email protected]>\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 1.5\n" +"X-Generator: Lokalize 2.0\n" "Plural-Forms: nplurals=1; plural=0;\n" msgctxt "NAME OF TRANSLATORS" msgid "Your names" -msgstr "Franklin Weng" +msgstr "Franklin Weng, Jeff Huang" msgctxt "EMAIL OF TRANSLATORS" msgid "Your emails" -msgstr "[email protected]" +msgstr "[email protected], [email protected]" #: ecma/debugger/callstackdock.cpp:35 msgid "Call Stack" @@ -1326,7 +1327,7 @@ #: kmultipart/httpfiltergzip.cpp:89 msgid "Receiving corrupt data." -msgstr "" +msgstr "正在接收毀損的資料。" #: kmultipart/kmultipart.cpp:39 msgid "KMultiPart" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/CMakeLists.txt new/khtml-5.24.0/src/CMakeLists.txt --- old/khtml-5.23.0/src/CMakeLists.txt 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/CMakeLists.txt 2016-07-03 11:13:03.000000000 +0200 @@ -542,6 +542,8 @@ html/keygenwizard2.ui ) +qt5_add_resources( khtml_LIB_SRCS khtml.qrc ) + add_library(KF5KHtml ${khtml_LIB_SRCS}) add_library(KF5::KHtml ALIAS KF5KHtml) @@ -788,8 +790,6 @@ install(FILES khtml.desktop khtmlimage.desktop khtmladaptorpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) -install(FILES khtml.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/khtml) -install(FILES khtml_browser.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/khtml) # install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KHtmlPart.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/css/css_renderstyledeclarationimpl.cpp new/khtml-5.24.0/src/css/css_renderstyledeclarationimpl.cpp --- old/khtml-5.23.0/src/css/css_renderstyledeclarationimpl.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/css/css_renderstyledeclarationimpl.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -491,34 +491,34 @@ RETURN_NULL_ON_NULL(renderer); return valueForLength(style->backgroundYPosition(), renderer->contentHeight()); case CSS_PROP_BACKGROUND_SIZE: { - const EBackgroundSizeType backgroundSizeType = style->backgroundLayers()->backgroundSizeType(); + const EBackgroundSizeType backgroundSizeType = style->backgroundLayers()->backgroundSize().type; switch (backgroundSizeType) { case BGSCONTAIN: return new CSSPrimitiveValueImpl(CSS_VAL_CONTAIN); case BGSCOVER: return new CSSPrimitiveValueImpl(CSS_VAL_COVER); case BGSLENGTH: { - const LengthSize bgLengthSize = style->backgroundLayers()->backgroundSize(); + const BGSize bgSize = style->backgroundLayers()->backgroundSize(); CSSValueListImpl *values = new CSSValueListImpl(CSSValueListImpl::Space); - switch (bgLengthSize.width.type()) { + switch (bgSize.width.type()) { case Auto: values->append(new CSSPrimitiveValueImpl(CSS_VAL_AUTO)); break; case Percent: - values->append(new CSSPrimitiveValueImpl(bgLengthSize.width.percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); + values->append(new CSSPrimitiveValueImpl(bgSize.width.percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); break; default: - values->append(new CSSPrimitiveValueImpl(bgLengthSize.width.value(), CSSPrimitiveValue::CSS_PX)); + values->append(new CSSPrimitiveValueImpl(bgSize.width.value(), CSSPrimitiveValue::CSS_PX)); } - switch (bgLengthSize.height.type()) { + switch (bgSize.height.type()) { case Auto: values->append(new CSSPrimitiveValueImpl(CSS_VAL_AUTO)); break; case Percent: - values->append(new CSSPrimitiveValueImpl(bgLengthSize.height.percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); + values->append(new CSSPrimitiveValueImpl(bgSize.height.percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); break; default: - values->append(new CSSPrimitiveValueImpl(bgLengthSize.height.value(), CSSPrimitiveValue::CSS_PX)); + values->append(new CSSPrimitiveValueImpl(bgSize.height.value(), CSSPrimitiveValue::CSS_PX)); } return values; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/css/css_valueimpl.cpp new/khtml-5.24.0/src/css/css_valueimpl.cpp --- old/khtml-5.23.0/src/css/css_valueimpl.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/css/css_valueimpl.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -230,11 +230,12 @@ return getLayeredShortHandValue(properties, 2); } case CSS_PROP_BACKGROUND: { - const int properties[6] = { CSS_PROP_BACKGROUND_IMAGE, CSS_PROP_BACKGROUND_REPEAT, - CSS_PROP_BACKGROUND_ATTACHMENT, CSS_PROP_BACKGROUND_POSITION_X, - CSS_PROP_BACKGROUND_POSITION_Y, CSS_PROP_BACKGROUND_COLOR + // 'clip' must come after 'origin' in this array + const int properties[9] = { CSS_PROP_BACKGROUND_IMAGE, CSS_PROP_BACKGROUND_REPEAT, CSS_PROP_BACKGROUND_ATTACHMENT, + CSS_PROP_BACKGROUND_POSITION_X, CSS_PROP_BACKGROUND_POSITION_Y, CSS_PROP_BACKGROUND_SIZE, + CSS_PROP_BACKGROUND_ORIGIN, CSS_PROP_BACKGROUND_CLIP, CSS_PROP_BACKGROUND_COLOR }; - return getLayeredShortHandValue(properties, 6); + return getLayeredShortHandValue(properties, 9); } case CSS_PROP_BORDER: { const int properties[3][4] = {{ @@ -381,6 +382,31 @@ return res; } +static inline DOMString posXYSize_string_helper(DOMString &bPosX, DOMString &bPosY, DOMString &bSize) +{ + DOMString res, position; + + if (!bPosX.isEmpty() && !bPosY.isEmpty()) { + position = bPosX + DOMString(" ") + bPosY; + } else if (bPosX.isEmpty() && !bPosY.isEmpty()) { + position = DOMString("0% ") + bPosY; + } else if (!bPosX.isEmpty() && bPosY.isEmpty()) { + position = bPosX + DOMString(" 0%"); + } + + if (!bSize.isEmpty()) { + if (position.isEmpty()) { + res = DOMString("0% 0%") + DOMString(" / ") + bSize; + } else { + res = position + DOMString(" / ") + bSize; + } + } else { + res = position; + } + + return res; +} + DOMString CSSStyleDeclarationImpl::getLayeredShortHandValue(const int *properties, unsigned number) const { DOMString res; @@ -403,10 +429,11 @@ } } - // Now stitch the properties together. Implicit initial values are flagged as such and - // can safely be omitted. + // Now stitch the properties together. + // Implicit initial values are flagged as such and can safely be omitted. for (i = 0; i < numLayers; i++) { DOMString layerRes; + DOMString bPosX, bPosY, bSize; for (j = 0; j < number; j++) { CSSValueImpl *value = 0; if (values[j]) { @@ -427,13 +454,32 @@ } if (value && !value->isImplicitInitialValue()) { - if (!layerRes.isNull()) { - layerRes += " "; + // positionX,positionY,size should be handled separately in order + // to return a consistent and valid 'background' property string + if (properties[j] == CSS_PROP_BACKGROUND_POSITION_X) { + bPosX = value->cssText(); + } else if (properties[j] == CSS_PROP_BACKGROUND_POSITION_Y) { + bPosY = value->cssText(); + } else if (properties[j] == CSS_PROP_BACKGROUND_SIZE) { + bSize = value->cssText(); + } else { + if (!layerRes.isNull()) { + layerRes += " "; + } + layerRes += value->cssText(); } - layerRes += value->cssText(); } } + // now add positionX,positionY,size + DOMString posXYSize = posXYSize_string_helper(bPosX, bPosY, bSize); + if (!posXYSize.isEmpty()) { + if (!layerRes.isNull()) { + layerRes += " "; + } + layerRes += posXYSize; + } + if (!layerRes.isNull()) { if (!res.isNull()) { res += ", "; @@ -631,7 +677,11 @@ CSS_PROP_BACKGROUND_POSITION_Y, CSS_PROP_BACKGROUND_REPEAT, CSS_PROP__KHTML_BACKGROUND_SIZE, - CSS_PROP_BACKGROUND_SIZE + CSS_PROP_BACKGROUND_SIZE, + CSS_PROP__KHTML_BACKGROUND_ORIGIN, + CSS_PROP_BACKGROUND_ORIGIN, + CSS_PROP__KHTML_BACKGROUND_CLIP, + CSS_PROP_BACKGROUND_CLIP }; SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSS_PROP_BACKGROUND, backgroundProperties); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/css/cssparser.cpp new/khtml-5.24.0/src/css/cssparser.cpp --- old/khtml-5.23.0/src/css/cssparser.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/css/cssparser.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -1334,7 +1334,7 @@ static_cast<CSSValueListImpl *>(lval)->append(rval); } else { CSSValueImpl *oldVal = lval; - CSSValueListImpl *list = new CSSValueListImpl(); + CSSValueListImpl *list = new CSSValueListImpl(CSSValueListImpl::Comma); lval = list; list->append(oldVal); list->append(rval); @@ -1346,13 +1346,16 @@ bool CSSParser::parseBackgroundShorthand(bool important) { - // Position must come before color in this array because a plain old "0" is a legal color - // in quirks mode but it's usually the X coordinate of a position. - // FIXME: Add CSS_PROP_BACKGROUND_SIZE to the shorthand. - const int numProperties = 7; + // Order is important in this array: + // 'position' must come before color because a plain old "0" is a legal color in quirks mode + // but it's usually the X coordinate of a position. + // 'size' must be the next property after 'position' in order to correctly parse '/size'. + // 'origin' must come before 'clip' because the first <box> value found belongs to 'origin', + // the second (if any) to 'clip'. + const int numProperties = 8; const int properties[numProperties] = { CSS_PROP_BACKGROUND_IMAGE, CSS_PROP_BACKGROUND_REPEAT, - CSS_PROP_BACKGROUND_ATTACHMENT, CSS_PROP_BACKGROUND_POSITION, CSS_PROP_BACKGROUND_CLIP, - CSS_PROP_BACKGROUND_ORIGIN, CSS_PROP_BACKGROUND_COLOR + CSS_PROP_BACKGROUND_ATTACHMENT, CSS_PROP_BACKGROUND_POSITION, CSS_PROP_BACKGROUND_SIZE, + CSS_PROP_BACKGROUND_ORIGIN, CSS_PROP_BACKGROUND_CLIP, CSS_PROP_BACKGROUND_COLOR }; ShorthandScope scope(this, CSS_PROP_BACKGROUND); @@ -1360,6 +1363,7 @@ bool parsedProperty[numProperties] = { false }; // compiler will repeat false as necessary CSSValueImpl *values[numProperties] = { 0 }; // compiler will repeat 0 as necessary CSSValueImpl *positionYValue = 0; + int parsedOriginIdent = 0; int i; while (valueList->current()) { @@ -1376,13 +1380,18 @@ } if (!parsedProperty[i] && properties[i] != CSS_PROP_BACKGROUND_COLOR) { - addBackgroundValue(values[i], new CSSInitialValueImpl(true/*implicit initial*/)); - if (properties[i] == CSS_PROP_BACKGROUND_POSITION) { - addBackgroundValue(positionYValue, new CSSInitialValueImpl(true/*implicit initial*/)); + if (properties[i] == CSS_PROP_BACKGROUND_CLIP && parsedOriginIdent != 0) { + addBackgroundValue(values[i], new CSSPrimitiveValueImpl(parsedOriginIdent)); + } else { + addBackgroundValue(values[i], new CSSInitialValueImpl(true/*implicit initial*/)); + if (properties[i] == CSS_PROP_BACKGROUND_POSITION) { + addBackgroundValue(positionYValue, new CSSInitialValueImpl(true/*implicit initial*/)); + } } } parsedProperty[i] = false; } + parsedOriginIdent = 0; if (!valueList->current()) { break; } @@ -1398,6 +1407,25 @@ addBackgroundValue(values[i], val1); if (properties[i] == CSS_PROP_BACKGROUND_POSITION) { addBackgroundValue(positionYValue, val2); + // after 'position' there could be '/size', check for it + const Value *v = valueList->current(); + if (v && v->unit == Value::Operator && v->iValue == '/') { + // next property _must_ be 'size' + valueList->next(); + ++i; // 'size' is at the next position in properties[] array + CSSValueImpl *retVal1 = 0, *retVal2 = 0; + if (parseBackgroundProperty(properties[i], propId1, propId2, retVal1, retVal2)) { + parsedProperty[i] = true; + addBackgroundValue(values[i], retVal1); + } else { + goto fail; + } + } + } else if (properties[i] == CSS_PROP_BACKGROUND_ORIGIN) { + parsedOriginIdent = static_cast<CSSPrimitiveValueImpl *>(val1)->getIdent(); + } else if (properties[i] == CSS_PROP_BACKGROUND_SIZE) { + // we caught an invalid length|percent as background-size + goto fail; } } } @@ -1408,14 +1436,19 @@ if (!found) { goto fail; } - } + + } // end of while loop // Fill in any remaining properties with the initial value. for (i = 0; i < numProperties; ++i) { if (!parsedProperty[i]) { - addBackgroundValue(values[i], new CSSInitialValueImpl(true/*implicit initial*/)); - if (properties[i] == CSS_PROP_BACKGROUND_POSITION) { - addBackgroundValue(positionYValue, new CSSInitialValueImpl(true/*implicit initial*/)); + if (properties[i] == CSS_PROP_BACKGROUND_CLIP && parsedOriginIdent != 0) { + addBackgroundValue(values[i], new CSSPrimitiveValueImpl(parsedOriginIdent)); + } else { + addBackgroundValue(values[i], new CSSInitialValueImpl(true/*implicit initial*/)); + if (properties[i] == CSS_PROP_BACKGROUND_POSITION) { + addBackgroundValue(positionYValue, new CSSInitialValueImpl(true/*implicit initial*/)); + } } } } @@ -1957,33 +1990,47 @@ CSSValueImpl *CSSParser::parseBackgroundSize() { Value *value = valueList->current(); + + // Parse the first value. CSSPrimitiveValueImpl *parsedValue1; if (value->id == CSS_VAL_COVER || value->id == CSS_VAL_CONTAIN) { + valueList->next(); return new CSSPrimitiveValueImpl(value->id); } if (value->id == CSS_VAL_AUTO) { parsedValue1 = new CSSPrimitiveValueImpl(CSS_VAL_AUTO); - } else { - if (!validUnit(value, FLength | FPercent | FNonNeg, strict)) { - return 0; - } + } else if (validUnit(value, FLength | FPercent | FNonNeg, strict)) { parsedValue1 = new CSSPrimitiveValueImpl(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); + } else { + return 0; + } + + // Parse the second value, if any. + value = valueList->next(); + + // First check for the comma. If so, we are finished parsing this value or value pair. + if (value && value->unit == Value::Operator && value->iValue == ',') { + value = 0; } - CSSPrimitiveValueImpl *parsedValue2; - if ((value = valueList->next())) { + CSSPrimitiveValueImpl *parsedValue2 = 0; + if (value) { if (value->id == CSS_VAL_AUTO) { parsedValue2 = new CSSPrimitiveValueImpl(CSS_VAL_AUTO); - } else { - if (!validUnit(value, FLength | FPercent | FNonNeg, strict)) { - delete parsedValue1; - return 0; - } + } else if (validUnit(value, FLength | FPercent | FNonNeg, strict)) { parsedValue2 = new CSSPrimitiveValueImpl(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); + } else if (!inShorthand()) { + delete parsedValue1; + return 0; } + } + + if (parsedValue2) { + valueList->next(); } else { + // If only one value is given the second is assumed to be ‘auto’ parsedValue2 = new CSSPrimitiveValueImpl(CSS_VAL_AUTO); } @@ -1999,8 +2046,8 @@ qDebug() << "LOOKING FOR: " << getPropertyName(propId).string(); #endif Value *val; - CSSValueListImpl *value = new CSSValueListImpl; - CSSValueListImpl *value2 = new CSSValueListImpl; + CSSValueListImpl *value = new CSSValueListImpl(CSSValueListImpl::Comma); + CSSValueListImpl *value2 = new CSSValueListImpl(CSSValueListImpl::Comma); bool expectComma = false; retValue1 = retValue2 = 0; @@ -2057,7 +2104,7 @@ break; case CSS_PROP_BACKGROUND_POSITION: parseBackgroundPosition(currValue, currValue2); - // unlike the other functions, parseBackgroundPosition advances the valueList pointer + // parseBackgroundPosition advances the valueList pointer break; case CSS_PROP_BACKGROUND_POSITION_X: { BackgroundPosKind pos; @@ -2094,9 +2141,7 @@ case CSS_PROP__KHTML_BACKGROUND_SIZE: case CSS_PROP_BACKGROUND_SIZE: currValue = parseBackgroundSize(); - if (currValue) { - valueList->next(); - } + // parseBackgroundSize advances the valueList pointer break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/css/cssstyleselector.cpp new/khtml-5.24.0/src/css/cssstyleselector.cpp --- old/khtml-5.23.0/src/css/cssstyleselector.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/css/cssstyleselector.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -120,6 +120,7 @@ #define HANDLE_BACKGROUND_INHERIT_AND_INITIAL(prop, Prop) \ if (isInherit) { \ + style->setInheritedNoninherited(true); \ BackgroundLayer* currChild = style->accessBackgroundLayers(); \ BackgroundLayer* prevChild = 0; \ const BackgroundLayer* currParent = parentStyle->backgroundLayers(); \ @@ -2475,10 +2476,6 @@ static BorderRadii convertToBorderRadii(CSSPrimitiveValueImpl *value, RenderStyle *style, RenderStyle *rootStyle, int logicalDpiY) { BorderRadii ret; - if (!value) { - return ret; - } - PairImpl *p = value->getPairValue(); if (!p) { return ret; @@ -3191,23 +3188,57 @@ break; } - // ### should these handle initial & inherit? case CSS_PROP__KHTML_BORDER_TOP_RIGHT_RADIUS: case CSS_PROP_BORDER_TOP_RIGHT_RADIUS: - style->setBorderTopRightRadius(convertToBorderRadii(primitiveValue, style, m_rootStyle, logicalDpiY)); - break; case CSS_PROP__KHTML_BORDER_TOP_LEFT_RADIUS: case CSS_PROP_BORDER_TOP_LEFT_RADIUS: - style->setBorderTopLeftRadius(convertToBorderRadii(primitiveValue, style, m_rootStyle, logicalDpiY)); - break; case CSS_PROP__KHTML_BORDER_BOTTOM_RIGHT_RADIUS: case CSS_PROP_BORDER_BOTTOM_RIGHT_RADIUS: - style->setBorderBottomRightRadius(convertToBorderRadii(primitiveValue, style, m_rootStyle, logicalDpiY)); - break; case CSS_PROP__KHTML_BORDER_BOTTOM_LEFT_RADIUS: - case CSS_PROP_BORDER_BOTTOM_LEFT_RADIUS: - style->setBorderBottomLeftRadius(convertToBorderRadii(primitiveValue, style, m_rootStyle, logicalDpiY)); - break; + case CSS_PROP_BORDER_BOTTOM_LEFT_RADIUS: { + if (isInherit) { + style->setInheritedNoninherited(true); + HANDLE_INHERIT_COND(CSS_PROP_BORDER_TOP_RIGHT_RADIUS, borderTopRightRadius, BorderTopRightRadius) + HANDLE_INHERIT_COND(CSS_PROP_BORDER_TOP_LEFT_RADIUS, borderTopLeftRadius, BorderTopLeftRadius) + HANDLE_INHERIT_COND(CSS_PROP_BORDER_BOTTOM_RIGHT_RADIUS, borderBottomRightRadius, BorderBottomRightRadius) + HANDLE_INHERIT_COND(CSS_PROP_BORDER_BOTTOM_LEFT_RADIUS, borderBottomLeftRadius, BorderBottomLeftRadius) + return; + } else if (isInitial) { + HANDLE_INITIAL_COND_WITH_VALUE(CSS_PROP_BORDER_TOP_RIGHT_RADIUS, BorderTopRightRadius, BorderRadius) + HANDLE_INITIAL_COND_WITH_VALUE(CSS_PROP_BORDER_TOP_LEFT_RADIUS, BorderTopLeftRadius, BorderRadius) + HANDLE_INITIAL_COND_WITH_VALUE(CSS_PROP_BORDER_BOTTOM_RIGHT_RADIUS, BorderBottomRightRadius, BorderRadius) + HANDLE_INITIAL_COND_WITH_VALUE(CSS_PROP_BORDER_BOTTOM_LEFT_RADIUS, BorderBottomLeftRadius, BorderRadius) + return; + } + + if (!primitiveValue) { + return; + } + + BorderRadii bradii = convertToBorderRadii(primitiveValue, style, m_rootStyle, logicalDpiY); + switch(id) { + case CSS_PROP__KHTML_BORDER_TOP_RIGHT_RADIUS: + case CSS_PROP_BORDER_TOP_RIGHT_RADIUS: + style->setBorderTopRightRadius(bradii); + break; + case CSS_PROP__KHTML_BORDER_TOP_LEFT_RADIUS: + case CSS_PROP_BORDER_TOP_LEFT_RADIUS: + style->setBorderTopLeftRadius(bradii); + break; + case CSS_PROP__KHTML_BORDER_BOTTOM_RIGHT_RADIUS: + case CSS_PROP_BORDER_BOTTOM_RIGHT_RADIUS: + style->setBorderBottomRightRadius(bradii); + break; + case CSS_PROP__KHTML_BORDER_BOTTOM_LEFT_RADIUS: + case CSS_PROP_BORDER_BOTTOM_LEFT_RADIUS: + style->setBorderBottomLeftRadius(bradii); + break; + default: + break; + } + return; + } + break; case CSS_PROP_CURSOR: HANDLE_INITIAL_AND_INHERIT_ON_INHERITED_PROPERTY(cursor, Cursor) @@ -4180,6 +4211,7 @@ style->setBackgroundColor(QColor()); return; } else if (isInherit) { + style->setInheritedNoninherited(true); style->inheritBackgroundLayers(*parentStyle->backgroundLayers()); style->setBackgroundColor(parentStyle->backgroundColor()); } @@ -4231,6 +4263,21 @@ } } return; + case CSS_PROP__KHTML_BORDER_RADIUS: + case CSS_PROP_BORDER_RADIUS: + if (isInherit) { + style->setInheritedNoninherited(true); + style->setBorderTopLeftRadius(parentStyle->borderTopLeftRadius()); + style->setBorderTopRightRadius(parentStyle->borderTopRightRadius()); + style->setBorderBottomRightRadius(parentStyle->borderBottomRightRadius()); + style->setBorderBottomLeftRadius(parentStyle->borderBottomLeftRadius()); + } else if (isInitial) { + style->setBorderTopLeftRadius(RenderStyle::initialBorderRadius()); + style->setBorderTopRightRadius(RenderStyle::initialBorderRadius()); + style->setBorderBottomRightRadius(RenderStyle::initialBorderRadius()); + style->setBorderBottomLeftRadius(RenderStyle::initialBorderRadius()); + } + return; case CSS_PROP_BORDER_TOP: if (isInherit) { style->setInheritedNoninherited(true); @@ -4364,6 +4411,7 @@ break; case CSS_PROP_OUTLINE: if (isInherit) { + style->setInheritedNoninherited(true); style->setOutlineWidth(parentStyle->outlineWidth()); style->setOutlineColor(parentStyle->outlineColor()); style->setOutlineStyle(parentStyle->outlineStyle()); @@ -4720,10 +4768,8 @@ void CSSStyleSelector::mapBackgroundSize(BackgroundLayer *layer, CSSValueImpl *value) { - LengthSize b = RenderStyle::initialBackgroundSize(); - if (value->cssValueType() == CSSValue::CSS_INITIAL) { - layer->setBackgroundSize(b); + layer->setBackgroundSize(RenderStyle::initialBackgroundSize()); return; } @@ -4734,11 +4780,11 @@ CSSPrimitiveValueImpl *primitiveValue = static_cast<CSSPrimitiveValueImpl *>(value); const int id = primitiveValue->getIdent(); if (id == CSS_VAL_CONTAIN) { - layer->setBackgroundSizeType(BGSCONTAIN); + layer->setBackgroundSize(BGSize(BGSCONTAIN)); return; } if (id == CSS_VAL_COVER) { - layer->setBackgroundSizeType(BGSCOVER); + layer->setBackgroundSize(BGSize(BGSCOVER)); return; } @@ -4782,9 +4828,7 @@ } } - b.width = firstLength; - b.height = secondLength; - layer->setBackgroundSize(b); + layer->setBackgroundSize(BGSize(firstLength, secondLength)); } void CSSStyleSelector::mapBackgroundXPosition(BackgroundLayer *layer, DOM::CSSValueImpl *value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/html/dtd.cpp new/khtml-5.24.0/src/html/dtd.cpp --- old/khtml-5.23.0/src/html/dtd.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/html/dtd.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -154,7 +154,7 @@ 0, // ID_WBR 5, // ID_XMP 0, // ID_TEXT - 0, // ID_COMMENT + 0 // ID_COMMENT }; const tagStatus DOM::endTagArray[] = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/khtml.qrc new/khtml-5.24.0/src/khtml.qrc --- old/khtml-5.23.0/src/khtml.qrc 1970-01-01 01:00:00.000000000 +0100 +++ new/khtml-5.24.0/src/khtml.qrc 2016-07-03 11:13:03.000000000 +0200 @@ -0,0 +1,7 @@ +<!DOCTYPE RCC> +<RCC version="1.0"> + <qresource prefix="/kxmlgui5/khtml"> + <file>khtml.rc</file> + <file>khtml_browser.rc</file> + </qresource> +</RCC> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/rendering/render_box.cpp new/khtml-5.24.0/src/rendering/render_box.cpp --- old/khtml-5.23.0/src/rendering/render_box.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/rendering/render_box.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -494,7 +494,7 @@ CachedImage *bg = bgLayer->backgroundImage(); if (bgLayer->isBackgroundSizeSet()) { - if (bgLayer->backgroundSizeType() == BGSLENGTH) { + if (bgLayer->backgroundSize().type == BGSLENGTH) { int w = scaledWidth; int h = scaledHeight; @@ -529,13 +529,13 @@ scaledHeight = qMax(1, h); } else { // 'cover' and 'contain' scaling ratio - assert(bgLayer->backgroundSizeType() == BGSCONTAIN || - bgLayer->backgroundSizeType() == BGSCOVER); + Q_ASSERT(bgLayer->backgroundSize().type == BGSCONTAIN || + bgLayer->backgroundSize().type == BGSCOVER); float iw = bg->pixmap_size().width(); float ih = bg->pixmap_size().height(); float w = scaledWidth / iw; float h = scaledHeight / ih; - float r = (bgLayer->backgroundSizeType() == BGSCONTAIN) ? qMin(w, h) : qMax(w, h); + float r = (bgLayer->backgroundSize().type == BGSCONTAIN) ? qMin(w, h) : qMax(w, h); scaledWidth = qMax(1, static_cast<int>(iw * r)); scaledHeight = qMax(1, static_cast<int>(ih * r)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/rendering/render_style.cpp new/khtml-5.24.0/src/rendering/render_style.cpp --- old/khtml-5.23.0/src/rendering/render_style.cpp 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/rendering/render_style.cpp 2016-07-03 11:13:03.000000000 +0200 @@ -112,7 +112,6 @@ m_bgClip(RenderStyle::initialBackgroundClip()), m_bgOrigin(RenderStyle::initialBackgroundOrigin()), m_bgRepeat(RenderStyle::initialBackgroundRepeat()), - m_bgSizeType(RenderStyle::initialBackgroundSizeType()), m_backgroundSize(RenderStyle::initialBackgroundSize()), m_next(0) { @@ -131,7 +130,6 @@ m_bgOrigin = o.m_bgOrigin; m_bgRepeat = o.m_bgRepeat; m_backgroundSize = o.m_backgroundSize; - m_bgSizeType = o.m_bgSizeType; m_imageSet = o.m_imageSet; m_attachmentSet = o.m_attachmentSet; m_clipSet = o.m_clipSet; @@ -162,7 +160,6 @@ m_bgOrigin = o.m_bgOrigin; m_bgRepeat = o.m_bgRepeat; m_backgroundSize = o.m_backgroundSize; - m_bgSizeType = o.m_bgSizeType; m_imageSet = o.m_imageSet; m_attachmentSet = o.m_attachmentSet; @@ -178,8 +175,8 @@ bool BackgroundLayer::operator==(const BackgroundLayer &o) const { return m_image == o.m_image && m_xPosition == o.m_xPosition && m_yPosition == o.m_yPosition && - m_bgAttachment == o.m_bgAttachment && m_bgClip == o.m_bgClip && m_bgOrigin == o.m_bgOrigin && m_bgRepeat == o.m_bgRepeat && - m_backgroundSize.width == o.m_backgroundSize.width && m_bgSizeType == o.m_bgSizeType && m_backgroundSize.height == o.m_backgroundSize.height && + m_bgAttachment == o.m_bgAttachment && m_bgClip == o.m_bgClip && m_bgOrigin == o.m_bgOrigin && + m_bgRepeat == o.m_bgRepeat && m_backgroundSize == o.m_backgroundSize && m_imageSet == o.m_imageSet && m_attachmentSet == o.m_attachmentSet && m_repeatSet == o.m_repeatSet && m_xPosSet == o.m_xPosSet && m_yPosSet == o.m_yPosSet && m_backgroundSizeSet == o.m_backgroundSizeSet && ((m_next && o.m_next) ? *m_next == *o.m_next : m_next == o.m_next); @@ -193,7 +190,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_xPosition = pattern->m_xPosition; + curr->setBackgroundXPosition(pattern->backgroundXPosition()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -205,7 +202,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_yPosition = pattern->m_yPosition; + curr->setBackgroundYPosition(pattern->backgroundYPosition()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -217,7 +214,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_bgAttachment = pattern->m_bgAttachment; + curr->setBackgroundAttachment(pattern->backgroundAttachment()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -229,7 +226,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_bgClip = pattern->m_bgClip; + curr->setBackgroundClip(pattern->backgroundClip()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -241,7 +238,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_bgOrigin = pattern->m_bgOrigin; + curr->setBackgroundOrigin(pattern->backgroundOrigin()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -253,7 +250,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_bgRepeat = pattern->m_bgRepeat; + curr->setBackgroundRepeat(pattern->backgroundRepeat()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; @@ -265,7 +262,7 @@ if (curr && curr != this) { // We need to fill in the remaining values with the pattern specified. for (BackgroundLayer *pattern = this; curr; curr = curr->next()) { - curr->m_backgroundSize = pattern->m_backgroundSize; + curr->setBackgroundSize(pattern->backgroundSize()); pattern = pattern->next(); if (pattern == curr || !pattern) { pattern = this; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/khtml-5.23.0/src/rendering/render_style.h new/khtml-5.24.0/src/rendering/render_style.h --- old/khtml-5.23.0/src/rendering/render_style.h 2016-06-06 13:35:08.000000000 +0200 +++ new/khtml-5.24.0/src/rendering/render_style.h 2016-07-03 11:13:03.000000000 +0200 @@ -414,7 +414,22 @@ BGASCROLL, BGAFIXED, BGALOCAL }; -struct LengthSize { +struct BGSize { + BGSize() : type(BGSLENGTH), width(Length()), height(Length()) {} + // Use to set BGSCONTAIN|BGSCOVER + BGSize(EBackgroundSizeType t) : type(t), width(Length()), height(Length()) + { + Q_ASSERT(t != BGSLENGTH); + } + // Use to set lenghts + BGSize(Length w, Length h) : type(BGSLENGTH), width(w), height(h) {} + + bool operator==(const BGSize &o) const + { + return type == o.type && width == o.width && height == o.height; + } + + EBackgroundSizeType type : 2; Length width; Length height; }; @@ -452,14 +467,10 @@ { return KDE_CAST_BF_ENUM(EBackgroundRepeat, m_bgRepeat); } - LengthSize backgroundSize() const + BGSize backgroundSize() const { return m_backgroundSize; } - EBackgroundSizeType backgroundSizeType() const - { - return KDE_CAST_BF_ENUM(EBackgroundSizeType, m_bgSizeType); - } BackgroundLayer *next() const { @@ -538,16 +549,11 @@ m_bgRepeat = r; m_repeatSet = true; } - void setBackgroundSize(const LengthSize &b) + void setBackgroundSize(const BGSize &b) { m_backgroundSize = b; m_backgroundSizeSet = true; } - void setBackgroundSizeType(EBackgroundSizeType t) - { - m_bgSizeType = t; - m_backgroundSizeSet = true; - } void clearBackgroundImage() { @@ -635,9 +641,8 @@ KDE_BF_ENUM(EBackgroundBox) m_bgClip : 2; KDE_BF_ENUM(EBackgroundBox) m_bgOrigin : 2; KDE_BF_ENUM(EBackgroundRepeat) m_bgRepeat : 2; - KDE_BF_ENUM(EBackgroundSizeType) m_bgSizeType : 2; - LengthSize m_backgroundSize; + BGSize m_backgroundSize; bool m_imageSet : 1; bool m_attachmentSet : 1; @@ -2387,13 +2392,9 @@ { return REPEAT; } - static LengthSize initialBackgroundSize() + static BGSize initialBackgroundSize() { - return LengthSize(); - } - static EBackgroundSizeType initialBackgroundSizeType() - { - return BGSLENGTH; + return BGSize(); } static bool initialBorderCollapse() { @@ -2523,6 +2524,10 @@ { return 3; } + static BorderRadii initialBorderRadius() + { + return BorderRadii(); + } static int initialLetterWordSpacing() { return 0;
