+2006-04-12 Darin Adler <darin@apple.com>
+
+ Rubber-stamped by Anders.
+
+ - fix Windows build
+
+ * WebCore.vcproj/Image\ Viewer/Image\ Viewer.vcproj: Add loader directory.
+
+ - use std::min/max exclusively intead of kMin/Max
+ - eliminate KWQDef.h since all it had left in it was kMin/Max
+
+ * WebCore.vcproj/WebCore/WebCore.vcproj: Remove KWQDef.h.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+ * kwq/KWQDef.h: Removed.
+
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::attributedString):
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+ * css/cssstyleselector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
+ (WebCore::CSSStyleSelector::fontSizeForKeyword):
+ * dom/Document.cpp:
+ (WebCore::Document::minimumLayoutDelay):
+ (WebCore::Document::addMarker):
+ * dom/StyledElement.cpp:
+ (WebCore::StyledElement::addCSSColor):
+ * dom/xml_tokenizer.cpp:
+ (WebCore::OffsetBuffer::readOutBytes):
+ * editing/ApplyStyleCommand.cpp:
+ (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::deleteInsignificantText):
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::handleTextNode):
+ (WebCore::TextIterator::handleTextBox):
+ (WebCore::CharacterIterator::string):
+ (WebCore::findPlainText):
+ * editing/htmlediting.cpp:
+ (WebCore::rangeCompliantEquivalent):
+ * editing/markup.cpp:
+ (WebCore::renderedText):
+ * editing/visible_units.cpp:
+ (WebCore::startOfParagraph):
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::parseMappedAttribute):
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::parseComment):
+ (WebCore::HTMLTokenizer::parseEntity):
+ (WebCore::HTMLTokenizer::parseTag):
+ (WebCore::HTMLTokenizer::enlargeBuffer):
+ (WebCore::HTMLTokenizer::enlargeScriptBuffer):
+ * html/html_imageimpl.cpp:
+ (WebCore::HTMLAreaElement::getRegion):
+ * html/html_tableimpl.cpp:
+ (WebCore::HTMLTableElement::parseMappedAttribute):
+ * ksvg2/css/SVGCSSParser.cpp:
+ (WebCore::CSSParser::parseSVGPaint):
+ (WebCore::CSSParser::parseSVGColor):
+ * kwq/KWQComboBox.mm:
+ (QComboBox::sizeHint):
+ * kwq/KWQListBox.mm:
+ (QListBox::sizeForNumberOfLines):
+ * kwq/KWQSlider.mm:
+ (QSlider::setValue):
+ * loader/Cache.cpp:
+ (WebCore::Cache::setSize):
+ * page/Frame.cpp:
+ (WebCore::Frame::forceLayoutWithPageWidthRange):
+ * platform/DeprecatedPtrListImpl.h:
+ * platform/DeprecatedString.cpp:
+ (ucstrcmp):
+ * platform/DeprecatedString.h:
+ * platform/DeprecatedValueListImpl.h:
+ * platform/mac/GraphicsContextMac.mm:
+ (WebCore::GraphicsContext::addRoundedRectClip):
+ * platform/mac/WebCoreTextArea.mm:
+ (-[WebCoreTextView _trackResizeFromMouseDown:]):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::isSelected):
+ (WebCore::InlineTextBox::selectionRect):
+ (WebCore::InlineTextBox::placeEllipsisBox):
+ (WebCore::InlineTextBox::selectionStartEnd):
+ (WebCore::InlineTextBox::paintMarkedTextBackground):
+ (WebCore::InlineTextBox::paintSpellingMarker):
+ (WebCore::InlineTextBox::paintTextMatchMarker):
+ (WebCore::InlineTextBox::paintMarkedTextUnderline):
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::overflowRect):
+ (WebCore::RenderBlock::layoutBlock):
+ (WebCore::RenderBlock::collapseMargins):
+ (WebCore::RenderBlock::clearFloatsIfNeeded):
+ (WebCore::RenderBlock::estimateVerticalPosition):
+ (WebCore::RenderBlock::determineHorizontalPosition):
+ (WebCore::RenderBlock::setCollapsedBottomMargin):
+ (WebCore::RenderBlock::handleBottomOfBlock):
+ (WebCore::RenderBlock::layoutBlockChildren):
+ (WebCore::RenderBlock::fillVerticalSelectionGap):
+ (WebCore::RenderBlock::fillLeftSelectionGap):
+ (WebCore::RenderBlock::fillRightSelectionGap):
+ (WebCore::RenderBlock::positionNewFloats):
+ (WebCore::RenderBlock::nearestFloatBottom):
+ (WebCore::RenderBlock::lowestPosition):
+ (WebCore::RenderBlock::rightmostPosition):
+ (WebCore::RenderBlock::leftmostPosition):
+ (WebCore::RenderBlock::getClearDelta):
+ (WebCore::RenderBlock::calcMinMaxWidth):
+ (WebCore::RenderBlock::calcInlineMinMaxWidth):
+ (WebCore::RenderBlock::calcBlocminMaxWidth):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::calcBorderBoxWidth):
+ (WebCore::RenderBox::calcBorderBoxHeight):
+ (WebCore::RenderBox::calcContentBoxWidth):
+ (WebCore::RenderBox::calcContentBoxHeight):
+ (WebCore::RenderBox::paintRootBoxDecorations):
+ (WebCore::RenderBox::paintBoxDecorations):
+ (WebCore::RenderBox::calcWidth):
+ (WebCore::RenderBox::calcWidthUsing):
+ (WebCore::RenderBox::calcHeight):
+ (WebCore::RenderBox::calcPercentageHeight):
+ (WebCore::RenderBox::calcReplacedWidth):
+ (WebCore::RenderBox::calcReplacedHeight):
+ (WebCore::RenderBox::calcAbsoluteHorizontalValues):
+ (WebCore::RenderBox::calcAbsoluteVerticalValues):
+ * rendering/RenderCanvas.cpp:
+ (WebCore::RenderCanvas::layout):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::calcMinMaxWidth):
+ (WebCore::RenderFlexibleBox::layoutHorizontalBox):
+ (WebCore::RenderFlexibleBox::layoutVerticalBox):
+ (WebCore::RenderFlexibleBox::allowedChildFlex):
+ * rendering/RenderFlow.cpp:
+ (WebCore::RenderFlow::paintLines):
+ (WebCore::RenderFlow::lowestPosition):
+ (WebCore::RenderFlow::rightmostPosition):
+ (WebCore::RenderFlow::leftmostPosition):
+ (WebCore::RenderFlow::paintOutlineForLine):
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::imageChanged):
+ (WebCore::RenderImage::calcReplacedWidth):
+ (WebCore::RenderImage::calcReplacedHeight):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollRectToVisible):
+ (WebCore::RenderLayer::computeScrollDimensions):
+ (WebCore::RenderLayer::updateScrollInfoAfterLayout):
+ (WebCore::RenderLayer::absoluteBoundingBox):
+ (WebCore::Marquee::marqueeSpeed):
+ (WebCore::Marquee::computePosition):
+ (WebCore::Marquee::timerFired):
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::drawBorder):
+ (WebCore::RenderObject::paintBorderImage):
+ (WebCore::RenderObject::paintBorder):
+ (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
+ * rendering/RenderTable.cpp:
+ (WebCore::RenderTable::calcWidth):
+ (WebCore::RenderTable::layout):
+ (WebCore::RenderTable::paintBoxDecorations):
+ * rendering/RenderTableCell.cpp:
+ (WebCore::RenderTableCell::paintBackgroundsBehindCell):
+ * rendering/RenderTableSection.cpp:
+ (WebCore::RenderTableSection::layoutRows):
+ (WebCore::RenderTableSection::lowestPosition):
+ (WebCore::RenderTableSection::rightmostPosition):
+ (WebCore::RenderTableSection::leftmostPosition):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::caretRect):
+ (WebCore::RenderText::calcMinMaxWidth):
+ (WebCore::RenderText::minXPos):
+ (WebCore::RenderText::width):
+ (WebCore::RenderText::caretMinOffset):
+ (WebCore::RenderText::caretMaxOffset):
+ * rendering/bidi.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine):
+ (WebCore::RenderBlock::layoutInlineChildren):
+ (WebCore::RenderBlock::checkLinesForOverflow):
+ * rendering/render_form.cpp:
+ (WebCore::RenderLineEdit::setSelectionStart):
+ (WebCore::RenderLineEdit::setSelectionEnd):
+ (WebCore::RenderLineEdit::setSelectionRange):
+ (WebCore::RenderFieldset::layoutLegend):
+ (WebCore::RenderFieldset::paintBoxDecorations):
+ (WebCore::RenderSelect::layout):
+ (WebCore::RenderTextArea::calcMinMaxWidth):
+ (WebCore::RenderSlider::updateFromElement):
+ * rendering/render_frames.cpp:
+ (WebCore::RenderFrameSet::layout):
+ * rendering/render_line.cpp:
+ (WebCore::InlineFlowBox::placeBoxesHorizontally):
+ (WebCore::InlineFlowBox::verticallyAlignBoxes):
+ (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
+ (WebCore::InlineFlowBox::placeBoxesVertically):
+ (WebCore::InlineFlowBox::paintBackgroundAndBorder):
+ * rendering/render_line.h:
+ (WebCore::RootInlineBox::selectionHeight):
+ * rendering/render_list.cpp:
+ (WebCore::RenderListItem::positionListMarker):
+ * rendering/render_replaced.cpp:
+ (WebCore::RenderReplaced::shouldPaint):
+ * rendering/table_layout.cpp:
+ (WebCore::FixedTableLayout::calcMinMaxWidth):
+ (WebCore::AutoTableLayout::recalcColumn):
+ (WebCore::AutoTableLayout::calcMinMaxWidth):
+ (WebCore::AutoTableLayout::calcEffectiveWidth):
+ (WebCore::AutoTableLayout::layout):
+ Use min/max instead of kMin/kMax.
+
2006-04-12 Darin Adler <darin@apple.com>
Rubber-stamped by Anders.
<Tool\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
- AdditionalIncludeDirectories=""$(SolutionDir)\..";"$(SolutionDir)\..\dom";"$(SolutionDir)\..\bridge\win";"$(SolutionDir)\..\bridge";"$(SolutionDir)\..\editing";"$(SolutionDir)\..\page";"$(SolutionDir)\..\khtml";"$(SolutionDir)\..\khtml\misc";"$(SolutionDir)\..\khtml\html";"$(SolutionDir)\..\..\icu\include";"$(SolutionDir)\..\icu";"$(SolutionDir)\..\kwq";"$(SolutionDir)\..\platform\win";"$(SolutionDir)\..\platform";"$(SolutionDir)\..\platform\cairo\cairo\src";"$(SolutionDir)\..\..\JavaScriptCore\os-win32";"$(SolutionDir)\..\..\JavaScriptCore";"$(SolutionDir)\..\ForwardingHeaders""\r
+ AdditionalIncludeDirectories=""$(SolutionDir)\..";"$(SolutionDir)\..\dom";"$(SolutionDir)\..\bridge\win";"$(SolutionDir)\..\bridge";"$(SolutionDir)\..\editing";"$(SolutionDir)\..\page";"$(SolutionDir)\..\loader";"$(SolutionDir)\..\khtml";"$(SolutionDir)\..\khtml\misc";"$(SolutionDir)\..\khtml\html";"$(SolutionDir)\..\..\icu\include";"$(SolutionDir)\..\icu";"$(SolutionDir)\..\kwq";"$(SolutionDir)\..\platform\win";"$(SolutionDir)\..\platform";"$(SolutionDir)\..\platform\cairo\cairo\src";"$(SolutionDir)\..\..\JavaScriptCore\os-win32";"$(SolutionDir)\..\..\JavaScriptCore";"$(SolutionDir)\..\ForwardingHeaders""\r
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- AdditionalIncludeDirectories=""$(SolutionDir)\..";"$(SolutionDir)\..\dom";"$(SolutionDir)\..\bridge\win";"$(SolutionDir)\..\bridge";"$(SolutionDir)\..\editing";"$(SolutionDir)\..\page";"$(SolutionDir)\..\khtml";"$(SolutionDir)\..\khtml\misc";"$(SolutionDir)\..\khtml\html";"$(SolutionDir)\..\..\icu\include";"$(SolutionDir)\..\icu";"$(SolutionDir)\..\kwq";"$(SolutionDir)\..\platform\win";"$(SolutionDir)\..\platform";"$(SolutionDir)\..\platform\cairo\cairo\src";"$(SolutionDir)\..\..\JavaScriptCore\os-win32";"$(SolutionDir)\..\..\JavaScriptCore";"$(SolutionDir)\..\ForwardingHeaders""\r
+ AdditionalIncludeDirectories=""$(SolutionDir)\..";"$(SolutionDir)\..\dom";"$(SolutionDir)\..\bridge\win";"$(SolutionDir)\..\bridge";"$(SolutionDir)\..\editing";"$(SolutionDir)\..\page";"$(SolutionDir)\..\loader";"$(SolutionDir)\..\khtml";"$(SolutionDir)\..\khtml\misc";"$(SolutionDir)\..\khtml\html";"$(SolutionDir)\..\..\icu\include";"$(SolutionDir)\..\icu";"$(SolutionDir)\..\kwq";"$(SolutionDir)\..\platform\win";"$(SolutionDir)\..\platform";"$(SolutionDir)\..\platform\cairo\cairo\src";"$(SolutionDir)\..\..\JavaScriptCore\os-win32";"$(SolutionDir)\..\..\JavaScriptCore";"$(SolutionDir)\..\ForwardingHeaders""\r
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG"\r
MinimalRebuild="false"\r
RuntimeLibrary="2"\r
RelativePath="..\..\kwq\KWQCString.h"\r
>\r
</File>\r
- <File\r
- RelativePath="..\..\kwq\KWQDef.h"\r
- >\r
- </File>\r
<File\r
RelativePath="..\..\kwq\KWQEditCommand.h"\r
>\r
93F1992908245E59001E9ABC /* KWQCString.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868302DE3B8601EA4122 /* KWQCString.h */; };
93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868202DE3B8601EA4122 /* KWQComboBox.h */; };
93F1992F08245E59001E9ABC /* Cursor.h in Headers */ = {isa = PBXBuildFile; fileRef = F587868402DE3B8601EA4122 /* Cursor.h */; };
- 93F1993308245E59001E9ABC /* KWQDef.h in Headers */ = {isa = PBXBuildFile; fileRef = F58784DA02DE375901EA4122 /* KWQDef.h */; };
93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CCF7D4033BD43C008635CE /* KWQFileButton.h */; };
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = F587863A02DE3A1401EA4122 /* KWQKHTMLSettings.h */; };
93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */ = {isa = PBXBuildFile; fileRef = F587864902DE3A9A01EA4122 /* KWQKIOGlobal.h */; };
F565AE8602ECA583018635CA /* WebCoreSettings.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSettings.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784D202DE375901EA4122 /* KWQComboBox.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQComboBox.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784D502DE375901EA4122 /* KWQCString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KWQCString.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F58784DA02DE375901EA4122 /* KWQDef.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQDef.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784F002DE375901EA4122 /* CursorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CursorMac.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F58784FF02DE375901EA4122 /* JavaAppletWidget.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = JavaAppletWidget.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F587850302DE375901EA4122 /* KWQLoader.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQLoader.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D15002DE4271018635CA /* other */ = {
isa = PBXGroup;
children = (
- F58784DA02DE375901EA4122 /* KWQDef.h */,
BEF7EEA005FF8F0D009717EE /* KWQEditCommand.h */,
BEF7EEA105FF8F0D009717EE /* KWQEditCommand.mm */,
93CCF7D4033BD43C008635CE /* KWQFileButton.h */,
93F1992908245E59001E9ABC /* KWQCString.h in Headers */,
93F1992E08245E59001E9ABC /* KWQComboBox.h in Headers */,
93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
- 93F1993308245E59001E9ABC /* KWQDef.h in Headers */,
93F1993908245E59001E9ABC /* KWQFileButton.h in Headers */,
93F1994F08245E59001E9ABC /* KWQKHTMLSettings.h in Headers */,
93F1995008245E59001E9ABC /* KWQKIOGlobal.h in Headers */,
- (void *)pluginScriptableObject;
@end
+using namespace std;
+
using namespace KJS;
using namespace Bindings;
for (InlineTextBox* box = textObj->firstTextBox(); box; box = box->nextTextBox()) {
int runStart = (start == -1) ? box->m_start : start;
int runEnd = (end == -1) ? box->m_start + box->m_len : end;
- runEnd = kMin(runEnd, box->m_start + box->m_len);
+ runEnd = min(runEnd, box->m_start + box->m_len);
if (runStart >= box->m_start &&
runStart < box->m_start + box->m_len) {
if (box == textObj->firstTextBox() && box->m_start == runStart && runStart > 0)
@class NSView;
+using namespace std;
using namespace WebCore;
using namespace HTMLNames;
+using KJS::BooleanType;
+using KJS::DateInstance;
using KJS::ExecState;
+using KJS::GetterSetterType;
+using KJS::Identifier;
using KJS::Interpreter;
using KJS::JSLock;
using KJS::JSObject;
+using KJS::JSType;
using KJS::JSValue;
-using KJS::SavedProperties;
-using KJS::SavedBuiltins;
-using KJS::Window;
-using KJS::BooleanType;
-using KJS::StringType;
+using KJS::List;
+using KJS::NullType;
using KJS::NumberType;
using KJS::ObjectType;
-using KJS::UnspecifiedType;
-using KJS::UndefinedType;
-using KJS::NullType;
-using KJS::GetterSetterType;
+using KJS::SavedBuiltins;
+using KJS::SavedProperties;
+using KJS::StringType;
using KJS::UString;
-using KJS::Identifier;
-using KJS::List;
-using KJS::JSType;
-using KJS::DateInstance;
+using KJS::UndefinedType;
+using KJS::UnspecifiedType;
+using KJS::Window;
using KJS::Bindings::RootObject;
-using WebCore::RenderObject;
-
-NSString *WebCorePageCacheStateKey = @"WebCorePageCacheState";
+NSString *WebCorePageCacheStateKey = @"WebCorePageCacheState";
@interface WebCoreFrameBridge (WebCoreBridgeInternal)
- (RootObject *)executionContextForView:(NSView *)aView;
// We need to give the part the opportunity to adjust the page height at each step.
for (float i = 0; i < docHeight; i += currPageHeight) {
- float proposedBottom = kMin(docHeight, i + printHeight);
+ float proposedBottom = min(docHeight, i + printHeight);
m_frame->adjustPageHeight(&proposedBottom, i, proposedBottom, i);
- currPageHeight = kMax(1.0f, proposedBottom - i);
+ currPageHeight = max(1.0f, proposedBottom - i);
for (float j = 0; j < docWidth; j += printWidth) {
NSValue* val = [NSValue valueWithRect: NSMakeRect(j, i, printWidth, currPageHeight)];
[pages addObject: val];
#include "css_stylesheetimpl.h"
#include "loader.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
return; // Error case.
// Clamp opacity to the range 0-1
- style->setOpacity(kMin(1.0, kMax(0.0, primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER))));
+ style->setOpacity(min(1.0, max(0.0, primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER))));
return;
case CSS_PROP__KHTML_BOX_ALIGN:
HANDLE_INHERIT_AND_INITIAL(boxAlign, BoxAlign)
if (zoomedSize < minLogicalSize && (specifiedSize >= minLogicalSize || !isAbsoluteSize))
zoomedSize = minLogicalSize;
- return kMax(zoomedSize, 1.0f);
+ return max(zoomedSize, 1.0f);
}
const int fontSizeTableMax = 16;
}
// Value is outside the range of the table. Apply the scale factor instead.
- float minLogicalSize = kMax(settings->minLogicalFontSize(), 1);
- return kMax(fontSizeFactors[keyword - CSS_VAL_XX_SMALL]*mediumSize, minLogicalSize);
+ float minLogicalSize = max(settings->minLogicalFontSize(), 1);
+ return max(fontSizeFactors[keyword - CSS_VAL_XX_SMALL]*mediumSize, minLogicalSize);
}
float CSSStyleSelector::largerFontSize(float size, bool quirksMode) const
#include "KSVGTimeScheduler.h"
#endif
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
m_overMinimumLayoutThreshold = elapsed > cLayoutScheduleThreshold;
// We'll want to schedule the timer to fire at the minimum layout threshold.
- return kMax(0, cLayoutScheduleThreshold - elapsed);
+ return max(0, cLayoutScheduleThreshold - elapsed);
}
int Document::elapsedTime() const
return;
} else {
// marker and newMarker intersect or touch - merge them into newMarker
- newMarker.startOffset = kMin(newMarker.startOffset, marker.startOffset);
- newMarker.endOffset = kMax(newMarker.endOffset, marker.endOffset);
+ newMarker.startOffset = min(newMarker.startOffset, marker.startOffset);
+ newMarker.endOffset = max(newMarker.endOffset, marker.endOffset);
// remove old one, we'll add newMarker later
it = markers->remove(it);
// it points to the next marker to consider
#include "HTMLNames.h"
#include "css_stylesheetimpl.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
colors[component] = (colors[component] << 4);
if (hex > 0) {
colors[component] += hex;
- maxDigit = kMin(maxDigit, numDigits);
+ maxDigit = min(maxDigit, numDigits);
}
numDigits++;
pos++;
#include "XLinkNames.h"
#endif
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
int readOutBytes(char *outputBuffer, unsigned askedToRead) {
unsigned bytesLeft = m_buffer.size() - m_currentOffset;
- unsigned lenToCopy = kMin(askedToRead, bytesLeft);
+ unsigned lenToCopy = min(askedToRead, bytesLeft);
if (lenToCopy) {
memcpy(outputBuffer, m_buffer.data() + m_currentOffset, lenToCopy);
m_currentOffset += lenToCopy;
CSSMutableStyleDeclaration* inlineStyleDecl = elem->getInlineStyleDecl();
float currentFontSize = computedFontSize(node);
- float desiredFontSize = kMax(MinimumFontSize, startingFontSizes.get(node) + adjustment);
+ float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + adjustment);
RefPtr<CSSValue> value = inlineStyleDecl->getPropertyCSSValue(CSS_PROP_FONT_SIZE);
if (value) {
inlineStyleDecl->removeProperty(CSS_PROP_FONT_SIZE, true);
#include "htmlediting.h"
#include "visible_units.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
bool indicesIntersect = start <= gapEnd && end >= gapStart;
int gapLen = gapEnd - gapStart;
if (indicesIntersect && gapLen > 0) {
- gapStart = kMax(gapStart, start);
- gapEnd = kMin(gapEnd, end);
+ gapStart = max(gapStart, start);
+ gapEnd = min(gapEnd, end);
if (!str)
str = textNode->string()->substring(start, end - start);
// remove text in the gap
#include "RenderTableCell.h"
#include "RenderTableRow.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
}
int strLength = str.length();
int end = (m_node == m_endContainer) ? m_endOffset : LONG_MAX;
- int runEnd = kMin(strLength, end);
+ int runEnd = min(strLength, end);
if (runStart >= runEnd)
return true;
int end = (m_node == m_endContainer) ? m_endOffset : LONG_MAX;
while (m_textBox) {
int textBoxStart = m_textBox->m_start;
- int runStart = kMax(textBoxStart, start);
+ int runStart = max(textBoxStart, start);
// Check for collapsed space at the start of this run.
InlineTextBox *firstTextBox = renderer->containsReversedText() ? m_sortedTextBoxes[0] : renderer->firstTextBox();
return;
}
int textBoxEnd = textBoxStart + m_textBox->m_len;
- int runEnd = kMin(textBoxEnd, end);
+ int runEnd = min(textBoxEnd, end);
// Determine what the next text box will be, but don't advance yet
InlineTextBox *nextTextBox = 0;
DeprecatedString result;
result.reserve(numChars);
while (numChars > 0 && !atEnd()) {
- int runSize = kMin(numChars, length());
+ int runSize = min(numChars, length());
result.append(characters(), runSize);
numChars -= runSize;
advance(runSize);
buffer.clear();
}
int available = it.length();
- int runLength = kMin(needed, available);
+ int runLength = min(needed, available);
buffer.append(runLength, it.characters());
it.advance(runLength);
}
#include "RenderObject.h"
#include "RegularExpression.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
}
if (node->offsetInCharacters())
- return Position(node, kMin(node->maxOffset(), pos.offset()));
+ return Position(node, min(node->maxOffset(), pos.offset()));
int maxCompliantOffset = node->childNodeCount();
if (pos.offset() > maxCompliantOffset) {
#include "htmlediting.h"
#include "visible_units.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
if (endOffset < start)
break;
if (startOffset <= end) {
- unsigned s = kMax(start, startOffset);
- unsigned e = kMin(end, endOffset);
+ unsigned s = max(start, startOffset);
+ unsigned e = min(end, endOffset);
result.append(str.mid(s, e-s));
if (e == end) {
// now add in collapsed-away spaces if at the end of the line
// count the number of characters between the end of the
// current box and the start of the next box.
int collapsedStart = e;
- int collapsedPastEnd = kMin((unsigned)nextBox->m_start, endOffset + 1);
+ int collapsedPastEnd = min((unsigned)nextBox->m_start, endOffset + 1);
bool addNextNonNBSP = true;
for (int i = collapsedStart; i < collapsedPastEnd; i++) {
if (str[i] == nonBreakingSpace) {
int i = static_cast<RenderText*>(r)->length();
int o = offset;
if (n == startNode && o < i)
- i = kMax(0, o);
+ i = max(0, o);
while (--i >= 0)
if (text[i] == '\n')
return VisiblePosition(n, i + 1, DOWNSTREAM);
void HTMLSelectElement::parseMappedAttribute(MappedAttribute *attr)
{
if (attr->name() == sizeAttr) {
- m_size = kMax(attr->value().toInt(), 1);
+ m_size = max(attr->value().toInt(), 1);
} else if (attr->name() == widthAttr) {
- m_minwidth = kMax(attr->value().toInt(), 0);
+ m_minwidth = max(attr->value().toInt(), 0);
} else if (attr->name() == multipleAttr) {
m_multiple = (!attr->isNull());
} else if (attr->name() == accesskeyAttr) {
#define TOKENIZER_CHUNK_SIZE 4096
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
scriptCode[ scriptCodeSize++ ] = *src;
#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
qDebug("comment is now: *%s*",
- QConstString((QChar*)src.operator->(), kMin(16U, src.length())).deprecatedString().latin1());
+ QConstString((QChar*)src.operator->(), min(16U, src.length())).deprecatedString().latin1());
#endif
if (strict) {
case Hexadecimal:
{
- int ll = kMin(src.length(), 10-cBufferPos);
+ int ll = min(src.length(), 10-cBufferPos);
while(ll--) {
QChar csrc(src->lower());
cc = csrc.cell();
}
case Decimal:
{
- int ll = kMin(src.length(), 9-cBufferPos);
+ int ll = min(src.length(), 9-cBufferPos);
while(ll--) {
cc = src->cell();
}
case EntityName:
{
- int ll = kMin(src.length(), 9-cBufferPos);
+ int ll = min(src.length(), 9-cBufferPos);
while(ll--) {
QChar csrc = *src;
cc = csrc.cell();
}
bool finish = false;
- unsigned int ll = kMin(src.length(), CBUFLEN-cBufferPos);
+ unsigned int ll = min(src.length(), CBUFLEN-cBufferPos);
while(ll--) {
unsigned short curchar = src->unicode();
if(curchar <= ' ' || curchar == '>' ) {
#if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 1
qDebug("AttributeName");
#endif
- int ll = kMin(src.length(), CBUFLEN-cBufferPos);
+ int ll = min(src.length(), CBUFLEN-cBufferPos);
while(ll--) {
unsigned short curchar = src->unicode();
if (curchar <= '>' && (curchar >= '=' || curchar <= ' ')) {
void HTMLTokenizer::enlargeBuffer(int len)
{
- int newsize = kMax(size*2, size+len);
+ int newsize = max(size*2, size+len);
int oldoffs = (dest - buffer);
buffer = (QChar*)fastRealloc(buffer, newsize*sizeof(QChar));
void HTMLTokenizer::enlargeScriptBuffer(int len)
{
- int newsize = kMax(scriptCodeMaxSize*2, scriptCodeMaxSize+len);
+ int newsize = max(scriptCodeMaxSize*2, scriptCodeMaxSize+len);
scriptCode = (QChar*)fastRealloc(scriptCode, newsize*sizeof(QChar));
scriptCodeMaxSize = newsize;
}
#include "RenderImage.h"
#include "HTMLNames.h"
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
case Circle:
if (m_coordsLen >= 3) {
Length radius = m_coords[2];
- int r = kMin(radius.calcMinValue(width), radius.calcMinValue(height));
+ int r = min(radius.calcMinValue(width), radius.calcMinValue(height));
return Path(IntRect(m_coords[0].calcMinValue(width) - r, m_coords[1].calcMinValue(height) - r,
2 * r, 2 * r), Path::Ellipse);
}
addCSSLength(attr, CSS_PROP_BORDER_SPACING, attr->value());
} else if (attr->name() == cellpaddingAttr) {
if (!attr->value().isEmpty())
- padding = kMax( 0, attr->value().toInt() );
+ padding = max( 0, attr->value().toInt() );
else
padding = 1;
if (renderer() && renderer()->isTable()) {
#include "ksvgcssproperties.c"
#include "ksvgcssvalues.c"
+using namespace std;
+
namespace WebCore {
typedef Value KDOMCSSValue;
if(!validUnit(v, FInteger|FPercent, true))
return 0;
int b = (int) (v->fValue * (v->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? 256./100. : 1.));
- r = kMax(0, kMin(255, r));
- g = kMax(0, kMin(255, g));
- b = kMax(0, kMin(255, b));
+ r = max(0, min(255, r));
+ g = max(0, min(255, g));
+ b = max(0, min(255, b));
return new SVGPaint(SVG_PAINTTYPE_RGBCOLOR, 0, String::sprintf("rgb(%d, %d, %d)", r, g, b).impl());
}
if(!validUnit(v, FInteger|FPercent, true))
return 0;
int b = (int) (v->fValue * (v->unit == CSSPrimitiveValue::CSS_PERCENTAGE ? 256./100. : 1.));
- r = kMax(0, kMin(255, r));
- g = kMax(0, kMin(255, g));
- b = kMax(0, kMin(255, b));
+ r = max(0, min(255, r));
+ g = max(0, min(255, g));
+ b = max(0, min(255, b));
return new SVGColor(String::sprintf("rgb(%d, %d, %d)", r, g, b).impl());
}
renderer = itemRenderer;
}
float textWidth = [renderer floatWidthForRun:&run style:&style];
- width = kMax(width, textWidth);
+ width = max(width, textWidth);
} while (i != e);
}
- _width = kMax(static_cast<int>(ceilf(width)), dimensions()[minimumTextWidth]);
+ _width = max(static_cast<int>(ceilf(width)), dimensions()[minimumTextWidth]);
_widthGood = true;
}
+++ /dev/null
-/*
- * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef KWQDEF_H_
-#define KWQDEF_H_
-
-template<typename T> inline const T& kMin(const T& a, const T& b) { return a < b ? a : b; }
-template<typename T> inline const T& kMax(const T& a, const T& b) { return b < a ? a : b; }
-
-#endif
WebCoreInitializeTextRun(&run, reinterpret_cast<const UniChar *>(s.unicode()), length, 0, length);
float textWidth = [(((*i).type == KWQListBoxGroupLabel) ? groupLabelRenderer : renderer) floatWidthForRun:&run style:&style];
- width = kMax(width, textWidth);
+ width = max(width, textWidth);
++i;
#import "WebCoreWidgetHolder.h"
#import "render_form.h"
+using namespace std;
using namespace WebCore;
@interface KWQSlider : NSSlider <WebCoreWidgetHolder>
void QSlider::setValue(double v)
{
- double val = kMax(m_minVal, kMin(v, m_maxVal));
+ double val = max(m_minVal, min(v, m_maxVal));
KWQSlider* slider = (KWQSlider*)getView();
[slider setDoubleValue: val];
#include "TransferJob.h"
#include "loader.h"
+using namespace std;
+
namespace WebCore {
const int defaultCacheSize = 4096 * 1024;
void Cache::setSize(int bytes)
{
maxSize = bytes;
- maxCacheable = kMax(maxSize / 128, minMaxCacheableObjectSize);
+ maxCacheable = max(maxSize / 128, minMaxCacheableObjectSize);
// may be we need to clear parts of the cache
flushCount = 0;
#include "SVGDocumentExtensions.h"
#endif
+using namespace std;
using namespace KJS;
namespace WebCore {
// implementation should not do this!
int rightmostPos = root->rightmostPosition();
if (rightmostPos > minPageWidth) {
- pageW = kMin(rightmostPos, (int)ceilf(maxPageWidth));
+ pageW = min(rightmostPos, (int)ceilf(maxPageWidth));
root->setWidth(pageW);
root->setNeedsLayoutAndMinMaxRecalc();
forceLayout();
#ifndef KWQ_LIST_IMPL_H
#define KWQ_LIST_IMPL_H
-#include "KWQDef.h"
-
class KWQListNode;
class DeprecatedPtrListImplIterator;
#include <stdio.h>
#include <stdarg.h>
#ifdef WIN32
-#include "Windows.h"
+#include <windows.h>
#endif
+using namespace std;
using namespace KJS;
using namespace WebCore;
return 1;
if ( b == 0 )
return -1;
- int l = kMin(as.length(), bs.length());
+ int l = min(as.length(), bs.length());
while ( l-- && *a == *b )
a++,b++;
if ( l == -1 )
#ifndef QSTRING_H_
#define QSTRING_H_
-#include "KWQDef.h"
#include <ctype.h>
#include <unicode/uchar.h>
#if __APPLE__
#ifndef KWQVALUELIST_H_
#define KWQVALUELIST_H_
-#include "KWQDef.h"
#include <kxmlcore/RefPtr.h>
class DeprecatedValueListImplNode;
// Need sufficient width and height to contain these curves. Sanity check our top/bottom
// values and our width/height values to make sure the curves can all fit.
- int requiredWidth = kMax(topLeft.width() + topRight.width(), bottomLeft.width() + bottomRight.width());
+ int requiredWidth = max(topLeft.width() + topRight.width(), bottomLeft.width() + bottomRight.width());
if (requiredWidth > rect.width())
return;
- int requiredHeight = kMax(topLeft.height() + bottomLeft.height(), topRight.height() + bottomRight.height());
+ int requiredHeight = max(topLeft.height() + bottomLeft.height(), topRight.height() + bottomRight.height());
if (requiredHeight > rect.height())
return;
// Now add five rects (one for each edge rect in between the rounded corners and one for the interior).
CGContextAddRect(context, CGRectMake(rect.x() + topLeft.width(), rect.y(),
rect.width() - topLeft.width() - topRight.width(),
- kMax(topLeft.height(), topRight.height())));
+ max(topLeft.height(), topRight.height())));
CGContextAddRect(context, CGRectMake(rect.x() + bottomLeft.width(),
- rect.bottom() - kMax(bottomLeft.height(), bottomRight.height()),
+ rect.bottom() - max(bottomLeft.height(), bottomRight.height()),
rect.width() - bottomLeft.width() - bottomRight.width(),
- kMax(bottomLeft.height(), bottomRight.height())));
+ max(bottomLeft.height(), bottomRight.height())));
CGContextAddRect(context, CGRectMake(rect.x(), rect.y() + topLeft.height(),
- kMax(topLeft.width(), bottomLeft.width()), rect.height() - topLeft.height() - bottomLeft.height()));
- CGContextAddRect(context, CGRectMake(rect.right() - kMax(topRight.width(), bottomRight.width()),
+ max(topLeft.width(), bottomLeft.width()), rect.height() - topLeft.height() - bottomLeft.height()));
+ CGContextAddRect(context, CGRectMake(rect.right() - max(topRight.width(), bottomRight.width()),
rect.y() + topRight.height(),
- kMax(topRight.width(), bottomRight.width()), rect.height() - topRight.height() - bottomRight.height()));
- CGContextAddRect(context, CGRectMake(rect.x() + kMax(topLeft.width(), bottomLeft.width()),
- rect.y() + kMax(topLeft.height(), topRight.height()),
- rect.width() - kMax(topLeft.width(), bottomLeft.width()) - kMax(topRight.width(), bottomRight.width()),
- rect.height() - kMax(topLeft.height(), topRight.height()) - kMax(bottomLeft.height(), bottomRight.height())));
+ max(topRight.width(), bottomRight.width()), rect.height() - topRight.height() - bottomRight.height()));
+ CGContextAddRect(context, CGRectMake(rect.x() + max(topLeft.width(), bottomLeft.width()),
+ rect.y() + max(topLeft.height(), topRight.height()),
+ rect.width() - max(topLeft.width(), bottomLeft.width()) - max(topRight.width(), bottomRight.width()),
+ rect.height() - max(topLeft.height(), topRight.height()) - max(bottomLeft.height(), bottomRight.height())));
CGContextClip(context);
}
#import "render_replaced.h"
#import <kxmlcore/Assertions.h>
+using namespace std;
using namespace WebCore;
using namespace EventNames;
NSPoint initialLocalPoint = [self convertPoint:[event locationInWindow] fromView:nil];
NSSize initialTextAreaSize = [textArea frame].size;
- int minWidth = kMin((int)initialTextAreaSize.width, MinimumWidthWhileResizing);
- int minHeight = kMin((int)initialTextAreaSize.height, MinimumHeightWhileResizing);
+ int minWidth = min((int)initialTextAreaSize.width, MinimumWidthWhileResizing);
+ int minHeight = min((int)initialTextAreaSize.height, MinimumHeightWhileResizing);
BOOL handledIntrinsicMargins = NO;
DOMCSSStyleDeclaration *oldComputedStyle = [[element ownerDocument] getComputedStyle:element :@""];
// to drag the bottom-right corner to make the bottom-left corner move.
// FIXME Radar 4118564: ideally we'd autoscroll the window as necessary to keep the point under
// the cursor in view.
- int newWidth = kMax(minWidth, (int)(initialTextAreaSize.width + (localPoint.x - initialLocalPoint.x)));
- int newHeight = kMax(minHeight, (int)(initialTextAreaSize.height + (localPoint.y - initialLocalPoint.y)));
+ int newWidth = max(minWidth, (int)(initialTextAreaSize.width + (localPoint.x - initialLocalPoint.x)));
+ int newHeight = max(minHeight, (int)(initialTextAreaSize.height + (localPoint.y - initialLocalPoint.y)));
[inlineStyle setWidth:[NSString stringWithFormat:@"%dpx", newWidth]];
[inlineStyle setHeight:[NSString stringWithFormat:@"%dpx", newHeight]];
#include "RenderArena.h"
#include <kxmlcore/AlwaysInline.h>
+using namespace std;
+
namespace WebCore {
#ifndef NDEBUG
bool InlineTextBox::isSelected(int startPos, int endPos) const
{
- int sPos = kMax(startPos - m_start, 0);
- int ePos = kMin(endPos - m_start, (int)m_len);
+ int sPos = max(startPos - m_start, 0);
+ int ePos = min(endPos - m_start, (int)m_len);
return (sPos < ePos);
}
IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
{
- int sPos = kMax(startPos - m_start, 0);
- int ePos = kMin(endPos - m_start, (int)m_len);
+ int sPos = max(startPos - m_start, 0);
+ int ePos = min(endPos - m_start, (int)m_len);
if (sPos >= ePos)
return IntRect();
// No characters should be rendered. Set ourselves to full truncation and place the ellipsis at the min of our start
// and the ellipsis edge.
m_truncation = cFullTruncation;
- return kMin(ellipsisX, m_x);
+ return min(ellipsisX, m_x);
}
// Set the truncation index on the text run. The ellipsis needs to be placed just after the last visible character.
startPos = 0;
}
- sPos = kMax(startPos - m_start, 0);
- ePos = kMin(endPos - m_start, (int)m_len);
+ sPos = max(startPos - m_start, 0);
+ ePos = min(endPos - m_start, (int)m_len);
}
void InlineTextBox::paintSelection(GraphicsContext* p, int tx, int ty, RenderStyle* style, const Font* f)
void InlineTextBox::paintMarkedTextBackground(GraphicsContext* p, int tx, int ty, RenderStyle* style, const Font* f, int startPos, int endPos)
{
int offset = m_start;
- int sPos = kMax(startPos - offset, 0);
- int ePos = kMin(endPos - offset, (int)m_len);
+ int sPos = max(startPos - offset, 0);
+ int ePos = min(endPos - offset, (int)m_len);
if (sPos >= ePos)
return;
start = static_cast<RenderText*>(m_object)->width(m_start, paintStart - m_start, textPos(), m_firstLine);
}
if (paintEnd != marker.endOffset) { // end points at the last char, not past it
- paintEnd = kMin(paintEnd, marker.endOffset);
+ paintEnd = min(paintEnd, marker.endOffset);
useWholeWidth = false;
}
if (m_truncation != cNoTruncation) {
- paintEnd = kMin(paintEnd, (unsigned)m_truncation);
+ paintEnd = min(paintEnd, (unsigned)m_truncation);
useWholeWidth = false;
}
if (!useWholeWidth) {
int y = r->selectionTop();
int h = r->selectionHeight();
pt->addClip(IntRect(_tx + m_x, _ty + y, m_width, h));
- int sPos = kMax(marker.startOffset - m_start, (unsigned)0);
- int ePos = kMin(marker.endOffset - m_start, (unsigned)m_len);
+ int sPos = max(marker.startOffset - m_start, (unsigned)0);
+ int ePos = min(marker.endOffset - m_start, (unsigned)m_len);
pt->drawHighlightForText(m_x + _tx, y + _ty, h, textObject()->tabWidth(), textPos(),
textObject()->str->unicode(), textObject()->str->length(), m_start, m_len,
start = static_cast<RenderText*>(m_object)->width(m_start, paintStart - m_start, textPos(), m_firstLine);
}
if (paintEnd != underline.endOffset) { // end points at the last char, not past it
- paintEnd = kMin(paintEnd, (unsigned)underline.endOffset);
+ paintEnd = min(paintEnd, (unsigned)underline.endOffset);
useWholeWidth = false;
}
if (m_truncation != cNoTruncation) {
- paintEnd = kMin(paintEnd, (unsigned)m_truncation);
+ paintEnd = min(paintEnd, (unsigned)m_truncation);
useWholeWidth = false;
}
if (!useWholeWidth) {
#include "RenderTheme.h"
#include "KWQTextStream.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
if (!includeInterior && hasOverflowClip())
return borderBox();
int l = overflowLeft(includeInterior);
- int t = kMin(overflowTop(includeInterior), -borderTopExtra());
+ int t = min(overflowTop(includeInterior), -borderTopExtra());
return IntRect(l, t, overflowWidth(includeInterior) - 2*l, overflowHeight(includeInterior) + borderTopExtra() + borderBottomExtra() - 2*t);
}
positionListMarker();
// Always ensure our overflow width/height are at least as large as our width/height.
- m_overflowWidth = kMax(m_overflowWidth, m_width);
- m_overflowHeight = kMax(m_overflowHeight, m_height);
+ m_overflowWidth = max(m_overflowWidth, m_width);
+ m_overflowHeight = max(m_overflowHeight, m_height);
// Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
// we overflow or not.
// For self-collapsing blocks, collapse our bottom margins into our
// top to get new posTop and negTop values.
if (child->isSelfCollapsingBlock()) {
- posTop = kMax(posTop, child->maxBottomMargin(true));
- negTop = kMax(negTop, child->maxBottomMargin(false));
+ posTop = max(posTop, child->maxBottomMargin(true));
+ negTop = max(negTop, child->maxBottomMargin(false));
}
// See if the top margin is quirky. We only care if this child has
// block. If it has larger margin values, then we need to update
// our own maximal values.
if (!style()->htmlHacks() || !marginInfo.quirkContainer() || !topQuirk) {
- m_maxTopPosMargin = kMax(posTop, m_maxTopPosMargin);
- m_maxTopNegMargin = kMax(negTop, m_maxTopNegMargin);
+ m_maxTopPosMargin = max(posTop, m_maxTopPosMargin);
+ m_maxTopNegMargin = max(negTop, m_maxTopNegMargin);
}
// The minute any of the margins involved isn't a quirk, don't
// This child has no height. We need to compute our
// position before we collapse the child's margins together,
// so that we can get an accurate position for the zero-height block.
- int collapsedTopPos = kMax(marginInfo.posMargin(), child->maxTopMargin(true));
- int collapsedTopNeg = kMax(marginInfo.negMargin(), child->maxTopMargin(false));
+ int collapsedTopPos = max(marginInfo.posMargin(), child->maxTopMargin(true));
+ int collapsedTopNeg = max(marginInfo.negMargin(), child->maxTopMargin(false));
marginInfo.setMargin(collapsedTopPos, collapsedTopNeg);
// Now collapse the child's margins together, which means examining our
&& (!style()->htmlHacks() || !marginInfo.quirkContainer() || !marginInfo.topQuirk()))) {
// We're collapsing with a previous sibling's margins and not
// with the top of the block.
- m_height += kMax(marginInfo.posMargin(), posTop) - kMax(marginInfo.negMargin(), negTop);
+ m_height += max(marginInfo.posMargin(), posTop) - max(marginInfo.negMargin(), negTop);
ypos = m_height;
}
// For self-collapsing blocks that clear, they may end up collapsing
// into the bottom of the parent block. We simulate this behavior by
// setting our positive margin value to compensate for the clear.
- marginInfo.setPosMargin(kMax(0, child->yPos() - m_height));
+ marginInfo.setPosMargin(max(0, child->yPos() - m_height));
marginInfo.setNegMargin(0);
marginInfo.setSelfCollapsingBlockClearedFloat(true);
}
int yPosEstimate = m_height;
if (!marginInfo.canCollapseWithTop()) {
int childMarginTop = child->selfNeedsLayout() ? child->marginTop() : child->collapsedMarginTop();
- yPosEstimate += kMax(marginInfo.margin(), childMarginTop);
+ yPosEstimate += max(marginInfo.margin(), childMarginTop);
}
return yPosEstimate;
}
if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type() != Auto) {
if (child->marginLeft() < 0)
leftOff += child->marginLeft();
- chPos = kMax(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
+ chPos = max(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
}
else if (leftOff != xPos) {
// The object is shifting right. The object might be centered, so we need to
if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type() != Auto) {
if (child->marginRight() < 0)
rightOff -= child->marginRight();
- chPos = kMin(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
+ chPos = min(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
} else if (rightOff != xPos) {
// The object is shifting left. The object might be centered, so we need to
// recalculate our horizontal margins. Note that the containing block content
if (marginInfo.canCollapseWithBottom() && !marginInfo.canCollapseWithTop()) {
// Update our max pos/neg bottom margins, since we collapsed our bottom margins
// with our children.
- m_maxBottomPosMargin = kMax(m_maxBottomPosMargin, marginInfo.posMargin());
- m_maxBottomNegMargin = kMax(m_maxBottomNegMargin, marginInfo.negMargin());
+ m_maxBottomPosMargin = max(m_maxBottomPosMargin, marginInfo.posMargin());
+ m_maxBottomNegMargin = max(m_maxBottomNegMargin, marginInfo.negMargin());
if (!marginInfo.bottomQuirk())
m_bottomMarginQuirk = false;
// Negative margins can cause our height to shrink below our minimal height (border/padding).
// If this happens, ensure that the computed height is increased to the minimal height.
- m_height = kMax(m_height, top + bottom);
+ m_height = max(m_height, top + bottom);
// Always make sure our overflow height is at least our height.
- m_overflowHeight = kMax(m_height, m_overflowHeight);
+ m_overflowHeight = max(m_height, m_overflowHeight);
// Update our bottom collapsed margin info.
setCollapsedBottomMargin(marginInfo);
determineHorizontalPosition(child);
// Update our top overflow in case the child spills out the top of the block.
- m_overflowTop = kMin(m_overflowTop, child->yPos() + child->overflowTop(false));
+ m_overflowTop = min(m_overflowTop, child->yPos() + child->overflowTop(false));
// Update our height now that the child has been placed in the correct position.
m_height += child->height();
addOverhangingFloats(static_cast<RenderBlock *>(child), -child->xPos(), -child->yPos());
// See if this child has made our overflow need to grow.
- m_overflowWidth = kMax(child->xPos() + child->overflowWidth(false), m_overflowWidth);
- m_overflowLeft = kMin(child->xPos() + child->overflowLeft(false), m_overflowLeft);
+ m_overflowWidth = max(child->xPos() + child->overflowWidth(false), m_overflowWidth);
+ m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
// Insert our compact into the block margin if we have one.
insertCompactIfNeeded(child, compactInfo);
return IntRect();
// Get the selection offsets for the bottom of the gap
- int left = blockX + kMax(lastLeft, leftSelectionOffset(rootBlock, bottomY));
- int right = blockX + kMin(lastRight, rightSelectionOffset(rootBlock, bottomY));
+ int left = blockX + max(lastLeft, leftSelectionOffset(rootBlock, bottomY));
+ int right = blockX + min(lastRight, rightSelectionOffset(rootBlock, bottomY));
int width = right - left;
if (width <= 0)
return IntRect();
IntRect RenderBlock::fillLeftSelectionGap(RenderObject* selObj, int xPos, int yPos, int height, RenderBlock* rootBlock, int blockX, int blockY, int tx, int ty, const PaintInfo* i)
{
int top = yPos + ty;
- int left = blockX + kMax(leftSelectionOffset(rootBlock, yPos), leftSelectionOffset(rootBlock, yPos + height));
+ int left = blockX + max(leftSelectionOffset(rootBlock, yPos), leftSelectionOffset(rootBlock, yPos + height));
int width = tx + xPos - left;
if (width <= 0)
return IntRect();
{
int left = xPos + tx;
int top = yPos + ty;
- int right = blockX + kMin(rightSelectionOffset(rootBlock, yPos), rightSelectionOffset(rootBlock, yPos + height));
+ int right = blockX + min(rightSelectionOffset(rootBlock, yPos), rightSelectionOffset(rootBlock, yPos + height));
int width = right - left;
if (width <= 0)
return IntRect();
int oldChildY = o->yPos();
if ( o->style()->clear() & CLEFT )
- y = kMax( leftBottom(), y );
+ y = max( leftBottom(), y );
if ( o->style()->clear() & CRIGHT )
- y = kMax( rightBottom(), y );
+ y = max( rightBottom(), y );
if (o->style()->floating() == FLEFT)
{
int fx = leftRelOffset(y,lo, false, &heightRemainingLeft);
while (rightRelOffset(y,ro, false, &heightRemainingRight)-fx < fwidth)
{
- y += kMin( heightRemainingLeft, heightRemainingRight );
+ y += min( heightRemainingLeft, heightRemainingRight );
fx = leftRelOffset(y,lo, false, &heightRemainingLeft);
}
if (fx<0) fx=0;
int fx = rightRelOffset(y,ro, false, &heightRemainingRight);
while (fx - leftRelOffset(y,lo, false, &heightRemainingLeft) < fwidth)
{
- y += kMin(heightRemainingLeft, heightRemainingRight);
+ y += min(heightRemainingLeft, heightRemainingRight);
fx = rightRelOffset(y,ro, false, &heightRemainingRight);
}
if (fx<f->width) fx=f->width;
for ( ; (r = it.current()); ++it )
if (r->endY>height && (r->endY<bottom || bottom==0))
bottom=r->endY;
- return kMax(bottom, height);
+ return max(bottom, height);
}
int
for ( ; (r = it.current()); ++it ) {
if (!r->noPaint || r->node->layer()) {
int lp = r->startY + r->node->marginTop() + r->node->lowestPosition(false);
- bottom = kMax(bottom, lp);
+ bottom = max(bottom, lp);
}
}
}
DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
for ( ; (r = it.current()); ++it ) {
int lp = r->yPos() + r->lowestPosition(false);
- bottom = kMax(bottom, lp);
+ bottom = max(bottom, lp);
}
}
if (!includeSelf && lastLineBox()) {
int lp = lastLineBox()->yPos() + lastLineBox()->height();
- bottom = kMax(bottom, lp);
+ bottom = max(bottom, lp);
}
return bottom;
for ( ; (r = it.current()); ++it ) {
if (!r->noPaint || r->node->layer()) {
int rp = r->left + r->node->marginLeft() + r->node->rightmostPosition(false);
- right = kMax(right, rp);
+ right = max(right, rp);
}
}
}
DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
for ( ; (r = it.current()); ++it ) {
int rp = r->xPos() + r->rightmostPosition(false);
- right = kMax(right, rp);
+ right = max(right, rp);
}
}
if (!includeSelf && firstLineBox()) {
for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox()) {
int rp = currBox->xPos() + currBox->width();
- right = kMax(right, rp);
+ right = max(right, rp);
}
// If this node is a root editable element, then the rightmostPosition should account for a caret at the end.
if (node()->isContentEditable() && node() == node()->rootEditableElement() && style()->direction() == LTR)
for ( ; (r = it.current()); ++it ) {
if (!r->noPaint || r->node->layer()) {
int lp = r->left + r->node->marginLeft() + r->node->leftmostPosition(false);
- left = kMin(left, lp);
+ left = min(left, lp);
}
}
}
DeprecatedPtrListIterator<RenderObject> it(*m_positionedObjects);
for ( ; (r = it.current()); ++it ) {
int lp = r->xPos() + r->leftmostPosition(false);
- left = kMin(left, lp);
+ left = min(left, lp);
}
}
if (!includeSelf && firstLineBox()) {
for (InlineRunBox* currBox = firstLineBox(); currBox; currBox = currBox->nextLineBox())
- left = kMin(left, (int)currBox->xPos());
+ left = min(left, (int)currBox->xPos());
}
return left;
// to fit) and not all (we should be using nearestFloatBottom and looping).
// Do not allow tables to wrap in quirks or even in almost strict mode
// (ebay on the PLT, finance.yahoo.com in the real world, versiontracker.com forces even almost strict mode not to work)
- int result = clearSet ? kMax(0, bottom - child->yPos()) : 0;
+ int result = clearSet ? max(0, bottom - child->yPos()) : 0;
if (!result && child->avoidsFloats() && child->style()->width().isFixed() &&
child->minWidth() > lineWidth(child->yPos()) && child->minWidth() <= contentWidth() &&
document()->inStrictMode())
- result = kMax(0, floatBottom() - child->yPos());
+ result = max(0, floatBottom() - child->yPos());
return result;
}
if (childrenInline())
calcInlineMinMaxWidth();
else
- calcBlockMinMaxWidth();
+ calcBlocminMaxWidth();
if(m_maxWidth < m_minWidth) m_maxWidth = m_minWidth;
if (isTableCell()) {
Length w = static_cast<RenderTableCell*>(this)->styleOrColWidth();
if (w.isFixed() && w.value() > 0)
- m_maxWidth = kMax(m_minWidth, calcContentBoxWidth(w.value()));
+ m_maxWidth = max(m_minWidth, calcContentBoxWidth(w.value()));
} else if (style()->width().isFixed() && style()->width().value() > 0)
m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxWidth = kMax(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minWidth = kMax(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxWidth = max(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_minWidth = max(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
}
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxWidth = kMin(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minWidth = kMin(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxWidth = min(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_minWidth = min(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
}
int toAdd = 0;
if (prevFloat &&
((prevFloat->style()->floating() == FLEFT && (child->style()->clear() & CLEFT)) ||
(prevFloat->style()->floating() == FRIGHT && (child->style()->clear() & CRIGHT)))) {
- m_maxWidth = kMax(inlineMax, m_maxWidth);
+ m_maxWidth = max(inlineMax, m_maxWidth);
inlineMax = 0;
}
prevFloat = child;
if (style()->collapseWhiteSpace())
stripTrailingSpace(inlineMax, inlineMin, trailingSpaceChild);
- m_minWidth = kMax(inlineMin, m_minWidth);
- m_maxWidth = kMax(inlineMax, m_maxWidth);
+ m_minWidth = max(inlineMin, m_minWidth);
+ m_maxWidth = max(inlineMax, m_maxWidth);
}
// Use a very large value (in effect infinite).
#define BLOCK_MAX_WIDTH 15000
-void RenderBlock::calcBlockMinMaxWidth()
+void RenderBlock::calcBlocminMaxWidth()
{
bool nowrap = style()->whiteSpace() == NOWRAP;
if (child->isFloating() || child->avoidsFloats()) {
int floatTotalWidth = floatLeftWidth + floatRightWidth;
if (child->style()->clear() & CLEFT) {
- m_maxWidth = kMax(floatTotalWidth, m_maxWidth);
+ m_maxWidth = max(floatTotalWidth, m_maxWidth);
floatLeftWidth = 0;
}
if (child->style()->clear() & CRIGHT) {
- m_maxWidth = kMax(floatTotalWidth, m_maxWidth);
+ m_maxWidth = max(floatTotalWidth, m_maxWidth);
floatRightWidth = 0;
}
}
// Determine a left and right max value based off whether or not the floats can fit in the
// margins of the object. For negative margins, we will attempt to overlap the float if the negative margin
// is smaller than the float width.
- int maxLeft = marginLeft > 0 ? kMax(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft;
- int maxRight = marginRight > 0 ? kMax(floatRightWidth, marginRight) : floatRightWidth + marginRight;
+ int maxLeft = marginLeft > 0 ? max(floatLeftWidth, marginLeft) : floatLeftWidth + marginLeft;
+ int maxRight = marginRight > 0 ? max(floatRightWidth, marginRight) : floatRightWidth + marginRight;
w = child->maxWidth() + maxLeft + maxRight;
- w = kMax(w, floatLeftWidth + floatRightWidth);
+ w = max(w, floatLeftWidth + floatRightWidth);
}
else
- m_maxWidth = kMax(floatLeftWidth + floatRightWidth, m_maxWidth);
+ m_maxWidth = max(floatLeftWidth + floatRightWidth, m_maxWidth);
floatLeftWidth = floatRightWidth = 0;
}
}
// Always make sure these values are non-negative.
- m_minWidth = kMax(0, m_minWidth);
- m_maxWidth = kMax(0, m_maxWidth);
+ m_minWidth = max(0, m_minWidth);
+ m_maxWidth = max(0, m_maxWidth);
- m_maxWidth = kMax(floatLeftWidth + floatRightWidth, m_maxWidth);
+ m_maxWidth = max(floatLeftWidth + floatRightWidth, m_maxWidth);
}
short RenderBlock::lineHeight(bool b, bool isRootLineBox) const
virtual void calcMinMaxWidth();
void calcInlineMinMaxWidth();
- void calcBlockMinMaxWidth();
+ void calcBlocminMaxWidth();
virtual int getBaselineOfFirstLineBox() const;
virtual int getBaselineOfLastLineBox() const;
#include "RenderTheme.h"
#include <assert.h>
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
int toAdd = borderLeft() + borderRight() + paddingLeft() + paddingRight();
if (style()->boxSizing() == CONTENT_BOX)
return w + toAdd;
- return kMax(w, toAdd);
+ return max(w, toAdd);
}
int RenderBox::calcBorderBoxHeight(int h) const
int toAdd = borderTop() + borderBottom() + paddingTop() + paddingBottom();
if (style()->boxSizing() == CONTENT_BOX)
return h + toAdd;
- return kMax(h, toAdd);
+ return max(h, toAdd);
}
int RenderBox::calcContentBoxWidth(int w) const
{
if (style()->boxSizing() == BORDER_BOX)
w -= (borderLeft() + borderRight() + paddingLeft() + paddingRight());
- return kMax(0, w);
+ return max(0, w);
}
int RenderBox::calcContentBoxHeight(int h) const
{
if (style()->boxSizing() == BORDER_BOX)
h -= (borderTop() + borderBottom() + paddingTop() + paddingBottom());
- return kMax(0, h);
+ return max(0, h);
}
// Hit Testing
int bx = _tx - marginLeft();
int by = _ty - marginTop();
- int bw = kMax(w + marginLeft() + marginRight() + borderLeft() + borderRight(), rw);
- int bh = kMax(h + marginTop() + marginBottom() + borderTop() + borderBottom(), rh);
+ int bw = max(w + marginLeft() + marginRight() + borderLeft() + borderRight(), rw);
+ int bh = max(h + marginTop() + marginBottom() + borderTop() + borderBottom(), rh);
// CSS2 14.2:
// " The background of the box generated by the root element covers the entire canvas."
// hence, paint the background even in the margin areas (unlike for every other element!)
// I just love these little inconsistencies .. :-( (Dirk)
- int my = kMax(by, i.r.y());
+ int my = max(by, i.r.y());
paintBackgrounds(i.p, bgColor, bgLayer, my, i.r.height(), bx, by, bw, bh);
int h = height() + borderTopExtra() + borderBottomExtra();
_ty -= borderTopExtra();
- int my = kMax(_ty, i.r.y());
+ int my = max(_ty, i.r.y());
int mh;
if (_ty < i.r.y())
- mh = kMax(0, h - (i.r.y() - _ty));
+ mh = max(0, h - (i.r.y() - _ty));
else
- mh = kMin(i.r.height(), h);
+ mh = min(i.r.height(), h);
// If we have a native theme appearance, paint that before painting our background.
// The theme will tell us whether or not we should also paint the CSS background.
m_marginRight = mr.calcMinValue(cw);
if (treatAsReplaced) {
m_width = w.calcValue(cw) + borderLeft() + borderRight() + paddingLeft() + paddingRight();
- m_width = kMax(m_width, m_minWidth);
+ m_width = max(m_width, m_minWidth);
}
return;
}
if (cw) width = cw - marginLeft - marginRight;
if (sizesToIntrinsicWidth(widthType)) {
- width = kMax(width, m_minWidth);
- width = kMin(width, m_maxWidth);
+ width = max(width, m_minWidth);
+ width = min(width, m_maxWidth);
}
}
else
bool inHorizontalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
bool stretching = parent()->style()->boxAlign() == BSTRETCH;
bool treatAsReplaced = isReplaced() && !isInlineBlockOrInlineTable() && (!inHorizontalBox || !stretching);
- bool checkMinMaxHeight = false;
+ bool checminMaxHeight = false;
// The parent box is flexing us, so it has increased or decreased our height. We have to
// grab our cached flexible height.
h = Length(calcReplacedHeight(), Fixed);
else {
h = style()->height();
- checkMinMaxHeight = true;
+ checminMaxHeight = true;
}
// Block children of horizontal flexible boxes fill the height of the box.
&& parent()->isStretchingChildren()) {
h = Length(parent()->contentHeight() - marginTop() - marginBottom() -
borderTop() - paddingTop() - borderBottom() - paddingBottom(), Fixed);
- checkMinMaxHeight = false;
+ checminMaxHeight = false;
}
int height;
- if (checkMinMaxHeight) {
+ if (checminMaxHeight) {
height = calcHeightUsing(style()->height());
if (height == -1)
height = m_height;
int maxH = style()->maxHeight().value() == undefinedLength ? height : calcHeightUsing(style()->maxHeight());
if (maxH == -1)
maxH = height;
- height = kMin(maxH, height);
- height = kMax(minH, height);
+ height = min(maxH, height);
+ height = max(minH, height);
}
else
// The only times we don't check min/max height are when a fixed length has
if (style()->overflow() == OMARQUEE && m_layer && m_layer->marquee() &&
m_layer->marquee()->isUnfurlMarquee() && !m_layer->marquee()->isHorizontal()) {
m_layer->marquee()->setEnd(m_height);
- m_height = kMin(m_height, m_layer->marquee()->unfurlPos());
+ m_height = min(m_height, m_layer->marquee()->unfurlPos());
}
// WinIE quirk: The <html> block always fills the entire canvas in quirks mode. The <body> always fills the
int margins = collapsedMarginTop() + collapsedMarginBottom();
int visHeight = canvas()->view()->visibleHeight();
if (isRoot())
- m_height = kMax(m_height, visHeight - margins);
+ m_height = max(m_height, visHeight - margins);
else
- m_height = kMax(m_height, visHeight -
+ m_height = max(m_height, visHeight -
(margins + parent()->marginTop() + parent()->marginBottom() +
parent()->borderTop() + parent()->borderBottom() +
parent()->paddingTop() + parent()->paddingBottom()));
// box model. This is essential for sizing inside
// table cells using percentage heights.
result -= (borderTop() + paddingTop() + borderBottom() + paddingBottom());
- result = kMax(0, result);
+ result = max(0, result);
}
}
return result;
int minW = calcReplacedWidthUsing(MinWidth);
int maxW = style()->maxWidth().value() == undefinedLength ? width : calcReplacedWidthUsing(MaxWidth);
- return kMax(minW, kMin(width, maxW));
+ return max(minW, min(width, maxW));
}
int RenderBox::calcReplacedWidthUsing(WidthType widthType) const
int minH = calcReplacedHeightUsing(MinHeight);
int maxH = style()->maxHeight().value() == undefinedLength ? height : calcReplacedHeightUsing(MaxHeight);
- return kMax(minH, kMin(height, maxH));
+ return max(minH, min(height, maxH));
}
int RenderBox::calcReplacedHeightUsing(HeightType heightType) const
if (l == AUTO && w == AUTO && r != AUTO) {
// From section 10.3.7 of the CSS2.1 specification.
// "The shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width)."
- w = kMin(kMax(m_minWidth - pab, cw - (r + ml + mr + pab)), m_maxWidth - pab);
+ w = min(max(m_minWidth - pab, cw - (r + ml + mr + pab)), m_maxWidth - pab);
l = cw - (r + w + ml + mr + pab);
}
else
else if (l != AUTO && w == AUTO && r == AUTO) {
// From section 10.3.7 of the CSS2.1 specification.
// "The shrink-to-fit width is: min(max(preferred minimum width, available width), preferred width)."
- w = kMin(kMax(m_minWidth - pab, cw - (l + ml + mr + pab)), m_maxWidth - pab);
+ w = min(max(m_minWidth - pab, cw - (l + ml + mr + pab)), m_maxWidth - pab);
r = cw - (l + w + ml + mr + pab);
}
else
// Do not allow the height to be negative. This can happen when someone specifies both top and bottom
// but the containing block height is less than top, e.g., top:20px, bottom:0, containing block height 16.
- ourHeight = kMax(0, ourHeight);
+ ourHeight = max(0, ourHeight);
h = ourHeight;
y = t + mt + cb->borderTop();
// ### we could maybe do the call below better and only pass true if the docsize changed.
layoutPositionedObjects( true );
- layer()->setHeight(kMax(doch, m_height));
- layer()->setWidth(kMax(docw, m_width));
+ layer()->setHeight(max(doch, m_height));
+ layer()->setWidth(max(docw, m_width));
setNeedsLayout(false);
}
#include "config.h"
#include "RenderFlexibleBox.h"
-using namespace WebCore;
+using namespace std;
namespace WebCore {
m_minWidth = m_maxWidth = calcContentBoxWidth(style()->width().value());
if (style()->minWidth().isFixed() && style()->minWidth().value() > 0) {
- m_maxWidth = kMax(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
- m_minWidth = kMax(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_maxWidth = max(m_maxWidth, calcContentBoxWidth(style()->minWidth().value()));
+ m_minWidth = max(m_minWidth, calcContentBoxWidth(style()->minWidth().value()));
}
if (style()->maxWidth().isFixed() && style()->maxWidth().value() != undefinedLength) {
- m_maxWidth = kMin(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
- m_minWidth = kMin(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_maxWidth = min(m_maxWidth, calcContentBoxWidth(style()->maxWidth().value()));
+ m_minWidth = min(m_minWidth, calcContentBoxWidth(style()->maxWidth().value()));
}
int toAdd = borderLeft() + borderRight() + paddingLeft() + paddingRight();
int descent = (child->marginTop() + child->height() + child->marginBottom()) - ascent;
// Update our maximum ascent.
- maxAscent = kMax(maxAscent, ascent);
+ maxAscent = max(maxAscent, ascent);
// Update our maximum descent.
- maxDescent = kMax(maxDescent, descent);
+ maxDescent = max(maxDescent, descent);
// Now update our height.
- m_height = kMax(yPos + maxAscent + maxDescent, m_height);
+ m_height = max(yPos + maxAscent + maxDescent, m_height);
}
else
- m_height = kMax(m_height, yPos + child->marginTop() + child->height() + child->marginBottom());
+ m_height = max(m_height, yPos + child->marginTop() + child->height() + child->marginBottom());
child = iterator.next();
}
int childY = yPos;
switch (style()->boxAlign()) {
case BCENTER:
- childY += child->marginTop() + kMax(0, (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2);
+ childY += child->marginTop() + max(0, (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2);
break;
case BBASELINE: {
int ascent = child->marginTop() + child->getBaselineOfFirstLineBox();
}
placeChild(child, xPos, childY);
- m_overflowHeight = kMax(m_overflowHeight, childY + child->overflowHeight(false));
- m_overflowTop = kMin(m_overflowTop, child->yPos() + child->overflowTop(false));
+ m_overflowHeight = max(m_overflowHeight, childY + child->overflowHeight(false));
+ m_overflowTop = min(m_overflowTop, child->yPos() + child->overflowTop(false));
xPos += child->width() + child->marginRight();
int allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
int projectedFlex = (allowedFlex == INT_MAX) ? allowedFlex : (int)(allowedFlex * (totalFlex / child->style()->boxFlex()));
- spaceAvailableThisPass = expanding ? kMin(spaceAvailableThisPass, projectedFlex) : kMax(spaceAvailableThisPass, projectedFlex);
+ spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
child = iterator.next();
}
}
if (child) {
- m_overflowLeft = kMin(child->xPos() + child->overflowLeft(false), m_overflowLeft);
+ m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
RenderObject* lastChild = child;
while ((child = iterator.next())) {
if (!child->isPositioned())
lastChild = child;
}
- m_overflowWidth = kMax(lastChild->xPos() + lastChild->overflowWidth(false), m_overflowWidth);
+ m_overflowWidth = max(lastChild->xPos() + lastChild->overflowWidth(false), m_overflowWidth);
}
// So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
}
child->layoutIfNeeded();
if (child->style()->height().isAuto() && child->isBlockFlow())
- maxLineCount = kMax(maxLineCount, static_cast<RenderBlock*>(child)->lineCount());
+ maxLineCount = max(maxLineCount, static_cast<RenderBlock*>(child)->lineCount());
}
child = iterator.next();
}
switch (style()->boxAlign()) {
case BCENTER:
case BBASELINE: // Baseline just maps to center for vertical boxes
- childX += child->marginLeft() + kMax(0, (contentWidth() - (child->width() + child->marginLeft() + child->marginRight()))/2);
+ childX += child->marginLeft() + max(0, (contentWidth() - (child->width() + child->marginLeft() + child->marginRight()))/2);
break;
case BEND:
if (style()->direction() == RTL)
m_height += child->height() + child->marginBottom();
// See if this child has made our overflow need to grow.
- m_overflowWidth = kMax(child->xPos() + child->overflowWidth(false), m_overflowWidth);
- m_overflowLeft = kMin(child->xPos() + child->overflowLeft(false), m_overflowLeft);
+ m_overflowWidth = max(child->xPos() + child->overflowWidth(false), m_overflowWidth);
+ m_overflowLeft = min(child->xPos() + child->overflowLeft(false), m_overflowLeft);
child = iterator.next();
}
int allowedFlex = allowedChildFlex(child, expanding, i);
if (allowedFlex) {
int projectedFlex = (allowedFlex == INT_MAX) ? allowedFlex : (int)(allowedFlex * (totalFlex / child->style()->boxFlex()));
- spaceAvailableThisPass = expanding ? kMin(spaceAvailableThisPass, projectedFlex) : kMax(spaceAvailableThisPass, projectedFlex);
+ spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
}
child = iterator.next();
}
}
if (child) {
- m_overflowTop = kMin(child->yPos() + child->overflowTop(false), m_overflowTop);
+ m_overflowTop = min(child->yPos() + child->overflowTop(false), m_overflowTop);
RenderObject* lastChild = child;
while ((child = iterator.next())) {
if (!child->isPositioned())
lastChild = child;
}
- m_overflowHeight = kMax(lastChild->yPos() + lastChild->overflowHeight(false), m_overflowHeight);
+ m_overflowHeight = max(lastChild->yPos() + lastChild->overflowHeight(false), m_overflowHeight);
}
// So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
maxW = child->minWidth();
if (maxW == INT_MAX)
return maxW;
- return kMax(0, maxW - w);
+ return max(0, maxW - w);
} else {
// FIXME: For now just handle fixed values.
int maxH = INT_MAX;
maxH = child->style()->maxHeight().value();
if (maxH == INT_MAX)
return maxH;
- return kMax(0, maxH - h);
+ return max(0, maxH - h);
}
}
else if (child->style()->minWidth().type() == MinIntrinsic)
minW = child->minWidth();
- int allowedShrinkage = kMin(0, minW - w);
+ int allowedShrinkage = min(0, minW - w);
return allowedShrinkage;
} else {
if (child->style()->minHeight().isFixed()) {
int minH = child->style()->minHeight().value();
int h = child->contentHeight();
- int allowedShrinkage = kMin(0, minH - h);
+ int allowedShrinkage = min(0, minH - h);
return allowedShrinkage;
}
}
return "RenderFlexibleBox";
}
-
} // namespace WebCore
-
#include "RenderCanvas.h"
#include "RenderInline.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
}
}
- int top = kMin(curr->root()->topOverflow(), curr->root()->selectionTop()) - maximalOutlineSize(info.phase);
+ int top = min(curr->root()->topOverflow(), curr->root()->selectionTop()) - maximalOutlineSize(info.phase);
int bottom = curr->root()->bottomOverflow() + maximalOutlineSize(info.phase);
h = bottom - top;
yPos = _ty + top;
for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
int lp = c->yPos() + c->lowestPosition(false);
- bottom = kMax(bottom, lp);
+ bottom = max(bottom, lp);
}
}
for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
int rp = c->xPos() + c->rightmostPosition(false);
- right = kMax(right, rp);
+ right = max(right, rp);
}
}
for (RenderObject *c = firstChild(); c; c = c->nextSibling()) {
if (!c->isFloatingOrPositioned() && !c->isText() && !c->isInlineFlow()) {
int lp = c->xPos() + c->leftmostPosition(false);
- left = kMin(left, lp);
+ left = min(left, lp);
}
}
drawBorder(p,
l - ow,
t - ow,
- kMin(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())),
+ min(r+ow, (lastline.isEmpty() ? 1000000 : tx + lastline.x())),
t ,
BSTop, oc, style()->color(), os,
ow,
if (lastline.right() < thisline.right())
drawBorder(p,
- kMax(lastline.isEmpty() ? -1000000 : tx + lastline.right(), l - ow),
+ max(lastline.isEmpty() ? -1000000 : tx + lastline.right(), l - ow),
t - ow,
r + ow,
t ,
drawBorder(p,
l - ow,
b,
- kMin(r + ow, !nextline.isEmpty() ? tx + nextline.x() + 1 : 1000000),
+ min(r + ow, !nextline.isEmpty() ? tx + nextline.x() + 1 : 1000000),
b + ow,
BSBottom, oc, style()->color(), os,
ow,
if (nextline.right() < thisline.right())
drawBorder(p,
- kMax(!nextline.isEmpty() ? tx + nextline.right() : -1000000, l - ow),
+ max(!nextline.isEmpty() ? tx + nextline.right() : -1000000, l - ow),
b,
r + ow,
b + ow,
#include "HTMLNames.h"
#include "RenderCanvas.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
// we have an alt and the user meant it (its not a text we invented)
if (!m_altText.isEmpty()) {
const Font& font = style()->font();
- iw = kMax(iw, kMin(font.width(m_altText.deprecatedString()), 1024));
- ih = kMax(ih, kMin(font.height(), 256));
+ iw = max(iw, min(font.width(m_altText.deprecatedString()), 1024));
+ ih = max(ih, min(font.height(), 256));
}
if (iw != intrinsicWidth()) {
int minW = calcReplacedWidthUsing(MinWidth);
int maxW = style()->maxWidth().value() == undefinedLength ? width : calcReplacedWidthUsing(MaxWidth);
- return kMax(minW, kMin(width, maxW));
+ return max(minW, min(width, maxW));
}
int RenderImage::calcReplacedHeight() const
int minH = calcReplacedHeightUsing(MinHeight);
int maxH = style()->maxHeight().value() == undefinedLength ? height : calcReplacedHeightUsing(MaxHeight);
- return kMax(minH, kMin(height, maxH));
+ return max(minH, min(height, maxH));
}
int RenderImage::calcAspectRatioWidth() const
#define MIN_INTERSECT_FOR_REVEAL 32
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
xOffset = r.x() - xPos();
yOffset = r.y() - yPos();
// Adjust offsets if they're outside of the allowable range.
- xOffset = kMax(0, kMin(scrollWidth() - width(), xOffset));
- yOffset = kMax(0, kMin(scrollHeight() - height(), yOffset));
+ xOffset = max(0, min(scrollWidth() - width(), xOffset));
+ yOffset = max(0, min(scrollHeight() - height(), yOffset));
if (xOffset != scrollXOffset() || yOffset != scrollYOffset()) {
int diffX = scrollXOffset();
xOffset = r.x();
yOffset = r.y();
// Adjust offsets if they're outside of the allowable range.
- xOffset = kMax(0, kMin(view->contentsWidth(), xOffset));
- yOffset = kMax(0, kMin(view->contentsHeight(), yOffset));
+ xOffset = max(0, min(view->contentsWidth(), xOffset));
+ yOffset = max(0, min(view->contentsHeight(), yOffset));
if (m_object->document() && m_object->document()->ownerElement() && m_object->document()->ownerElement()->renderer()) {
view->setContentsPos(xOffset, yOffset);
int clientWidth = m_object->clientWidth();
int clientHeight = m_object->clientHeight();
- m_scrollLeftOverflow = ltr ? 0 : kMin(0, m_object->leftmostPosition(true, false) - m_object->borderLeft());
+ m_scrollLeftOverflow = ltr ? 0 : min(0, m_object->leftmostPosition(true, false) - m_object->borderLeft());
int rightPos = ltr ?
m_object->rightmostPosition(true, false) - m_object->borderLeft() :
clientWidth - m_scrollLeftOverflow;
int bottomPos = m_object->lowestPosition(true, false) - m_object->borderTop();
- m_scrollWidth = kMax(rightPos, clientWidth);
- m_scrollHeight = kMax(bottomPos, clientHeight);
+ m_scrollWidth = max(rightPos, clientWidth);
+ m_scrollHeight = max(bottomPos, clientHeight);
m_scrollOriginX = ltr ? 0 : m_scrollWidth - clientWidth;
if (m_object->style()->overflow() != OMARQUEE) {
// Layout may cause us to be in an invalid scroll position. In this case we need
// to pull our scroll offsets back to the max (or push them up to the min).
- int newX = kMax(0, kMin(scrollXOffset(), scrollWidth() - m_object->clientWidth()));
- int newY = kMax(0, kMin(m_scrollY, scrollHeight() - m_object->clientHeight()));
+ int newX = max(0, min(scrollXOffset(), scrollWidth() - m_object->clientWidth()));
+ int newY = max(0, min(m_scrollY, scrollHeight() - m_object->clientHeight()));
if (newX != scrollXOffset() || newY != m_scrollY)
scrollToOffset(newX, newY);
// FIXME: At this point a scroll event fired, which could have deleted this layer.
int bottom = inlineFlow->lastLineBox()->root()->bottomOverflow();
int left = firstBox->xPos();
for (InlineRunBox* curr = firstBox->nextLineBox(); curr; curr = curr->nextLineBox())
- left = kMin(left, curr->xPos());
+ left = min(left, curr->xPos());
result = IntRect(m_x + left, m_y + (top - renderer()->yPos()), width(), bottom - top);
} else if (renderer()->isTableRow()) {
// Our bounding box is just the union of all of our cells' border/overflow rects.
WebCore::Node* elt = m_layer->renderer()->element();
if (elt && elt->hasTagName(marqueeTag)) {
HTMLMarqueeElement* marqueeElt = static_cast<HTMLMarqueeElement*>(elt);
- result = kMax(result, marqueeElt->minimumDelay());
+ result = max(result, marqueeElt->minimumDelay());
}
return result;
}
}
if (dir == MRIGHT) {
if (stopAtContentEdge)
- return kMax(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
+ return max(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
else
return ltr ? contentWidth : clientWidth;
}
else {
if (stopAtContentEdge)
- return kMin(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
+ return min(0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
else
return ltr ? -clientWidth : -contentWidth;
}
int clientHeight = m_layer->renderer()->clientHeight();
if (dir == MUP) {
if (stopAtContentEdge)
- return kMin(contentHeight - clientHeight, 0);
+ return min(contentHeight - clientHeight, 0);
else
return -clientHeight;
}
else {
if (stopAtContentEdge)
- return kMax(contentHeight - clientHeight, 0);
+ return max(contentHeight - clientHeight, 0);
else
return contentHeight;
}
bool positive = range > 0;
int clientSize = isUnfurlMarquee() ? abs(range) :
(isHorizontal() ? m_layer->renderer()->clientWidth() : m_layer->renderer()->clientHeight());
- int increment = kMax(1, abs(m_layer->renderer()->style()->marqueeIncrement().calcValue(clientSize)));
+ int increment = max(1, abs(m_layer->renderer()->style()->marqueeIncrement().calcValue(clientSize)));
int currentPos = isUnfurlMarquee() ? m_unfurlPos :
(isHorizontal() ? m_layer->scrollXOffset() : m_layer->scrollYOffset());
newPos = currentPos + (addIncrement ? increment : -increment);
if (positive)
- newPos = kMin(newPos, endPoint);
+ newPos = min(newPos, endPoint);
else
- newPos = kMax(newPos, endPoint);
+ newPos = max(newPos, endPoint);
}
if (newPos == endPoint) {
#include "KWQWMatrix.h"
#include "KWQTextStream.h"
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
switch(s)
{
case BSTop:
- drawBorder(p, x1+kMax((-adjbw1*2+1)/3,0), y1 , x2-kMax((-adjbw2*2+1)/3,0), y1 + third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
- drawBorder(p, x1+kMax(( adjbw1*2+1)/3,0), y2 - third, x2-kMax(( adjbw2*2+1)/3,0), y2 , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1+max((-adjbw1*2+1)/3,0), y1 , x2-max((-adjbw2*2+1)/3,0), y1 + third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1+max(( adjbw1*2+1)/3,0), y2 - third, x2-max(( adjbw2*2+1)/3,0), y2 , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
break;
case BSLeft:
- drawBorder(p, x1 , y1+kMax((-adjbw1*2+1)/3,0), x1+third, y2-kMax((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
- drawBorder(p, x2 - third, y1+kMax(( adjbw1*2+1)/3,0), x2 , y2-kMax(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1 , y1+max((-adjbw1*2+1)/3,0), x1+third, y2-max((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x2 - third, y1+max(( adjbw1*2+1)/3,0), x2 , y2-max(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
break;
case BSBottom:
- drawBorder(p, x1+kMax(( adjbw1*2+1)/3,0), y1 , x2-kMax(( adjbw2*2+1)/3,0), y1+third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
- drawBorder(p, x1+kMax((-adjbw1*2+1)/3,0), y2-third, x2-kMax((-adjbw2*2+1)/3,0), y2 , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1+max(( adjbw1*2+1)/3,0), y1 , x2-max(( adjbw2*2+1)/3,0), y1+third, s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1+max((-adjbw1*2+1)/3,0), y2-third, x2-max((-adjbw2*2+1)/3,0), y2 , s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
break;
case BSRight:
- drawBorder(p, x1 , y1+kMax(( adjbw1*2+1)/3,0), x1+third, y2-kMax(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
- drawBorder(p, x2-third, y1+kMax((-adjbw1*2+1)/3,0), x2 , y2-kMax((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x1 , y1+max(( adjbw1*2+1)/3,0), x1+third, y2-max(( adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
+ drawBorder(p, x2-third, y1+max((-adjbw1*2+1)/3,0), x2 , y2-max((-adjbw2*2+1)/3,0), s, c, textcolor, SOLID, adjbw1bigthird, adjbw2bigthird);
break;
default:
break;
switch (s)
{
case BSTop:
- drawBorder(p, x1+kMax(-adjbw1 ,0)/2, y1 , x2-kMax(-adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
- drawBorder(p, x1+kMax( adjbw1+1,0)/2, (y1+y2+1)/2, x2-kMax( adjbw2+1,0)/2, y2 , s, c, textcolor, s2, adjbw1/2, adjbw2/2);
+ drawBorder(p, x1+max(-adjbw1 ,0)/2, y1 , x2-max(-adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+ drawBorder(p, x1+max( adjbw1+1,0)/2, (y1+y2+1)/2, x2-max( adjbw2+1,0)/2, y2 , s, c, textcolor, s2, adjbw1/2, adjbw2/2);
break;
case BSLeft:
- drawBorder(p, x1 , y1+kMax(-adjbw1 ,0)/2, (x1+x2+1)/2, y2-kMax(-adjbw2,0)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
- drawBorder(p, (x1+x2+1)/2, y1+kMax( adjbw1+1,0)/2, x2 , y2-kMax( adjbw2+1,0)/2, s, c, textcolor, s2, adjbw1/2, adjbw2/2);
+ drawBorder(p, x1 , y1+max(-adjbw1 ,0)/2, (x1+x2+1)/2, y2-max(-adjbw2,0)/2, s, c, textcolor, s1, adjbw1bighalf, adjbw2bighalf);
+ drawBorder(p, (x1+x2+1)/2, y1+max( adjbw1+1,0)/2, x2 , y2-max( adjbw2+1,0)/2, s, c, textcolor, s2, adjbw1/2, adjbw2/2);
break;
case BSBottom:
- drawBorder(p, x1+kMax( adjbw1 ,0)/2, y1 , x2-kMax( adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
- drawBorder(p, x1+kMax(-adjbw1+1,0)/2, (y1+y2+1)/2, x2-kMax(-adjbw2+1,0)/2, y2 , s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+ drawBorder(p, x1+max( adjbw1 ,0)/2, y1 , x2-max( adjbw2,0)/2, (y1+y2+1)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
+ drawBorder(p, x1+max(-adjbw1+1,0)/2, (y1+y2+1)/2, x2-max(-adjbw2+1,0)/2, y2 , s, c, textcolor, s1, adjbw1/2, adjbw2/2);
break;
case BSRight:
- drawBorder(p, x1 , y1+kMax( adjbw1 ,0)/2, (x1+x2+1)/2, y2-kMax( adjbw2,0)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
- drawBorder(p, (x1+x2+1)/2, y1+kMax(-adjbw1+1,0)/2, x2 , y2-kMax(-adjbw2+1,0)/2, s, c, textcolor, s1, adjbw1/2, adjbw2/2);
+ drawBorder(p, x1 , y1+max( adjbw1 ,0)/2, (x1+x2+1)/2, y2-max( adjbw2,0)/2, s, c, textcolor, s2, adjbw1bighalf, adjbw2bighalf);
+ drawBorder(p, (x1+x2+1)/2, y1+max(-adjbw1+1,0)/2, x2 , y2-max(-adjbw2+1,0)/2, s, c, textcolor, s1, adjbw1/2, adjbw2/2);
break;
}
break;
switch(s) {
case BSTop:
quad.setPoints(4,
- x1+kMax(-adjbw1,0), y1,
- x1+kMax( adjbw1,0), y2,
- x2-kMax( adjbw2,0), y2,
- x2-kMax(-adjbw2,0), y1);
+ x1+max(-adjbw1,0), y1,
+ x1+max( adjbw1,0), y2,
+ x2-max( adjbw2,0), y2,
+ x2-max(-adjbw2,0), y1);
break;
case BSBottom:
quad.setPoints(4,
- x1+kMax( adjbw1,0), y1,
- x1+kMax(-adjbw1,0), y2,
- x2-kMax(-adjbw2,0), y2,
- x2-kMax( adjbw2,0), y1);
+ x1+max( adjbw1,0), y1,
+ x1+max(-adjbw1,0), y2,
+ x2-max(-adjbw2,0), y2,
+ x2-max( adjbw2,0), y1);
break;
case BSLeft:
quad.setPoints(4,
- x1, y1+kMax(-adjbw1,0),
- x1, y2-kMax(-adjbw2,0),
- x2, y2-kMax( adjbw2,0),
- x2, y1+kMax( adjbw1,0));
+ x1, y1+max(-adjbw1,0),
+ x1, y2-max(-adjbw2,0),
+ x2, y2-max( adjbw2,0),
+ x2, y1+max( adjbw1,0));
break;
case BSRight:
quad.setPoints(4,
- x1, y1+kMax( adjbw1,0),
- x1, y2-kMax( adjbw2,0),
- x2, y2-kMax(-adjbw2,0),
- x2, y1+kMax(-adjbw1,0));
+ x1, y1+max( adjbw1,0),
+ x1, y2-max( adjbw2,0),
+ x2, y2-max(-adjbw2,0),
+ x2, y1+max(-adjbw1,0));
break;
}
p->drawConvexPolygon(quad);
int imageWidth = borderImage->image()->width();
int imageHeight = borderImage->image()->height();
- int topSlice = kMin(imageHeight, style->borderImage().m_slices.top.calcValue(borderImage->image()->height()));
- int bottomSlice = kMin(imageHeight, style->borderImage().m_slices.bottom.calcValue(borderImage->image()->height()));
- int leftSlice = kMin(imageWidth, style->borderImage().m_slices.left.calcValue(borderImage->image()->width()));
- int rightSlice = kMin(imageWidth, style->borderImage().m_slices.right.calcValue(borderImage->image()->width()));
+ int topSlice = min(imageHeight, style->borderImage().m_slices.top.calcValue(borderImage->image()->height()));
+ int bottomSlice = min(imageHeight, style->borderImage().m_slices.bottom.calcValue(borderImage->image()->height()));
+ int leftSlice = min(imageWidth, style->borderImage().m_slices.left.calcValue(borderImage->image()->width()));
+ int rightSlice = min(imageWidth, style->borderImage().m_slices.right.calcValue(borderImage->image()->width()));
EBorderImageRule hRule = style->borderImage().horizontalRule();
EBorderImageRule vRule = style->borderImage().verticalRule();
IntSize bottomRight = style->borderBottomRightRadius();
if (style->hasBorderRadius()) {
- int requiredWidth = kMax(topLeft.width() + topRight.width(), bottomLeft.width() + bottomRight.width());
- int requiredHeight = kMax(topLeft.height() + bottomLeft.height(), topRight.height() + bottomRight.height());
+ int requiredWidth = max(topLeft.width() + topRight.width(), bottomLeft.width() + bottomRight.width());
+ int requiredHeight = max(topLeft.height() + bottomLeft.height(), topRight.height() + bottomRight.height());
render_radii = (requiredWidth <= w && requiredHeight <= h);
}
int ow = style() ? style()->outlineSize() : 0;
int width = abs(newBounds.width() - oldBounds.width());
if (width)
- c->repaintViewRectangle(IntRect(kMin(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight() - ow,
+ c->repaintViewRectangle(IntRect(min(newBounds.x() + newBounds.width(), oldBounds.x() + oldBounds.width()) - borderRight() - ow,
newBounds.y(),
width + borderRight() + ow,
- kMax(newBounds.height(), oldBounds.height())));
+ max(newBounds.height(), oldBounds.height())));
int height = abs(newBounds.height() - oldBounds.height());
if (height)
c->repaintViewRectangle(IntRect(newBounds.x(),
- kMin(newBounds.bottom(), oldBounds.bottom()) - borderBottom() - ow,
- kMax(newBounds.width(), oldBounds.width()),
+ min(newBounds.bottom(), oldBounds.bottom()) - borderBottom() - ow,
+ max(newBounds.width(), oldBounds.width()),
height + borderBottom() + ow));
return false;
}
#include "HTMLNames.h"
#include "KWQTextStream.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
marginTotal += style()->marginRight().calcValue(availableWidth);
// Subtract out our margins to get the available content width.
- int availContentWidth = kMax(0, availableWidth - marginTotal);
+ int availContentWidth = max(0, availableWidth - marginTotal);
// Ensure we aren't bigger than our max width or smaller than our min width.
- m_width = kMin(availContentWidth, m_maxWidth);
+ m_width = min(availContentWidth, m_maxWidth);
}
- m_width = kMax(m_width, m_minWidth);
+ m_width = max(m_width, m_minWidth);
// Finally, with our true width determined, compute our margins for real.
m_marginRight = 0;
th = h.value() - (bpTop + bpBottom); // Tables size as though CSS height includes border/padding.
else if (h.isPercent())
th = calcPercentageHeight(h);
- th = kMax(0, th);
+ th = max(0, th);
// layout rows
if (th > calculatedHeight) {
if (checkForRepaint)
repaintAfterLayoutIfNeeded(oldBounds, oldFullBounds);
- m_overflowHeight = kMax(m_overflowHeight, m_height);
- m_overflowWidth = kMax(m_overflowWidth, m_width);
+ m_overflowHeight = max(m_overflowHeight, m_height);
+ m_overflowWidth = max(m_overflowWidth, m_width);
setNeedsLayout(false);
}
_ty += captionHeight;
}
- int my = kMax(_ty, i.r.y());
+ int my = max(_ty, i.r.y());
int mh;
if (_ty < i.r.y())
- mh= kMax(0, h - (i.r.y() - _ty));
+ mh= max(0, h - (i.r.y() - _ty));
else
- mh = kMin(i.r.height(), h);
+ mh = min(i.r.height(), h);
paintBackground(i.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, _tx, _ty, w, h);
#include "HTMLNames.h"
#include "KWQTextStream.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
int h = height() + borderTopExtra() + borderBottomExtra();
_ty -= borderTopExtra();
- int my = kMax(_ty, i.r.y());
- int end = kMin(i.r.bottom(), _ty + h);
+ int my = max(_ty, i.r.y());
+ int end = min(i.r.bottom(), _ty + h);
int mh = end - my;
Color c = backgroundObject->style()->backgroundColor();
#include "HTMLNames.h"
#include "KWQTextStream.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
int rh = rowPos[1] - rowPos[0];
for (int r = 0; r < totalRows; r++) {
if (totalPercent > 0 && grid[r].height.isPercent()) {
- int toAdd = kMin(dh, (totalHeight * grid[r].height.value() / 100) - rh);
+ int toAdd = min(dh, (totalHeight * grid[r].height.value() / 100) - rh);
// If toAdd is negative, then we don't want to shrink the row (this bug
// affected Outlook Web Access).
- toAdd = kMax(0, toAdd);
+ toAdd = max(0, toAdd);
add += toAdd;
dh -= toAdd;
totalPercent -= grid[r].height.value();
}
}
if (cellChildrenFlex) {
- cell->setOverrideSize(kMax(0,
+ cell->setOverrideSize(max(0,
rHeight - cell->borderTop() - cell->paddingTop() -
cell->borderBottom() - cell->paddingBottom()));
cell->layoutIfNeeded();
for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
if (cell->isTableCell()) {
int bp = cell->yPos() + cell->lowestPosition(false);
- bottom = kMax(bottom, bp);
+ bottom = max(bottom, bp);
}
}
for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
if (cell->isTableCell()) {
int rp = cell->xPos() + cell->rightmostPosition(false);
- right = kMax(right, rp);
+ right = max(right, rp);
}
}
for (RenderObject *cell = row->firstChild(); cell; cell = cell->nextSibling())
if (cell->isTableCell()) {
int lp = cell->xPos() + cell->leftmostPosition(false);
- left = kMin(left, lp);
+ left = min(left, lp);
}
}
#include <kxmlcore/AlwaysInline.h>
#include <unicode/ubrk.h>
+using namespace std;
+
namespace WebCore {
UBreakIterator* characterBreakIterator(const StringImpl* i)
RenderBlock *cb = containingBlock();
int availableWidth = cb->lineWidth(top);
if (style()->autoWrap())
- left = kMin(left, absx + box->m_x + availableWidth - 1);
+ left = min(left, absx + box->m_x + availableWidth - 1);
return IntRect(left, top, 1, height);
}
if (needsWordSpacing && len > 1)
currMaxWidth += wordSpacing;
- m_minWidth = kMax(currMinWidth, m_minWidth);
- m_maxWidth = kMax(currMaxWidth, m_maxWidth);
+ m_minWidth = max(currMinWidth, m_minWidth);
+ m_maxWidth = max(currMaxWidth, m_maxWidth);
if (!style()->autoWrap())
m_minWidth = m_maxWidth;
if (!m_firstTextBox) return 0;
int retval=6666666;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- retval = kMin(retval, (int)box->m_x);
+ retval = min(retval, (int)box->m_x);
return retval;
}
maxx = s->m_x + s->m_width;
}
- return kMax(0, maxx-minx);
+ return max(0, maxx-minx);
}
IntRect RenderText::getAbsoluteRepaintRect()
return 0;
int minOffset = box->m_start;
for (box = box->nextTextBox(); box; box = box->nextTextBox())
- minOffset = kMin(minOffset, box->m_start);
+ minOffset = min(minOffset, box->m_start);
return minOffset;
}
return str->length();
int maxOffset = box->m_start + box->m_len;
for (box = box->prevTextBox(); box; box = box->prevTextBox())
- maxOffset = kMax(maxOffset,box->m_start + box->m_len);
+ maxOffset = max(maxOffset,box->m_start + box->m_len);
return maxOffset;
}
#include "break_lines.h"
#include <kxmlcore/AlwaysInline.h>
+using namespace std;
+
namespace WebCore {
// an iterator which traverses all the objects within a block
RenderStyle *style = r->obj->style();
if (style->autoWrap() && style->breakOnlyAfterWhiteSpace()) {
// shrink the box as needed to keep the line from overflowing the available width
- textWidth = kMin(effectiveWidth, availableWidth - totWidth);
+ textWidth = min(effectiveWidth, availableWidth - totWidth);
}
}
r->box->setWidth(textWidth);
if (startLine) {
useRepaintRect = true;
startLineBottom = startLine->bottomOverflow();
- repaintRect.setY(kMin(m_height, startLine->topOverflow()));
+ repaintRect.setY(min(m_height, startLine->topOverflow()));
RenderArena* arena = renderArena();
RootInlineBox* box = startLine;
while (box) {
if (endLineMatched) {
// Note our current y-position for correct repainting when no lines move. If no lines move, we still have to
// repaint up to the maximum of the bottom overflow of the old start line or the bottom overflow of the new last line.
- int currYPos = kMax(startLineBottom, m_height);
+ int currYPos = max(startLineBottom, m_height);
if (lastRootBox())
- currYPos = kMax(currYPos, lastRootBox()->bottomOverflow());
+ currYPos = max(currYPos, lastRootBox()->bottomOverflow());
// Attach all the remaining lines, and then adjust their y-positions as needed.
for (RootInlineBox* line = endLine; line; line = line->nextRootBox())
line->adjustPosition(0, delta);
}
m_height = lastRootBox()->blockHeight();
- m_overflowHeight = kMax(m_height, m_overflowHeight);
+ m_overflowHeight = max(m_height, m_overflowHeight);
int bottomOfLine = lastRootBox()->bottomOverflow();
if (bottomOfLine > m_height && bottomOfLine > m_overflowHeight)
m_overflowHeight = bottomOfLine;
if (delta)
- repaintRect.setHeight(kMax(m_overflowHeight-delta, m_overflowHeight) - repaintRect.y());
+ repaintRect.setHeight(max(m_overflowHeight-delta, m_overflowHeight) - repaintRect.y());
else
repaintRect.setHeight(currYPos - repaintRect.y());
}
else {
// Delete all the remaining lines.
- m_overflowHeight = kMax(m_height, m_overflowHeight);
+ m_overflowHeight = max(m_height, m_overflowHeight);
InlineRunBox* line = endLine;
RenderArena* arena = renderArena();
while (line) {
InlineRunBox* next = line->nextLineBox();
if (!next)
- repaintRect.setHeight(kMax(m_overflowHeight, line->bottomOverflow()) - repaintRect.y());
+ repaintRect.setHeight(max(m_overflowHeight, line->bottomOverflow()) - repaintRect.y());
line->deleteLine(arena);
line = next;
}
m_height += toAdd;
// Always make sure this is at least our height.
- m_overflowHeight = kMax(m_height, m_overflowHeight);
+ m_overflowHeight = max(m_height, m_overflowHeight);
// See if any lines spill out of the block. If so, we need to update our overflow width.
checkLinesForOverflow();
if (useRepaintRect) {
repaintRect.setX(m_overflowLeft);
- repaintRect.setWidth(kMax((int)m_width, m_overflowWidth) - m_overflowLeft);
+ repaintRect.setWidth(max((int)m_width, m_overflowWidth) - m_overflowLeft);
if (repaintRect.height() == 0)
- repaintRect.setHeight(kMax(oldLineBottom, m_overflowHeight) - repaintRect.y());
+ repaintRect.setHeight(max(oldLineBottom, m_overflowHeight) - repaintRect.y());
}
if (!firstLineBox() && element() && element()->isContentEditable() && element()->rootEditableElement() == element())
// and factor that in somehow.
m_overflowWidth = m_width;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
- m_overflowLeft = kMin(curr->leftOverflow(), m_overflowLeft);
- m_overflowTop = kMin(curr->topOverflow(), m_overflowTop);
- m_overflowWidth = kMax(curr->rightOverflow(), m_overflowWidth);
- m_overflowHeight = kMax(curr->bottomOverflow(), m_overflowHeight);
+ m_overflowLeft = min(curr->leftOverflow(), m_overflowLeft);
+ m_overflowTop = min(curr->topOverflow(), m_overflowTop);
+ m_overflowWidth = max(curr->rightOverflow(), m_overflowWidth);
+ m_overflowHeight = max(curr->bottomOverflow(), m_overflowHeight);
}
}
#include "PlatformMouseEvent.h"
#include "dom2_eventsimpl.h"
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
void RenderLineEdit::setSelectionStart(int start)
{
- int realStart = kMax(start, 0);
- int length = kMax(selectionEnd() - realStart, 0);
+ int realStart = max(start, 0);
+ int length = max(selectionEnd() - realStart, 0);
static_cast<QLineEdit *>(m_widget)->setSelection(realStart, length);
}
void RenderLineEdit::setSelectionEnd(int end)
{
int start = selectionStart();
- int realEnd = kMax(end, 0);
+ int realEnd = max(end, 0);
int length = realEnd - start;
if (length < 0) {
start = realEnd;
void RenderLineEdit::setSelectionRange(int start, int end)
{
- int realStart = kMax(start, 0);
- int length = kMax(end - realStart, 0);
+ int realStart = max(start, 0);
+ int length = max(end - realStart, 0);
static_cast<QLineEdit *>(m_widget)->setSelection(realStart, length);
}
xPos = m_width - paddingRight() - borderRight() - legend->width() - legend->marginRight();
int b = borderTop();
int h = legend->height();
- legend->setPos(xPos, kMax((b-h)/2, 0));
- m_height = kMax(b,h) + paddingTop();
+ legend->setPos(xPos, max((b-h)/2, 0));
+ m_height = max(b,h) + paddingTop();
}
return legend;
}
h -= yOff;
_ty += yOff - borderTopExtra();
- int my = kMax(_ty, i.r.y());
- int end = kMin(i.r.bottom(), _ty + h);
+ int my = max(_ty, i.r.y());
+ int end = min(i.r.bottom(), _ty + h);
int mh = end - my;
paintBackground(i.p, style()->backgroundColor(), style()->backgroundLayers(), my, mh, _tx, _ty, w, h);
int size = m_size;
// check if multiple and size was not given or invalid
- // Internet Exploder sets size to kMin(number of elements, 4)
+ // Internet Exploder sets size to min(number of elements, 4)
// Netscape seems to simply set it to "number of elements"
- // the average of that is IMHO kMin(number of elements, 10)
+ // the average of that is IMHO min(number of elements, 10)
// so I did that ;-)
if(size < 1)
- size = kMin(static_cast<QListBox*>(m_widget)->count(), 10U);
+ size = min(static_cast<QListBox*>(m_widget)->count(), 10U);
// Let the widget tell us how big it wants to be.
IntSize s(w->sizeForNumberOfLines(size));
KHTMLAssert( !minMaxKnown() );
QTextEdit* w = static_cast<QTextEdit*>(m_widget);
- IntSize size(w->sizeWithColumnsAndRows(kMax(element()->cols(), 1), kMax(element()->rows(), 1)));
+ IntSize size(w->sizeWithColumnsAndRows(max(element()->cols(), 1), max(element()->rows(), 1)));
setIntrinsicWidth( size.width() );
setIntrinsicHeight( size.height() );
void RenderSlider::updateFromElement()
{
String value = element()->value();
- const AtomicString& min = element()->getAttribute(minAttr);
- const AtomicString& max = element()->getAttribute(maxAttr);
+ const AtomicString& minStr = element()->getAttribute(minAttr);
+ const AtomicString& maxStr = element()->getAttribute(maxAttr);
const AtomicString& precision = element()->getAttribute(precisionAttr);
- double minVal = min.isNull() ? 0.0 : min.deprecatedString().toDouble();
- double maxVal = max.isNull() ? 100.0 : max.deprecatedString().toDouble();
- minVal = kMin(minVal, maxVal); // Make sure the range is sane.
+ double minVal = minStr.isNull() ? 0.0 : minStr.deprecatedString().toDouble();
+ double maxVal = maxStr.isNull() ? 100.0 : maxStr.deprecatedString().toDouble();
+ minVal = min(minVal, maxVal); // Make sure the range is sane.
double val = value.isNull() ? (maxVal + minVal)/2.0 : value.deprecatedString().toDouble();
- val = kMax(minVal, kMin(val, maxVal)); // Make sure val is within min/max.
+ val = max(minVal, min(val, maxVal)); // Make sure val is within min/max.
// Force integer value if not float.
if (!equalIgnoringCase(precision, "float"))
// Count the total length of all of the fixed columns/rows -> totalFixed
// Count the number of columns/rows which are fixed -> countFixed
if (grid[i].isFixed()) {
- gridLayout[i] = kMax(grid[i].value(), 0);
+ gridLayout[i] = max(grid[i].value(), 0);
totalFixed += gridLayout[i];
countFixed++;
}
// Count the total percentage of all of the percentage columns/rows -> totalPercent
// Count the number of columns/rows which are percentages -> countPercent
if (grid[i].isPercent()) {
- gridLayout[i] = kMax(grid[i].calcValue(availableLen[k]), 0);
+ gridLayout[i] = max(grid[i].calcValue(availableLen[k]), 0);
totalPercent += gridLayout[i];
countPercent++;
}
// Count the total relative of all the relative columns/rows -> totalRelative
// Count the number of columns/rows which are relative -> countRelative
if (grid[i].isRelative()) {
- totalRelative += kMax(grid[i].value(), 1);
+ totalRelative += max(grid[i].value(), 1);
countRelative++;
}
}
for (int i = 0; i < gridLen; ++i) {
if (grid[i].isRelative()) {
- gridLayout[i] = (kMax(grid[i].value(), 1) * remainingRelative) / totalRelative;
+ gridLayout[i] = (max(grid[i].value(), 1) * remainingRelative) / totalRelative;
remainingLen[k] -= gridLayout[i];
lastRelative = i;
}
#include "render_list.h"
#include <assert.h>
+using namespace std;
+
namespace WebCore {
#ifndef NDEBUG
{
// Set our x position.
setXPos(x);
- leftPosition = kMin(x, leftPosition);
+ leftPosition = min(x, leftPosition);
int startX = x;
x += borderLeft() + paddingLeft();
int shadowLeft = 0;
int shadowRight = 0;
for (ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next) {
- shadowLeft = kMin(shadowLeft, shadow->x - shadow->blur);
- shadowRight = kMax(shadowRight, shadow->x + shadow->blur);
+ shadowLeft = min(shadowLeft, shadow->x - shadow->blur);
+ shadowRight = max(shadowRight, shadow->x + shadow->blur);
}
- leftPosition = kMin(x + shadowLeft, leftPosition);
- rightPosition = kMax(x + text->width() + shadowRight, rightPosition);
- m_maxHorizontalShadow = kMax(kMax(shadowRight, -shadowLeft), m_maxHorizontalShadow);
+ leftPosition = min(x + shadowLeft, leftPosition);
+ rightPosition = max(x + text->width() + shadowRight, rightPosition);
+ m_maxHorizontalShadow = max(max(shadowRight, -shadowLeft), m_maxHorizontalShadow);
x += text->width();
} else {
if (curr->object()->isPositioned()) {
} else if (!curr->object()->isCompact() && (!curr->object()->isListMarker() || static_cast<RenderListMarker*>(curr->object())->isInside())) {
x += curr->object()->marginLeft();
curr->setXPos(x);
- leftPosition = kMin(x, leftPosition);
- rightPosition = kMax(x + curr->width(), rightPosition);
+ leftPosition = min(x, leftPosition);
+ rightPosition = max(x + curr->width(), rightPosition);
x += curr->width() + curr->object()->marginRight();
}
}
x += borderRight() + paddingRight();
setWidth(x-startX);
- rightPosition = kMax(xPos() + width(), rightPosition);
+ rightPosition = max(xPos() + width(), rightPosition);
return x;
}
computeLogicalBoxHeights(maxPositionTop, maxPositionBottom, maxAscent, maxDescent, strictMode);
- if (maxAscent + maxDescent < kMax(maxPositionTop, maxPositionBottom))
+ if (maxAscent + maxDescent < max(maxPositionTop, maxPositionBottom))
adjustMaxAscentAndDescent(maxAscent, maxDescent, maxPositionTop, maxPositionBottom);
int maxHeight = maxAscent + maxDescent;
maxAscent = curr->height() - maxDescent;
}
- if (maxAscent + maxDescent >= kMax(maxPositionTop, maxPositionBottom))
+ if (maxAscent + maxDescent >= max(maxPositionTop, maxPositionBottom))
break;
}
newY += curr->baseline() - newBaseline;
newHeight = newBaseline + font.descent();
for (ShadowData* shadow = curr->object()->style()->textShadow(); shadow; shadow = shadow->next) {
- overflowTop = kMin(overflowTop, shadow->y - shadow->blur);
- overflowBottom = kMax(overflowBottom, shadow->y + shadow->blur);
+ overflowTop = min(overflowTop, shadow->y - shadow->blur);
+ overflowBottom = max(overflowBottom, shadow->y + shadow->blur);
}
if (curr->isInlineFlowBox()) {
newHeight += curr->object()->borderTop() + curr->object()->paddingTop() +
curr->setBaseline(newBaseline);
if (childAffectsTopBottomPos) {
- selectionTop = kMin(selectionTop, newY);
- selectionBottom = kMax(selectionBottom, newY + newHeight);
- topPosition = kMin(topPosition, newY + overflowTop);
- bottomPosition = kMax(bottomPosition, newY + newHeight + overflowBottom);
+ selectionTop = min(selectionTop, newY);
+ selectionBottom = max(selectionBottom, newY + newHeight);
+ topPosition = min(topPosition, newY + overflowTop);
+ bottomPosition = max(bottomPosition, newY + newHeight + overflowBottom);
}
}
setYPos(yPos() + baseline() - font.ascent());
setBaseline(font.ascent());
if (hasTextChildren() || strictMode) {
- selectionTop = kMin(selectionTop, yPos());
- selectionBottom = kMax(selectionBottom, yPos() + height());
+ selectionTop = min(selectionTop, yPos());
+ selectionBottom = max(selectionBottom, yPos() + height());
}
}
}
int w = width();
int h = height();
- int my = kMax(_ty, i.r.y());
+ int my = max(_ty, i.r.y());
int mh;
if (_ty < i.r.y())
- mh = kMax(0, h - (i.r.y() - _ty));
+ mh = max(0, h - (i.r.y() - _ty));
else
- mh = kMin(i.r.height(), h);
+ mh = min(i.r.height(), h);
GraphicsContext* p = i.p;
int selectionTop();
int selectionBottom() { return m_selectionBottom; }
- int selectionHeight() { return kMax(0, selectionBottom() - selectionTop()); }
+ int selectionHeight() { return max(0, selectionBottom() - selectionTop()); }
InlineBox* closestLeafChildForXPos(int _x, int _tx);
#include "RenderCanvas.h"
#include "html_listimpl.h"
+using namespace std;
+
namespace WebCore {
using namespace HTMLNames;
m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
if (markerXPos < root->leftOverflow()) {
root->setHorizontalOverflowPositions(markerXPos, root->rightOverflow());
- m_overflowLeft = kMin(markerXPos, m_overflowLeft);
+ m_overflowLeft = min(markerXPos, m_overflowLeft);
}
} else {
int rightLineOffset = rightRelOffset(yOffset, rightOffset(yOffset));
m_marker->inlineBoxWrapper()->adjustPosition(markerXPos - markerOldX, 0);
if (markerXPos + m_marker->width() > root->rightOverflow()) {
root->setHorizontalOverflowPositions(root->leftOverflow(), markerXPos + m_marker->width());
- m_overflowWidth = kMax(markerXPos + m_marker->width(), m_overflowLeft);
+ m_overflowWidth = max(markerXPos + m_marker->width(), m_overflowLeft);
}
}
}
#include "RenderCanvas.h"
#include "dom2_eventsimpl.h"
+using namespace std;
+
namespace WebCore {
using namespace EventNames;
if (isSelected() && m_inlineBoxWrapper) {
int selTop = _ty + m_inlineBoxWrapper->root()->selectionTop();
int selBottom = _ty + selTop + m_inlineBoxWrapper->root()->selectionHeight();
- top = kMin(selTop, top);
- bottom = kMax(selBottom, bottom);
+ top = min(selTop, top);
+ bottom = max(selBottom, bottom);
}
int os = 2*maximalOutlineSize(i.phase);
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+
#include "config.h"
#include "table_layout.h"
+
#include "RenderTable.h"
#include "RenderTableCol.h"
#include "RenderTableSection.h"
*/
+using namespace std;
+
namespace WebCore {
FixedTableLayout::FixedTableLayout( RenderTable *table )
// only need to calculate the minimum width as the sum of the
// cols/cells with a fixed width.
//
- // The maximum width is kMax( minWidth, tableWidth ).
+ // The maximum width is max( minWidth, tableWidth ).
int bs = table->bordersPaddingAndSpacing();
int tableWidth = table->style()->width().isFixed() ? table->style()->width().value() - bs : 0;
int mw = calcWidthArray( tableWidth ) + bs;
- table->m_minWidth = kMax( mw, tableWidth );
+ table->m_minWidth = max( mw, tableWidth );
table->m_maxWidth = table->m_minWidth;
}
if (cell && cell->colSpan() == 1) {
// A cell originates in this column. Ensure we have
// a min/max width of at least 1px for this column now.
- l.minWidth = kMax(l.minWidth, 1);
- l.maxWidth = kMax(l.maxWidth, 1);
+ l.minWidth = max(l.minWidth, 1);
+ l.maxWidth = max(l.maxWidth, 1);
if (!cell->minMaxKnown())
cell->calcMinMaxWidth();
if (cell->minWidth() > l.minWidth)
if (cell && (!effCol || section->cellAt(i, effCol-1).cell != cell)) {
// This spanning cell originates in this column. Ensure we have
// a min/max width of at least 1px for this column now.
- l.minWidth = kMax(l.minWidth, 1);
- l.maxWidth = kMax(l.maxWidth, 1);
+ l.minWidth = max(l.minWidth, 1);
+ l.maxWidth = max(l.maxWidth, 1);
insertSpanCell( cell );
}
last = cell;
}
}
- l.maxWidth = kMax(l.maxWidth, l.minWidth);
+ l.maxWidth = max(l.maxWidth, l.minWidth);
#ifdef DEBUG_LAYOUT
qDebug("col %d, final min=%d, max=%d, width=%d(%d)", effCol, l.minWidth, l.maxWidth, l.width.value, l.width.type );
#endif
minWidth += layoutStruct[i].effMinWidth;
maxWidth += layoutStruct[i].effMaxWidth;
if ( layoutStruct[i].effWidth.isPercent() ) {
- int percent = kMin(layoutStruct[i].effWidth.value(), remainingPercent);
- int pw = ( layoutStruct[i].effMaxWidth * 100) / kMax(percent, 1);
+ int percent = min(layoutStruct[i].effWidth.value(), remainingPercent);
+ int pw = ( layoutStruct[i].effMaxWidth * 100) / max(percent, 1);
remainingPercent -= percent;
- maxPercent = kMax( pw, maxPercent );
+ maxPercent = max( pw, maxPercent );
} else {
maxNonPercent += layoutStruct[i].effMaxWidth;
}
}
if (shouldScaleColumns(table)) {
- maxNonPercent = (maxNonPercent * 100 + 50) / kMax(remainingPercent, 1);
- maxWidth = kMax( maxNonPercent, maxWidth );
- maxWidth = kMax( maxWidth, maxPercent );
+ maxNonPercent = (maxNonPercent * 100 + 50) / max(remainingPercent, 1);
+ maxWidth = max( maxNonPercent, maxWidth );
+ maxWidth = max( maxWidth, maxPercent );
}
- maxWidth = kMax( maxWidth, spanMaxWidth );
+ maxWidth = max( maxWidth, spanMaxWidth );
int bs = table->bordersPaddingAndSpacing();
minWidth += bs;
Length tw = table->style()->width();
if ( tw.isFixed() && tw.value() > 0 ) {
- minWidth = kMax(minWidth, tw.value());
+ minWidth = max(minWidth, tw.value());
maxWidth = minWidth;
}
// can't satify this condition, treat as variable
w = Length();
} else {
- int spanMax = kMax( maxWidth, cMaxWidth );
+ int spanMax = max( maxWidth, cMaxWidth );
#ifdef DEBUG_LAYOUT
qDebug(" adjusting tMaxWidth (%d): spanMax=%d, value=%d, totalPercent=%d", tMaxWidth, spanMax, w.value, totalPercent );
#endif
- tMaxWidth = kMax( tMaxWidth, spanMax * 100 / w.value() );
+ tMaxWidth = max( tMaxWidth, spanMax * 100 / w.value() );
// all non percent columns in the span get percent vlaues to sum up correctly.
int percentMissing = w.value() - totalPercent;
qDebug("extending minWidth of cols %d-%d to %dpx currentMin=%d accroding to fixed sum %d", col, lastCol-1, cMinWidth, minWidth, fixedWidth );
#endif
for ( unsigned int pos = col; fixedWidth > 0 && pos < lastCol; pos++ ) {
- int w = kMax( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].width.value() / fixedWidth );
+ int w = max( layoutStruct[pos].effMinWidth, cMinWidth * layoutStruct[pos].width.value() / fixedWidth );
#ifdef DEBUG_LAYOUT
qDebug(" col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
#endif
// Give min to variable first, to fixed second, and to others third.
for ( unsigned int pos = col; maxw >= 0 && pos < lastCol; pos++ ) {
if ( layoutStruct[pos].width.isFixed() && haveAuto && fixedWidth <= cMinWidth ) {
- int w = kMax( layoutStruct[pos].effMinWidth, layoutStruct[pos].width.value() );
+ int w = max( layoutStruct[pos].effMinWidth, layoutStruct[pos].width.value() );
fixedWidth -= layoutStruct[pos].width.value();
minw -= layoutStruct[pos].effMinWidth;
#ifdef DEBUG_LAYOUT
for ( unsigned int pos = col; maxw >= 0 && pos < lastCol && minw < cMinWidth; pos++ ) {
if ( !(layoutStruct[pos].width.isFixed() && haveAuto && fixedWidth <= cMinWidth) ) {
- int w = kMax( layoutStruct[pos].effMinWidth, maxw ? (cMinWidth * layoutStruct[pos].effMaxWidth / maxw) : cMinWidth );
- w = kMin(layoutStruct[pos].effMinWidth+(cMinWidth-minw), w);
+ int w = max( layoutStruct[pos].effMinWidth, maxw ? (cMinWidth * layoutStruct[pos].effMaxWidth / maxw) : cMinWidth );
+ w = min(layoutStruct[pos].effMinWidth+(cMinWidth-minw), w);
#ifdef DEBUG_LAYOUT
qDebug(" col %d: min=%d, effMin=%d, new=%d", pos, layoutStruct[pos].effMinWidth, layoutStruct[pos].effMinWidth, w );
qDebug("extending maxWidth of cols %d-%d to %dpx", col, lastCol-1, cMaxWidth );
#endif
for ( unsigned int pos = col; maxWidth >= 0 && pos < lastCol; pos++ ) {
- int w = kMax( layoutStruct[pos].effMaxWidth, maxWidth ? (cMaxWidth * layoutStruct[pos].effMaxWidth / maxWidth) : cMaxWidth );
+ int w = max( layoutStruct[pos].effMaxWidth, maxWidth ? (cMaxWidth * layoutStruct[pos].effMaxWidth / maxWidth) : cMaxWidth );
#ifdef DEBUG_LAYOUT
qDebug(" col %d: max=%d, effMax=%d, new=%d", pos, layoutStruct[pos].effMaxWidth, layoutStruct[pos].effMaxWidth, w );
#endif
}
} else {
for (unsigned int pos = col; pos < lastCol; pos++)
- layoutStruct[pos].maxWidth = kMax(layoutStruct[pos].maxWidth, layoutStruct[pos].minWidth );
+ layoutStruct[pos].maxWidth = max(layoutStruct[pos].maxWidth, layoutStruct[pos].minWidth );
}
}
effWidthDirty = false;
for ( int i = 0; i < nEffCols; i++ ) {
Length &width = layoutStruct[i].effWidth;
if ( width.isPercent() ) {
- int w = kMax(int(layoutStruct[i].effMinWidth), width.calcMinValue(tableWidth));
+ int w = max(int(layoutStruct[i].effMinWidth), width.calcMinValue(tableWidth));
available += layoutStruct[i].calcWidth - w;
layoutStruct[i].calcWidth = w;
}
for ( int i = nEffCols-1; i >= 0; i-- ) {
if ( layoutStruct[i].effWidth.isPercent() ) {
int w = layoutStruct[i].calcWidth;
- int reduction = kMin( w, excess );
+ int reduction = min( w, excess );
// the lines below might look inconsistent, but that's the way it's handled in mozilla
excess -= reduction;
- int newWidth = kMax( int (layoutStruct[i].effMinWidth), w - reduction );
+ int newWidth = max( int (layoutStruct[i].effMinWidth), w - reduction );
available += w - newWidth;
layoutStruct[i].calcWidth = newWidth;
}
for ( int i = 0; i < nEffCols; i++ ) {
Length &width = layoutStruct[i].effWidth;
if ( width.isAuto() && totalAuto != 0 ) {
- int w = kMax(int(layoutStruct[i].calcWidth), available * layoutStruct[i].effMaxWidth / totalAuto);
+ int w = max(int(layoutStruct[i].calcWidth), available * layoutStruct[i].effMaxWidth / totalAuto);
available -= w;
totalAuto -= layoutStruct[i].effMaxWidth;
layoutStruct[i].calcWidth = w;